sf-x402x 0.6.6-patch.3

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.
Files changed (92) hide show
  1. package/README.md +60 -0
  2. package/dist/cjs/client/index.d.ts +64 -0
  3. package/dist/cjs/client/index.js +811 -0
  4. package/dist/cjs/client/index.js.map +1 -0
  5. package/dist/cjs/config-CFBSAuxW.d.ts +10 -0
  6. package/dist/cjs/config-Dfuvno71.d.ts +19 -0
  7. package/dist/cjs/facilitator/index.d.ts +42 -0
  8. package/dist/cjs/facilitator/index.js +1827 -0
  9. package/dist/cjs/facilitator/index.js.map +1 -0
  10. package/dist/cjs/index.d.ts +16 -0
  11. package/dist/cjs/index.js +2207 -0
  12. package/dist/cjs/index.js.map +1 -0
  13. package/dist/cjs/middleware-BcYD9vqv.d.ts +93 -0
  14. package/dist/cjs/middleware-DagbDyNz.d.ts +93 -0
  15. package/dist/cjs/network--RYzQfBg.d.ts +11 -0
  16. package/dist/cjs/network-BGTUrx-D.d.ts +11 -0
  17. package/dist/cjs/paywall/index.d.ts +30 -0
  18. package/dist/cjs/paywall/index.js +141 -0
  19. package/dist/cjs/paywall/index.js.map +1 -0
  20. package/dist/cjs/rpc-De2c0oKR.d.ts +35 -0
  21. package/dist/cjs/rpc-TVntAK7V.d.ts +35 -0
  22. package/dist/cjs/schemes/index.d.ts +298 -0
  23. package/dist/cjs/schemes/index.js +2121 -0
  24. package/dist/cjs/schemes/index.js.map +1 -0
  25. package/dist/cjs/shared/evm/index.d.ts +55 -0
  26. package/dist/cjs/shared/evm/index.js +910 -0
  27. package/dist/cjs/shared/evm/index.js.map +1 -0
  28. package/dist/cjs/shared/index.d.ts +181 -0
  29. package/dist/cjs/shared/index.js +667 -0
  30. package/dist/cjs/shared/index.js.map +1 -0
  31. package/dist/cjs/types/index.d.ts +1214 -0
  32. package/dist/cjs/types/index.js +1408 -0
  33. package/dist/cjs/types/index.js.map +1 -0
  34. package/dist/cjs/verify/index.d.ts +7 -0
  35. package/dist/cjs/verify/index.js +427 -0
  36. package/dist/cjs/verify/index.js.map +1 -0
  37. package/dist/cjs/wallet-BReyvAJs.d.ts +151 -0
  38. package/dist/cjs/wallet-BTqCm9Zp.d.ts +27 -0
  39. package/dist/cjs/wallet-DndoTf1_.d.ts +48 -0
  40. package/dist/cjs/x402Specs-7OH8g851.d.ts +1306 -0
  41. package/dist/cjs/x402Specs-CFX8TBKR.d.ts +1306 -0
  42. package/dist/esm/chunk-5UPAZUO6.mjs +90 -0
  43. package/dist/esm/chunk-5UPAZUO6.mjs.map +1 -0
  44. package/dist/esm/chunk-7CWEZNFA.mjs +812 -0
  45. package/dist/esm/chunk-7CWEZNFA.mjs.map +1 -0
  46. package/dist/esm/chunk-MWDK4RSB.mjs +620 -0
  47. package/dist/esm/chunk-MWDK4RSB.mjs.map +1 -0
  48. package/dist/esm/chunk-R2NI44QI.mjs +327 -0
  49. package/dist/esm/chunk-R2NI44QI.mjs.map +1 -0
  50. package/dist/esm/chunk-WS2W5DJT.mjs +58 -0
  51. package/dist/esm/chunk-WS2W5DJT.mjs.map +1 -0
  52. package/dist/esm/chunk-XZA3USQF.mjs +784 -0
  53. package/dist/esm/chunk-XZA3USQF.mjs.map +1 -0
  54. package/dist/esm/chunk-Z3INM7T4.mjs +106 -0
  55. package/dist/esm/chunk-Z3INM7T4.mjs.map +1 -0
  56. package/dist/esm/client/index.d.mts +64 -0
  57. package/dist/esm/client/index.mjs +17 -0
  58. package/dist/esm/client/index.mjs.map +1 -0
  59. package/dist/esm/config-CFBSAuxW.d.mts +10 -0
  60. package/dist/esm/config-Dfuvno71.d.mts +19 -0
  61. package/dist/esm/facilitator/index.d.mts +42 -0
  62. package/dist/esm/facilitator/index.mjs +14 -0
  63. package/dist/esm/facilitator/index.mjs.map +1 -0
  64. package/dist/esm/index.d.mts +16 -0
  65. package/dist/esm/index.mjs +28 -0
  66. package/dist/esm/index.mjs.map +1 -0
  67. package/dist/esm/middleware-CAOp-bv4.d.mts +93 -0
  68. package/dist/esm/network--RYzQfBg.d.mts +11 -0
  69. package/dist/esm/paywall/index.d.mts +30 -0
  70. package/dist/esm/paywall/index.mjs +46 -0
  71. package/dist/esm/paywall/index.mjs.map +1 -0
  72. package/dist/esm/rpc-22QIQWIu.d.mts +35 -0
  73. package/dist/esm/schemes/index.d.mts +298 -0
  74. package/dist/esm/schemes/index.mjs +16 -0
  75. package/dist/esm/schemes/index.mjs.map +1 -0
  76. package/dist/esm/shared/evm/index.d.mts +55 -0
  77. package/dist/esm/shared/evm/index.mjs +18 -0
  78. package/dist/esm/shared/evm/index.mjs.map +1 -0
  79. package/dist/esm/shared/index.d.mts +181 -0
  80. package/dist/esm/shared/index.mjs +31 -0
  81. package/dist/esm/shared/index.mjs.map +1 -0
  82. package/dist/esm/types/index.d.mts +1214 -0
  83. package/dist/esm/types/index.mjs +81 -0
  84. package/dist/esm/types/index.mjs.map +1 -0
  85. package/dist/esm/verify/index.d.mts +7 -0
  86. package/dist/esm/verify/index.mjs +105 -0
  87. package/dist/esm/verify/index.mjs.map +1 -0
  88. package/dist/esm/wallet-BReyvAJs.d.mts +151 -0
  89. package/dist/esm/wallet-BTqCm9Zp.d.mts +27 -0
  90. package/dist/esm/wallet-C9iHSQbd.d.mts +48 -0
  91. package/dist/esm/x402Specs-7OH8g851.d.mts +1306 -0
  92. package/package.json +152 -0
