settlementAbi
このコンテンツはまだ日本語訳がありません。
constsettlementAbi: readonly [{inputs: readonly [{name:"token";type:"address"; }, {name:"merchant";type:"address"; }, {name:"amount";type:"uint256"; }, {name:"validUntil";type:"uint64"; }, {name:"details";type:"bytes32"; }];name:"pay";outputs: readonly [];stateMutability:"nonpayable";type:"function"; }, {inputs: readonly [{name:"token";type:"address"; }, {name:"payer";type:"address"; }, {name:"merchant";type:"address"; }, {name:"amount";type:"uint256"; }, {name:"validUntil";type:"uint64"; }, {name:"details";type:"bytes32"; }];name:"orderRef";outputs: readonly [{name:"";type:"bytes32"; }];stateMutability:"view";type:"function"; }, {inputs: readonly [{name:"ref";type:"bytes32"; }];name:"settled";outputs: readonly [{name:"";type:"bool"; }];stateMutability:"view";type:"function"; }, {inputs: readonly [{indexed:true;name:"ref";type:"bytes32"; }, {indexed:true;name:"payer";type:"address"; }, {indexed:true;name:"merchant";type:"address"; }, {indexed:false;name:"token";type:"address"; }, {indexed:false;name:"amount";type:"uint256"; }];name:"Settled";type:"event"; }, {inputs: readonly [];name:"ZeroAmount";type:"error"; }, {inputs: readonly [{name:"validUntil";type:"uint64"; }];name:"Expired";type:"error"; }, {inputs: readonly [{name:"ref";type:"bytes32"; }];name:"AlreadySettled";type:"error"; }]
Defined in: src/settlement/abi.ts:31
ABI of Settlement v1.
pay— moveamountoftokenfrom the caller tomerchant, settling one order. The caller must have approved the contract foramount; a smart account does both in one UserOp.orderRef— the order reference for these fields, as the contract computes it.settled—trueonce the order with that reference has been paid.Settled— the single fact a payment leaves behind;refis indexed, so a payment can be found by its reference alone.AlreadySettled(ref)/Expired(validUntil)/ZeroAmount()— whypayrefused.
Example
import { getSettlementAddress, polygonAmoy, settlementAbi } from "kawasekit";
const paid = await publicClient.readContract({ address: getSettlementAddress(polygonAmoy.id), abi: settlementAbi, functionName: "settled", args: [ref],});