@wtflabs/x402 0.0.1-beta.0
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/README.md +60 -0
- package/dist/cjs/client/index.d.ts +64 -0
- package/dist/cjs/client/index.js +832 -0
- package/dist/cjs/client/index.js.map +1 -0
- package/dist/cjs/config-CFBSAuxW.d.ts +10 -0
- package/dist/cjs/config-Dfuvno71.d.ts +19 -0
- package/dist/cjs/facilitator/index.d.ts +42 -0
- package/dist/cjs/facilitator/index.js +2574 -0
- package/dist/cjs/facilitator/index.js.map +1 -0
- package/dist/cjs/index.d.ts +16 -0
- package/dist/cjs/index.js +2974 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/middleware-6_1ApcJn.d.ts +93 -0
- package/dist/cjs/middleware-B_ewwsQp.d.ts +93 -0
- package/dist/cjs/middleware-Brgsx32F.d.ts +93 -0
- package/dist/cjs/middleware-BwfW7mAs.d.ts +93 -0
- package/dist/cjs/middleware-CQb61c1k.d.ts +93 -0
- package/dist/cjs/middleware-DB9lqy9f.d.ts +93 -0
- package/dist/cjs/middleware-DcHctwQV.d.ts +93 -0
- package/dist/cjs/middleware-De0jD3Bp.d.ts +93 -0
- package/dist/cjs/middleware-HoFOmpgv.d.ts +93 -0
- package/dist/cjs/middleware-Y8AiAfYw.d.ts +93 -0
- package/dist/cjs/middleware-pnres9YM.d.ts +93 -0
- package/dist/cjs/network-FrFmmiyj.d.ts +11 -0
- package/dist/cjs/network-RtNddYQk.d.ts +11 -0
- package/dist/cjs/paywall/index.d.ts +30 -0
- package/dist/cjs/paywall/index.js +131 -0
- package/dist/cjs/paywall/index.js.map +1 -0
- package/dist/cjs/rpc-BMvnNNHd.d.ts +35 -0
- package/dist/cjs/rpc-Ca8eHCWz.d.ts +35 -0
- package/dist/cjs/schemes/index.d.ts +533 -0
- package/dist/cjs/schemes/index.js +3144 -0
- package/dist/cjs/schemes/index.js.map +1 -0
- package/dist/cjs/shared/evm/index.d.ts +71 -0
- package/dist/cjs/shared/evm/index.js +947 -0
- package/dist/cjs/shared/evm/index.js.map +1 -0
- package/dist/cjs/shared/index.d.ts +182 -0
- package/dist/cjs/shared/index.js +674 -0
- package/dist/cjs/shared/index.js.map +1 -0
- package/dist/cjs/types/index.d.ts +1515 -0
- package/dist/cjs/types/index.js +1645 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/verify/index.d.ts +7 -0
- package/dist/cjs/verify/index.js +438 -0
- package/dist/cjs/verify/index.js.map +1 -0
- package/dist/cjs/wallet-BRWfOM5D.d.ts +153 -0
- package/dist/cjs/wallet-BTqCm9Zp.d.ts +27 -0
- package/dist/cjs/wallet-BYRAGtOB.d.ts +153 -0
- package/dist/cjs/wallet-BmEtlgEf.d.ts +48 -0
- package/dist/cjs/wallet-CNOAmyZ6.d.ts +48 -0
- package/dist/cjs/wallet-CQ0Fe_M5.d.ts +88 -0
- package/dist/cjs/wallet-D1SoxFTw.d.ts +48 -0
- package/dist/cjs/wallet-SJ-hbjm9.d.ts +153 -0
- package/dist/cjs/wallet-SJKJpUgQ.d.ts +167 -0
- package/dist/cjs/wallet-ecnda4Aj.d.ts +48 -0
- package/dist/cjs/wallet-gP8Qoi-c.d.ts +74 -0
- package/dist/cjs/x402Specs-B7InXo2L.d.ts +1065 -0
- package/dist/cjs/x402Specs-BLH3j34O.d.ts +1696 -0
- package/dist/cjs/x402Specs-C7LipAZg.d.ts +1715 -0
- package/dist/cjs/x402Specs-CYq5tSY1.d.ts +1745 -0
- package/dist/cjs/x402Specs-CeajqonG.d.ts +1696 -0
- package/dist/cjs/x402Specs-qMujgEV5.d.ts +1715 -0
- package/dist/cjs/x402Specs-qUBCpcuz.d.ts +1715 -0
- package/dist/esm/chunk-34YNR4LY.mjs +106 -0
- package/dist/esm/chunk-34YNR4LY.mjs.map +1 -0
- package/dist/esm/chunk-57UEJN5U.mjs +1416 -0
- package/dist/esm/chunk-57UEJN5U.mjs.map +1 -0
- package/dist/esm/chunk-5LTKIVOA.mjs +858 -0
- package/dist/esm/chunk-5LTKIVOA.mjs.map +1 -0
- package/dist/esm/chunk-AQQR4PXH.mjs +80 -0
- package/dist/esm/chunk-AQQR4PXH.mjs.map +1 -0
- package/dist/esm/chunk-LGXWNXCO.mjs +76 -0
- package/dist/esm/chunk-LGXWNXCO.mjs.map +1 -0
- package/dist/esm/chunk-RX2JKK4O.mjs +349 -0
- package/dist/esm/chunk-RX2JKK4O.mjs.map +1 -0
- package/dist/esm/chunk-UCBE7FDY.mjs +1041 -0
- package/dist/esm/chunk-UCBE7FDY.mjs.map +1 -0
- package/dist/esm/client/index.mjs +17 -0
- package/dist/esm/client/index.mjs.map +1 -0
- package/dist/esm/facilitator/index.mjs +14 -0
- package/dist/esm/facilitator/index.mjs.map +1 -0
- package/dist/esm/index.mjs +28 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/paywall/index.mjs +46 -0
- package/dist/esm/paywall/index.mjs.map +1 -0
- package/dist/esm/schemes/index.mjs +16 -0
- package/dist/esm/schemes/index.mjs.map +1 -0
- package/dist/esm/shared/evm/index.mjs +20 -0
- package/dist/esm/shared/evm/index.mjs.map +1 -0
- package/dist/esm/shared/index.mjs +31 -0
- package/dist/esm/shared/index.mjs.map +1 -0
- package/dist/esm/types/index.mjs +87 -0
- package/dist/esm/types/index.mjs.map +1 -0
- package/dist/esm/verify/index.mjs +105 -0
- package/dist/esm/verify/index.mjs.map +1 -0
- package/package.json +148 -0
|
@@ -0,0 +1,1065 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const schemes: readonly ["exact"];
|
|
4
|
+
declare const x402Versions: readonly [1];
|
|
5
|
+
declare const ErrorReasons: readonly ["insufficient_funds", "invalid_exact_evm_payload_authorization_valid_after", "invalid_exact_evm_payload_authorization_valid_before", "invalid_exact_evm_payload_authorization_value", "invalid_exact_evm_payload_signature", "invalid_exact_evm_payload_recipient_mismatch", "invalid_exact_svm_payload_transaction", "invalid_exact_svm_payload_transaction_amount_mismatch", "invalid_exact_svm_payload_transaction_create_ata_instruction", "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee", "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset", "invalid_exact_svm_payload_transaction_instructions", "invalid_exact_svm_payload_transaction_instructions_length", "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction", "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction", "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high", "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked", "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked", "invalid_exact_svm_payload_transaction_not_a_transfer_instruction", "invalid_exact_svm_payload_transaction_receiver_ata_not_found", "invalid_exact_svm_payload_transaction_sender_ata_not_found", "invalid_exact_svm_payload_transaction_simulation_failed", "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata", "invalid_network", "invalid_payload", "invalid_payment_requirements", "invalid_scheme", "invalid_payment", "payment_expired", "unsupported_scheme", "invalid_x402_version", "invalid_transaction_state", "invalid_x402_version", "settle_exact_svm_block_height_exceeded", "settle_exact_svm_transaction_confirmation_timed_out", "unsupported_scheme", "unexpected_settle_error", "unexpected_verify_error"];
|
|
6
|
+
declare const PaymentRequirementsSchema: z.ZodObject<{
|
|
7
|
+
scheme: z.ZodEnum<["exact"]>;
|
|
8
|
+
network: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
|
|
9
|
+
maxAmountRequired: z.ZodEffects<z.ZodString, string, string>;
|
|
10
|
+
resource: z.ZodString;
|
|
11
|
+
description: z.ZodString;
|
|
12
|
+
mimeType: z.ZodString;
|
|
13
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
14
|
+
payTo: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
15
|
+
maxTimeoutSeconds: z.ZodNumber;
|
|
16
|
+
asset: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
17
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
scheme: "exact";
|
|
20
|
+
description: string;
|
|
21
|
+
asset: string;
|
|
22
|
+
maxAmountRequired: string;
|
|
23
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
24
|
+
resource: string;
|
|
25
|
+
mimeType: string;
|
|
26
|
+
payTo: string;
|
|
27
|
+
maxTimeoutSeconds: number;
|
|
28
|
+
outputSchema?: Record<string, any> | undefined;
|
|
29
|
+
extra?: Record<string, any> | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
scheme: "exact";
|
|
32
|
+
description: string;
|
|
33
|
+
asset: string;
|
|
34
|
+
maxAmountRequired: string;
|
|
35
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
36
|
+
resource: string;
|
|
37
|
+
mimeType: string;
|
|
38
|
+
payTo: string;
|
|
39
|
+
maxTimeoutSeconds: number;
|
|
40
|
+
outputSchema?: Record<string, any> | undefined;
|
|
41
|
+
extra?: Record<string, any> | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
type PaymentRequirements = z.infer<typeof PaymentRequirementsSchema>;
|
|
44
|
+
declare const ExactEvmPayloadAuthorizationSchema: z.ZodObject<{
|
|
45
|
+
from: z.ZodString;
|
|
46
|
+
to: z.ZodString;
|
|
47
|
+
value: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
48
|
+
validAfter: z.ZodEffects<z.ZodString, string, string>;
|
|
49
|
+
validBefore: z.ZodEffects<z.ZodString, string, string>;
|
|
50
|
+
nonce: z.ZodString;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
from: string;
|
|
53
|
+
to: string;
|
|
54
|
+
value: string;
|
|
55
|
+
validAfter: string;
|
|
56
|
+
validBefore: string;
|
|
57
|
+
nonce: string;
|
|
58
|
+
}, {
|
|
59
|
+
from: string;
|
|
60
|
+
to: string;
|
|
61
|
+
value: string;
|
|
62
|
+
validAfter: string;
|
|
63
|
+
validBefore: string;
|
|
64
|
+
nonce: string;
|
|
65
|
+
}>;
|
|
66
|
+
type ExactEvmPayloadAuthorization = z.infer<typeof ExactEvmPayloadAuthorizationSchema>;
|
|
67
|
+
declare const ExactEvmPayloadSchema: z.ZodObject<{
|
|
68
|
+
signature: z.ZodString;
|
|
69
|
+
authorization: z.ZodObject<{
|
|
70
|
+
from: z.ZodString;
|
|
71
|
+
to: z.ZodString;
|
|
72
|
+
value: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
73
|
+
validAfter: z.ZodEffects<z.ZodString, string, string>;
|
|
74
|
+
validBefore: z.ZodEffects<z.ZodString, string, string>;
|
|
75
|
+
nonce: z.ZodString;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
from: string;
|
|
78
|
+
to: string;
|
|
79
|
+
value: string;
|
|
80
|
+
validAfter: string;
|
|
81
|
+
validBefore: string;
|
|
82
|
+
nonce: string;
|
|
83
|
+
}, {
|
|
84
|
+
from: string;
|
|
85
|
+
to: string;
|
|
86
|
+
value: string;
|
|
87
|
+
validAfter: string;
|
|
88
|
+
validBefore: string;
|
|
89
|
+
nonce: string;
|
|
90
|
+
}>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
signature: string;
|
|
93
|
+
authorization: {
|
|
94
|
+
from: string;
|
|
95
|
+
to: string;
|
|
96
|
+
value: string;
|
|
97
|
+
validAfter: string;
|
|
98
|
+
validBefore: string;
|
|
99
|
+
nonce: string;
|
|
100
|
+
};
|
|
101
|
+
}, {
|
|
102
|
+
signature: string;
|
|
103
|
+
authorization: {
|
|
104
|
+
from: string;
|
|
105
|
+
to: string;
|
|
106
|
+
value: string;
|
|
107
|
+
validAfter: string;
|
|
108
|
+
validBefore: string;
|
|
109
|
+
nonce: string;
|
|
110
|
+
};
|
|
111
|
+
}>;
|
|
112
|
+
type ExactEvmPayload = z.infer<typeof ExactEvmPayloadSchema>;
|
|
113
|
+
declare const ExactSvmPayloadSchema: z.ZodObject<{
|
|
114
|
+
transaction: z.ZodString;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
transaction: string;
|
|
117
|
+
}, {
|
|
118
|
+
transaction: string;
|
|
119
|
+
}>;
|
|
120
|
+
type ExactSvmPayload = z.infer<typeof ExactSvmPayloadSchema>;
|
|
121
|
+
declare const PaymentPayloadSchema: z.ZodObject<{
|
|
122
|
+
x402Version: z.ZodEffects<z.ZodNumber, number, number>;
|
|
123
|
+
scheme: z.ZodEnum<["exact"]>;
|
|
124
|
+
network: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
|
|
125
|
+
payload: z.ZodUnion<[z.ZodObject<{
|
|
126
|
+
signature: z.ZodString;
|
|
127
|
+
authorization: z.ZodObject<{
|
|
128
|
+
from: z.ZodString;
|
|
129
|
+
to: z.ZodString;
|
|
130
|
+
value: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
131
|
+
validAfter: z.ZodEffects<z.ZodString, string, string>;
|
|
132
|
+
validBefore: z.ZodEffects<z.ZodString, string, string>;
|
|
133
|
+
nonce: z.ZodString;
|
|
134
|
+
}, "strip", z.ZodTypeAny, {
|
|
135
|
+
from: string;
|
|
136
|
+
to: string;
|
|
137
|
+
value: string;
|
|
138
|
+
validAfter: string;
|
|
139
|
+
validBefore: string;
|
|
140
|
+
nonce: string;
|
|
141
|
+
}, {
|
|
142
|
+
from: string;
|
|
143
|
+
to: string;
|
|
144
|
+
value: string;
|
|
145
|
+
validAfter: string;
|
|
146
|
+
validBefore: string;
|
|
147
|
+
nonce: string;
|
|
148
|
+
}>;
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
150
|
+
signature: string;
|
|
151
|
+
authorization: {
|
|
152
|
+
from: string;
|
|
153
|
+
to: string;
|
|
154
|
+
value: string;
|
|
155
|
+
validAfter: string;
|
|
156
|
+
validBefore: string;
|
|
157
|
+
nonce: string;
|
|
158
|
+
};
|
|
159
|
+
}, {
|
|
160
|
+
signature: string;
|
|
161
|
+
authorization: {
|
|
162
|
+
from: string;
|
|
163
|
+
to: string;
|
|
164
|
+
value: string;
|
|
165
|
+
validAfter: string;
|
|
166
|
+
validBefore: string;
|
|
167
|
+
nonce: string;
|
|
168
|
+
};
|
|
169
|
+
}>, z.ZodObject<{
|
|
170
|
+
transaction: z.ZodString;
|
|
171
|
+
}, "strip", z.ZodTypeAny, {
|
|
172
|
+
transaction: string;
|
|
173
|
+
}, {
|
|
174
|
+
transaction: string;
|
|
175
|
+
}>]>;
|
|
176
|
+
}, "strip", z.ZodTypeAny, {
|
|
177
|
+
scheme: "exact";
|
|
178
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
179
|
+
x402Version: number;
|
|
180
|
+
payload: {
|
|
181
|
+
signature: string;
|
|
182
|
+
authorization: {
|
|
183
|
+
from: string;
|
|
184
|
+
to: string;
|
|
185
|
+
value: string;
|
|
186
|
+
validAfter: string;
|
|
187
|
+
validBefore: string;
|
|
188
|
+
nonce: string;
|
|
189
|
+
};
|
|
190
|
+
} | {
|
|
191
|
+
transaction: string;
|
|
192
|
+
};
|
|
193
|
+
}, {
|
|
194
|
+
scheme: "exact";
|
|
195
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
196
|
+
x402Version: number;
|
|
197
|
+
payload: {
|
|
198
|
+
signature: string;
|
|
199
|
+
authorization: {
|
|
200
|
+
from: string;
|
|
201
|
+
to: string;
|
|
202
|
+
value: string;
|
|
203
|
+
validAfter: string;
|
|
204
|
+
validBefore: string;
|
|
205
|
+
nonce: string;
|
|
206
|
+
};
|
|
207
|
+
} | {
|
|
208
|
+
transaction: string;
|
|
209
|
+
};
|
|
210
|
+
}>;
|
|
211
|
+
type PaymentPayload = z.infer<typeof PaymentPayloadSchema>;
|
|
212
|
+
type UnsignedPaymentPayload = Omit<PaymentPayload, "payload"> & {
|
|
213
|
+
payload: Omit<ExactEvmPayload, "signature"> & {
|
|
214
|
+
signature: undefined;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
declare const x402ResponseSchema: z.ZodObject<{
|
|
218
|
+
x402Version: z.ZodEffects<z.ZodNumber, number, number>;
|
|
219
|
+
error: z.ZodOptional<z.ZodEnum<["insufficient_funds", "invalid_exact_evm_payload_authorization_valid_after", "invalid_exact_evm_payload_authorization_valid_before", "invalid_exact_evm_payload_authorization_value", "invalid_exact_evm_payload_signature", "invalid_exact_evm_payload_recipient_mismatch", "invalid_exact_svm_payload_transaction", "invalid_exact_svm_payload_transaction_amount_mismatch", "invalid_exact_svm_payload_transaction_create_ata_instruction", "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee", "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset", "invalid_exact_svm_payload_transaction_instructions", "invalid_exact_svm_payload_transaction_instructions_length", "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction", "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction", "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high", "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked", "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked", "invalid_exact_svm_payload_transaction_not_a_transfer_instruction", "invalid_exact_svm_payload_transaction_receiver_ata_not_found", "invalid_exact_svm_payload_transaction_sender_ata_not_found", "invalid_exact_svm_payload_transaction_simulation_failed", "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata", "invalid_network", "invalid_payload", "invalid_payment_requirements", "invalid_scheme", "invalid_payment", "payment_expired", "unsupported_scheme", "invalid_x402_version", "invalid_transaction_state", "invalid_x402_version", "settle_exact_svm_block_height_exceeded", "settle_exact_svm_transaction_confirmation_timed_out", "unsupported_scheme", "unexpected_settle_error", "unexpected_verify_error"]>>;
|
|
220
|
+
accepts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
221
|
+
scheme: z.ZodEnum<["exact"]>;
|
|
222
|
+
network: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
|
|
223
|
+
maxAmountRequired: z.ZodEffects<z.ZodString, string, string>;
|
|
224
|
+
resource: z.ZodString;
|
|
225
|
+
description: z.ZodString;
|
|
226
|
+
mimeType: z.ZodString;
|
|
227
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
228
|
+
payTo: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
229
|
+
maxTimeoutSeconds: z.ZodNumber;
|
|
230
|
+
asset: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
231
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
232
|
+
}, "strip", z.ZodTypeAny, {
|
|
233
|
+
scheme: "exact";
|
|
234
|
+
description: string;
|
|
235
|
+
asset: string;
|
|
236
|
+
maxAmountRequired: string;
|
|
237
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
238
|
+
resource: string;
|
|
239
|
+
mimeType: string;
|
|
240
|
+
payTo: string;
|
|
241
|
+
maxTimeoutSeconds: number;
|
|
242
|
+
outputSchema?: Record<string, any> | undefined;
|
|
243
|
+
extra?: Record<string, any> | undefined;
|
|
244
|
+
}, {
|
|
245
|
+
scheme: "exact";
|
|
246
|
+
description: string;
|
|
247
|
+
asset: string;
|
|
248
|
+
maxAmountRequired: string;
|
|
249
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
250
|
+
resource: string;
|
|
251
|
+
mimeType: string;
|
|
252
|
+
payTo: string;
|
|
253
|
+
maxTimeoutSeconds: number;
|
|
254
|
+
outputSchema?: Record<string, any> | undefined;
|
|
255
|
+
extra?: Record<string, any> | undefined;
|
|
256
|
+
}>, "many">>;
|
|
257
|
+
payer: z.ZodOptional<z.ZodString>;
|
|
258
|
+
}, "strip", z.ZodTypeAny, {
|
|
259
|
+
x402Version: number;
|
|
260
|
+
error?: "invalid_exact_svm_payload_transaction" | "insufficient_funds" | "invalid_exact_evm_payload_authorization_valid_after" | "invalid_exact_evm_payload_authorization_valid_before" | "invalid_exact_evm_payload_authorization_value" | "invalid_exact_evm_payload_signature" | "invalid_exact_evm_payload_recipient_mismatch" | "invalid_exact_svm_payload_transaction_amount_mismatch" | "invalid_exact_svm_payload_transaction_create_ata_instruction" | "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee" | "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset" | "invalid_exact_svm_payload_transaction_instructions" | "invalid_exact_svm_payload_transaction_instructions_length" | "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction" | "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction" | "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high" | "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked" | "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked" | "invalid_exact_svm_payload_transaction_not_a_transfer_instruction" | "invalid_exact_svm_payload_transaction_receiver_ata_not_found" | "invalid_exact_svm_payload_transaction_sender_ata_not_found" | "invalid_exact_svm_payload_transaction_simulation_failed" | "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata" | "invalid_network" | "invalid_payload" | "invalid_payment_requirements" | "invalid_scheme" | "invalid_payment" | "payment_expired" | "unsupported_scheme" | "invalid_x402_version" | "invalid_transaction_state" | "settle_exact_svm_block_height_exceeded" | "settle_exact_svm_transaction_confirmation_timed_out" | "unexpected_settle_error" | "unexpected_verify_error" | undefined;
|
|
261
|
+
payer?: string | undefined;
|
|
262
|
+
accepts?: {
|
|
263
|
+
scheme: "exact";
|
|
264
|
+
description: string;
|
|
265
|
+
asset: string;
|
|
266
|
+
maxAmountRequired: string;
|
|
267
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
268
|
+
resource: string;
|
|
269
|
+
mimeType: string;
|
|
270
|
+
payTo: string;
|
|
271
|
+
maxTimeoutSeconds: number;
|
|
272
|
+
outputSchema?: Record<string, any> | undefined;
|
|
273
|
+
extra?: Record<string, any> | undefined;
|
|
274
|
+
}[] | undefined;
|
|
275
|
+
}, {
|
|
276
|
+
x402Version: number;
|
|
277
|
+
error?: "invalid_exact_svm_payload_transaction" | "insufficient_funds" | "invalid_exact_evm_payload_authorization_valid_after" | "invalid_exact_evm_payload_authorization_valid_before" | "invalid_exact_evm_payload_authorization_value" | "invalid_exact_evm_payload_signature" | "invalid_exact_evm_payload_recipient_mismatch" | "invalid_exact_svm_payload_transaction_amount_mismatch" | "invalid_exact_svm_payload_transaction_create_ata_instruction" | "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee" | "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset" | "invalid_exact_svm_payload_transaction_instructions" | "invalid_exact_svm_payload_transaction_instructions_length" | "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction" | "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction" | "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high" | "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked" | "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked" | "invalid_exact_svm_payload_transaction_not_a_transfer_instruction" | "invalid_exact_svm_payload_transaction_receiver_ata_not_found" | "invalid_exact_svm_payload_transaction_sender_ata_not_found" | "invalid_exact_svm_payload_transaction_simulation_failed" | "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata" | "invalid_network" | "invalid_payload" | "invalid_payment_requirements" | "invalid_scheme" | "invalid_payment" | "payment_expired" | "unsupported_scheme" | "invalid_x402_version" | "invalid_transaction_state" | "settle_exact_svm_block_height_exceeded" | "settle_exact_svm_transaction_confirmation_timed_out" | "unexpected_settle_error" | "unexpected_verify_error" | undefined;
|
|
278
|
+
payer?: string | undefined;
|
|
279
|
+
accepts?: {
|
|
280
|
+
scheme: "exact";
|
|
281
|
+
description: string;
|
|
282
|
+
asset: string;
|
|
283
|
+
maxAmountRequired: string;
|
|
284
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
285
|
+
resource: string;
|
|
286
|
+
mimeType: string;
|
|
287
|
+
payTo: string;
|
|
288
|
+
maxTimeoutSeconds: number;
|
|
289
|
+
outputSchema?: Record<string, any> | undefined;
|
|
290
|
+
extra?: Record<string, any> | undefined;
|
|
291
|
+
}[] | undefined;
|
|
292
|
+
}>;
|
|
293
|
+
type x402Response = z.infer<typeof x402ResponseSchema>;
|
|
294
|
+
declare const HTTPVerbsSchema: z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"]>;
|
|
295
|
+
type HTTPVerbs = z.infer<typeof HTTPVerbsSchema>;
|
|
296
|
+
declare const HTTPRequestStructureSchema: z.ZodObject<{
|
|
297
|
+
type: z.ZodLiteral<"http">;
|
|
298
|
+
method: z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"]>;
|
|
299
|
+
queryParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
300
|
+
bodyType: z.ZodOptional<z.ZodEnum<["json", "form-data", "multipart-form-data", "text", "binary"]>>;
|
|
301
|
+
bodyFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
302
|
+
headerFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
303
|
+
}, "strip", z.ZodTypeAny, {
|
|
304
|
+
type: "http";
|
|
305
|
+
method: "POST" | "GET" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "HEAD";
|
|
306
|
+
queryParams?: Record<string, string> | undefined;
|
|
307
|
+
bodyType?: "binary" | "json" | "form-data" | "multipart-form-data" | "text" | undefined;
|
|
308
|
+
bodyFields?: Record<string, any> | undefined;
|
|
309
|
+
headerFields?: Record<string, any> | undefined;
|
|
310
|
+
}, {
|
|
311
|
+
type: "http";
|
|
312
|
+
method: "POST" | "GET" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "HEAD";
|
|
313
|
+
queryParams?: Record<string, string> | undefined;
|
|
314
|
+
bodyType?: "binary" | "json" | "form-data" | "multipart-form-data" | "text" | undefined;
|
|
315
|
+
bodyFields?: Record<string, any> | undefined;
|
|
316
|
+
headerFields?: Record<string, any> | undefined;
|
|
317
|
+
}>;
|
|
318
|
+
declare const RequestStructureSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
319
|
+
type: z.ZodLiteral<"http">;
|
|
320
|
+
method: z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"]>;
|
|
321
|
+
queryParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
322
|
+
bodyType: z.ZodOptional<z.ZodEnum<["json", "form-data", "multipart-form-data", "text", "binary"]>>;
|
|
323
|
+
bodyFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
324
|
+
headerFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
325
|
+
}, "strip", z.ZodTypeAny, {
|
|
326
|
+
type: "http";
|
|
327
|
+
method: "POST" | "GET" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "HEAD";
|
|
328
|
+
queryParams?: Record<string, string> | undefined;
|
|
329
|
+
bodyType?: "binary" | "json" | "form-data" | "multipart-form-data" | "text" | undefined;
|
|
330
|
+
bodyFields?: Record<string, any> | undefined;
|
|
331
|
+
headerFields?: Record<string, any> | undefined;
|
|
332
|
+
}, {
|
|
333
|
+
type: "http";
|
|
334
|
+
method: "POST" | "GET" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "HEAD";
|
|
335
|
+
queryParams?: Record<string, string> | undefined;
|
|
336
|
+
bodyType?: "binary" | "json" | "form-data" | "multipart-form-data" | "text" | undefined;
|
|
337
|
+
bodyFields?: Record<string, any> | undefined;
|
|
338
|
+
headerFields?: Record<string, any> | undefined;
|
|
339
|
+
}>]>;
|
|
340
|
+
type HTTPRequestStructure = z.infer<typeof HTTPRequestStructureSchema>;
|
|
341
|
+
type RequestStructure = z.infer<typeof RequestStructureSchema>;
|
|
342
|
+
declare const DiscoveredResourceSchema: z.ZodObject<{
|
|
343
|
+
resource: z.ZodString;
|
|
344
|
+
type: z.ZodEnum<["http"]>;
|
|
345
|
+
x402Version: z.ZodEffects<z.ZodNumber, number, number>;
|
|
346
|
+
accepts: z.ZodArray<z.ZodObject<{
|
|
347
|
+
scheme: z.ZodEnum<["exact"]>;
|
|
348
|
+
network: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
|
|
349
|
+
maxAmountRequired: z.ZodEffects<z.ZodString, string, string>;
|
|
350
|
+
resource: z.ZodString;
|
|
351
|
+
description: z.ZodString;
|
|
352
|
+
mimeType: z.ZodString;
|
|
353
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
354
|
+
payTo: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
355
|
+
maxTimeoutSeconds: z.ZodNumber;
|
|
356
|
+
asset: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
357
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
358
|
+
}, "strip", z.ZodTypeAny, {
|
|
359
|
+
scheme: "exact";
|
|
360
|
+
description: string;
|
|
361
|
+
asset: string;
|
|
362
|
+
maxAmountRequired: string;
|
|
363
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
364
|
+
resource: string;
|
|
365
|
+
mimeType: string;
|
|
366
|
+
payTo: string;
|
|
367
|
+
maxTimeoutSeconds: number;
|
|
368
|
+
outputSchema?: Record<string, any> | undefined;
|
|
369
|
+
extra?: Record<string, any> | undefined;
|
|
370
|
+
}, {
|
|
371
|
+
scheme: "exact";
|
|
372
|
+
description: string;
|
|
373
|
+
asset: string;
|
|
374
|
+
maxAmountRequired: string;
|
|
375
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
376
|
+
resource: string;
|
|
377
|
+
mimeType: string;
|
|
378
|
+
payTo: string;
|
|
379
|
+
maxTimeoutSeconds: number;
|
|
380
|
+
outputSchema?: Record<string, any> | undefined;
|
|
381
|
+
extra?: Record<string, any> | undefined;
|
|
382
|
+
}>, "many">;
|
|
383
|
+
lastUpdated: z.ZodDate;
|
|
384
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
385
|
+
}, "strip", z.ZodTypeAny, {
|
|
386
|
+
type: "http";
|
|
387
|
+
resource: string;
|
|
388
|
+
x402Version: number;
|
|
389
|
+
accepts: {
|
|
390
|
+
scheme: "exact";
|
|
391
|
+
description: string;
|
|
392
|
+
asset: string;
|
|
393
|
+
maxAmountRequired: string;
|
|
394
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
395
|
+
resource: string;
|
|
396
|
+
mimeType: string;
|
|
397
|
+
payTo: string;
|
|
398
|
+
maxTimeoutSeconds: number;
|
|
399
|
+
outputSchema?: Record<string, any> | undefined;
|
|
400
|
+
extra?: Record<string, any> | undefined;
|
|
401
|
+
}[];
|
|
402
|
+
lastUpdated: Date;
|
|
403
|
+
metadata?: Record<string, any> | undefined;
|
|
404
|
+
}, {
|
|
405
|
+
type: "http";
|
|
406
|
+
resource: string;
|
|
407
|
+
x402Version: number;
|
|
408
|
+
accepts: {
|
|
409
|
+
scheme: "exact";
|
|
410
|
+
description: string;
|
|
411
|
+
asset: string;
|
|
412
|
+
maxAmountRequired: string;
|
|
413
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
414
|
+
resource: string;
|
|
415
|
+
mimeType: string;
|
|
416
|
+
payTo: string;
|
|
417
|
+
maxTimeoutSeconds: number;
|
|
418
|
+
outputSchema?: Record<string, any> | undefined;
|
|
419
|
+
extra?: Record<string, any> | undefined;
|
|
420
|
+
}[];
|
|
421
|
+
lastUpdated: Date;
|
|
422
|
+
metadata?: Record<string, any> | undefined;
|
|
423
|
+
}>;
|
|
424
|
+
type DiscoveredResource = z.infer<typeof DiscoveredResourceSchema>;
|
|
425
|
+
declare const SettleRequestSchema: z.ZodObject<{
|
|
426
|
+
paymentPayload: z.ZodObject<{
|
|
427
|
+
x402Version: z.ZodEffects<z.ZodNumber, number, number>;
|
|
428
|
+
scheme: z.ZodEnum<["exact"]>;
|
|
429
|
+
network: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
|
|
430
|
+
payload: z.ZodUnion<[z.ZodObject<{
|
|
431
|
+
signature: z.ZodString;
|
|
432
|
+
authorization: z.ZodObject<{
|
|
433
|
+
from: z.ZodString;
|
|
434
|
+
to: z.ZodString;
|
|
435
|
+
value: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
436
|
+
validAfter: z.ZodEffects<z.ZodString, string, string>;
|
|
437
|
+
validBefore: z.ZodEffects<z.ZodString, string, string>;
|
|
438
|
+
nonce: z.ZodString;
|
|
439
|
+
}, "strip", z.ZodTypeAny, {
|
|
440
|
+
from: string;
|
|
441
|
+
to: string;
|
|
442
|
+
value: string;
|
|
443
|
+
validAfter: string;
|
|
444
|
+
validBefore: string;
|
|
445
|
+
nonce: string;
|
|
446
|
+
}, {
|
|
447
|
+
from: string;
|
|
448
|
+
to: string;
|
|
449
|
+
value: string;
|
|
450
|
+
validAfter: string;
|
|
451
|
+
validBefore: string;
|
|
452
|
+
nonce: string;
|
|
453
|
+
}>;
|
|
454
|
+
}, "strip", z.ZodTypeAny, {
|
|
455
|
+
signature: string;
|
|
456
|
+
authorization: {
|
|
457
|
+
from: string;
|
|
458
|
+
to: string;
|
|
459
|
+
value: string;
|
|
460
|
+
validAfter: string;
|
|
461
|
+
validBefore: string;
|
|
462
|
+
nonce: string;
|
|
463
|
+
};
|
|
464
|
+
}, {
|
|
465
|
+
signature: string;
|
|
466
|
+
authorization: {
|
|
467
|
+
from: string;
|
|
468
|
+
to: string;
|
|
469
|
+
value: string;
|
|
470
|
+
validAfter: string;
|
|
471
|
+
validBefore: string;
|
|
472
|
+
nonce: string;
|
|
473
|
+
};
|
|
474
|
+
}>, z.ZodObject<{
|
|
475
|
+
transaction: z.ZodString;
|
|
476
|
+
}, "strip", z.ZodTypeAny, {
|
|
477
|
+
transaction: string;
|
|
478
|
+
}, {
|
|
479
|
+
transaction: string;
|
|
480
|
+
}>]>;
|
|
481
|
+
}, "strip", z.ZodTypeAny, {
|
|
482
|
+
scheme: "exact";
|
|
483
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
484
|
+
x402Version: number;
|
|
485
|
+
payload: {
|
|
486
|
+
signature: string;
|
|
487
|
+
authorization: {
|
|
488
|
+
from: string;
|
|
489
|
+
to: string;
|
|
490
|
+
value: string;
|
|
491
|
+
validAfter: string;
|
|
492
|
+
validBefore: string;
|
|
493
|
+
nonce: string;
|
|
494
|
+
};
|
|
495
|
+
} | {
|
|
496
|
+
transaction: string;
|
|
497
|
+
};
|
|
498
|
+
}, {
|
|
499
|
+
scheme: "exact";
|
|
500
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
501
|
+
x402Version: number;
|
|
502
|
+
payload: {
|
|
503
|
+
signature: string;
|
|
504
|
+
authorization: {
|
|
505
|
+
from: string;
|
|
506
|
+
to: string;
|
|
507
|
+
value: string;
|
|
508
|
+
validAfter: string;
|
|
509
|
+
validBefore: string;
|
|
510
|
+
nonce: string;
|
|
511
|
+
};
|
|
512
|
+
} | {
|
|
513
|
+
transaction: string;
|
|
514
|
+
};
|
|
515
|
+
}>;
|
|
516
|
+
paymentRequirements: z.ZodObject<{
|
|
517
|
+
scheme: z.ZodEnum<["exact"]>;
|
|
518
|
+
network: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
|
|
519
|
+
maxAmountRequired: z.ZodEffects<z.ZodString, string, string>;
|
|
520
|
+
resource: z.ZodString;
|
|
521
|
+
description: z.ZodString;
|
|
522
|
+
mimeType: z.ZodString;
|
|
523
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
524
|
+
payTo: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
525
|
+
maxTimeoutSeconds: z.ZodNumber;
|
|
526
|
+
asset: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
527
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
528
|
+
}, "strip", z.ZodTypeAny, {
|
|
529
|
+
scheme: "exact";
|
|
530
|
+
description: string;
|
|
531
|
+
asset: string;
|
|
532
|
+
maxAmountRequired: string;
|
|
533
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
534
|
+
resource: string;
|
|
535
|
+
mimeType: string;
|
|
536
|
+
payTo: string;
|
|
537
|
+
maxTimeoutSeconds: number;
|
|
538
|
+
outputSchema?: Record<string, any> | undefined;
|
|
539
|
+
extra?: Record<string, any> | undefined;
|
|
540
|
+
}, {
|
|
541
|
+
scheme: "exact";
|
|
542
|
+
description: string;
|
|
543
|
+
asset: string;
|
|
544
|
+
maxAmountRequired: string;
|
|
545
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
546
|
+
resource: string;
|
|
547
|
+
mimeType: string;
|
|
548
|
+
payTo: string;
|
|
549
|
+
maxTimeoutSeconds: number;
|
|
550
|
+
outputSchema?: Record<string, any> | undefined;
|
|
551
|
+
extra?: Record<string, any> | undefined;
|
|
552
|
+
}>;
|
|
553
|
+
}, "strip", z.ZodTypeAny, {
|
|
554
|
+
paymentPayload: {
|
|
555
|
+
scheme: "exact";
|
|
556
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
557
|
+
x402Version: number;
|
|
558
|
+
payload: {
|
|
559
|
+
signature: string;
|
|
560
|
+
authorization: {
|
|
561
|
+
from: string;
|
|
562
|
+
to: string;
|
|
563
|
+
value: string;
|
|
564
|
+
validAfter: string;
|
|
565
|
+
validBefore: string;
|
|
566
|
+
nonce: string;
|
|
567
|
+
};
|
|
568
|
+
} | {
|
|
569
|
+
transaction: string;
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
paymentRequirements: {
|
|
573
|
+
scheme: "exact";
|
|
574
|
+
description: string;
|
|
575
|
+
asset: string;
|
|
576
|
+
maxAmountRequired: string;
|
|
577
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
578
|
+
resource: string;
|
|
579
|
+
mimeType: string;
|
|
580
|
+
payTo: string;
|
|
581
|
+
maxTimeoutSeconds: number;
|
|
582
|
+
outputSchema?: Record<string, any> | undefined;
|
|
583
|
+
extra?: Record<string, any> | undefined;
|
|
584
|
+
};
|
|
585
|
+
}, {
|
|
586
|
+
paymentPayload: {
|
|
587
|
+
scheme: "exact";
|
|
588
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
589
|
+
x402Version: number;
|
|
590
|
+
payload: {
|
|
591
|
+
signature: string;
|
|
592
|
+
authorization: {
|
|
593
|
+
from: string;
|
|
594
|
+
to: string;
|
|
595
|
+
value: string;
|
|
596
|
+
validAfter: string;
|
|
597
|
+
validBefore: string;
|
|
598
|
+
nonce: string;
|
|
599
|
+
};
|
|
600
|
+
} | {
|
|
601
|
+
transaction: string;
|
|
602
|
+
};
|
|
603
|
+
};
|
|
604
|
+
paymentRequirements: {
|
|
605
|
+
scheme: "exact";
|
|
606
|
+
description: string;
|
|
607
|
+
asset: string;
|
|
608
|
+
maxAmountRequired: string;
|
|
609
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
610
|
+
resource: string;
|
|
611
|
+
mimeType: string;
|
|
612
|
+
payTo: string;
|
|
613
|
+
maxTimeoutSeconds: number;
|
|
614
|
+
outputSchema?: Record<string, any> | undefined;
|
|
615
|
+
extra?: Record<string, any> | undefined;
|
|
616
|
+
};
|
|
617
|
+
}>;
|
|
618
|
+
type SettleRequest = z.infer<typeof SettleRequestSchema>;
|
|
619
|
+
declare const VerifyRequestSchema: z.ZodObject<{
|
|
620
|
+
paymentPayload: z.ZodObject<{
|
|
621
|
+
x402Version: z.ZodEffects<z.ZodNumber, number, number>;
|
|
622
|
+
scheme: z.ZodEnum<["exact"]>;
|
|
623
|
+
network: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
|
|
624
|
+
payload: z.ZodUnion<[z.ZodObject<{
|
|
625
|
+
signature: z.ZodString;
|
|
626
|
+
authorization: z.ZodObject<{
|
|
627
|
+
from: z.ZodString;
|
|
628
|
+
to: z.ZodString;
|
|
629
|
+
value: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
630
|
+
validAfter: z.ZodEffects<z.ZodString, string, string>;
|
|
631
|
+
validBefore: z.ZodEffects<z.ZodString, string, string>;
|
|
632
|
+
nonce: z.ZodString;
|
|
633
|
+
}, "strip", z.ZodTypeAny, {
|
|
634
|
+
from: string;
|
|
635
|
+
to: string;
|
|
636
|
+
value: string;
|
|
637
|
+
validAfter: string;
|
|
638
|
+
validBefore: string;
|
|
639
|
+
nonce: string;
|
|
640
|
+
}, {
|
|
641
|
+
from: string;
|
|
642
|
+
to: string;
|
|
643
|
+
value: string;
|
|
644
|
+
validAfter: string;
|
|
645
|
+
validBefore: string;
|
|
646
|
+
nonce: string;
|
|
647
|
+
}>;
|
|
648
|
+
}, "strip", z.ZodTypeAny, {
|
|
649
|
+
signature: string;
|
|
650
|
+
authorization: {
|
|
651
|
+
from: string;
|
|
652
|
+
to: string;
|
|
653
|
+
value: string;
|
|
654
|
+
validAfter: string;
|
|
655
|
+
validBefore: string;
|
|
656
|
+
nonce: string;
|
|
657
|
+
};
|
|
658
|
+
}, {
|
|
659
|
+
signature: string;
|
|
660
|
+
authorization: {
|
|
661
|
+
from: string;
|
|
662
|
+
to: string;
|
|
663
|
+
value: string;
|
|
664
|
+
validAfter: string;
|
|
665
|
+
validBefore: string;
|
|
666
|
+
nonce: string;
|
|
667
|
+
};
|
|
668
|
+
}>, z.ZodObject<{
|
|
669
|
+
transaction: z.ZodString;
|
|
670
|
+
}, "strip", z.ZodTypeAny, {
|
|
671
|
+
transaction: string;
|
|
672
|
+
}, {
|
|
673
|
+
transaction: string;
|
|
674
|
+
}>]>;
|
|
675
|
+
}, "strip", z.ZodTypeAny, {
|
|
676
|
+
scheme: "exact";
|
|
677
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
678
|
+
x402Version: number;
|
|
679
|
+
payload: {
|
|
680
|
+
signature: string;
|
|
681
|
+
authorization: {
|
|
682
|
+
from: string;
|
|
683
|
+
to: string;
|
|
684
|
+
value: string;
|
|
685
|
+
validAfter: string;
|
|
686
|
+
validBefore: string;
|
|
687
|
+
nonce: string;
|
|
688
|
+
};
|
|
689
|
+
} | {
|
|
690
|
+
transaction: string;
|
|
691
|
+
};
|
|
692
|
+
}, {
|
|
693
|
+
scheme: "exact";
|
|
694
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
695
|
+
x402Version: number;
|
|
696
|
+
payload: {
|
|
697
|
+
signature: string;
|
|
698
|
+
authorization: {
|
|
699
|
+
from: string;
|
|
700
|
+
to: string;
|
|
701
|
+
value: string;
|
|
702
|
+
validAfter: string;
|
|
703
|
+
validBefore: string;
|
|
704
|
+
nonce: string;
|
|
705
|
+
};
|
|
706
|
+
} | {
|
|
707
|
+
transaction: string;
|
|
708
|
+
};
|
|
709
|
+
}>;
|
|
710
|
+
paymentRequirements: z.ZodObject<{
|
|
711
|
+
scheme: z.ZodEnum<["exact"]>;
|
|
712
|
+
network: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
|
|
713
|
+
maxAmountRequired: z.ZodEffects<z.ZodString, string, string>;
|
|
714
|
+
resource: z.ZodString;
|
|
715
|
+
description: z.ZodString;
|
|
716
|
+
mimeType: z.ZodString;
|
|
717
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
718
|
+
payTo: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
719
|
+
maxTimeoutSeconds: z.ZodNumber;
|
|
720
|
+
asset: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
721
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
722
|
+
}, "strip", z.ZodTypeAny, {
|
|
723
|
+
scheme: "exact";
|
|
724
|
+
description: string;
|
|
725
|
+
asset: string;
|
|
726
|
+
maxAmountRequired: string;
|
|
727
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
728
|
+
resource: string;
|
|
729
|
+
mimeType: string;
|
|
730
|
+
payTo: string;
|
|
731
|
+
maxTimeoutSeconds: number;
|
|
732
|
+
outputSchema?: Record<string, any> | undefined;
|
|
733
|
+
extra?: Record<string, any> | undefined;
|
|
734
|
+
}, {
|
|
735
|
+
scheme: "exact";
|
|
736
|
+
description: string;
|
|
737
|
+
asset: string;
|
|
738
|
+
maxAmountRequired: string;
|
|
739
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
740
|
+
resource: string;
|
|
741
|
+
mimeType: string;
|
|
742
|
+
payTo: string;
|
|
743
|
+
maxTimeoutSeconds: number;
|
|
744
|
+
outputSchema?: Record<string, any> | undefined;
|
|
745
|
+
extra?: Record<string, any> | undefined;
|
|
746
|
+
}>;
|
|
747
|
+
}, "strip", z.ZodTypeAny, {
|
|
748
|
+
paymentPayload: {
|
|
749
|
+
scheme: "exact";
|
|
750
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
751
|
+
x402Version: number;
|
|
752
|
+
payload: {
|
|
753
|
+
signature: string;
|
|
754
|
+
authorization: {
|
|
755
|
+
from: string;
|
|
756
|
+
to: string;
|
|
757
|
+
value: string;
|
|
758
|
+
validAfter: string;
|
|
759
|
+
validBefore: string;
|
|
760
|
+
nonce: string;
|
|
761
|
+
};
|
|
762
|
+
} | {
|
|
763
|
+
transaction: string;
|
|
764
|
+
};
|
|
765
|
+
};
|
|
766
|
+
paymentRequirements: {
|
|
767
|
+
scheme: "exact";
|
|
768
|
+
description: string;
|
|
769
|
+
asset: string;
|
|
770
|
+
maxAmountRequired: string;
|
|
771
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
772
|
+
resource: string;
|
|
773
|
+
mimeType: string;
|
|
774
|
+
payTo: string;
|
|
775
|
+
maxTimeoutSeconds: number;
|
|
776
|
+
outputSchema?: Record<string, any> | undefined;
|
|
777
|
+
extra?: Record<string, any> | undefined;
|
|
778
|
+
};
|
|
779
|
+
}, {
|
|
780
|
+
paymentPayload: {
|
|
781
|
+
scheme: "exact";
|
|
782
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
783
|
+
x402Version: number;
|
|
784
|
+
payload: {
|
|
785
|
+
signature: string;
|
|
786
|
+
authorization: {
|
|
787
|
+
from: string;
|
|
788
|
+
to: string;
|
|
789
|
+
value: string;
|
|
790
|
+
validAfter: string;
|
|
791
|
+
validBefore: string;
|
|
792
|
+
nonce: string;
|
|
793
|
+
};
|
|
794
|
+
} | {
|
|
795
|
+
transaction: string;
|
|
796
|
+
};
|
|
797
|
+
};
|
|
798
|
+
paymentRequirements: {
|
|
799
|
+
scheme: "exact";
|
|
800
|
+
description: string;
|
|
801
|
+
asset: string;
|
|
802
|
+
maxAmountRequired: string;
|
|
803
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
804
|
+
resource: string;
|
|
805
|
+
mimeType: string;
|
|
806
|
+
payTo: string;
|
|
807
|
+
maxTimeoutSeconds: number;
|
|
808
|
+
outputSchema?: Record<string, any> | undefined;
|
|
809
|
+
extra?: Record<string, any> | undefined;
|
|
810
|
+
};
|
|
811
|
+
}>;
|
|
812
|
+
type VerifyRequest = z.infer<typeof VerifyRequestSchema>;
|
|
813
|
+
declare const VerifyResponseSchema: z.ZodObject<{
|
|
814
|
+
isValid: z.ZodBoolean;
|
|
815
|
+
invalidReason: z.ZodOptional<z.ZodEnum<["insufficient_funds", "invalid_exact_evm_payload_authorization_valid_after", "invalid_exact_evm_payload_authorization_valid_before", "invalid_exact_evm_payload_authorization_value", "invalid_exact_evm_payload_signature", "invalid_exact_evm_payload_recipient_mismatch", "invalid_exact_svm_payload_transaction", "invalid_exact_svm_payload_transaction_amount_mismatch", "invalid_exact_svm_payload_transaction_create_ata_instruction", "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee", "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset", "invalid_exact_svm_payload_transaction_instructions", "invalid_exact_svm_payload_transaction_instructions_length", "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction", "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction", "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high", "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked", "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked", "invalid_exact_svm_payload_transaction_not_a_transfer_instruction", "invalid_exact_svm_payload_transaction_receiver_ata_not_found", "invalid_exact_svm_payload_transaction_sender_ata_not_found", "invalid_exact_svm_payload_transaction_simulation_failed", "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata", "invalid_network", "invalid_payload", "invalid_payment_requirements", "invalid_scheme", "invalid_payment", "payment_expired", "unsupported_scheme", "invalid_x402_version", "invalid_transaction_state", "invalid_x402_version", "settle_exact_svm_block_height_exceeded", "settle_exact_svm_transaction_confirmation_timed_out", "unsupported_scheme", "unexpected_settle_error", "unexpected_verify_error"]>>;
|
|
816
|
+
payer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
817
|
+
}, "strip", z.ZodTypeAny, {
|
|
818
|
+
isValid: boolean;
|
|
819
|
+
invalidReason?: "invalid_exact_svm_payload_transaction" | "insufficient_funds" | "invalid_exact_evm_payload_authorization_valid_after" | "invalid_exact_evm_payload_authorization_valid_before" | "invalid_exact_evm_payload_authorization_value" | "invalid_exact_evm_payload_signature" | "invalid_exact_evm_payload_recipient_mismatch" | "invalid_exact_svm_payload_transaction_amount_mismatch" | "invalid_exact_svm_payload_transaction_create_ata_instruction" | "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee" | "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset" | "invalid_exact_svm_payload_transaction_instructions" | "invalid_exact_svm_payload_transaction_instructions_length" | "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction" | "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction" | "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high" | "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked" | "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked" | "invalid_exact_svm_payload_transaction_not_a_transfer_instruction" | "invalid_exact_svm_payload_transaction_receiver_ata_not_found" | "invalid_exact_svm_payload_transaction_sender_ata_not_found" | "invalid_exact_svm_payload_transaction_simulation_failed" | "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata" | "invalid_network" | "invalid_payload" | "invalid_payment_requirements" | "invalid_scheme" | "invalid_payment" | "payment_expired" | "unsupported_scheme" | "invalid_x402_version" | "invalid_transaction_state" | "settle_exact_svm_block_height_exceeded" | "settle_exact_svm_transaction_confirmation_timed_out" | "unexpected_settle_error" | "unexpected_verify_error" | undefined;
|
|
820
|
+
payer?: string | undefined;
|
|
821
|
+
}, {
|
|
822
|
+
isValid: boolean;
|
|
823
|
+
invalidReason?: "invalid_exact_svm_payload_transaction" | "insufficient_funds" | "invalid_exact_evm_payload_authorization_valid_after" | "invalid_exact_evm_payload_authorization_valid_before" | "invalid_exact_evm_payload_authorization_value" | "invalid_exact_evm_payload_signature" | "invalid_exact_evm_payload_recipient_mismatch" | "invalid_exact_svm_payload_transaction_amount_mismatch" | "invalid_exact_svm_payload_transaction_create_ata_instruction" | "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee" | "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset" | "invalid_exact_svm_payload_transaction_instructions" | "invalid_exact_svm_payload_transaction_instructions_length" | "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction" | "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction" | "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high" | "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked" | "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked" | "invalid_exact_svm_payload_transaction_not_a_transfer_instruction" | "invalid_exact_svm_payload_transaction_receiver_ata_not_found" | "invalid_exact_svm_payload_transaction_sender_ata_not_found" | "invalid_exact_svm_payload_transaction_simulation_failed" | "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata" | "invalid_network" | "invalid_payload" | "invalid_payment_requirements" | "invalid_scheme" | "invalid_payment" | "payment_expired" | "unsupported_scheme" | "invalid_x402_version" | "invalid_transaction_state" | "settle_exact_svm_block_height_exceeded" | "settle_exact_svm_transaction_confirmation_timed_out" | "unexpected_settle_error" | "unexpected_verify_error" | undefined;
|
|
824
|
+
payer?: string | undefined;
|
|
825
|
+
}>;
|
|
826
|
+
type VerifyResponse = z.infer<typeof VerifyResponseSchema>;
|
|
827
|
+
declare const SettleResponseSchema: z.ZodObject<{
|
|
828
|
+
success: z.ZodBoolean;
|
|
829
|
+
errorReason: z.ZodOptional<z.ZodEnum<["insufficient_funds", "invalid_exact_evm_payload_authorization_valid_after", "invalid_exact_evm_payload_authorization_valid_before", "invalid_exact_evm_payload_authorization_value", "invalid_exact_evm_payload_signature", "invalid_exact_evm_payload_recipient_mismatch", "invalid_exact_svm_payload_transaction", "invalid_exact_svm_payload_transaction_amount_mismatch", "invalid_exact_svm_payload_transaction_create_ata_instruction", "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee", "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset", "invalid_exact_svm_payload_transaction_instructions", "invalid_exact_svm_payload_transaction_instructions_length", "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction", "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction", "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high", "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked", "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked", "invalid_exact_svm_payload_transaction_not_a_transfer_instruction", "invalid_exact_svm_payload_transaction_receiver_ata_not_found", "invalid_exact_svm_payload_transaction_sender_ata_not_found", "invalid_exact_svm_payload_transaction_simulation_failed", "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata", "invalid_network", "invalid_payload", "invalid_payment_requirements", "invalid_scheme", "invalid_payment", "payment_expired", "unsupported_scheme", "invalid_x402_version", "invalid_transaction_state", "invalid_x402_version", "settle_exact_svm_block_height_exceeded", "settle_exact_svm_transaction_confirmation_timed_out", "unsupported_scheme", "unexpected_settle_error", "unexpected_verify_error"]>>;
|
|
830
|
+
payer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
831
|
+
transaction: z.ZodString;
|
|
832
|
+
network: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
|
|
833
|
+
}, "strip", z.ZodTypeAny, {
|
|
834
|
+
transaction: string;
|
|
835
|
+
success: boolean;
|
|
836
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
837
|
+
payer?: string | undefined;
|
|
838
|
+
errorReason?: "invalid_exact_svm_payload_transaction" | "insufficient_funds" | "invalid_exact_evm_payload_authorization_valid_after" | "invalid_exact_evm_payload_authorization_valid_before" | "invalid_exact_evm_payload_authorization_value" | "invalid_exact_evm_payload_signature" | "invalid_exact_evm_payload_recipient_mismatch" | "invalid_exact_svm_payload_transaction_amount_mismatch" | "invalid_exact_svm_payload_transaction_create_ata_instruction" | "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee" | "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset" | "invalid_exact_svm_payload_transaction_instructions" | "invalid_exact_svm_payload_transaction_instructions_length" | "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction" | "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction" | "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high" | "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked" | "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked" | "invalid_exact_svm_payload_transaction_not_a_transfer_instruction" | "invalid_exact_svm_payload_transaction_receiver_ata_not_found" | "invalid_exact_svm_payload_transaction_sender_ata_not_found" | "invalid_exact_svm_payload_transaction_simulation_failed" | "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata" | "invalid_network" | "invalid_payload" | "invalid_payment_requirements" | "invalid_scheme" | "invalid_payment" | "payment_expired" | "unsupported_scheme" | "invalid_x402_version" | "invalid_transaction_state" | "settle_exact_svm_block_height_exceeded" | "settle_exact_svm_transaction_confirmation_timed_out" | "unexpected_settle_error" | "unexpected_verify_error" | undefined;
|
|
839
|
+
}, {
|
|
840
|
+
transaction: string;
|
|
841
|
+
success: boolean;
|
|
842
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
843
|
+
payer?: string | undefined;
|
|
844
|
+
errorReason?: "invalid_exact_svm_payload_transaction" | "insufficient_funds" | "invalid_exact_evm_payload_authorization_valid_after" | "invalid_exact_evm_payload_authorization_valid_before" | "invalid_exact_evm_payload_authorization_value" | "invalid_exact_evm_payload_signature" | "invalid_exact_evm_payload_recipient_mismatch" | "invalid_exact_svm_payload_transaction_amount_mismatch" | "invalid_exact_svm_payload_transaction_create_ata_instruction" | "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee" | "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset" | "invalid_exact_svm_payload_transaction_instructions" | "invalid_exact_svm_payload_transaction_instructions_length" | "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction" | "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction" | "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high" | "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked" | "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked" | "invalid_exact_svm_payload_transaction_not_a_transfer_instruction" | "invalid_exact_svm_payload_transaction_receiver_ata_not_found" | "invalid_exact_svm_payload_transaction_sender_ata_not_found" | "invalid_exact_svm_payload_transaction_simulation_failed" | "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata" | "invalid_network" | "invalid_payload" | "invalid_payment_requirements" | "invalid_scheme" | "invalid_payment" | "payment_expired" | "unsupported_scheme" | "invalid_x402_version" | "invalid_transaction_state" | "settle_exact_svm_block_height_exceeded" | "settle_exact_svm_transaction_confirmation_timed_out" | "unexpected_settle_error" | "unexpected_verify_error" | undefined;
|
|
845
|
+
}>;
|
|
846
|
+
type SettleResponse = z.infer<typeof SettleResponseSchema>;
|
|
847
|
+
declare const ListDiscoveryResourcesRequestSchema: z.ZodObject<{
|
|
848
|
+
type: z.ZodOptional<z.ZodString>;
|
|
849
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
850
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
851
|
+
}, "strip", z.ZodTypeAny, {
|
|
852
|
+
type?: string | undefined;
|
|
853
|
+
limit?: number | undefined;
|
|
854
|
+
offset?: number | undefined;
|
|
855
|
+
}, {
|
|
856
|
+
type?: string | undefined;
|
|
857
|
+
limit?: number | undefined;
|
|
858
|
+
offset?: number | undefined;
|
|
859
|
+
}>;
|
|
860
|
+
type ListDiscoveryResourcesRequest = z.infer<typeof ListDiscoveryResourcesRequestSchema>;
|
|
861
|
+
declare const ListDiscoveryResourcesResponseSchema: z.ZodObject<{
|
|
862
|
+
x402Version: z.ZodEffects<z.ZodNumber, number, number>;
|
|
863
|
+
items: z.ZodArray<z.ZodObject<{
|
|
864
|
+
resource: z.ZodString;
|
|
865
|
+
type: z.ZodEnum<["http"]>;
|
|
866
|
+
x402Version: z.ZodEffects<z.ZodNumber, number, number>;
|
|
867
|
+
accepts: z.ZodArray<z.ZodObject<{
|
|
868
|
+
scheme: z.ZodEnum<["exact"]>;
|
|
869
|
+
network: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
|
|
870
|
+
maxAmountRequired: z.ZodEffects<z.ZodString, string, string>;
|
|
871
|
+
resource: z.ZodString;
|
|
872
|
+
description: z.ZodString;
|
|
873
|
+
mimeType: z.ZodString;
|
|
874
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
875
|
+
payTo: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
876
|
+
maxTimeoutSeconds: z.ZodNumber;
|
|
877
|
+
asset: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
878
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
879
|
+
}, "strip", z.ZodTypeAny, {
|
|
880
|
+
scheme: "exact";
|
|
881
|
+
description: string;
|
|
882
|
+
asset: string;
|
|
883
|
+
maxAmountRequired: string;
|
|
884
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
885
|
+
resource: string;
|
|
886
|
+
mimeType: string;
|
|
887
|
+
payTo: string;
|
|
888
|
+
maxTimeoutSeconds: number;
|
|
889
|
+
outputSchema?: Record<string, any> | undefined;
|
|
890
|
+
extra?: Record<string, any> | undefined;
|
|
891
|
+
}, {
|
|
892
|
+
scheme: "exact";
|
|
893
|
+
description: string;
|
|
894
|
+
asset: string;
|
|
895
|
+
maxAmountRequired: string;
|
|
896
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
897
|
+
resource: string;
|
|
898
|
+
mimeType: string;
|
|
899
|
+
payTo: string;
|
|
900
|
+
maxTimeoutSeconds: number;
|
|
901
|
+
outputSchema?: Record<string, any> | undefined;
|
|
902
|
+
extra?: Record<string, any> | undefined;
|
|
903
|
+
}>, "many">;
|
|
904
|
+
lastUpdated: z.ZodDate;
|
|
905
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
906
|
+
}, "strip", z.ZodTypeAny, {
|
|
907
|
+
type: "http";
|
|
908
|
+
resource: string;
|
|
909
|
+
x402Version: number;
|
|
910
|
+
accepts: {
|
|
911
|
+
scheme: "exact";
|
|
912
|
+
description: string;
|
|
913
|
+
asset: string;
|
|
914
|
+
maxAmountRequired: string;
|
|
915
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
916
|
+
resource: string;
|
|
917
|
+
mimeType: string;
|
|
918
|
+
payTo: string;
|
|
919
|
+
maxTimeoutSeconds: number;
|
|
920
|
+
outputSchema?: Record<string, any> | undefined;
|
|
921
|
+
extra?: Record<string, any> | undefined;
|
|
922
|
+
}[];
|
|
923
|
+
lastUpdated: Date;
|
|
924
|
+
metadata?: Record<string, any> | undefined;
|
|
925
|
+
}, {
|
|
926
|
+
type: "http";
|
|
927
|
+
resource: string;
|
|
928
|
+
x402Version: number;
|
|
929
|
+
accepts: {
|
|
930
|
+
scheme: "exact";
|
|
931
|
+
description: string;
|
|
932
|
+
asset: string;
|
|
933
|
+
maxAmountRequired: string;
|
|
934
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
935
|
+
resource: string;
|
|
936
|
+
mimeType: string;
|
|
937
|
+
payTo: string;
|
|
938
|
+
maxTimeoutSeconds: number;
|
|
939
|
+
outputSchema?: Record<string, any> | undefined;
|
|
940
|
+
extra?: Record<string, any> | undefined;
|
|
941
|
+
}[];
|
|
942
|
+
lastUpdated: Date;
|
|
943
|
+
metadata?: Record<string, any> | undefined;
|
|
944
|
+
}>, "many">;
|
|
945
|
+
pagination: z.ZodObject<{
|
|
946
|
+
limit: z.ZodNumber;
|
|
947
|
+
offset: z.ZodNumber;
|
|
948
|
+
total: z.ZodNumber;
|
|
949
|
+
}, "strip", z.ZodTypeAny, {
|
|
950
|
+
limit: number;
|
|
951
|
+
offset: number;
|
|
952
|
+
total: number;
|
|
953
|
+
}, {
|
|
954
|
+
limit: number;
|
|
955
|
+
offset: number;
|
|
956
|
+
total: number;
|
|
957
|
+
}>;
|
|
958
|
+
}, "strip", z.ZodTypeAny, {
|
|
959
|
+
x402Version: number;
|
|
960
|
+
items: {
|
|
961
|
+
type: "http";
|
|
962
|
+
resource: string;
|
|
963
|
+
x402Version: number;
|
|
964
|
+
accepts: {
|
|
965
|
+
scheme: "exact";
|
|
966
|
+
description: string;
|
|
967
|
+
asset: string;
|
|
968
|
+
maxAmountRequired: string;
|
|
969
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
970
|
+
resource: string;
|
|
971
|
+
mimeType: string;
|
|
972
|
+
payTo: string;
|
|
973
|
+
maxTimeoutSeconds: number;
|
|
974
|
+
outputSchema?: Record<string, any> | undefined;
|
|
975
|
+
extra?: Record<string, any> | undefined;
|
|
976
|
+
}[];
|
|
977
|
+
lastUpdated: Date;
|
|
978
|
+
metadata?: Record<string, any> | undefined;
|
|
979
|
+
}[];
|
|
980
|
+
pagination: {
|
|
981
|
+
limit: number;
|
|
982
|
+
offset: number;
|
|
983
|
+
total: number;
|
|
984
|
+
};
|
|
985
|
+
}, {
|
|
986
|
+
x402Version: number;
|
|
987
|
+
items: {
|
|
988
|
+
type: "http";
|
|
989
|
+
resource: string;
|
|
990
|
+
x402Version: number;
|
|
991
|
+
accepts: {
|
|
992
|
+
scheme: "exact";
|
|
993
|
+
description: string;
|
|
994
|
+
asset: string;
|
|
995
|
+
maxAmountRequired: string;
|
|
996
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
997
|
+
resource: string;
|
|
998
|
+
mimeType: string;
|
|
999
|
+
payTo: string;
|
|
1000
|
+
maxTimeoutSeconds: number;
|
|
1001
|
+
outputSchema?: Record<string, any> | undefined;
|
|
1002
|
+
extra?: Record<string, any> | undefined;
|
|
1003
|
+
}[];
|
|
1004
|
+
lastUpdated: Date;
|
|
1005
|
+
metadata?: Record<string, any> | undefined;
|
|
1006
|
+
}[];
|
|
1007
|
+
pagination: {
|
|
1008
|
+
limit: number;
|
|
1009
|
+
offset: number;
|
|
1010
|
+
total: number;
|
|
1011
|
+
};
|
|
1012
|
+
}>;
|
|
1013
|
+
type ListDiscoveryResourcesResponse = z.infer<typeof ListDiscoveryResourcesResponseSchema>;
|
|
1014
|
+
declare const SupportedPaymentKindSchema: z.ZodObject<{
|
|
1015
|
+
x402Version: z.ZodEffects<z.ZodNumber, number, number>;
|
|
1016
|
+
scheme: z.ZodEnum<["exact"]>;
|
|
1017
|
+
network: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
|
|
1018
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
1019
|
+
}, "strip", z.ZodTypeAny, {
|
|
1020
|
+
scheme: "exact";
|
|
1021
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
1022
|
+
x402Version: number;
|
|
1023
|
+
extra?: Record<string, any> | undefined;
|
|
1024
|
+
}, {
|
|
1025
|
+
scheme: "exact";
|
|
1026
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
1027
|
+
x402Version: number;
|
|
1028
|
+
extra?: Record<string, any> | undefined;
|
|
1029
|
+
}>;
|
|
1030
|
+
type SupportedPaymentKind = z.infer<typeof SupportedPaymentKindSchema>;
|
|
1031
|
+
declare const SupportedPaymentKindsResponseSchema: z.ZodObject<{
|
|
1032
|
+
kinds: z.ZodArray<z.ZodObject<{
|
|
1033
|
+
x402Version: z.ZodEffects<z.ZodNumber, number, number>;
|
|
1034
|
+
scheme: z.ZodEnum<["exact"]>;
|
|
1035
|
+
network: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
|
|
1036
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
1037
|
+
}, "strip", z.ZodTypeAny, {
|
|
1038
|
+
scheme: "exact";
|
|
1039
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
1040
|
+
x402Version: number;
|
|
1041
|
+
extra?: Record<string, any> | undefined;
|
|
1042
|
+
}, {
|
|
1043
|
+
scheme: "exact";
|
|
1044
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
1045
|
+
x402Version: number;
|
|
1046
|
+
extra?: Record<string, any> | undefined;
|
|
1047
|
+
}>, "many">;
|
|
1048
|
+
}, "strip", z.ZodTypeAny, {
|
|
1049
|
+
kinds: {
|
|
1050
|
+
scheme: "exact";
|
|
1051
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
1052
|
+
x402Version: number;
|
|
1053
|
+
extra?: Record<string, any> | undefined;
|
|
1054
|
+
}[];
|
|
1055
|
+
}, {
|
|
1056
|
+
kinds: {
|
|
1057
|
+
scheme: "exact";
|
|
1058
|
+
network: "base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana";
|
|
1059
|
+
x402Version: number;
|
|
1060
|
+
extra?: Record<string, any> | undefined;
|
|
1061
|
+
}[];
|
|
1062
|
+
}>;
|
|
1063
|
+
type SupportedPaymentKindsResponse = z.infer<typeof SupportedPaymentKindsResponseSchema>;
|
|
1064
|
+
|
|
1065
|
+
export { SupportedPaymentKindSchema as A, type SupportedPaymentKind as B, SupportedPaymentKindsResponseSchema as C, DiscoveredResourceSchema as D, type ExactSvmPayload as E, type SupportedPaymentKindsResponse as F, type HTTPVerbs as H, ListDiscoveryResourcesRequestSchema as L, type PaymentRequirements as P, RequestStructureSchema as R, type SettleResponse as S, type UnsignedPaymentPayload as U, VerifyRequestSchema as V, type PaymentPayload as a, ErrorReasons as b, PaymentRequirementsSchema as c, ExactEvmPayloadAuthorizationSchema as d, type ExactEvmPayloadAuthorization as e, ExactEvmPayloadSchema as f, type ExactEvmPayload as g, ExactSvmPayloadSchema as h, PaymentPayloadSchema as i, x402ResponseSchema as j, type x402Response as k, HTTPRequestStructureSchema as l, type HTTPRequestStructure as m, type RequestStructure as n, type DiscoveredResource as o, SettleRequestSchema as p, type SettleRequest as q, type VerifyRequest as r, schemes as s, VerifyResponseSchema as t, type VerifyResponse as u, SettleResponseSchema as v, type ListDiscoveryResourcesRequest as w, x402Versions as x, ListDiscoveryResourcesResponseSchema as y, type ListDiscoveryResourcesResponse as z };
|