Skip to content

Typed query client for the BitBadges chain's GAMM module via its LCD REST gateway.

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:307

Typed query client for the BitBadges chain's GAMM module via its LCD REST gateway.

Mirrors the proto-REST query surface (/osmosis/gamm/v1beta1/...) but exposes camelCase params + responses to match the rest of the BitBadges SDK. Snake_case translation happens at the wire boundary in convertSnakeToCamel / convertCamelToSnake.

The generic T extends NumberType controls the runtime type of numeric fields in responses. Pass a convertFunction (e.g. BigIntify, Stringify, Numberify) to the constructor or per-method to control conversion. Defaults to BigIntify.

Example

ts
const client = new GammChainQueryClient({ baseUrl: 'https://lcd.bitbadges.io' });
const { pool } = await client.getPool({ poolId: 1n });
const { totalShares } = await client.getTotalShares({ poolId: 1n });

Type Parameters

T

T extends NumberType = bigint

Constructors

Constructor

new GammChainQueryClient<T>(opts?): GammChainQueryClient<T>

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:312

Parameters

opts?

iGammChainQueryClientOptions & object = {}

Returns

GammChainQueryClient<T>

Methods

calcExitPoolCoinsFromShares()

calcExitPoolCoinsFromShares(payload): Promise<iCalcExitPoolCoinsFromSharesResponse<T>>

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:481

GET /osmosis/gamm/v1beta1/pools/{poolId}/exit_swap_share_amount_in?share_in_amount=...

Parameters

payload

iCalcExitPoolCoinsFromSharesPayload<NumberType>

Returns

Promise<iCalcExitPoolCoinsFromSharesResponse<T>>


calcJoinPoolNoSwapShares()

calcJoinPoolNoSwapShares(payload): Promise<iCalcJoinPoolNoSwapSharesResponse<T>>

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:500

Calc join-pool no-swap shares. The chain proto for this query has no HTTP gateway annotation; we use the same path style as calcJoinPoolShares with the trailing segment join_pool_no_swap. If your chain build does not expose this route, the call will surface a 404 from get.

Parameters

payload

iCalcJoinPoolNoSwapSharesPayload<NumberType>

Returns

Promise<iCalcJoinPoolNoSwapSharesResponse<T>>


calcJoinPoolShares()

calcJoinPoolShares(payload): Promise<iCalcJoinPoolSharesResponse<T>>

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:462

GET /osmosis/gamm/v1beta1/pools/{poolId}/join_swap_exact_in?tokens_in=...

Parameters

payload

iCalcJoinPoolSharesPayload<NumberType>

Returns

Promise<iCalcJoinPoolSharesResponse<T>>


estimateSwapExactAmountIn()

estimateSwapExactAmountIn(payload): Promise<iEstimateSwapExactAmountInResponse<T>>

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:519

GET /osmosis/gamm/v1beta1/{poolId}/estimate/swap_exact_amount_in

Parameters

payload

iEstimateSwapExactAmountInPayload<NumberType>

Returns

Promise<iEstimateSwapExactAmountInResponse<T>>


estimateSwapExactAmountOut()

estimateSwapExactAmountOut(payload): Promise<iEstimateSwapExactAmountOutResponse<T>>

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:541

GET /osmosis/gamm/v1beta1/{poolId}/estimate/swap_exact_amount_out

Parameters

payload

iEstimateSwapExactAmountOutPayload<NumberType>

Returns

Promise<iEstimateSwapExactAmountOutResponse<T>>


getPool()

getPool(payload): Promise<{ pool: Pool<T>; }>

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:394

GET /osmosis/gamm/v1beta1/pools/{poolId}

Parameters

payload

iGetPoolPayload<NumberType>

Returns

Promise<{ pool: Pool<T>; }>


getPools()

getPools(payload?): Promise<iGetPoolsResponse<T>>

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:403

GET /osmosis/gamm/v1beta1/pools

Parameters

payload?

iGetPoolsPayload = {}

Returns

Promise<iGetPoolsResponse<T>>


getSpotPrice()

getSpotPrice(payload): Promise<iGetSpotPriceResponse>

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:439

GET /osmosis/gamm/v1beta1/pools/{poolId}/prices?base_asset_denom=...&quote_asset_denom=...

Parameters

payload

iGetSpotPricePayload<NumberType>

Returns

Promise<iGetSpotPriceResponse>


getTotalLiquidity()

getTotalLiquidity(): Promise<iGetTotalLiquidityResponse<T>>

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:454

GET /osmosis/gamm/v1beta1/total_liquidity

Returns

Promise<iGetTotalLiquidityResponse<T>>


getTotalPoolLiquidity()

getTotalPoolLiquidity(payload): Promise<iGetTotalPoolLiquidityResponse<T>>

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:428

GET /osmosis/gamm/v1beta1/pools/{poolId}/total_pool_liquidity

Parameters

payload

iGetTotalPoolLiquidityPayload<NumberType>

Returns

Promise<iGetTotalPoolLiquidityResponse<T>>


getTotalShares()

getTotalShares(payload): Promise<iGetTotalSharesResponse<T>>

Defined in: packages/bitbadgesjs-sdk/src/gamm/chain-query-client.ts:417

GET /osmosis/gamm/v1beta1/pools/{poolId}/total_shares

Parameters

payload

iGetTotalSharesPayload<NumberType>

Returns

Promise<iGetTotalSharesResponse<T>>

Edit this page on GitHub