@@ -0,0 +1,35 @@
1
+ import { RpcDevnet, SolanaRpcApiDevnet, RpcMainnet, SolanaRpcApiMainnet, RpcSubscriptionsFromTransport, SolanaRpcSubscriptionsApi, RpcSubscriptionsTransportFromClusterUrl, ClusterUrl } from '@solana/kit';
2
+ import { N as Network } from './network-BGTUrx-D.js';
3
+
4
+ /**
5
+ * Creates a Solana RPC client for the devnet network.
6
+ *
7
+ * @param url - Optional URL of the devnet network.
8
+ * @returns A Solana RPC client.
9
+ */
10
+ declare function createDevnetRpcClient(url?: string): RpcDevnet<SolanaRpcApiDevnet>;
11
+ /**
12
+ * Creates a Solana RPC client for the mainnet network.
13
+ *
14
+ * @param url - Optional URL of the mainnet network.
15
+ * @returns A Solana RPC client.
16
+ */
17
+ declare function createMainnetRpcClient(url?: string): RpcMainnet<SolanaRpcApiMainnet>;
18
+ /**
19
+ * Gets the RPC client for the given network.
20
+ *
21
+ * @param network - The network to get the RPC client for
22
+ * @param url - Optional URL of the network. If not provided, the default URL will be used.
23
+ * @returns The RPC client for the given network
24
+ */
25
+ declare function getRpcClient(network: Network, url?: string): RpcDevnet<SolanaRpcApiDevnet> | RpcMainnet<SolanaRpcApiMainnet>;
26
+ /**
27
+ * Gets the RPC subscriptions for the given network.
28
+ *
29
+ * @param network - The network to get the RPC subscriptions for
30
+ * @param url - Optional URL of the network. If not provided, the default URL will be used.
31
+ * @returns The RPC subscriptions for the given network
32
+ */
33
+ declare function getRpcSubscriptions(network: Network, url?: string): RpcSubscriptionsFromTransport<SolanaRpcSubscriptionsApi, RpcSubscriptionsTransportFromClusterUrl<ClusterUrl>>;
34
+
35
+ export { createMainnetRpcClient as a, getRpcSubscriptions as b, createDevnetRpcClient as c, getRpcClient as g };
@@ -0,0 +1,35 @@
1
+ import { RpcDevnet, SolanaRpcApiDevnet, RpcMainnet, SolanaRpcApiMainnet, RpcSubscriptionsFromTransport, SolanaRpcSubscriptionsApi, RpcSubscriptionsTransportFromClusterUrl, ClusterUrl } from '@solana/kit';
2
+ import { N as Network } from './network--RYzQfBg.js';
3
+
4
+ /**
5
+ * Creates a Solana RPC client for the devnet network.
6
+ *
7
+ * @param url - Optional URL of the devnet network.
8
+ * @returns A Solana RPC client.
9
+ */
10
+ declare function createDevnetRpcClient(url?: string): RpcDevnet<SolanaRpcApiDevnet>;
11
+ /**
12
+ * Creates a Solana RPC client for the mainnet network.
13
+ *
14
+ * @param url - Optional URL of the mainnet network.
15
+ * @returns A Solana RPC client.
16
+ */
17
+ declare function createMainnetRpcClient(url?: string): RpcMainnet<SolanaRpcApiMainnet>;
18
+ /**
19
+ * Gets the RPC client for the given network.
20
+ *
21
+ * @param network - The network to get the RPC client for
22
+ * @param url - Optional URL of the network. If not provided, the default URL will be used.
23
+ * @returns The RPC client for the given network
24
+ */
25
+ declare function getRpcClient(network: Network, url?: string): RpcDevnet<SolanaRpcApiDevnet> | RpcMainnet<SolanaRpcApiMainnet>;
26
+ /**
27
+ * Gets the RPC subscriptions for the given network.
28
+ *
29
+ * @param network - The network to get the RPC subscriptions for
30
+ * @param url - Optional URL of the network. If not provided, the default URL will be used.
31
+ * @returns The RPC subscriptions for the given network
32
+ */
33
+ declare function getRpcSubscriptions(network: Network, url?: string): RpcSubscriptionsFromTransport<SolanaRpcSubscriptionsApi, RpcSubscriptionsTransportFromClusterUrl<ClusterUrl>>;
34
+
35
+ export { createMainnetRpcClient as a, getRpcSubscriptions as b, createDevnetRpcClient as c, getRpcClient as g };
@@ -0,0 +1,298 @@
1
+ import { Address, Transport, Chain, LocalAccount, Account } from 'viem';
2
+ import { S as SignerWallet, C as ConnectedClient } from '../wallet-BReyvAJs.js';
3
+ import { P as PaymentRequirements, U as UnsignedPaymentPayload, a as PaymentPayload, u as VerifyResponse, S as SettleResponse, b as ErrorReasons, E as ExactSvmPayload } from '../x402Specs-7OH8g851.js';
4
+ import { X as X402Config } from '../config-Dfuvno71.js';
5
+ import { KeyPairSigner, signTransaction, RpcDevnet, SolanaRpcApiDevnet, RpcMainnet, SolanaRpcApiMainnet, SendTransactionApi, CompilableTransactionMessage, Instruction, AccountLookupMeta, AccountMeta } from '@solana/kit';
6
+ import { b as getRpcSubscriptions } from '../rpc-TVntAK7V.js';
7
+ import * as _solana_program_token from '@solana-program/token';
8
+ import { parseTransferCheckedInstruction } from '@solana-program/token-2022';
9
+ import 'viem/chains';
10
+ import 'zod';
11
+ import '../network--RYzQfBg.js';
12
+
13
+ /**
14
+ * Prepares an unsigned payment header with the given sender address and payment requirements.
15
+ *
16
+ * @param from - The sender's address from which the payment will be made
17
+ * @param x402Version - The version of the X402 protocol to use
18
+ * @param paymentRequirements - The payment requirements containing scheme and network information
19
+ * @returns An unsigned payment payload containing authorization details
20
+ */
21
+ declare function preparePaymentHeader(from: Address, x402Version: number, paymentRequirements: PaymentRequirements): UnsignedPaymentPayload;
22
+ /**
23
+ * Signs a payment header using the provided client and payment requirements.
24
+ *
25
+ * @param client - The signer wallet instance used to sign the payment header
26
+ * @param paymentRequirements - The payment requirements containing scheme and network information
27
+ * @param unsignedPaymentHeader - The unsigned payment payload to be signed
28
+ * @returns A promise that resolves to the signed payment payload
29
+ */
30
+ declare function signPaymentHeader<transport extends Transport, chain extends Chain>(client: SignerWallet<chain, transport> | LocalAccount, paymentRequirements: PaymentRequirements, unsignedPaymentHeader: UnsignedPaymentPayload): Promise<PaymentPayload>;
31
+ /**
32
+ * Creates a complete payment payload by preparing and signing a payment header.
33
+ *
34
+ * @param client - The signer wallet instance used to create and sign the payment
35
+ * @param x402Version - The version of the X402 protocol to use
36
+ * @param paymentRequirements - The payment requirements containing scheme and network information
37
+ * @returns A promise that resolves to the complete signed payment payload
38
+ */
39
+ declare function createPayment<transport extends Transport, chain extends Chain>(client: SignerWallet<chain, transport> | LocalAccount, x402Version: number, paymentRequirements: PaymentRequirements): Promise<PaymentPayload>;
40
+ /**
41
+ * Creates and encodes a payment header for the given client and payment requirements.
42
+ *
43
+ * @param client - The signer wallet instance used to create the payment header
44
+ * @param x402Version - The version of the X402 protocol to use
45
+ * @param paymentRequirements - The payment requirements containing scheme and network information
46
+ * @returns A promise that resolves to the encoded payment header string
47
+ */
48
+ declare function createPaymentHeader$1(client: SignerWallet | LocalAccount, x402Version: number, paymentRequirements: PaymentRequirements): Promise<string>;
49
+
50
+ /**
51
+ * Verifies a payment payload against the required payment details
52
+ *
53
+ * This function performs several verification steps:
54
+ * - Verifies protocol version compatibility
55
+ * - Validates the permit signature
56
+ * - Confirms USDC contract address is correct for the chain
57
+ * - Checks permit deadline is sufficiently in the future
58
+ * - Verifies client has sufficient USDC balance
59
+ * - Ensures payment amount meets required minimum
60
+ *
61
+ * @param client - The public client used for blockchain interactions
62
+ * @param payload - The signed payment payload containing transfer parameters and signature
63
+ * @param paymentRequirements - The payment requirements that the payload must satisfy
64
+ * @returns A ValidPaymentRequest indicating if the payment is valid and any invalidation reason
65
+ */
66
+ declare function verify$1<transport extends Transport, chain extends Chain, account extends Account | undefined>(client: ConnectedClient<transport, chain, account>, payload: PaymentPayload, paymentRequirements: PaymentRequirements): Promise<VerifyResponse>;
67
+ /**
68
+ * Settles a payment by executing a USDC transferWithAuthorization transaction
69
+ *
70
+ * This function executes the actual USDC transfer using the signed authorization from the user.
71
+ * The facilitator wallet submits the transaction but does not need to hold or transfer any tokens itself.
72
+ *
73
+ * @param wallet - The facilitator wallet that will submit the transaction
74
+ * @param paymentPayload - The signed payment payload containing the transfer parameters and signature
75
+ * @param paymentRequirements - The original payment details that were used to create the payload
76
+ * @returns A PaymentExecutionResponse containing the transaction status and hash
77
+ */
78
+ declare function settle$1<transport extends Transport, chain extends Chain>(wallet: SignerWallet<chain, transport>, paymentPayload: PaymentPayload, paymentRequirements: PaymentRequirements): Promise<SettleResponse>;
79
+
80
+ /**
81
+ * Encodes a payment payload into a base64 string, ensuring bigint values are properly stringified
82
+ *
83
+ * @param payment - The payment payload to encode
84
+ * @returns A base64 encoded string representation of the payment payload
85
+ */
86
+ declare function encodePayment(payment: PaymentPayload): string;
87
+ /**
88
+ * Decodes a base64 encoded payment string back into a PaymentPayload object
89
+ *
90
+ * @param payment - The base64 encoded payment string to decode
91
+ * @returns The decoded and validated PaymentPayload object
92
+ */
93
+ declare function decodePayment(payment: string): PaymentPayload;
94
+
95
+ declare const index$2_createPayment: typeof createPayment;
96
+ declare const index$2_decodePayment: typeof decodePayment;
97
+ declare const index$2_encodePayment: typeof encodePayment;
98
+ declare const index$2_preparePaymentHeader: typeof preparePaymentHeader;
99
+ declare const index$2_signPaymentHeader: typeof signPaymentHeader;
100
+ declare namespace index$2 {
101
+ export { index$2_createPayment as createPayment, createPaymentHeader$1 as createPaymentHeader, index$2_decodePayment as decodePayment, index$2_encodePayment as encodePayment, index$2_preparePaymentHeader as preparePaymentHeader, settle$1 as settle, index$2_signPaymentHeader as signPaymentHeader, verify$1 as verify };
102
+ }
103
+
104
+ /**
105
+ * Settle the payment payload against the payment requirements.
106
+ * TODO: handle durable nonce lifetime transactions
107
+ *
108
+ * @param signer - The signer that will sign the transaction
109
+ * @param payload - The payment payload to settle
110
+ * @param paymentRequirements - The payment requirements to settle against
111
+ * @param config - Optional configuration for X402 operations (e.g., custom RPC URLs)
112
+ * @returns A SettleResponse indicating if the payment is settled and any error reason
113
+ */
114
+ declare function settle(signer: KeyPairSigner, payload: PaymentPayload, paymentRequirements: PaymentRequirements, config?: X402Config): Promise<SettleResponse>;
115
+ /**
116
+ * Send a signed transaction to the RPC.
117
+ * TODO: should this be moved to the shared/svm/rpc.ts file?
118
+ *
119
+ * @param signedTransaction - The signed transaction to send
120
+ * @param rpc - The RPC client to use to send the transaction
121
+ * @param sendTxConfig - The configuration for the transaction send
122
+ * @returns The signature of the sent transaction
123
+ */
124
+ declare function sendSignedTransaction(signedTransaction: Awaited<ReturnType<typeof signTransaction>>, rpc: RpcDevnet<SolanaRpcApiDevnet> | RpcMainnet<SolanaRpcApiMainnet>, sendTxConfig?: Parameters<SendTransactionApi["sendTransaction"]>[1]): Promise<string>;
125
+ /**
126
+ * Confirm a signed transaction.
127
+ * TODO: can some of this be refactored to be moved to the shared/svm/rpc.ts file?
128
+ * TODO: should the commitment and the timeout be passed in as parameters?
129
+ *
130
+ * @param signedTransaction - The signed transaction to confirm
131
+ * @param rpc - The RPC client to use to confirm the transaction
132
+ * @param rpcSubscriptions - The RPC subscriptions to use to confirm the transaction
133
+ * @returns The success and signature of the confirmed transaction
134
+ */
135
+ declare function confirmSignedTransaction(signedTransaction: Awaited<ReturnType<typeof signTransaction>>, rpc: RpcDevnet<SolanaRpcApiDevnet> | RpcMainnet<SolanaRpcApiMainnet>, rpcSubscriptions: ReturnType<typeof getRpcSubscriptions>): Promise<{
136
+ success: boolean;
137
+ errorReason?: (typeof ErrorReasons)[number];
138
+ signature: string;
139
+ }>;
140
+ /**
141
+ * Send and confirm a signed transaction.
142
+ *
143
+ * @param signedTransaction - The signed transaction to send and confirm
144
+ * @param rpc - The RPC client to use to send and confirm the transaction
145
+ * @param rpcSubscriptions - The RPC subscriptions to use to send and confirm the transaction
146
+ * @returns The success and signature of the confirmed transaction
147
+ */
148
+ declare function sendAndConfirmSignedTransaction(signedTransaction: Awaited<ReturnType<typeof signTransaction>>, rpc: RpcDevnet<SolanaRpcApiDevnet> | RpcMainnet<SolanaRpcApiMainnet>, rpcSubscriptions: ReturnType<typeof getRpcSubscriptions>): Promise<{
149
+ success: boolean;
150
+ errorReason?: (typeof ErrorReasons)[number];
151
+ signature: string;
152
+ }>;
153
+
154
+ /**
155
+ * Verify the payment payload against the payment requirements.
156
+ *
157
+ * @param signer - The signer that will sign and simulate the transaction
158
+ * @param payload - The payment payload to verify
159
+ * @param paymentRequirements - The payment requirements to verify against
160
+ * @param config - Optional configuration for X402 operations (e.g., custom RPC URLs)
161
+ * @returns A VerifyResponse indicating if the payment is valid and any invalidation reason
162
+ */
163
+ declare function verify(signer: KeyPairSigner, payload: PaymentPayload, paymentRequirements: PaymentRequirements, config?: X402Config): Promise<VerifyResponse>;
164
+ /**
165
+ * Verify that the scheme and network are supported.
166
+ *
167
+ * @param payload - The payment payload to verify
168
+ * @param paymentRequirements - The payment requirements to verify against
169
+ */
170
+ declare function verifySchemesAndNetworks(payload: PaymentPayload, paymentRequirements: PaymentRequirements): void;
171
+ /**
172
+ * Perform transaction introspection to validate the transaction structure and transfer details.
173
+ * This function handles decoding the transaction, validating the transfer instruction,
174
+ * and verifying all transfer details against the payment requirements.
175
+ *
176
+ * @param svmPayload - The SVM payload containing the transaction
177
+ * @param paymentRequirements - The payment requirements to verify against
178
+ * @param config - Optional configuration for X402 operations (e.g., custom RPC URLs)
179
+ */
180
+ declare function transactionIntrospection(svmPayload: ExactSvmPayload, paymentRequirements: PaymentRequirements, config?: X402Config): Promise<void>;
181
+ /**
182
+ * Verify that the transaction contains the expected instructions.
183
+ *
184
+ * @param transactionMessage - The transaction message to verify
185
+ * @param paymentRequirements - The payment requirements to verify against
186
+ * @param rpc - The RPC client to use for verifying account existence
187
+ * @throws Error if the transaction does not contain the expected instructions
188
+ */
189
+ declare function verifyTransactionInstructions(transactionMessage: CompilableTransactionMessage, paymentRequirements: PaymentRequirements, rpc: RpcDevnet<SolanaRpcApiDevnet> | RpcMainnet<SolanaRpcApiMainnet>): Promise<void>;
190
+ /**
191
+ * Verify that the compute limit instruction is valid.
192
+ *
193
+ * @param instruction - The compute limit instruction to verify
194
+ * @throws Error if the compute limit instruction is invalid
195
+ */
196
+ declare function verifyComputeLimitInstruction(instruction: Instruction<string, readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[]>): void;
197
+ /**
198
+ * Verify that the compute price instruction is valid.
199
+ * This function throws an error if the compute unit price is greater than 5 lamports,
200
+ * to protect the facilitator against gas fee abuse from the client.
201
+ *
202
+ * @param instruction - The compute price instruction to verify
203
+ * @throws Error if the compute price instruction is invalid
204
+ */
205
+ declare function verifyComputePriceInstruction(instruction: Instruction<string, readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[]>): void;
206
+ /**
207
+ * Verify that the create ATA instruction is valid.
208
+ *
209
+ * @param instruction - The create ATA instruction to verify
210
+ * @param paymentRequirements - The payment requirements to verify against
211
+ * @throws Error if the create ATA instruction is invalid
212
+ */
213
+ declare function verifyCreateATAInstruction(instruction: Instruction<string, readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[]>, paymentRequirements: PaymentRequirements): void;
214
+ /**
215
+ * Verify that the transfer instruction is valid.
216
+ *
217
+ * @param instruction - The transfer instruction to verify
218
+ * @param paymentRequirements - The payment requirements to verify against
219
+ * @param {object} options - The options for the verification of the transfer instruction
220
+ * @param {boolean} options.txHasCreateDestATAInstruction - Whether the transaction has a create destination ATA instruction
221
+ * @param rpc - The RPC client to use for verifying account existence
222
+ * @throws Error if the transfer instruction is invalid
223
+ */
224
+ declare function verifyTransferInstruction(instruction: Instruction<string, readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[]>, paymentRequirements: PaymentRequirements, { txHasCreateDestATAInstruction }: {
225
+ txHasCreateDestATAInstruction: boolean;
226
+ }, rpc: RpcDevnet<SolanaRpcApiDevnet> | RpcMainnet<SolanaRpcApiMainnet>): Promise<void>;
227
+ /**
228
+ * Verify that the transfer checked instruction is valid.
229
+ *
230
+ * @param parsedInstruction - The parsed transfer checked instruction to verify
231
+ * @param paymentRequirements - The payment requirements to verify against
232
+ * @param {object} options - The options for the verification of the transfer checked instruction
233
+ * @param {boolean} options.txHasCreateDestATAInstruction - Whether the transaction has a create destination ATA instruction
234
+ * @param rpc - The RPC client to use for verifying account existence
235
+ * @throws Error if the transfer checked instruction is invalid
236
+ */
237
+ declare function verifyTransferCheckedInstruction(parsedInstruction: ReturnType<typeof parseTransferCheckedInstruction>, paymentRequirements: PaymentRequirements, { txHasCreateDestATAInstruction }: {
238
+ txHasCreateDestATAInstruction: boolean;
239
+ }, rpc: RpcDevnet<SolanaRpcApiDevnet> | RpcMainnet<SolanaRpcApiMainnet>): Promise<void>;
240
+ /**
241
+ * Inspect the decompiled transaction message to make sure that it is a valid
242
+ * transfer instruction.
243
+ *
244
+ * @param instruction - The instruction to get the transfer instruction from
245
+ * @returns The validated transfer instruction
246
+ * @throws Error if the instruction is not a valid transfer checked instruction
247
+ */
248
+ declare function getValidatedTransferCheckedInstruction(instruction: Instruction<string, readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[]>): _solana_program_token.ParsedTransferCheckedInstruction<string, readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[]>;
249
+
250
+ /**
251
+ * Creates and encodes a payment header for the given client and payment requirements.
252
+ *
253
+ * @param client - The signer instance used to create the payment header
254
+ * @param x402Version - The version of the X402 protocol to use
255
+ * @param paymentRequirements - The payment requirements containing scheme and network information
256
+ * @param config - Optional configuration for X402 operations (e.g., custom RPC URLs)
257
+ * @returns A promise that resolves to a base64 encoded payment header string
258
+ */
259
+ declare function createPaymentHeader(client: KeyPairSigner, x402Version: number, paymentRequirements: PaymentRequirements, config?: X402Config): Promise<string>;
260
+ /**
261
+ * Creates and signs a payment for the given client and payment requirements.
262
+ *
263
+ * @param client - The signer instance used to create and sign the payment tx
264
+ * @param x402Version - The version of the X402 protocol to use
265
+ * @param paymentRequirements - The payment requirements
266
+ * @param config - Optional configuration for X402 operations (e.g., custom RPC URLs)
267
+ * @returns A promise that resolves to a payment payload containing a base64 encoded solana token transfer tx
268
+ */
269
+ declare function createAndSignPayment(client: KeyPairSigner, x402Version: number, paymentRequirements: PaymentRequirements, config?: X402Config): Promise<PaymentPayload>;
270
+
271
+ declare const index$1_confirmSignedTransaction: typeof confirmSignedTransaction;
272
+ declare const index$1_createAndSignPayment: typeof createAndSignPayment;
273
+ declare const index$1_createPaymentHeader: typeof createPaymentHeader;
274
+ declare const index$1_getValidatedTransferCheckedInstruction: typeof getValidatedTransferCheckedInstruction;
275
+ declare const index$1_sendAndConfirmSignedTransaction: typeof sendAndConfirmSignedTransaction;
276
+ declare const index$1_sendSignedTransaction: typeof sendSignedTransaction;
277
+ declare const index$1_settle: typeof settle;
278
+ declare const index$1_transactionIntrospection: typeof transactionIntrospection;
279
+ declare const index$1_verify: typeof verify;
280
+ declare const index$1_verifyComputeLimitInstruction: typeof verifyComputeLimitInstruction;
281
+ declare const index$1_verifyComputePriceInstruction: typeof verifyComputePriceInstruction;
282
+ declare const index$1_verifyCreateATAInstruction: typeof verifyCreateATAInstruction;
283
+ declare const index$1_verifySchemesAndNetworks: typeof verifySchemesAndNetworks;
284
+ declare const index$1_verifyTransactionInstructions: typeof verifyTransactionInstructions;
285
+ declare const index$1_verifyTransferCheckedInstruction: typeof verifyTransferCheckedInstruction;
286
+ declare const index$1_verifyTransferInstruction: typeof verifyTransferInstruction;
287
+ declare namespace index$1 {
288
+ export { index$1_confirmSignedTransaction as confirmSignedTransaction, index$1_createAndSignPayment as createAndSignPayment, index$1_createPaymentHeader as createPaymentHeader, index$1_getValidatedTransferCheckedInstruction as getValidatedTransferCheckedInstruction, index$1_sendAndConfirmSignedTransaction as sendAndConfirmSignedTransaction, index$1_sendSignedTransaction as sendSignedTransaction, index$1_settle as settle, index$1_transactionIntrospection as transactionIntrospection, index$1_verify as verify, index$1_verifyComputeLimitInstruction as verifyComputeLimitInstruction, index$1_verifyComputePriceInstruction as verifyComputePriceInstruction, index$1_verifyCreateATAInstruction as verifyCreateATAInstruction, index$1_verifySchemesAndNetworks as verifySchemesAndNetworks, index$1_verifyTransactionInstructions as verifyTransactionInstructions, index$1_verifyTransferCheckedInstruction as verifyTransferCheckedInstruction, index$1_verifyTransferInstruction as verifyTransferInstruction };
289
+ }
290
+
291
+ declare const SCHEME = "exact";
292
+
293
+ declare const index_SCHEME: typeof SCHEME;
294
+ declare namespace index {
295
+ export { index_SCHEME as SCHEME, index$2 as evm, index$1 as svm };
296
+ }
297
+
298
+ export { decodePayment, encodePayment, index as exact };