feat: fetchTokenInfo() support wrap token address

This commit is contained in:
c4605
2025-03-17 21:54:29 +01:00
committed by Kyle
parent 6562e486a6
commit 67688fbcb0

View File

@@ -78,7 +78,9 @@ export class AlexSDK {
async fetchTokenInfo(tokenAddress: string): Promise<TokenInfo | null> {
return (
(await this.getTokenInfos()).find(
(x) => x.underlyingToken.split('::')[0] === tokenAddress.split('::')[0]
(x) =>
x.wrapToken.split('::')[0] === tokenAddress.split('::')[0] ||
x.underlyingToken.split('::')[0] === tokenAddress.split('::')[0]
) ?? null
);
}