@bolt-liquidity-hq/sui-client 0.1.0-beta.26 → 0.1.0-beta.27
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/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/index.cjs +19 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -17
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -20,7 +20,7 @@ type SuiChainConfig = ChainConfig;
|
|
|
20
20
|
|
|
21
21
|
type WalletSigner = WalletContextState;
|
|
22
22
|
|
|
23
|
-
type SuiClientConfig = ClientConfig<SuiChainConfig> & {
|
|
23
|
+
type SuiClientConfig = Omit<ClientConfig<SuiChainConfig>, 'customOverride'> & {
|
|
24
24
|
signer?: Signer | WalletSigner;
|
|
25
25
|
suiClient?: SuiClient;
|
|
26
26
|
customOverride?: ClientConfig<SuiChainConfig>['customOverride'] & {
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ type SuiChainConfig = ChainConfig;
|
|
|
20
20
|
|
|
21
21
|
type WalletSigner = WalletContextState;
|
|
22
22
|
|
|
23
|
-
type SuiClientConfig = ClientConfig<SuiChainConfig> & {
|
|
23
|
+
type SuiClientConfig = Omit<ClientConfig<SuiChainConfig>, 'customOverride'> & {
|
|
24
24
|
signer?: Signer | WalletSigner;
|
|
25
25
|
suiClient?: SuiClient;
|
|
26
26
|
customOverride?: ClientConfig<SuiChainConfig>['customOverride'] & {
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var MainnetAssets = {
|
|
|
30
30
|
[SUI_TOKEN_DENOM]: {
|
|
31
31
|
symbol: "SUI",
|
|
32
32
|
name: "Sui",
|
|
33
|
-
chainId:
|
|
33
|
+
chainId: MainnetChainConfig.id,
|
|
34
34
|
denom: SUI_TOKEN_DENOM,
|
|
35
35
|
decimals: SUI_DECIMALS,
|
|
36
36
|
logo: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/sui/info/logo.png",
|
|
@@ -39,7 +39,7 @@ var MainnetAssets = {
|
|
|
39
39
|
"0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC": {
|
|
40
40
|
symbol: "USDC",
|
|
41
41
|
name: "Circle USDC",
|
|
42
|
-
chainId:
|
|
42
|
+
chainId: MainnetChainConfig.id,
|
|
43
43
|
denom: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
|
|
44
44
|
decimals: 6,
|
|
45
45
|
logo: "https://raw.githubusercontent.com/cosmos/chain-registry/refs/heads/master/_non-cosmos/ethereum/images/usdc.png",
|
|
@@ -48,7 +48,7 @@ var MainnetAssets = {
|
|
|
48
48
|
"0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL": {
|
|
49
49
|
symbol: "WAL",
|
|
50
50
|
name: "Walrus",
|
|
51
|
-
chainId:
|
|
51
|
+
chainId: MainnetChainConfig.id,
|
|
52
52
|
denom: "0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL",
|
|
53
53
|
decimals: 9,
|
|
54
54
|
logo: "https://app.lotusfinance.io/images/coins/wal-icon.svg",
|
|
@@ -57,7 +57,7 @@ var MainnetAssets = {
|
|
|
57
57
|
"0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT": {
|
|
58
58
|
symbol: "suiUSDT",
|
|
59
59
|
name: "Tether by Sui Bridge",
|
|
60
|
-
chainId:
|
|
60
|
+
chainId: MainnetChainConfig.id,
|
|
61
61
|
denom: "0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT",
|
|
62
62
|
decimals: 6,
|
|
63
63
|
logo: "https://raw.githubusercontent.com/cosmos/chain-registry/refs/heads/master/_non-cosmos/ethereum/images/usdt.svg",
|
|
@@ -96,7 +96,7 @@ var TestnetAssets = {
|
|
|
96
96
|
[SUI_TOKEN_DENOM]: {
|
|
97
97
|
symbol: "SUI",
|
|
98
98
|
name: "Sui",
|
|
99
|
-
chainId:
|
|
99
|
+
chainId: TestnetChainConfig.id,
|
|
100
100
|
denom: SUI_TOKEN_DENOM,
|
|
101
101
|
decimals: SUI_DECIMALS2,
|
|
102
102
|
logo: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/sui/info/logo.png",
|
|
@@ -105,7 +105,7 @@ var TestnetAssets = {
|
|
|
105
105
|
"0xa1ec7fc00a6f40db9693ad1415d0c193ad3906494428cf252621037bd7117e29::usdc::USDC": {
|
|
106
106
|
symbol: "USDC",
|
|
107
107
|
name: "Circle USDC",
|
|
108
|
-
chainId:
|
|
108
|
+
chainId: TestnetChainConfig.id,
|
|
109
109
|
denom: "0xa1ec7fc00a6f40db9693ad1415d0c193ad3906494428cf252621037bd7117e29::usdc::USDC",
|
|
110
110
|
decimals: 6,
|
|
111
111
|
logo: "https://raw.githubusercontent.com/cosmos/chain-registry/refs/heads/master/_non-cosmos/ethereum/images/usdc.png",
|
|
@@ -114,7 +114,7 @@ var TestnetAssets = {
|
|
|
114
114
|
"::test_btc::TEST_BTC": {
|
|
115
115
|
symbol: "TEST_BTC",
|
|
116
116
|
name: "Test BTC",
|
|
117
|
-
chainId:
|
|
117
|
+
chainId: TestnetChainConfig.id,
|
|
118
118
|
denom: "::test_btc::TEST_BTC",
|
|
119
119
|
decimals: 8,
|
|
120
120
|
logo: "https://raw.githubusercontent.com/cosmos/chain-registry/refs/heads/master/_non-cosmos/bitcoin/images/btc.svg",
|
|
@@ -123,7 +123,7 @@ var TestnetAssets = {
|
|
|
123
123
|
"::test_usdt::TEST_USDT": {
|
|
124
124
|
symbol: "TEST_USDT",
|
|
125
125
|
name: "Test USDT",
|
|
126
|
-
chainId:
|
|
126
|
+
chainId: TestnetChainConfig.id,
|
|
127
127
|
denom: "::test_usdt::TEST_USDT",
|
|
128
128
|
decimals: 6,
|
|
129
129
|
logo: "https://raw.githubusercontent.com/cosmos/chain-registry/refs/heads/master/_non-cosmos/ethereum/images/usdt.svg",
|
|
@@ -132,7 +132,7 @@ var TestnetAssets = {
|
|
|
132
132
|
"::test_deep::TEST_DEEP": {
|
|
133
133
|
symbol: "TEST_DEEP",
|
|
134
134
|
name: "TEST_DEEP",
|
|
135
|
-
chainId:
|
|
135
|
+
chainId: TestnetChainConfig.id,
|
|
136
136
|
denom: "::test_deep::TEST_DEEP",
|
|
137
137
|
decimals: 6,
|
|
138
138
|
logo: "https://app.lotusfinance.io/images/coins/deepbook-icon.svg",
|
|
@@ -141,7 +141,7 @@ var TestnetAssets = {
|
|
|
141
141
|
"::test_wal::TEST_WAL": {
|
|
142
142
|
symbol: "TEST_WAL",
|
|
143
143
|
name: "TEST_WAL",
|
|
144
|
-
chainId:
|
|
144
|
+
chainId: TestnetChainConfig.id,
|
|
145
145
|
denom: "::test_wal::TEST_WAL",
|
|
146
146
|
decimals: 9,
|
|
147
147
|
logo: "https://app.lotusfinance.io/images/coins/wal-icon.svg",
|
|
@@ -151,6 +151,7 @@ var TestnetAssets = {
|
|
|
151
151
|
|
|
152
152
|
// src/lib/constants/defaults.ts
|
|
153
153
|
var BASIS_POINTS = 1e4;
|
|
154
|
+
var PRICE_PRECISION = 18;
|
|
154
155
|
|
|
155
156
|
// src/lib/constants/sui-objects.ts
|
|
156
157
|
var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
@@ -786,7 +787,7 @@ var parsePriceDataStructOutput = (output, baseDenom, quoteDenom, isInverted) =>
|
|
|
786
787
|
return {
|
|
787
788
|
baseDenom,
|
|
788
789
|
quoteDenom,
|
|
789
|
-
price: BigNumber2(output.price.price).shiftedBy(-
|
|
790
|
+
price: BigNumber2(output.price.price).shiftedBy(-PRICE_PRECISION).toFixed(),
|
|
790
791
|
expiryTime: BigNumber2(output.price.expiry).times(1e6).toFixed(),
|
|
791
792
|
isInverse: isInverted ?? false
|
|
792
793
|
};
|
|
@@ -1066,7 +1067,7 @@ import { NotFoundError as NotFoundError3 } from "@bolt-liquidity-hq/core";
|
|
|
1066
1067
|
|
|
1067
1068
|
// src/lib/settlement/parsers.ts
|
|
1068
1069
|
import { BigNumber as BigNumber4 } from "bignumber.js";
|
|
1069
|
-
var parsePoolConfigStructOutput = (
|
|
1070
|
+
var parsePoolConfigStructOutput = (poolConfig, priceOracleContract) => {
|
|
1070
1071
|
return {
|
|
1071
1072
|
priceOracleContract,
|
|
1072
1073
|
protocolFeeRecipient: "0x",
|
|
@@ -1075,7 +1076,8 @@ var parsePoolConfigStructOutput = (routerClient, poolConfig, priceOracleContract
|
|
|
1075
1076
|
lpFee: BigNumber4(poolConfig.lp_fee_pct).div(BASIS_POINTS).toFixed(),
|
|
1076
1077
|
allowanceMode: "allow",
|
|
1077
1078
|
// Should come from pool config
|
|
1078
|
-
lps:
|
|
1079
|
+
lps: [],
|
|
1080
|
+
// TODO: update with lp list
|
|
1079
1081
|
minBaseOut: BigNumber4(poolConfig.min_base_out).toFixed()
|
|
1080
1082
|
};
|
|
1081
1083
|
};
|
|
@@ -1121,7 +1123,7 @@ var getPoolConfig = async (client, contractAddress) => {
|
|
|
1121
1123
|
[pool.baseDenom]
|
|
1122
1124
|
);
|
|
1123
1125
|
const output = parseDevInspectResult(poolConfig, PoolConfigStruct);
|
|
1124
|
-
return parsePoolConfigStructOutput(
|
|
1126
|
+
return parsePoolConfigStructOutput(output, client.contracts.oracle);
|
|
1125
1127
|
};
|
|
1126
1128
|
|
|
1127
1129
|
// src/lib/settlement/get-pool-config-by-denom.ts
|
|
@@ -1156,8 +1158,8 @@ var getPoolByDenom = async (client, baseDenom, quoteDenom) => {
|
|
|
1156
1158
|
return result;
|
|
1157
1159
|
};
|
|
1158
1160
|
|
|
1159
|
-
// src/lib/router/get-pools.ts
|
|
1160
|
-
var
|
|
1161
|
+
// src/lib/router/get-all-pools.ts
|
|
1162
|
+
var getAllPools = async (client) => {
|
|
1161
1163
|
return await client.routerClient.getPools();
|
|
1162
1164
|
};
|
|
1163
1165
|
|
|
@@ -1500,7 +1502,7 @@ var BoltSuiClient = class extends BaseClient {
|
|
|
1500
1502
|
/** @inheritdoc */
|
|
1501
1503
|
async getAllPools() {
|
|
1502
1504
|
await this.loadConfigFromUrl();
|
|
1503
|
-
return await
|
|
1505
|
+
return await getAllPools(this);
|
|
1504
1506
|
}
|
|
1505
1507
|
/** @inheritdoc */
|
|
1506
1508
|
async getPoolConfig(poolContractAddress) {
|