@across-protocol/sdk 4.3.18 → 4.3.19-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/arch/svm/BlockUtils.js +4 -31
- package/dist/cjs/arch/svm/BlockUtils.js.map +1 -1
- package/dist/cjs/arch/svm/SpokeUtils.d.ts +8 -8
- package/dist/cjs/arch/svm/SpokeUtils.js +33 -36
- package/dist/cjs/arch/svm/SpokeUtils.js.map +1 -1
- package/dist/cjs/arch/svm/utils.d.ts +10 -2
- package/dist/cjs/arch/svm/utils.js +35 -1
- package/dist/cjs/arch/svm/utils.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.d.ts +120 -120
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.d.ts +1 -1
- package/dist/esm/arch/svm/BlockUtils.js +4 -31
- package/dist/esm/arch/svm/BlockUtils.js.map +1 -1
- package/dist/esm/arch/svm/SpokeUtils.d.ts +8 -8
- package/dist/esm/arch/svm/SpokeUtils.js +35 -36
- package/dist/esm/arch/svm/SpokeUtils.js.map +1 -1
- package/dist/esm/arch/svm/utils.d.ts +16 -2
- package/dist/esm/arch/svm/utils.js +39 -0
- package/dist/esm/arch/svm/utils.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.d.ts +120 -120
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.d.ts +1 -1
- package/dist/types/arch/svm/BlockUtils.d.ts.map +1 -1
- package/dist/types/arch/svm/SpokeUtils.d.ts +8 -8
- package/dist/types/arch/svm/SpokeUtils.d.ts.map +1 -1
- package/dist/types/arch/svm/utils.d.ts +16 -2
- package/dist/types/arch/svm/utils.d.ts.map +1 -1
- package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts +120 -120
- package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts +1 -1
- package/package.json +1 -1
- package/src/arch/svm/BlockUtils.ts +4 -12
- package/src/arch/svm/SpokeUtils.ts +24 -20
- package/src/arch/svm/utils.ts +24 -0
|
@@ -11,68 +11,68 @@ export declare const SortableEventSS: {
|
|
|
11
11
|
export declare const BundleDataSS: import("superstruct").Struct<{
|
|
12
12
|
bundleDepositsV3: Record<string, Record<string, {
|
|
13
13
|
message: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
inputAmount: BigNumber;
|
|
14
|
+
recipient: SvmAddress | EvmAddress | RawAddress;
|
|
15
|
+
outputToken: SvmAddress | EvmAddress | RawAddress;
|
|
17
16
|
originChainId: number;
|
|
18
|
-
destinationChainId: number;
|
|
19
|
-
fromLiteChain: boolean;
|
|
20
|
-
toLiteChain: boolean;
|
|
21
|
-
messageHash: string;
|
|
22
|
-
quoteTimestamp: number;
|
|
23
17
|
depositor: SvmAddress | EvmAddress | RawAddress;
|
|
24
|
-
|
|
18
|
+
depositId: BigNumber;
|
|
25
19
|
inputToken: SvmAddress | EvmAddress | RawAddress;
|
|
26
|
-
|
|
20
|
+
inputAmount: BigNumber;
|
|
21
|
+
outputAmount: BigNumber;
|
|
27
22
|
fillDeadline: number;
|
|
28
23
|
exclusiveRelayer: SvmAddress | EvmAddress | RawAddress;
|
|
29
24
|
exclusivityDeadline: number;
|
|
25
|
+
destinationChainId: number;
|
|
26
|
+
quoteTimestamp: number;
|
|
27
|
+
fromLiteChain: boolean;
|
|
28
|
+
toLiteChain: boolean;
|
|
29
|
+
messageHash: string;
|
|
30
30
|
blockNumber: number;
|
|
31
31
|
logIndex: number;
|
|
32
32
|
quoteBlockNumber: number;
|
|
33
33
|
updatedRecipient?: SvmAddress | EvmAddress | RawAddress | undefined;
|
|
34
34
|
updatedOutputAmount?: BigNumber | undefined;
|
|
35
35
|
updatedMessage?: string | undefined;
|
|
36
|
+
transactionHash?: string | undefined;
|
|
37
|
+
transactionIndex?: number | undefined;
|
|
36
38
|
speedUpSignature?: string | undefined;
|
|
37
39
|
txnIndex?: number | undefined;
|
|
38
40
|
txnRef?: string | undefined;
|
|
39
|
-
transactionHash?: string | undefined;
|
|
40
|
-
transactionIndex?: number | undefined;
|
|
41
41
|
relayerFeePct?: BigNumber | undefined;
|
|
42
42
|
}[]>>;
|
|
43
43
|
bundleFillsV3: Record<string, Record<string, {
|
|
44
44
|
fills: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
inputAmount: BigNumber;
|
|
45
|
+
recipient: SvmAddress | EvmAddress | RawAddress;
|
|
46
|
+
outputToken: SvmAddress | EvmAddress | RawAddress;
|
|
48
47
|
originChainId: number;
|
|
49
|
-
destinationChainId: number;
|
|
50
|
-
repaymentChainId: number;
|
|
51
|
-
messageHash: string;
|
|
52
|
-
quoteTimestamp: number;
|
|
53
48
|
depositor: SvmAddress | EvmAddress | RawAddress;
|
|
54
|
-
|
|
49
|
+
depositId: BigNumber;
|
|
55
50
|
inputToken: SvmAddress | EvmAddress | RawAddress;
|
|
56
|
-
|
|
51
|
+
inputAmount: BigNumber;
|
|
52
|
+
outputAmount: BigNumber;
|
|
57
53
|
fillDeadline: number;
|
|
58
54
|
exclusiveRelayer: SvmAddress | EvmAddress | RawAddress;
|
|
59
55
|
exclusivityDeadline: number;
|
|
56
|
+
destinationChainId: number;
|
|
57
|
+
repaymentChainId: number;
|
|
58
|
+
quoteTimestamp: number;
|
|
59
|
+
messageHash: string;
|
|
60
60
|
blockNumber: number;
|
|
61
61
|
logIndex: number;
|
|
62
62
|
lpFeePct: BigNumber;
|
|
63
63
|
relayer: SvmAddress | EvmAddress | RawAddress;
|
|
64
64
|
relayExecutionInfo: {
|
|
65
|
-
fillType: number;
|
|
66
65
|
updatedRecipient: SvmAddress | EvmAddress | RawAddress;
|
|
67
66
|
updatedOutputAmount: BigNumber;
|
|
67
|
+
fillType: number;
|
|
68
68
|
updatedMessageHash: string;
|
|
69
69
|
updatedMessage?: string | undefined;
|
|
70
70
|
};
|
|
71
71
|
message?: string | undefined;
|
|
72
|
-
txnIndex?: number | undefined;
|
|
73
|
-
txnRef?: string | undefined;
|
|
74
72
|
transactionHash?: string | undefined;
|
|
75
73
|
transactionIndex?: number | undefined;
|
|
74
|
+
txnIndex?: number | undefined;
|
|
75
|
+
txnRef?: string | undefined;
|
|
76
76
|
}[];
|
|
77
77
|
refunds: Record<string, BigNumber>;
|
|
78
78
|
realizedLpFees: BigNumber;
|
|
@@ -80,22 +80,22 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
80
80
|
}>>;
|
|
81
81
|
bundleSlowFillsV3: Record<string, Record<string, {
|
|
82
82
|
message: string;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
inputAmount: BigNumber;
|
|
83
|
+
recipient: SvmAddress | EvmAddress | RawAddress;
|
|
84
|
+
outputToken: SvmAddress | EvmAddress | RawAddress;
|
|
86
85
|
originChainId: number;
|
|
87
|
-
destinationChainId: number;
|
|
88
|
-
fromLiteChain: boolean;
|
|
89
|
-
toLiteChain: boolean;
|
|
90
|
-
messageHash: string;
|
|
91
|
-
quoteTimestamp: number;
|
|
92
86
|
depositor: SvmAddress | EvmAddress | RawAddress;
|
|
93
|
-
|
|
87
|
+
depositId: BigNumber;
|
|
94
88
|
inputToken: SvmAddress | EvmAddress | RawAddress;
|
|
95
|
-
|
|
89
|
+
inputAmount: BigNumber;
|
|
90
|
+
outputAmount: BigNumber;
|
|
96
91
|
fillDeadline: number;
|
|
97
92
|
exclusiveRelayer: SvmAddress | EvmAddress | RawAddress;
|
|
98
93
|
exclusivityDeadline: number;
|
|
94
|
+
destinationChainId: number;
|
|
95
|
+
quoteTimestamp: number;
|
|
96
|
+
fromLiteChain: boolean;
|
|
97
|
+
toLiteChain: boolean;
|
|
98
|
+
messageHash: string;
|
|
99
99
|
blockNumber: number;
|
|
100
100
|
logIndex: number;
|
|
101
101
|
quoteBlockNumber: number;
|
|
@@ -103,62 +103,62 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
103
103
|
updatedRecipient?: SvmAddress | EvmAddress | RawAddress | undefined;
|
|
104
104
|
updatedOutputAmount?: BigNumber | undefined;
|
|
105
105
|
updatedMessage?: string | undefined;
|
|
106
|
+
transactionHash?: string | undefined;
|
|
107
|
+
transactionIndex?: number | undefined;
|
|
106
108
|
speedUpSignature?: string | undefined;
|
|
107
109
|
txnIndex?: number | undefined;
|
|
108
110
|
txnRef?: string | undefined;
|
|
109
|
-
transactionHash?: string | undefined;
|
|
110
|
-
transactionIndex?: number | undefined;
|
|
111
111
|
relayerFeePct?: BigNumber | undefined;
|
|
112
112
|
}[]>>;
|
|
113
113
|
expiredDepositsToRefundV3: Record<string, Record<string, {
|
|
114
114
|
message: string;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
inputAmount: BigNumber;
|
|
115
|
+
recipient: SvmAddress | EvmAddress | RawAddress;
|
|
116
|
+
outputToken: SvmAddress | EvmAddress | RawAddress;
|
|
118
117
|
originChainId: number;
|
|
119
|
-
destinationChainId: number;
|
|
120
|
-
fromLiteChain: boolean;
|
|
121
|
-
toLiteChain: boolean;
|
|
122
|
-
messageHash: string;
|
|
123
|
-
quoteTimestamp: number;
|
|
124
118
|
depositor: SvmAddress | EvmAddress | RawAddress;
|
|
125
|
-
|
|
119
|
+
depositId: BigNumber;
|
|
126
120
|
inputToken: SvmAddress | EvmAddress | RawAddress;
|
|
127
|
-
|
|
121
|
+
inputAmount: BigNumber;
|
|
122
|
+
outputAmount: BigNumber;
|
|
128
123
|
fillDeadline: number;
|
|
129
124
|
exclusiveRelayer: SvmAddress | EvmAddress | RawAddress;
|
|
130
125
|
exclusivityDeadline: number;
|
|
126
|
+
destinationChainId: number;
|
|
127
|
+
quoteTimestamp: number;
|
|
128
|
+
fromLiteChain: boolean;
|
|
129
|
+
toLiteChain: boolean;
|
|
130
|
+
messageHash: string;
|
|
131
131
|
blockNumber: number;
|
|
132
132
|
logIndex: number;
|
|
133
133
|
quoteBlockNumber: number;
|
|
134
134
|
updatedRecipient?: SvmAddress | EvmAddress | RawAddress | undefined;
|
|
135
135
|
updatedOutputAmount?: BigNumber | undefined;
|
|
136
136
|
updatedMessage?: string | undefined;
|
|
137
|
+
transactionHash?: string | undefined;
|
|
138
|
+
transactionIndex?: number | undefined;
|
|
137
139
|
speedUpSignature?: string | undefined;
|
|
138
140
|
txnIndex?: number | undefined;
|
|
139
141
|
txnRef?: string | undefined;
|
|
140
|
-
transactionHash?: string | undefined;
|
|
141
|
-
transactionIndex?: number | undefined;
|
|
142
142
|
relayerFeePct?: BigNumber | undefined;
|
|
143
143
|
}[]>>;
|
|
144
144
|
unexecutableSlowFills: Record<string, Record<string, {
|
|
145
145
|
message: string;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
inputAmount: BigNumber;
|
|
146
|
+
recipient: SvmAddress | EvmAddress | RawAddress;
|
|
147
|
+
outputToken: SvmAddress | EvmAddress | RawAddress;
|
|
149
148
|
originChainId: number;
|
|
150
|
-
destinationChainId: number;
|
|
151
|
-
fromLiteChain: boolean;
|
|
152
|
-
toLiteChain: boolean;
|
|
153
|
-
messageHash: string;
|
|
154
|
-
quoteTimestamp: number;
|
|
155
149
|
depositor: SvmAddress | EvmAddress | RawAddress;
|
|
156
|
-
|
|
150
|
+
depositId: BigNumber;
|
|
157
151
|
inputToken: SvmAddress | EvmAddress | RawAddress;
|
|
158
|
-
|
|
152
|
+
inputAmount: BigNumber;
|
|
153
|
+
outputAmount: BigNumber;
|
|
159
154
|
fillDeadline: number;
|
|
160
155
|
exclusiveRelayer: SvmAddress | EvmAddress | RawAddress;
|
|
161
156
|
exclusivityDeadline: number;
|
|
157
|
+
destinationChainId: number;
|
|
158
|
+
quoteTimestamp: number;
|
|
159
|
+
fromLiteChain: boolean;
|
|
160
|
+
toLiteChain: boolean;
|
|
161
|
+
messageHash: string;
|
|
162
162
|
blockNumber: number;
|
|
163
163
|
logIndex: number;
|
|
164
164
|
quoteBlockNumber: number;
|
|
@@ -166,94 +166,94 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
166
166
|
updatedRecipient?: SvmAddress | EvmAddress | RawAddress | undefined;
|
|
167
167
|
updatedOutputAmount?: BigNumber | undefined;
|
|
168
168
|
updatedMessage?: string | undefined;
|
|
169
|
+
transactionHash?: string | undefined;
|
|
170
|
+
transactionIndex?: number | undefined;
|
|
169
171
|
speedUpSignature?: string | undefined;
|
|
170
172
|
txnIndex?: number | undefined;
|
|
171
173
|
txnRef?: string | undefined;
|
|
172
|
-
transactionHash?: string | undefined;
|
|
173
|
-
transactionIndex?: number | undefined;
|
|
174
174
|
relayerFeePct?: BigNumber | undefined;
|
|
175
175
|
}[]>>;
|
|
176
176
|
}, {
|
|
177
177
|
bundleDepositsV3: import("superstruct").Struct<Record<string, Record<string, {
|
|
178
178
|
message: string;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
inputAmount: BigNumber;
|
|
179
|
+
recipient: SvmAddress | EvmAddress | RawAddress;
|
|
180
|
+
outputToken: SvmAddress | EvmAddress | RawAddress;
|
|
182
181
|
originChainId: number;
|
|
183
|
-
destinationChainId: number;
|
|
184
|
-
fromLiteChain: boolean;
|
|
185
|
-
toLiteChain: boolean;
|
|
186
|
-
messageHash: string;
|
|
187
|
-
quoteTimestamp: number;
|
|
188
182
|
depositor: SvmAddress | EvmAddress | RawAddress;
|
|
189
|
-
|
|
183
|
+
depositId: BigNumber;
|
|
190
184
|
inputToken: SvmAddress | EvmAddress | RawAddress;
|
|
191
|
-
|
|
185
|
+
inputAmount: BigNumber;
|
|
186
|
+
outputAmount: BigNumber;
|
|
192
187
|
fillDeadline: number;
|
|
193
188
|
exclusiveRelayer: SvmAddress | EvmAddress | RawAddress;
|
|
194
189
|
exclusivityDeadline: number;
|
|
190
|
+
destinationChainId: number;
|
|
191
|
+
quoteTimestamp: number;
|
|
192
|
+
fromLiteChain: boolean;
|
|
193
|
+
toLiteChain: boolean;
|
|
194
|
+
messageHash: string;
|
|
195
195
|
blockNumber: number;
|
|
196
196
|
logIndex: number;
|
|
197
197
|
quoteBlockNumber: number;
|
|
198
198
|
updatedRecipient?: SvmAddress | EvmAddress | RawAddress | undefined;
|
|
199
199
|
updatedOutputAmount?: BigNumber | undefined;
|
|
200
200
|
updatedMessage?: string | undefined;
|
|
201
|
+
transactionHash?: string | undefined;
|
|
202
|
+
transactionIndex?: number | undefined;
|
|
201
203
|
speedUpSignature?: string | undefined;
|
|
202
204
|
txnIndex?: number | undefined;
|
|
203
205
|
txnRef?: string | undefined;
|
|
204
|
-
transactionHash?: string | undefined;
|
|
205
|
-
transactionIndex?: number | undefined;
|
|
206
206
|
relayerFeePct?: BigNumber | undefined;
|
|
207
207
|
}[]>>, null>;
|
|
208
208
|
expiredDepositsToRefundV3: import("superstruct").Struct<Record<string, Record<string, {
|
|
209
209
|
message: string;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
inputAmount: BigNumber;
|
|
210
|
+
recipient: SvmAddress | EvmAddress | RawAddress;
|
|
211
|
+
outputToken: SvmAddress | EvmAddress | RawAddress;
|
|
213
212
|
originChainId: number;
|
|
214
|
-
destinationChainId: number;
|
|
215
|
-
fromLiteChain: boolean;
|
|
216
|
-
toLiteChain: boolean;
|
|
217
|
-
messageHash: string;
|
|
218
|
-
quoteTimestamp: number;
|
|
219
213
|
depositor: SvmAddress | EvmAddress | RawAddress;
|
|
220
|
-
|
|
214
|
+
depositId: BigNumber;
|
|
221
215
|
inputToken: SvmAddress | EvmAddress | RawAddress;
|
|
222
|
-
|
|
216
|
+
inputAmount: BigNumber;
|
|
217
|
+
outputAmount: BigNumber;
|
|
223
218
|
fillDeadline: number;
|
|
224
219
|
exclusiveRelayer: SvmAddress | EvmAddress | RawAddress;
|
|
225
220
|
exclusivityDeadline: number;
|
|
221
|
+
destinationChainId: number;
|
|
222
|
+
quoteTimestamp: number;
|
|
223
|
+
fromLiteChain: boolean;
|
|
224
|
+
toLiteChain: boolean;
|
|
225
|
+
messageHash: string;
|
|
226
226
|
blockNumber: number;
|
|
227
227
|
logIndex: number;
|
|
228
228
|
quoteBlockNumber: number;
|
|
229
229
|
updatedRecipient?: SvmAddress | EvmAddress | RawAddress | undefined;
|
|
230
230
|
updatedOutputAmount?: BigNumber | undefined;
|
|
231
231
|
updatedMessage?: string | undefined;
|
|
232
|
+
transactionHash?: string | undefined;
|
|
233
|
+
transactionIndex?: number | undefined;
|
|
232
234
|
speedUpSignature?: string | undefined;
|
|
233
235
|
txnIndex?: number | undefined;
|
|
234
236
|
txnRef?: string | undefined;
|
|
235
|
-
transactionHash?: string | undefined;
|
|
236
|
-
transactionIndex?: number | undefined;
|
|
237
237
|
relayerFeePct?: BigNumber | undefined;
|
|
238
238
|
}[]>>, null>;
|
|
239
239
|
unexecutableSlowFills: import("superstruct").Struct<Record<string, Record<string, {
|
|
240
240
|
message: string;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
inputAmount: BigNumber;
|
|
241
|
+
recipient: SvmAddress | EvmAddress | RawAddress;
|
|
242
|
+
outputToken: SvmAddress | EvmAddress | RawAddress;
|
|
244
243
|
originChainId: number;
|
|
245
|
-
destinationChainId: number;
|
|
246
|
-
fromLiteChain: boolean;
|
|
247
|
-
toLiteChain: boolean;
|
|
248
|
-
messageHash: string;
|
|
249
|
-
quoteTimestamp: number;
|
|
250
244
|
depositor: SvmAddress | EvmAddress | RawAddress;
|
|
251
|
-
|
|
245
|
+
depositId: BigNumber;
|
|
252
246
|
inputToken: SvmAddress | EvmAddress | RawAddress;
|
|
253
|
-
|
|
247
|
+
inputAmount: BigNumber;
|
|
248
|
+
outputAmount: BigNumber;
|
|
254
249
|
fillDeadline: number;
|
|
255
250
|
exclusiveRelayer: SvmAddress | EvmAddress | RawAddress;
|
|
256
251
|
exclusivityDeadline: number;
|
|
252
|
+
destinationChainId: number;
|
|
253
|
+
quoteTimestamp: number;
|
|
254
|
+
fromLiteChain: boolean;
|
|
255
|
+
toLiteChain: boolean;
|
|
256
|
+
messageHash: string;
|
|
257
257
|
blockNumber: number;
|
|
258
258
|
logIndex: number;
|
|
259
259
|
quoteBlockNumber: number;
|
|
@@ -261,31 +261,31 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
261
261
|
updatedRecipient?: SvmAddress | EvmAddress | RawAddress | undefined;
|
|
262
262
|
updatedOutputAmount?: BigNumber | undefined;
|
|
263
263
|
updatedMessage?: string | undefined;
|
|
264
|
+
transactionHash?: string | undefined;
|
|
265
|
+
transactionIndex?: number | undefined;
|
|
264
266
|
speedUpSignature?: string | undefined;
|
|
265
267
|
txnIndex?: number | undefined;
|
|
266
268
|
txnRef?: string | undefined;
|
|
267
|
-
transactionHash?: string | undefined;
|
|
268
|
-
transactionIndex?: number | undefined;
|
|
269
269
|
relayerFeePct?: BigNumber | undefined;
|
|
270
270
|
}[]>>, null>;
|
|
271
271
|
bundleSlowFillsV3: import("superstruct").Struct<Record<string, Record<string, {
|
|
272
272
|
message: string;
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
inputAmount: BigNumber;
|
|
273
|
+
recipient: SvmAddress | EvmAddress | RawAddress;
|
|
274
|
+
outputToken: SvmAddress | EvmAddress | RawAddress;
|
|
276
275
|
originChainId: number;
|
|
277
|
-
destinationChainId: number;
|
|
278
|
-
fromLiteChain: boolean;
|
|
279
|
-
toLiteChain: boolean;
|
|
280
|
-
messageHash: string;
|
|
281
|
-
quoteTimestamp: number;
|
|
282
276
|
depositor: SvmAddress | EvmAddress | RawAddress;
|
|
283
|
-
|
|
277
|
+
depositId: BigNumber;
|
|
284
278
|
inputToken: SvmAddress | EvmAddress | RawAddress;
|
|
285
|
-
|
|
279
|
+
inputAmount: BigNumber;
|
|
280
|
+
outputAmount: BigNumber;
|
|
286
281
|
fillDeadline: number;
|
|
287
282
|
exclusiveRelayer: SvmAddress | EvmAddress | RawAddress;
|
|
288
283
|
exclusivityDeadline: number;
|
|
284
|
+
destinationChainId: number;
|
|
285
|
+
quoteTimestamp: number;
|
|
286
|
+
fromLiteChain: boolean;
|
|
287
|
+
toLiteChain: boolean;
|
|
288
|
+
messageHash: string;
|
|
289
289
|
blockNumber: number;
|
|
290
290
|
logIndex: number;
|
|
291
291
|
quoteBlockNumber: number;
|
|
@@ -293,46 +293,46 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
293
293
|
updatedRecipient?: SvmAddress | EvmAddress | RawAddress | undefined;
|
|
294
294
|
updatedOutputAmount?: BigNumber | undefined;
|
|
295
295
|
updatedMessage?: string | undefined;
|
|
296
|
+
transactionHash?: string | undefined;
|
|
297
|
+
transactionIndex?: number | undefined;
|
|
296
298
|
speedUpSignature?: string | undefined;
|
|
297
299
|
txnIndex?: number | undefined;
|
|
298
300
|
txnRef?: string | undefined;
|
|
299
|
-
transactionHash?: string | undefined;
|
|
300
|
-
transactionIndex?: number | undefined;
|
|
301
301
|
relayerFeePct?: BigNumber | undefined;
|
|
302
302
|
}[]>>, null>;
|
|
303
303
|
bundleFillsV3: import("superstruct").Struct<Record<string, Record<string, {
|
|
304
304
|
fills: {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
inputAmount: BigNumber;
|
|
305
|
+
recipient: SvmAddress | EvmAddress | RawAddress;
|
|
306
|
+
outputToken: SvmAddress | EvmAddress | RawAddress;
|
|
308
307
|
originChainId: number;
|
|
309
|
-
destinationChainId: number;
|
|
310
|
-
repaymentChainId: number;
|
|
311
|
-
messageHash: string;
|
|
312
|
-
quoteTimestamp: number;
|
|
313
308
|
depositor: SvmAddress | EvmAddress | RawAddress;
|
|
314
|
-
|
|
309
|
+
depositId: BigNumber;
|
|
315
310
|
inputToken: SvmAddress | EvmAddress | RawAddress;
|
|
316
|
-
|
|
311
|
+
inputAmount: BigNumber;
|
|
312
|
+
outputAmount: BigNumber;
|
|
317
313
|
fillDeadline: number;
|
|
318
314
|
exclusiveRelayer: SvmAddress | EvmAddress | RawAddress;
|
|
319
315
|
exclusivityDeadline: number;
|
|
316
|
+
destinationChainId: number;
|
|
317
|
+
repaymentChainId: number;
|
|
318
|
+
quoteTimestamp: number;
|
|
319
|
+
messageHash: string;
|
|
320
320
|
blockNumber: number;
|
|
321
321
|
logIndex: number;
|
|
322
322
|
lpFeePct: BigNumber;
|
|
323
323
|
relayer: SvmAddress | EvmAddress | RawAddress;
|
|
324
324
|
relayExecutionInfo: {
|
|
325
|
-
fillType: number;
|
|
326
325
|
updatedRecipient: SvmAddress | EvmAddress | RawAddress;
|
|
327
326
|
updatedOutputAmount: BigNumber;
|
|
327
|
+
fillType: number;
|
|
328
328
|
updatedMessageHash: string;
|
|
329
329
|
updatedMessage?: string | undefined;
|
|
330
330
|
};
|
|
331
331
|
message?: string | undefined;
|
|
332
|
-
txnIndex?: number | undefined;
|
|
333
|
-
txnRef?: string | undefined;
|
|
334
332
|
transactionHash?: string | undefined;
|
|
335
333
|
transactionIndex?: number | undefined;
|
|
334
|
+
txnIndex?: number | undefined;
|
|
335
|
+
txnRef?: string | undefined;
|
|
336
336
|
}[];
|
|
337
337
|
refunds: Record<string, BigNumber>;
|
|
338
338
|
realizedLpFees: BigNumber;
|
|
@@ -74,7 +74,7 @@ export declare class SvmQuery implements QueryInterface {
|
|
|
74
74
|
recipient: SvmAddress;
|
|
75
75
|
outputToken: SvmAddress;
|
|
76
76
|
}, signer: TransactionSigner, repaymentChainId: number, repaymentAddress: Address): Promise<import("@solana/kit").TransactionMessageWithBlockhashLifetime & import("@solana/kit").ITransactionMessageWithFeePayerSigner<string, TransactionSigner<string>> & Omit<Readonly<{
|
|
77
|
-
instructions: readonly import("@solana/kit").IInstruction<string, readonly (import("@solana/kit").
|
|
77
|
+
instructions: readonly import("@solana/kit").IInstruction<string, readonly (import("@solana/kit").IAccountMeta<string> | import("@solana/kit").IAccountLookupMeta<string, string>)[]>[];
|
|
78
78
|
version: 0;
|
|
79
79
|
}>, "feePayer">>;
|
|
80
80
|
/**
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { isDefined } from "../../utils/TypeGuards";
|
|
|
5
5
|
import { getCurrentTime } from "../../utils/TimeUtils";
|
|
6
6
|
import { CHAIN_IDs } from "../../constants";
|
|
7
7
|
import { SVMProvider } from "./";
|
|
8
|
-
import {
|
|
8
|
+
import { getNearestSlotTime } from "./utils";
|
|
9
9
|
|
|
10
10
|
interface SVMBlock extends Block {}
|
|
11
11
|
|
|
@@ -95,17 +95,9 @@ export class SVMBlockFinder extends BlockFinder<SVMBlock> {
|
|
|
95
95
|
* immediate preceding block timestamp will be used. Note that this may return an eventually-incorrect timestamp for
|
|
96
96
|
* future slots.
|
|
97
97
|
*/
|
|
98
|
-
private
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
do {
|
|
103
|
-
timestamp = await getTimestampForSlot(this.provider, slot);
|
|
104
|
-
} while (!isDefined(timestamp) && --slot);
|
|
105
|
-
assert(isDefined(timestamp), `Unable to resolve block time for SVM slot ${_slot ?? "latest"}`);
|
|
106
|
-
assert(BigInt(Number(timestamp) === timestamp), `Unexpected SVM block timestamp: ${timestamp}`);
|
|
107
|
-
|
|
108
|
-
return { slot, timestamp: Number(timestamp) };
|
|
98
|
+
private getBlockTime(slot?: bigint): Promise<{ slot: bigint; timestamp: number }> {
|
|
99
|
+
const opts = isDefined(slot) ? { slot } : undefined;
|
|
100
|
+
return getNearestSlotTime(this.provider, opts);
|
|
109
101
|
}
|
|
110
102
|
|
|
111
103
|
// Grabs the most recent slot and caches it.
|
|
@@ -65,6 +65,7 @@ import {
|
|
|
65
65
|
import { SvmCpiEventsClient } from "./eventsClient";
|
|
66
66
|
import { SVM_NO_BLOCK_AT_SLOT, isSolanaError } from "./provider";
|
|
67
67
|
import { AttestedCCTPMessage, SVMEventNames, SVMProvider } from "./types";
|
|
68
|
+
import { getNearestSlotTime } from "./utils";
|
|
68
69
|
|
|
69
70
|
/**
|
|
70
71
|
* @note: Average Solana slot duration is about 400-500ms. We can be conservative
|
|
@@ -83,9 +84,10 @@ type ProtoFill = Omit<RelayData, "recipient" | "outputToken"> & {
|
|
|
83
84
|
*/
|
|
84
85
|
export async function getTimestampForSlot(provider: SVMProvider, slotNumber: bigint): Promise<number | undefined> {
|
|
85
86
|
// @note: getBlockTime receives a slot number, not a block number.
|
|
87
|
+
let _timestamp: bigint;
|
|
88
|
+
|
|
86
89
|
try {
|
|
87
|
-
|
|
88
|
-
return Number(blockTime);
|
|
90
|
+
_timestamp = await provider.getBlockTime(slotNumber).send();
|
|
89
91
|
} catch (err) {
|
|
90
92
|
if (!isSolanaError(err)) {
|
|
91
93
|
throw err;
|
|
@@ -98,6 +100,11 @@ export async function getTimestampForSlot(provider: SVMProvider, slotNumber: big
|
|
|
98
100
|
|
|
99
101
|
throw err; // Unhandled Solana error.
|
|
100
102
|
}
|
|
103
|
+
|
|
104
|
+
const timestamp = Number(_timestamp);
|
|
105
|
+
assert(BigInt(timestamp) === _timestamp, `Unexpected SVM block timestamp: ${_timestamp}`); // No truncation.
|
|
106
|
+
|
|
107
|
+
return timestamp;
|
|
101
108
|
}
|
|
102
109
|
|
|
103
110
|
/**
|
|
@@ -226,14 +233,17 @@ export async function relayFillStatus(
|
|
|
226
233
|
const provider = svmEventsClient.getRpc();
|
|
227
234
|
// Get fill status PDA using relayData
|
|
228
235
|
const fillStatusPda = await getFillStatusPda(programId, relayData, destinationChainId);
|
|
229
|
-
|
|
236
|
+
let toSlot = BigInt(atHeight ?? 0);
|
|
230
237
|
|
|
231
238
|
// If no specific slot is requested, try fetching the current status from the PDA
|
|
232
239
|
if (atHeight === undefined) {
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
|
|
240
|
+
const commitment = "confirmed";
|
|
241
|
+
const [fillStatusAccount, { slot: currentSlot, timestamp }] = await Promise.all([
|
|
242
|
+
fetchEncodedAccount(provider, fillStatusPda, { commitment }),
|
|
243
|
+
getNearestSlotTime(provider, { commitment }),
|
|
236
244
|
]);
|
|
245
|
+
toSlot = currentSlot;
|
|
246
|
+
|
|
237
247
|
// If the PDA exists, return the stored fill status
|
|
238
248
|
if (fillStatusAccount.exists) {
|
|
239
249
|
const decodedAccountData = decodeFillStatusAccount(fillStatusAccount);
|
|
@@ -241,14 +251,12 @@ export async function relayFillStatus(
|
|
|
241
251
|
}
|
|
242
252
|
// If the PDA doesn't exist and the deadline hasn't passed yet, the deposit must be unfilled,
|
|
243
253
|
// since PDAs can't be closed before the fill deadline.
|
|
244
|
-
else if (
|
|
254
|
+
else if (timestamp < relayData.fillDeadline) {
|
|
245
255
|
return FillStatus.Unfilled;
|
|
246
256
|
}
|
|
247
257
|
}
|
|
248
258
|
|
|
249
|
-
// If status couldn't be determined from the PDA, or if a specific slot was requested, reconstruct
|
|
250
|
-
const toSlot = atHeight ? BigInt(atHeight) : currentSlot;
|
|
251
|
-
|
|
259
|
+
// If status couldn't be determined from the PDA, or if a specific slot was requested, reconstruct from events.
|
|
252
260
|
return resolveFillStatusFromPdaEvents(fillStatusPda, toSlot, svmEventsClient);
|
|
253
261
|
}
|
|
254
262
|
|
|
@@ -816,7 +824,7 @@ export const createReceiveMessageInstruction = async (
|
|
|
816
824
|
input: MessageTransmitterClient.ReceiveMessageInput,
|
|
817
825
|
remainingAccounts: IAccountMeta<string>[]
|
|
818
826
|
) => {
|
|
819
|
-
const receiveMessageIx =
|
|
827
|
+
const receiveMessageIx = MessageTransmitterClient.getReceiveMessageInstruction(input);
|
|
820
828
|
(receiveMessageIx.accounts as IAccountMeta<string>[]).push(...remainingAccounts);
|
|
821
829
|
return pipe(await createDefaultTransaction(solanaClient, signer), (tx) =>
|
|
822
830
|
appendTransactionMessageInstruction(receiveMessageIx, tx)
|
|
@@ -919,15 +927,11 @@ async function fetchBatchFillStatusFromPdaAccounts(
|
|
|
919
927
|
relayDataArray: RelayData[]
|
|
920
928
|
): Promise<(FillStatus | undefined)[]> {
|
|
921
929
|
const chunkSize = 100; // SVM method getMultipleAccounts allows a max of 100 addresses per request
|
|
922
|
-
const
|
|
930
|
+
const commitment = "confirmed";
|
|
923
931
|
|
|
924
|
-
const [pdaAccounts,
|
|
925
|
-
Promise.all(
|
|
926
|
-
|
|
927
|
-
fetchEncodedAccounts(provider, chunk, { commitment: "confirmed" })
|
|
928
|
-
)
|
|
929
|
-
),
|
|
930
|
-
getTimestampForSlot(provider, currentSlot),
|
|
932
|
+
const [pdaAccounts, { timestamp }] = await Promise.all([
|
|
933
|
+
Promise.all(chunk(fillStatusPdas, chunkSize).map((chunk) => fetchEncodedAccounts(provider, chunk, { commitment }))),
|
|
934
|
+
getNearestSlotTime(provider, { commitment }),
|
|
931
935
|
]);
|
|
932
936
|
|
|
933
937
|
const fillStatuses = pdaAccounts.flat().map((account, index) => {
|
|
@@ -939,7 +943,7 @@ async function fetchBatchFillStatusFromPdaAccounts(
|
|
|
939
943
|
|
|
940
944
|
// If the PDA doesn't exist and the deadline hasn't passed yet, the deposit must be unfilled,
|
|
941
945
|
// since PDAs can't be closed before the fill deadline.
|
|
942
|
-
if (
|
|
946
|
+
if (timestamp < relayDataArray[index].fillDeadline) {
|
|
943
947
|
return FillStatus.Unfilled;
|
|
944
948
|
}
|
|
945
949
|
|
package/src/arch/svm/utils.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import assert from "assert";
|
|
1
2
|
import { MessageTransmitterClient, SvmSpokeClient } from "@across-protocol/contracts";
|
|
2
3
|
import { BN, BorshEventCoder, Idl } from "@coral-xyz/anchor";
|
|
3
4
|
import {
|
|
4
5
|
Address,
|
|
6
|
+
type Commitment,
|
|
5
7
|
IInstruction,
|
|
6
8
|
KeyPairSigner,
|
|
7
9
|
address,
|
|
@@ -24,6 +26,7 @@ import { ethers } from "ethers";
|
|
|
24
26
|
import { FillType, RelayData } from "../../interfaces";
|
|
25
27
|
import { BigNumber, Address as SdkAddress, getRelayDataHash, isDefined, isUint8Array } from "../../utils";
|
|
26
28
|
import { AttestedCCTPMessage, EventName, SVMEventNames, SVMProvider } from "./types";
|
|
29
|
+
import { getTimestampForSlot } from "./SpokeUtils";
|
|
27
30
|
|
|
28
31
|
export { isSolanaError } from "@solana/kit";
|
|
29
32
|
|
|
@@ -56,6 +59,27 @@ export function toAddress(address: SdkAddress): Address<string> {
|
|
|
56
59
|
return address.toBase58() as Address<string>;
|
|
57
60
|
}
|
|
58
61
|
|
|
62
|
+
/**
|
|
63
|
+
* For a given slot (or implicit head of chain), find the immediate preceding slot that contained a block.
|
|
64
|
+
* @param provider SVM Provider instance.
|
|
65
|
+
* @param opts An object containing a specific slot number, or a Solana commitment, defaulting to "confirmed".
|
|
66
|
+
* @returns An object containing the slot number and the relevant timestamp for the block.
|
|
67
|
+
*/
|
|
68
|
+
export async function getNearestSlotTime(
|
|
69
|
+
provider: SVMProvider,
|
|
70
|
+
opts: { slot: bigint } | { commitment: Commitment } = { commitment: "confirmed" }
|
|
71
|
+
): Promise<{ slot: bigint; timestamp: number }> {
|
|
72
|
+
let timestamp: number | undefined;
|
|
73
|
+
let slot = "slot" in opts ? opts.slot : await provider.getSlot(opts).send();
|
|
74
|
+
|
|
75
|
+
do {
|
|
76
|
+
timestamp = await getTimestampForSlot(provider, slot);
|
|
77
|
+
} while (!isDefined(timestamp) && --slot);
|
|
78
|
+
assert(isDefined(timestamp), `Unable to resolve block time for SVM slot ${slot}`);
|
|
79
|
+
|
|
80
|
+
return { slot, timestamp };
|
|
81
|
+
}
|
|
82
|
+
|
|
59
83
|
/**
|
|
60
84
|
* Resolve the latest finalized slot, and then work backwards to find the nearest slot containing a block.
|
|
61
85
|
* In most cases the first-resolved slot should also have a block. Avoid making arbitrary decisions about
|