Skip to content

Commit

Permalink
fixup! Add chain ID query
Browse files Browse the repository at this point in the history
  • Loading branch information
peachbits committed Aug 8, 2024
1 parent 163a0bc commit 9588066
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cosmos/CosmosEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ export class CosmosEngine extends CurrencyEngine<
if (this.networkInfo.chainIdUpdateUrl != null) {
try {
const res = await this.fetchCors(this.networkInfo.chainIdUpdateUrl)
if (!res.ok) {
const message = await res.text()
throw new Error(message)
}
const raw = await res.json()
const clean = asChainIdUpdate(raw)
this.chainId = clean.result.node_info.network
Expand Down

0 comments on commit 9588066

Please sign in to comment.