@bolt-liquidity-hq/sui-client 0.1.0-beta.15 → 0.1.0-beta.17
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 +13 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -25
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -262,10 +262,11 @@ declare const PoolFeesInfoStruct: _mysten_bcs.BcsStruct<{
|
|
|
262
262
|
swap_fee_pct: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
263
263
|
lp_withdrawal_fee_pct: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
264
264
|
lp_fee_pct: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
265
|
+
max_dynamic_fee: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
266
|
+
limit_ratio: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
265
267
|
}, string>;
|
|
266
268
|
type PoolFeesInfoStructOutput = BcsParsed<typeof PoolFeesInfoStruct>;
|
|
267
269
|
declare const ProtocolFeesInfoStruct: _mysten_bcs.BcsStruct<{
|
|
268
|
-
bolt_fee_addr: _mysten_bcs.BcsType<string, string, "address">;
|
|
269
270
|
swap_fee_pct: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
270
271
|
lp_withdrawal_fee_pct: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
271
272
|
}, string>;
|
package/dist/index.d.ts
CHANGED
|
@@ -262,10 +262,11 @@ declare const PoolFeesInfoStruct: _mysten_bcs.BcsStruct<{
|
|
|
262
262
|
swap_fee_pct: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
263
263
|
lp_withdrawal_fee_pct: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
264
264
|
lp_fee_pct: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
265
|
+
max_dynamic_fee: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
266
|
+
limit_ratio: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
265
267
|
}, string>;
|
|
266
268
|
type PoolFeesInfoStructOutput = BcsParsed<typeof PoolFeesInfoStruct>;
|
|
267
269
|
declare const ProtocolFeesInfoStruct: _mysten_bcs.BcsStruct<{
|
|
268
|
-
bolt_fee_addr: _mysten_bcs.BcsType<string, string, "address">;
|
|
269
270
|
swap_fee_pct: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
270
271
|
lp_withdrawal_fee_pct: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
271
272
|
}, string>;
|
package/dist/index.js
CHANGED
|
@@ -42,7 +42,7 @@ var MainnetAssets = {
|
|
|
42
42
|
chainId: "101",
|
|
43
43
|
denom: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
|
|
44
44
|
decimals: 6,
|
|
45
|
-
logo: "https://raw.githubusercontent.com/cosmos/chain-registry/master/
|
|
45
|
+
logo: "https://raw.githubusercontent.com/cosmos/chain-registry/refs/heads/master/_non-cosmos/ethereum/images/usdc.png",
|
|
46
46
|
coingeckoId: "usd-coin"
|
|
47
47
|
}
|
|
48
48
|
};
|
|
@@ -80,7 +80,7 @@ var TestnetAssets = {
|
|
|
80
80
|
chainId: "103",
|
|
81
81
|
denom: "0xa1ec7fc00a6f40db9693ad1415d0c193ad3906494428cf252621037bd7117e29::usdc::USDC",
|
|
82
82
|
decimals: 6,
|
|
83
|
-
logo: "https://raw.githubusercontent.com/cosmos/chain-registry/master/
|
|
83
|
+
logo: "https://raw.githubusercontent.com/cosmos/chain-registry/refs/heads/master/_non-cosmos/ethereum/images/usdc.png",
|
|
84
84
|
coingeckoId: "usd-coin"
|
|
85
85
|
},
|
|
86
86
|
"::test_btc::TEST_BTC": {
|
|
@@ -876,10 +876,11 @@ var PoolInfoStruct = bcs6.struct("PoolInfo", {
|
|
|
876
876
|
var PoolFeesInfoStruct = bcs6.struct("PoolFeesInfo", {
|
|
877
877
|
swap_fee_pct: bcs6.u64(),
|
|
878
878
|
lp_withdrawal_fee_pct: bcs6.u64(),
|
|
879
|
-
lp_fee_pct: bcs6.u64()
|
|
879
|
+
lp_fee_pct: bcs6.u64(),
|
|
880
|
+
max_dynamic_fee: bcs6.u64(),
|
|
881
|
+
limit_ratio: bcs6.u64()
|
|
880
882
|
});
|
|
881
883
|
var ProtocolFeesInfoStruct = bcs6.struct("ProtocolFeesInfo", {
|
|
882
|
-
bolt_fee_addr: BcsAddressType,
|
|
883
884
|
swap_fee_pct: bcs6.u64(),
|
|
884
885
|
lp_withdrawal_fee_pct: bcs6.u64()
|
|
885
886
|
});
|
|
@@ -1147,10 +1148,10 @@ import { NotFoundError as NotFoundError6 } from "@bolt-liquidity-hq/core";
|
|
|
1147
1148
|
|
|
1148
1149
|
// src/lib/settlement/parsers.ts
|
|
1149
1150
|
import { BigNumber as BigNumber4 } from "bignumber.js";
|
|
1150
|
-
var parseSettlementConfigStructOutput = (routerClient, poolFeesInfo,
|
|
1151
|
+
var parseSettlementConfigStructOutput = (routerClient, poolFeesInfo, priceOracleContract) => {
|
|
1151
1152
|
return {
|
|
1152
1153
|
priceOracleContract,
|
|
1153
|
-
protocolFeeRecipient:
|
|
1154
|
+
protocolFeeRecipient: "0x",
|
|
1154
1155
|
protocolFee: BigNumber4(poolFeesInfo.swap_fee_pct).div(BASIS_POINTS).toFixed(),
|
|
1155
1156
|
lpFee: BigNumber4(poolFeesInfo.lp_fee_pct).div(BASIS_POINTS).toFixed(),
|
|
1156
1157
|
allowanceMode: "allow",
|
|
@@ -1164,33 +1165,20 @@ var parseSettlementConfigStructOutput = (routerClient, poolFeesInfo, protocolFee
|
|
|
1164
1165
|
// src/lib/settlement/get-pool-info.ts
|
|
1165
1166
|
var getPoolInfo = async (client, contractAddress) => {
|
|
1166
1167
|
const GET_POOL_FEES_INFO_FUNCTION = "get_pool_fees_info";
|
|
1167
|
-
const GET_PROTOCOL_FEES_INFO_FUNCTION = "get_protocol_fees_info";
|
|
1168
1168
|
const pool = client.routerClient.pools.find((item) => item.poolAddress === contractAddress);
|
|
1169
1169
|
if (!pool) {
|
|
1170
1170
|
throw new NotFoundError6(`Pool with the address ${contractAddress}`);
|
|
1171
1171
|
}
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
[pool.baseDenom]
|
|
1179
|
-
),
|
|
1180
|
-
// Query protocol fee information
|
|
1181
|
-
queryDevInspect(
|
|
1182
|
-
client.suiClient,
|
|
1183
|
-
[client.packageId, POOL_MODULE, GET_PROTOCOL_FEES_INFO_FUNCTION],
|
|
1184
|
-
[contractAddress],
|
|
1185
|
-
[pool.baseDenom]
|
|
1186
|
-
)
|
|
1187
|
-
]);
|
|
1172
|
+
const poolFeesInfo = await queryDevInspect(
|
|
1173
|
+
client.suiClient,
|
|
1174
|
+
[client.packageId, POOL_MODULE, GET_POOL_FEES_INFO_FUNCTION],
|
|
1175
|
+
[contractAddress],
|
|
1176
|
+
[pool.baseDenom]
|
|
1177
|
+
);
|
|
1188
1178
|
const poolFeesInfoOutput = parseDevInspectResult(poolFeesInfo, PoolFeesInfoStruct);
|
|
1189
|
-
const protocolFeesInfoOutput = parseDevInspectResult(protocolFeesInfo, ProtocolFeesInfoStruct);
|
|
1190
1179
|
return parseSettlementConfigStructOutput(
|
|
1191
1180
|
client.routerClient,
|
|
1192
1181
|
poolFeesInfoOutput,
|
|
1193
|
-
protocolFeesInfoOutput,
|
|
1194
1182
|
client.contracts.oracle
|
|
1195
1183
|
);
|
|
1196
1184
|
};
|