@t2000/sdk 0.20.1 → 0.20.3
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 +30 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +70 -1
- package/dist/index.d.ts +70 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -118,10 +118,10 @@ var volo_exports = {};
|
|
|
118
118
|
__export(volo_exports, {
|
|
119
119
|
MIN_STAKE_MIST: () => MIN_STAKE_MIST,
|
|
120
120
|
SUI_SYSTEM_STATE: () => SUI_SYSTEM_STATE,
|
|
121
|
-
VOLO_METADATA: () => VOLO_METADATA,
|
|
122
|
-
VOLO_PKG: () => VOLO_PKG,
|
|
123
|
-
VOLO_POOL: () => VOLO_POOL,
|
|
124
|
-
VSUI_TYPE: () => VSUI_TYPE,
|
|
121
|
+
VOLO_METADATA: () => exports.VOLO_METADATA,
|
|
122
|
+
VOLO_PKG: () => exports.VOLO_PKG,
|
|
123
|
+
VOLO_POOL: () => exports.VOLO_POOL,
|
|
124
|
+
VSUI_TYPE: () => exports.VSUI_TYPE,
|
|
125
125
|
buildStakeVSuiTx: () => buildStakeVSuiTx,
|
|
126
126
|
buildUnstakeVSuiTx: () => buildUnstakeVSuiTx,
|
|
127
127
|
getVoloStats: () => getVoloStats
|
|
@@ -149,10 +149,10 @@ async function buildStakeVSuiTx(_client, address, amountMist) {
|
|
|
149
149
|
tx.setSender(address);
|
|
150
150
|
const [suiCoin] = tx.splitCoins(tx.gas, [amountMist]);
|
|
151
151
|
const [vSuiCoin] = tx.moveCall({
|
|
152
|
-
target: `${VOLO_PKG}::stake_pool::stake`,
|
|
152
|
+
target: `${exports.VOLO_PKG}::stake_pool::stake`,
|
|
153
153
|
arguments: [
|
|
154
|
-
tx.object(VOLO_POOL),
|
|
155
|
-
tx.object(VOLO_METADATA),
|
|
154
|
+
tx.object(exports.VOLO_POOL),
|
|
155
|
+
tx.object(exports.VOLO_METADATA),
|
|
156
156
|
tx.object(SUI_SYSTEM_STATE),
|
|
157
157
|
suiCoin
|
|
158
158
|
]
|
|
@@ -178,10 +178,10 @@ async function buildUnstakeVSuiTx(client, address, amountMist) {
|
|
|
178
178
|
[vSuiCoin] = tx.splitCoins(primary, [amountMist]);
|
|
179
179
|
}
|
|
180
180
|
const [suiCoin] = tx.moveCall({
|
|
181
|
-
target: `${VOLO_PKG}::stake_pool::unstake`,
|
|
181
|
+
target: `${exports.VOLO_PKG}::stake_pool::unstake`,
|
|
182
182
|
arguments: [
|
|
183
|
-
tx.object(VOLO_POOL),
|
|
184
|
-
tx.object(VOLO_METADATA),
|
|
183
|
+
tx.object(exports.VOLO_POOL),
|
|
184
|
+
tx.object(exports.VOLO_METADATA),
|
|
185
185
|
tx.object(SUI_SYSTEM_STATE),
|
|
186
186
|
vSuiCoin
|
|
187
187
|
]
|
|
@@ -196,7 +196,7 @@ async function fetchVSuiCoins(client, address) {
|
|
|
196
196
|
while (hasNext) {
|
|
197
197
|
const page = await client.getCoins({
|
|
198
198
|
owner: address,
|
|
199
|
-
coinType: VSUI_TYPE,
|
|
199
|
+
coinType: exports.VSUI_TYPE,
|
|
200
200
|
cursor: cursor ?? void 0
|
|
201
201
|
});
|
|
202
202
|
all.push(...page.data.map((c) => ({ coinObjectId: c.coinObjectId, balance: c.balance })));
|
|
@@ -205,13 +205,13 @@ async function fetchVSuiCoins(client, address) {
|
|
|
205
205
|
}
|
|
206
206
|
return all;
|
|
207
207
|
}
|
|
208
|
-
|
|
208
|
+
exports.VOLO_PKG = void 0; exports.VOLO_POOL = void 0; exports.VOLO_METADATA = void 0; exports.VSUI_TYPE = void 0; var SUI_SYSTEM_STATE, MIN_STAKE_MIST, VOLO_STATS_URL;
|
|
209
209
|
var init_volo = __esm({
|
|
210
210
|
"src/protocols/volo.ts"() {
|
|
211
|
-
VOLO_PKG = "0x68d22cf8bdbcd11ecba1e094922873e4080d4d11133e2443fddda0bfd11dae20";
|
|
212
|
-
VOLO_POOL = "0x2d914e23d82fedef1b5f56a32d5c64bdcc3087ccfea2b4d6ea51a71f587840e5";
|
|
213
|
-
VOLO_METADATA = "0x680cd26af32b2bde8d3361e804c53ec1d1cfe24c7f039eb7f549e8dfde389a60";
|
|
214
|
-
VSUI_TYPE = "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT";
|
|
211
|
+
exports.VOLO_PKG = "0x68d22cf8bdbcd11ecba1e094922873e4080d4d11133e2443fddda0bfd11dae20";
|
|
212
|
+
exports.VOLO_POOL = "0x2d914e23d82fedef1b5f56a32d5c64bdcc3087ccfea2b4d6ea51a71f587840e5";
|
|
213
|
+
exports.VOLO_METADATA = "0x680cd26af32b2bde8d3361e804c53ec1d1cfe24c7f039eb7f549e8dfde389a60";
|
|
214
|
+
exports.VSUI_TYPE = "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT";
|
|
215
215
|
SUI_SYSTEM_STATE = "0x05";
|
|
216
216
|
MIN_STAKE_MIST = 1000000000n;
|
|
217
217
|
VOLO_STATS_URL = "https://open-api.naviprotocol.io/api/volo/stats";
|
|
@@ -221,7 +221,7 @@ var init_volo = __esm({
|
|
|
221
221
|
// src/protocols/cetus-swap.ts
|
|
222
222
|
var cetus_swap_exports = {};
|
|
223
223
|
__export(cetus_swap_exports, {
|
|
224
|
-
TOKEN_MAP: () => TOKEN_MAP,
|
|
224
|
+
TOKEN_MAP: () => exports.TOKEN_MAP,
|
|
225
225
|
buildSwapTx: () => buildSwapTx,
|
|
226
226
|
findSwapRoute: () => findSwapRoute,
|
|
227
227
|
resolveTokenType: () => resolveTokenType,
|
|
@@ -290,13 +290,13 @@ async function simulateSwap(params) {
|
|
|
290
290
|
}
|
|
291
291
|
function resolveTokenType(nameOrType) {
|
|
292
292
|
if (nameOrType.includes("::")) return nameOrType;
|
|
293
|
-
return TOKEN_MAP[nameOrType.toUpperCase()] ?? null;
|
|
293
|
+
return exports.TOKEN_MAP[nameOrType.toUpperCase()] ?? null;
|
|
294
294
|
}
|
|
295
|
-
var clientInstance
|
|
295
|
+
var clientInstance; exports.TOKEN_MAP = void 0;
|
|
296
296
|
var init_cetus_swap = __esm({
|
|
297
297
|
"src/protocols/cetus-swap.ts"() {
|
|
298
298
|
clientInstance = null;
|
|
299
|
-
TOKEN_MAP = {
|
|
299
|
+
exports.TOKEN_MAP = {
|
|
300
300
|
SUI: "0x2::sui::SUI",
|
|
301
301
|
USDC: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
|
|
302
302
|
USDT: "0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT",
|
|
@@ -3204,6 +3204,10 @@ async function getSwapQuote(params) {
|
|
|
3204
3204
|
};
|
|
3205
3205
|
}
|
|
3206
3206
|
|
|
3207
|
+
// src/index.ts
|
|
3208
|
+
init_cetus_swap();
|
|
3209
|
+
init_volo();
|
|
3210
|
+
|
|
3207
3211
|
exports.BPS_DENOMINATOR = BPS_DENOMINATOR;
|
|
3208
3212
|
exports.CETUS_USDC_SUI_POOL = CETUS_USDC_SUI_POOL;
|
|
3209
3213
|
exports.CLOCK_ID = CLOCK_ID;
|
|
@@ -3226,10 +3230,14 @@ exports.USDC_DECIMALS = USDC_DECIMALS;
|
|
|
3226
3230
|
exports.ZkLoginSigner = ZkLoginSigner;
|
|
3227
3231
|
exports.addCollectFeeToTx = addCollectFeeToTx;
|
|
3228
3232
|
exports.allDescriptors = allDescriptors;
|
|
3233
|
+
exports.buildStakeVSuiTx = buildStakeVSuiTx;
|
|
3234
|
+
exports.buildSwapTx = buildSwapTx;
|
|
3235
|
+
exports.buildUnstakeVSuiTx = buildUnstakeVSuiTx;
|
|
3229
3236
|
exports.calculateFee = calculateFee;
|
|
3230
3237
|
exports.executeAutoTopUp = executeAutoTopUp;
|
|
3231
3238
|
exports.executeWithGas = executeWithGas;
|
|
3232
3239
|
exports.exportPrivateKey = exportPrivateKey;
|
|
3240
|
+
exports.findSwapRoute = findSwapRoute;
|
|
3233
3241
|
exports.formatAssetAmount = formatAssetAmount;
|
|
3234
3242
|
exports.formatSui = formatSui;
|
|
3235
3243
|
exports.formatUsd = formatUsd;
|
|
@@ -3239,6 +3247,7 @@ exports.getDecimals = getDecimals;
|
|
|
3239
3247
|
exports.getGasStatus = getGasStatus;
|
|
3240
3248
|
exports.getRates = getRates;
|
|
3241
3249
|
exports.getSwapQuote = getSwapQuote;
|
|
3250
|
+
exports.getVoloStats = getVoloStats;
|
|
3242
3251
|
exports.keypairFromPrivateKey = keypairFromPrivateKey;
|
|
3243
3252
|
exports.loadKey = loadKey;
|
|
3244
3253
|
exports.mapMoveAbortCode = mapMoveAbortCode;
|
|
@@ -3247,6 +3256,7 @@ exports.mistToSui = mistToSui;
|
|
|
3247
3256
|
exports.naviDescriptor = naviDescriptor;
|
|
3248
3257
|
exports.rawToStable = rawToStable;
|
|
3249
3258
|
exports.rawToUsdc = rawToUsdc;
|
|
3259
|
+
exports.resolveTokenType = resolveTokenType;
|
|
3250
3260
|
exports.saveKey = saveKey;
|
|
3251
3261
|
exports.shouldAutoTopUp = shouldAutoTopUp;
|
|
3252
3262
|
exports.simulateTransaction = simulateTransaction;
|