@bolt-liquidity-hq/cosmwasm-client 0.1.0-beta.21 → 0.1.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +53 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +53 -38
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -107,7 +107,7 @@ type QuerySimulateSwapExactInResponse = {
|
|
|
107
107
|
* const client = new BoltCosmWasmClient();
|
|
108
108
|
*
|
|
109
109
|
* // Query oracle prices
|
|
110
|
-
* const price = await client.getPrice("
|
|
110
|
+
* const price = await client.getPrice("ibc/...", "aarch");
|
|
111
111
|
*
|
|
112
112
|
* // Execute a swap (requires signer)
|
|
113
113
|
* const signer = await DirectSecp256k1HdWallet.fromMnemonic("my mnemonic goes here", {
|
|
@@ -289,8 +289,6 @@ declare class BoltCosmWasmClient extends BaseClient<OfflineSigner, ExecuteResult
|
|
|
289
289
|
getAllPools(): Promise<Pool[]>;
|
|
290
290
|
/** @inheritdoc */
|
|
291
291
|
getPoolConfig(poolContractAddress: Address): Promise<PoolConfig>;
|
|
292
|
-
/** @inheritdoc */
|
|
293
|
-
getAssets(): Promise<Asset[]>;
|
|
294
292
|
/**
|
|
295
293
|
* @inheritdoc
|
|
296
294
|
*
|
|
@@ -300,6 +298,10 @@ declare class BoltCosmWasmClient extends BaseClient<OfflineSigner, ExecuteResult
|
|
|
300
298
|
* by their base asset in the current CosmWasm architecture.
|
|
301
299
|
*/
|
|
302
300
|
getPoolConfigByDenom(baseDenom: string): Promise<PoolConfig>;
|
|
301
|
+
/** @inheritdoc */
|
|
302
|
+
getPoolBaseLiquidity(poolContractAddress: string): Promise<BaseLiquidityDetails>;
|
|
303
|
+
/** @inheritdoc */
|
|
304
|
+
getAssets(): Promise<Asset[]>;
|
|
303
305
|
/**
|
|
304
306
|
* @inheritdoc
|
|
305
307
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -107,7 +107,7 @@ type QuerySimulateSwapExactInResponse = {
|
|
|
107
107
|
* const client = new BoltCosmWasmClient();
|
|
108
108
|
*
|
|
109
109
|
* // Query oracle prices
|
|
110
|
-
* const price = await client.getPrice("
|
|
110
|
+
* const price = await client.getPrice("ibc/...", "aarch");
|
|
111
111
|
*
|
|
112
112
|
* // Execute a swap (requires signer)
|
|
113
113
|
* const signer = await DirectSecp256k1HdWallet.fromMnemonic("my mnemonic goes here", {
|
|
@@ -289,8 +289,6 @@ declare class BoltCosmWasmClient extends BaseClient<OfflineSigner, ExecuteResult
|
|
|
289
289
|
getAllPools(): Promise<Pool[]>;
|
|
290
290
|
/** @inheritdoc */
|
|
291
291
|
getPoolConfig(poolContractAddress: Address): Promise<PoolConfig>;
|
|
292
|
-
/** @inheritdoc */
|
|
293
|
-
getAssets(): Promise<Asset[]>;
|
|
294
292
|
/**
|
|
295
293
|
* @inheritdoc
|
|
296
294
|
*
|
|
@@ -300,6 +298,10 @@ declare class BoltCosmWasmClient extends BaseClient<OfflineSigner, ExecuteResult
|
|
|
300
298
|
* by their base asset in the current CosmWasm architecture.
|
|
301
299
|
*/
|
|
302
300
|
getPoolConfigByDenom(baseDenom: string): Promise<PoolConfig>;
|
|
301
|
+
/** @inheritdoc */
|
|
302
|
+
getPoolBaseLiquidity(poolContractAddress: string): Promise<BaseLiquidityDetails>;
|
|
303
|
+
/** @inheritdoc */
|
|
304
|
+
getAssets(): Promise<Asset[]>;
|
|
303
305
|
/**
|
|
304
306
|
* @inheritdoc
|
|
305
307
|
*
|
package/dist/index.js
CHANGED
|
@@ -5549,6 +5549,51 @@ var estimateSwapExactInGasFees = async (client, { assetIn, amountIn, assetOut, m
|
|
|
5549
5549
|
|
|
5550
5550
|
// src/lib/router/parsers.ts
|
|
5551
5551
|
import { BigNumber as BigNumber2 } from "bignumber.js";
|
|
5552
|
+
|
|
5553
|
+
// src/lib/settlement/get-settlement-base-liquidity.ts
|
|
5554
|
+
var getSettlementBaseLiquidity = async (client, contractAddress) => {
|
|
5555
|
+
const cosmWasmClient = await client.getCosmWasmClient();
|
|
5556
|
+
const response = await cosmWasmClient.queryContractSmart(contractAddress, {
|
|
5557
|
+
base_liquidity: {}
|
|
5558
|
+
});
|
|
5559
|
+
return parseQueryBaseLiquidityResponse(response);
|
|
5560
|
+
};
|
|
5561
|
+
|
|
5562
|
+
// src/lib/settlement/parsers.ts
|
|
5563
|
+
var parseQuerySettlementConfigResponse = (response) => {
|
|
5564
|
+
return {
|
|
5565
|
+
priceOracleContract: response.price_oracle_contract,
|
|
5566
|
+
protocolFeeRecipient: response.protocol_fee_recipient,
|
|
5567
|
+
protocolFee: response.protocol_fee,
|
|
5568
|
+
lpFee: response.lp_fee,
|
|
5569
|
+
allowanceMode: response.allowance_mode,
|
|
5570
|
+
lps: response.lps,
|
|
5571
|
+
minBaseOut: response.min_base_out
|
|
5572
|
+
};
|
|
5573
|
+
};
|
|
5574
|
+
var parseQueryBaseLiquidityResponse = (response) => {
|
|
5575
|
+
return {
|
|
5576
|
+
baseLiquidity: response.base_liquidity,
|
|
5577
|
+
totalShares: response.total_shares
|
|
5578
|
+
};
|
|
5579
|
+
};
|
|
5580
|
+
|
|
5581
|
+
// src/lib/settlement/get-settlement-config.ts
|
|
5582
|
+
var getSettlementConfig = async (client, contractAddress) => {
|
|
5583
|
+
const cosmWasmClient = await client.getCosmWasmClient();
|
|
5584
|
+
const response = await cosmWasmClient.queryContractSmart(contractAddress, {
|
|
5585
|
+
config: {}
|
|
5586
|
+
});
|
|
5587
|
+
return parseQuerySettlementConfigResponse(response);
|
|
5588
|
+
};
|
|
5589
|
+
|
|
5590
|
+
// src/lib/settlement/get-settlement-config-for-base.ts
|
|
5591
|
+
var getSettlementConfigForBase = async (client, baseDenom) => {
|
|
5592
|
+
const pool = await getPoolForBase(client, baseDenom);
|
|
5593
|
+
return await getSettlementConfig(client, pool.poolAddress);
|
|
5594
|
+
};
|
|
5595
|
+
|
|
5596
|
+
// src/lib/router/parsers.ts
|
|
5552
5597
|
var parseMarketRepresentation = (marketRepresentation) => {
|
|
5553
5598
|
return {
|
|
5554
5599
|
poolAddress: marketRepresentation.market_address,
|
|
@@ -5569,12 +5614,6 @@ var parseQueryRouterConfigResponse = (response) => {
|
|
|
5569
5614
|
settlementCodeId: response.settlement_code_id
|
|
5570
5615
|
};
|
|
5571
5616
|
};
|
|
5572
|
-
var parseQueryBaseLiquidityResponse = (response) => {
|
|
5573
|
-
return {
|
|
5574
|
-
baseLiquidity: response.base_liquidity,
|
|
5575
|
-
totalShares: response.total_shares
|
|
5576
|
-
};
|
|
5577
|
-
};
|
|
5578
5617
|
var parseQueryBaseLiquidityAllResponse = (response) => {
|
|
5579
5618
|
const newMapping = {};
|
|
5580
5619
|
for (const [key, value] of Object.entries(response.liquidity)) {
|
|
@@ -5720,34 +5759,6 @@ var swapExactIn = async (client, { assetIn, amountIn, assetOut, minimumAmountOut
|
|
|
5720
5759
|
};
|
|
5721
5760
|
};
|
|
5722
5761
|
|
|
5723
|
-
// src/lib/settlement/parsers.ts
|
|
5724
|
-
var parseQuerySettlementConfigResponse = (response) => {
|
|
5725
|
-
return {
|
|
5726
|
-
priceOracleContract: response.price_oracle_contract,
|
|
5727
|
-
protocolFeeRecipient: response.protocol_fee_recipient,
|
|
5728
|
-
protocolFee: response.protocol_fee,
|
|
5729
|
-
lpFee: response.lp_fee,
|
|
5730
|
-
allowanceMode: response.allowance_mode,
|
|
5731
|
-
lps: response.lps,
|
|
5732
|
-
minBaseOut: response.min_base_out
|
|
5733
|
-
};
|
|
5734
|
-
};
|
|
5735
|
-
|
|
5736
|
-
// src/lib/settlement/get-settlement-config.ts
|
|
5737
|
-
var getSettlementConfig = async (client, contractAddress) => {
|
|
5738
|
-
const cosmWasmClient = await client.getCosmWasmClient();
|
|
5739
|
-
const response = await cosmWasmClient.queryContractSmart(contractAddress, {
|
|
5740
|
-
config: {}
|
|
5741
|
-
});
|
|
5742
|
-
return parseQuerySettlementConfigResponse(response);
|
|
5743
|
-
};
|
|
5744
|
-
|
|
5745
|
-
// src/lib/settlement/get-settlement-config-for-base.ts
|
|
5746
|
-
var getSettlementConfigForBase = async (client, baseDenom) => {
|
|
5747
|
-
const pool = await getPoolForBase(client, baseDenom);
|
|
5748
|
-
return await getSettlementConfig(client, pool.poolAddress);
|
|
5749
|
-
};
|
|
5750
|
-
|
|
5751
5762
|
// src/lib/client.ts
|
|
5752
5763
|
var BoltCosmWasmClient = class extends BaseClient {
|
|
5753
5764
|
/**
|
|
@@ -6011,10 +6022,6 @@ var BoltCosmWasmClient = class extends BaseClient {
|
|
|
6011
6022
|
async getPoolConfig(poolContractAddress) {
|
|
6012
6023
|
return await getSettlementConfig(this, poolContractAddress);
|
|
6013
6024
|
}
|
|
6014
|
-
/** @inheritdoc */
|
|
6015
|
-
async getAssets() {
|
|
6016
|
-
return await getAssets(this);
|
|
6017
|
-
}
|
|
6018
6025
|
/**
|
|
6019
6026
|
* @inheritdoc
|
|
6020
6027
|
*
|
|
@@ -6026,6 +6033,14 @@ var BoltCosmWasmClient = class extends BaseClient {
|
|
|
6026
6033
|
async getPoolConfigByDenom(baseDenom) {
|
|
6027
6034
|
return await getSettlementConfigForBase(this, baseDenom);
|
|
6028
6035
|
}
|
|
6036
|
+
/** @inheritdoc */
|
|
6037
|
+
async getPoolBaseLiquidity(poolContractAddress) {
|
|
6038
|
+
return await getSettlementBaseLiquidity(this, poolContractAddress);
|
|
6039
|
+
}
|
|
6040
|
+
/** @inheritdoc */
|
|
6041
|
+
async getAssets() {
|
|
6042
|
+
return await getAssets(this);
|
|
6043
|
+
}
|
|
6029
6044
|
/**
|
|
6030
6045
|
* @inheritdoc
|
|
6031
6046
|
*
|