Skip to content

Commit

Permalink
chore: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
james-a-morris committed Jan 16, 2024
2 parents 66829e6 + 674de8c commit e9c1484
Show file tree
Hide file tree
Showing 50 changed files with 887 additions and 1,417 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@across-protocol/sdk-v2",
"author": "UMA Team",
"version": "0.17.17",
"version": "0.20.1",
"license": "AGPL-3.0",
"homepage": "https://docs.across.to/v/developer-docs/developers/across-sdk",
"files": [
Expand Down Expand Up @@ -97,7 +97,7 @@
},
"dependencies": {
"@across-protocol/across-token": "^1.0.0",
"@across-protocol/constants-v2": "^1.0.7",
"@across-protocol/constants-v2": "^1.0.8",
"@across-protocol/contracts-v2": "^2.4.7",
"@eth-optimism/sdk": "^2.1.0",
"@pinata/sdk": "^2.1.0",
Expand Down
9 changes: 4 additions & 5 deletions src/apiClient/abstractClient.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ethers } from "ethers";
import { ChainId } from "../transfers-history/adapters/web3/model";
import {
CoingeckoDataReturnType,
SuggestedFeeReturnType,
Expand Down Expand Up @@ -67,8 +66,8 @@ export default abstract class AbstractApiClient {
public abstract getSuggestedFees(
amount: ethers.BigNumber,
originToken: string,
toChainid: ChainId,
fromChainid: ChainId
toChainid: number,
fromChainid: number
): Promise<SuggestedFeeReturnType>;

/**
Expand All @@ -83,8 +82,8 @@ export default abstract class AbstractApiClient {
*/
public abstract getBridgeLimits(
token: string,
fromChainId: string | ChainId,
toChainId: string | ChainId
fromnumber: string | number,
tonumber: string | number
): Promise<BridgeLimitsReturnType>;

/**
Expand Down
11 changes: 5 additions & 6 deletions src/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
public cumulativeDisabledChainUpdates: DisabledChainsUpdate[] = [];

protected rateModelDictionary: across.rateModel.RateModelDictionary;
public firstBlockToSearch: number;
public latestBlockNumber = 0;

public hasLatestConfigStoreVersion = false;
public chainId: number | undefined;
Expand All @@ -89,6 +87,7 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
) {
super();
this.firstBlockToSearch = eventSearchConfig.fromBlock;
this.latestBlockSearched = 0;
this.rateModelDictionary = new across.rateModel.RateModelDictionary();
}

Expand Down Expand Up @@ -519,7 +518,7 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
this.rateModelDictionary.updateWithEvents(this.cumulativeRateModelUpdates);

this.hasLatestConfigStoreVersion = this.hasValidConfigStoreVersionForTimestamp();
this.latestBlockNumber = result.searchEndBlock;
this.latestBlockSearched = result.searchEndBlock;
this.firstBlockToSearch = result.searchEndBlock + 1; // Next iteration should start off from where this one ended.
this.chainId = this.chainId ?? chainId; // Update on the first run only.
this.isUpdated = true;
Expand Down Expand Up @@ -576,7 +575,7 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
cumulativeDisabledChainUpdates = this.cumulativeDisabledChainUpdates,
firstBlockToSearch = this.firstBlockToSearch,
hasLatestConfigStoreVersion = this.hasLatestConfigStoreVersion,
latestBlockNumber = this.latestBlockNumber,
latestBlockSearched = this.latestBlockSearched,
ubaConfigUpdates,
cumulativeSpokeTargetBalanceUpdates,
} = configStoreClientState;
Expand Down Expand Up @@ -611,7 +610,7 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
this.cumulativeDisabledChainUpdates = cumulativeDisabledChainUpdates;
this.firstBlockToSearch = firstBlockToSearch;
this.hasLatestConfigStoreVersion = hasLatestConfigStoreVersion;
this.latestBlockNumber = latestBlockNumber;
this.latestBlockSearched = latestBlockSearched;
this.rateModelDictionary.updateWithEvents(cumulativeRateModelUpdates);
this.isUpdated = true;
}
Expand All @@ -634,7 +633,7 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
cumulativeConfigStoreVersionUpdates: this.cumulativeConfigStoreVersionUpdates,
cumulativeDisabledChainUpdates: this.cumulativeDisabledChainUpdates,
firstBlockToSearch: this.firstBlockToSearch,
latestBlockNumber: this.latestBlockNumber,
latestBlockSearched: this.latestBlockSearched,
hasLatestConfigStoreVersion: this.hasLatestConfigStoreVersion,
};
}
Expand Down
2 changes: 2 additions & 0 deletions src/clients/BaseAbstractClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { isDefined } from "../utils";
*/
export abstract class BaseAbstractClient {
protected _isUpdated: boolean;
public firstBlockToSearch = 0;
public latestBlockSearched = 0;

/**
* Creates a new client.
Expand Down
Loading

0 comments on commit e9c1484

Please sign in to comment.