@across-protocol/sdk 4.3.113 → 4.3.114-alpha.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/dist/cjs/arch/svm/SpokeUtils.d.ts +16 -23
- package/dist/cjs/arch/svm/SpokeUtils.js.map +1 -1
- package/dist/cjs/arch/svm/utils.d.ts +3 -8
- package/dist/cjs/arch/svm/utils.js.map +1 -1
- package/dist/cjs/gasPriceOracle/adapters/solana.js.map +1 -1
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/index.js +1 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.d.ts +3 -3
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js.map +1 -1
- package/dist/esm/arch/svm/SpokeUtils.d.ts +16 -23
- package/dist/esm/arch/svm/SpokeUtils.js.map +1 -1
- package/dist/esm/arch/svm/utils.d.ts +3 -8
- package/dist/esm/arch/svm/utils.js.map +1 -1
- package/dist/esm/gasPriceOracle/adapters/solana.js +1 -1
- package/dist/esm/gasPriceOracle/adapters/solana.js.map +1 -1
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.d.ts +3 -3
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js +3 -3
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js.map +1 -1
- package/dist/types/arch/svm/SpokeUtils.d.ts +16 -23
- package/dist/types/arch/svm/SpokeUtils.d.ts.map +1 -1
- package/dist/types/arch/svm/utils.d.ts +3 -8
- package/dist/types/arch/svm/utils.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/adapters/solana.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts +3 -3
- package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts.map +1 -1
- package/package.json +17 -8
- package/src/arch/svm/SpokeUtils.ts +25 -24
- package/src/arch/svm/utils.ts +6 -3
- package/src/gasPriceOracle/adapters/solana.ts +8 -3
- package/src/index.ts +0 -1
- package/src/relayFeeCalculator/chain-queries/svmQuery.ts +5 -5
- package/dist/cjs/pool/TransactionManager.d.ts +0 -12
- package/dist/cjs/pool/TransactionManager.js +0 -121
- package/dist/cjs/pool/TransactionManager.js.map +0 -1
- package/dist/cjs/pool/index.d.ts +0 -1
- package/dist/cjs/pool/index.js +0 -5
- package/dist/cjs/pool/index.js.map +0 -1
- package/dist/cjs/pool/poolClient.d.ts +0 -228
- package/dist/cjs/pool/poolClient.js +0 -869
- package/dist/cjs/pool/poolClient.js.map +0 -1
- package/dist/cjs/pool/uma/across/constants.d.ts +0 -2
- package/dist/cjs/pool/uma/across/constants.js +0 -6
- package/dist/cjs/pool/uma/across/constants.js.map +0 -1
- package/dist/cjs/pool/uma/across/index.d.ts +0 -2
- package/dist/cjs/pool/uma/across/index.js +0 -8
- package/dist/cjs/pool/uma/across/index.js.map +0 -1
- package/dist/cjs/pool/uma/across/transactionManager.d.ts +0 -12
- package/dist/cjs/pool/uma/across/transactionManager.js +0 -121
- package/dist/cjs/pool/uma/across/transactionManager.js.map +0 -1
- package/dist/cjs/pool/uma/clients/erc20/client.d.ts +0 -26
- package/dist/cjs/pool/uma/clients/erc20/client.js +0 -38
- package/dist/cjs/pool/uma/clients/erc20/client.js.map +0 -1
- package/dist/cjs/pool/uma/clients/erc20/index.d.ts +0 -1
- package/dist/cjs/pool/uma/clients/erc20/index.js +0 -5
- package/dist/cjs/pool/uma/clients/erc20/index.js.map +0 -1
- package/dist/cjs/pool/uma/clients/index.d.ts +0 -1
- package/dist/cjs/pool/uma/clients/index.js +0 -6
- package/dist/cjs/pool/uma/clients/index.js.map +0 -1
- package/dist/cjs/pool/uma/index.d.ts +0 -13
- package/dist/cjs/pool/uma/index.js +0 -9
- package/dist/cjs/pool/uma/index.js.map +0 -1
- package/dist/cjs/pool/uma/oracle/index.d.ts +0 -1
- package/dist/cjs/pool/uma/oracle/index.js +0 -6
- package/dist/cjs/pool/uma/oracle/index.js.map +0 -1
- package/dist/cjs/pool/uma/oracle/utils.d.ts +0 -7
- package/dist/cjs/pool/uma/oracle/utils.js +0 -20
- package/dist/cjs/pool/uma/oracle/utils.js.map +0 -1
- package/dist/cjs/pool/uma/utils.d.ts +0 -17
- package/dist/cjs/pool/uma/utils.js +0 -69
- package/dist/cjs/pool/uma/utils.js.map +0 -1
- package/dist/esm/pool/TransactionManager.d.ts +0 -12
- package/dist/esm/pool/TransactionManager.js +0 -122
- package/dist/esm/pool/TransactionManager.js.map +0 -1
- package/dist/esm/pool/index.d.ts +0 -1
- package/dist/esm/pool/index.js +0 -2
- package/dist/esm/pool/index.js.map +0 -1
- package/dist/esm/pool/poolClient.d.ts +0 -238
- package/dist/esm/pool/poolClient.js +0 -899
- package/dist/esm/pool/poolClient.js.map +0 -1
- package/dist/esm/pool/uma/across/constants.d.ts +0 -2
- package/dist/esm/pool/uma/across/constants.js +0 -3
- package/dist/esm/pool/uma/across/constants.js.map +0 -1
- package/dist/esm/pool/uma/across/index.d.ts +0 -2
- package/dist/esm/pool/uma/across/index.js +0 -4
- package/dist/esm/pool/uma/across/index.js.map +0 -1
- package/dist/esm/pool/uma/across/transactionManager.d.ts +0 -12
- package/dist/esm/pool/uma/across/transactionManager.js +0 -122
- package/dist/esm/pool/uma/across/transactionManager.js.map +0 -1
- package/dist/esm/pool/uma/clients/erc20/client.d.ts +0 -26
- package/dist/esm/pool/uma/clients/erc20/client.js +0 -35
- package/dist/esm/pool/uma/clients/erc20/client.js.map +0 -1
- package/dist/esm/pool/uma/clients/erc20/index.d.ts +0 -1
- package/dist/esm/pool/uma/clients/erc20/index.js +0 -2
- package/dist/esm/pool/uma/clients/erc20/index.js.map +0 -1
- package/dist/esm/pool/uma/clients/index.d.ts +0 -1
- package/dist/esm/pool/uma/clients/index.js +0 -3
- package/dist/esm/pool/uma/clients/index.js.map +0 -1
- package/dist/esm/pool/uma/index.d.ts +0 -13
- package/dist/esm/pool/uma/index.js +0 -9
- package/dist/esm/pool/uma/index.js.map +0 -1
- package/dist/esm/pool/uma/oracle/index.d.ts +0 -1
- package/dist/esm/pool/uma/oracle/index.js +0 -3
- package/dist/esm/pool/uma/oracle/index.js.map +0 -1
- package/dist/esm/pool/uma/oracle/utils.d.ts +0 -23
- package/dist/esm/pool/uma/oracle/utils.js +0 -33
- package/dist/esm/pool/uma/oracle/utils.js.map +0 -1
- package/dist/esm/pool/uma/utils.d.ts +0 -17
- package/dist/esm/pool/uma/utils.js +0 -68
- package/dist/esm/pool/uma/utils.js.map +0 -1
- package/dist/types/pool/TransactionManager.d.ts +0 -13
- package/dist/types/pool/TransactionManager.d.ts.map +0 -1
- package/dist/types/pool/index.d.ts +0 -2
- package/dist/types/pool/index.d.ts.map +0 -1
- package/dist/types/pool/poolClient.d.ts +0 -239
- package/dist/types/pool/poolClient.d.ts.map +0 -1
- package/dist/types/pool/uma/across/constants.d.ts +0 -3
- package/dist/types/pool/uma/across/constants.d.ts.map +0 -1
- package/dist/types/pool/uma/across/index.d.ts +0 -3
- package/dist/types/pool/uma/across/index.d.ts.map +0 -1
- package/dist/types/pool/uma/across/transactionManager.d.ts +0 -13
- package/dist/types/pool/uma/across/transactionManager.d.ts.map +0 -1
- package/dist/types/pool/uma/clients/erc20/client.d.ts +0 -27
- package/dist/types/pool/uma/clients/erc20/client.d.ts.map +0 -1
- package/dist/types/pool/uma/clients/erc20/index.d.ts +0 -2
- package/dist/types/pool/uma/clients/erc20/index.d.ts.map +0 -1
- package/dist/types/pool/uma/clients/index.d.ts +0 -2
- package/dist/types/pool/uma/clients/index.d.ts.map +0 -1
- package/dist/types/pool/uma/index.d.ts +0 -14
- package/dist/types/pool/uma/index.d.ts.map +0 -1
- package/dist/types/pool/uma/oracle/index.d.ts +0 -2
- package/dist/types/pool/uma/oracle/index.d.ts.map +0 -1
- package/dist/types/pool/uma/oracle/utils.d.ts +0 -24
- package/dist/types/pool/uma/oracle/utils.d.ts.map +0 -1
- package/dist/types/pool/uma/utils.d.ts +0 -18
- package/dist/types/pool/uma/utils.d.ts.map +0 -1
- package/src/pool/TransactionManager.ts +0 -73
- package/src/pool/index.ts +0 -1
- package/src/pool/poolClient.ts +0 -849
- package/src/pool/uma/across/constants.ts +0 -2
- package/src/pool/uma/across/index.ts +0 -2
- package/src/pool/uma/across/transactionManager.ts +0 -73
- package/src/pool/uma/clients/erc20/README.md +0 -29
- package/src/pool/uma/clients/erc20/client.e2e.ts +0 -26
- package/src/pool/uma/clients/erc20/client.ts +0 -67
- package/src/pool/uma/clients/erc20/index.ts +0 -1
- package/src/pool/uma/clients/index.ts +0 -1
- package/src/pool/uma/index.ts +0 -33
- package/src/pool/uma/oracle/index.ts +0 -2
- package/src/pool/uma/oracle/utils.ts +0 -38
- package/src/pool/uma/utils.test.ts +0 -24
- package/src/pool/uma/utils.ts +0 -53
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageTransmitterClient, SvmSpokeClient } from "@across-protocol/contracts";
|
|
2
2
|
import { Mint } from "@solana-program/token";
|
|
3
|
-
import { Account, Address, FetchAccountConfig,
|
|
3
|
+
import { Account, AccountMeta, Address, FetchAccountConfig, Instruction, KeyPairSigner, ReadonlyUint8Array, type TransactionSigner, type WritableAccount, type ReadonlyAccount, type Commitment, type TransactionMessage, type TransactionMessageWithBlockhashLifetime, type TransactionMessageWithFeePayer } from "@solana/kit";
|
|
4
4
|
import winston from "winston";
|
|
5
5
|
import { DepositWithBlock, FillStatus, FillWithBlock, RelayData, RelayDataWithMessageHash } from "../../interfaces";
|
|
6
6
|
import { BigNumber, EvmAddress, Address as SdkAddress, SvmAddress } from "../../utils";
|
|
@@ -121,7 +121,7 @@ export declare function findFillEvent(relayData: RelayDataWithMessageHash, desti
|
|
|
121
121
|
* @param repaymentChainId Optional repaymentChainId (defaults to destinationChainId).
|
|
122
122
|
* @returns An Ethers UnsignedTransaction instance.
|
|
123
123
|
*/
|
|
124
|
-
export declare function fillRelayInstruction(spokePool: SvmAddress, relayData: ProtoFill, signer: TransactionSigner<string>, recipientTokenAccount: Address<string>, repaymentAddress: EvmAddress | SvmAddress, repaymentChainId: number): Promise<
|
|
124
|
+
export declare function fillRelayInstruction(spokePool: SvmAddress, relayData: ProtoFill, signer: TransactionSigner<string>, recipientTokenAccount: Address<string>, repaymentAddress: EvmAddress | SvmAddress, repaymentChainId: number): Promise<Instruction>;
|
|
125
125
|
/**
|
|
126
126
|
* @param mint Address of the token corresponding to the account being made.
|
|
127
127
|
* @param relayer Address of the relayer filling the deposit.
|
|
@@ -142,7 +142,7 @@ export declare function getFillRelayTx(spokePoolAddr: SvmAddress, solanaClient:
|
|
|
142
142
|
destinationChainId: number;
|
|
143
143
|
recipient: SvmAddress;
|
|
144
144
|
outputToken: SvmAddress;
|
|
145
|
-
}, signer: TransactionSigner, repaymentChainId: number, repaymentAddress: SdkAddress): Promise<
|
|
145
|
+
}, signer: TransactionSigner, repaymentChainId: number, repaymentAddress: SdkAddress): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer>;
|
|
146
146
|
/**
|
|
147
147
|
* Creates a fill instruction with an instruction params PDA as the relayData input.
|
|
148
148
|
* @param spokePoolAddr Address of the spoke pool we're trying to fill through
|
|
@@ -157,7 +157,7 @@ export declare function getIPFillRelayTx(spokePoolAddr: SvmAddress, solanaClient
|
|
|
157
157
|
destinationChainId: number;
|
|
158
158
|
recipient: SvmAddress;
|
|
159
159
|
outputToken: SvmAddress;
|
|
160
|
-
}, signer: TransactionSigner, repaymentChainId: number, repaymentAddress: SdkAddress): Promise<
|
|
160
|
+
}, signer: TransactionSigner, repaymentChainId: number, repaymentAddress: SdkAddress): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer>;
|
|
161
161
|
/**
|
|
162
162
|
* Creates a fill instruction.
|
|
163
163
|
* @param signer - The signer of the transaction.
|
|
@@ -167,7 +167,7 @@ export declare function getIPFillRelayTx(spokePoolAddr: SvmAddress, solanaClient
|
|
|
167
167
|
* @param createRecipientAta - Whether to create a recipient token account.
|
|
168
168
|
* @returns The fill instruction.
|
|
169
169
|
*/
|
|
170
|
-
export declare const createFillInstruction: (signer: TransactionSigner, solanaClient: SVMProvider, fillInput: SvmSpokeClient.FillRelayInput, relayData: Pick<SvmSpokeClient.RelayDataArgs, "outputAmount" | "recipient">, tokenDecimals: number, createRecipientAta?: boolean, remainingAccounts?: (WritableAccount | ReadonlyAccount)[]) => Promise<
|
|
170
|
+
export declare const createFillInstruction: (signer: TransactionSigner, solanaClient: SVMProvider, fillInput: SvmSpokeClient.FillRelayInput, relayData: Pick<SvmSpokeClient.RelayDataArgs, "outputAmount" | "recipient">, tokenDecimals: number, createRecipientAta?: boolean, remainingAccounts?: (WritableAccount | ReadonlyAccount)[]) => Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer>;
|
|
171
171
|
export declare function deserializeMessage(_message: string): AcrossPlusMessage;
|
|
172
172
|
/**
|
|
173
173
|
* Creates a deposit instruction.
|
|
@@ -178,7 +178,7 @@ export declare function deserializeMessage(_message: string): AcrossPlusMessage;
|
|
|
178
178
|
* @param createVaultAtaIfNeeded - Whether to create a vault token account.
|
|
179
179
|
* @returns The deposit instruction.
|
|
180
180
|
*/
|
|
181
|
-
export declare const createDepositInstruction: (signer: TransactionSigner, solanaClient: SVMProvider, depositInput: SvmSpokeClient.DepositInput, tokenDecimals: number, createVaultAtaIfNeeded?: boolean) => Promise<
|
|
181
|
+
export declare const createDepositInstruction: (signer: TransactionSigner, solanaClient: SVMProvider, depositInput: SvmSpokeClient.DepositInput, tokenDecimals: number, createVaultAtaIfNeeded?: boolean) => Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime>;
|
|
182
182
|
/**
|
|
183
183
|
* Creates a request slow fill instruction.
|
|
184
184
|
* @param signer - The signer of the transaction.
|
|
@@ -186,7 +186,7 @@ export declare const createDepositInstruction: (signer: TransactionSigner, solan
|
|
|
186
186
|
* @param requestSlowFillInput - The input arguments for the `requestSlowFill` instruction.
|
|
187
187
|
* @returns The request slow fill instruction.
|
|
188
188
|
*/
|
|
189
|
-
export declare const createRequestSlowFillInstruction: (signer: TransactionSigner, solanaClient: SVMProvider, requestSlowFillInput: SvmSpokeClient.RequestSlowFillInput) => Promise<
|
|
189
|
+
export declare const createRequestSlowFillInstruction: (signer: TransactionSigner, solanaClient: SVMProvider, requestSlowFillInput: SvmSpokeClient.RequestSlowFillInput) => Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime>;
|
|
190
190
|
/**
|
|
191
191
|
* @notice Return the requestSlowFill transaction for a given deposit
|
|
192
192
|
* @param spokePoolAddr Address of the spoke pool we're trying to fill through
|
|
@@ -199,7 +199,7 @@ export declare function getSlowFillRequestTx(spokePoolAddr: SvmAddress, solanaCl
|
|
|
199
199
|
destinationChainId: number;
|
|
200
200
|
recipient: SvmAddress;
|
|
201
201
|
outputToken: SvmAddress;
|
|
202
|
-
}, signer: TransactionSigner): Promise<
|
|
202
|
+
}, signer: TransactionSigner): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime>;
|
|
203
203
|
/**
|
|
204
204
|
* Creates a close fill PDA instruction.
|
|
205
205
|
* @param signer - The signer of the transaction.
|
|
@@ -207,20 +207,13 @@ export declare function getSlowFillRequestTx(spokePoolAddr: SvmAddress, solanaCl
|
|
|
207
207
|
* @param fillStatusPda - The fill status PDA.
|
|
208
208
|
* @returns The close fill PDA instruction.
|
|
209
209
|
*/
|
|
210
|
-
export declare const createCloseFillPdaInstruction: (signer: TransactionSigner, solanaClient: SVMProvider, fillStatusPda: Address) => Promise<
|
|
211
|
-
export declare const createReceiveMessageInstruction: (signer: TransactionSigner, solanaClient: SVMProvider, input: MessageTransmitterClient.ReceiveMessageInput, remainingAccounts:
|
|
210
|
+
export declare const createCloseFillPdaInstruction: (signer: TransactionSigner, solanaClient: SVMProvider, fillStatusPda: Address) => Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime>;
|
|
211
|
+
export declare const createReceiveMessageInstruction: (signer: TransactionSigner, solanaClient: SVMProvider, input: MessageTransmitterClient.ReceiveMessageInput, remainingAccounts: AccountMeta<string>[]) => Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer>;
|
|
212
212
|
export declare function getAssociatedTokenAddress(owner: SvmAddress, mint: SvmAddress, tokenProgramId?: Address<string>): Promise<Address<string>>;
|
|
213
213
|
export declare function getRelayDataHash(relayData: RelayData & {
|
|
214
214
|
messageHash: string;
|
|
215
215
|
}, destinationChainId: number): string;
|
|
216
|
-
export declare function getIPForFillRelayTxs(spokePool: SvmAddress, relayData: RelayData, repaymentChainId: number, repaymentAddress: SdkAddress, signer: TransactionSigner<string>, provider: SVMProvider): Promise<
|
|
217
|
-
instructions: readonly import("@solana/kit").Instruction<string, readonly (import("@solana/kit").AccountLookupMeta<string, string> | import("@solana/kit").AccountMeta<string>)[]>[];
|
|
218
|
-
version: 0;
|
|
219
|
-
}>, "instructions"> & import("@solana/kit").TransactionMessageWithinSizeLimit & {
|
|
220
|
-
instructions: readonly [];
|
|
221
|
-
}, "feePayer"> & import("@solana/kit").TransactionMessageWithFeePayerSigner<string, TransactionSigner<string>>> & TransactionMessageWithBlockhashLifetime>, "instructions"> & {
|
|
222
|
-
readonly instructions: readonly [IInstruction];
|
|
223
|
-
})[]>;
|
|
216
|
+
export declare function getIPForFillRelayTxs(spokePool: SvmAddress, relayData: RelayData, repaymentChainId: number, repaymentAddress: SdkAddress, signer: TransactionSigner<string>, provider: SVMProvider): Promise<Array<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer>>;
|
|
224
217
|
/**
|
|
225
218
|
* Returns a set of instructions to execute to fill a relay via instruction params.
|
|
226
219
|
* @param spokePool The program ID of the Solana spoke pool.
|
|
@@ -230,7 +223,7 @@ export declare function getIPForFillRelayTxs(spokePool: SvmAddress, relayData: R
|
|
|
230
223
|
* @param signer The transaction signer and authority of the instruction params PDA.
|
|
231
224
|
* @param maxWriteSize The maximum fragment size to write to instruction params.
|
|
232
225
|
*/
|
|
233
|
-
export declare function getFillRelayViaInstructionParamsInstructions(spokePool: Address<string>, relayData: RelayData, repaymentChainId: number, repaymentAddress: SdkAddress, signer: TransactionSigner<string>, provider: SVMProvider, maxWriteSize?: number): Promise<
|
|
226
|
+
export declare function getFillRelayViaInstructionParamsInstructions(spokePool: Address<string>, relayData: RelayData, repaymentChainId: number, repaymentAddress: SdkAddress, signer: TransactionSigner<string>, provider: SVMProvider, maxWriteSize?: number): Promise<Instruction[]>;
|
|
234
227
|
/**
|
|
235
228
|
* Returns the delegate PDA for deposit.
|
|
236
229
|
*/
|
|
@@ -284,7 +277,7 @@ export declare const hasCCTPV1MessageBeenProcessed: (solanaClient: SVMProvider,
|
|
|
284
277
|
* Returns the account metas for a tokenless message.
|
|
285
278
|
* @returns The account metas for a tokenless message.
|
|
286
279
|
*/
|
|
287
|
-
export declare function getAccountMetasForTokenlessMessage(solanaClient: SVMProvider, signer: KeyPairSigner, messageBytes: string): Promise<
|
|
280
|
+
export declare function getAccountMetasForTokenlessMessage(solanaClient: SVMProvider, signer: KeyPairSigner, messageBytes: string): Promise<AccountMeta<string>[]>;
|
|
288
281
|
/**
|
|
289
282
|
* Returns the required PDAs for a deposit message.
|
|
290
283
|
* @param hubChainId The chain ID of the corresponding Across hub.
|
|
@@ -300,7 +293,7 @@ export declare function getCCTPDepositAccounts(hubChainId: number, cctpDestinati
|
|
|
300
293
|
* @returns Object containing a boolean if the input deposit requires a multipart fill, false otherwise and
|
|
301
294
|
* the number of bytes in the serialized transaction.
|
|
302
295
|
*/
|
|
303
|
-
export declare function isSVMFillTooLarge(fillRelayTx:
|
|
296
|
+
export declare function isSVMFillTooLarge(fillRelayTx: TransactionMessage & TransactionMessageWithFeePayer): {
|
|
304
297
|
tooLarge: boolean;
|
|
305
298
|
sizeBytes: number;
|
|
306
299
|
};
|
|
@@ -315,7 +308,7 @@ export declare function base64StrToByteSize(base64TxString: string): number;
|
|
|
315
308
|
* @param fillTx The compilable fill relay transaction.
|
|
316
309
|
* @returns The number of bytes in the serialized fillRelay transaction.
|
|
317
310
|
*/
|
|
318
|
-
export declare function calculateFillSizeBytes(fillTx:
|
|
311
|
+
export declare function calculateFillSizeBytes(fillTx: TransactionMessage & TransactionMessageWithFeePayer): number;
|
|
319
312
|
/**
|
|
320
313
|
* Returns the CCTP v1 receive message transaction.
|
|
321
314
|
* @param solanaClient The Solana client.
|
|
@@ -325,7 +318,7 @@ export declare function calculateFillSizeBytes(fillTx: CompilableTransactionMess
|
|
|
325
318
|
* @param recipientAta The ATA of the recipient address (used for token finalizations only).
|
|
326
319
|
* @returns The CCTP v1 receive message transaction.
|
|
327
320
|
*/
|
|
328
|
-
export declare function getCCTPV1ReceiveMessageTx(solanaClient: SVMProvider, signer: KeyPairSigner, message: AttestedCCTPMessage, hubChainId: number, recipientAta: SvmAddress): Promise<
|
|
321
|
+
export declare function getCCTPV1ReceiveMessageTx(solanaClient: SVMProvider, signer: KeyPairSigner, message: AttestedCCTPMessage, hubChainId: number, recipientAta: SvmAddress): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer>;
|
|
329
322
|
/**
|
|
330
323
|
* Finalizes CCTP deposits and messages on Solana.
|
|
331
324
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpokeUtils.d.ts","sourceRoot":"","sources":["../../../../src/arch/svm/SpokeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAA8B,MAAM,4BAA4B,CAAC;AAIlH,OAAO,EAEL,IAAI,EAML,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,OAAO,
|
|
1
|
+
{"version":3,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{ Address,
|
|
3
|
+
import { Address, Instruction, KeyPairSigner, type Commitment, type TransactionMessage, type TransactionMessageWithBlockhashLifetime, type TransactionMessageWithFeePayer, type TransactionSigner } from "@solana/kit";
|
|
4
4
|
import { RelayData, RelayDataWithMessageHash } from "../../interfaces";
|
|
5
5
|
import { BigNumber, Address as SdkAddress } from "../../utils";
|
|
6
6
|
import { AttestedCCTPMessage, EventName, SVMProvider, LatestBlockhash } from "./types";
|
|
@@ -130,12 +130,7 @@ export declare function getRandomSvmAddress(): Address<string>;
|
|
|
130
130
|
* @param signer - The signer of the transaction.
|
|
131
131
|
* @returns The default transaction.
|
|
132
132
|
*/
|
|
133
|
-
export declare const createDefaultTransaction: (rpcClient: SVMProvider, signer: TransactionSigner, latestBlockhash?: LatestBlockhash) => Promise<
|
|
134
|
-
instructions: readonly import("@solana/kit").Instruction<string, readonly (import("@solana/kit").AccountLookupMeta<string, string> | import("@solana/kit").AccountMeta<string>)[]>[];
|
|
135
|
-
version: 0;
|
|
136
|
-
}>, "instructions"> & import("@solana/kit").TransactionMessageWithinSizeLimit & {
|
|
137
|
-
instructions: readonly [];
|
|
138
|
-
}, "feePayer"> & import("@solana/kit").TransactionMessageWithFeePayerSigner<string, TransactionSigner<string>>> & import("@solana/kit").TransactionMessageWithBlockhashLifetime>;
|
|
133
|
+
export declare const createDefaultTransaction: (rpcClient: SVMProvider, signer: TransactionSigner, latestBlockhash?: LatestBlockhash) => Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer>;
|
|
139
134
|
/**
|
|
140
135
|
* Simulates a transaction and decodes the result using a parser function.
|
|
141
136
|
* @param solanaClient - The Solana client.
|
|
@@ -144,7 +139,7 @@ export declare const createDefaultTransaction: (rpcClient: SVMProvider, signer:
|
|
|
144
139
|
* @param parser - The parser function to decode the result.
|
|
145
140
|
* @returns The decoded result.
|
|
146
141
|
*/
|
|
147
|
-
export declare const simulateAndDecode: <P extends (buf: Buffer) => unknown>(solanaClient: SVMProvider, ix:
|
|
142
|
+
export declare const simulateAndDecode: <P extends (buf: Buffer) => unknown>(solanaClient: SVMProvider, ix: Instruction, signer: KeyPairSigner, parser: P, latestBlockhash?: LatestBlockhash) => Promise<ReturnType<P>>;
|
|
148
143
|
/**
|
|
149
144
|
* Converts a common `RelayData` type to an SvmSpokeClient.RelayData` type. This is useful for when we need
|
|
150
145
|
* to interface directly with the SvmSpoke.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/arch/svm/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC1G,OAAO,EAAuB,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/arch/svm/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC1G,OAAO,EAAuB,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,OAAO,EACP,WAAW,EACX,aAAa,EAcb,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,uCAAuC,EAC5C,KAAK,8BAA8B,EACnC,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAY,SAAS,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,OAAO,IAAI,UAAU,EAAkD,MAAM,aAAa,CAAC;AAE/G,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAiB,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACtG,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,iBAAiB,CAAC,MAAM,CASrF,CAAC;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,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAQpD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA+BnH"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * as arch from "./arch";
|
|
2
2
|
export * as addressAggregator from "./addressAggregator";
|
|
3
3
|
export * as lpFeeCalculator from "./lpFeeCalculator";
|
|
4
|
-
export * as pool from "./pool";
|
|
5
4
|
export * as relayFeeCalculator from "./relayFeeCalculator";
|
|
6
5
|
export * as utils from "./utils";
|
|
7
6
|
export * as contracts from "./contracts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransactionSigner, type
|
|
1
|
+
import { TransactionSigner, type TransactionMessage, type TransactionMessageWithBlockhashLifetime, type TransactionMessageWithFeePayer } from "@solana/kit";
|
|
2
2
|
import { SVMProvider } from "../../arch/svm";
|
|
3
3
|
import { RelayData } from "../../interfaces";
|
|
4
4
|
import { Address, BigNumber, BigNumberish, SvmAddress, TransactionCostEstimate } from "../../utils";
|
|
@@ -17,7 +17,7 @@ export declare class SvmQuery implements QueryInterface {
|
|
|
17
17
|
readonly coingeckoProApiKey?: string | undefined;
|
|
18
18
|
readonly fixedGasPrice?: BigNumberish | undefined;
|
|
19
19
|
readonly coingeckoBaseCurrency: string;
|
|
20
|
-
protected computeUnitEstimator:
|
|
20
|
+
protected computeUnitEstimator: import("@solana-program/compute-budget/dist/types/estimateComputeLimitInternal").EstimateComputeUnitLimitFactoryFunction;
|
|
21
21
|
/**
|
|
22
22
|
* Instantiates a SvmQuery instance
|
|
23
23
|
* @param provider A valid solana/kit rpc client.
|
|
@@ -75,7 +75,7 @@ export declare class SvmQuery implements QueryInterface {
|
|
|
75
75
|
destinationChainId: number;
|
|
76
76
|
recipient: SvmAddress;
|
|
77
77
|
outputToken: SvmAddress;
|
|
78
|
-
}, signer: TransactionSigner, repaymentChainId: number, repaymentAddress: Address): Promise<
|
|
78
|
+
}, signer: TransactionSigner, repaymentChainId: number, repaymentAddress: Address): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer>;
|
|
79
79
|
/**
|
|
80
80
|
* Retrieves the current price of a token
|
|
81
81
|
* @param tokenSymbol A valid [CoinGecko-ID](https://api.coingecko.com/api/v3/coins/list)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svmQuery.d.ts","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/svmQuery.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"svmQuery.d.ts","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/svmQuery.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EAQjB,KAAK,kBAAkB,EACvB,KAAK,uCAAuC,EAC5C,KAAK,8BAA8B,EACpC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EASZ,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,uBAAuB,EAAkB,MAAM,aAAa,CAAC;AACpH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAqB,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAC;AAMvC;;;GAGG;AACH,qBAAa,QAAS,YAAW,cAAc;IAe3C,QAAQ,CAAC,QAAQ,EAAE,WAAW;IAC9B,QAAQ,CAAC,aAAa,EAAE,iBAAiB;IACzC,QAAQ,CAAC,SAAS,EAAE,UAAU;IAC9B,QAAQ,CAAC,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AAE,iBAAiB,EACzB,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,EAAE,OAAO,GACxB,OAAO,CAAC,kBAAkB,GAAG,uCAAuC,GAAG,8BAA8B,CAAC;IAIzG;;;;OAIG;IACG,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAUzD;;;;OAIG;IACH,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAMvC,oBAAoB,CACxB,SAAS,EAAE,SAAS,GAAG;QACrB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,SAAS,EAAE,UAAU,CAAC;QACtB,WAAW,EAAE,UAAU,CAAC;QACxB,gBAAgB,EAAE,UAAU,CAAC;KAC9B,EACD,OAAO,EAAE,UAAU,EACnB,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,EAAE,UAAU,GAC3B,OAAO,CAAC,MAAM,CAAC;CAiEnB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@across-protocol/sdk",
|
|
3
3
|
"author": "UMA Team",
|
|
4
|
-
"version": "4.3.
|
|
4
|
+
"version": "4.3.114-alpha.0",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"homepage": "https://docs.across.to/reference/sdk",
|
|
7
7
|
"repository": {
|
|
@@ -109,17 +109,18 @@
|
|
|
109
109
|
"dependencies": {
|
|
110
110
|
"@across-protocol/across-token": "^1.0.0",
|
|
111
111
|
"@across-protocol/constants": "^3.1.97",
|
|
112
|
-
"@across-protocol/contracts": "4.1.
|
|
112
|
+
"@across-protocol/contracts": "4.1.23-alpha.0",
|
|
113
113
|
"@coral-xyz/anchor": "^0.30.1",
|
|
114
114
|
"@eth-optimism/sdk": "^3.3.1",
|
|
115
115
|
"@ethersproject/bignumber": "^5.7.0",
|
|
116
116
|
"@nktkas/hyperliquid": "^0.25.9",
|
|
117
117
|
"@pinata/sdk": "^2.1.0",
|
|
118
|
-
"@solana-program/system": "^0.
|
|
119
|
-
"@solana-program/token
|
|
120
|
-
"@solana-program/
|
|
121
|
-
"@solana/
|
|
122
|
-
"@
|
|
118
|
+
"@solana-program/system": "^0.10.0",
|
|
119
|
+
"@solana-program/token": "^0.9.0",
|
|
120
|
+
"@solana-program/token-2022": "^0.6.1",
|
|
121
|
+
"@solana-program/compute-budget": "^0.11.0",
|
|
122
|
+
"@solana/kit": "^5.4.0",
|
|
123
|
+
"@solana/sysvars": "^5.4.0",
|
|
123
124
|
"arweave": "^1.14.4",
|
|
124
125
|
"async": "^3.2.5",
|
|
125
126
|
"axios": "^0.27.2",
|
|
@@ -169,7 +170,15 @@
|
|
|
169
170
|
"**/ethereum-cryptography/secp256k1": "4.0.4",
|
|
170
171
|
"**/arbundles/secp256k1": "4.0.4",
|
|
171
172
|
"**/ganache/secp256k1": "4.0.4",
|
|
172
|
-
"**/ethereumjs-util/secp256k1": "3.8.1"
|
|
173
|
+
"**/ethereumjs-util/secp256k1": "3.8.1",
|
|
174
|
+
"**/@solana/codecs": "5.4.0",
|
|
175
|
+
"**/@solana/codecs-core": "5.4.0",
|
|
176
|
+
"**/@solana/codecs-data-structures": "5.4.0",
|
|
177
|
+
"**/@solana/codecs-numbers": "5.4.0",
|
|
178
|
+
"**/@solana/codecs-strings": "5.4.0",
|
|
179
|
+
"**/@solana/addresses": "5.4.0",
|
|
180
|
+
"**/@solana/options": "5.4.0",
|
|
181
|
+
"**/@solana/errors": "5.4.0"
|
|
173
182
|
},
|
|
174
183
|
"overrides": {
|
|
175
184
|
"secp256k1@3.7.1": "3.8.1",
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
} from "@solana-program/token";
|
|
14
14
|
import {
|
|
15
15
|
Account,
|
|
16
|
+
AccountMeta,
|
|
16
17
|
AccountRole,
|
|
17
18
|
Address,
|
|
18
19
|
FetchAccountConfig,
|
|
19
|
-
|
|
20
|
-
IInstruction,
|
|
20
|
+
Instruction,
|
|
21
21
|
KeyPairSigner,
|
|
22
22
|
ReadonlyUint8Array,
|
|
23
23
|
appendTransactionMessageInstruction,
|
|
@@ -37,8 +37,9 @@ import {
|
|
|
37
37
|
type WritableAccount,
|
|
38
38
|
type ReadonlyAccount,
|
|
39
39
|
type Commitment,
|
|
40
|
-
type
|
|
40
|
+
type TransactionMessage,
|
|
41
41
|
type TransactionMessageWithBlockhashLifetime,
|
|
42
|
+
type TransactionMessageWithFeePayer,
|
|
42
43
|
} from "@solana/kit";
|
|
43
44
|
import assert from "assert";
|
|
44
45
|
import winston from "winston";
|
|
@@ -504,7 +505,7 @@ export async function fillRelayInstruction(
|
|
|
504
505
|
recipientTokenAccount: Address<string>,
|
|
505
506
|
repaymentAddress: EvmAddress | SvmAddress,
|
|
506
507
|
repaymentChainId: number
|
|
507
|
-
): Promise<
|
|
508
|
+
): Promise<Instruction> {
|
|
508
509
|
const program = toAddress(spokePool);
|
|
509
510
|
assert(
|
|
510
511
|
repaymentAddress.isValidOn(repaymentChainId),
|
|
@@ -579,7 +580,7 @@ export async function getFillRelayTx(
|
|
|
579
580
|
signer: TransactionSigner,
|
|
580
581
|
repaymentChainId: number,
|
|
581
582
|
repaymentAddress: SdkAddress
|
|
582
|
-
): Promise<
|
|
583
|
+
): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer> {
|
|
583
584
|
const svmRelayData = toSvmRelayData(relayData);
|
|
584
585
|
|
|
585
586
|
assert(
|
|
@@ -674,7 +675,7 @@ export async function getIPFillRelayTx(
|
|
|
674
675
|
signer: TransactionSigner,
|
|
675
676
|
repaymentChainId: number,
|
|
676
677
|
repaymentAddress: SdkAddress
|
|
677
|
-
): Promise<
|
|
678
|
+
): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer> {
|
|
678
679
|
const program = toAddress(spokePoolAddr);
|
|
679
680
|
const _relayDataHash = getRelayDataHash(
|
|
680
681
|
{ ...relayData, messageHash: getMessageHash(relayData.message) },
|
|
@@ -765,7 +766,7 @@ export const createFillInstruction = async (
|
|
|
765
766
|
tokenDecimals: number,
|
|
766
767
|
createRecipientAta: boolean = false,
|
|
767
768
|
remainingAccounts: (WritableAccount | ReadonlyAccount)[] = []
|
|
768
|
-
): Promise<
|
|
769
|
+
): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer> => {
|
|
769
770
|
const mintInfo = await getMintInfo(solanaClient, fillInput.mint);
|
|
770
771
|
const approveIx = getApproveCheckedInstruction(
|
|
771
772
|
{
|
|
@@ -833,7 +834,7 @@ export const createDepositInstruction = async (
|
|
|
833
834
|
depositInput: SvmSpokeClient.DepositInput,
|
|
834
835
|
tokenDecimals: number,
|
|
835
836
|
createVaultAtaIfNeeded: boolean = true
|
|
836
|
-
): Promise<
|
|
837
|
+
): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime> => {
|
|
837
838
|
const getCreateAssociatedTokenIdempotentIx = () =>
|
|
838
839
|
getCreateAssociatedTokenIdempotentInstruction({
|
|
839
840
|
payer: signer,
|
|
@@ -878,7 +879,7 @@ export const createRequestSlowFillInstruction = async (
|
|
|
878
879
|
signer: TransactionSigner,
|
|
879
880
|
solanaClient: SVMProvider,
|
|
880
881
|
requestSlowFillInput: SvmSpokeClient.RequestSlowFillInput
|
|
881
|
-
): Promise<
|
|
882
|
+
): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime> => {
|
|
882
883
|
const requestSlowFillIx = SvmSpokeClient.getRequestSlowFillInstruction(requestSlowFillInput);
|
|
883
884
|
|
|
884
885
|
return pipe(await createDefaultTransaction(solanaClient, signer), (tx) =>
|
|
@@ -903,7 +904,7 @@ export async function getSlowFillRequestTx(
|
|
|
903
904
|
outputToken: SvmAddress;
|
|
904
905
|
},
|
|
905
906
|
signer: TransactionSigner
|
|
906
|
-
): Promise<
|
|
907
|
+
): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime> {
|
|
907
908
|
const program = toAddress(spokePoolAddr);
|
|
908
909
|
const messageHash = getMessageHash(relayData.message);
|
|
909
910
|
const relayDataHash = getRelayDataHash({ ...relayData, messageHash }, relayData.destinationChainId);
|
|
@@ -940,7 +941,7 @@ export const createCloseFillPdaInstruction = async (
|
|
|
940
941
|
signer: TransactionSigner,
|
|
941
942
|
solanaClient: SVMProvider,
|
|
942
943
|
fillStatusPda: Address
|
|
943
|
-
): Promise<
|
|
944
|
+
): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime> => {
|
|
944
945
|
const closeFillPdaIx = SvmSpokeClient.getCloseFillPdaInstruction({
|
|
945
946
|
signer,
|
|
946
947
|
state: await getStatePda(SvmSpokeClient.SVM_SPOKE_PROGRAM_ADDRESS),
|
|
@@ -955,10 +956,10 @@ export const createReceiveMessageInstruction = async (
|
|
|
955
956
|
signer: TransactionSigner,
|
|
956
957
|
solanaClient: SVMProvider,
|
|
957
958
|
input: MessageTransmitterClient.ReceiveMessageInput,
|
|
958
|
-
remainingAccounts:
|
|
959
|
-
): Promise<
|
|
959
|
+
remainingAccounts: AccountMeta<string>[]
|
|
960
|
+
): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer> => {
|
|
960
961
|
const receiveMessageIx = MessageTransmitterClient.getReceiveMessageInstruction(input);
|
|
961
|
-
(receiveMessageIx.accounts as
|
|
962
|
+
(receiveMessageIx.accounts as AccountMeta<string>[]).push(...remainingAccounts);
|
|
962
963
|
return pipe(await createDefaultTransaction(solanaClient, signer), (tx) =>
|
|
963
964
|
appendTransactionMessageInstruction(receiveMessageIx, tx)
|
|
964
965
|
);
|
|
@@ -1094,7 +1095,7 @@ export async function getIPForFillRelayTxs(
|
|
|
1094
1095
|
repaymentAddress: SdkAddress,
|
|
1095
1096
|
signer: TransactionSigner<string>,
|
|
1096
1097
|
provider: SVMProvider
|
|
1097
|
-
) {
|
|
1098
|
+
): Promise<Array<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer>> {
|
|
1098
1099
|
const ixs = await getFillRelayViaInstructionParamsInstructions(
|
|
1099
1100
|
toAddress(spokePool),
|
|
1100
1101
|
relayData,
|
|
@@ -1126,7 +1127,7 @@ export async function getFillRelayViaInstructionParamsInstructions(
|
|
|
1126
1127
|
signer: TransactionSigner<string>,
|
|
1127
1128
|
provider: SVMProvider,
|
|
1128
1129
|
maxWriteSize = 450
|
|
1129
|
-
): Promise<
|
|
1130
|
+
): Promise<Instruction[]> {
|
|
1130
1131
|
const instructionParams = await getInstructionParamsPda(spokePool, signer.address);
|
|
1131
1132
|
const encodedInstructionParams = await fetchEncodedAccount(provider, instructionParams);
|
|
1132
1133
|
|
|
@@ -1143,7 +1144,7 @@ export async function getFillRelayViaInstructionParamsInstructions(
|
|
|
1143
1144
|
instructionParams,
|
|
1144
1145
|
totalSize: encodedRelayData.length,
|
|
1145
1146
|
});
|
|
1146
|
-
const instructions:
|
|
1147
|
+
const instructions: Instruction[] = [initInstructionParamsIx];
|
|
1147
1148
|
|
|
1148
1149
|
for (let i = 0; i <= encodedRelayData.length / maxWriteSize; ++i) {
|
|
1149
1150
|
const offset = i * maxWriteSize;
|
|
@@ -1328,7 +1329,7 @@ export async function getAccountMetasForTokenlessMessage(
|
|
|
1328
1329
|
solanaClient: SVMProvider,
|
|
1329
1330
|
signer: KeyPairSigner,
|
|
1330
1331
|
messageBytes: string
|
|
1331
|
-
): Promise<
|
|
1332
|
+
): Promise<AccountMeta<string>[]> {
|
|
1332
1333
|
const messageHex = messageBytes.slice(2);
|
|
1333
1334
|
const messageHeader = decodeMessageHeader(Buffer.from(messageHex, "hex"));
|
|
1334
1335
|
const programAddress = SvmSpokeClient.SVM_SPOKE_PROGRAM_ADDRESS;
|
|
@@ -1336,7 +1337,7 @@ export async function getAccountMetasForTokenlessMessage(
|
|
|
1336
1337
|
const selfAuthority = await getSelfAuthority();
|
|
1337
1338
|
const eventAuthority = await getEventAuthority(programAddress);
|
|
1338
1339
|
|
|
1339
|
-
const base:
|
|
1340
|
+
const base: AccountMeta<string>[] = [
|
|
1340
1341
|
{ address: statePda, role: AccountRole.READONLY },
|
|
1341
1342
|
{ address: selfAuthority, role: AccountRole.READONLY },
|
|
1342
1343
|
{ address: programAddress, role: AccountRole.READONLY },
|
|
@@ -1455,7 +1456,7 @@ export async function getCCTPDepositAccounts(
|
|
|
1455
1456
|
* @returns Object containing a boolean if the input deposit requires a multipart fill, false otherwise and
|
|
1456
1457
|
* the number of bytes in the serialized transaction.
|
|
1457
1458
|
*/
|
|
1458
|
-
export function isSVMFillTooLarge(fillRelayTx:
|
|
1459
|
+
export function isSVMFillTooLarge(fillRelayTx: TransactionMessage & TransactionMessageWithFeePayer): {
|
|
1459
1460
|
tooLarge: boolean;
|
|
1460
1461
|
sizeBytes: number;
|
|
1461
1462
|
} {
|
|
@@ -1483,7 +1484,7 @@ export function base64StrToByteSize(base64TxString: string): number {
|
|
|
1483
1484
|
* @param fillTx The compilable fill relay transaction.
|
|
1484
1485
|
* @returns The number of bytes in the serialized fillRelay transaction.
|
|
1485
1486
|
*/
|
|
1486
|
-
export function calculateFillSizeBytes(fillTx:
|
|
1487
|
+
export function calculateFillSizeBytes(fillTx: TransactionMessage & TransactionMessageWithFeePayer): number {
|
|
1487
1488
|
const signedTransaction = compileTransaction(fillTx);
|
|
1488
1489
|
const serializedTx = getBase64EncodedWireTransaction(signedTransaction);
|
|
1489
1490
|
return base64StrToByteSize(serializedTx);
|
|
@@ -1502,7 +1503,7 @@ async function getAccountMetasForDepositMessage(
|
|
|
1502
1503
|
hubChainId: number,
|
|
1503
1504
|
tokenMessengerMinter: Address,
|
|
1504
1505
|
recipientAta: SvmAddress
|
|
1505
|
-
): Promise<
|
|
1506
|
+
): Promise<AccountMeta<string>[]> {
|
|
1506
1507
|
const l1Usdc = EvmAddress.from(TOKEN_SYMBOLS_MAP.USDC.addresses[hubChainId]);
|
|
1507
1508
|
const l2Usdc = SvmAddress.from(
|
|
1508
1509
|
TOKEN_SYMBOLS_MAP.USDC.addresses[chainIsProd(hubChainId) ? CHAIN_IDs.SOLANA : CHAIN_IDs.SOLANA_DEVNET]
|
|
@@ -1577,7 +1578,7 @@ export async function getCCTPV1ReceiveMessageTx(
|
|
|
1577
1578
|
message: AttestedCCTPMessage,
|
|
1578
1579
|
hubChainId: number,
|
|
1579
1580
|
recipientAta: SvmAddress
|
|
1580
|
-
): Promise<
|
|
1581
|
+
): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer> {
|
|
1581
1582
|
const [messageTransmitterPda] = await getProgramDerivedAddress({
|
|
1582
1583
|
programAddress: MessageTransmitterClient.MESSAGE_TRANSMITTER_PROGRAM_ADDRESS,
|
|
1583
1584
|
seeds: ["message_transmitter"],
|
|
@@ -1601,7 +1602,7 @@ export async function getCCTPV1ReceiveMessageTx(
|
|
|
1601
1602
|
const usedNonces = await getCCTPNoncePda(solanaClient, signer, message.nonce, message.sourceDomain);
|
|
1602
1603
|
|
|
1603
1604
|
// Notice: for Svm tokenless messages, we currently only support very specific finalizations: Hub -> Spoke relayRootBundle calls
|
|
1604
|
-
const accountMetas:
|
|
1605
|
+
const accountMetas: AccountMeta<string>[] = isDepositForBurnEvent(message)
|
|
1605
1606
|
? await getAccountMetasForDepositMessage(
|
|
1606
1607
|
message,
|
|
1607
1608
|
hubChainId,
|
package/src/arch/svm/utils.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { MessageTransmitterClient, SpokePool__factory, SvmSpokeClient } from "@a
|
|
|
2
2
|
import { BN, BorshEventCoder, Idl } from "@coral-xyz/anchor";
|
|
3
3
|
import {
|
|
4
4
|
Address,
|
|
5
|
-
|
|
5
|
+
Instruction,
|
|
6
6
|
KeyPairSigner,
|
|
7
7
|
address,
|
|
8
8
|
appendTransactionMessageInstruction,
|
|
@@ -18,6 +18,9 @@ import {
|
|
|
18
18
|
setTransactionMessageLifetimeUsingBlockhash,
|
|
19
19
|
signTransactionMessageWithSigners,
|
|
20
20
|
type Commitment,
|
|
21
|
+
type TransactionMessage,
|
|
22
|
+
type TransactionMessageWithBlockhashLifetime,
|
|
23
|
+
type TransactionMessageWithFeePayer,
|
|
21
24
|
type TransactionSigner,
|
|
22
25
|
} from "@solana/kit";
|
|
23
26
|
import assert from "assert";
|
|
@@ -411,7 +414,7 @@ export const createDefaultTransaction = async (
|
|
|
411
414
|
rpcClient: SVMProvider,
|
|
412
415
|
signer: TransactionSigner,
|
|
413
416
|
latestBlockhash?: LatestBlockhash
|
|
414
|
-
) => {
|
|
417
|
+
): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer> => {
|
|
415
418
|
latestBlockhash = isDefined(latestBlockhash) ? latestBlockhash : (await rpcClient.getLatestBlockhash().send()).value;
|
|
416
419
|
return pipe(
|
|
417
420
|
createTransactionMessage({ version: 0 }),
|
|
@@ -430,7 +433,7 @@ export const createDefaultTransaction = async (
|
|
|
430
433
|
*/
|
|
431
434
|
export const simulateAndDecode = async <P extends (buf: Buffer) => unknown>(
|
|
432
435
|
solanaClient: SVMProvider,
|
|
433
|
-
ix:
|
|
436
|
+
ix: Instruction,
|
|
434
437
|
signer: KeyPairSigner,
|
|
435
438
|
parser: P,
|
|
436
439
|
latestBlockhash?: LatestBlockhash
|
|
@@ -2,7 +2,12 @@ import { SVMProvider } from "../../arch/svm";
|
|
|
2
2
|
import { toBN, dedupArray } from "../../utils";
|
|
3
3
|
import { SvmGasPriceEstimate } from "../types";
|
|
4
4
|
import { GasPriceEstimateOptions } from "../oracle";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
TransactionMessage,
|
|
7
|
+
TransactionMessageBytesBase64,
|
|
8
|
+
TransactionMessageWithFeePayer,
|
|
9
|
+
compileTransaction,
|
|
10
|
+
} from "@solana/kit";
|
|
6
11
|
|
|
7
12
|
/**
|
|
8
13
|
* @notice Returns result of getFeeForMessage and getRecentPrioritizationFees RPC calls.
|
|
@@ -11,8 +16,8 @@ import { CompilableTransactionMessage, TransactionMessageBytesBase64, compileTra
|
|
|
11
16
|
export async function messageFee(provider: SVMProvider, opts: GasPriceEstimateOptions): Promise<SvmGasPriceEstimate> {
|
|
12
17
|
const { unsignedTx: _unsignedTx } = opts;
|
|
13
18
|
|
|
14
|
-
// Cast the opaque unsignedTx type to a solana-kit
|
|
15
|
-
const unsignedTx = _unsignedTx as
|
|
19
|
+
// Cast the opaque unsignedTx type to a solana-kit TransactionMessage with fee payer.
|
|
20
|
+
const unsignedTx = _unsignedTx as TransactionMessage & TransactionMessageWithFeePayer;
|
|
16
21
|
const compiledTransaction = compileTransaction(unsignedTx);
|
|
17
22
|
|
|
18
23
|
// Get this base fee. This should result in LAMPORTS_PER_SIGNATURE * nSignatures.
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * as arch from "./arch";
|
|
2
2
|
export * as addressAggregator from "./addressAggregator";
|
|
3
3
|
export * as lpFeeCalculator from "./lpFeeCalculator";
|
|
4
|
-
export * as pool from "./pool";
|
|
5
4
|
export * as relayFeeCalculator from "./relayFeeCalculator";
|
|
6
5
|
export * as utils from "./utils";
|
|
7
6
|
export * as contracts from "./contracts";
|