@faremeter/payment-solana 0.9.0 → 0.10.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faremeter/payment-solana",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "license": "LGPL-3.0-only",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -24,7 +24,7 @@
24
24
  "prettier": "3.6.2",
25
25
  "tap": "21.1.0",
26
26
  "tsc-esm-fix": "3.1.2",
27
- "typescript": "5.9.2",
27
+ "typescript": "5.9.3",
28
28
  "typescript-eslint": "8.42.0",
29
29
  "typescript-language-server": "4.4.0"
30
30
  },
@@ -38,7 +38,8 @@
38
38
  "@solana/transactions": "2.3.0",
39
39
  "@solana/web3.js": "1.98.4",
40
40
  "arktype": "2.1.21",
41
- "@faremeter/types": "^0.9.0"
41
+ "@faremeter/info": "^0.10.1",
42
+ "@faremeter/types": "^0.10.1"
42
43
  },
43
44
  "tap": {
44
45
  "plugin": [
@@ -1,11 +0,0 @@
1
- import type { PaymentHandler } from "@faremeter/types/client";
2
- import { Connection, PublicKey, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
3
- export type Wallet = {
4
- network: string;
5
- publicKey: PublicKey;
6
- buildTransaction?: (instructions: TransactionInstruction[], recentBlockHash: string) => Promise<VersionedTransaction>;
7
- updateTransaction?: (tx: VersionedTransaction) => Promise<VersionedTransaction>;
8
- sendTransaction?: (tx: VersionedTransaction) => Promise<string>;
9
- };
10
- export declare function createPaymentHandler(wallet: Wallet, mint: PublicKey, connection?: Connection): PaymentHandler;
11
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/exact/client.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAEV,cAAc,EAEf,MAAM,yBAAyB,CAAC;AAWjC,OAAO,EAEL,UAAU,EACV,SAAS,EACT,sBAAsB,EAEtB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAQzB,MAAM,MAAM,MAAM,GAAG;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,CAAC,EAAE,CACjB,YAAY,EAAE,sBAAsB,EAAE,EACtC,eAAe,EAAE,MAAM,KACpB,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACnC,iBAAiB,CAAC,EAAE,CAClB,EAAE,EAAE,oBAAoB,KACrB,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACnC,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,oBAAoB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACjE,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,EACf,UAAU,CAAC,EAAE,UAAU,GACtB,cAAc,CAyHhB"}
@@ -1,90 +0,0 @@
1
- import { isValidationError, throwValidationError, caseInsensitiveLiteral, } from "@faremeter/types";
2
- import { createTransferCheckedInstruction, getAssociatedTokenAddressSync, getMint, } from "@solana/spl-token";
3
- import { getBase64EncodedWireTransaction, } from "@solana/transactions";
4
- import { ComputeBudgetProgram, Connection, PublicKey, TransactionInstruction, TransactionMessage, VersionedTransaction, } from "@solana/web3.js";
5
- import { type } from "arktype";
6
- import { PaymentRequirementsExtra, x402Scheme, lookupX402Network, } from "./facilitator.js";
7
- export function createPaymentHandler(wallet, mint, connection) {
8
- const matcher = type({
9
- scheme: caseInsensitiveLiteral(x402Scheme),
10
- network: caseInsensitiveLiteral(lookupX402Network(wallet.network)),
11
- asset: caseInsensitiveLiteral(mint ? mint.toBase58() : "sol"),
12
- });
13
- return async (context, accepts) => {
14
- const res = accepts
15
- .filter((r) => !isValidationError(matcher(r)))
16
- .map((requirements) => {
17
- const extra = PaymentRequirementsExtra(requirements.extra);
18
- if (isValidationError(extra)) {
19
- throwValidationError("couldn't validate requirements extra field", extra);
20
- }
21
- const exec = async () => {
22
- let recentBlockhash;
23
- if (extra.recentBlockhash !== undefined) {
24
- recentBlockhash = extra.recentBlockhash;
25
- }
26
- else if (connection !== undefined) {
27
- recentBlockhash = (await connection.getLatestBlockhash()).blockhash;
28
- }
29
- else {
30
- throw new Error("couldn't get the latest Solana network block hash");
31
- }
32
- let decimals;
33
- if (extra.decimals !== undefined) {
34
- decimals = extra.decimals;
35
- }
36
- else if (connection !== undefined) {
37
- const mintInfo = await getMint(connection, mint);
38
- decimals = mintInfo.decimals;
39
- }
40
- else {
41
- throw new Error("couldn't get the decimal information for the mint");
42
- }
43
- const paymentRequirements = {
44
- ...extra,
45
- amount: Number(requirements.maxAmountRequired),
46
- receiver: new PublicKey(requirements.payTo),
47
- };
48
- const sourceAccount = getAssociatedTokenAddressSync(mint, wallet.publicKey);
49
- const receiverAccount = getAssociatedTokenAddressSync(mint, paymentRequirements.receiver);
50
- const instructions = [
51
- ComputeBudgetProgram.setComputeUnitLimit({
52
- units: 50_000,
53
- }),
54
- ComputeBudgetProgram.setComputeUnitPrice({
55
- microLamports: 1,
56
- }),
57
- createTransferCheckedInstruction(sourceAccount, mint, receiverAccount, wallet.publicKey, paymentRequirements.amount, decimals),
58
- ];
59
- let tx;
60
- if (wallet.buildTransaction) {
61
- tx = await wallet.buildTransaction(instructions, recentBlockhash);
62
- }
63
- else {
64
- const message = new TransactionMessage({
65
- instructions,
66
- payerKey: new PublicKey(paymentRequirements.feePayer),
67
- recentBlockhash,
68
- }).compileToV0Message();
69
- tx = new VersionedTransaction(message);
70
- }
71
- if (wallet.updateTransaction) {
72
- tx = await wallet.updateTransaction(tx);
73
- }
74
- const base64EncodedWireTransaction = getBase64EncodedWireTransaction({
75
- messageBytes: tx.message.serialize(),
76
- signatures: tx.signatures,
77
- });
78
- const payload = {
79
- transaction: base64EncodedWireTransaction,
80
- };
81
- return { payload };
82
- };
83
- return {
84
- exec,
85
- requirements,
86
- };
87
- });
88
- return res;
89
- };
90
- }
@@ -1,20 +0,0 @@
1
- import type { FacilitatorHandler } from "@faremeter/types/facilitator";
2
- import { type Rpc, type SolanaRpcApi } from "@solana/kit";
3
- import type { TransactionError } from "@solana/rpc-types";
4
- import { Keypair, type PublicKey } from "@solana/web3.js";
5
- export declare const x402Scheme = "exact";
6
- export declare const PaymentRequirementsExtra: import("arktype/internal/methods/object.ts").ObjectType<{
7
- feePayer: string;
8
- decimals?: number;
9
- recentBlockhash?: string;
10
- }, {}>;
11
- export declare const PaymentPayload: import("arktype/internal/methods/object.ts").ObjectType<{
12
- transaction: (In: string) => import("arktype").Out<Readonly<{
13
- messageBytes: import("@solana/transactions").TransactionMessageBytes;
14
- signatures: import("@solana/transactions").SignaturesMap;
15
- }>>;
16
- }, {}>;
17
- export declare const lookupX402Network: (network: string) => string;
18
- export declare function transactionErrorToString(t: TransactionError): string;
19
- export declare const createFacilitatorHandler: (network: string, rpc: Rpc<SolanaRpcApi>, feePayerKeypair: Keypair, mint: PublicKey, maxRetries?: number, retryDelayMs?: number) => FacilitatorHandler;
20
- //# sourceMappingURL=facilitator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"facilitator.d.ts","sourceRoot":"","sources":["../../../src/exact/facilitator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAML,KAAK,GAAG,EACR,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AAOrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK1D,eAAO,MAAM,UAAU,UAAU,CAAC;AAElC,eAAO,MAAM,wBAAwB;;;;MAInC,CAAC;AAmBH,eAAO,MAAM,cAAc;;;;;MAEzB,CAAC;AAEH,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,WAEhD,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,gBAAgB,UAY3D;AAiDD,eAAO,MAAM,wBAAwB,GACnC,SAAS,MAAM,EACf,KAAK,GAAG,CAAC,YAAY,CAAC,EACtB,iBAAiB,OAAO,EACxB,MAAM,SAAS,EACf,mBAAe,EACf,qBAAmB,KAClB,kBAqHF,CAAC"}
@@ -1,171 +0,0 @@
1
- import { isValidationError, caseInsensitiveLiteral } from "@faremeter/types";
2
- import { fetchMint } from "@solana-program/token";
3
- import { address, createKeyPairSignerFromBytes, decompileTransactionMessage, getBase64Encoder, getCompiledTransactionMessageDecoder, } from "@solana/kit";
4
- import { getBase64EncodedWireTransaction, getTransactionDecoder, partiallySignTransaction, } from "@solana/transactions";
5
- import { Keypair } from "@solana/web3.js";
6
- import { type } from "arktype";
7
- import { isValidTransaction } from "./verify.js";
8
- import { logger } from "./logger.js";
9
- export const x402Scheme = "exact";
10
- export const PaymentRequirementsExtra = type({
11
- feePayer: "string",
12
- decimals: "number?",
13
- recentBlockhash: "string?",
14
- });
15
- function errorResponse(msg) {
16
- logger.error(msg);
17
- return {
18
- success: false,
19
- error: msg,
20
- txHash: null,
21
- networkId: null,
22
- };
23
- }
24
- const TransactionString = type("string").pipe.try((tx) => {
25
- const decoder = getTransactionDecoder();
26
- const base64Encoder = getBase64Encoder();
27
- const transactionBytes = base64Encoder.encode(tx);
28
- return decoder.decode(transactionBytes);
29
- });
30
- export const PaymentPayload = type({
31
- transaction: TransactionString,
32
- });
33
- export const lookupX402Network = (network) => {
34
- return `solana-${network}`;
35
- };
36
- export function transactionErrorToString(t) {
37
- if (typeof t == "string") {
38
- return t;
39
- }
40
- if (typeof t == "object") {
41
- return JSON.stringify(t, (_, v) => typeof v === "bigint" ? v.toString() : v);
42
- }
43
- return String(t);
44
- }
45
- const sendTransaction = async (rpc, signedTransaction, maxRetries, retryDelayMs) => {
46
- const base64EncodedTransaction = getBase64EncodedWireTransaction(signedTransaction);
47
- const simResult = await rpc
48
- .simulateTransaction(base64EncodedTransaction, {
49
- encoding: "base64",
50
- })
51
- .send();
52
- if (simResult.value.err) {
53
- logger.error("transaction simulation failed: {*}", simResult.value);
54
- return { success: false, error: "Transaction simulation failed" };
55
- }
56
- const signature = await rpc
57
- .sendTransaction(base64EncodedTransaction, {
58
- encoding: "base64",
59
- })
60
- .send();
61
- for (let i = 0; i < maxRetries; i++) {
62
- const status = await rpc.getSignatureStatuses([signature]).send();
63
- if (status.value[0]?.err) {
64
- return {
65
- success: false,
66
- error: `Transaction failed: ${transactionErrorToString(status.value[0].err)}`,
67
- };
68
- }
69
- if (status.value[0]?.confirmationStatus === "confirmed" ||
70
- status.value[0]?.confirmationStatus === "finalized") {
71
- return { success: true, signature };
72
- }
73
- await new Promise((resolve) => setTimeout(resolve, retryDelayMs));
74
- }
75
- return { success: false, error: "Transaction confirmation timeout" };
76
- };
77
- export const createFacilitatorHandler = (network, rpc, feePayerKeypair, mint, maxRetries = 30, retryDelayMs = 1000) => {
78
- const checkTuple = type({
79
- scheme: caseInsensitiveLiteral(x402Scheme),
80
- network: caseInsensitiveLiteral(lookupX402Network(network)),
81
- });
82
- const checkTupleAndAsset = checkTuple.and({
83
- asset: caseInsensitiveLiteral(mint.toBase58()),
84
- });
85
- const getSupported = () => {
86
- return [
87
- Promise.resolve({
88
- x402Version: 1,
89
- scheme: x402Scheme,
90
- network: lookupX402Network(network),
91
- extra: {
92
- feePayer: feePayerKeypair.publicKey.toString(),
93
- },
94
- }),
95
- ];
96
- };
97
- const getRequirements = async (req) => {
98
- const recentBlockhash = (await rpc.getLatestBlockhash().send()).value
99
- .blockhash;
100
- const mintInfo = await fetchMint(rpc, address(mint.toBase58()));
101
- return req
102
- .filter((x) => !isValidationError(checkTupleAndAsset(x)))
103
- .map((x) => {
104
- return {
105
- ...x,
106
- asset: mint.toBase58(),
107
- extra: {
108
- feePayer: feePayerKeypair.publicKey.toString(),
109
- decimals: mintInfo.data.decimals,
110
- recentBlockhash,
111
- },
112
- };
113
- });
114
- };
115
- const handleSettle = async (requirements, payment) => {
116
- if (isValidationError(checkTuple(payment))) {
117
- return null;
118
- }
119
- const paymentPayload = PaymentPayload(payment.payload);
120
- if (isValidationError(paymentPayload)) {
121
- return errorResponse(paymentPayload.summary);
122
- }
123
- let transactionMessage, transaction;
124
- try {
125
- transaction = paymentPayload.transaction;
126
- const compiledTransactionMessage = getCompiledTransactionMessageDecoder().decode(transaction.messageBytes);
127
- transactionMessage = decompileTransactionMessage(compiledTransactionMessage);
128
- }
129
- catch (cause) {
130
- throw new Error("Failed to get compiled transaction message", { cause });
131
- }
132
- try {
133
- if (!(await isValidTransaction(transactionMessage, requirements))) {
134
- logger.error("Invalid transaction");
135
- return errorResponse("Invalid transaction");
136
- }
137
- }
138
- catch (cause) {
139
- throw new Error("Failed to validate transaction", { cause });
140
- }
141
- let signedTransaction;
142
- try {
143
- const kitKeypair = await createKeyPairSignerFromBytes(feePayerKeypair.secretKey);
144
- signedTransaction = await partiallySignTransaction([kitKeypair.keyPair], transaction);
145
- }
146
- catch (cause) {
147
- throw new Error("Failed to partially sign transaction", { cause });
148
- }
149
- let result;
150
- try {
151
- result = await sendTransaction(rpc, signedTransaction, maxRetries, retryDelayMs);
152
- }
153
- catch (cause) {
154
- throw new Error("Failed to send transaction", { cause });
155
- }
156
- if (!result.success) {
157
- return errorResponse(result.error);
158
- }
159
- return {
160
- success: true,
161
- error: null,
162
- txHash: result.signature,
163
- networkId: payment.network,
164
- };
165
- };
166
- return {
167
- getSupported,
168
- getRequirements,
169
- handleSettle,
170
- };
171
- };
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env pnpm tsx
2
- export {};
3
- //# sourceMappingURL=facilitator.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"facilitator.test.d.ts","sourceRoot":"","sources":["../../../src/exact/facilitator.test.ts"],"names":[],"mappings":""}
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env pnpm tsx
2
- import t from "tap";
3
- import { transactionErrorToString } from "./facilitator.js";
4
- class MyBigCrazyError {
5
- someBigInt = 32n;
6
- someString = "a string";
7
- DuplicateInstruction = 42;
8
- }
9
- await t.test("transactionErrorToString", async (t) => {
10
- {
11
- const err = "AccountBorrowOutstanding";
12
- t.matchOnly(transactionErrorToString(err), "AccountBorrowOutstanding");
13
- }
14
- {
15
- const err = { DuplicateInstruction: 42 };
16
- t.matchOnly(transactionErrorToString(err), '{"DuplicateInstruction":42}');
17
- }
18
- {
19
- const err = {
20
- InstructionError: [32, "AccountBorrowFailed"],
21
- };
22
- t.matchOnly(transactionErrorToString(err), '{"InstructionError":[32,"AccountBorrowFailed"]}');
23
- }
24
- {
25
- const err = {
26
- SomeResultThatShouldNeverHappen: 1337n,
27
- };
28
- t.matchOnly(transactionErrorToString(err), '{"SomeResultThatShouldNeverHappen":"1337"}');
29
- }
30
- {
31
- const err = 42;
32
- t.matchOnly(transactionErrorToString(err), "42");
33
- }
34
- {
35
- const err = new MyBigCrazyError();
36
- t.matchOnly(transactionErrorToString(err), '{"someBigInt":"32","someString":"a string","DuplicateInstruction":42}');
37
- }
38
- t.end();
39
- });
@@ -1,3 +0,0 @@
1
- export { createPaymentHandler } from "./client.js";
2
- export { createFacilitatorHandler, lookupX402Network } from "./facilitator.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exact/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,2 +0,0 @@
1
- export { createPaymentHandler } from "./client.js";
2
- export { createFacilitatorHandler, lookupX402Network } from "./facilitator.js";
@@ -1,2 +0,0 @@
1
- export declare const logger: import("@logtape/logtape").Logger;
2
- //# sourceMappingURL=logger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/exact/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,mCAAmD,CAAC"}
@@ -1,2 +0,0 @@
1
- import { getLogger } from "@logtape/logtape";
2
- export const logger = getLogger(["faremeter", "payment-solana-exact"]);
@@ -1,4 +0,0 @@
1
- import type { x402PaymentRequirements } from "@faremeter/types/x402";
2
- import { type CompilableTransactionMessage } from "@solana/kit";
3
- export declare function isValidTransaction(transactionMessage: CompilableTransactionMessage, paymentRequirements: x402PaymentRequirements): Promise<boolean>;
4
- //# sourceMappingURL=verify.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/exact/verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAYrE,OAAO,EAEL,KAAK,4BAA4B,EAElC,MAAM,aAAa,CAAC;AA+ErB,wBAAsB,kBAAkB,CACtC,kBAAkB,EAAE,4BAA4B,EAChD,mBAAmB,EAAE,uBAAuB,GAC3C,OAAO,CAAC,OAAO,CAAC,CA4ClB"}
@@ -1,106 +0,0 @@
1
- import { isValidationError } from "@faremeter/types";
2
- import { parseSetComputeUnitLimitInstruction, parseSetComputeUnitPriceInstruction, } from "@solana-program/compute-budget";
3
- import { findAssociatedTokenPda, parseCreateAssociatedTokenInstruction, parseTransferCheckedInstruction, TOKEN_PROGRAM_ADDRESS, } from "@solana-program/token";
4
- import { address, } from "@solana/kit";
5
- import { PaymentRequirementsExtra } from "./facilitator.js";
6
- function verifyComputeUnitLimitInstruction(instruction) {
7
- if (!instruction.data) {
8
- return false;
9
- }
10
- try {
11
- parseSetComputeUnitLimitInstruction({
12
- programAddress: instruction.programAddress,
13
- data: new Uint8Array(instruction.data),
14
- });
15
- return true;
16
- }
17
- catch {
18
- return false;
19
- }
20
- }
21
- function verifyComputeUnitPriceInstruction(instruction) {
22
- if (!instruction.data) {
23
- return false;
24
- }
25
- try {
26
- parseSetComputeUnitPriceInstruction({
27
- programAddress: instruction.programAddress,
28
- data: new Uint8Array(instruction.data),
29
- });
30
- return true;
31
- }
32
- catch {
33
- return false;
34
- }
35
- }
36
- async function verifyTransferInstruction(instruction, paymentRequirements, destination) {
37
- if (!instruction.data || !instruction.accounts) {
38
- return false;
39
- }
40
- let transfer;
41
- try {
42
- transfer = parseTransferCheckedInstruction({
43
- accounts: instruction.accounts,
44
- programAddress: instruction.programAddress,
45
- data: new Uint8Array(instruction.data),
46
- });
47
- }
48
- catch {
49
- return false;
50
- }
51
- return (transfer.data.amount === BigInt(paymentRequirements.maxAmountRequired) &&
52
- transfer.accounts.mint.address === paymentRequirements.asset &&
53
- transfer.accounts.destination.address === destination);
54
- }
55
- function verifyCreateATAInstruction(instruction) {
56
- if (!instruction.data || !instruction.accounts) {
57
- return false;
58
- }
59
- try {
60
- parseCreateAssociatedTokenInstruction({
61
- accounts: instruction.accounts,
62
- programAddress: instruction.programAddress,
63
- data: new Uint8Array(instruction.data),
64
- });
65
- return true;
66
- }
67
- catch {
68
- return false;
69
- }
70
- }
71
- export async function isValidTransaction(transactionMessage, paymentRequirements) {
72
- const extra = PaymentRequirementsExtra(paymentRequirements.extra);
73
- if (isValidationError(extra)) {
74
- throw new Error("feePayer is required");
75
- }
76
- if (transactionMessage.feePayer.address !== extra.feePayer) {
77
- return false;
78
- }
79
- const [destination] = await findAssociatedTokenPda({
80
- mint: address(paymentRequirements.asset),
81
- owner: address(paymentRequirements.payTo),
82
- tokenProgram: TOKEN_PROGRAM_ADDRESS,
83
- });
84
- const instructions = transactionMessage.instructions;
85
- if (instructions.length === 3) {
86
- // Make typescript happy...
87
- const [ix0, ix1, ix2] = instructions;
88
- if (!ix0 || !ix1 || !ix2) {
89
- return false;
90
- }
91
- return (verifyComputeUnitLimitInstruction(ix0) &&
92
- verifyComputeUnitPriceInstruction(ix1) &&
93
- (await verifyTransferInstruction(ix2, paymentRequirements, destination)));
94
- }
95
- else if (instructions.length === 4) {
96
- const [ix0, ix1, ix2, ix3] = instructions;
97
- if (!ix0 || !ix1 || !ix2 || !ix3) {
98
- return false;
99
- }
100
- return (verifyComputeUnitLimitInstruction(ix0) &&
101
- verifyComputeUnitPriceInstruction(ix1) &&
102
- verifyCreateATAInstruction(ix2) &&
103
- (await verifyTransferInstruction(ix3, paymentRequirements, destination)));
104
- }
105
- return false;
106
- }
@@ -1,2 +0,0 @@
1
- export * as exact from "./exact/index.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
package/dist/src/index.js DELETED
@@ -1 +0,0 @@
1
- export * as exact from "./exact/index.js";