mirror of
https://github.com/alexgo-io/alex-sdk.git
synced 2026-01-12 14:25:02 +08:00
feat: fetchTokenInfo() support wrap token address
This commit is contained in:
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user