Skip to content

Commit

Permalink
feat(SpokePoolClient): include speed ups tx info (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
melisaguevara committed Sep 4, 2024
1 parent 9937642 commit 896ac38
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@across-protocol/sdk",
"author": "UMA Team",
"version": "3.1.29",
"version": "3.1.30",
"license": "AGPL-3.0",
"homepage": "https://docs.across.to/reference/sdk",
"files": [
Expand Down
9 changes: 5 additions & 4 deletions src/clients/SpokePoolClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
RelayerRefundExecutionWithBlock,
RootBundleRelayWithBlock,
SlowFillRequestWithBlock,
SpeedUp,
SpeedUpWithBlock,
TokensBridged,
V3FundsDepositedEvent,
} from "../interfaces";
Expand Down Expand Up @@ -67,7 +67,7 @@ export class SpokePoolClient extends BaseAbstractClient {
protected oldestTime = 0;
protected depositHashes: { [depositHash: string]: DepositWithBlock } = {};
protected depositHashesToFills: { [depositHash: string]: FillWithBlock[] } = {};
protected speedUps: { [depositorAddress: string]: { [depositId: number]: SpeedUp[] } } = {};
protected speedUps: { [depositorAddress: string]: { [depositId: number]: SpeedUpWithBlock[] } } = {};
protected slowFillRequests: { [relayDataHash: string]: SlowFillRequestWithBlock } = {};
protected depositRoutes: { [originToken: string]: { [DestinationChainId: number]: boolean } } = {};
protected tokensBridged: TokensBridged[] = [];
Expand Down Expand Up @@ -296,7 +296,7 @@ export class SpokePoolClient extends BaseAbstractClient {
* Retrieves speed up requests grouped by depositor and depositId.
* @returns A mapping of depositor addresses to deposit ids with their corresponding speed up requests.
*/
public getSpeedUps(): { [depositorAddress: string]: { [depositId: number]: SpeedUp[] } } {
public getSpeedUps(): { [depositorAddress: string]: { [depositId: number]: SpeedUpWithBlock[] } } {
return this.speedUps;
}

Expand Down Expand Up @@ -592,7 +592,8 @@ export class SpokePoolClient extends BaseAbstractClient {
const speedUpEvents = [...(queryResults[eventsToQuery.indexOf("RequestedSpeedUpV3Deposit")] ?? [])];

for (const event of speedUpEvents) {
const speedUp: SpeedUp = { ...spreadEvent(event.args), originChainId: this.chainId };
const rawEvent = spreadEventWithBlockNumber(event);
const speedUp = { ...rawEvent, originChainId: this.chainId } as SpeedUpWithBlock;
assign(this.speedUps, [speedUp.depositor, speedUp.depositId], [speedUp]);

// Find deposit hash matching this speed up event and update the deposit data associated with the hash,
Expand Down
2 changes: 2 additions & 0 deletions src/interfaces/SpokePool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export interface SpeedUp {
updatedMessage: string;
}

export interface SpeedUpWithBlock extends SpeedUp, SortableEvent {}

export interface SlowFillRequest extends RelayData {
destinationChainId: number;
}
Expand Down

0 comments on commit 896ac38

Please sign in to comment.