@wtflabs/x402 0.0.1-beta.14 → 0.0.1-beta.16
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/dist/cjs/client/index.d.ts +1 -1
- package/dist/cjs/client/index.js +1 -1
- package/dist/cjs/client/index.js.map +1 -1
- package/dist/cjs/facilitator/index.d.ts +1 -1
- package/dist/cjs/facilitator/index.js +1169 -1077
- package/dist/cjs/facilitator/index.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1636 -1544
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/middleware-qavKyUnr.d.ts +93 -0
- package/dist/cjs/paywall/index.d.ts +1 -1
- package/dist/cjs/schemes/index.d.ts +1 -1
- package/dist/cjs/schemes/index.js +697 -605
- package/dist/cjs/schemes/index.js.map +1 -1
- package/dist/cjs/shared/index.d.ts +2 -2
- package/dist/cjs/types/index.d.ts +335 -4
- package/dist/cjs/types/index.js +426 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/verify/index.d.ts +2 -2
- package/dist/esm/{chunk-VTLJOZXM.mjs → chunk-27VV4F7H.mjs} +3 -3
- package/dist/esm/chunk-27VV4F7H.mjs.map +1 -0
- package/dist/esm/{chunk-NPWDNT2P.mjs → chunk-5UE5XTGG.mjs} +428 -1
- package/dist/esm/chunk-5UE5XTGG.mjs.map +1 -0
- package/dist/esm/{chunk-KABV25HJ.mjs → chunk-VHQZ4KRR.mjs} +3 -3
- package/dist/esm/{chunk-WCQCFJWV.mjs → chunk-YWZNW3IG.mjs} +74 -409
- package/dist/esm/chunk-YWZNW3IG.mjs.map +1 -0
- package/dist/esm/{chunk-A6TSFIQP.mjs → chunk-YZUMYCYA.mjs} +3 -3
- package/dist/esm/client/index.d.mts +1 -1
- package/dist/esm/client/index.mjs +3 -3
- package/dist/esm/facilitator/index.d.mts +1 -1
- package/dist/esm/facilitator/index.mjs +4 -4
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/{middleware-DSDucaQ5.d.mts → middleware-CFWW-MAF.d.mts} +1 -1
- package/dist/esm/paywall/index.d.mts +1 -1
- package/dist/esm/schemes/index.d.mts +1 -1
- package/dist/esm/schemes/index.mjs +3 -3
- package/dist/esm/shared/index.d.mts +2 -2
- package/dist/esm/shared/index.mjs +1 -1
- package/dist/esm/types/index.d.mts +335 -4
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/verify/index.d.mts +2 -2
- package/dist/esm/verify/index.mjs +1 -1
- package/dist/esm/x402Specs-B9zS3LnZ.d.mts +1778 -0
- package/package.json +1 -1
- package/dist/esm/chunk-NPWDNT2P.mjs.map +0 -1
- package/dist/esm/chunk-VTLJOZXM.mjs.map +0 -1
- package/dist/esm/chunk-WCQCFJWV.mjs.map +0 -1
- package/dist/{esm/x402Specs-BtRXj67U.d.mts → cjs/x402Specs-B9zS3LnZ.d.ts} +6 -6
- /package/dist/esm/{chunk-KABV25HJ.mjs.map → chunk-VHQZ4KRR.mjs.map} +0 -0
- /package/dist/esm/{chunk-A6TSFIQP.mjs.map → chunk-YZUMYCYA.mjs.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { C as CreateHeaders, l as list, s as settle, f as supported, u as useFacilitator, v as verify } from '../middleware-
|
|
1
|
+
export { C as CreateHeaders, l as list, s as settle, f as supported, u as useFacilitator, v as verify } from '../middleware-qavKyUnr.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import '../network-FrFmmiyj.js';
|
|
4
4
|
import '../wallet-SJKJpUgQ.js';
|
|
5
5
|
import 'viem';
|
|
6
6
|
import 'viem/chains';
|
|
7
|
-
import '../x402Specs-
|
|
7
|
+
import '../x402Specs-B9zS3LnZ.js';
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isSignerWallet,
|
|
10
10
|
safeBase64Decode,
|
|
11
11
|
safeBase64Encode
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5UE5XTGG.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__require
|
|
15
15
|
} from "./chunk-AQQR4PXH.mjs";
|
|
@@ -147,7 +147,7 @@ function preparePaymentHeader(from, x402Version, paymentRequirements) {
|
|
|
147
147
|
signature: void 0,
|
|
148
148
|
authorization: {
|
|
149
149
|
from,
|
|
150
|
-
to: paymentRequirements.
|
|
150
|
+
to: paymentRequirements.payTo,
|
|
151
151
|
value: paymentRequirements.maxAmountRequired,
|
|
152
152
|
validAfter: validAfter.toString(),
|
|
153
153
|
validBefore: validBefore.toString(),
|
|
@@ -346,4 +346,4 @@ export {
|
|
|
346
346
|
createPaymentHeader2,
|
|
347
347
|
createAndSignPayment
|
|
348
348
|
};
|
|
349
|
-
//# sourceMappingURL=chunk-
|
|
349
|
+
//# sourceMappingURL=chunk-27VV4F7H.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schemes/exact/evm/utils/paymentUtils.ts","../../src/schemes/exact/evm/eip3009/sign.ts","../../src/schemes/exact/evm/eip3009/client.ts","../../src/schemes/exact/svm/client.ts"],"sourcesContent":["import { safeBase64Encode, safeBase64Decode } from \"../../../../shared\";\nimport { SupportedEVMNetworks, SupportedSVMNetworks } from \"../../../../types\";\nimport {\n PaymentPayload,\n PaymentPayloadSchema,\n ExactEvmPayload,\n ExactSvmPayload,\n} from \"../../../../types/verify\";\n\n/**\n * Encodes a payment payload into a base64 string, ensuring bigint values are properly stringified\n *\n * @param payment - The payment payload to encode\n * @returns A base64 encoded string representation of the payment payload\n */\nexport function encodePayment(payment: PaymentPayload): string {\n let safe: PaymentPayload;\n\n // evm\n if (SupportedEVMNetworks.includes(payment.network)) {\n const evmPayload = payment.payload as ExactEvmPayload;\n\n // Convert bigint to string based on authorization type\n let processedPayload: ExactEvmPayload;\n\n if (evmPayload.authorizationType === \"eip3009\") {\n processedPayload = {\n ...evmPayload,\n authorization: {\n ...evmPayload.authorization,\n validAfter: evmPayload.authorization.validAfter.toString(),\n validBefore: evmPayload.authorization.validBefore.toString(),\n },\n };\n } else if (evmPayload.authorizationType === \"permit\") {\n processedPayload = {\n ...evmPayload,\n authorization: {\n ...evmPayload.authorization,\n deadline: evmPayload.authorization.deadline.toString(),\n nonce: evmPayload.authorization.nonce.toString(),\n },\n };\n } else {\n // permit2\n processedPayload = {\n ...evmPayload,\n authorization: {\n ...evmPayload.authorization,\n deadline: evmPayload.authorization.deadline.toString(),\n nonce: evmPayload.authorization.nonce.toString(),\n },\n };\n }\n\n safe = {\n ...payment,\n payload: processedPayload,\n };\n return safeBase64Encode(JSON.stringify(safe));\n }\n\n // svm\n if (SupportedSVMNetworks.includes(payment.network)) {\n safe = { ...payment, payload: payment.payload as ExactSvmPayload };\n return safeBase64Encode(JSON.stringify(safe));\n }\n\n throw new Error(\"Invalid network\");\n}\n\n/**\n * Decodes a base64 encoded payment string back into a PaymentPayload object\n *\n * @param payment - The base64 encoded payment string to decode\n * @returns The decoded and validated PaymentPayload object\n */\nexport function decodePayment(payment: string): PaymentPayload {\n const decoded = safeBase64Decode(payment);\n const parsed = JSON.parse(decoded);\n\n let obj: PaymentPayload;\n\n // evm\n if (SupportedEVMNetworks.includes(parsed.network)) {\n obj = {\n ...parsed,\n payload: parsed.payload as ExactEvmPayload,\n };\n }\n\n // svm\n else if (SupportedSVMNetworks.includes(parsed.network)) {\n obj = {\n ...parsed,\n payload: parsed.payload as ExactSvmPayload,\n };\n } else {\n throw new Error(\"Invalid network\");\n }\n\n const validated = PaymentPayloadSchema.parse(obj);\n return validated;\n}\n","import { Chain, getAddress, Hex, LocalAccount, toHex, Transport } from \"viem\";\nimport { getNetworkId } from \"../../../../shared\";\nimport {\n authorizationTypes,\n isAccount,\n isSignerWallet,\n SignerWallet,\n} from \"../../../../types/shared/evm\";\nimport { ExactEvmPayloadAuthorization, PaymentRequirements } from \"../../../../types/verify\";\n\n/**\n * Signs an EIP-3009 authorization for USDC transfer\n *\n * @param walletClient - The wallet client that will sign the authorization\n * @param params - The authorization parameters containing transfer details\n * @param params.from - The address tokens will be transferred from\n * @param params.to - The address tokens will be transferred to\n * @param params.value - The amount of USDC tokens to transfer (in base units)\n * @param params.validAfter - Unix timestamp after which the authorization becomes valid\n * @param params.validBefore - Unix timestamp before which the authorization is valid\n * @param params.nonce - Random 32-byte nonce to prevent replay attacks\n * @param paymentRequirements - The payment requirements containing asset and network information\n * @param paymentRequirements.asset - The address of the USDC contract\n * @param paymentRequirements.network - The network where the USDC contract exists\n * @param paymentRequirements.extra - The extra information containing the name and version of the ERC20 contract\n * @returns The signature for the authorization\n */\nexport async function signAuthorization<transport extends Transport, chain extends Chain>(\n walletClient: SignerWallet<chain, transport> | LocalAccount,\n { from, to, value, validAfter, validBefore, nonce }: ExactEvmPayloadAuthorization,\n { asset, network, extra }: PaymentRequirements,\n): Promise<{ signature: Hex }> {\n const chainId = getNetworkId(network);\n const name = extra?.name;\n const version = extra?.version;\n\n const data = {\n types: authorizationTypes,\n domain: {\n name,\n version,\n chainId,\n verifyingContract: getAddress(asset),\n },\n primaryType: \"TransferWithAuthorization\" as const,\n message: {\n from: getAddress(from),\n to: getAddress(to),\n value: value,\n validAfter: validAfter,\n validBefore: validBefore,\n nonce: nonce,\n },\n };\n\n if (isSignerWallet(walletClient)) {\n const signature = await walletClient.signTypedData(data);\n return {\n signature,\n };\n } else if (isAccount(walletClient) && walletClient.signTypedData) {\n const signature = await walletClient.signTypedData(data);\n return {\n signature,\n };\n } else {\n throw new Error(\"Invalid wallet client provided does not support signTypedData\");\n }\n}\n\n/**\n * Generates a random 32-byte nonce for use in authorization signatures\n *\n * @returns A random 32-byte nonce as a hex string\n */\nexport function createNonce(): Hex {\n const cryptoObj =\n typeof globalThis.crypto !== \"undefined\" &&\n typeof globalThis.crypto.getRandomValues === \"function\"\n ? globalThis.crypto\n : // Dynamic require is needed to support node.js\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n require(\"crypto\").webcrypto;\n return toHex(cryptoObj.getRandomValues(new Uint8Array(32)));\n}\n","import { Address, Chain, LocalAccount, Transport } from \"viem\";\nimport { isSignerWallet, SignerWallet } from \"../../../../types/shared/evm\";\nimport {\n PaymentRequirements,\n UnsignedEip3009PaymentPayload,\n Eip3009PaymentPayload,\n} from \"../../../../types/verify\";\nimport { createNonce, signAuthorization } from \"./sign\";\nimport { encodePayment } from \"../utils/paymentUtils\";\n\n/**\n * Prepares an unsigned EIP-3009 payment header with the given sender address and payment requirements.\n *\n * @param from - The sender's address from which the payment will be made\n * @param x402Version - The version of the X402 protocol to use\n * @param paymentRequirements - The payment requirements containing scheme and network information\n * @returns An unsigned EIP-3009 payment payload containing authorization details\n */\nexport function preparePaymentHeader(\n from: Address,\n x402Version: number,\n paymentRequirements: PaymentRequirements,\n): UnsignedEip3009PaymentPayload {\n const nonce = createNonce();\n\n const validAfter = BigInt(\n Math.floor(Date.now() / 1000) - 600, // 10 minutes before\n ).toString();\n const validBefore = BigInt(\n Math.floor(Date.now() / 1000 + paymentRequirements.maxTimeoutSeconds),\n ).toString();\n\n return {\n x402Version,\n scheme: paymentRequirements.scheme,\n network: paymentRequirements.network,\n payload: {\n authorizationType: \"eip3009\" as const,\n signature: undefined,\n authorization: {\n from,\n to: paymentRequirements.payTo as Address,\n value: paymentRequirements.maxAmountRequired,\n validAfter: validAfter.toString(),\n validBefore: validBefore.toString(),\n nonce,\n },\n },\n };\n}\n\n/**\n * Signs an EIP-3009 payment header using the provided client and payment requirements.\n *\n * @param client - The signer wallet instance used to sign the payment header\n * @param paymentRequirements - The payment requirements containing scheme and network information\n * @param unsignedPaymentHeader - The unsigned EIP-3009 payment payload to be signed\n * @returns A promise that resolves to the signed EIP-3009 payment payload\n */\nexport async function signPaymentHeader<transport extends Transport, chain extends Chain>(\n client: SignerWallet<chain, transport> | LocalAccount,\n paymentRequirements: PaymentRequirements,\n unsignedPaymentHeader: UnsignedEip3009PaymentPayload,\n): Promise<Eip3009PaymentPayload> {\n const { authorization } = unsignedPaymentHeader.payload;\n\n const { signature } = await signAuthorization(client, authorization, paymentRequirements);\n\n return {\n ...unsignedPaymentHeader,\n payload: {\n authorizationType: \"eip3009\",\n signature,\n authorization,\n },\n };\n}\n\n/**\n * Creates a complete EIP-3009 payment payload by preparing and signing a payment header.\n *\n * @param client - The signer wallet instance used to create and sign the payment\n * @param x402Version - The version of the X402 protocol to use\n * @param paymentRequirements - The payment requirements containing scheme and network information\n * @returns A promise that resolves to the complete signed EIP-3009 payment payload\n */\nexport async function createPayment<transport extends Transport, chain extends Chain>(\n client: SignerWallet<chain, transport> | LocalAccount,\n x402Version: number,\n paymentRequirements: PaymentRequirements,\n): Promise<Eip3009PaymentPayload> {\n const from = isSignerWallet(client) ? client.account!.address : client.address;\n const unsignedPaymentHeader = preparePaymentHeader(from, x402Version, paymentRequirements);\n return signPaymentHeader(client, paymentRequirements, unsignedPaymentHeader);\n}\n\n/**\n * Creates and encodes an EIP-3009 payment header for the given client and payment requirements.\n *\n * @param client - The signer wallet instance used to create the payment header\n * @param x402Version - The version of the X402 protocol to use\n * @param paymentRequirements - The payment requirements containing scheme and network information\n * @returns A promise that resolves to the encoded EIP-3009 payment header string\n */\nexport async function createPaymentHeader(\n client: SignerWallet | LocalAccount,\n x402Version: number,\n paymentRequirements: PaymentRequirements,\n): Promise<string> {\n const payment = await createPayment(client, x402Version, paymentRequirements);\n return encodePayment(payment);\n}\n","import { encodePayment } from \"../../utils\";\nimport {\n Address,\n pipe,\n createTransactionMessage,\n setTransactionMessageFeePayer,\n setTransactionMessageLifetimeUsingBlockhash,\n appendTransactionMessageInstructions,\n partiallySignTransactionMessageWithSigners,\n prependTransactionMessageInstruction,\n getBase64EncodedWireTransaction,\n type KeyPairSigner,\n fetchEncodedAccount,\n TransactionSigner,\n Instruction,\n} from \"@solana/kit\";\nimport { PaymentPayload, PaymentRequirements } from \"../../../types/verify\";\nimport { X402Config } from \"../../../types/config\";\nimport {\n fetchMint,\n findAssociatedTokenPda,\n getCreateAssociatedTokenInstruction,\n getTransferCheckedInstruction,\n TOKEN_2022_PROGRAM_ADDRESS,\n} from \"@solana-program/token-2022\";\nimport { TOKEN_PROGRAM_ADDRESS } from \"@solana-program/token\";\nimport {\n estimateComputeUnitLimitFactory,\n getSetComputeUnitLimitInstruction,\n setTransactionMessageComputeUnitPrice,\n} from \"@solana-program/compute-budget\";\nimport { getRpcClient } from \"../../../shared/svm/rpc\";\n\n/**\n * Creates and encodes a payment header for the given client and payment requirements.\n *\n * @param client - The signer instance used to create the payment header\n * @param x402Version - The version of the X402 protocol to use\n * @param paymentRequirements - The payment requirements containing scheme and network information\n * @param config - Optional configuration for X402 operations (e.g., custom RPC URLs)\n * @returns A promise that resolves to a base64 encoded payment header string\n */\nexport async function createPaymentHeader(\n client: KeyPairSigner,\n x402Version: number,\n paymentRequirements: PaymentRequirements,\n config?: X402Config,\n): Promise<string> {\n const paymentPayload = await createAndSignPayment(\n client,\n x402Version,\n paymentRequirements,\n config,\n );\n return encodePayment(paymentPayload);\n}\n\n/**\n * Creates and signs a payment for the given client and payment requirements.\n *\n * @param client - The signer instance used to create and sign the payment tx\n * @param x402Version - The version of the X402 protocol to use\n * @param paymentRequirements - The payment requirements\n * @param config - Optional configuration for X402 operations (e.g., custom RPC URLs)\n * @returns A promise that resolves to a payment payload containing a base64 encoded solana token transfer tx\n */\nexport async function createAndSignPayment(\n client: KeyPairSigner,\n x402Version: number,\n paymentRequirements: PaymentRequirements,\n config?: X402Config,\n): Promise<PaymentPayload> {\n const transactionMessage = await createTransferTransactionMessage(\n client,\n paymentRequirements,\n config,\n );\n const signedTransaction = await partiallySignTransactionMessageWithSigners(transactionMessage);\n const base64EncodedWireTransaction = getBase64EncodedWireTransaction(signedTransaction);\n\n // return payment payload\n return {\n scheme: paymentRequirements.scheme,\n network: paymentRequirements.network,\n x402Version: x402Version,\n payload: {\n transaction: base64EncodedWireTransaction,\n },\n } as PaymentPayload;\n}\n\n/**\n * Creates a transfer transaction message for the given client and payment requirements.\n *\n * @param client - The signer instance used to create the transfer transaction message\n * @param paymentRequirements - The payment requirements\n * @param config - Optional configuration for X402 operations (e.g., custom RPC URLs)\n * @returns A promise that resolves to the transaction message with the transfer instruction\n */\nasync function createTransferTransactionMessage(\n client: KeyPairSigner,\n paymentRequirements: PaymentRequirements,\n config?: X402Config,\n) {\n const rpc = getRpcClient(paymentRequirements.network, config?.svmConfig?.rpcUrl);\n\n // create the transfer instruction\n const transferInstructions = await createAtaAndTransferInstructions(\n client,\n paymentRequirements,\n config,\n );\n\n // create tx to simulate\n const feePayer = paymentRequirements.extra?.feePayer as Address;\n const txToSimulate = pipe(\n createTransactionMessage({ version: 0 }),\n tx => setTransactionMessageComputeUnitPrice(1, tx), // 1 microlamport priority fee\n tx => setTransactionMessageFeePayer(feePayer, tx),\n tx => appendTransactionMessageInstructions(transferInstructions, tx),\n );\n\n // estimate the compute budget limit (gas limit)\n const estimateComputeUnitLimit = estimateComputeUnitLimitFactory({ rpc });\n const estimatedUnits = await estimateComputeUnitLimit(txToSimulate);\n\n // finalize the transaction message by adding the compute budget limit and blockhash\n const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n const tx = pipe(\n txToSimulate,\n tx =>\n prependTransactionMessageInstruction(\n getSetComputeUnitLimitInstruction({ units: estimatedUnits }),\n tx,\n ),\n tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),\n );\n\n return tx;\n}\n\n/**\n * Creates a transfer instruction for the given client and payment requirements.\n * This function will determine which transfer instruction to create\n * based on the program that created the token (token-2022 or token).\n *\n * @param client - The signer instance used to create the transfer instruction\n * @param paymentRequirements - The payment requirements\n * @param config - Optional configuration for X402 operations (e.g., custom RPC URLs)\n * @returns A promise that resolves to the create ATA (if needed) and transfer instruction\n */\nasync function createAtaAndTransferInstructions(\n client: KeyPairSigner,\n paymentRequirements: PaymentRequirements,\n config?: X402Config,\n): Promise<Instruction[]> {\n const { asset } = paymentRequirements;\n\n const rpc = getRpcClient(paymentRequirements.network, config?.svmConfig?.rpcUrl);\n const tokenMint = await fetchMint(rpc, asset as Address);\n const tokenProgramAddress = tokenMint.programAddress;\n\n // validate that the asset was created by a known token program\n if (\n tokenProgramAddress.toString() !== TOKEN_PROGRAM_ADDRESS.toString() &&\n tokenProgramAddress.toString() !== TOKEN_2022_PROGRAM_ADDRESS.toString()\n ) {\n throw new Error(\"Asset was not created by a known token program\");\n }\n\n const instructions: Instruction[] = [];\n\n // create the ATA (if needed)\n const createAtaIx = await createAtaInstructionOrUndefined(\n paymentRequirements,\n tokenProgramAddress,\n config,\n );\n if (createAtaIx) {\n instructions.push(createAtaIx);\n }\n\n // create the transfer instruction\n const transferIx = await createTransferInstruction(\n client,\n paymentRequirements,\n tokenMint.data.decimals,\n tokenProgramAddress,\n );\n instructions.push(transferIx);\n\n return instructions;\n}\n\n/**\n * Returns a create ATA instruction for the payTo address if the ATA account does not exist.\n * The create ATA instruction will be paid for by the feePayer in the payment requirements.\n *\n * This function will work for both spl-token and token-2022.\n *\n * Returns undefined if the ATA account already exists.\n *\n * @param paymentRequirements - The payment requirements\n * @param tokenProgramAddress - The address of the token program\n * @param config - Optional configuration for X402 operations (e.g., custom RPC URLs)\n * @returns A promise that resolves to the create ATA instruction or undefined if the ATA account already exists\n * @throws an error if the feePayer is not provided in the payment requirements\n */\nasync function createAtaInstructionOrUndefined(\n paymentRequirements: PaymentRequirements,\n tokenProgramAddress: Address,\n config?: X402Config,\n): Promise<Instruction | undefined> {\n const { asset, payTo, extra } = paymentRequirements;\n const feePayer = extra?.feePayer as Address;\n\n // feePayer is required\n if (!feePayer) {\n throw new Error(\n \"feePayer is required in paymentRequirements.extra in order to set the \" +\n \"facilitator as the fee payer for the create associated token account instruction\",\n );\n }\n\n // derive the ATA of the payTo address\n const [destinationATAAddress] = await findAssociatedTokenPda({\n mint: asset as Address,\n owner: payTo as Address,\n tokenProgram: tokenProgramAddress,\n });\n\n // check if the ATA exists\n const rpc = getRpcClient(paymentRequirements.network, config?.svmConfig?.rpcUrl);\n const maybeAccount = await fetchEncodedAccount(rpc, destinationATAAddress);\n\n // if the ATA does not exist, return an instruction to create it\n if (!maybeAccount.exists) {\n return getCreateAssociatedTokenInstruction({\n payer: paymentRequirements.extra?.feePayer as TransactionSigner<string>,\n ata: destinationATAAddress,\n owner: payTo as Address,\n mint: asset as Address,\n tokenProgram: tokenProgramAddress,\n });\n }\n\n // if the ATA exists, return undefined\n return undefined;\n}\n\n/**\n * Creates a transfer instruction for the given client and payment requirements.\n * This function will create a transfer instruction for a token created by either\n * the token program or the token-2022 program.\n *\n * @param client - The signer instance who's tokens will be debited from\n * @param paymentRequirements - The payment requirements\n * @param decimals - The decimals of the token\n * @param tokenProgramAddress - The address of the token program\n * @returns A promise that resolves to the transfer instruction\n */\nasync function createTransferInstruction(\n client: KeyPairSigner,\n paymentRequirements: PaymentRequirements,\n decimals: number,\n tokenProgramAddress: Address,\n): Promise<Instruction> {\n const { asset, maxAmountRequired: amount, payTo } = paymentRequirements;\n\n const [sourceATA] = await findAssociatedTokenPda({\n mint: asset as Address,\n owner: client.address,\n tokenProgram: tokenProgramAddress,\n });\n\n const [destinationATA] = await findAssociatedTokenPda({\n mint: asset as Address,\n owner: payTo as Address,\n tokenProgram: tokenProgramAddress,\n });\n\n return getTransferCheckedInstruction(\n {\n source: sourceATA,\n mint: asset as Address,\n destination: destinationATA,\n authority: client,\n amount: BigInt(amount),\n decimals: decimals,\n },\n { programAddress: tokenProgramAddress },\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAeO,SAAS,cAAc,SAAiC;AAC7D,MAAI;AAGJ,MAAI,qBAAqB,SAAS,QAAQ,OAAO,GAAG;AAClD,UAAM,aAAa,QAAQ;AAG3B,QAAI;AAEJ,QAAI,WAAW,sBAAsB,WAAW;AAC9C,yBAAmB;AAAA,QACjB,GAAG;AAAA,QACH,eAAe;AAAA,UACb,GAAG,WAAW;AAAA,UACd,YAAY,WAAW,cAAc,WAAW,SAAS;AAAA,UACzD,aAAa,WAAW,cAAc,YAAY,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b,QACA,qBACA,UACA,qBACsB;AACtB,QAAM,EAAE,OAAO,mBAAmB,QAAQ,MAAM,IAAI;AAEpD,QAAM,CAAC,SAAS,IAAI,MAAM,uBAAuB;AAAA,IAC/C,MAAM;AAAA,IACN,OAAO,OAAO;AAAA,IACd,cAAc;AAAA,EAChB,CAAC;AAED,QAAM,CAAC,cAAc,IAAI,MAAM,uBAAuB;AAAA,IACpD,MAAM;AAAA,IACN,OAAO;AAAA,IACP,cAAc;AAAA,EAChB,CAAC;AAED,SAAO;AAAA,IACL;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,aAAa;AAAA,MACb,WAAW;AAAA,MACX,QAAQ,OAAO,MAAM;AAAA,MACrB;AAAA,IACF;AAAA,IACA,EAAE,gBAAgB,oBAAoB;AAAA,EACxC;AACF;","names":["createPaymentHeader","tx"]}
|
|
@@ -318,6 +318,7 @@ function isMultiNetworkSigner(wallet) {
|
|
|
318
318
|
// src/types/shared/evm/index.ts
|
|
319
319
|
var evm_exports = {};
|
|
320
320
|
__export(evm_exports, {
|
|
321
|
+
EIP7702SellerWalletMinimalAbi: () => EIP7702SellerWalletMinimalAbi,
|
|
321
322
|
PERMIT2_ADDRESS: () => PERMIT2_ADDRESS,
|
|
322
323
|
WITNESS_TYPE_STRING: () => WITNESS_TYPE_STRING,
|
|
323
324
|
authorizationPrimaryType: () => authorizationPrimaryType,
|
|
@@ -584,6 +585,431 @@ var permit2ABI = [
|
|
|
584
585
|
}
|
|
585
586
|
];
|
|
586
587
|
|
|
588
|
+
// src/types/shared/evm/eip7702ABI.ts
|
|
589
|
+
var EIP7702SellerWalletMinimalAbi = [
|
|
590
|
+
{
|
|
591
|
+
inputs: [],
|
|
592
|
+
name: "InvalidAmount",
|
|
593
|
+
type: "error"
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
inputs: [],
|
|
597
|
+
name: "NotOwner",
|
|
598
|
+
type: "error"
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
inputs: [],
|
|
602
|
+
name: "ReentrancyGuardReentrantCall",
|
|
603
|
+
type: "error"
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
inputs: [
|
|
607
|
+
{
|
|
608
|
+
internalType: "address",
|
|
609
|
+
name: "token",
|
|
610
|
+
type: "address"
|
|
611
|
+
}
|
|
612
|
+
],
|
|
613
|
+
name: "SafeERC20FailedOperation",
|
|
614
|
+
type: "error"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
inputs: [],
|
|
618
|
+
name: "ZeroAddress",
|
|
619
|
+
type: "error"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
anonymous: false,
|
|
623
|
+
inputs: [
|
|
624
|
+
{
|
|
625
|
+
indexed: true,
|
|
626
|
+
internalType: "address",
|
|
627
|
+
name: "beneficiary",
|
|
628
|
+
type: "address"
|
|
629
|
+
}
|
|
630
|
+
],
|
|
631
|
+
name: "ConfigUpdated",
|
|
632
|
+
type: "event"
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
anonymous: false,
|
|
636
|
+
inputs: [
|
|
637
|
+
{
|
|
638
|
+
indexed: true,
|
|
639
|
+
internalType: "address",
|
|
640
|
+
name: "token",
|
|
641
|
+
type: "address"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
indexed: true,
|
|
645
|
+
internalType: "address",
|
|
646
|
+
name: "payer",
|
|
647
|
+
type: "address"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
indexed: true,
|
|
651
|
+
internalType: "address",
|
|
652
|
+
name: "facilitator",
|
|
653
|
+
type: "address"
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
indexed: false,
|
|
657
|
+
internalType: "uint256",
|
|
658
|
+
name: "amount",
|
|
659
|
+
type: "uint256"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
indexed: false,
|
|
663
|
+
internalType: "uint256",
|
|
664
|
+
name: "beneficiaryAmount",
|
|
665
|
+
type: "uint256"
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
indexed: false,
|
|
669
|
+
internalType: "uint256",
|
|
670
|
+
name: "feeAmount",
|
|
671
|
+
type: "uint256"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
indexed: false,
|
|
675
|
+
internalType: "string",
|
|
676
|
+
name: "method",
|
|
677
|
+
type: "string"
|
|
678
|
+
}
|
|
679
|
+
],
|
|
680
|
+
name: "SettlementExecuted",
|
|
681
|
+
type: "event"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
stateMutability: "payable",
|
|
685
|
+
type: "fallback"
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
inputs: [],
|
|
689
|
+
name: "BASIS_POINTS",
|
|
690
|
+
outputs: [
|
|
691
|
+
{
|
|
692
|
+
internalType: "uint96",
|
|
693
|
+
name: "",
|
|
694
|
+
type: "uint96"
|
|
695
|
+
}
|
|
696
|
+
],
|
|
697
|
+
stateMutability: "view",
|
|
698
|
+
type: "function"
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
inputs: [],
|
|
702
|
+
name: "FEE_BPS",
|
|
703
|
+
outputs: [
|
|
704
|
+
{
|
|
705
|
+
internalType: "uint96",
|
|
706
|
+
name: "",
|
|
707
|
+
type: "uint96"
|
|
708
|
+
}
|
|
709
|
+
],
|
|
710
|
+
stateMutability: "view",
|
|
711
|
+
type: "function"
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
inputs: [],
|
|
715
|
+
name: "FEE_RECIPIENT",
|
|
716
|
+
outputs: [
|
|
717
|
+
{
|
|
718
|
+
internalType: "address",
|
|
719
|
+
name: "",
|
|
720
|
+
type: "address"
|
|
721
|
+
}
|
|
722
|
+
],
|
|
723
|
+
stateMutability: "view",
|
|
724
|
+
type: "function"
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
inputs: [],
|
|
728
|
+
name: "getConfig",
|
|
729
|
+
outputs: [
|
|
730
|
+
{
|
|
731
|
+
internalType: "address",
|
|
732
|
+
name: "beneficiary",
|
|
733
|
+
type: "address"
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
internalType: "bool",
|
|
737
|
+
name: "initialized",
|
|
738
|
+
type: "bool"
|
|
739
|
+
}
|
|
740
|
+
],
|
|
741
|
+
stateMutability: "view",
|
|
742
|
+
type: "function"
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
inputs: [],
|
|
746
|
+
name: "getEffectiveConfig",
|
|
747
|
+
outputs: [
|
|
748
|
+
{
|
|
749
|
+
internalType: "address",
|
|
750
|
+
name: "beneficiary",
|
|
751
|
+
type: "address"
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
internalType: "address",
|
|
755
|
+
name: "feeRecipient",
|
|
756
|
+
type: "address"
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
internalType: "uint96",
|
|
760
|
+
name: "feeBps",
|
|
761
|
+
type: "uint96"
|
|
762
|
+
}
|
|
763
|
+
],
|
|
764
|
+
stateMutability: "view",
|
|
765
|
+
type: "function"
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
inputs: [
|
|
769
|
+
{
|
|
770
|
+
internalType: "address",
|
|
771
|
+
name: "",
|
|
772
|
+
type: "address"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
internalType: "address",
|
|
776
|
+
name: "",
|
|
777
|
+
type: "address"
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
internalType: "uint256[]",
|
|
781
|
+
name: "",
|
|
782
|
+
type: "uint256[]"
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
internalType: "uint256[]",
|
|
786
|
+
name: "",
|
|
787
|
+
type: "uint256[]"
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
internalType: "bytes",
|
|
791
|
+
name: "",
|
|
792
|
+
type: "bytes"
|
|
793
|
+
}
|
|
794
|
+
],
|
|
795
|
+
name: "onERC1155BatchReceived",
|
|
796
|
+
outputs: [
|
|
797
|
+
{
|
|
798
|
+
internalType: "bytes4",
|
|
799
|
+
name: "",
|
|
800
|
+
type: "bytes4"
|
|
801
|
+
}
|
|
802
|
+
],
|
|
803
|
+
stateMutability: "nonpayable",
|
|
804
|
+
type: "function"
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
inputs: [
|
|
808
|
+
{
|
|
809
|
+
internalType: "address",
|
|
810
|
+
name: "",
|
|
811
|
+
type: "address"
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
internalType: "address",
|
|
815
|
+
name: "",
|
|
816
|
+
type: "address"
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
internalType: "uint256",
|
|
820
|
+
name: "",
|
|
821
|
+
type: "uint256"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
internalType: "uint256",
|
|
825
|
+
name: "",
|
|
826
|
+
type: "uint256"
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
internalType: "bytes",
|
|
830
|
+
name: "",
|
|
831
|
+
type: "bytes"
|
|
832
|
+
}
|
|
833
|
+
],
|
|
834
|
+
name: "onERC1155Received",
|
|
835
|
+
outputs: [
|
|
836
|
+
{
|
|
837
|
+
internalType: "bytes4",
|
|
838
|
+
name: "",
|
|
839
|
+
type: "bytes4"
|
|
840
|
+
}
|
|
841
|
+
],
|
|
842
|
+
stateMutability: "nonpayable",
|
|
843
|
+
type: "function"
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
inputs: [
|
|
847
|
+
{
|
|
848
|
+
internalType: "address",
|
|
849
|
+
name: "",
|
|
850
|
+
type: "address"
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
internalType: "address",
|
|
854
|
+
name: "",
|
|
855
|
+
type: "address"
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
internalType: "uint256",
|
|
859
|
+
name: "",
|
|
860
|
+
type: "uint256"
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
internalType: "bytes",
|
|
864
|
+
name: "",
|
|
865
|
+
type: "bytes"
|
|
866
|
+
}
|
|
867
|
+
],
|
|
868
|
+
name: "onERC721Received",
|
|
869
|
+
outputs: [
|
|
870
|
+
{
|
|
871
|
+
internalType: "bytes4",
|
|
872
|
+
name: "",
|
|
873
|
+
type: "bytes4"
|
|
874
|
+
}
|
|
875
|
+
],
|
|
876
|
+
stateMutability: "nonpayable",
|
|
877
|
+
type: "function"
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
inputs: [
|
|
881
|
+
{
|
|
882
|
+
internalType: "address",
|
|
883
|
+
name: "token",
|
|
884
|
+
type: "address"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
internalType: "address",
|
|
888
|
+
name: "payer",
|
|
889
|
+
type: "address"
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
internalType: "uint256",
|
|
893
|
+
name: "amount",
|
|
894
|
+
type: "uint256"
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
internalType: "uint256",
|
|
898
|
+
name: "validAfter",
|
|
899
|
+
type: "uint256"
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
internalType: "uint256",
|
|
903
|
+
name: "validBefore",
|
|
904
|
+
type: "uint256"
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
internalType: "bytes32",
|
|
908
|
+
name: "nonce",
|
|
909
|
+
type: "bytes32"
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
internalType: "uint8",
|
|
913
|
+
name: "v",
|
|
914
|
+
type: "uint8"
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
internalType: "bytes32",
|
|
918
|
+
name: "r",
|
|
919
|
+
type: "bytes32"
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
internalType: "bytes32",
|
|
923
|
+
name: "s",
|
|
924
|
+
type: "bytes32"
|
|
925
|
+
}
|
|
926
|
+
],
|
|
927
|
+
name: "settleWithERC3009",
|
|
928
|
+
outputs: [],
|
|
929
|
+
stateMutability: "nonpayable",
|
|
930
|
+
type: "function"
|
|
931
|
+
},
|
|
932
|
+
{
|
|
933
|
+
inputs: [
|
|
934
|
+
{
|
|
935
|
+
internalType: "address",
|
|
936
|
+
name: "token",
|
|
937
|
+
type: "address"
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
internalType: "address",
|
|
941
|
+
name: "payer",
|
|
942
|
+
type: "address"
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
internalType: "uint256",
|
|
946
|
+
name: "amount",
|
|
947
|
+
type: "uint256"
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
internalType: "uint256",
|
|
951
|
+
name: "deadline",
|
|
952
|
+
type: "uint256"
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
internalType: "uint8",
|
|
956
|
+
name: "v",
|
|
957
|
+
type: "uint8"
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
internalType: "bytes32",
|
|
961
|
+
name: "r",
|
|
962
|
+
type: "bytes32"
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
internalType: "bytes32",
|
|
966
|
+
name: "s",
|
|
967
|
+
type: "bytes32"
|
|
968
|
+
}
|
|
969
|
+
],
|
|
970
|
+
name: "settleWithPermit",
|
|
971
|
+
outputs: [],
|
|
972
|
+
stateMutability: "nonpayable",
|
|
973
|
+
type: "function"
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
inputs: [
|
|
977
|
+
{
|
|
978
|
+
internalType: "bytes4",
|
|
979
|
+
name: "interfaceId",
|
|
980
|
+
type: "bytes4"
|
|
981
|
+
}
|
|
982
|
+
],
|
|
983
|
+
name: "supportsInterface",
|
|
984
|
+
outputs: [
|
|
985
|
+
{
|
|
986
|
+
internalType: "bool",
|
|
987
|
+
name: "",
|
|
988
|
+
type: "bool"
|
|
989
|
+
}
|
|
990
|
+
],
|
|
991
|
+
stateMutability: "view",
|
|
992
|
+
type: "function"
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
inputs: [
|
|
996
|
+
{
|
|
997
|
+
internalType: "address",
|
|
998
|
+
name: "beneficiary_",
|
|
999
|
+
type: "address"
|
|
1000
|
+
}
|
|
1001
|
+
],
|
|
1002
|
+
name: "updateConfig",
|
|
1003
|
+
outputs: [],
|
|
1004
|
+
stateMutability: "nonpayable",
|
|
1005
|
+
type: "function"
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
stateMutability: "payable",
|
|
1009
|
+
type: "receive"
|
|
1010
|
+
}
|
|
1011
|
+
];
|
|
1012
|
+
|
|
587
1013
|
// src/types/shared/svm/index.ts
|
|
588
1014
|
var svm_exports = {};
|
|
589
1015
|
__export(svm_exports, {
|
|
@@ -1043,6 +1469,7 @@ export {
|
|
|
1043
1469
|
permit2WitnessTypes,
|
|
1044
1470
|
WITNESS_TYPE_STRING,
|
|
1045
1471
|
permit2ABI,
|
|
1472
|
+
EIP7702SellerWalletMinimalAbi,
|
|
1046
1473
|
isSignerWallet,
|
|
1047
1474
|
isAccount,
|
|
1048
1475
|
withChain,
|
|
@@ -1103,4 +1530,4 @@ export {
|
|
|
1103
1530
|
signAndSimulateTransaction,
|
|
1104
1531
|
svm_exports2
|
|
1105
1532
|
};
|
|
1106
|
-
//# sourceMappingURL=chunk-
|
|
1533
|
+
//# sourceMappingURL=chunk-5UE5XTGG.mjs.map
|