Skip to content

Commit 67688fb

Browse files
bolasblackzhigang1992
authored andcommitted
feat: fetchTokenInfo() support wrap token address
1 parent 6562e48 commit 67688fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/alexSDK.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ export class AlexSDK {
7878
async fetchTokenInfo(tokenAddress: string): Promise<TokenInfo | null> {
7979
return (
8080
(await this.getTokenInfos()).find(
81-
(x) => x.underlyingToken.split('::')[0] === tokenAddress.split('::')[0]
81+
(x) =>
82+
x.wrapToken.split('::')[0] === tokenAddress.split('::')[0] ||
83+
x.underlyingToken.split('::')[0] === tokenAddress.split('::')[0]
8284
) ?? null
8385
);
8486
}

0 commit comments

Comments
 (0)