@across-protocol/sdk 4.1.32 → 4.1.33

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.
Files changed (96) hide show
  1. package/dist/cjs/arch/evm/index.d.ts +1 -0
  2. package/dist/cjs/arch/evm/index.js +5 -0
  3. package/dist/cjs/arch/evm/index.js.map +1 -0
  4. package/dist/cjs/arch/index.d.ts +2 -0
  5. package/dist/cjs/arch/index.js +7 -0
  6. package/dist/cjs/arch/index.js.map +1 -0
  7. package/dist/cjs/arch/svm/index.d.ts +1 -0
  8. package/dist/cjs/arch/svm/index.js +5 -0
  9. package/dist/cjs/arch/svm/index.js.map +1 -0
  10. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js +24 -3
  11. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  12. package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.d.ts +2 -2
  13. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +19 -0
  14. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js +170 -0
  15. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -0
  16. package/dist/cjs/clients/{SpokePoolClient.d.ts → SpokePoolClient/SpokePoolClient.d.ts} +17 -22
  17. package/dist/cjs/clients/{SpokePoolClient.js → SpokePoolClient/SpokePoolClient.js} +24 -174
  18. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js.map +1 -0
  19. package/dist/cjs/clients/SpokePoolClient/index.d.ts +5 -0
  20. package/dist/cjs/clients/SpokePoolClient/index.js +13 -0
  21. package/dist/cjs/clients/SpokePoolClient/index.js.map +1 -0
  22. package/dist/cjs/clients/index.d.ts +1 -1
  23. package/dist/cjs/clients/index.js +2 -1
  24. package/dist/cjs/clients/index.js.map +1 -1
  25. package/dist/cjs/clients/mocks/MockSpokePoolClient.d.ts +2 -2
  26. package/dist/cjs/clients/mocks/MockSpokePoolClient.js +1 -1
  27. package/dist/cjs/clients/mocks/MockSpokePoolClient.js.map +1 -1
  28. package/dist/cjs/utils/BundleUtils.js +7 -7
  29. package/dist/cjs/utils/BundleUtils.js.map +1 -1
  30. package/dist/esm/arch/evm/index.d.ts +1 -0
  31. package/dist/esm/arch/evm/index.js +2 -0
  32. package/dist/esm/arch/evm/index.js.map +1 -0
  33. package/dist/esm/arch/index.d.ts +2 -0
  34. package/dist/esm/arch/index.js +5 -0
  35. package/dist/esm/arch/index.js.map +1 -0
  36. package/dist/esm/arch/svm/index.d.ts +1 -0
  37. package/dist/esm/arch/svm/index.js +2 -0
  38. package/dist/esm/arch/svm/index.js.map +1 -0
  39. package/dist/esm/clients/BundleDataClient/BundleDataClient.js +30 -3
  40. package/dist/esm/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  41. package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.d.ts +2 -2
  42. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +22 -0
  43. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js +174 -0
  44. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -0
  45. package/dist/{types/clients → esm/clients/SpokePoolClient}/SpokePoolClient.d.ts +58 -57
  46. package/dist/esm/clients/{SpokePoolClient.js → SpokePoolClient/SpokePoolClient.js} +22 -212
  47. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js.map +1 -0
  48. package/dist/esm/clients/SpokePoolClient/index.d.ts +10 -0
  49. package/dist/esm/clients/SpokePoolClient/index.js +12 -0
  50. package/dist/esm/clients/SpokePoolClient/index.js.map +1 -0
  51. package/dist/esm/clients/index.d.ts +1 -1
  52. package/dist/esm/clients/index.js +1 -1
  53. package/dist/esm/clients/index.js.map +1 -1
  54. package/dist/esm/clients/mocks/MockSpokePoolClient.d.ts +2 -2
  55. package/dist/esm/clients/mocks/MockSpokePoolClient.js +2 -2
  56. package/dist/esm/clients/mocks/MockSpokePoolClient.js.map +1 -1
  57. package/dist/esm/utils/BundleUtils.js +7 -7
  58. package/dist/esm/utils/BundleUtils.js.map +1 -1
  59. package/dist/esm/utils/abi/typechain/Multicall3.d.ts +1 -4
  60. package/dist/esm/utils/abi/typechain/factories/Multicall3__factory.js.map +1 -1
  61. package/dist/types/arch/evm/index.d.ts +2 -0
  62. package/dist/types/arch/evm/index.d.ts.map +1 -0
  63. package/dist/types/arch/index.d.ts +3 -0
  64. package/dist/types/arch/index.d.ts.map +1 -0
  65. package/dist/types/arch/svm/index.d.ts +2 -0
  66. package/dist/types/arch/svm/index.d.ts.map +1 -0
  67. package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts.map +1 -1
  68. package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts +2 -2
  69. package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +23 -0
  70. package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts.map +1 -0
  71. package/dist/{esm/clients → types/clients/SpokePoolClient}/SpokePoolClient.d.ts +59 -56
  72. package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts.map +1 -0
  73. package/dist/types/clients/SpokePoolClient/index.d.ts +11 -0
  74. package/dist/types/clients/SpokePoolClient/index.d.ts.map +1 -0
  75. package/dist/types/clients/index.d.ts +1 -1
  76. package/dist/types/clients/index.d.ts.map +1 -1
  77. package/dist/types/clients/mocks/MockSpokePoolClient.d.ts +2 -2
  78. package/dist/types/clients/mocks/MockSpokePoolClient.d.ts.map +1 -1
  79. package/dist/types/utils/abi/typechain/Multicall3.d.ts +1 -4
  80. package/dist/types/utils/abi/typechain/Multicall3.d.ts.map +1 -1
  81. package/dist/types/utils/abi/typechain/common.d.ts.map +1 -1
  82. package/dist/types/utils/abi/typechain/factories/Multicall3__factory.d.ts.map +1 -1
  83. package/package.json +4 -3
  84. package/src/arch/evm/index.ts +1 -0
  85. package/src/arch/index.ts +2 -0
  86. package/src/arch/svm/index.ts +1 -0
  87. package/src/clients/BundleDataClient/BundleDataClient.ts +29 -1
  88. package/src/clients/SpokePoolClient/EVMSpokePoolClient.ts +206 -0
  89. package/src/clients/{SpokePoolClient.ts → SpokePoolClient/SpokePoolClient.ts} +87 -237
  90. package/src/clients/SpokePoolClient/index.ts +14 -0
  91. package/src/clients/index.ts +1 -1
  92. package/src/clients/mocks/MockSpokePoolClient.ts +2 -2
  93. package/src/utils/BundleUtils.ts +6 -6
  94. package/dist/cjs/clients/SpokePoolClient.js.map +0 -1
  95. package/dist/esm/clients/SpokePoolClient.js.map +0 -1
  96. package/dist/types/clients/SpokePoolClient.d.ts.map +0 -1
