Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@
"@types/jest": "^29.5.14",
"axios-mock-adapter": "^2.1.0",
"jest": "^29.7.0",
"msw": "^2.7.6",
"prettier": "^3.4.2",
"ts-jest": "^29.3.2",
"tsup": "^8.3.5",
"typescript": "^5.7.2",
"msw": "^2.7.6"
"viem": "^2.37.6"
}
}
141 changes: 141 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 40 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export class EnsoClient {
* );
*/
public async getBundleData(
params: BundleParams,
params: BundleParams & { skipQuote?: boolean },
actions: BundleAction[],
): Promise<BundleData> {
const url = "/shortcuts/bundle";
Expand Down Expand Up @@ -594,6 +594,45 @@ export class EnsoClient {
url,
});
}

/**
* Gets LayerZero pool address for a token.
*
* Returns the LayerZero Stargate pool address for a given token address and chain ID.
* Returns null if no pool exists for the token on that chain.
*
* @param {Object} params - Parameters for the pool lookup
* @param {number} params.chainId - Chain ID
* @param {string} params.token - Token address
* @returns {Promise<{poolAddress: string | null, chainId: number, token: string}>} Pool lookup result
* @throws {Error} If the API request fails
*
* @example
* const poolInfo = await client.getLayerZeroPool({
* chainId: 1,
* token: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
* });
*/
public async getLayerZeroPool(params: {
chainId: number;
token: string;
}): Promise<{
poolAddress: string | null;
chainId: number;
token: string;
}> {
const url = "/layerzero/pool";

return this.request<{
poolAddress: string | null;
chainId: number;
token: string;
}>({
method: "GET",
url,
params,
});
}
}

// Custom error classes
Expand Down
Loading