diff --git a/package.json b/package.json index 6adc640e8..f71263a32 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@across-protocol/sdk", "author": "UMA Team", - "version": "4.3.74", + "version": "4.3.75", "license": "AGPL-3.0", "homepage": "https://docs.across.to/reference/sdk", "files": [ diff --git a/src/clients/SpokePoolClient/SpokePoolClientManager.ts b/src/clients/SpokePoolClient/SpokePoolClientManager.ts index 2559e1aeb..c09abcf7e 100644 --- a/src/clients/SpokePoolClient/SpokePoolClientManager.ts +++ b/src/clients/SpokePoolClient/SpokePoolClientManager.ts @@ -1,5 +1,6 @@ import winston from "winston"; import { SpokePoolClient } from "./SpokePoolClient"; +import { Address } from "../../utils"; /** * SpokePoolClientManager is a wrapper around spokePoolClients. We want to use wrapper almost always @@ -33,4 +34,24 @@ export class SpokePoolManager { getSpokePoolClients(): { [chainId: number]: SpokePoolClient } { return this.spokePoolClients; } + + /** + * Retrieves all SpokePoolClient Addresses mapped by chainId + * @returns { [chainId: number]: Address | undefined } + * @note This method returns all SpokePoolClient Addresses mapped by their chainId. + */ + getSpokePoolAddresses(): { [chainId: number]: Address | undefined } { + return Object.fromEntries( + Object.entries(this.spokePoolClients).map(([chainId, client]) => [chainId, client.spokePoolAddress]) + ); + } + + /** + * Retrieves all SpokePoolClient chainIds + * @returns number[] + * @note This method returns all SpokePoolClient chainIds. + */ + getChainIds(): number[] { + return Object.values(this.spokePoolClients).map((client) => client.chainId); + } }