Skip to content

Commit 805a124

Browse files
authored
Fix Token Detail Fetching (#9)
1 parent 01c01d5 commit 805a124

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/agent-sdk/src/evm/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export async function validateRequest<
8282
return null;
8383
}
8484

85-
async function getAdapterAddress(
85+
export async function getAdapterAddress(
8686
accountId: string,
8787
safeSaltNonce: string,
8888
): Promise<Address> {

packages/agent-sdk/src/evm/tokens.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ export async function getTokenDetails(
3535
symbolOrAddress: string,
3636
tokenMap?: BlockchainMapping,
3737
): Promise<TokenInfo> {
38+
if (isAddress(symbolOrAddress, { strict: false })) {
39+
return getTokenInfo(chainId, symbolOrAddress);
40+
}
3841
if (!tokenMap) {
3942
console.log(
4043
"Loading TokenMap... this should be stored in memory consider setting it with loadTokenMap() in your app and passing it here.",
4144
);
4245
tokenMap = await loadTokenMap();
4346
}
44-
if (isAddress(symbolOrAddress, { strict: false })) {
45-
return getTokenInfo(chainId, symbolOrAddress);
46-
}
4747
console.log("Seeking TokenMap for Symbol", symbolOrAddress);
4848
// TokenMap has lower cased (sanitized) symbols
4949
return tokenMap[chainId][symbolOrAddress.toLowerCase()];

0 commit comments

Comments
 (0)