Skip to main content
Glama
query.lcd.js3.78 kB
export class LCDQueryClient { req; constructor({ requestClient }) { this.req = requestClient; this.params = this.params.bind(this); this.arithmeticTwap = this.arithmeticTwap.bind(this); this.arithmeticTwapToNow = this.arithmeticTwapToNow.bind(this); this.geometricTwap = this.geometricTwap.bind(this); this.geometricTwapToNow = this.geometricTwapToNow.bind(this); } /* Params */ async params(_params = {}) { const endpoint = `osmosis/twap/v1beta1/Params`; return await this.req.get(endpoint); } /* ArithmeticTwap */ async arithmeticTwap(params) { const options = { params: {} }; if (typeof params?.poolId !== "undefined") { options.params.pool_id = params.poolId; } if (typeof params?.baseAsset !== "undefined") { options.params.base_asset = params.baseAsset; } if (typeof params?.quoteAsset !== "undefined") { options.params.quote_asset = params.quoteAsset; } if (typeof params?.startTime !== "undefined") { options.params.start_time = params.startTime; } if (typeof params?.endTime !== "undefined") { options.params.end_time = params.endTime; } const endpoint = `osmosis/twap/v1beta1/ArithmeticTwap`; return await this.req.get(endpoint, options); } /* ArithmeticTwapToNow */ async arithmeticTwapToNow(params) { const options = { params: {} }; if (typeof params?.poolId !== "undefined") { options.params.pool_id = params.poolId; } if (typeof params?.baseAsset !== "undefined") { options.params.base_asset = params.baseAsset; } if (typeof params?.quoteAsset !== "undefined") { options.params.quote_asset = params.quoteAsset; } if (typeof params?.startTime !== "undefined") { options.params.start_time = params.startTime; } const endpoint = `osmosis/twap/v1beta1/ArithmeticTwapToNow`; return await this.req.get(endpoint, options); } /* GeometricTwap */ async geometricTwap(params) { const options = { params: {} }; if (typeof params?.poolId !== "undefined") { options.params.pool_id = params.poolId; } if (typeof params?.baseAsset !== "undefined") { options.params.base_asset = params.baseAsset; } if (typeof params?.quoteAsset !== "undefined") { options.params.quote_asset = params.quoteAsset; } if (typeof params?.startTime !== "undefined") { options.params.start_time = params.startTime; } if (typeof params?.endTime !== "undefined") { options.params.end_time = params.endTime; } const endpoint = `osmosis/twap/v1beta1/GeometricTwap`; return await this.req.get(endpoint, options); } /* GeometricTwapToNow */ async geometricTwapToNow(params) { const options = { params: {} }; if (typeof params?.poolId !== "undefined") { options.params.pool_id = params.poolId; } if (typeof params?.baseAsset !== "undefined") { options.params.base_asset = params.baseAsset; } if (typeof params?.quoteAsset !== "undefined") { options.params.quote_asset = params.quoteAsset; } if (typeof params?.startTime !== "undefined") { options.params.start_time = params.startTime; } const endpoint = `osmosis/twap/v1beta1/GeometricTwapToNow`; return await this.req.get(endpoint, options); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MyronKoch-dev/osmosis-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server