Skip to content

Commit d51b950

Browse files
authored
fix(aptos): only use coin list file when using mainnet (#1189)
1 parent a387d36 commit d51b950

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

packages/cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"dependencies": {
2626
"@aptos-labs/ts-sdk": "~1.33.0",
2727
"@mysten/sui": "~1.20.0",
28-
"@sentio/chain": "~3.0.2",
28+
"@sentio/chain": "~3.0.5",
2929
"@sentio/graph-cli": "^0.80.0-patch.1",
3030
"@types/node": "^22.8.6",
3131
"chalk": "^5.3.0",

packages/sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"@sentio/abi-wan-kanabi": "2.2.2-1",
8686
"@sentio/api": "1.0.2-rc.11",
8787
"@sentio/bigdecimal": "9.1.1-patch.3",
88-
"@sentio/chain": "~3.0.2",
88+
"@sentio/chain": "~3.0.5",
8989
"@sentio/ethers-v6": "^1.0.29",
9090
"@sentio/protos": "workspace:*",
9191
"@sentio/runtime": "workspace:^",

packages/sdk/src/aptos/ext/token.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,13 @@ async function getCoinTokenInfo(client: RichAptosClient, type: MoveStructId): Pr
168168

169169
// token: address of the fungible asset, e.g. "0xa", or the coin type, e.g. "0x1::aptos::AptosCoin"
170170
export async function getTokenInfoWithFallback(token: string, network?: AptosNetwork): Promise<TokenInfo> {
171-
const r = TOKEN_MAP.get(token)
172-
if (r) {
173-
return r
174-
}
175171
network = network || AptosNetwork.MAIN_NET
172+
if (network === AptosNetwork.MOVEMENT_MAIN_NET) {
173+
const r = TOKEN_MAP.get(token)
174+
if (r) {
175+
return r
176+
}
177+
}
176178
const key = network + '_' + token
177179
let promise = TOKEN_METADATA_CACHE.get(key)
178180
const isFungibleAsset = !token.includes(SPLITTER)

pnpm-lock.yaml

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)