@across-protocol/sdk 4.3.22 → 4.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/arch/svm/SpokeUtils.d.ts +1 -1
- package/dist/cjs/arch/svm/SpokeUtils.js +54 -22
- package/dist/cjs/arch/svm/SpokeUtils.js.map +1 -1
- package/dist/cjs/arch/svm/utils.d.ts +4 -1
- package/dist/cjs/arch/svm/utils.js +25 -3
- package/dist/cjs/arch/svm/utils.js.map +1 -1
- package/dist/cjs/caching/Arweave/ArweaveClient.d.ts +4 -1
- package/dist/cjs/caching/Arweave/ArweaveClient.js +66 -17
- package/dist/cjs/caching/Arweave/ArweaveClient.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.d.ts +24 -24
- package/dist/cjs/gasPriceOracle/adapters/ethereum.js +1 -5
- package/dist/cjs/gasPriceOracle/adapters/ethereum.js.map +1 -1
- package/dist/cjs/gasPriceOracle/adapters/solana.js +1 -5
- package/dist/cjs/gasPriceOracle/adapters/solana.js.map +1 -1
- package/dist/esm/arch/svm/SpokeUtils.d.ts +1 -1
- package/dist/esm/arch/svm/SpokeUtils.js +58 -26
- package/dist/esm/arch/svm/SpokeUtils.js.map +1 -1
- package/dist/esm/arch/svm/utils.d.ts +15 -1
- package/dist/esm/arch/svm/utils.js +33 -3
- package/dist/esm/arch/svm/utils.js.map +1 -1
- package/dist/esm/caching/Arweave/ArweaveClient.d.ts +4 -1
- package/dist/esm/caching/Arweave/ArweaveClient.js +72 -20
- package/dist/esm/caching/Arweave/ArweaveClient.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.d.ts +24 -24
- package/dist/esm/gasPriceOracle/adapters/ethereum.js +2 -6
- package/dist/esm/gasPriceOracle/adapters/ethereum.js.map +1 -1
- package/dist/esm/gasPriceOracle/adapters/solana.js +2 -6
- package/dist/esm/gasPriceOracle/adapters/solana.js.map +1 -1
- package/dist/types/arch/svm/SpokeUtils.d.ts +1 -1
- package/dist/types/arch/svm/SpokeUtils.d.ts.map +1 -1
- package/dist/types/arch/svm/utils.d.ts +15 -1
- package/dist/types/arch/svm/utils.d.ts.map +1 -1
- package/dist/types/caching/Arweave/ArweaveClient.d.ts +4 -1
- package/dist/types/caching/Arweave/ArweaveClient.d.ts.map +1 -1
- package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts +24 -24
- package/dist/types/gasPriceOracle/adapters/ethereum.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/adapters/solana.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/arch/svm/SpokeUtils.ts +62 -11
- package/src/arch/svm/utils.ts +40 -5
- package/src/caching/Arweave/ArweaveClient.ts +47 -12
- package/src/gasPriceOracle/adapters/ethereum.ts +2 -6
- package/src/gasPriceOracle/adapters/solana.ts +2 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpokeUtils.d.ts","sourceRoot":"","sources":["../../../../src/arch/svm/SpokeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAA8B,MAAM,4BAA4B,CAAC;AAKlH,OAAO,EAEL,IAAI,EAKL,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,OAAO,EAEP,OAAO,EACP,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAalB,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAA2B,MAAM,kBAAkB,CAAC;AACnH,OAAO,EACL,SAAS,EACT,UAAU,EACV,OAAO,IAAI,UAAU,EACrB,UAAU,EASX,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"SpokeUtils.d.ts","sourceRoot":"","sources":["../../../../src/arch/svm/SpokeUtils.ts"],"names":[],"m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,wBAAsB,WAAW,CAC/B,YAAY,EAAE,WAAW,EACzB,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,EACrB,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAEhC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Idl } from "@coral-xyz/anchor";
|
|
3
|
-
import { Address,
|
|
3
|
+
import { Address, IInstruction, KeyPairSigner, type Commitment, type TransactionSigner } from "@solana/kit";
|
|
4
4
|
import { RelayData } from "../../interfaces";
|
|
5
5
|
import { BigNumber, Address as SdkAddress } from "../../utils";
|
|
6
6
|
import { AttestedCCTPMessage, EventName, SVMProvider } from "./types";
|
|
@@ -152,6 +152,20 @@ export declare const getCCTPNoncePda: (solanaClient: SVMProvider, signer: KeyPai
|
|
|
152
152
|
* @returns True if the message is a deposit for burn event, false otherwise.
|
|
153
153
|
*/
|
|
154
154
|
export declare function isDepositForBurnEvent(event: AttestedCCTPMessage): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* True if `body` encodes a `relayRootBundle(bytes32,bytes32)` call.
|
|
157
|
+
*/
|
|
158
|
+
export declare const isRelayRootBundleMessageBody: (body: Buffer) => boolean;
|
|
159
|
+
/**
|
|
160
|
+
* True if `body` encodes a `emergencyDeleteRootBundle(uint32)` call.
|
|
161
|
+
*/
|
|
162
|
+
export declare const isEmergencyDeleteRootBundleMessageBody: (body: Buffer) => boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Decodes the root bundle ID from an emergency delete root bundle message body.
|
|
165
|
+
* @param body The message body.
|
|
166
|
+
* @returns The root bundle ID.
|
|
167
|
+
*/
|
|
168
|
+
export declare const getEmergencyDeleteRootBundleRootBundleId: (body: Buffer) => number;
|
|
155
169
|
/**
|
|
156
170
|
* Convert a bigint (0 ≤ n < 2^256) to a 32-byte Uint8Array (big-endian).
|
|
157
171
|
* @param n The bigint to convert.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/arch/svm/utils.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/arch/svm/utils.ts"],"names":[],"mappings":";AACA,OAAO,EAAuB,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,OAAO,EACP,YAAY,EACZ,aAAa,EAcb,KAAK,UAAU,EACf,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAY,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,OAAO,IAAI,UAAU,EAAoD,MAAM,aAAa,CAAC;AAEjH,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAiB,WAAW,EAAE,MAAM,SAAS,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,iBAAiB,CAAC,MAAM,CASrF,CAAC;AAEF;;GAEG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAGjE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9D;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,WAAW,EACrB,IAAI,GAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,UAAU,EAAE,UAAU,CAAA;CAAgC,GAChF,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAU9C;AAED;;;;GAIG;AACH,wBAAsB,+BAA+B,CACnD,QAAQ,EAAE,WAAW,EACrB,O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
|
|
5
5
|
export declare class ArweaveClient {
|
|
6
6
|
private arweaveJWT;
|
|
7
7
|
private logger;
|
|
8
|
+
private readonly retries;
|
|
9
|
+
private readonly retryDelaySeconds;
|
|
8
10
|
private client;
|
|
9
11
|
private gatewayUrl;
|
|
10
|
-
constructor(arweaveJWT: JWKInterface, logger: winston.Logger, gatewayURL?: string, protocol?: string, port?: number);
|
|
12
|
+
constructor(arweaveJWT: JWKInterface, logger: winston.Logger, gatewayURL?: string, protocol?: string, port?: number, retries?: number, retryDelaySeconds?: number);
|
|
11
13
|
/**
|
|
12
14
|
* Stores an arbitrary record in the Arweave network. The record is stored as a JSON string and uses
|
|
13
15
|
* JSON.stringify to convert the record to a string. The record has all of its big numbers converted
|
|
@@ -53,6 +55,7 @@ export declare class ArweaveClient {
|
|
|
53
55
|
* @returns The address of the signer in this client
|
|
54
56
|
*/
|
|
55
57
|
getAddress(): Promise<string>;
|
|
58
|
+
private _retryRequest;
|
|
56
59
|
/**
|
|
57
60
|
* The balance of the signer
|
|
58
61
|
* @returns The balance of the signer in winston units
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArweaveClient.d.ts","sourceRoot":"","sources":["../../../../src/caching/Arweave/ArweaveClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAU,MAAM,aAAa,CAAC;AAC7C,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"ArweaveClient.d.ts","sourceRoot":"","sources":["../../../../src/caching/Arweave/ArweaveClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAU,MAAM,aAAa,CAAC;AAC7C,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAsD,MAAM,aAAa,CAAC;A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struct<{
|
|
|
24
24
|
exclusivityDeadline: number;
|
|
25
25
|
destinationChainId: number;
|
|
26
26
|
quoteTimestamp: number;
|
|
27
|
+
messageHash: string;
|
|
27
28
|
fromLiteChain: boolean;
|
|
28
29
|
toLiteChain: boolean;
|
|
29
|
-
messageHash: string;
|
|
30
30
|
blockNumber: number;
|
|
31
31
|
logIndex: number;
|
|
32
32
|
quoteBlockNumber: number;
|
|
@@ -35,10 +35,10 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
35
35
|
updatedMessage?: string | undefined;
|
|
36
36
|
transactionHash?: string | undefined;
|
|
37
37
|
transactionIndex?: number | undefined;
|
|
38
|
+
relayerFeePct?: BigNumber | undefined;
|
|
38
39
|
speedUpSignature?: string | undefined;
|
|
39
40
|
txnIndex?: number | undefined;
|
|
40
41
|
txnRef?: string | undefined;
|
|
41
|
-
relayerFeePct?: BigNumber | undefined;
|
|
42
42
|
}[]>>;
|
|
43
43
|
bundleFillsV3: Record<string, Record<string, {
|
|
44
44
|
fills: {
|
|
@@ -56,11 +56,8 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
56
56
|
destinationChainId: number;
|
|
57
57
|
repaymentChainId: number;
|
|
58
58
|
quoteTimestamp: number;
|
|
59
|
-
messageHash: string;
|
|
60
|
-
blockNumber: number;
|
|
61
|
-
logIndex: number;
|
|
62
|
-
lpFeePct: BigNumber;
|
|
63
59
|
relayer: SvmAddress | EvmAddress | RawAddress;
|
|
60
|
+
messageHash: string;
|
|
64
61
|
relayExecutionInfo: {
|
|
65
62
|
updatedRecipient: SvmAddress | EvmAddress | RawAddress;
|
|
66
63
|
updatedOutputAmount: BigNumber;
|
|
@@ -68,6 +65,9 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
68
65
|
updatedMessageHash: string;
|
|
69
66
|
updatedMessage?: string | undefined;
|
|
70
67
|
};
|
|
68
|
+
blockNumber: number;
|
|
69
|
+
logIndex: number;
|
|
70
|
+
lpFeePct: BigNumber;
|
|
71
71
|
message?: string | undefined;
|
|
72
72
|
transactionHash?: string | undefined;
|
|
73
73
|
transactionIndex?: number | undefined;
|
|
@@ -93,9 +93,9 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
93
93
|
exclusivityDeadline: number;
|
|
94
94
|
destinationChainId: number;
|
|
95
95
|
quoteTimestamp: number;
|
|
96
|
+
messageHash: string;
|
|
96
97
|
fromLiteChain: boolean;
|
|
97
98
|
toLiteChain: boolean;
|
|
98
|
-
messageHash: string;
|
|
99
99
|
blockNumber: number;
|
|
100
100
|
logIndex: number;
|
|
101
101
|
quoteBlockNumber: number;
|
|
@@ -105,10 +105,10 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
105
105
|
updatedMessage?: string | undefined;
|
|
106
106
|
transactionHash?: string | undefined;
|
|
107
107
|
transactionIndex?: number | undefined;
|
|
108
|
+
relayerFeePct?: BigNumber | undefined;
|
|
108
109
|
speedUpSignature?: string | undefined;
|
|
109
110
|
txnIndex?: number | undefined;
|
|
110
111
|
txnRef?: string | undefined;
|
|
111
|
-
relayerFeePct?: BigNumber | undefined;
|
|
112
112
|
}[]>>;
|
|
113
113
|
expiredDepositsToRefundV3: Record<string, Record<string, {
|
|
114
114
|
message: string;
|
|
@@ -125,9 +125,9 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
125
125
|
exclusivityDeadline: number;
|
|
126
126
|
destinationChainId: number;
|
|
127
127
|
quoteTimestamp: number;
|
|
128
|
+
messageHash: string;
|
|
128
129
|
fromLiteChain: boolean;
|
|
129
130
|
toLiteChain: boolean;
|
|
130
|
-
messageHash: string;
|
|
131
131
|
blockNumber: number;
|
|
132
132
|
logIndex: number;
|
|
133
133
|
quoteBlockNumber: number;
|
|
@@ -136,10 +136,10 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
136
136
|
updatedMessage?: string | undefined;
|
|
137
137
|
transactionHash?: string | undefined;
|
|
138
138
|
transactionIndex?: number | undefined;
|
|
139
|
+
relayerFeePct?: BigNumber | undefined;
|
|
139
140
|
speedUpSignature?: string | undefined;
|
|
140
141
|
txnIndex?: number | undefined;
|
|
141
142
|
txnRef?: string | undefined;
|
|
142
|
-
relayerFeePct?: BigNumber | undefined;
|
|
143
143
|
}[]>>;
|
|
144
144
|
unexecutableSlowFills: Record<string, Record<string, {
|
|
145
145
|
message: string;
|
|
@@ -156,9 +156,9 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
156
156
|
exclusivityDeadline: number;
|
|
157
157
|
destinationChainId: number;
|
|
158
158
|
quoteTimestamp: number;
|
|
159
|
+
messageHash: string;
|
|
159
160
|
fromLiteChain: boolean;
|
|
160
161
|
toLiteChain: boolean;
|
|
161
|
-
messageHash: string;
|
|
162
162
|
blockNumber: number;
|
|
163
163
|
logIndex: number;
|
|
164
164
|
quoteBlockNumber: number;
|
|
@@ -168,10 +168,10 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
168
168
|
updatedMessage?: string | undefined;
|
|
169
169
|
transactionHash?: string | undefined;
|
|
170
170
|
transactionIndex?: number | undefined;
|
|
171
|
+
relayerFeePct?: BigNumber | undefined;
|
|
171
172
|
speedUpSignature?: string | undefined;
|
|
172
173
|
txnIndex?: number | undefined;
|
|
173
174
|
txnRef?: string | undefined;
|
|
174
|
-
relayerFeePct?: BigNumber | undefined;
|
|
175
175
|
}[]>>;
|
|
176
176
|
}, {
|
|
177
177
|
bundleDepositsV3: import("superstruct").Struct<Record<string, Record<string, {
|
|
@@ -189,9 +189,9 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
189
189
|
exclusivityDeadline: number;
|
|
190
190
|
destinationChainId: number;
|
|
191
191
|
quoteTimestamp: number;
|
|
192
|
+
messageHash: string;
|
|
192
193
|
fromLiteChain: boolean;
|
|
193
194
|
toLiteChain: boolean;
|
|
194
|
-
messageHash: string;
|
|
195
195
|
blockNumber: number;
|
|
196
196
|
logIndex: number;
|
|
197
197
|
quoteBlockNumber: number;
|
|
@@ -200,10 +200,10 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
200
200
|
updatedMessage?: string | undefined;
|
|
201
201
|
transactionHash?: string | undefined;
|
|
202
202
|
transactionIndex?: number | undefined;
|
|
203
|
+
relayerFeePct?: BigNumber | undefined;
|
|
203
204
|
speedUpSignature?: string | undefined;
|
|
204
205
|
txnIndex?: number | undefined;
|
|
205
206
|
txnRef?: string | undefined;
|
|
206
|
-
relayerFeePct?: BigNumber | undefined;
|
|
207
207
|
}[]>>, null>;
|
|
208
208
|
expiredDepositsToRefundV3: import("superstruct").Struct<Record<string, Record<string, {
|
|
209
209
|
message: string;
|
|
@@ -220,9 +220,9 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
220
220
|
exclusivityDeadline: number;
|
|
221
221
|
destinationChainId: number;
|
|
222
222
|
quoteTimestamp: number;
|
|
223
|
+
messageHash: string;
|
|
223
224
|
fromLiteChain: boolean;
|
|
224
225
|
toLiteChain: boolean;
|
|
225
|
-
messageHash: string;
|
|
226
226
|
blockNumber: number;
|
|
227
227
|
logIndex: number;
|
|
228
228
|
quoteBlockNumber: number;
|
|
@@ -231,10 +231,10 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
231
231
|
updatedMessage?: string | undefined;
|
|
232
232
|
transactionHash?: string | undefined;
|
|
233
233
|
transactionIndex?: number | undefined;
|
|
234
|
+
relayerFeePct?: BigNumber | undefined;
|
|
234
235
|
speedUpSignature?: string | undefined;
|
|
235
236
|
txnIndex?: number | undefined;
|
|
236
237
|
txnRef?: string | undefined;
|
|
237
|
-
relayerFeePct?: BigNumber | undefined;
|
|
238
238
|
}[]>>, null>;
|
|
239
239
|
unexecutableSlowFills: import("superstruct").Struct<Record<string, Record<string, {
|
|
240
240
|
message: string;
|
|
@@ -251,9 +251,9 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
251
251
|
exclusivityDeadline: number;
|
|
252
252
|
destinationChainId: number;
|
|
253
253
|
quoteTimestamp: number;
|
|
254
|
+
messageHash: string;
|
|
254
255
|
fromLiteChain: boolean;
|
|
255
256
|
toLiteChain: boolean;
|
|
256
|
-
messageHash: string;
|
|
257
257
|
blockNumber: number;
|
|
258
258
|
logIndex: number;
|
|
259
259
|
quoteBlockNumber: number;
|
|
@@ -263,10 +263,10 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
263
263
|
updatedMessage?: string | undefined;
|
|
264
264
|
transactionHash?: string | undefined;
|
|
265
265
|
transactionIndex?: number | undefined;
|
|
266
|
+
relayerFeePct?: BigNumber | undefined;
|
|
266
267
|
speedUpSignature?: string | undefined;
|
|
267
268
|
txnIndex?: number | undefined;
|
|
268
269
|
txnRef?: string | undefined;
|
|
269
|
-
relayerFeePct?: BigNumber | undefined;
|
|
270
270
|
}[]>>, null>;
|
|
271
271
|
bundleSlowFillsV3: import("superstruct").Struct<Record<string, Record<string, {
|
|
272
272
|
message: string;
|
|
@@ -283,9 +283,9 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
283
283
|
exclusivityDeadline: number;
|
|
284
284
|
destinationChainId: number;
|
|
285
285
|
quoteTimestamp: number;
|
|
286
|
+
messageHash: string;
|
|
286
287
|
fromLiteChain: boolean;
|
|
287
288
|
toLiteChain: boolean;
|
|
288
|
-
messageHash: string;
|
|
289
289
|
blockNumber: number;
|
|
290
290
|
logIndex: number;
|
|
291
291
|
quoteBlockNumber: number;
|
|
@@ -295,10 +295,10 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
295
295
|
updatedMessage?: string | undefined;
|
|
296
296
|
transactionHash?: string | undefined;
|
|
297
297
|
transactionIndex?: number | undefined;
|
|
298
|
+
relayerFeePct?: BigNumber | undefined;
|
|
298
299
|
speedUpSignature?: string | undefined;
|
|
299
300
|
txnIndex?: number | undefined;
|
|
300
301
|
txnRef?: string | undefined;
|
|
301
|
-
relayerFeePct?: BigNumber | undefined;
|
|
302
302
|
}[]>>, null>;
|
|
303
303
|
bundleFillsV3: import("superstruct").Struct<Record<string, Record<string, {
|
|
304
304
|
fills: {
|
|
@@ -316,11 +316,8 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
316
316
|
destinationChainId: number;
|
|
317
317
|
repaymentChainId: number;
|
|
318
318
|
quoteTimestamp: number;
|
|
319
|
-
messageHash: string;
|
|
320
|
-
blockNumber: number;
|
|
321
|
-
logIndex: number;
|
|
322
|
-
lpFeePct: BigNumber;
|
|
323
319
|
relayer: SvmAddress | EvmAddress | RawAddress;
|
|
320
|
+
messageHash: string;
|
|
324
321
|
relayExecutionInfo: {
|
|
325
322
|
updatedRecipient: SvmAddress | EvmAddress | RawAddress;
|
|
326
323
|
updatedOutputAmount: BigNumber;
|
|
@@ -328,6 +325,9 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
328
325
|
updatedMessageHash: string;
|
|
329
326
|
updatedMessage?: string | undefined;
|
|
330
327
|
};
|
|
328
|
+
blockNumber: number;
|
|
329
|
+
logIndex: number;
|
|
330
|
+
lpFeePct: BigNumber;
|
|
331
331
|
message?: string | undefined;
|
|
332
332
|
transactionHash?: string | undefined;
|
|
333
333
|
transactionIndex?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ethereum.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/ethereum.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"ethereum.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/ethereum.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,SAAS,EAAgD,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAEjH;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAC5B,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,SAAS,EAC5B,qBAAqB,EAAE,SAAS,GAC/B,OAAO,CAAC,mBAAmB,CAAC,CAc9B;AAED;;;;GAIG;AACH,wBAAsB,MAAM,CAC1B,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAC5B,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAU9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAGpD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,mBAAmB,CAAC,
|
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAGpD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA+BnH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageTransmitterClient, SvmSpokeClient, TokenMessengerMinterClient } from "@across-protocol/contracts";
|
|
2
2
|
import { decodeFillStatusAccount, fetchState } from "@across-protocol/contracts/dist/src/svm/clients/SvmSpoke";
|
|
3
|
-
import { hashNonEmptyMessage } from "@across-protocol/contracts/dist/src/svm/web3-v1";
|
|
3
|
+
import { decodeMessageHeader, hashNonEmptyMessage } from "@across-protocol/contracts/dist/src/svm/web3-v1";
|
|
4
4
|
import { intToU8Array32 } from "@across-protocol/contracts/dist/src/svm/web3-v1/conversionUtils";
|
|
5
5
|
import { SYSTEM_PROGRAM_ADDRESS } from "@solana-program/system";
|
|
6
6
|
import {
|
|
@@ -64,11 +64,17 @@ import {
|
|
|
64
64
|
simulateAndDecode,
|
|
65
65
|
toAddress,
|
|
66
66
|
unwrapEventData,
|
|
67
|
+
getRootBundlePda,
|
|
67
68
|
} from "./";
|
|
68
69
|
import { SvmCpiEventsClient } from "./eventsClient";
|
|
69
70
|
import { SVM_NO_BLOCK_AT_SLOT, isSolanaError } from "./provider";
|
|
70
71
|
import { AttestedCCTPMessage, SVMEventNames, SVMProvider } from "./types";
|
|
71
|
-
import {
|
|
72
|
+
import {
|
|
73
|
+
getEmergencyDeleteRootBundleRootBundleId,
|
|
74
|
+
getNearestSlotTime,
|
|
75
|
+
isEmergencyDeleteRootBundleMessageBody,
|
|
76
|
+
isRelayRootBundleMessageBody,
|
|
77
|
+
} from "./utils";
|
|
72
78
|
|
|
73
79
|
/**
|
|
74
80
|
* @note: Average Solana slot duration is about 400-500ms. We can be conservative
|
|
@@ -1115,15 +1121,60 @@ export const hasCCTPV1MessageBeenProcessed = async (
|
|
|
1115
1121
|
* Returns the account metas for a tokenless message.
|
|
1116
1122
|
* @returns The account metas for a tokenless message.
|
|
1117
1123
|
*/
|
|
1118
|
-
export async function getAccountMetasForTokenlessMessage(
|
|
1119
|
-
|
|
1120
|
-
|
|
1124
|
+
export async function getAccountMetasForTokenlessMessage(
|
|
1125
|
+
solanaClient: SVMProvider,
|
|
1126
|
+
signer: KeyPairSigner,
|
|
1127
|
+
messageBytes: string
|
|
1128
|
+
): Promise<IAccountMeta<string>[]> {
|
|
1129
|
+
const messageHex = messageBytes.slice(2);
|
|
1130
|
+
const messageHeader = decodeMessageHeader(Buffer.from(messageHex, "hex"));
|
|
1131
|
+
const programAddress = SvmSpokeClient.SVM_SPOKE_PROGRAM_ADDRESS;
|
|
1132
|
+
const statePda = await getStatePda(programAddress);
|
|
1133
|
+
const selfAuthority = await getSelfAuthority();
|
|
1134
|
+
const eventAuthority = await getEventAuthority(programAddress);
|
|
1135
|
+
|
|
1136
|
+
const base: IAccountMeta<string>[] = [
|
|
1121
1137
|
{ address: statePda, role: AccountRole.READONLY },
|
|
1122
|
-
{ address:
|
|
1123
|
-
{ address:
|
|
1138
|
+
{ address: selfAuthority, role: AccountRole.READONLY },
|
|
1139
|
+
{ address: programAddress, role: AccountRole.READONLY },
|
|
1140
|
+
];
|
|
1141
|
+
|
|
1142
|
+
if (isRelayRootBundleMessageBody(messageHeader.messageBody)) {
|
|
1143
|
+
const {
|
|
1144
|
+
data: { rootBundleId },
|
|
1145
|
+
} = await SvmSpokeClient.fetchState(solanaClient, statePda);
|
|
1146
|
+
const rootBundle = await getRootBundlePda(programAddress, rootBundleId);
|
|
1147
|
+
|
|
1148
|
+
return [
|
|
1149
|
+
...base,
|
|
1150
|
+
{ address: signer.address, role: AccountRole.WRITABLE },
|
|
1151
|
+
{ address: statePda, role: AccountRole.WRITABLE },
|
|
1152
|
+
{ address: rootBundle, role: AccountRole.WRITABLE },
|
|
1153
|
+
{ address: SYSTEM_PROGRAM_ADDRESS, role: AccountRole.READONLY },
|
|
1154
|
+
{ address: eventAuthority, role: AccountRole.READONLY },
|
|
1155
|
+
{ address: programAddress, role: AccountRole.READONLY },
|
|
1156
|
+
];
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
if (isEmergencyDeleteRootBundleMessageBody(messageHeader.messageBody)) {
|
|
1160
|
+
const rootBundleId = getEmergencyDeleteRootBundleRootBundleId(messageHeader.messageBody);
|
|
1161
|
+
const rootBundle = await getRootBundlePda(programAddress, rootBundleId);
|
|
1162
|
+
|
|
1163
|
+
return [
|
|
1164
|
+
...base,
|
|
1165
|
+
{ address: signer.address, role: AccountRole.READONLY },
|
|
1166
|
+
{ address: statePda, role: AccountRole.READONLY },
|
|
1167
|
+
{ address: rootBundle, role: AccountRole.WRITABLE },
|
|
1168
|
+
{ address: eventAuthority, role: AccountRole.READONLY },
|
|
1169
|
+
{ address: programAddress, role: AccountRole.READONLY },
|
|
1170
|
+
];
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
return [
|
|
1174
|
+
...base,
|
|
1124
1175
|
{ address: statePda, role: AccountRole.WRITABLE },
|
|
1125
|
-
{ address:
|
|
1126
|
-
{ address:
|
|
1176
|
+
{ address: eventAuthority, role: AccountRole.READONLY },
|
|
1177
|
+
{ address: programAddress, role: AccountRole.READONLY },
|
|
1127
1178
|
];
|
|
1128
1179
|
}
|
|
1129
1180
|
|
|
@@ -1249,7 +1300,7 @@ export async function getCCTPV1ReceiveMessageTx(
|
|
|
1249
1300
|
hubChainId,
|
|
1250
1301
|
TokenMessengerMinterClient.TOKEN_MESSENGER_MINTER_PROGRAM_ADDRESS
|
|
1251
1302
|
)
|
|
1252
|
-
: await getAccountMetasForTokenlessMessage();
|
|
1303
|
+
: await getAccountMetasForTokenlessMessage(solanaClient, signer, message.messageBytes);
|
|
1253
1304
|
|
|
1254
1305
|
const messageBytes = message.messageBytes.startsWith("0x")
|
|
1255
1306
|
? Buffer.from(message.messageBytes.slice(2), "hex")
|
|
@@ -1263,7 +1314,7 @@ export async function getCCTPV1ReceiveMessageTx(
|
|
|
1263
1314
|
messageTransmitter: messageTransmitterPda,
|
|
1264
1315
|
eventAuthority: eventAuthorityPda,
|
|
1265
1316
|
usedNonces,
|
|
1266
|
-
receiver:
|
|
1317
|
+
receiver: cctpMessageReceiver,
|
|
1267
1318
|
systemProgram: SYSTEM_PROGRAM_ADDRESS,
|
|
1268
1319
|
message: messageBytes,
|
|
1269
1320
|
attestation: Buffer.from(message.attestation.slice(2), "hex"),
|
package/src/arch/svm/utils.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { MessageTransmitterClient, SvmSpokeClient } from "@across-protocol/contracts";
|
|
1
|
+
import { MessageTransmitterClient, SpokePool__factory, SvmSpokeClient } from "@across-protocol/contracts";
|
|
3
2
|
import { BN, BorshEventCoder, Idl } from "@coral-xyz/anchor";
|
|
4
3
|
import {
|
|
5
4
|
Address,
|
|
6
|
-
type Commitment,
|
|
7
5
|
IInstruction,
|
|
8
6
|
KeyPairSigner,
|
|
9
7
|
address,
|
|
@@ -19,14 +17,16 @@ import {
|
|
|
19
17
|
setTransactionMessageFeePayerSigner,
|
|
20
18
|
setTransactionMessageLifetimeUsingBlockhash,
|
|
21
19
|
signTransactionMessageWithSigners,
|
|
20
|
+
type Commitment,
|
|
22
21
|
type TransactionSigner,
|
|
23
22
|
} from "@solana/kit";
|
|
23
|
+
import assert from "assert";
|
|
24
24
|
import bs58 from "bs58";
|
|
25
25
|
import { ethers } from "ethers";
|
|
26
26
|
import { FillType, RelayData } from "../../interfaces";
|
|
27
|
-
import { BigNumber,
|
|
28
|
-
import { AttestedCCTPMessage, EventName, SVMEventNames, SVMProvider } from "./types";
|
|
27
|
+
import { BigNumber, Address as SdkAddress, biMin, getRelayDataHash, isDefined, isUint8Array } from "../../utils";
|
|
29
28
|
import { getTimestampForSlot } from "./SpokeUtils";
|
|
29
|
+
import { AttestedCCTPMessage, EventName, SVMEventNames, SVMProvider } from "./types";
|
|
30
30
|
|
|
31
31
|
export { isSolanaError } from "@solana/kit";
|
|
32
32
|
|
|
@@ -472,6 +472,41 @@ export function isDepositForBurnEvent(event: AttestedCCTPMessage): boolean {
|
|
|
472
472
|
return event.type === "transfer";
|
|
473
473
|
}
|
|
474
474
|
|
|
475
|
+
/**
|
|
476
|
+
* True if `body` encodes a `relayRootBundle(bytes32,bytes32)` call.
|
|
477
|
+
*/
|
|
478
|
+
export const isRelayRootBundleMessageBody = (body: Buffer): boolean => {
|
|
479
|
+
if (body.length < 4) return false;
|
|
480
|
+
|
|
481
|
+
const spokePoolInterface = new ethers.utils.Interface(SpokePool__factory.abi);
|
|
482
|
+
const relayRootBundleSelector = spokePoolInterface.getSighash("relayRootBundle");
|
|
483
|
+
|
|
484
|
+
return body.slice(0, 4).equals(Buffer.from(relayRootBundleSelector.slice(2), "hex"));
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* True if `body` encodes a `emergencyDeleteRootBundle(uint32)` call.
|
|
489
|
+
*/
|
|
490
|
+
export const isEmergencyDeleteRootBundleMessageBody = (body: Buffer): boolean => {
|
|
491
|
+
if (body.length < 4) return false;
|
|
492
|
+
|
|
493
|
+
const spokePoolInterface = new ethers.utils.Interface(SpokePool__factory.abi);
|
|
494
|
+
const emergencyDeleteRootBundleSelector = spokePoolInterface.getSighash("emergencyDeleteRootBundle");
|
|
495
|
+
|
|
496
|
+
return body.slice(0, 4).equals(Buffer.from(emergencyDeleteRootBundleSelector.slice(2), "hex"));
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Decodes the root bundle ID from an emergency delete root bundle message body.
|
|
501
|
+
* @param body The message body.
|
|
502
|
+
* @returns The root bundle ID.
|
|
503
|
+
*/
|
|
504
|
+
export const getEmergencyDeleteRootBundleRootBundleId = (body: Buffer): number => {
|
|
505
|
+
const spokePoolInterface = new ethers.utils.Interface(SpokePool__factory.abi);
|
|
506
|
+
const result = spokePoolInterface.decodeFunctionData("emergencyDeleteRootBundle", body);
|
|
507
|
+
return result.rootBundleId.toNumber();
|
|
508
|
+
};
|
|
509
|
+
|
|
475
510
|
/**
|
|
476
511
|
* Convert a bigint (0 ≤ n < 2^256) to a 32-byte Uint8Array (big-endian).
|
|
477
512
|
* @param n The bigint to convert.
|
|
@@ -4,7 +4,7 @@ import axios from "axios";
|
|
|
4
4
|
import { Struct, create } from "superstruct";
|
|
5
5
|
import winston from "winston";
|
|
6
6
|
import { ARWEAVE_TAG_APP_NAME, ARWEAVE_TAG_APP_VERSION, DEFAULT_ARWEAVE_STORAGE_ADDRESS } from "../../constants";
|
|
7
|
-
import { BigNumber, isDefined, jsonReplacerWithBigNumbers, toBN } from "../../utils";
|
|
7
|
+
import { BigNumber, delay, isDefined, jsonReplacerWithBigNumbers, toBN } from "../../utils";
|
|
8
8
|
|
|
9
9
|
export class ArweaveClient {
|
|
10
10
|
private client: Arweave;
|
|
@@ -15,7 +15,9 @@ export class ArweaveClient {
|
|
|
15
15
|
private logger: winston.Logger,
|
|
16
16
|
gatewayURL = "arweave.net",
|
|
17
17
|
protocol = "https",
|
|
18
|
-
port = 443
|
|
18
|
+
port = 443,
|
|
19
|
+
private readonly retries = 2,
|
|
20
|
+
private readonly retryDelaySeconds = 1
|
|
19
21
|
) {
|
|
20
22
|
this.gatewayUrl = `${protocol}://${gatewayURL}:${port}`;
|
|
21
23
|
this.client = new Arweave({
|
|
@@ -30,6 +32,12 @@ export class ArweaveClient {
|
|
|
30
32
|
message: "Arweave client initialized",
|
|
31
33
|
gateway: this.gatewayUrl,
|
|
32
34
|
});
|
|
35
|
+
if (this.retries < 0) {
|
|
36
|
+
throw new Error(`retries cannot be < 0 and must be an integer. Currently set to ${this.retries}`);
|
|
37
|
+
}
|
|
38
|
+
if (this.retryDelaySeconds < 0) {
|
|
39
|
+
throw new Error(`delay cannot be < 0. Currently set to ${this.retryDelaySeconds}`);
|
|
40
|
+
}
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
/**
|
|
@@ -225,21 +233,48 @@ export class ArweaveClient {
|
|
|
225
233
|
return this.client.wallets.jwkToAddress(this.arweaveJWT);
|
|
226
234
|
}
|
|
227
235
|
|
|
236
|
+
private async _retryRequest<T>(request: () => Promise<T>, retryCount: number): Promise<T> {
|
|
237
|
+
try {
|
|
238
|
+
return request();
|
|
239
|
+
} catch (e) {
|
|
240
|
+
if (retryCount < this.retries) {
|
|
241
|
+
// Implement a slightly aggressive exponential backoff to account for fierce parallelism.
|
|
242
|
+
const baseDelay = this.retryDelaySeconds * Math.pow(2, retryCount); // ms; attempt = [0, 1, 2, ...]
|
|
243
|
+
const delayS = baseDelay + baseDelay * Math.random();
|
|
244
|
+
this.logger.debug({
|
|
245
|
+
at: "ArweaveClient:getBalance",
|
|
246
|
+
message: `Arweave request failed, retrying after waiting ${delayS} seconds: ${e}`,
|
|
247
|
+
retryCount,
|
|
248
|
+
});
|
|
249
|
+
await delay(delayS);
|
|
250
|
+
return this._retryRequest(request, retryCount + 1);
|
|
251
|
+
} else {
|
|
252
|
+
throw e;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
228
257
|
/**
|
|
229
258
|
* The balance of the signer
|
|
230
259
|
* @returns The balance of the signer in winston units
|
|
231
260
|
*/
|
|
232
261
|
async getBalance(): Promise<BigNumber> {
|
|
233
262
|
const address = await this.getAddress();
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
263
|
+
const request = async () => {
|
|
264
|
+
const balanceInFloat = await this.client.wallets.getBalance(address);
|
|
265
|
+
// @dev The reason we add in the BN.from into this retry loop is because the client.getBalance call
|
|
266
|
+
// does not correctly throw an error if the request fails, instead it will return the error string as the
|
|
267
|
+
// balanceInFloat.
|
|
268
|
+
// Sometimes the balance is returned in scientific notation, so we need to
|
|
269
|
+
// convert it to a BigNumber
|
|
270
|
+
if (balanceInFloat.includes("e")) {
|
|
271
|
+
const [balance, exponent] = balanceInFloat.split("e");
|
|
272
|
+
const resultingBN = BigNumber.from(balance).mul(toBN(10).pow(exponent.replace("+", "")));
|
|
273
|
+
return BigNumber.from(resultingBN.toString());
|
|
274
|
+
} else {
|
|
275
|
+
return BigNumber.from(balanceInFloat);
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
return await this._retryRequest(request, 0);
|
|
244
279
|
}
|
|
245
280
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
2
|
import { providers } from "ethers";
|
|
3
|
-
import { BigNumber, bnZero, fixedPointAdjustment, getNetworkName
|
|
3
|
+
import { BigNumber, bnZero, fixedPointAdjustment, getNetworkName } from "../../utils";
|
|
4
4
|
import { EvmGasPriceEstimate } from "../types";
|
|
5
5
|
import { gasPriceError } from "../util";
|
|
6
6
|
import { GasPriceEstimateOptions } from "../oracle";
|
|
@@ -37,11 +37,7 @@ export async function eip1559Raw(
|
|
|
37
37
|
const maxPriorityFeePerGas = BigNumber.from(_maxPriorityFeePerGas);
|
|
38
38
|
assert(BigNumber.isBigNumber(baseFeePerGas), `No baseFeePerGas received on ${getNetworkName(chainId)}`);
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
const flooredPriorityFeePerGas = parseUnits(process.env[`MIN_PRIORITY_FEE_PER_GAS_${chainId}`] || "0", 9);
|
|
42
|
-
if (scaledPriorityFee.lt(flooredPriorityFeePerGas)) {
|
|
43
|
-
scaledPriorityFee = BigNumber.from(flooredPriorityFeePerGas);
|
|
44
|
-
}
|
|
40
|
+
const scaledPriorityFee = maxPriorityFeePerGas.mul(priorityFeeMultiplier).div(fixedPointAdjustment);
|
|
45
41
|
const scaledBaseFee = baseFeePerGas.mul(baseFeeMultiplier).div(fixedPointAdjustment);
|
|
46
42
|
return {
|
|
47
43
|
maxFeePerGas: scaledPriorityFee.add(scaledBaseFee),
|