@across-protocol/sdk 4.2.16 → 4.3.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/evm/SpokeUtils.d.ts +8 -3
- package/dist/cjs/arch/evm/SpokeUtils.js +26 -11
- package/dist/cjs/arch/evm/SpokeUtils.js.map +1 -1
- package/dist/cjs/arch/svm/SpokeUtils.d.ts +8 -2
- package/dist/cjs/arch/svm/SpokeUtils.js +41 -50
- package/dist/cjs/arch/svm/SpokeUtils.js.map +1 -1
- package/dist/cjs/arch/svm/eventsClient.js +4 -2
- 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 +16 -14
- 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 +4 -2
- package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/BundleDataClient.d.ts +4 -4
- package/dist/cjs/clients/BundleDataClient/BundleDataClient.js +60 -56
- 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 +2 -1
- package/dist/cjs/clients/BundleDataClient/utils/FillUtils.js +3 -2
- package/dist/cjs/clients/BundleDataClient/utils/FillUtils.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/utils/MerkleTreeUtils.js +5 -1
- 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 +71 -71
- package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.js +13 -8
- 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 +85 -58
- 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 +65 -45
- package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
- package/dist/cjs/clients/mocks/MockHubPoolClient.d.ts +9 -9
- package/dist/cjs/clients/mocks/MockHubPoolClient.js +15 -9
- package/dist/cjs/clients/mocks/MockHubPoolClient.js.map +1 -1
- package/dist/cjs/clients/mocks/MockSpokePoolClient.d.ts +5 -3
- package/dist/cjs/clients/mocks/MockSpokePoolClient.js +40 -36
- 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 +6 -4
- 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 +19 -14
- package/dist/cjs/interfaces/SpokePool.d.ts +18 -19
- package/dist/cjs/interfaces/SpokePool.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.d.ts +15 -7
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js +24 -15
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.js +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.d.ts +12 -4
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js +46 -44
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +6 -6
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js +10 -10
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
- package/dist/cjs/utils/AddressUtils.d.ts +12 -8
- package/dist/cjs/utils/AddressUtils.js +33 -36
- package/dist/cjs/utils/AddressUtils.js.map +1 -1
- package/dist/cjs/utils/SpokeUtils.d.ts +3 -3
- package/dist/cjs/utils/SpokeUtils.js +4 -22
- package/dist/cjs/utils/SpokeUtils.js.map +1 -1
- package/dist/cjs/utils/TokenUtils.d.ts +4 -4
- package/dist/cjs/utils/TokenUtils.js +5 -3
- package/dist/cjs/utils/TokenUtils.js.map +1 -1
- package/dist/esm/arch/evm/SpokeUtils.d.ts +9 -4
- package/dist/esm/arch/evm/SpokeUtils.js +29 -14
- package/dist/esm/arch/evm/SpokeUtils.js.map +1 -1
- package/dist/esm/arch/svm/SpokeUtils.d.ts +9 -3
- package/dist/esm/arch/svm/SpokeUtils.js +42 -55
- package/dist/esm/arch/svm/SpokeUtils.js.map +1 -1
- package/dist/esm/arch/svm/eventsClient.js +5 -3
- 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 +17 -15
- 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 +4 -2
- package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/BundleDataClient.d.ts +4 -4
- package/dist/esm/clients/BundleDataClient/BundleDataClient.js +61 -57
- 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 +2 -1
- package/dist/esm/clients/BundleDataClient/utils/FillUtils.js +7 -7
- package/dist/esm/clients/BundleDataClient/utils/FillUtils.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/utils/MerkleTreeUtils.js +5 -1
- 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 +71 -71
- package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.js +20 -10
- package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.js.map +1 -1
- package/dist/esm/clients/HubPoolClient.d.ts +22 -22
- package/dist/esm/clients/HubPoolClient.js +91 -62
- 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 +68 -47
- package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
- package/dist/esm/clients/mocks/MockHubPoolClient.d.ts +9 -9
- package/dist/esm/clients/mocks/MockHubPoolClient.js +16 -10
- package/dist/esm/clients/mocks/MockHubPoolClient.js.map +1 -1
- package/dist/esm/clients/mocks/MockSpokePoolClient.d.ts +5 -3
- package/dist/esm/clients/mocks/MockSpokePoolClient.js +42 -38
- 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 +7 -5
- 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 +19 -14
- package/dist/esm/interfaces/SpokePool.d.ts +18 -19
- package/dist/esm/interfaces/SpokePool.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.d.ts +18 -10
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js +29 -20
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/factory.js +2 -2
- package/dist/esm/relayFeeCalculator/chain-queries/factory.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.d.ts +14 -6
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js +51 -48
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js.map +1 -1
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +6 -6
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.js +9 -9
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
- package/dist/esm/utils/AddressUtils.d.ts +12 -8
- package/dist/esm/utils/AddressUtils.js +36 -38
- package/dist/esm/utils/AddressUtils.js.map +1 -1
- package/dist/esm/utils/SpokeUtils.d.ts +3 -8
- package/dist/esm/utils/SpokeUtils.js +4 -26
- package/dist/esm/utils/SpokeUtils.js.map +1 -1
- package/dist/esm/utils/TokenUtils.d.ts +22 -18
- package/dist/esm/utils/TokenUtils.js +6 -4
- package/dist/esm/utils/TokenUtils.js.map +1 -1
- package/dist/types/arch/evm/SpokeUtils.d.ts +9 -4
- package/dist/types/arch/evm/SpokeUtils.d.ts.map +1 -1
- package/dist/types/arch/svm/SpokeUtils.d.ts +9 -3
- 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 +4 -4
- 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 +2 -1
- 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 +71 -71
- package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts.map +1 -1
- package/dist/types/clients/HubPoolClient.d.ts +22 -22
- 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/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 +5 -3
- 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 +19 -14
- package/dist/types/interfaces/HubPool.d.ts.map +1 -1
- package/dist/types/interfaces/SpokePool.d.ts +18 -19
- package/dist/types/interfaces/SpokePool.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts +18 -10
- package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts +14 -6
- package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +6 -6
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
- package/dist/types/utils/AddressUtils.d.ts +12 -8
- package/dist/types/utils/AddressUtils.d.ts.map +1 -1
- package/dist/types/utils/SpokeUtils.d.ts +3 -8
- package/dist/types/utils/SpokeUtils.d.ts.map +1 -1
- package/dist/types/utils/TokenUtils.d.ts +22 -18
- package/dist/types/utils/TokenUtils.d.ts.map +1 -1
- package/package.json +1 -2
- package/src/arch/evm/SpokeUtils.ts +72 -22
- package/src/arch/svm/SpokeUtils.ts +67 -53
- package/src/arch/svm/eventsClient.ts +40 -8
- package/src/arch/svm/utils.ts +6 -6
- package/src/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.ts +7 -4
- package/src/clients/BundleDataClient/BundleDataClient.ts +57 -53
- package/src/clients/BundleDataClient/utils/DataworkerUtils.ts +28 -13
- package/src/clients/BundleDataClient/utils/FillUtils.ts +12 -8
- package/src/clients/BundleDataClient/utils/MerkleTreeUtils.ts +7 -1
- package/src/clients/BundleDataClient/utils/PoolRebalanceUtils.ts +4 -4
- package/src/clients/BundleDataClient/utils/SuperstructUtils.ts +22 -10
- package/src/clients/HubPoolClient.ts +123 -82
- package/src/clients/SpokePoolClient/EVMSpokePoolClient.ts +6 -0
- package/src/clients/SpokePoolClient/SpokePoolClient.ts +121 -35
- package/src/clients/mocks/MockHubPoolClient.ts +24 -19
- package/src/clients/mocks/MockSpokePoolClient.ts +39 -27
- package/src/clients/mocks/MockSvmCpiEventsClient.ts +8 -5
- package/src/clients/mocks/MockSvmSpokePoolClient.ts +12 -3
- package/src/interfaces/HubPool.ts +20 -14
- package/src/interfaces/SpokePool.ts +19 -19
- package/src/relayFeeCalculator/chain-queries/baseQuery.ts +39 -20
- package/src/relayFeeCalculator/chain-queries/factory.ts +2 -2
- package/src/relayFeeCalculator/chain-queries/svmQuery.ts +57 -56
- package/src/relayFeeCalculator/relayFeeCalculator.ts +15 -13
- package/src/utils/AddressUtils.ts +39 -51
- package/src/utils/SpokeUtils.ts +11 -33
- package/src/utils/TokenUtils.ts +10 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BigNumber } from "../utils";
|
|
1
|
+
import { Address, BigNumber, EvmAddress } from "../utils";
|
|
2
2
|
import { SortableEvent } from "./Common";
|
|
3
3
|
export interface PoolRebalanceLeaf {
|
|
4
4
|
chainId: number;
|
|
@@ -7,15 +7,15 @@ export interface PoolRebalanceLeaf {
|
|
|
7
7
|
netSendAmounts: BigNumber[];
|
|
8
8
|
runningBalances: BigNumber[];
|
|
9
9
|
leafId: number;
|
|
10
|
-
l1Tokens:
|
|
10
|
+
l1Tokens: EvmAddress[];
|
|
11
11
|
}
|
|
12
12
|
export interface RelayerRefundLeaf {
|
|
13
13
|
amountToReturn: BigNumber;
|
|
14
14
|
chainId: number;
|
|
15
15
|
refundAmounts: BigNumber[];
|
|
16
16
|
leafId: number;
|
|
17
|
-
l2TokenAddress:
|
|
18
|
-
refundAddresses:
|
|
17
|
+
l2TokenAddress: Address;
|
|
18
|
+
refundAddresses: Address[];
|
|
19
19
|
}
|
|
20
20
|
export interface ProposedRootBundle extends SortableEvent {
|
|
21
21
|
challengePeriodEndTimestamp: number;
|
|
@@ -24,7 +24,7 @@ export interface ProposedRootBundle extends SortableEvent {
|
|
|
24
24
|
poolRebalanceRoot: string;
|
|
25
25
|
relayerRefundRoot: string;
|
|
26
26
|
slowRelayRoot: string;
|
|
27
|
-
proposer:
|
|
27
|
+
proposer: EvmAddress;
|
|
28
28
|
}
|
|
29
29
|
export type RealizedLpFee = {
|
|
30
30
|
quoteBlock: number;
|
|
@@ -47,7 +47,7 @@ export interface ExecutedRootBundle extends SortableEvent {
|
|
|
47
47
|
netSendAmounts: BigNumber[];
|
|
48
48
|
runningBalances: BigNumber[];
|
|
49
49
|
leafId: number;
|
|
50
|
-
l1Tokens:
|
|
50
|
+
l1Tokens: EvmAddress[];
|
|
51
51
|
proof: string[];
|
|
52
52
|
}
|
|
53
53
|
export type ExecutedRootBundleStringified = Omit<ExecutedRootBundle, "bundleLpFees" | "netSendAmounts" | "runningBalances"> & {
|
|
@@ -61,8 +61,13 @@ export type TokenRunningBalance = {
|
|
|
61
61
|
export interface RelayerRefundLeafWithGroup extends RelayerRefundLeaf {
|
|
62
62
|
groupIndex: number;
|
|
63
63
|
}
|
|
64
|
-
export interface
|
|
65
|
-
address:
|
|
64
|
+
export interface L1TokenInfo {
|
|
65
|
+
address: EvmAddress;
|
|
66
|
+
symbol: string;
|
|
67
|
+
decimals: number;
|
|
68
|
+
}
|
|
69
|
+
export interface TokenInfo {
|
|
70
|
+
address: Address;
|
|
66
71
|
symbol: string;
|
|
67
72
|
decimals: number;
|
|
68
73
|
}
|
|
@@ -72,22 +77,22 @@ export interface LpToken {
|
|
|
72
77
|
}
|
|
73
78
|
export interface CrossChainContractsSet extends SortableEvent {
|
|
74
79
|
l2ChainId: number;
|
|
75
|
-
spokePool:
|
|
80
|
+
spokePool: Address;
|
|
76
81
|
}
|
|
77
82
|
export interface DestinationTokenWithBlock extends SortableEvent {
|
|
78
|
-
l2Token:
|
|
79
|
-
l1Token:
|
|
83
|
+
l2Token: Address;
|
|
84
|
+
l1Token: EvmAddress;
|
|
80
85
|
}
|
|
81
86
|
export interface SetPoolRebalanceRoot extends SortableEvent {
|
|
82
87
|
destinationChainId: number;
|
|
83
|
-
l1Token:
|
|
84
|
-
destinationToken:
|
|
88
|
+
l1Token: EvmAddress;
|
|
89
|
+
destinationToken: Address;
|
|
85
90
|
}
|
|
86
91
|
export interface PendingRootBundle {
|
|
87
92
|
poolRebalanceRoot: string;
|
|
88
93
|
relayerRefundRoot: string;
|
|
89
94
|
slowRelayRoot: string;
|
|
90
|
-
proposer:
|
|
95
|
+
proposer: EvmAddress;
|
|
91
96
|
unclaimedPoolRebalanceLeafCount: number;
|
|
92
97
|
challengePeriodEndTimestamp: number;
|
|
93
98
|
bundleEvaluationBlockNumbers: number[];
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import { SortableEvent } from "./Common";
|
|
2
2
|
import { SpokePoolClient } from "../clients";
|
|
3
|
-
import { BigNumber } from "../utils";
|
|
3
|
+
import { BigNumber, Address, EvmAddress } from "../utils";
|
|
4
4
|
import { RelayerRefundLeaf } from "./HubPool";
|
|
5
5
|
export interface RelayData {
|
|
6
6
|
originChainId: number;
|
|
7
|
-
depositor:
|
|
8
|
-
recipient:
|
|
7
|
+
depositor: Address;
|
|
8
|
+
recipient: Address;
|
|
9
9
|
depositId: BigNumber;
|
|
10
|
-
inputToken:
|
|
10
|
+
inputToken: Address;
|
|
11
11
|
inputAmount: BigNumber;
|
|
12
|
-
outputToken:
|
|
12
|
+
outputToken: Address;
|
|
13
13
|
outputAmount: BigNumber;
|
|
14
14
|
message: string;
|
|
15
15
|
fillDeadline: number;
|
|
16
|
-
exclusiveRelayer:
|
|
16
|
+
exclusiveRelayer: Address;
|
|
17
17
|
exclusivityDeadline: number;
|
|
18
18
|
}
|
|
19
|
-
export interface
|
|
19
|
+
export interface SpeedUpCommon {
|
|
20
|
+
updatedRecipient: Address;
|
|
21
|
+
updatedOutputAmount: BigNumber;
|
|
22
|
+
updatedMessage: string;
|
|
23
|
+
}
|
|
24
|
+
export interface Deposit extends RelayData, Partial<SpeedUpCommon> {
|
|
20
25
|
messageHash: string;
|
|
21
26
|
destinationChainId: number;
|
|
22
27
|
quoteTimestamp: number;
|
|
23
28
|
speedUpSignature?: string;
|
|
24
|
-
updatedRecipient?: string;
|
|
25
|
-
updatedOutputAmount?: BigNumber;
|
|
26
|
-
updatedMessage?: string;
|
|
27
29
|
fromLiteChain: boolean;
|
|
28
30
|
toLiteChain: boolean;
|
|
29
31
|
}
|
|
@@ -44,7 +46,7 @@ export declare enum FillType {
|
|
|
44
46
|
SlowFill = 2
|
|
45
47
|
}
|
|
46
48
|
export interface RelayExecutionEventInfo {
|
|
47
|
-
updatedRecipient:
|
|
49
|
+
updatedRecipient: Address;
|
|
48
50
|
updatedOutputAmount: BigNumber;
|
|
49
51
|
updatedMessage?: string;
|
|
50
52
|
updatedMessageHash: string;
|
|
@@ -53,7 +55,7 @@ export interface RelayExecutionEventInfo {
|
|
|
53
55
|
export interface Fill extends Omit<RelayData, "message"> {
|
|
54
56
|
messageHash: string;
|
|
55
57
|
destinationChainId: number;
|
|
56
|
-
relayer:
|
|
58
|
+
relayer: Address;
|
|
57
59
|
repaymentChainId: number;
|
|
58
60
|
relayExecutionInfo: RelayExecutionEventInfo;
|
|
59
61
|
}
|
|
@@ -63,20 +65,17 @@ export interface FillWithTime extends Fill, SortableEvent {
|
|
|
63
65
|
fillTimestamp: number;
|
|
64
66
|
}
|
|
65
67
|
export interface EnabledDepositRoute {
|
|
66
|
-
originToken:
|
|
68
|
+
originToken: Address;
|
|
67
69
|
destinationChainId: number;
|
|
68
70
|
enabled: boolean;
|
|
69
71
|
}
|
|
70
72
|
export interface EnabledDepositRouteWithBlock extends EnabledDepositRoute, SortableEvent {
|
|
71
73
|
}
|
|
72
|
-
export interface SpeedUp {
|
|
73
|
-
depositor:
|
|
74
|
+
export interface SpeedUp extends SpeedUpCommon {
|
|
75
|
+
depositor: EvmAddress;
|
|
74
76
|
depositorSignature: string;
|
|
75
77
|
depositId: BigNumber;
|
|
76
78
|
originChainId: number;
|
|
77
|
-
updatedRecipient: string;
|
|
78
|
-
updatedOutputAmount: BigNumber;
|
|
79
|
-
updatedMessage: string;
|
|
80
79
|
}
|
|
81
80
|
export interface SpeedUpWithBlock extends SpeedUp, SortableEvent {
|
|
82
81
|
}
|
|
@@ -115,7 +114,7 @@ export interface TokensBridged extends SortableEvent {
|
|
|
115
114
|
amountToReturn: BigNumber;
|
|
116
115
|
chainId: number;
|
|
117
116
|
leafId: number;
|
|
118
|
-
l2TokenAddress:
|
|
117
|
+
l2TokenAddress: Address;
|
|
119
118
|
}
|
|
120
119
|
export interface ClaimedRelayerRefundWithBlock extends SortableEvent {
|
|
121
120
|
l2TokenAddress: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpokePool.js","sourceRoot":"","sources":["../../../src/interfaces/SpokePool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SpokePool.js","sourceRoot":"","sources":["../../../src/interfaces/SpokePool.ts"],"names":[],"mappings":"AA2CA,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,mDAAY,CAAA;IACZ,qEAAiB,CAAA;IACjB,+CAAM,CAAA;AACR,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAED,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,+CAAY,CAAA;IACZ,+DAAgB,CAAA;IAChB,+CAAQ,CAAA;AACV,CAAC,EAJW,QAAQ,KAAR,QAAQ,QAInB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { L2Provider } from "@eth-optimism/sdk/dist/interfaces/l2-provider";
|
|
2
2
|
import { PopulatedTransaction, providers } from "ethers";
|
|
3
|
-
import {
|
|
3
|
+
import { RelayData } from "../../interfaces";
|
|
4
4
|
import { SpokePool } from "../../typechain";
|
|
5
|
-
import { BigNumberish, TransactionCostEstimate, BigNumber } from "../../utils";
|
|
5
|
+
import { BigNumberish, EvmAddress, TransactionCostEstimate, BigNumber, Address } from "../../utils";
|
|
6
6
|
import { Logger, QueryInterface } from "../relayFeeCalculator";
|
|
7
7
|
import { Transport } from "viem";
|
|
8
8
|
import { EvmProvider } from "../../arch/evm/types";
|
|
@@ -38,7 +38,7 @@ export declare class QueryBase implements QueryInterface {
|
|
|
38
38
|
constructor(provider: EvmProvider, symbolMapping: SymbolMappingType, spokePoolAddress: string, simulatedRelayerAddress: string, logger: Logger, coingeckoProApiKey?: string | undefined, fixedGasPrice?: BigNumberish | undefined, coingeckoBaseCurrency?: string);
|
|
39
39
|
/**
|
|
40
40
|
* Retrieves the current gas costs of performing a fillRelay contract at the referenced SpokePool.
|
|
41
|
-
* @param
|
|
41
|
+
* @param relayData RelayData instance, supplemented with destinationChainId
|
|
42
42
|
* @param relayerAddress Relayer address to simulate with.
|
|
43
43
|
* @param options
|
|
44
44
|
* @param options.gasPrice Optional gas price to use for the simulation.
|
|
@@ -46,7 +46,9 @@ 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(
|
|
49
|
+
getGasCosts(relayData: RelayData & {
|
|
50
|
+
destinationChainId: number;
|
|
51
|
+
}, relayer?: Address, options?: Partial<{
|
|
50
52
|
gasPrice: BigNumberish;
|
|
51
53
|
gasUnits: BigNumberish;
|
|
52
54
|
baseFeeMultiplier: BigNumber;
|
|
@@ -56,18 +58,24 @@ export declare class QueryBase implements QueryInterface {
|
|
|
56
58
|
}>): Promise<TransactionCostEstimate>;
|
|
57
59
|
/**
|
|
58
60
|
* @notice Return ethers.PopulatedTransaction for a fill based on input deposit args
|
|
59
|
-
* @param
|
|
61
|
+
* @param relayData RelayData instance, supplemented with destinationChainId
|
|
60
62
|
* @param relayer Sender of PopulatedTransaction
|
|
61
63
|
* @returns PopulatedTransaction
|
|
62
64
|
*/
|
|
63
|
-
getUnsignedTxFromDeposit(
|
|
65
|
+
getUnsignedTxFromDeposit(relayData: Omit<RelayData, "recipient" | "outputToken"> & {
|
|
66
|
+
destinationChainId: number;
|
|
67
|
+
recipient: EvmAddress;
|
|
68
|
+
outputToken: EvmAddress;
|
|
69
|
+
}, relayer?: Address): Promise<PopulatedTransaction>;
|
|
64
70
|
/**
|
|
65
71
|
* @notice Return the gas cost of a simulated transaction
|
|
66
|
-
* @param
|
|
72
|
+
* @param relayData RelayData instance, supplemented with destinationChainId
|
|
67
73
|
* @param relayer Sender of PopulatedTransaction
|
|
68
74
|
* @returns Estimated gas cost based on ethers.VoidSigner's gas estimation
|
|
69
75
|
*/
|
|
70
|
-
getNativeGasCost(
|
|
76
|
+
getNativeGasCost(relayData: RelayData & {
|
|
77
|
+
destinationChainId: number;
|
|
78
|
+
}, relayer?: Address): Promise<BigNumber>;
|
|
71
79
|
/**
|
|
72
80
|
* @notice Return L1 data fee for OP stack L2 transaction, which is based on L2 calldata.
|
|
73
81
|
* @dev https://docs.optimism.io/stack/transactions/fees#l1-data-fee
|
|
@@ -76,7 +84,7 @@ export declare class QueryBase implements QueryInterface {
|
|
|
76
84
|
* @param options Specify gas units to avoid additional gas estimation call and multiplier for L1 data fee
|
|
77
85
|
* @returns BigNumber L1 data fee in gas units
|
|
78
86
|
*/
|
|
79
|
-
getOpStackL1DataFee(unsignedTx: PopulatedTransaction, relayer:
|
|
87
|
+
getOpStackL1DataFee(unsignedTx: PopulatedTransaction, relayer: Address | undefined, options: Partial<{
|
|
80
88
|
opStackL2GasUnits: BigNumberish;
|
|
81
89
|
opStackL1DataFeeMultiplier: BigNumber;
|
|
82
90
|
}>): Promise<BigNumber>;
|
|
@@ -91,7 +99,7 @@ export declare class QueryBase implements QueryInterface {
|
|
|
91
99
|
* @param options.transport A custom transport object for custom gas price retrieval.
|
|
92
100
|
* @returns Estimated cost in units of gas and the underlying gas token (gasPrice * estimatedGasUnits).
|
|
93
101
|
*/
|
|
94
|
-
estimateGas(unsignedTx: PopulatedTransaction, senderAddress:
|
|
102
|
+
estimateGas(unsignedTx: PopulatedTransaction, senderAddress: Address, provider: providers.Provider | L2Provider<providers.Provider>, options?: Partial<{
|
|
95
103
|
gasPrice: BigNumberish;
|
|
96
104
|
gasUnits: BigNumberish;
|
|
97
105
|
baseFeeMultiplier: BigNumber;
|
|
@@ -5,9 +5,9 @@ import { Coingecko } from "../../coingecko";
|
|
|
5
5
|
import { CHAIN_IDs } from "../../constants";
|
|
6
6
|
import { SpokePool__factory } from "../../typechain";
|
|
7
7
|
import { populateV3Relay } from "../../arch/evm";
|
|
8
|
-
import { BigNumber, toBNWei, bnZero, chainIsOPStack, fixedPointAdjustment, } from "../../utils";
|
|
8
|
+
import { BigNumber, toBNWei, bnZero, chainIsOPStack, fixedPointAdjustment, toAddressType, } from "../../utils";
|
|
9
9
|
import assert from "assert";
|
|
10
|
-
import {
|
|
10
|
+
import { getDefaultRelayer } from "../relayFeeCalculator";
|
|
11
11
|
import { getGasPriceEstimate } from "../../gasPriceOracle";
|
|
12
12
|
/**
|
|
13
13
|
* A unified QueryBase for querying gas costs, token prices, and decimals of various tokens
|
|
@@ -39,7 +39,7 @@ var QueryBase = /** @class */ (function () {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Retrieves the current gas costs of performing a fillRelay contract at the referenced SpokePool.
|
|
42
|
-
* @param
|
|
42
|
+
* @param relayData RelayData instance, supplemented with destinationChainId
|
|
43
43
|
* @param relayerAddress Relayer address to simulate with.
|
|
44
44
|
* @param options
|
|
45
45
|
* @param options.gasPrice Optional gas price to use for the simulation.
|
|
@@ -47,16 +47,20 @@ var QueryBase = /** @class */ (function () {
|
|
|
47
47
|
* @param options.transport Optional transport object for custom gas price retrieval.
|
|
48
48
|
* @returns The gas estimate for this function call (multiplied with the optional buffer).
|
|
49
49
|
*/
|
|
50
|
-
QueryBase.prototype.getGasCosts = function (
|
|
51
|
-
if (relayer === void 0) { relayer =
|
|
50
|
+
QueryBase.prototype.getGasCosts = function (relayData, relayer, options) {
|
|
51
|
+
if (relayer === void 0) { relayer = toAddressType(getDefaultRelayer(relayData.destinationChainId), relayData.destinationChainId); }
|
|
52
52
|
if (options === void 0) { options = {}; }
|
|
53
53
|
return __awaiter(this, void 0, void 0, function () {
|
|
54
|
-
var _a, gasPrice, gasUnits, baseFeeMultiplier, priorityFeeMultiplier, opStackL1GasCostMultiplier, transport, tx, _b, nativeGasCost, tokenGasCost, impliedGasPrice, opStackL1GasCost;
|
|
54
|
+
var _a, gasPrice, gasUnits, baseFeeMultiplier, priorityFeeMultiplier, opStackL1GasCostMultiplier, transport, recipient, outputToken, exclusiveRelayer, tx, _b, nativeGasCost, tokenGasCost, impliedGasPrice, opStackL1GasCost;
|
|
55
55
|
return __generator(this, function (_c) {
|
|
56
56
|
switch (_c.label) {
|
|
57
57
|
case 0:
|
|
58
58
|
_a = options.gasPrice, gasPrice = _a === void 0 ? this.fixedGasPrice : _a, gasUnits = options.gasUnits, baseFeeMultiplier = options.baseFeeMultiplier, priorityFeeMultiplier = options.priorityFeeMultiplier, opStackL1GasCostMultiplier = options.opStackL1GasCostMultiplier, transport = options.transport;
|
|
59
|
-
|
|
59
|
+
recipient = relayData.recipient, outputToken = relayData.outputToken, exclusiveRelayer = relayData.exclusiveRelayer;
|
|
60
|
+
assert(recipient.isEVM(), "getGasCosts: recipient not an EVM address (".concat(recipient, ")"));
|
|
61
|
+
assert(outputToken.isEVM(), "getGasCosts: outputToken not an EVM address (".concat(outputToken, ")"));
|
|
62
|
+
assert(exclusiveRelayer.isEVM(), "getGasCosts: exclusiveRelayer not an EVM address (".concat(exclusiveRelayer, ")"));
|
|
63
|
+
return [4 /*yield*/, this.getUnsignedTxFromDeposit(__assign(__assign({}, relayData), { recipient: recipient, outputToken: outputToken, exclusiveRelayer: exclusiveRelayer }), relayer)];
|
|
60
64
|
case 1:
|
|
61
65
|
tx = _c.sent();
|
|
62
66
|
return [4 /*yield*/, this.estimateGas(tx, relayer, this.provider, {
|
|
@@ -81,30 +85,35 @@ var QueryBase = /** @class */ (function () {
|
|
|
81
85
|
};
|
|
82
86
|
/**
|
|
83
87
|
* @notice Return ethers.PopulatedTransaction for a fill based on input deposit args
|
|
84
|
-
* @param
|
|
88
|
+
* @param relayData RelayData instance, supplemented with destinationChainId
|
|
85
89
|
* @param relayer Sender of PopulatedTransaction
|
|
86
90
|
* @returns PopulatedTransaction
|
|
87
91
|
*/
|
|
88
|
-
QueryBase.prototype.getUnsignedTxFromDeposit = function (
|
|
89
|
-
if (relayer === void 0) { relayer =
|
|
90
|
-
return populateV3Relay(this.spokePool,
|
|
92
|
+
QueryBase.prototype.getUnsignedTxFromDeposit = function (relayData, relayer) {
|
|
93
|
+
if (relayer === void 0) { relayer = toAddressType(getDefaultRelayer(relayData.destinationChainId), relayData.destinationChainId); }
|
|
94
|
+
return populateV3Relay(this.spokePool, relayData, relayer);
|
|
91
95
|
};
|
|
92
96
|
/**
|
|
93
97
|
* @notice Return the gas cost of a simulated transaction
|
|
94
|
-
* @param
|
|
98
|
+
* @param relayData RelayData instance, supplemented with destinationChainId
|
|
95
99
|
* @param relayer Sender of PopulatedTransaction
|
|
96
100
|
* @returns Estimated gas cost based on ethers.VoidSigner's gas estimation
|
|
97
101
|
*/
|
|
98
|
-
QueryBase.prototype.getNativeGasCost = function (
|
|
99
|
-
if (relayer === void 0) { relayer =
|
|
102
|
+
QueryBase.prototype.getNativeGasCost = function (relayData, relayer) {
|
|
103
|
+
if (relayer === void 0) { relayer = toAddressType(getDefaultRelayer(relayData.destinationChainId), relayData.destinationChainId); }
|
|
100
104
|
return __awaiter(this, void 0, void 0, function () {
|
|
101
|
-
var unsignedTx, voidSigner;
|
|
105
|
+
var recipient, outputToken, exclusiveRelayer, unsignedTx, voidSigner;
|
|
102
106
|
return __generator(this, function (_a) {
|
|
103
107
|
switch (_a.label) {
|
|
104
|
-
case 0:
|
|
108
|
+
case 0:
|
|
109
|
+
recipient = relayData.recipient, outputToken = relayData.outputToken, exclusiveRelayer = relayData.exclusiveRelayer;
|
|
110
|
+
assert(recipient.isEVM(), "getNativeGasCost: recipient not an EVM address (".concat(recipient, ")"));
|
|
111
|
+
assert(outputToken.isEVM(), "getNativeGasCost: outputToken not an EVM address (".concat(outputToken, ")"));
|
|
112
|
+
assert(exclusiveRelayer.isEVM(), "getNativeGasCost: exclusiveRelayer not an EVM address (".concat(exclusiveRelayer, ")"));
|
|
113
|
+
return [4 /*yield*/, this.getUnsignedTxFromDeposit(__assign(__assign({}, relayData), { recipient: recipient, outputToken: outputToken, exclusiveRelayer: exclusiveRelayer }), relayer)];
|
|
105
114
|
case 1:
|
|
106
115
|
unsignedTx = _a.sent();
|
|
107
|
-
voidSigner = new VoidSigner(relayer, this.provider);
|
|
116
|
+
voidSigner = new VoidSigner(relayer.toEvmAddress(), this.provider);
|
|
108
117
|
return [2 /*return*/, voidSigner.estimateGas(unsignedTx)];
|
|
109
118
|
}
|
|
110
119
|
});
|
|
@@ -119,7 +128,7 @@ var QueryBase = /** @class */ (function () {
|
|
|
119
128
|
* @returns BigNumber L1 data fee in gas units
|
|
120
129
|
*/
|
|
121
130
|
QueryBase.prototype.getOpStackL1DataFee = function (unsignedTx, relayer, options) {
|
|
122
|
-
if (relayer === void 0) { relayer =
|
|
131
|
+
if (relayer === void 0) { relayer = toAddressType(getDefaultRelayer(unsignedTx.chainId), CHAIN_IDs.MAINNET); }
|
|
123
132
|
return __awaiter(this, void 0, void 0, function () {
|
|
124
133
|
var _a, opStackL2GasUnits, _b, opStackL1DataFeeMultiplier, chainId, voidSigner, populatedTransaction, l1DataFee;
|
|
125
134
|
return __generator(this, function (_c) {
|
|
@@ -130,7 +139,7 @@ var QueryBase = /** @class */ (function () {
|
|
|
130
139
|
case 1:
|
|
131
140
|
chainId = (_c.sent()).chainId;
|
|
132
141
|
assert(isOptimismL2Provider(this.provider), "Unexpected provider for chain ID ".concat(chainId, "."));
|
|
133
|
-
voidSigner = new VoidSigner(relayer, this.provider);
|
|
142
|
+
voidSigner = new VoidSigner(relayer.toEvmAddress(), this.provider);
|
|
134
143
|
return [4 /*yield*/, voidSigner.populateTransaction(__assign(__assign({}, unsignedTx), { gasLimit: opStackL2GasUnits }))];
|
|
135
144
|
case 2:
|
|
136
145
|
populatedTransaction = _c.sent();
|
|
@@ -164,7 +173,7 @@ var QueryBase = /** @class */ (function () {
|
|
|
164
173
|
return [4 /*yield*/, provider.getNetwork()];
|
|
165
174
|
case 1:
|
|
166
175
|
chainId = (_f.sent()).chainId;
|
|
167
|
-
voidSigner = new VoidSigner(senderAddress, provider);
|
|
176
|
+
voidSigner = new VoidSigner(senderAddress.toEvmAddress(), provider);
|
|
168
177
|
queries = [
|
|
169
178
|
gasUnits ? Promise.resolve(BigNumber.from(gasUnits)) : voidSigner.estimateGas(unsignedTx),
|
|
170
179
|
_gasPrice
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseQuery.js","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/baseQuery.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"baseQuery.js","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/baseQuery.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,EAAmC,UAAU,EAAE,MAAM,QAAQ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C,CAAC;;;wBAE/C,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;;4BAG7C,sBAAO;4BACL,aAAa,eAAA;4BACb,YAAY,cAAA;4BACZ,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;4BAC7C,gBAAgB,kBAAA;yBACjB,EAAC;;;;KACH;IAED;;;;OAIG;IACG,iCAAa,GAAnB,UAAoB,WAAmB;;;;;;wBACrC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;4BAAE,MAAM,IAAI,KAAK,CAAC,UAAG,WAAW,+BAA4B,CAAC,CAAC;wBAC5F,iBAAiB,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;wBAC5D,qBAAM,iBAAiB,CAAC,yBAAyB,CACjE,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,EAC5D,IAAI,CAAC,qBAAqB,CAC3B,EAAA;;wBAHK,KAAY,SAGjB,EAHQ,KAAK,QAAA;wBAId,sBAAO,KAAK,EAAC;;;;KACd;IACH,gBAAC;AAAD,CAAC,AA7OD,IA6OC"}
|
|
@@ -6,7 +6,7 @@ import { asL2Provider } from "@eth-optimism/sdk";
|
|
|
6
6
|
import { CUSTOM_GAS_TOKENS } from "../../constants";
|
|
7
7
|
import { chainIsOPStack, isDefined, chainIsSvm, SvmAddress } from "../../utils";
|
|
8
8
|
import { QueryBase } from "./baseQuery";
|
|
9
|
-
import { DEFAULT_LOGGER,
|
|
9
|
+
import { DEFAULT_LOGGER, getDefaultRelayer } from "../relayFeeCalculator";
|
|
10
10
|
import { CustomGasTokenQueries } from "./customGasToken";
|
|
11
11
|
import { SvmQuery } from "./svmQuery";
|
|
12
12
|
/**
|
|
@@ -22,7 +22,7 @@ var QueryBase__factory = /** @class */ (function () {
|
|
|
22
22
|
QueryBase__factory.create = function (chainId, provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, coingeckoProApiKey, logger, coingeckoBaseCurrency) {
|
|
23
23
|
if (symbolMapping === void 0) { symbolMapping = TOKEN_SYMBOLS_MAP; }
|
|
24
24
|
if (spokePoolAddress === void 0) { spokePoolAddress = getDeployedAddress("SpokePool", chainId); }
|
|
25
|
-
if (simulatedRelayerAddress === void 0) { simulatedRelayerAddress =
|
|
25
|
+
if (simulatedRelayerAddress === void 0) { simulatedRelayerAddress = getDefaultRelayer(chainId); }
|
|
26
26
|
if (logger === void 0) { logger = DEFAULT_LOGGER; }
|
|
27
27
|
if (coingeckoBaseCurrency === void 0) { coingeckoBaseCurrency = "eth"; }
|
|
28
28
|
assert(isDefined(spokePoolAddress));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/factory.ts"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/factory.ts"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;A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KAAK;iBACN;gBACD,oBAAoB,sBAAA;aACrB,CAAC,CAAC;SACJ;QACD,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE;YACvB,OAAO,IAAI,QAAQ,CACjB,QAAuB,EACvB,aAAa,EACb,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,EACjC,UAAU,CAAC,IAAI,CAAC,uBAAuB,CAAC,EACxC,MAAM,EACN,kBAAkB,EAClB,aAAa,CAAC,OAAO,CAAC,EACtB,qBAAqB,CACtB,CAAC;SACH;QAED,oEAAoE;QACpE,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC;YAChC,CAAC,CAAC,YAAY,CAAC,QAA8B,CAAC;YAC9C,CAAC,CAAE,QAA+B,CAAC;QAErC,OAAO,IAAI,SAAS,CAClB,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,MAAM,EACN,kBAAkB,EAClB,aAAa,CAAC,OAAO,CAAC,EACtB,qBAAqB,CACtB,CAAC;IACJ,CAAC;IACH,yBAAC;AAAD,CAAC,AA1DD,IA0DC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SVMProvider } from "../../arch/svm";
|
|
2
|
-
import {
|
|
2
|
+
import { RelayData } from "../../interfaces";
|
|
3
3
|
import { BigNumber, BigNumberish, SvmAddress, TransactionCostEstimate } from "../../utils";
|
|
4
4
|
import { Logger, QueryInterface } from "../relayFeeCalculator";
|
|
5
5
|
import { SymbolMappingType } from "./";
|
|
@@ -37,7 +37,7 @@ export declare class SvmQuery implements QueryInterface {
|
|
|
37
37
|
constructor(provider: SVMProvider, symbolMapping: SymbolMappingType, spokePool: SvmAddress, simulatedRelayerAddress: SvmAddress, logger: Logger, coingeckoProApiKey?: string | undefined, fixedGasPrice?: BigNumberish | undefined, coingeckoBaseCurrency?: string);
|
|
38
38
|
/**
|
|
39
39
|
* Retrieves the current gas costs of performing a fillRelay contract at the referenced SpokePool.
|
|
40
|
-
* @param
|
|
40
|
+
* @param relayData RelayData instance, supplemented with destinationChainId
|
|
41
41
|
* @param _relayer Relayer address to simulate with.
|
|
42
42
|
* @param options
|
|
43
43
|
* @param options.gasPrice Optional gas price to use for the simulation.
|
|
@@ -45,7 +45,9 @@ 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(
|
|
48
|
+
getGasCosts(relayData: RelayData & {
|
|
49
|
+
destinationChainId: number;
|
|
50
|
+
}, relayer?: import("../../utils").Address, options?: Partial<{
|
|
49
51
|
gasPrice: BigNumberish;
|
|
50
52
|
gasUnits: BigNumberish;
|
|
51
53
|
baseFeeMultiplier: BigNumber;
|
|
@@ -57,14 +59,20 @@ export declare class SvmQuery implements QueryInterface {
|
|
|
57
59
|
* @param relayer SVM address of the relayer
|
|
58
60
|
* @returns Estimated gas cost in compute units
|
|
59
61
|
*/
|
|
60
|
-
getNativeGasCost(deposit:
|
|
62
|
+
getNativeGasCost(deposit: RelayData & {
|
|
63
|
+
destinationChainId: number;
|
|
64
|
+
}, _relayer?: import("../../utils").Address): Promise<BigNumber>;
|
|
61
65
|
/**
|
|
62
66
|
* @notice Return the fillRelay transaction for a given deposit
|
|
63
|
-
* @param
|
|
67
|
+
* @param relayData RelayData instance, supplemented with destinationChainId
|
|
64
68
|
* @param relayer SVM address of the relayer
|
|
65
69
|
* @returns FillRelay transaction
|
|
66
70
|
*/
|
|
67
|
-
getFillRelayTx(
|
|
71
|
+
getFillRelayTx(relayData: Omit<RelayData, "recipent" | "outputToken"> & {
|
|
72
|
+
destinationChainId: number;
|
|
73
|
+
recipient: SvmAddress;
|
|
74
|
+
outputToken: SvmAddress;
|
|
75
|
+
}, 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<{
|
|
68
76
|
instructions: readonly import("@solana/kit").IInstruction<string, readonly (import("@solana/kit").IAccountLookupMeta<string, string> | import("@solana/kit").IAccountMeta<string>)[]>[];
|
|
69
77
|
version: 0;
|
|
70
78
|
}>, "feePayer">>;
|