コンテンツにスキップ

buildSettlementPaymentCalls

このコンテンツはまだ日本語訳がありません。

buildSettlementPaymentCalls(params): readonly [SettlementCall, SettlementCall]

Defined in: src/settlement/settle-order.ts:133

The two calls a Settlement payment consists of, in order: [token.approve(settlement, amount), settlement.pay(token, merchant, amount, validUntil, details)].

settleOrder sends exactly this. It is exported so that the shape has ONE definition: anything that has to recognise a payment — a sponsorship policy deciding whether to pay for a UserOp’s gas, for instance — can build the expected calls with it instead of restating them.

A session key’s call policy bounds each call, not how many there are: a batch carrying two pay calls passes it. Holding a UserOp to ONE payment is the sponsor’s job, and this is its template.

Parameters

params

BuildSettlementPaymentCallsParams

Returns

readonly [SettlementCall, SettlementCall]

Example

import { buildSettlementPaymentCalls } from "kawasekit";
const [approve, pay] = buildSettlementPaymentCalls({ settlement, token, merchant, amount, validUntil, details });