Skip to content

Commit

Permalink
fix(fix): node info (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgilbe27 authored Aug 30, 2023
1 parent 0d36024 commit 9d6af39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/nibijs/docs/classes/StableSwap.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ y()
Calculate x[j] if one makes x[i] = x

Done by solving quadratic equation iteratively.
x_1**2 + x1 * (sum' - (A*n**n - 1) _ D / (A _ n**n)) = D ** (n+1)/(n ** (2 _ n) _ prod' \* A)
x_1**2 + b\*x_1 = c
x*1**2 + x1 * (sum' - (A*n**n - 1) * D / (A _ n**n)) = D ** (n+1)/(n \*\* (2 _ n) \_ prod' \* A)
x_1\*\*2 + b\*x_1 = c

x_1 = (x_1\**2 + c) / (2*x_1 + b)

Expand Down
9 changes: 6 additions & 3 deletions packages/nibijs/src/chain/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,12 @@ export const Devnet = (chainNumber: number) =>

export const queryChainIdWithRest = async (chain: Chain) => {
const queryChainId = async (chain: Chain): Promise<string> => {
const response = await window.fetch(`${chain.endptRest}/node_info`)
const nodeInfo: { node_info: { network: string } } = await response.json()
return nodeInfo.node_info.network
const response = await window.fetch(
`${chain.endptRest}/cosmos/base/tendermint/v1beta1/node_info`
)
const nodeInfo: { default_node_info: { network: string } } =
await response.json()
return nodeInfo.default_node_info.network
}

const { res: chainId, err } = await go(queryChainId(chain))
Expand Down

0 comments on commit 9d6af39

Please sign in to comment.