@@ -1,28 +1,27 @@
1
- import { Contract, EventFilter } from "ethers";
2
1
  import winston from "winston";
3
- import { AnyObject, BigNumber, DefaultLogLevels, DepositSearchResult, EventSearchConfig, MakeOptional } from "../utils";
4
- import { Deposit, DepositWithBlock, Fill, FillStatus, FillWithBlock, Log, RelayData, RelayerRefundExecutionWithBlock, RootBundleRelayWithBlock, SlowFillRequestWithBlock, SpeedUpWithBlock, TokensBridged } from "../interfaces";
5
- import { BaseAbstractClient, UpdateFailureReason } from "./BaseAbstractClient";
6
- import { HubPoolClient } from "./HubPoolClient";
7
- import { AcrossConfigStoreClient } from "./AcrossConfigStoreClient";
8
- type SpokePoolUpdateSuccess = {
2
+ import { AnyObject, BigNumber, DefaultLogLevels, DepositSearchResult, EventSearchConfig, MakeOptional } from "../../utils";
3
+ import { Deposit, DepositWithBlock, Fill, FillStatus, FillWithBlock, Log, RelayData, RelayerRefundExecutionWithBlock, RootBundleRelayWithBlock, SlowFillRequestWithBlock, SpeedUpWithBlock, TokensBridged } from "../../interfaces";
4
+ import { BaseAbstractClient, UpdateFailureReason } from "../BaseAbstractClient";
5
+ import { AcrossConfigStoreClient } from "../AcrossConfigStoreClient";
6
+ import { HubPoolClient } from "../HubPoolClient";
7
+ export type SpokePoolUpdateSuccess = {
9
8
  success: true;
10
9
  currentTime: number;
11
10
  events: Log[][];
12
11
  searchEndBlock: number;
13
12
  };
14
- type SpokePoolUpdateFailure = {
13
+ export type SpokePoolUpdateFailure = {
15
14
  success: false;
16
15
  reason: UpdateFailureReason;
17
16
  };
18
17
  export type SpokePoolUpdate = SpokePoolUpdateSuccess | SpokePoolUpdateFailure;
18
+ export declare const knownEventNames: string[];
19
19
  /**
20
20
  * SpokePoolClient is a client for the SpokePool contract. It is responsible for querying the SpokePool contract
21
21
  * for events and storing them in memory. It also provides some convenience methods for querying the stored events.
22
22
  */
23
- export declare class SpokePoolClient extends BaseAbstractClient {
23
+ export declare abstract class SpokePoolClient extends BaseAbstractClient {
24
24
  readonly logger: winston.Logger;
25
- readonly spokePool: Contract;
26
25
  readonly hubPoolClient: HubPoolClient | null;
27
26
  readonly chainId: number;
28
27
  deploymentBlock: number;
@@ -52,7 +51,6 @@ export declare class SpokePoolClient extends BaseAbstractClient {
52
51
  protected tokensBridged: TokensBridged[];
53
52
  protected rootBundleRelays: RootBundleRelayWithBlock[];
54
53
  protected relayerRefundExecutions: RelayerRefundExecutionWithBlock[];
55
- protected queryableEventNames: string[];
56
54
  protected configStoreClient: AcrossConfigStoreClient | undefined;
57
55
  protected invalidFills: Set<string>;
58
56
  fills: {
@@ -61,16 +59,12 @@ export declare class SpokePoolClient extends BaseAbstractClient {
61
59
  /**
62
60
  * Creates a new SpokePoolClient.
63
61
  * @param logger A logger instance.
64
- * @param spokePool The SpokePool contract instance that this client will query.
65
62
  * @param hubPoolClient An optional HubPoolClient instance. This is used to fetch spoke data that is not stored on the SpokePool contract but is stored on the HubPool contract.
66
63
  * @param chainId The chain ID of the chain that this client is querying.
67
64
  * @param deploymentBlock The block number that the SpokePool contract was deployed at.
68
65
  * @param eventSearchConfig An optional EventSearchConfig object that controls how far back in history the client will search for events. If not provided, the client will only search for events from the deployment block.
69
66
  */
70
- constructor(logger: winston.Logger, spokePool: Contract, hubPoolClient: HubPoolClient | null, chainId: number, deploymentBlock: number, eventSearchConfig?: MakeOptional<EventSearchConfig, "toBlock">);
71
- _queryableEventNames(): {
72
- [eventName: string]: EventFilter;
73
- };
67
+ protected constructor(logger: winston.Logger, hubPoolClient: HubPoolClient | null, chainId: number, deploymentBlock: number, eventSearchConfig?: MakeOptional<EventSearchConfig, "toBlock">);
74
68
  /**
75
69
  * Retrieves a list of unique deposits from the SpokePool contract destined for the given destination chain ID.
76
70
  * @param destinationChainId The destination chain ID.
@@ -224,27 +218,6 @@ export declare class SpokePoolClient extends BaseAbstractClient {
224
218
  depositId: BigNumber;
225
219
  originChainId: number;
226
220
  }): string;
227
- /**
228
- * @notice Return maximum of fill deadline buffer at start and end of block range. This is a contract
229
- * immutable state variable so we can't query other events to find its updates.
230
- * @dev V3 deposits have a fill deadline which can be set to a maximum of fillDeadlineBuffer + deposit.block.timestamp.
231
- * Therefore, we cannot evaluate a block range for expired deposits if the spoke pool client doesn't return us
232
- * deposits whose block.timestamp is within fillDeadlineBuffer of the end block time. As a conservative check,
233
- * we verify that the time between the end block timestamp and the first timestamp queried by the
234
- * spoke pool client is greater than the maximum of the fill deadline buffers at the start and end of the block
235
- * range. We assume the fill deadline buffer wasn't changed more than once within a bundle.
236
- * @param startBlock start block
237
- * @param endBlock end block
238
- * @returns maximum of fill deadline buffer at start and end block
239
- */
240
- getMaxFillDeadlineInRange(startBlock: number, endBlock: number): Promise<number>;
241
- /**
242
- * Performs an update to refresh the state of this client. This will query the SpokePool contract for new events
243
- * and store them in memory. This method is the primary method for updating the state of this client.
244
- * @param eventsToQuery An optional list of events to query. If not provided, all events will be queried.
245
- * @returns A Promise that resolves to a SpokePoolUpdate object.
246
- */
247
- protected _update(eventsToQuery: string[]): Promise<SpokePoolUpdate>;
248
221
  /**
249
222
  * A wrapper over the `_update` method that handles errors and logs. This method additionally calls into the
250
223
  * HubPoolClient to update the state of this client with data from the HubPool contract.
@@ -286,18 +259,6 @@ export declare class SpokePoolClient extends BaseAbstractClient {
286
259
  * @returns The current time, which will be 0 if there has been no update() yet.
287
260
  */
288
261
  getCurrentTime(): number;
289
- /**
290
- * Retrieves the time from the SpokePool contract at a particular block.
291
- * @returns The time at the specified block tag.
292
- */
293
- getTimeAt(blockNumber: number): Promise<number>;
294
- /**
295
- * For a given origin chain depositId, resolve the corresponding Deposit.
296
- * Note: This method can only be used for depositIds within the non-deterministic range (0 < depositId < 2^32 - 1).
297
- * @param depositId Deposit ID of the deposit to resolve.
298
- * @returns A DepositSearchResult instance.
299
- */
300
- findDeposit(depositId: BigNumber): Promise<DepositSearchResult>;
301
262
  /**
302
263
  * Determines whether a deposit originates from a lite chain.
303
264
  * @param deposit The deposit to evaluate.
@@ -312,14 +273,54 @@ export declare class SpokePoolClient extends BaseAbstractClient {
312
273
  * this method will return false.
313
274
  */
314
275
  protected isDestinationLiteChain(deposit: DepositWithBlock): boolean;
315
- getTimestampForBlock(blockTag: number): Promise<number>;
316
276
  /**
317
- * Find the amount filled for a deposit at a particular block.
318
- * @param relayData Deposit information that is used to complete a fill.
319
- * @param blockTag Block tag (numeric or "latest") to query at.
320
- * @returns The amount filled for the specified deposit at the requested block (or latest).
277
+ * Returns a list of event names that are queryable for the SpokePoolClient.
278
+ * @returns A list of event names that are queryable for the SpokePoolClient.
279
+ */
280
+ abstract _queryableEventNames(): string[];
281
+ /**
282
+ * Performs an update to refresh the state of this client. This will query the SpokePool contract for new events
283
+ * and store them in memory. This method is the primary method for updating the state of this client.
284
+ * @param eventsToQuery An optional list of events to query. If not provided, all events will be queried.
285
+ * @returns A Promise that resolves to a SpokePoolUpdate object.
286
+ */
287
+ protected abstract _update(eventsToQuery: string[]): Promise<SpokePoolUpdate>;
288
+ /**
289
+ * @notice Return maximum of fill deadline buffer at start and end of block range. This is a contract
290
+ * immutable state variable so we can't query other events to find its updates.
291
+ * @dev V3 deposits have a fill deadline which can be set to a maximum of fillDeadlineBuffer + deposit.block.timestamp.
292
+ * Therefore, we cannot evaluate a block range for expired deposits if the spoke pool client doesn't return us
293
+ * deposits whose block.timestamp is within fillDeadlineBuffer of the end block time. As a conservative check,
294
+ * we verify that the time between the end block timestamp and the first timestamp queried by the
295
+ * spoke pool client is greater than the maximum of the fill deadline buffers at the start and end of the block
296
+ * range. We assume the fill deadline buffer wasn't changed more than once within a bundle.
297
+ * @param startBlock start block
298
+ * @param endBlock end block
299
+ * @returns maximum of fill deadline buffer at start and end block
300
+ */
301
+ abstract getMaxFillDeadlineInRange(startBlock: number, endBlock: number): Promise<number>;
302
+ /**
303
+ * Retrieves the timestamp for a given block number.
304
+ * @param blockTag The block number to retrieve the timestamp for.
305
+ * @returns The timestamp for the given block number.
306
+ */
307
+ abstract getTimestampForBlock(blockTag: number): Promise<number>;
308
+ /**
309
+ * Retrieves the time from the SpokePool contract at a particular block.
310
+ * @returns The time at the specified block tag.
311
+ */
312
+ abstract getTimeAt(blockNumber: number): Promise<number>;
313
+ /**
314
+ * For a given origin chain depositId, resolve the corresponding Deposit.
315
+ * Note: This method can only be used for depositIds within the non-deterministic range (0 < depositId < 2^32 - 1).
316
+ * @param depositId Deposit ID of the deposit to resolve.
317
+ * @returns A DepositSearchResult instance.
318
+ */
319
+ abstract findDeposit(depositId: BigNumber): Promise<DepositSearchResult>;
320
+ /**
321
+ * Retrieves the fill status for a given relay data.
322
+ * @param relayData The relay data to retrieve the fill status for.
323
+ * @returns The fill status for the given relay data.
321
324
  */
322
- relayFillStatus(relayData: RelayData, blockTag?: number | "latest", destinationChainId?: number): Promise<FillStatus>;
325
+ abstract relayFillStatus(relayData: RelayData, blockTag?: number | "latest", destinationChainId?: number): Promise<FillStatus>;
323
326
  }
324
- export {};
325
- //# sourceMappingURL=SpokePoolClient.d.ts.map
@@ -1,11 +1,23 @@
1
- import { __assign, __awaiter, __extends, __generator, __spreadArray } from "tslib";
2
- import { BigNumber, bnZero, MAX_BIG_INT, assign, getRelayEventKey, InvalidFill, isDefined, toBN, getMessageHash, isSlowFill, isValidEvmAddress, isZeroAddress, toAddress, validateFillForDeposit, } from "../utils";
3
- import { duplicateEvent, paginatedEventQuery, sortEventsAscendingInPlace, spreadEvent, spreadEventWithBlockNumber, } from "../utils/EventUtils";
4
- import { ZERO_ADDRESS } from "../constants";
5
- import { getNetworkName } from "../utils/NetworkUtils";
6
- import { findDepositBlock, getMaxFillDeadlineInRange as getMaxFillDeadline, getTimeAt as _getTimeAt, getTimestampForBlock as _getTimestampForBlock, relayFillStatus, } from "../utils/SpokeUtils";
7
- import { BaseAbstractClient, isUpdateFailureReason } from "./BaseAbstractClient";
8
- import { getRepaymentChainId, forceDestinationRepayment } from "./BundleDataClient/utils/FillUtils";
1
+ import { __assign, __awaiter, __extends, __generator } from "tslib";
2
+ import { bnZero, MAX_BIG_INT, assign, getRelayEventKey, isDefined, getMessageHash, isSlowFill, isValidEvmAddress, isZeroAddress, toAddress, validateFillForDeposit, } from "../../utils";
3
+ import { duplicateEvent, sortEventsAscendingInPlace, spreadEvent, spreadEventWithBlockNumber, } from "../../utils/EventUtils";
4
+ import { ZERO_ADDRESS } from "../../constants";
5
+ import { BaseAbstractClient } from "../BaseAbstractClient";
6
+ import { getRepaymentChainId, forceDestinationRepayment } from "../BundleDataClient";
7
+ export var knownEventNames = [
8
+ "EnabledDepositRoute",
9
+ "TokensBridged",
10
+ "RelayedRootBundle",
11
+ "ExecutedRelayerRefundRoot",
12
+ "V3FundsDeposited",
13
+ "FundsDeposited",
14
+ "RequestedSpeedUpV3Deposit",
15
+ "RequestedSpeedUpDeposit",
16
+ "RequestedV3SlowFill",
17
+ "RequestedSlowFill",
18
+ "FilledV3Relay",
19
+ "FilledRelay",
20
+ ];
9
21
  /**
10
22
  * SpokePoolClient is a client for the SpokePool contract. It is responsible for querying the SpokePool contract
11
23
  * for events and storing them in memory. It also provides some convenience methods for querying the stored events.
@@ -15,19 +27,17 @@ var SpokePoolClient = /** @class */ (function (_super) {
15
27
  /**
16
28
  * Creates a new SpokePoolClient.
17
29
  * @param logger A logger instance.
18
- * @param spokePool The SpokePool contract instance that this client will query.
19
30
  * @param hubPoolClient An optional HubPoolClient instance. This is used to fetch spoke data that is not stored on the SpokePool contract but is stored on the HubPool contract.
20
31
  * @param chainId The chain ID of the chain that this client is querying.
21
32
  * @param deploymentBlock The block number that the SpokePool contract was deployed at.
22
33
  * @param eventSearchConfig An optional EventSearchConfig object that controls how far back in history the client will search for events. If not provided, the client will only search for events from the deployment block.
23
34
  */
24
- function SpokePoolClient(logger, spokePool,
35
+ function SpokePoolClient(logger,
25
36
  // Can be excluded. This disables some deposit validation.
26
37
  hubPoolClient, chainId, deploymentBlock, eventSearchConfig) {
27
38
  if (eventSearchConfig === void 0) { eventSearchConfig = { fromBlock: 0, maxBlockLookBack: 0 }; }
28
39
  var _this = _super.call(this, eventSearchConfig) || this;
29
40
  _this.logger = logger;
30
- _this.spokePool = spokePool;
31
41
  _this.hubPoolClient = hubPoolClient;
32
42
  _this.chainId = chainId;
33
43
  _this.deploymentBlock = deploymentBlock;
@@ -41,41 +51,13 @@ var SpokePoolClient = /** @class */ (function (_super) {
41
51
  _this.tokensBridged = [];
42
52
  _this.rootBundleRelays = [];
43
53
  _this.relayerRefundExecutions = [];
44
- _this.queryableEventNames = [];
45
54
  _this.invalidFills = new Set();
46
55
  _this.fills = {};
47
56
  _this.firstBlockToSearch = eventSearchConfig.fromBlock;
48
57
  _this.latestBlockSearched = 0;
49
- _this.queryableEventNames = Object.keys(_this._queryableEventNames());
50
58
  _this.configStoreClient = hubPoolClient === null || hubPoolClient === void 0 ? void 0 : hubPoolClient.configStoreClient;
51
59
  return _this;
52
60
  }
53
- SpokePoolClient.prototype._queryableEventNames = function () {
54
- var _this = this;
55
- var knownEventNames = [
56
- "EnabledDepositRoute",
57
- "TokensBridged",
58
- "RelayedRootBundle",
59
- "ExecutedRelayerRefundRoot",
60
- "V3FundsDeposited",
61
- "FundsDeposited",
62
- "RequestedSpeedUpV3Deposit",
63
- "RequestedSpeedUpDeposit",
64
- "RequestedV3SlowFill",
65
- "RequestedSlowFill",
66
- "FilledV3Relay",
67
- "FilledRelay",
68
- ];
69
- return Object.fromEntries(this.spokePool.interface.fragments
70
- .filter(function (_a) {
71
- var name = _a.name, type = _a.type;
72
- return type === "event" && knownEventNames.includes(name);
73
- })
74
- .map(function (_a) {
75
- var name = _a.name;
76
- return [name, _this.spokePool.filters[name]()];
77
- }));
78
- };
79
61
  /**
80
62
  * Retrieves a list of unique deposits from the SpokePool contract destined for the given destination chain ID.
81
63
  * @param destinationChainId The destination chain ID.
@@ -370,90 +352,6 @@ var SpokePoolClient = /** @class */ (function (_super) {
370
352
  SpokePoolClient.prototype.getDepositHash = function (event) {
371
353
  return "".concat(event.depositId.toString(), "-").concat(event.originChainId);
372
354
  };
373
- /**
374
- * @notice Return maximum of fill deadline buffer at start and end of block range. This is a contract
375
- * immutable state variable so we can't query other events to find its updates.
376
- * @dev V3 deposits have a fill deadline which can be set to a maximum of fillDeadlineBuffer + deposit.block.timestamp.
377
- * Therefore, we cannot evaluate a block range for expired deposits if the spoke pool client doesn't return us
378
- * deposits whose block.timestamp is within fillDeadlineBuffer of the end block time. As a conservative check,
379
- * we verify that the time between the end block timestamp and the first timestamp queried by the
380
- * spoke pool client is greater than the maximum of the fill deadline buffers at the start and end of the block
381
- * range. We assume the fill deadline buffer wasn't changed more than once within a bundle.
382
- * @param startBlock start block
383
- * @param endBlock end block
384
- * @returns maximum of fill deadline buffer at start and end block
385
- */
386
- SpokePoolClient.prototype.getMaxFillDeadlineInRange = function (startBlock, endBlock) {
387
- return getMaxFillDeadline(this.spokePool, startBlock, endBlock);
388
- };
389
- /**
390
- * Performs an update to refresh the state of this client. This will query the SpokePool contract for new events
391
- * and store them in memory. This method is the primary method for updating the state of this client.
392
- * @param eventsToQuery An optional list of events to query. If not provided, all events will be queried.
393
- * @returns A Promise that resolves to a SpokePoolUpdate object.
394
- */
395
- SpokePoolClient.prototype._update = function (eventsToQuery) {
396
- return __awaiter(this, void 0, void 0, function () {
397
- var searchConfig, reason, eventSearchConfigs, spokePool, timerStart, multicallFunctions, _a, multicallOutput, events, currentTime, errMsg;
398
- var _this = this;
399
- return __generator(this, function (_b) {
400
- switch (_b.label) {
401
- case 0: return [4 /*yield*/, this.updateSearchConfig(this.spokePool.provider)];
402
- case 1:
403
- searchConfig = _b.sent();
404
- if (isUpdateFailureReason(searchConfig)) {
405
- reason = searchConfig;
406
- return [2 /*return*/, { success: false, reason: reason }];
407
- }
408
- eventSearchConfigs = eventsToQuery.map(function (eventName) {
409
- if (!_this.queryableEventNames.includes(eventName)) {
410
- throw new Error("SpokePoolClient: Cannot query unrecognised SpokePool event name: ".concat(eventName));
411
- }
412
- var _searchConfig = __assign({}, searchConfig); // shallow copy
413
- // By default, an event's query range is controlled by the `eventSearchConfig` passed in during instantiation.
414
- // However, certain events have special overriding requirements to their search ranges:
415
- // - EnabledDepositRoute: The full history is always required, so override the requested fromBlock.
416
- if (eventName === "EnabledDepositRoute" && !_this.isUpdated) {
417
- _searchConfig.fromBlock = _this.deploymentBlock;
418
- }
419
- return {
420
- filter: _this._queryableEventNames()[eventName],
421
- searchConfig: _searchConfig,
422
- };
423
- });
424
- spokePool = this.spokePool;
425
- this.log("debug", "Updating SpokePool client for chain ".concat(this.chainId), {
426
- eventsToQuery: eventsToQuery,
427
- searchConfig: searchConfig,
428
- spokePool: spokePool.address,
429
- });
430
- timerStart = Date.now();
431
- multicallFunctions = ["getCurrentTime"];
432
- return [4 /*yield*/, Promise.all(__spreadArray([
433
- spokePool.callStatic.multicall(multicallFunctions.map(function (f) { return spokePool.interface.encodeFunctionData(f); }), { blockTag: searchConfig.toBlock })
434
- ], eventSearchConfigs.map(function (config) { return paginatedEventQuery(_this.spokePool, config.filter, config.searchConfig); }), true))];
435
- case 2:
436
- _a = _b.sent(), multicallOutput = _a[0], events = _a.slice(1);
437
- this.log("debug", "Time to query new events from RPC for ".concat(this.chainId, ": ").concat(Date.now() - timerStart, " ms"));
438
- currentTime = multicallFunctions.map(function (fn, idx) { return spokePool.interface.decodeFunctionResult(fn, multicallOutput[idx])[0]; })[0];
439
- if (!BigNumber.isBigNumber(currentTime) || currentTime.lt(this.currentTime)) {
440
- errMsg = BigNumber.isBigNumber(currentTime)
441
- ? "currentTime: ".concat(currentTime, " < ").concat(toBN(this.currentTime))
442
- : "currentTime is not a BigNumber: ".concat(JSON.stringify(currentTime));
443
- throw new Error("SpokePoolClient::update: ".concat(errMsg));
444
- }
445
- // Sort all events to ensure they are stored in a consistent order.
446
- events.forEach(function (events) { return sortEventsAscendingInPlace(events); });
447
- return [2 /*return*/, {
448
- success: true,
449
- currentTime: currentTime.toNumber(),
450
- searchEndBlock: searchConfig.toBlock,
451
- events: events,
452
- }];
453
- }
454
- });
455
- });
456
- };
457
355
  /**
458
356
  * A wrapper over the `_update` method that handles errors and logs. This method additionally calls into the
459
357
  * HubPoolClient to update the state of this client with data from the HubPool contract.
@@ -463,7 +361,7 @@ var SpokePoolClient = /** @class */ (function (_super) {
463
361
  * @see _update
464
362
  */
465
363
  SpokePoolClient.prototype.update = function (eventsToQuery) {
466
- if (eventsToQuery === void 0) { eventsToQuery = this.queryableEventNames; }
364
+ if (eventsToQuery === void 0) { eventsToQuery = this._queryableEventNames(); }
467
365
  return __awaiter(this, void 0, void 0, function () {
468
366
  var duplicateEvents, update, queryResults, currentTime, searchEndBlock, _i, _a, event_1, queryDepositEvents, _b, _c, event_2, querySpeedUpDepositEvents, queryRequestedSlowFillEvents, queryFilledRelayEvents, enableDepositsEvents, _d, enableDepositsEvents_1, event_3, enableDeposit, relayedRootBundleEvents, _e, relayedRootBundleEvents_1, event_4, refundEvents, _f, refundEvents_1, event_5, executedRefund;
469
367
  var _this = this;
@@ -722,82 +620,6 @@ var SpokePoolClient = /** @class */ (function (_super) {
722
620
  SpokePoolClient.prototype.getCurrentTime = function () {
723
621
  return this.currentTime;
724
622
  };
725
- /**
726
- * Retrieves the time from the SpokePool contract at a particular block.
727
- * @returns The time at the specified block tag.
728
- */
729
- SpokePoolClient.prototype.getTimeAt = function (blockNumber) {
730
- return _getTimeAt(this.spokePool, blockNumber);
731
- };
732
- /**
733
- * For a given origin chain depositId, resolve the corresponding Deposit.
734
- * Note: This method can only be used for depositIds within the non-deterministic range (0 < depositId < 2^32 - 1).
735
- * @param depositId Deposit ID of the deposit to resolve.
736
- * @returns A DepositSearchResult instance.
737
- */
738
- SpokePoolClient.prototype.findDeposit = function (depositId) {
739
- return __awaiter(this, void 0, void 0, function () {
740
- var deposit, upperBound, fromBlock, chain, reason, toBlock, tStart, maxBlockLookBack, query, tStop, event, _a;
741
- var _b;
742
- return __generator(this, function (_c) {
743
- switch (_c.label) {
744
- case 0:
745
- deposit = this.getDeposit(depositId);
746
- if (deposit) {
747
- return [2 /*return*/, { found: true, deposit: deposit }];
748
- }
749
- upperBound = this.latestBlockSearched || undefined;
750
- return [4 /*yield*/, findDepositBlock(this.spokePool, depositId, this.deploymentBlock, upperBound)];
751
- case 1:
752
- fromBlock = _c.sent();
753
- chain = getNetworkName(this.chainId);
754
- if (!fromBlock) {
755
- reason = "Unable to find ".concat(chain, " depositId ").concat(depositId) +
756
- " within blocks [".concat(this.deploymentBlock, ", ").concat(upperBound !== null && upperBound !== void 0 ? upperBound : "latest", "].");
757
- return [2 /*return*/, { found: false, code: InvalidFill.DepositIdNotFound, reason: reason }];
758
- }
759
- toBlock = fromBlock;
760
- tStart = Date.now();
761
- maxBlockLookBack = this.eventSearchConfig.maxBlockLookBack;
762
- return [4 /*yield*/, Promise.all([
763
- paginatedEventQuery(this.spokePool, this.spokePool.filters.V3FundsDeposited(null, null, null, null, null, depositId), { fromBlock: fromBlock, toBlock: toBlock, maxBlockLookBack: maxBlockLookBack }),
764
- paginatedEventQuery(this.spokePool, this.spokePool.filters.FundsDeposited(null, null, null, null, null, depositId), { fromBlock: fromBlock, toBlock: toBlock, maxBlockLookBack: maxBlockLookBack }),
765
- ])];
766
- case 2:
767
- query = (_c.sent()).flat();
768
- tStop = Date.now();
769
- event = query.find(function (_a) {
770
- var args = _a.args;
771
- return args["depositId"].eq(depositId);
772
- });
773
- if (event === undefined) {
774
- return [2 /*return*/, {
775
- found: false,
776
- code: InvalidFill.DepositIdNotFound,
777
- reason: "".concat(chain, " depositId ").concat(depositId, " not found at block ").concat(fromBlock, "."),
778
- }];
779
- }
780
- _a = [__assign({}, spreadEventWithBlockNumber(event))];
781
- _b = { originChainId: this.chainId };
782
- return [4 /*yield*/, this.getBlockNumber(Number(event.args["quoteTimestamp"]))];
783
- case 3:
784
- deposit = __assign.apply(void 0, _a.concat([(_b.quoteBlockNumber = _c.sent(), _b.fromLiteChain = true, _b.toLiteChain = true, _b)]));
785
- if (isZeroAddress(deposit.outputToken)) {
786
- deposit.outputToken = this.getDestinationTokenForDeposit(deposit);
787
- }
788
- deposit.fromLiteChain = this.isOriginLiteChain(deposit);
789
- deposit.toLiteChain = this.isDestinationLiteChain(deposit);
790
- this.logger.debug({
791
- at: "SpokePoolClient#findDeposit",
792
- message: "Located V3 deposit outside of SpokePoolClient's search range",
793
- deposit: deposit,
794
- elapsedMs: tStop - tStart,
795
- });
796
- return [2 /*return*/, { found: true, deposit: deposit }];
797
- }
798
- });
799
- });
800
- };
801
623
  /**
802
624
  * Determines whether a deposit originates from a lite chain.
803
625
  * @param deposit The deposit to evaluate.
@@ -818,18 +640,6 @@ var SpokePoolClient = /** @class */ (function (_super) {
818
640
  var _a, _b;
819
641
  return ((_b = (_a = this.configStoreClient) === null || _a === void 0 ? void 0 : _a.isChainLiteChainAtTimestamp(deposit.destinationChainId, deposit.quoteTimestamp)) !== null && _b !== void 0 ? _b : false);
820
642
  };
821
- SpokePoolClient.prototype.getTimestampForBlock = function (blockTag) {
822
- return _getTimestampForBlock(this.spokePool.provider, blockTag);
823
- };
824
- /**
825
- * Find the amount filled for a deposit at a particular block.
826
- * @param relayData Deposit information that is used to complete a fill.
827
- * @param blockTag Block tag (numeric or "latest") to query at.
828
- * @returns The amount filled for the specified deposit at the requested block (or latest).
829
- */
830
- SpokePoolClient.prototype.relayFillStatus = function (relayData, blockTag, destinationChainId) {
831
- return relayFillStatus(this.spokePool, relayData, blockTag, destinationChainId);
832
- };
833
643
  return SpokePoolClient;
834
644
  }(BaseAbstractClient));
835
645
  export { SpokePoolClient };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpokePoolClient.js","sourceRoot":"","sources":["../../../../src/clients/SpokePoolClient/SpokePoolClient.ts"],"names":[],"mappings":";AACA,OAAO,EAGL,MAAM,EAIN,WAAW,EAEX,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,WAAW,EACX,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAe/C,OAAO,EAAE,kBAAkB,EAAuB,MAAM,uBAAuB,CAAC;AAEhF,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAerF,MAAM,CAAC,IAAM,eAAe,GAAG;IAC7B,qBAAqB;IACrB,eAAe;IACf,mBAAmB;IACnB,2BAA2B;IAC3B,kBAAkB;IAClB,gBAAgB;IAChB,2BAA2B;IAC3B,yBAAyB;IACzB,qBAAqB;IACrB,mBAAmB;IACnB,eAAe;IACf,aAAa;CACd,CAAC;AAEF;;;GAGG;AACH;IAA8C,mCAAkB;IAe9D;;;;;;;OAOG;IACH,yBACW,MAAsB;IAC/B,0DAA0D;IACjD,aAAmC,EACnC,OAAe,EACjB,eAAuB,EAC9B,iBAAqG;QAArG,kCAAA,EAAA,sBAAkE,SAAS,EAAE,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE;QANvG,YAQE,kBAAM,iBAAiB,CAAC,SAIzB;QAXU,YAAM,GAAN,MAAM,CAAgB;QAEtB,mBAAa,GAAb,aAAa,CAAsB;QACnC,aAAO,GAAP,OAAO,CAAQ;QACjB,qBAAe,GAAf,eAAe,CAAQ;QA3BtB,iBAAW,GAAG,CAAC,CAAC;QACh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AO,EAAE,OAAO,SAAA,IAAK,IAAI,EAAG,CAAC;IACzF,CAAC;IAED;;;OAGG;IACI,wCAAc,GAArB;QACE,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;;;;OAKG;IACO,2CAAiB,GAA3B,UAA4B,OAAyB;;QACnD,OAAO,MAAA,MAAA,IAAI,CAAC,iBAAiB,0CAAE,2BAA2B,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,cAAc,CAAC,mCAAI,KAAK,CAAC;IACrH,CAAC;IAED;;;;;OAKG;IACO,gDAAsB,GAAhC,UAAiC,OAAyB;;QACxD,OAAO,CACL,MAAA,MAAA,IAAI,CAAC,iBAAiB,0CAAE,2BAA2B,CAAC,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,cAAc,CAAC,mCAAI,KAAK,CACjH,CAAC;IACJ,CAAC;IAkEH,sBAAC;AAAD,CAAC,AAtuBD,CAA8C,kBAAkB,GAsuB/D"}
@@ -0,0 +1,10 @@
1
+ import { EVMSpokePoolClient } from "./EVMSpokePoolClient";
2
+ import { SpokePoolClient } from "./SpokePoolClient";
3
+ export { EVMSpokePoolClient } from "./EVMSpokePoolClient";
4
+ export { SpokePoolClient, SpokePoolUpdate } from "./SpokePoolClient";
5
+ /**
6
+ * Checks if a SpokePoolClient is an EVMSpokePoolClient.
7
+ * @param spokePoolClient The SpokePoolClient to check.
8
+ * @returns True if the SpokePoolClient is an EVMSpokePoolClient, false otherwise.
9
+ */
10
+ export declare function isEVMSpokePoolClient(spokePoolClient: SpokePoolClient): spokePoolClient is EVMSpokePoolClient;
@@ -0,0 +1,12 @@
1
+ import { EVMSpokePoolClient } from "./EVMSpokePoolClient";
2
+ export { EVMSpokePoolClient } from "./EVMSpokePoolClient";
3
+ export { SpokePoolClient } from "./SpokePoolClient";
4
+ /**
5
+ * Checks if a SpokePoolClient is an EVMSpokePoolClient.
6
+ * @param spokePoolClient The SpokePoolClient to check.
7
+ * @returns True if the SpokePoolClient is an EVMSpokePoolClient, false otherwise.
8
+ */
9
+ export function isEVMSpokePoolClient(spokePoolClient) {
10
+ return spokePoolClient instanceof EVMSpokePoolClient;
11
+ }
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/clients/SpokePoolClient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAmB,MAAM,mBAAmB,CAAC;AAErE;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,eAAgC;IACnE,OAAO,eAAe,YAAY,kBAAkB,CAAC;AACvD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export { DEFAULT_CONFIG_STORE_VERSION, GLOBAL_CONFIG_STORE_KEYS, AcrossConfigStoreClient, ConfigStoreUpdate, } from "./AcrossConfigStoreClient";
2
2
  export { UpdateFailureReason } from "./BaseAbstractClient";
3
3
  export { HubPoolClient, LpFeeRequest } from "./HubPoolClient";
4
- export { SpokePoolClient, SpokePoolUpdate } from "./SpokePoolClient";
4
+ export { SpokePoolClient, SpokePoolUpdate, EVMSpokePoolClient } from "./SpokePoolClient";
5
5
  export * as BundleDataClient from "./BundleDataClient";
6
6
  export * as mocks from "./mocks";
@@ -1,7 +1,7 @@
1
1
  export { DEFAULT_CONFIG_STORE_VERSION, GLOBAL_CONFIG_STORE_KEYS, AcrossConfigStoreClient, } from "./AcrossConfigStoreClient";
2
2
  export { UpdateFailureReason } from "./BaseAbstractClient";
3
3
  export { HubPoolClient } from "./HubPoolClient";
4
- export { SpokePoolClient } from "./SpokePoolClient";
4
+ export { SpokePoolClient, EVMSpokePoolClient } from "./SpokePoolClient";
5
5
  import * as BundleDataClient_1 from "./BundleDataClient";
6
6
  export { BundleDataClient_1 as BundleDataClient };
7
7
  import * as mocks_1 from "./mocks";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/clients/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,uBAAuB,GAExB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAmB,MAAM,mBAAmB,CAAC;oCACnC,oBAAoB;+BAA1C,gBAAgB;yBACL,SAAS;oBAApB,KAAK"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/clients/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,uBAAuB,GAExB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAmB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;oCACvD,oBAAoB;+BAA1C,gBAAgB;yBACL,SAAS;oBAApB,KAAK"}
@@ -2,11 +2,11 @@ import { Contract } from "ethers";
2
2
  import winston from "winston";
3
3
  import { Log, Deposit, DepositWithBlock, RelayerRefundExecution, SlowFillRequest, SortableEvent, Fill, SlowFillLeaf, SpeedUp, TokensBridged } from "../../interfaces";
4
4
  import { BigNumber } from "../../utils";
5
- import { SpokePoolClient, SpokePoolUpdate } from "../SpokePoolClient";
5
+ import { EVMSpokePoolClient, SpokePoolUpdate } from "../SpokePoolClient";
6
6
  import { HubPoolClient } from "../HubPoolClient";
7
7
  import { EventManager, EventOverrides } from "./MockEvents";
8
8
  import { AcrossConfigStoreClient } from "../AcrossConfigStoreClient";
9
- export declare class MockSpokePoolClient extends SpokePoolClient {
9
+ export declare class MockSpokePoolClient extends EVMSpokePoolClient {
10
10
  eventManager: EventManager;
11
11
  private destinationTokenForChainOverride;
12
12
  depositIdAtBlock: BigNumber[];
@@ -4,7 +4,7 @@ import { random } from "lodash";
4
4
  import { EMPTY_MESSAGE, ZERO_ADDRESS } from "../../constants";
5
5
  import { FillType, } from "../../interfaces";
6
6
  import { toBN, toBNWei, getCurrentTime, getMessageHash, randomAddress, BigNumber, bnZero, bnOne, toAddress, toBytes32, } from "../../utils";
7
- import { SpokePoolClient } from "../SpokePoolClient";
7
+ import { EVMSpokePoolClient } from "../SpokePoolClient";
8
8
  import { getEventManager } from "./MockEvents";
9
9
  // This class replaces internal SpokePoolClient functionality, enabling
10
10
  // the user to bypass on-chain queries and inject Log objects directly.
@@ -290,6 +290,6 @@ var MockSpokePoolClient = /** @class */ (function (_super) {
290
290
  });
291
291
  };
292
292
  return MockSpokePoolClient;
293
- }(SpokePoolClient));
293
+ }(EVMSpokePoolClient));
294
294
  export { MockSpokePoolClient };
295
295
  //# sourceMappingURL=MockSpokePoolClient.js.map