@across-protocol/sdk 4.2.16-alpha.5 → 4.2.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/arch/evm/SpokeUtils.d.ts +2 -2
- package/dist/cjs/arch/evm/SpokeUtils.js +6 -21
- package/dist/cjs/arch/evm/SpokeUtils.js.map +1 -1
- package/dist/cjs/arch/svm/SpokeUtils.d.ts +1 -5
- package/dist/cjs/arch/svm/SpokeUtils.js +39 -30
- package/dist/cjs/arch/svm/SpokeUtils.js.map +1 -1
- package/dist/cjs/arch/svm/eventsClient.js +2 -4
- package/dist/cjs/arch/svm/eventsClient.js.map +1 -1
- package/dist/cjs/arch/svm/utils.d.ts +3 -3
- package/dist/cjs/arch/svm/utils.js +14 -16
- package/dist/cjs/arch/svm/utils.js.map +1 -1
- package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +3 -3
- package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +2 -4
- package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/BundleDataClient.d.ts +6 -7
- package/dist/cjs/clients/BundleDataClient/BundleDataClient.js +83 -78
- package/dist/cjs/clients/BundleDataClient/BundleDataClient.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/utils/DataworkerUtils.js +13 -13
- package/dist/cjs/clients/BundleDataClient/utils/DataworkerUtils.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/utils/FillUtils.d.ts +1 -2
- package/dist/cjs/clients/BundleDataClient/utils/FillUtils.js +2 -3
- package/dist/cjs/clients/BundleDataClient/utils/FillUtils.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/utils/MerkleTreeUtils.js +1 -5
- package/dist/cjs/clients/BundleDataClient/utils/MerkleTreeUtils.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js +3 -3
- package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.d.ts +63 -63
- package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.js +8 -13
- package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.js.map +1 -1
- package/dist/cjs/clients/HubPoolClient.d.ts +21 -21
- package/dist/cjs/clients/HubPoolClient.js +58 -84
- package/dist/cjs/clients/HubPoolClient.js.map +1 -1
- package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js +1 -1
- package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
- package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.d.ts +2 -2
- package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js +45 -65
- package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
- package/dist/cjs/clients/SpokePoolClient/SpokePoolClientManager.d.ts +13 -0
- package/dist/cjs/clients/SpokePoolClient/SpokePoolClientManager.js +18 -0
- package/dist/cjs/clients/SpokePoolClient/SpokePoolClientManager.js.map +1 -0
- package/dist/cjs/clients/mocks/MockHubPoolClient.d.ts +9 -9
- package/dist/cjs/clients/mocks/MockHubPoolClient.js +9 -15
- package/dist/cjs/clients/mocks/MockHubPoolClient.js.map +1 -1
- package/dist/cjs/clients/mocks/MockSpokePoolClient.d.ts +3 -5
- package/dist/cjs/clients/mocks/MockSpokePoolClient.js +36 -40
- package/dist/cjs/clients/mocks/MockSpokePoolClient.js.map +1 -1
- package/dist/cjs/clients/mocks/MockSvmCpiEventsClient.d.ts +1 -1
- package/dist/cjs/clients/mocks/MockSvmCpiEventsClient.js +4 -6
- package/dist/cjs/clients/mocks/MockSvmCpiEventsClient.js.map +1 -1
- package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.d.ts +2 -2
- package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.js +2 -2
- package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.js.map +1 -1
- package/dist/cjs/interfaces/HubPool.d.ts +14 -19
- package/dist/cjs/interfaces/SpokePool.d.ts +13 -13
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.d.ts +6 -10
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js +11 -20
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.d.ts +3 -7
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js +32 -34
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +5 -5
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js +7 -7
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
- package/dist/cjs/utils/AddressUtils.d.ts +8 -12
- package/dist/cjs/utils/AddressUtils.js +36 -33
- package/dist/cjs/utils/AddressUtils.js.map +1 -1
- package/dist/cjs/utils/NetworkUtils.js +1 -1
- package/dist/cjs/utils/NetworkUtils.js.map +1 -1
- package/dist/cjs/utils/SpokeUtils.d.ts +3 -3
- package/dist/cjs/utils/SpokeUtils.js +22 -4
- package/dist/cjs/utils/SpokeUtils.js.map +1 -1
- package/dist/cjs/utils/TokenUtils.d.ts +4 -4
- package/dist/cjs/utils/TokenUtils.js +3 -5
- package/dist/cjs/utils/TokenUtils.js.map +1 -1
- package/dist/esm/arch/evm/SpokeUtils.d.ts +2 -2
- package/dist/esm/arch/evm/SpokeUtils.js +7 -22
- package/dist/esm/arch/evm/SpokeUtils.js.map +1 -1
- package/dist/esm/arch/svm/SpokeUtils.d.ts +1 -5
- package/dist/esm/arch/svm/SpokeUtils.js +44 -31
- package/dist/esm/arch/svm/SpokeUtils.js.map +1 -1
- package/dist/esm/arch/svm/eventsClient.js +3 -5
- package/dist/esm/arch/svm/eventsClient.js.map +1 -1
- package/dist/esm/arch/svm/utils.d.ts +3 -3
- package/dist/esm/arch/svm/utils.js +15 -17
- package/dist/esm/arch/svm/utils.js.map +1 -1
- package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +3 -3
- package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +2 -4
- package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/BundleDataClient.d.ts +6 -7
- package/dist/esm/clients/BundleDataClient/BundleDataClient.js +84 -79
- package/dist/esm/clients/BundleDataClient/BundleDataClient.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/utils/DataworkerUtils.js +14 -14
- package/dist/esm/clients/BundleDataClient/utils/DataworkerUtils.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/utils/FillUtils.d.ts +1 -2
- package/dist/esm/clients/BundleDataClient/utils/FillUtils.js +3 -5
- package/dist/esm/clients/BundleDataClient/utils/FillUtils.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/utils/MerkleTreeUtils.js +1 -5
- package/dist/esm/clients/BundleDataClient/utils/MerkleTreeUtils.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js +4 -4
- package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.d.ts +63 -63
- package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.js +10 -20
- package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.js.map +1 -1
- package/dist/esm/clients/HubPoolClient.d.ts +22 -23
- package/dist/esm/clients/HubPoolClient.js +63 -98
- package/dist/esm/clients/HubPoolClient.js.map +1 -1
- package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js +2 -2
- package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
- package/dist/esm/clients/SpokePoolClient/SpokePoolClient.d.ts +2 -2
- package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js +47 -68
- package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
- package/dist/esm/clients/SpokePoolClient/SpokePoolClientManager.d.ts +28 -0
- package/dist/esm/clients/SpokePoolClient/SpokePoolClientManager.js +30 -0
- package/dist/esm/clients/SpokePoolClient/SpokePoolClientManager.js.map +1 -0
- package/dist/esm/clients/mocks/MockHubPoolClient.d.ts +9 -9
- package/dist/esm/clients/mocks/MockHubPoolClient.js +10 -16
- package/dist/esm/clients/mocks/MockHubPoolClient.js.map +1 -1
- package/dist/esm/clients/mocks/MockSpokePoolClient.d.ts +3 -5
- package/dist/esm/clients/mocks/MockSpokePoolClient.js +38 -42
- package/dist/esm/clients/mocks/MockSpokePoolClient.js.map +1 -1
- package/dist/esm/clients/mocks/MockSvmCpiEventsClient.d.ts +1 -1
- package/dist/esm/clients/mocks/MockSvmCpiEventsClient.js +5 -7
- package/dist/esm/clients/mocks/MockSvmCpiEventsClient.js.map +1 -1
- package/dist/esm/clients/mocks/MockSvmSpokePoolClient.d.ts +2 -2
- package/dist/esm/clients/mocks/MockSvmSpokePoolClient.js +3 -3
- package/dist/esm/clients/mocks/MockSvmSpokePoolClient.js.map +1 -1
- package/dist/esm/interfaces/HubPool.d.ts +14 -19
- package/dist/esm/interfaces/SpokePool.d.ts +13 -13
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.d.ts +6 -10
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js +12 -21
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.d.ts +3 -8
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js +34 -38
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js.map +1 -1
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +5 -5
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.js +8 -8
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
- package/dist/esm/utils/AddressUtils.d.ts +8 -12
- package/dist/esm/utils/AddressUtils.js +38 -36
- package/dist/esm/utils/AddressUtils.js.map +1 -1
- package/dist/esm/utils/NetworkUtils.js +1 -1
- package/dist/esm/utils/NetworkUtils.js.map +1 -1
- package/dist/esm/utils/SpokeUtils.d.ts +8 -3
- package/dist/esm/utils/SpokeUtils.js +26 -4
- package/dist/esm/utils/SpokeUtils.js.map +1 -1
- package/dist/esm/utils/TokenUtils.d.ts +18 -22
- package/dist/esm/utils/TokenUtils.js +4 -6
- package/dist/esm/utils/TokenUtils.js.map +1 -1
- package/dist/types/arch/evm/SpokeUtils.d.ts +2 -2
- package/dist/types/arch/evm/SpokeUtils.d.ts.map +1 -1
- package/dist/types/arch/svm/SpokeUtils.d.ts +1 -5
- package/dist/types/arch/svm/SpokeUtils.d.ts.map +1 -1
- package/dist/types/arch/svm/eventsClient.d.ts.map +1 -1
- package/dist/types/arch/svm/utils.d.ts +3 -3
- package/dist/types/arch/svm/utils.d.ts.map +1 -1
- package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +3 -3
- package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts.map +1 -1
- package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts +6 -7
- package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts.map +1 -1
- package/dist/types/clients/BundleDataClient/utils/DataworkerUtils.d.ts.map +1 -1
- package/dist/types/clients/BundleDataClient/utils/FillUtils.d.ts +1 -2
- package/dist/types/clients/BundleDataClient/utils/FillUtils.d.ts.map +1 -1
- package/dist/types/clients/BundleDataClient/utils/MerkleTreeUtils.d.ts.map +1 -1
- package/dist/types/clients/BundleDataClient/utils/PoolRebalanceUtils.d.ts.map +1 -1
- package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts +63 -63
- package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts.map +1 -1
- package/dist/types/clients/HubPoolClient.d.ts +22 -23
- package/dist/types/clients/HubPoolClient.d.ts.map +1 -1
- package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts.map +1 -1
- package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts +2 -2
- package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts.map +1 -1
- package/dist/types/clients/SpokePoolClient/SpokePoolClientManager.d.ts +29 -0
- package/dist/types/clients/SpokePoolClient/SpokePoolClientManager.d.ts.map +1 -0
- package/dist/types/clients/mocks/MockHubPoolClient.d.ts +9 -9
- package/dist/types/clients/mocks/MockHubPoolClient.d.ts.map +1 -1
- package/dist/types/clients/mocks/MockSpokePoolClient.d.ts +3 -5
- package/dist/types/clients/mocks/MockSpokePoolClient.d.ts.map +1 -1
- package/dist/types/clients/mocks/MockSvmCpiEventsClient.d.ts +1 -1
- package/dist/types/clients/mocks/MockSvmCpiEventsClient.d.ts.map +1 -1
- package/dist/types/clients/mocks/MockSvmSpokePoolClient.d.ts +2 -2
- package/dist/types/clients/mocks/MockSvmSpokePoolClient.d.ts.map +1 -1
- package/dist/types/interfaces/HubPool.d.ts +14 -19
- package/dist/types/interfaces/HubPool.d.ts.map +1 -1
- package/dist/types/interfaces/SpokePool.d.ts +13 -13
- package/dist/types/interfaces/SpokePool.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts +6 -10
- package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts +3 -8
- package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +5 -5
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
- package/dist/types/utils/AddressUtils.d.ts +8 -12
- package/dist/types/utils/AddressUtils.d.ts.map +1 -1
- package/dist/types/utils/SpokeUtils.d.ts +8 -3
- package/dist/types/utils/SpokeUtils.d.ts.map +1 -1
- package/dist/types/utils/TokenUtils.d.ts +18 -22
- package/dist/types/utils/TokenUtils.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/arch/evm/SpokeUtils.ts +12 -47
- package/src/arch/svm/SpokeUtils.ts +42 -64
- package/src/arch/svm/eventsClient.ts +8 -40
- package/src/arch/svm/utils.ts +6 -6
- package/src/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.ts +4 -7
- package/src/clients/BundleDataClient/BundleDataClient.ts +90 -77
- package/src/clients/BundleDataClient/utils/DataworkerUtils.ts +13 -28
- package/src/clients/BundleDataClient/utils/FillUtils.ts +4 -10
- package/src/clients/BundleDataClient/utils/MerkleTreeUtils.ts +1 -7
- package/src/clients/BundleDataClient/utils/PoolRebalanceUtils.ts +4 -4
- package/src/clients/BundleDataClient/utils/SuperstructUtils.ts +10 -22
- package/src/clients/HubPoolClient.ts +82 -127
- package/src/clients/SpokePoolClient/EVMSpokePoolClient.ts +0 -6
- package/src/clients/SpokePoolClient/SpokePoolClient.ts +35 -121
- package/src/clients/SpokePoolClient/SpokePoolClientManager.ts +36 -0
- package/src/clients/mocks/MockHubPoolClient.ts +19 -24
- package/src/clients/mocks/MockSpokePoolClient.ts +27 -39
- package/src/clients/mocks/MockSvmCpiEventsClient.ts +5 -8
- package/src/clients/mocks/MockSvmSpokePoolClient.ts +3 -12
- package/src/interfaces/HubPool.ts +14 -23
- package/src/interfaces/SpokePool.ts +13 -13
- package/src/relayFeeCalculator/chain-queries/baseQuery.ts +11 -31
- package/src/relayFeeCalculator/chain-queries/svmQuery.ts +39 -43
- package/src/relayFeeCalculator/relayFeeCalculator.ts +12 -20
- package/src/utils/AddressUtils.ts +51 -39
- package/src/utils/NetworkUtils.ts +1 -1
- package/src/utils/SpokeUtils.ts +33 -11
- package/src/utils/TokenUtils.ts +8 -10
|
@@ -2,7 +2,7 @@ import { L2Provider } from "@eth-optimism/sdk/dist/interfaces/l2-provider";
|
|
|
2
2
|
import { PopulatedTransaction, providers } from "ethers";
|
|
3
3
|
import { Deposit } from "../../interfaces";
|
|
4
4
|
import { SpokePool } from "../../typechain";
|
|
5
|
-
import { BigNumberish,
|
|
5
|
+
import { BigNumberish, TransactionCostEstimate, BigNumber } from "../../utils";
|
|
6
6
|
import { Logger, QueryInterface } from "../relayFeeCalculator";
|
|
7
7
|
import { Transport } from "viem";
|
|
8
8
|
import { EvmProvider } from "../../arch/evm/types";
|
|
@@ -46,7 +46,7 @@ export declare class QueryBase implements QueryInterface {
|
|
|
46
46
|
* @param options.transport Optional transport object for custom gas price retrieval.
|
|
47
47
|
* @returns The gas estimate for this function call (multiplied with the optional buffer).
|
|
48
48
|
*/
|
|
49
|
-
getGasCosts(deposit: Omit<Deposit, "messageHash">, relayer?:
|
|
49
|
+
getGasCosts(deposit: Omit<Deposit, "messageHash">, relayer?: string, options?: Partial<{
|
|
50
50
|
gasPrice: BigNumberish;
|
|
51
51
|
gasUnits: BigNumberish;
|
|
52
52
|
baseFeeMultiplier: BigNumber;
|
|
@@ -60,18 +60,14 @@ export declare class QueryBase implements QueryInterface {
|
|
|
60
60
|
* @param relayer Sender of PopulatedTransaction
|
|
61
61
|
* @returns PopulatedTransaction
|
|
62
62
|
*/
|
|
63
|
-
getUnsignedTxFromDeposit(deposit: Omit<Deposit, "messageHash"
|
|
64
|
-
recipient: EvmAddress;
|
|
65
|
-
outputToken: EvmAddress;
|
|
66
|
-
exclusiveRelayer: EvmAddress;
|
|
67
|
-
}, relayer?: Address): Promise<PopulatedTransaction>;
|
|
63
|
+
getUnsignedTxFromDeposit(deposit: Omit<Deposit, "messageHash">, relayer?: string): Promise<PopulatedTransaction>;
|
|
68
64
|
/**
|
|
69
65
|
* @notice Return the gas cost of a simulated transaction
|
|
70
66
|
* @param deposit
|
|
71
67
|
* @param relayer Sender of PopulatedTransaction
|
|
72
68
|
* @returns Estimated gas cost based on ethers.VoidSigner's gas estimation
|
|
73
69
|
*/
|
|
74
|
-
getNativeGasCost(deposit: Omit<Deposit, "messageHash">, relayer?:
|
|
70
|
+
getNativeGasCost(deposit: Omit<Deposit, "messageHash">, relayer?: string): Promise<BigNumber>;
|
|
75
71
|
/**
|
|
76
72
|
* @notice Return L1 data fee for OP stack L2 transaction, which is based on L2 calldata.
|
|
77
73
|
* @dev https://docs.optimism.io/stack/transactions/fees#l1-data-fee
|
|
@@ -80,7 +76,7 @@ export declare class QueryBase implements QueryInterface {
|
|
|
80
76
|
* @param options Specify gas units to avoid additional gas estimation call and multiplier for L1 data fee
|
|
81
77
|
* @returns BigNumber L1 data fee in gas units
|
|
82
78
|
*/
|
|
83
|
-
getOpStackL1DataFee(unsignedTx: PopulatedTransaction, relayer:
|
|
79
|
+
getOpStackL1DataFee(unsignedTx: PopulatedTransaction, relayer: string | undefined, options: Partial<{
|
|
84
80
|
opStackL2GasUnits: BigNumberish;
|
|
85
81
|
opStackL1DataFeeMultiplier: BigNumber;
|
|
86
82
|
}>): Promise<BigNumber>;
|
|
@@ -95,7 +91,7 @@ export declare class QueryBase implements QueryInterface {
|
|
|
95
91
|
* @param options.transport A custom transport object for custom gas price retrieval.
|
|
96
92
|
* @returns Estimated cost in units of gas and the underlying gas token (gasPrice * estimatedGasUnits).
|
|
97
93
|
*/
|
|
98
|
-
estimateGas(unsignedTx: PopulatedTransaction, senderAddress:
|
|
94
|
+
estimateGas(unsignedTx: PopulatedTransaction, senderAddress: string, provider: providers.Provider | L2Provider<providers.Provider>, options?: Partial<{
|
|
99
95
|
gasPrice: BigNumberish;
|
|
100
96
|
gasUnits: BigNumberish;
|
|
101
97
|
baseFeeMultiplier: BigNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseQuery.d.ts","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/baseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAG3E,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAc,MAAM,QAAQ,CAAC;AAGrE,OAAO,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,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,EAC7D,OAAO,GAAE,OAAO,CAAC;QACf,QAAQ,EAAE,YAAY,CAAC;QACvB,QAAQ,EAAE,YAAY,CAAC;QACvB,iBAAiB,EAAE,SAAS,CAAC;QAC7B,qBAAqB,EAAE,SAAS,CAAC;QACjC,0BAA0B,EAAE,SAAS,CAAC;QACtC,SAAS,EAAE,SAAS,CAAC;KACtB,CAAM,GACN,OAAO,CAAC,uBAAuB,CAAC;IA+CnC;;;;OAIG;IACG,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAS1D"}
|
|
@@ -45,7 +45,7 @@ export declare class SvmQuery implements QueryInterface {
|
|
|
45
45
|
* @param options.transport Optional transport object for custom gas price retrieval.
|
|
46
46
|
* @returns The gas estimate for this function call (multiplied with the optional buffer).
|
|
47
47
|
*/
|
|
48
|
-
getGasCosts(deposit: Omit<Deposit, "messageHash">,
|
|
48
|
+
getGasCosts(deposit: Omit<Deposit, "messageHash">, _relayer?: string, options?: Partial<{
|
|
49
49
|
gasPrice: BigNumberish;
|
|
50
50
|
gasUnits: BigNumberish;
|
|
51
51
|
baseFeeMultiplier: BigNumber;
|
|
@@ -57,19 +57,14 @@ export declare class SvmQuery implements QueryInterface {
|
|
|
57
57
|
* @param relayer SVM address of the relayer
|
|
58
58
|
* @returns Estimated gas cost in compute units
|
|
59
59
|
*/
|
|
60
|
-
getNativeGasCost(deposit: Omit<Deposit, "messageHash">,
|
|
61
|
-
_relayer?: import("../../utils").Address): Promise<BigNumber>;
|
|
60
|
+
getNativeGasCost(deposit: Omit<Deposit, "messageHash">, _relayer?: string): Promise<BigNumber>;
|
|
62
61
|
/**
|
|
63
62
|
* @notice Return the fillRelay transaction for a given deposit
|
|
64
63
|
* @param deposit
|
|
65
64
|
* @param relayer SVM address of the relayer
|
|
66
65
|
* @returns FillRelay transaction
|
|
67
66
|
*/
|
|
68
|
-
getFillRelayTx(deposit: Omit<Deposit, "
|
|
69
|
-
recipient: SvmAddress;
|
|
70
|
-
outputToken: SvmAddress;
|
|
71
|
-
exclusiveRelayer: SvmAddress;
|
|
72
|
-
}, relayer?: import("../../utils").Address, repaymentChainId?: number, repaymentAddress?: import("../../utils").Address): Promise<import("@solana/kit").TransactionMessageWithBlockhashLifetime & import("@solana/kit").ITransactionMessageWithFeePayerSigner<string, import("@solana/kit").TransactionSigner<string>> & Omit<Readonly<{
|
|
67
|
+
getFillRelayTx(deposit: Omit<Deposit, "messageHash">, _relayer?: string, repaymentChainId?: number, repaymentAddress?: string): Promise<import("@solana/kit").TransactionMessageWithBlockhashLifetime & import("@solana/kit").ITransactionMessageWithFeePayerSigner<string, import("@solana/kit").TransactionSigner<string>> & Omit<Readonly<{
|
|
73
68
|
instructions: readonly import("@solana/kit").IInstruction<string, readonly (import("@solana/kit").IAccountLookupMeta<string, string> | import("@solana/kit").IAccountMeta<string>)[]>[];
|
|
74
69
|
version: 0;
|
|
75
70
|
}>, "feePayer">>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svmQuery.d.ts","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/svmQuery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"svmQuery.d.ts","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/svmQuery.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,WAAW,EASZ,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EACL,SAAS,EACT,YAAY,EACZ,UAAU,EACV,uBAAuB,EAIxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,cAAc,EAAqC,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAC;AAEvC;;;GAGG;AACH,qBAAa,QAAS,YAAW,cAAc;IAe3C,QAAQ,CAAC,QAAQ,EA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D;;;;OAIG;IACH,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;CAI9C"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Transport } from "viem";
|
|
2
2
|
import { Deposit } from "../interfaces";
|
|
3
|
-
import { BigNumber, BigNumberish, TransactionCostEstimate
|
|
3
|
+
import { BigNumber, BigNumberish, TransactionCostEstimate } from "../utils";
|
|
4
4
|
export interface QueryInterface {
|
|
5
|
-
getGasCosts: (deposit: Omit<Deposit, "messageHash">, relayer:
|
|
5
|
+
getGasCosts: (deposit: Omit<Deposit, "messageHash">, relayer: string, options?: Partial<{
|
|
6
6
|
gasPrice: BigNumberish;
|
|
7
7
|
gasUnits: BigNumberish;
|
|
8
8
|
baseFeeMultiplier: BigNumber;
|
|
@@ -11,7 +11,7 @@ export interface QueryInterface {
|
|
|
11
11
|
transport: Transport;
|
|
12
12
|
}>) => Promise<TransactionCostEstimate>;
|
|
13
13
|
getTokenPrice: (tokenSymbol: string) => Promise<number>;
|
|
14
|
-
getNativeGasCost: (deposit: Omit<Deposit, "messageHash">, relayer:
|
|
14
|
+
getNativeGasCost: (deposit: Omit<Deposit, "messageHash">, relayer: string) => Promise<BigNumber>;
|
|
15
15
|
}
|
|
16
16
|
export declare const expectedCapitalCostsKeys: string[];
|
|
17
17
|
export interface CapitalCostConfig {
|
|
@@ -127,7 +127,7 @@ export declare class RelayFeeCalculator {
|
|
|
127
127
|
* a message & recipient contract is provided as this function may not simulate with
|
|
128
128
|
* the correct parameters to see a full fill.
|
|
129
129
|
*/
|
|
130
|
-
gasFeePercent(deposit: Deposit, outputAmount: BigNumberish, simulateZeroFill?: boolean, relayerAddress?:
|
|
130
|
+
gasFeePercent(deposit: Deposit, outputAmount: BigNumberish, simulateZeroFill?: boolean, relayerAddress?: string, _tokenPrice?: number, tokenMapping?: {
|
|
131
131
|
ACX: {
|
|
132
132
|
name: string;
|
|
133
133
|
symbol: string;
|
|
@@ -549,7 +549,7 @@ export declare class RelayFeeCalculator {
|
|
|
549
549
|
* @param gasUnits Optional gas units to use for the simulation
|
|
550
550
|
* @returns A resulting `RelayerFeeDetails` object
|
|
551
551
|
*/
|
|
552
|
-
relayerFeeDetails(deposit: Deposit, outputAmount?: BigNumberish, simulateZeroFill?: boolean, relayerAddress?:
|
|
552
|
+
relayerFeeDetails(deposit: Deposit, outputAmount?: BigNumberish, simulateZeroFill?: boolean, relayerAddress?: string, _tokenPrice?: number, gasPrice?: BigNumberish, gasUnits?: BigNumberish, tokenGasCost?: BigNumberish): Promise<RelayerFeeDetails>;
|
|
553
553
|
}
|
|
554
554
|
export {};
|
|
555
555
|
//# sourceMappingURL=relayFeeCalculator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relayFeeCalculator.d.ts","sourceRoot":"","sources":["../../../src/relayFeeCalculator/relayFeeCalculator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAMjC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,SAAS,EACT,YAAY,
|
|
1
|
+
{"version":3,"file":"relayFeeCalculator.d.ts","sourceRoot":"","sources":["../../../src/relayFeeCalculator/relayFeeCalculator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAMjC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,SAAS,EACT,YAAY,EAGZ,uBAAuB,EAcxB,MAAM,UAAU,CAAC;AAGlB,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,CACX,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,EACrC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,OAAO,CAAC;QAChB,QAAQ,EAAE,YAAY,CAAC;QACvB,QAAQ,EAAE,YAAY,CAAC;QACvB,iBAAiB,EAAE,SAAS,CAAC;QAC7B,qBAAqB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAoB,EAChC,QAAQ,CAAC,EAAE,YAAY,EACvB,QAAQ,CAAC,EAAE,YAAY,EACvB,aAAa,CAAC,EAAE,YAAY,EAC5B,SAAS,CAAC,EAAE,SAAS,GACpB,OAAO,CAAC,SAAS,CAAC;IA2DrB,iBAAiB,CACf,aAAa,EAAE,YAAY,EAC3B,YAAY,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,eAAe,EAC9B,iBAAiB,CAAC,EAAE,eAAe,GAClC,SAAS;IAmEZ;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IA0C/B;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IA8B7B;;;;;;;;;;;;;;OAcG;IACG,iBAAiB,CACrB,OAAO,EAAE,OAAO,EAChB,YAAY,CAAC,EAAE,YAAY,EAC3B,gBAAgB,UAAQ,EACxB,cAAc,SAAgE,EAC9E,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,YAAY,EACvB,QAAQ,CAAC,EAAE,YAAY,EACvB,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,iBAAiB,CAAC;CAuE9B"}
|
|
@@ -20,13 +20,14 @@ export declare function isValidEvmAddress(address: string): boolean;
|
|
|
20
20
|
* @todo: Change this to `toAddress` once we remove the other `toAddress` function.
|
|
21
21
|
*/
|
|
22
22
|
export declare function toAddressType(address: string, chainId: number): Address;
|
|
23
|
-
export declare
|
|
23
|
+
export declare class Address {
|
|
24
24
|
readonly rawAddress: Uint8Array;
|
|
25
25
|
evmAddress: string | undefined;
|
|
26
26
|
bytes32Address: string | undefined;
|
|
27
27
|
svmAddress: string | undefined;
|
|
28
28
|
bnAddress: BigNumber | undefined;
|
|
29
29
|
constructor(_rawAddress: Uint8Array);
|
|
30
|
+
static __unsafeConstruct(_rawAddress: Uint8Array): Address;
|
|
30
31
|
toBytes32(): string;
|
|
31
32
|
truncateToBytes20(): string;
|
|
32
33
|
toBase58(): string;
|
|
@@ -35,32 +36,27 @@ export declare abstract class Address {
|
|
|
35
36
|
toNative(): string;
|
|
36
37
|
toHexString(): string;
|
|
37
38
|
isValidOn(chainId: number): boolean;
|
|
39
|
+
static isAddress(obj: unknown): boolean;
|
|
38
40
|
toString(): string;
|
|
39
41
|
isZeroAddress(): boolean;
|
|
40
42
|
forceSvmAddress(): SvmAddress;
|
|
41
43
|
eq(other: Address): boolean;
|
|
42
44
|
compare(otherAddress: Address): 1 | -1 | 0;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
static isEvmAddress(address: Address): boolean;
|
|
46
|
+
static isSvmAddress(address: Address): boolean;
|
|
45
47
|
}
|
|
46
48
|
export declare class EvmAddress extends Address {
|
|
47
|
-
private readonly
|
|
49
|
+
private readonly _brandEvmAddress;
|
|
48
50
|
constructor(rawAddress: Uint8Array);
|
|
49
51
|
static validate(rawAddress: Uint8Array): boolean;
|
|
50
|
-
isEVM(): this is EvmAddress;
|
|
51
52
|
toNative(): string;
|
|
52
|
-
static from(address: string, encoding?: "
|
|
53
|
+
static from(address: string, encoding?: "base16" | "base58"): EvmAddress;
|
|
53
54
|
}
|
|
54
55
|
export declare class SvmAddress extends Address {
|
|
55
|
-
private readonly
|
|
56
|
+
private readonly _brandSvmAddress;
|
|
56
57
|
constructor(rawAddress: Uint8Array);
|
|
57
58
|
static validate(rawAddress: Uint8Array): boolean;
|
|
58
|
-
isSVM(): this is SvmAddress;
|
|
59
59
|
toNative(): string;
|
|
60
60
|
static from(address: string, encoding?: "base58" | "base16"): SvmAddress;
|
|
61
61
|
}
|
|
62
|
-
export declare class RawAddress extends Address {
|
|
63
|
-
private readonly _type;
|
|
64
|
-
constructor(rawAddress: Uint8Array);
|
|
65
|
-
}
|
|
66
62
|
//# sourceMappingURL=AddressUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/AddressUtils.ts"],"names":[],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Y,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;IAI9C,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;CAG/C;AAGD,qBAAa,UAAW,SAAQ,OAAO;IAGrC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAQ;gBAG7B,UAAU,EAAE,UAAU;IAUlC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO;IAOvC,QAAQ,IAAI,MAAM;IAK3B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,QAAQ,GAAG,QAAmB,GAAG,UAAU;CAenF;AAGD,qBAAa,UAAW,SAAQ,OAAO;IAGrC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAQ;gBAG7B,UAAU,EAAE,UAAU;IAUlC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO;IAMvC,QAAQ,IAAI,MAAM;IAK3B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,QAAQ,GAAG,QAAmB,GAAG,UAAU;CAYnF"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { Fill, RelayData, SlowFillLeaf } from "../interfaces";
|
|
1
|
+
import { Deposit, Fill, RelayData, SlowFillLeaf } from "../interfaces";
|
|
2
2
|
import { BigNumber } from "./BigNumberUtils";
|
|
3
|
-
import { Address } from "./AddressUtils";
|
|
4
3
|
export declare function isSlowFill(fill: Fill): boolean;
|
|
5
4
|
export declare function getSlowFillLeafLpFeePct(leaf: SlowFillLeaf): BigNumber;
|
|
5
|
+
/**
|
|
6
|
+
* Produce the RelayData for a Deposit.
|
|
7
|
+
* @param deposit Deposit instance.
|
|
8
|
+
* @returns The corresponding RelayData object.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getDepositRelayData(deposit: Omit<Deposit, "messageHash">): RelayData;
|
|
6
11
|
/**
|
|
7
12
|
* Compute the RelayData hash for a fill. This can be used to determine the fill status.
|
|
8
13
|
* @param relayData RelayData information that is used to complete a fill.
|
|
@@ -14,6 +19,6 @@ export declare function getRelayHashFromEvent(e: RelayData & {
|
|
|
14
19
|
destinationChainId: number;
|
|
15
20
|
}): string;
|
|
16
21
|
export declare function isUnsafeDepositId(depositId: BigNumber): boolean;
|
|
17
|
-
export declare function isZeroAddress(address:
|
|
22
|
+
export declare function isZeroAddress(address: string): boolean;
|
|
18
23
|
export declare function getMessageHash(message: string): string;
|
|
19
24
|
//# sourceMappingURL=SpokeUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpokeUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/SpokeUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAY,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"SpokeUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/SpokeUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAY,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAK7C,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAE9C;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,CAGrE;AACD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG,SAAS,CAepF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAkCzF;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,SAAS,GAAG;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE3F;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAQ/D;AAGD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BlockTag } from "@ethersproject/abstract-provider";
|
|
2
2
|
import { providers, Signer } from "ethers";
|
|
3
|
-
import {
|
|
3
|
+
import { L1Token } from "../interfaces";
|
|
4
4
|
import { BigNumber } from "./BigNumberUtils";
|
|
5
5
|
type SignerOrProvider = providers.Provider | Signer;
|
|
6
|
-
export declare function fetchTokenInfo(address: string, signerOrProvider: SignerOrProvider): Promise<
|
|
6
|
+
export declare function fetchTokenInfo(address: string, signerOrProvider: SignerOrProvider): Promise<L1Token>;
|
|
7
7
|
export declare const getL2TokenAddresses: (l1TokenAddress: string, l1ChainId?: number) => {
|
|
8
8
|
[chainId: number]: string;
|
|
9
9
|
} | undefined;
|
|
@@ -14,7 +14,7 @@ export declare const getL2TokenAddresses: (l1TokenAddress: string, l1ChainId?: n
|
|
|
14
14
|
* @param chainId Chain ID to query on.
|
|
15
15
|
* @returns Symbol, decimals and contract address on the requested chain.
|
|
16
16
|
*/
|
|
17
|
-
export declare function resolveSymbolOnChain(chainId: number, symbol: string):
|
|
17
|
+
export declare function resolveSymbolOnChain(chainId: number, symbol: string): L1Token;
|
|
18
18
|
/**
|
|
19
19
|
* Returns the contract address for a given token symbol and chainId.
|
|
20
20
|
* @param symbol A case-insensitive token symbol.
|
|
@@ -124,7 +124,13 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
124
124
|
};
|
|
125
125
|
GHO: {
|
|
126
126
|
name: string;
|
|
127
|
-
symbol: string;
|
|
127
|
+
symbol: string; /**
|
|
128
|
+
* Returns the contract address for a given token symbol and chainId.
|
|
129
|
+
* @param symbol A case-insensitive token symbol.
|
|
130
|
+
* @param chainId The chainId to resolve the contract address for.
|
|
131
|
+
* @param tokenMapping A parameter to determine where to source token information. Defaults to the constants variant.
|
|
132
|
+
* @returns The contract address for the given token symbol and chainId, or undefined if the token symbol is not supported.
|
|
133
|
+
*/
|
|
128
134
|
decimals: number;
|
|
129
135
|
addresses: {
|
|
130
136
|
[x: number]: string;
|
|
@@ -185,14 +191,6 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
185
191
|
};
|
|
186
192
|
coingeckoId: string;
|
|
187
193
|
};
|
|
188
|
-
/**
|
|
189
|
-
* Retrieves the ERC20 balance for a given address and token address.
|
|
190
|
-
* @param address The address to retrieve the balance for.
|
|
191
|
-
* @param tokenAddress The token address
|
|
192
|
-
* @param signerOrProvider A valid ethers.js Signer or Provider object.
|
|
193
|
-
* @param blockTag The block tag to retrieve the balance at.
|
|
194
|
-
* @returns The balance of the given address for the given token address.
|
|
195
|
-
*/
|
|
196
194
|
SOL: {
|
|
197
195
|
name: string;
|
|
198
196
|
symbol: string;
|
|
@@ -547,7 +545,13 @@ export declare function getTokenInfo(l2TokenAddress: string, chainId: number, to
|
|
|
547
545
|
};
|
|
548
546
|
GHO: {
|
|
549
547
|
name: string;
|
|
550
|
-
symbol: string;
|
|
548
|
+
symbol: string; /**
|
|
549
|
+
* Returns the contract address for a given token symbol and chainId.
|
|
550
|
+
* @param symbol A case-insensitive token symbol.
|
|
551
|
+
* @param chainId The chainId to resolve the contract address for.
|
|
552
|
+
* @param tokenMapping A parameter to determine where to source token information. Defaults to the constants variant.
|
|
553
|
+
* @returns The contract address for the given token symbol and chainId, or undefined if the token symbol is not supported.
|
|
554
|
+
*/
|
|
551
555
|
decimals: number;
|
|
552
556
|
addresses: {
|
|
553
557
|
[x: number]: string;
|
|
@@ -608,14 +612,6 @@ export declare function getTokenInfo(l2TokenAddress: string, chainId: number, to
|
|
|
608
612
|
};
|
|
609
613
|
coingeckoId: string;
|
|
610
614
|
};
|
|
611
|
-
/**
|
|
612
|
-
* Retrieves the ERC20 balance for a given address and token address.
|
|
613
|
-
* @param address The address to retrieve the balance for.
|
|
614
|
-
* @param tokenAddress The token address
|
|
615
|
-
* @param signerOrProvider A valid ethers.js Signer or Provider object.
|
|
616
|
-
* @param blockTag The block tag to retrieve the balance at.
|
|
617
|
-
* @returns The balance of the given address for the given token address.
|
|
618
|
-
*/
|
|
619
615
|
SOL: {
|
|
620
616
|
name: string;
|
|
621
617
|
symbol: string;
|
|
@@ -846,7 +842,7 @@ export declare function getTokenInfo(l2TokenAddress: string, chainId: number, to
|
|
|
846
842
|
};
|
|
847
843
|
coingeckoId: string;
|
|
848
844
|
};
|
|
849
|
-
}):
|
|
845
|
+
}): L1Token;
|
|
850
846
|
/**
|
|
851
847
|
* Get the USDC symbol for the given token address and chain ID.
|
|
852
848
|
* @param l2Token A Web3 token address (not case sensitive)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/TokenUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TokenUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/TokenUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAY,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAM7C,KAAK,gBAAgB,GAAG,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC;AAEpD,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAI1G;AAED,eAAO,MAAM,mBAAmB,mBACd,MAAM;;aAMvB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAA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;;;;;;;;;;;;;;;;;wBAhElF;;;;;;WAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DmG,GAAG,OAAO,CAoB/G;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOlF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAUjF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@across-protocol/sdk",
|
|
3
3
|
"author": "UMA Team",
|
|
4
|
-
"version": "4.2.16
|
|
4
|
+
"version": "4.2.16",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"homepage": "https://docs.across.to/reference/sdk",
|
|
7
7
|
"files": [
|
|
@@ -111,6 +111,7 @@
|
|
|
111
111
|
"@ethersproject/bignumber": "^5.7.0",
|
|
112
112
|
"@pinata/sdk": "^2.1.0",
|
|
113
113
|
"@solana-program/system": "^0.7.0",
|
|
114
|
+
"@solana-program/token": "^0.5.1",
|
|
114
115
|
"@solana-program/token-2022": "^0.4.0",
|
|
115
116
|
"@solana/kit": "^2.1.0",
|
|
116
117
|
"@solana/web3.js": "^1.31.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
2
|
import { BytesLike, Contract, PopulatedTransaction, providers } from "ethers";
|
|
3
3
|
import { CHAIN_IDs } from "../../constants";
|
|
4
|
-
import { Deposit, FillStatus, FillWithBlock, RelayData
|
|
4
|
+
import { Deposit, FillStatus, FillWithBlock, RelayData } from "../../interfaces";
|
|
5
5
|
import {
|
|
6
6
|
bnUint32Max,
|
|
7
7
|
BigNumber,
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
isDefined,
|
|
14
14
|
isUnsafeDepositId,
|
|
15
15
|
isZeroAddress,
|
|
16
|
+
getDepositRelayData,
|
|
16
17
|
getNetworkName,
|
|
17
18
|
paginatedEventQuery,
|
|
18
19
|
spreadEventWithBlockNumber,
|
|
19
|
-
|
|
20
|
-
toAddressType,
|
|
20
|
+
toBytes32,
|
|
21
21
|
} from "../../utils";
|
|
22
22
|
|
|
23
23
|
type BlockTag = providers.BlockTag;
|
|
@@ -30,28 +30,11 @@ type BlockTag = providers.BlockTag;
|
|
|
30
30
|
*/
|
|
31
31
|
export function populateV3Relay(
|
|
32
32
|
spokePool: Contract,
|
|
33
|
-
deposit: Omit<Deposit, "messageHash"
|
|
34
|
-
|
|
33
|
+
deposit: Omit<Deposit, "messageHash">,
|
|
34
|
+
relayer: string,
|
|
35
35
|
repaymentChainId = deposit.destinationChainId
|
|
36
36
|
): Promise<PopulatedTransaction> {
|
|
37
|
-
|
|
38
|
-
repaymentAddress.isValidOn(repaymentChainId),
|
|
39
|
-
`Invalid repayment address for chain ${repaymentChainId}: ${repaymentAddress.toNative()}.`
|
|
40
|
-
);
|
|
41
|
-
const relayData = {
|
|
42
|
-
depositor: deposit.depositor.toBytes32(),
|
|
43
|
-
recipient: deposit.recipient.toBytes32(),
|
|
44
|
-
inputToken: deposit.inputToken.toBytes32(),
|
|
45
|
-
outputToken: deposit.outputToken.toBytes32(),
|
|
46
|
-
inputAmount: deposit.inputAmount,
|
|
47
|
-
outputAmount: deposit.outputAmount,
|
|
48
|
-
originChainId: deposit.originChainId,
|
|
49
|
-
depositId: deposit.depositId,
|
|
50
|
-
fillDeadline: deposit.fillDeadline,
|
|
51
|
-
exclusivityDeadline: deposit.exclusivityDeadline,
|
|
52
|
-
message: deposit.message,
|
|
53
|
-
exclusiveRelayer: deposit.exclusiveRelayer.toBytes32(),
|
|
54
|
-
};
|
|
37
|
+
const relayData = getDepositRelayData(deposit);
|
|
55
38
|
|
|
56
39
|
if (isDefined(deposit.speedUpSignature)) {
|
|
57
40
|
assert(isDefined(deposit.updatedRecipient) && !isZeroAddress(deposit.updatedRecipient));
|
|
@@ -60,15 +43,16 @@ export function populateV3Relay(
|
|
|
60
43
|
return spokePool.populateTransaction.fillRelayWithUpdatedDeposit(
|
|
61
44
|
relayData,
|
|
62
45
|
repaymentChainId,
|
|
63
|
-
|
|
46
|
+
toBytes32(relayer),
|
|
64
47
|
deposit.updatedOutputAmount,
|
|
65
|
-
deposit.updatedRecipient
|
|
48
|
+
toBytes32(deposit.updatedRecipient),
|
|
66
49
|
deposit.updatedMessage,
|
|
67
|
-
deposit.speedUpSignature
|
|
50
|
+
deposit.speedUpSignature,
|
|
51
|
+
{ from: relayer }
|
|
68
52
|
);
|
|
69
53
|
}
|
|
70
54
|
|
|
71
|
-
return spokePool.populateTransaction.fillRelay(relayData, repaymentChainId,
|
|
55
|
+
return spokePool.populateTransaction.fillRelay(relayData, repaymentChainId, toBytes32(relayer), { from: relayer });
|
|
72
56
|
}
|
|
73
57
|
|
|
74
58
|
/**
|
|
@@ -331,27 +315,8 @@ export async function findFillEvent(
|
|
|
331
315
|
const destinationChainId = Object.values(CHAIN_IDs).includes(relayData.originChainId)
|
|
332
316
|
? (await spokePool.provider.getNetwork()).chainId
|
|
333
317
|
: Number(await spokePool.chainId());
|
|
334
|
-
const fillEvent = spreadEventWithBlockNumber(event) as FillWithBlock & {
|
|
335
|
-
depositor: string;
|
|
336
|
-
recipient: string;
|
|
337
|
-
inputToken: string;
|
|
338
|
-
outputToken: string;
|
|
339
|
-
exclusiveRelayer: string;
|
|
340
|
-
relayer: string;
|
|
341
|
-
relayExecutionInfo: RelayExecutionEventInfo & { updatedRecipient: string };
|
|
342
|
-
};
|
|
343
318
|
const fill = {
|
|
344
|
-
...
|
|
345
|
-
inputToken: toAddressType(fillEvent.inputToken, relayData.originChainId),
|
|
346
|
-
outputToken: toAddressType(fillEvent.outputToken, destinationChainId),
|
|
347
|
-
depositor: toAddressType(fillEvent.depositor, relayData.originChainId),
|
|
348
|
-
recipient: toAddressType(fillEvent.recipient, destinationChainId),
|
|
349
|
-
exclusiveRelayer: toAddressType(fillEvent.exclusiveRelayer, destinationChainId),
|
|
350
|
-
relayer: toAddressType(fillEvent.relayer, destinationChainId),
|
|
351
|
-
relayExecutionInfo: {
|
|
352
|
-
...fillEvent.relayExecutionInfo,
|
|
353
|
-
updatedRecipient: toAddressType(fillEvent.relayExecutionInfo.updatedRecipient, destinationChainId),
|
|
354
|
-
},
|
|
319
|
+
...spreadEventWithBlockNumber(event),
|
|
355
320
|
destinationChainId,
|
|
356
321
|
messageHash: getMessageHash(event.args.message),
|
|
357
322
|
} as FillWithBlock;
|