mppx 0.17.1 → 0.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/dist/Errors.d.ts +94 -0
- package/dist/Errors.js +83 -0
- package/dist/Store.d.ts +413 -0
- package/dist/Store.js +837 -0
- package/dist/cli/cli.js +141 -136
- package/dist/cli/internal.js +28 -6
- package/dist/cli/plugins/index.js +16 -11
- package/dist/cli/sessions/Manager.js +12 -1
- package/dist/cli/utils.d.ts +2 -0
- package/dist/cli/utils.js +6 -0
- package/dist/cli/validate/challenge.d.ts +4 -0
- package/dist/cli/validate/challenge.js +9 -6
- package/dist/client/Mppx.d.ts +1 -1
- package/dist/client/Mppx.js +7 -3
- package/dist/client/internal/Fetch.d.ts +1 -1
- package/dist/client/internal/Fetch.js +9 -0
- package/dist/client/internal/MethodResponse.d.ts +8 -0
- package/dist/client/internal/MethodResponse.js +9 -0
- package/dist/client/internal/ProofRealm.d.ts +3 -3
- package/dist/client/internal/ProofRealm.js +4 -4
- package/dist/client/internal/protocols/Mcp.d.ts +4 -0
- package/dist/client/internal/protocols/Mcp.js +27 -14
- package/dist/cloudflare/ChannelStore.d.ts +97 -0
- package/dist/cloudflare/ChannelStore.js +304 -0
- package/dist/cloudflare/Channels.d.ts +92 -0
- package/dist/cloudflare/Channels.js +325 -0
- package/dist/cloudflare/index.d.ts +5 -0
- package/dist/cloudflare/index.js +5 -0
- package/dist/identity/Client.js +7 -1
- package/dist/internal/sse.d.ts +21 -0
- package/dist/internal/sse.js +82 -0
- package/dist/internal/version.d.ts +2 -2
- package/dist/internal/version.js +1 -1
- package/dist/mcp/client/McpClient.d.ts +2 -2
- package/dist/mcp/client/McpClient.js +5 -2
- package/dist/proxy/Proxy.d.ts +2 -0
- package/dist/proxy/Proxy.js +31 -6
- package/dist/proxy/internal/Replay.js +1 -1
- package/dist/server/Mppx.js +5 -4
- package/dist/server/Transport.js +1 -1
- package/dist/server/internal/html/config.d.ts +7 -1
- package/dist/server/internal/html/config.js +4 -0
- package/dist/stripe/internal/types.d.ts +82 -6
- package/dist/stripe/server/Charge.js +1 -2
- package/dist/stripe/server/Methods.d.ts +2 -0
- package/dist/stripe/server/Methods.js +2 -1
- package/dist/stripe/server/internal/html.gen.js +1 -1
- package/dist/stripe/server/internal/record-payment.d.ts +49 -0
- package/dist/stripe/server/internal/record-payment.js +75 -18
- package/dist/tempo/Methods.d.ts +8 -0
- package/dist/tempo/Methods.js +18 -2
- package/dist/tempo/client/Charge.d.ts +32 -1
- package/dist/tempo/client/Charge.js +201 -3
- package/dist/tempo/client/Methods.d.ts +16 -0
- package/dist/tempo/internal/fee-payer.d.ts +64 -14
- package/dist/tempo/internal/fee-payer.js +231 -20
- package/dist/tempo/internal/zone.d.ts +79 -0
- package/dist/tempo/internal/zone.js +133 -0
- package/dist/tempo/legacy/session/Chain.js +2 -0
- package/dist/tempo/server/Charge.d.ts +7 -3
- package/dist/tempo/server/Charge.js +100 -6
- package/dist/tempo/server/Methods.d.ts +40 -0
- package/dist/tempo/server/Subscription.js +1 -0
- package/dist/tempo/server/internal/html.gen.js +1 -1
- package/dist/tempo/server/internal/transport.d.ts +6 -0
- package/dist/tempo/server/internal/transport.js +21 -21
- package/dist/tempo/session/client/ChannelStore.d.ts +2 -0
- package/dist/tempo/session/client/CredentialState.js +2 -0
- package/dist/tempo/session/client/Session.d.ts +11 -1
- package/dist/tempo/session/client/Session.js +39 -6
- package/dist/tempo/session/client/SessionManager.d.ts +1 -1
- package/dist/tempo/session/client/SessionManager.js +8 -4
- package/dist/tempo/session/client/Transports.d.ts +2 -0
- package/dist/tempo/session/client/Transports.js +4 -1
- package/dist/tempo/session/precompile/Chain.js +1 -0
- package/dist/tempo/session/server/ChannelStore.d.ts +14 -0
- package/dist/tempo/session/server/ChannelStore.js +10 -3
- package/dist/tempo/session/server/CredentialVerification.js +1 -1
- package/dist/tempo/session/server/MeteredStream.d.ts +4 -0
- package/dist/tempo/session/server/MeteredStream.js +6 -1
- package/dist/tempo/session/server/Sse.d.ts +59 -0
- package/dist/tempo/session/server/Sse.js +175 -10
- package/dist/validation/core.js +2 -0
- package/dist/zod.d.ts +2 -1
- package/dist/zod.js +1 -1
- package/package.json +5 -3
- package/dist/stripe/server/internal/html/types.d.ts +0 -2
- package/dist/stripe/server/internal/html/types.js +0 -2
|
@@ -3,7 +3,7 @@ import { decodeFunctionData, formatUnits, keccak256, parseEventLogs, WaitForTran
|
|
|
3
3
|
import { getTransaction, getTransactionReceipt, sendRawTransaction, sendRawTransactionSync, signTransaction, verifyTypedData, waitForTransactionReceipt, call as viem_call, } from 'viem/actions';
|
|
4
4
|
import { Abis, Actions, Transaction } from 'viem/tempo';
|
|
5
5
|
import { tempo as tempo_chain } from 'viem/tempo/chains';
|
|
6
|
-
import { CredentialReplayedError, PaymentError, VerificationFailedError } from '../../Errors.js';
|
|
6
|
+
import { BroadcastOutcomeUnknownError, CredentialReplayedError, PaymentError, VerificationFailedError, } from '../../Errors.js';
|
|
7
7
|
import * as Expires from '../../Expires.js';
|
|
8
8
|
import * as Method from '../../Method.js';
|
|
9
9
|
import * as Store from '../../Store.js';
|
|
@@ -18,9 +18,9 @@ import { resolveFeeToken } from '../internal/fee-token.js';
|
|
|
18
18
|
import * as MachineTokenCharge from '../internal/machine-token-charge.js';
|
|
19
19
|
import * as Proof from '../internal/proof.js';
|
|
20
20
|
import * as Selectors from '../internal/selectors.js';
|
|
21
|
+
import * as Zone from '../internal/zone.js';
|
|
21
22
|
import * as Methods from '../Methods.js';
|
|
22
23
|
import { fallbackStore } from './internal/fallback-store.js';
|
|
23
|
-
import { html as htmlContent } from './internal/html.gen.js';
|
|
24
24
|
import * as Relay from './Relay.js';
|
|
25
25
|
import * as SponsorBudget from './SponsorBudget.js';
|
|
26
26
|
/**
|
|
@@ -34,7 +34,7 @@ import * as SponsorBudget from './SponsorBudget.js';
|
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
36
|
export function charge(parameters = {}) {
|
|
37
|
-
const { machineTokenEnabled, allowedFeeTokens: configuredAllowedFeeTokens, amount, confirmationTimeoutMs = 30_000, currency = defaults.resolveCurrency(parameters), decimals = defaults.decimals, description, externalId, feeToken: configuredFeeToken, feePayerPolicy, html, relay, sponsorBudget, splits, supportedModes, validateSender, waitForConfirmation = true, } = parameters;
|
|
37
|
+
const { machineTokenEnabled, allowedFeeTokens: configuredAllowedFeeTokens, amount, confirmationTimeoutMs = 30_000, currency = defaults.resolveCurrency(parameters), decimals = defaults.decimals, description, externalId, feeToken: configuredFeeToken, feePayerPolicy, html, relay, sponsorBudget, splits, supportedModes, validateSender, waitForConfirmation = true, zones, } = parameters;
|
|
38
38
|
if (configuredAllowedFeeTokens?.length === 0)
|
|
39
39
|
throw new Error('`allowedFeeTokens` must contain at least one token.');
|
|
40
40
|
const storeKeyPrefix = parameters.storeKeyPrefix ?? '';
|
|
@@ -188,6 +188,55 @@ export function charge(parameters = {}) {
|
|
|
188
188
|
const payer = payers.size === 1 ? [...payers][0] : undefined;
|
|
189
189
|
return { payer, receipt, sender, transfers };
|
|
190
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Validates a payment that a Zone withdrawal settled on Tempo: the portal's
|
|
193
|
+
* `WithdrawalProcessed` event pays the recipient, and the withdrawal's memo in
|
|
194
|
+
* the `processWithdrawals` calldata binds it to this challenge.
|
|
195
|
+
*/
|
|
196
|
+
async function validateZoneCredential(payload, context) {
|
|
197
|
+
const { amount, challenge, client, currency, methodDetails, recipient, supportedModes } = context;
|
|
198
|
+
if (supportedModes && !supportedModes.includes('push'))
|
|
199
|
+
throw new MismatchError('Zone credentials are not supported for this challenge.', {});
|
|
200
|
+
if (!Zone.isAccepted(methodDetails?.zones, payload.zoneId))
|
|
201
|
+
throw new MismatchError('Zone is not accepted for this challenge.', {
|
|
202
|
+
zoneId: String(payload.zoneId),
|
|
203
|
+
});
|
|
204
|
+
if (methodDetails?.splits)
|
|
205
|
+
throw new MismatchError('Zone credentials do not support split payments.', {});
|
|
206
|
+
const portal = Zone.portalAddress(payload.zoneId);
|
|
207
|
+
const senderTag = payload.senderTag;
|
|
208
|
+
const hash = payload.hash;
|
|
209
|
+
const receipt = await getTransactionReceipt(client, { hash });
|
|
210
|
+
if (receipt.status !== 'success')
|
|
211
|
+
throw new MismatchError('Payment verification failed: settlement transaction reverted.', {
|
|
212
|
+
hash,
|
|
213
|
+
});
|
|
214
|
+
const event = Zone.findProcessedEvent(receipt, { portal, senderTag });
|
|
215
|
+
if (!event)
|
|
216
|
+
throw new MismatchError('Payment verification failed: Zone withdrawal not settled.', {
|
|
217
|
+
senderTag,
|
|
218
|
+
});
|
|
219
|
+
if (!event.callbackSuccess)
|
|
220
|
+
throw new MismatchError('Payment verification failed: Zone withdrawal bounced.', {
|
|
221
|
+
senderTag,
|
|
222
|
+
});
|
|
223
|
+
// The event has no memo, so the calldata's withdrawal shows what was paid and for which challenge.
|
|
224
|
+
const transaction = await getTransaction(client, { hash });
|
|
225
|
+
const calls = transaction.calls ??
|
|
226
|
+
(transaction.to ? [{ to: transaction.to, data: transaction.input }] : []);
|
|
227
|
+
const withdrawal = Zone.findWithdrawal(calls, { portal, senderTag });
|
|
228
|
+
if (!withdrawal ||
|
|
229
|
+
withdrawal.gasLimit !== 0n ||
|
|
230
|
+
!TempoAddress.isEqual(withdrawal.to, recipient) ||
|
|
231
|
+
!TempoAddress.isEqual(withdrawal.token, currency) ||
|
|
232
|
+
withdrawal.amount.toString() !== amount)
|
|
233
|
+
throw new MismatchError('Payment verification failed: Zone withdrawal not found.', {
|
|
234
|
+
senderTag,
|
|
235
|
+
});
|
|
236
|
+
if (!isChallengeBound([withdrawal.memo], { challengeId: challenge.id, realm: challenge.realm }))
|
|
237
|
+
throw new CredentialReplayedError({ reason: 'memo is not bound to this challenge' });
|
|
238
|
+
return { hash, portal, receipt, senderTag };
|
|
239
|
+
}
|
|
191
240
|
async function validateProofCredential(credential, payload, context) {
|
|
192
241
|
const { chainId, challenge, client, isZeroAmount } = context;
|
|
193
242
|
if (!isZeroAmount)
|
|
@@ -283,6 +332,18 @@ export function charge(parameters = {}) {
|
|
|
283
332
|
type: 'proof',
|
|
284
333
|
};
|
|
285
334
|
}
|
|
335
|
+
case 'zone': {
|
|
336
|
+
const { hash, portal, receipt, senderTag } = await validateZoneCredential(context.payload, context);
|
|
337
|
+
return {
|
|
338
|
+
details: { mode: 'push' },
|
|
339
|
+
hash,
|
|
340
|
+
payer: undefined,
|
|
341
|
+
portal,
|
|
342
|
+
receipt,
|
|
343
|
+
senderTag,
|
|
344
|
+
type: 'zone',
|
|
345
|
+
};
|
|
346
|
+
}
|
|
286
347
|
case 'transaction': {
|
|
287
348
|
const { fundingCurrency, isFeePayerTx, serializedTransaction, settlementSenders, transaction, transfers, } = await validateTransactionCredential(credential, context.payload, request, context);
|
|
288
349
|
return {
|
|
@@ -317,12 +378,13 @@ export function charge(parameters = {}) {
|
|
|
317
378
|
recipient,
|
|
318
379
|
splits,
|
|
319
380
|
supportedModes,
|
|
381
|
+
zones,
|
|
320
382
|
},
|
|
321
383
|
stableBinding: chargeBinding,
|
|
322
384
|
html: html
|
|
323
385
|
? {
|
|
324
386
|
config: {},
|
|
325
|
-
content:
|
|
387
|
+
content: async () => (await import('./internal/html.gen.js')).html,
|
|
326
388
|
formatAmount: async (request) => {
|
|
327
389
|
try {
|
|
328
390
|
const chainId = request.methodDetails?.chainId;
|
|
@@ -451,6 +513,15 @@ export function charge(parameters = {}) {
|
|
|
451
513
|
}
|
|
452
514
|
return toReceipt(receipt.transactionHash, fundingCurrency);
|
|
453
515
|
}
|
|
516
|
+
case 'zone': {
|
|
517
|
+
const { portal, receipt, senderTag } = validated;
|
|
518
|
+
if (!(await tryClaimZoneWithdrawal(store, portal, senderTag, replayExpires))) {
|
|
519
|
+
throw new CredentialReplayedError({
|
|
520
|
+
reason: 'Zone withdrawal has already been used',
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
return toReceipt(receipt.transactionHash);
|
|
524
|
+
}
|
|
454
525
|
case 'proof': {
|
|
455
526
|
if (proofStore && !(await tryClaimProof(proofStore, challenge.id, replayExpires))) {
|
|
456
527
|
throw new CredentialReplayedError({
|
|
@@ -481,6 +552,7 @@ export function charge(parameters = {}) {
|
|
|
481
552
|
if (feePayerAccount && methodDetails?.feePayer !== false) {
|
|
482
553
|
const selectableFeeTokens = allowedFeeTokens ?? FeePayer.defaultAllowedFeeTokens(chainId);
|
|
483
554
|
const completed = await FeePayer.preflightSponsorship({
|
|
555
|
+
policy: transactionFeePayerPolicy,
|
|
484
556
|
transaction,
|
|
485
557
|
simulate: (request) => viem_call(client, request),
|
|
486
558
|
async complete() {
|
|
@@ -639,7 +711,11 @@ export function charge(parameters = {}) {
|
|
|
639
711
|
if (!recovered && validUntil < deadline)
|
|
640
712
|
recovered = await withDeadline(getTransactionReceipt(client, { hash: finalHash }), Math.max(deadline, Date.now() + client.pollingInterval), broadcastError).catch(() => undefined);
|
|
641
713
|
if (!recovered)
|
|
642
|
-
throw
|
|
714
|
+
throw new BroadcastOutcomeUnknownError({
|
|
715
|
+
cause: broadcastError,
|
|
716
|
+
transactionHash: finalHash,
|
|
717
|
+
validBefore: transaction.validBefore,
|
|
718
|
+
});
|
|
643
719
|
receipt = recovered;
|
|
644
720
|
}
|
|
645
721
|
if (reservation)
|
|
@@ -663,8 +739,18 @@ export function charge(parameters = {}) {
|
|
|
663
739
|
// Optimistic path: broadcast without waiting for confirmation
|
|
664
740
|
// (simulation above already ran). The returned receipt assumes
|
|
665
741
|
// success — callers opt in via waitForConfirmation: false.
|
|
742
|
+
const transactionHash = finalHash;
|
|
666
743
|
const reference = await sendRawTransaction(client, {
|
|
667
744
|
serializedTransaction: serializedTransaction_final,
|
|
745
|
+
}).catch((broadcastError) => {
|
|
746
|
+
// Without a receipt wait, an ambiguous failure leaves the outcome to the caller.
|
|
747
|
+
if (!isAmbiguousBroadcastError(broadcastError))
|
|
748
|
+
throw broadcastError;
|
|
749
|
+
throw new BroadcastOutcomeUnknownError({
|
|
750
|
+
cause: broadcastError,
|
|
751
|
+
transactionHash,
|
|
752
|
+
validBefore: transaction.validBefore,
|
|
753
|
+
});
|
|
668
754
|
});
|
|
669
755
|
if (reference.toLowerCase() !== finalHash.toLowerCase())
|
|
670
756
|
throw new VerificationFailedError({
|
|
@@ -711,7 +797,7 @@ function chargeBinding(request) {
|
|
|
711
797
|
// Exhaustively destructure so new charge request fields require an explicit binding decision.
|
|
712
798
|
const { amount, currency, description, externalId, methodDetails, recipient, ...requestRest } = request;
|
|
713
799
|
requestRest;
|
|
714
|
-
const { chainId, feePayer, machineTokenEnabled, splits, supportedModes, ...methodDetailsRest } = methodDetails ?? {};
|
|
800
|
+
const { chainId, feePayer, machineTokenEnabled, splits, supportedModes, zones, ...methodDetailsRest } = methodDetails ?? {};
|
|
715
801
|
methodDetailsRest;
|
|
716
802
|
void feePayer;
|
|
717
803
|
return {
|
|
@@ -724,6 +810,7 @@ function chargeBinding(request) {
|
|
|
724
810
|
recipient,
|
|
725
811
|
splits,
|
|
726
812
|
supportedModes,
|
|
813
|
+
zones,
|
|
727
814
|
};
|
|
728
815
|
}
|
|
729
816
|
function getExpectedTransfers(parameters) {
|
|
@@ -953,6 +1040,13 @@ function getHashStoreKey(hash) {
|
|
|
953
1040
|
function getProofStoreKey(challengeId) {
|
|
954
1041
|
return `mppx:charge:proof:${challengeId}`;
|
|
955
1042
|
}
|
|
1043
|
+
/** @internal */
|
|
1044
|
+
function getZoneWithdrawalStoreKey(portal, senderTag) {
|
|
1045
|
+
return `mppx:charge:zone:${portal.toLowerCase()}:${senderTag.toLowerCase()}`;
|
|
1046
|
+
}
|
|
1047
|
+
async function tryClaimZoneWithdrawal(store, portal, senderTag, expires) {
|
|
1048
|
+
return Store.tryClaim(store, getZoneWithdrawalStoreKey(portal, senderTag), expires);
|
|
1049
|
+
}
|
|
956
1050
|
async function tryClaimHash(store, hash, expires) {
|
|
957
1051
|
return Store.tryClaim(store, getHashStoreKey(hash), expires);
|
|
958
1052
|
}
|
|
@@ -51,6 +51,11 @@ export declare function tempo<const parameters extends tempo.Parameters>(paramet
|
|
|
51
51
|
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniObject<{
|
|
52
52
|
signature: import("zod/mini").ZodMiniString<string>;
|
|
53
53
|
type: import("zod/mini").ZodMiniLiteral<"proof">;
|
|
54
|
+
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniObject<{
|
|
55
|
+
hash: import("zod/mini").ZodMiniString<string>;
|
|
56
|
+
senderTag: import("zod/mini").ZodMiniString<string>;
|
|
57
|
+
type: import("zod/mini").ZodMiniLiteral<"zone">;
|
|
58
|
+
zoneId: import("zod/mini").ZodMiniNumber<number>;
|
|
54
59
|
}, import("zod/v4/core").$strip>], "type">;
|
|
55
60
|
};
|
|
56
61
|
request: import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniObject<{
|
|
@@ -73,6 +78,7 @@ export declare function tempo<const parameters extends tempo.Parameters>(paramet
|
|
|
73
78
|
pull: "pull";
|
|
74
79
|
push: "push";
|
|
75
80
|
}>>>;
|
|
81
|
+
zones: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniUnion<readonly [import("zod/mini").ZodMiniLiteral<true>, import("zod/mini").ZodMiniArray<import("zod/mini").ZodMiniNumber<number>>]>>;
|
|
76
82
|
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniTransform<{
|
|
77
83
|
currency: string;
|
|
78
84
|
description?: string | undefined;
|
|
@@ -89,6 +95,7 @@ export declare function tempo<const parameters extends tempo.Parameters>(paramet
|
|
|
89
95
|
amount: string;
|
|
90
96
|
}[] | undefined;
|
|
91
97
|
supportedModes?: ("pull" | "push")[] | undefined;
|
|
98
|
+
zones?: true | number[] | undefined;
|
|
92
99
|
} | undefined;
|
|
93
100
|
}, {
|
|
94
101
|
machineTokenEnabled?: boolean | undefined;
|
|
@@ -107,6 +114,7 @@ export declare function tempo<const parameters extends tempo.Parameters>(paramet
|
|
|
107
114
|
recipient: `0x${string}`;
|
|
108
115
|
}[] | undefined;
|
|
109
116
|
supportedModes?: ("pull" | "push")[] | undefined;
|
|
117
|
+
zones?: true | number[] | undefined;
|
|
110
118
|
}>>;
|
|
111
119
|
};
|
|
112
120
|
}, charge_.DeriveDefaults<NoExtraKeys<parameters, tempo.Parameters>>, undefined, {}, string | undefined>, import("../../Method.js").Server<{
|
|
@@ -213,6 +221,11 @@ export declare function tempo<const parameters extends tempo.Parameters>(paramet
|
|
|
213
221
|
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniObject<{
|
|
214
222
|
signature: import("zod/mini").ZodMiniString<string>;
|
|
215
223
|
type: import("zod/mini").ZodMiniLiteral<"proof">;
|
|
224
|
+
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniObject<{
|
|
225
|
+
hash: import("zod/mini").ZodMiniString<string>;
|
|
226
|
+
senderTag: import("zod/mini").ZodMiniString<string>;
|
|
227
|
+
type: import("zod/mini").ZodMiniLiteral<"zone">;
|
|
228
|
+
zoneId: import("zod/mini").ZodMiniNumber<number>;
|
|
216
229
|
}, import("zod/v4/core").$strip>], "type">;
|
|
217
230
|
};
|
|
218
231
|
request: import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniObject<{
|
|
@@ -235,6 +248,7 @@ export declare function tempo<const parameters extends tempo.Parameters>(paramet
|
|
|
235
248
|
pull: "pull";
|
|
236
249
|
push: "push";
|
|
237
250
|
}>>>;
|
|
251
|
+
zones: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniUnion<readonly [import("zod/mini").ZodMiniLiteral<true>, import("zod/mini").ZodMiniArray<import("zod/mini").ZodMiniNumber<number>>]>>;
|
|
238
252
|
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniTransform<{
|
|
239
253
|
currency: string;
|
|
240
254
|
description?: string | undefined;
|
|
@@ -251,6 +265,7 @@ export declare function tempo<const parameters extends tempo.Parameters>(paramet
|
|
|
251
265
|
amount: string;
|
|
252
266
|
}[] | undefined;
|
|
253
267
|
supportedModes?: ("pull" | "push")[] | undefined;
|
|
268
|
+
zones?: true | number[] | undefined;
|
|
254
269
|
} | undefined;
|
|
255
270
|
}, {
|
|
256
271
|
machineTokenEnabled?: boolean | undefined;
|
|
@@ -269,6 +284,7 @@ export declare function tempo<const parameters extends tempo.Parameters>(paramet
|
|
|
269
284
|
recipient: `0x${string}`;
|
|
270
285
|
}[] | undefined;
|
|
271
286
|
supportedModes?: ("pull" | "push")[] | undefined;
|
|
287
|
+
zones?: true | number[] | undefined;
|
|
272
288
|
}>>;
|
|
273
289
|
};
|
|
274
290
|
}, charge_.DeriveDefaults<Omit<parameters, "chainId" | "currencies" | "currency" | "decimals"> & {
|
|
@@ -2323,6 +2339,11 @@ export declare function tempo<const parameters extends tempo.Parameters>(paramet
|
|
|
2323
2339
|
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniObject<{
|
|
2324
2340
|
signature: import("zod/mini").ZodMiniString<string>;
|
|
2325
2341
|
type: import("zod/mini").ZodMiniLiteral<"proof">;
|
|
2342
|
+
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniObject<{
|
|
2343
|
+
hash: import("zod/mini").ZodMiniString<string>;
|
|
2344
|
+
senderTag: import("zod/mini").ZodMiniString<string>;
|
|
2345
|
+
type: import("zod/mini").ZodMiniLiteral<"zone">;
|
|
2346
|
+
zoneId: import("zod/mini").ZodMiniNumber<number>;
|
|
2326
2347
|
}, import("zod/v4/core").$strip>], "type">;
|
|
2327
2348
|
};
|
|
2328
2349
|
request: import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniObject<{
|
|
@@ -2345,6 +2366,7 @@ export declare function tempo<const parameters extends tempo.Parameters>(paramet
|
|
|
2345
2366
|
pull: "pull";
|
|
2346
2367
|
push: "push";
|
|
2347
2368
|
}>>>;
|
|
2369
|
+
zones: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniUnion<readonly [import("zod/mini").ZodMiniLiteral<true>, import("zod/mini").ZodMiniArray<import("zod/mini").ZodMiniNumber<number>>]>>;
|
|
2348
2370
|
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniTransform<{
|
|
2349
2371
|
currency: string;
|
|
2350
2372
|
description?: string | undefined;
|
|
@@ -2361,6 +2383,7 @@ export declare function tempo<const parameters extends tempo.Parameters>(paramet
|
|
|
2361
2383
|
amount: string;
|
|
2362
2384
|
}[] | undefined;
|
|
2363
2385
|
supportedModes?: ("pull" | "push")[] | undefined;
|
|
2386
|
+
zones?: true | number[] | undefined;
|
|
2364
2387
|
} | undefined;
|
|
2365
2388
|
}, {
|
|
2366
2389
|
machineTokenEnabled?: boolean | undefined;
|
|
@@ -2379,6 +2402,7 @@ export declare function tempo<const parameters extends tempo.Parameters>(paramet
|
|
|
2379
2402
|
recipient: `0x${string}`;
|
|
2380
2403
|
}[] | undefined;
|
|
2381
2404
|
supportedModes?: ("pull" | "push")[] | undefined;
|
|
2405
|
+
zones?: true | number[] | undefined;
|
|
2382
2406
|
}>>;
|
|
2383
2407
|
};
|
|
2384
2408
|
}, charge_.DeriveDefaults<Omit<parameters, "chainId" | "currencies" | "currency" | "decimals"> & {
|
|
@@ -2467,6 +2491,11 @@ declare function chargeOffers<const parameters extends CurrencyParameters<charge
|
|
|
2467
2491
|
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniObject<{
|
|
2468
2492
|
signature: import("zod/mini").ZodMiniString<string>;
|
|
2469
2493
|
type: import("zod/mini").ZodMiniLiteral<"proof">;
|
|
2494
|
+
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniObject<{
|
|
2495
|
+
hash: import("zod/mini").ZodMiniString<string>;
|
|
2496
|
+
senderTag: import("zod/mini").ZodMiniString<string>;
|
|
2497
|
+
type: import("zod/mini").ZodMiniLiteral<"zone">;
|
|
2498
|
+
zoneId: import("zod/mini").ZodMiniNumber<number>;
|
|
2470
2499
|
}, import("zod/v4/core").$strip>], "type">;
|
|
2471
2500
|
};
|
|
2472
2501
|
request: import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniObject<{
|
|
@@ -2489,6 +2518,7 @@ declare function chargeOffers<const parameters extends CurrencyParameters<charge
|
|
|
2489
2518
|
pull: "pull";
|
|
2490
2519
|
push: "push";
|
|
2491
2520
|
}>>>;
|
|
2521
|
+
zones: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniUnion<readonly [import("zod/mini").ZodMiniLiteral<true>, import("zod/mini").ZodMiniArray<import("zod/mini").ZodMiniNumber<number>>]>>;
|
|
2492
2522
|
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniTransform<{
|
|
2493
2523
|
currency: string;
|
|
2494
2524
|
description?: string | undefined;
|
|
@@ -2505,6 +2535,7 @@ declare function chargeOffers<const parameters extends CurrencyParameters<charge
|
|
|
2505
2535
|
amount: string;
|
|
2506
2536
|
}[] | undefined;
|
|
2507
2537
|
supportedModes?: ("pull" | "push")[] | undefined;
|
|
2538
|
+
zones?: true | number[] | undefined;
|
|
2508
2539
|
} | undefined;
|
|
2509
2540
|
}, {
|
|
2510
2541
|
machineTokenEnabled?: boolean | undefined;
|
|
@@ -2523,6 +2554,7 @@ declare function chargeOffers<const parameters extends CurrencyParameters<charge
|
|
|
2523
2554
|
recipient: `0x${string}`;
|
|
2524
2555
|
}[] | undefined;
|
|
2525
2556
|
supportedModes?: ("pull" | "push")[] | undefined;
|
|
2557
|
+
zones?: true | number[] | undefined;
|
|
2526
2558
|
}>>;
|
|
2527
2559
|
};
|
|
2528
2560
|
}, charge_.DeriveDefaults<Omit<parameters, "chainId" | "currencies" | "currency" | "decimals"> & {
|
|
@@ -2543,6 +2575,11 @@ declare function chargeOffers<const parameters extends CurrencyParameters<charge
|
|
|
2543
2575
|
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniObject<{
|
|
2544
2576
|
signature: import("zod/mini").ZodMiniString<string>;
|
|
2545
2577
|
type: import("zod/mini").ZodMiniLiteral<"proof">;
|
|
2578
|
+
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniObject<{
|
|
2579
|
+
hash: import("zod/mini").ZodMiniString<string>;
|
|
2580
|
+
senderTag: import("zod/mini").ZodMiniString<string>;
|
|
2581
|
+
type: import("zod/mini").ZodMiniLiteral<"zone">;
|
|
2582
|
+
zoneId: import("zod/mini").ZodMiniNumber<number>;
|
|
2546
2583
|
}, import("zod/v4/core").$strip>], "type">;
|
|
2547
2584
|
};
|
|
2548
2585
|
request: import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniObject<{
|
|
@@ -2565,6 +2602,7 @@ declare function chargeOffers<const parameters extends CurrencyParameters<charge
|
|
|
2565
2602
|
pull: "pull";
|
|
2566
2603
|
push: "push";
|
|
2567
2604
|
}>>>;
|
|
2605
|
+
zones: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniUnion<readonly [import("zod/mini").ZodMiniLiteral<true>, import("zod/mini").ZodMiniArray<import("zod/mini").ZodMiniNumber<number>>]>>;
|
|
2568
2606
|
}, import("zod/v4/core").$strip>, import("zod/mini").ZodMiniTransform<{
|
|
2569
2607
|
currency: string;
|
|
2570
2608
|
description?: string | undefined;
|
|
@@ -2581,6 +2619,7 @@ declare function chargeOffers<const parameters extends CurrencyParameters<charge
|
|
|
2581
2619
|
amount: string;
|
|
2582
2620
|
}[] | undefined;
|
|
2583
2621
|
supportedModes?: ("pull" | "push")[] | undefined;
|
|
2622
|
+
zones?: true | number[] | undefined;
|
|
2584
2623
|
} | undefined;
|
|
2585
2624
|
}, {
|
|
2586
2625
|
machineTokenEnabled?: boolean | undefined;
|
|
@@ -2599,6 +2638,7 @@ declare function chargeOffers<const parameters extends CurrencyParameters<charge
|
|
|
2599
2638
|
recipient: `0x${string}`;
|
|
2600
2639
|
}[] | undefined;
|
|
2601
2640
|
supportedModes?: ("pull" | "push")[] | undefined;
|
|
2641
|
+
zones?: true | number[] | undefined;
|
|
2602
2642
|
}>>;
|
|
2603
2643
|
};
|
|
2604
2644
|
}, charge_.DeriveDefaults<Omit<parameters, "chainId" | "currencies" | "currency" | "decimals"> & {
|
|
@@ -713,6 +713,7 @@ async function submitSubscriptionPayment(parameters) {
|
|
|
713
713
|
const userSerialized = await signTransaction(client, prepared);
|
|
714
714
|
const userTransaction = Transaction.deserialize(userSerialized);
|
|
715
715
|
const completed = await FeePayer.preflightSponsorship({
|
|
716
|
+
policy: feePayerPolicy,
|
|
716
717
|
transaction: userTransaction,
|
|
717
718
|
simulate: (request) => viem_call(client, request),
|
|
718
719
|
async complete() {
|