@suilend/springsui-cli 1.0.0
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/cli/src/index.d.ts +1 -0
- package/cli/src/index.js +304 -0
- package/package.json +1 -0
- package/sdk/src/_generated/_dependencies/source/0x1/ascii/structs.d.ts +92 -0
- package/sdk/src/_generated/_dependencies/source/0x1/ascii/structs.js +289 -0
- package/sdk/src/_generated/_dependencies/source/0x1/index.d.ts +3 -0
- package/sdk/src/_generated/_dependencies/source/0x1/index.js +6 -0
- package/sdk/src/_generated/_dependencies/source/0x1/option/structs.d.ts +52 -0
- package/sdk/src/_generated/_dependencies/source/0x1/option/structs.js +180 -0
- package/sdk/src/_generated/_dependencies/source/0x1/string/structs.d.ts +50 -0
- package/sdk/src/_generated/_dependencies/source/0x1/string/structs.js +167 -0
- package/sdk/src/_generated/_dependencies/source/0x1/type-name/structs.d.ts +53 -0
- package/sdk/src/_generated/_dependencies/source/0x1/type-name/structs.js +144 -0
- package/sdk/src/_generated/_dependencies/source/0x2/bag/structs.d.ts +61 -0
- package/sdk/src/_generated/_dependencies/source/0x2/bag/structs.js +149 -0
- package/sdk/src/_generated/_dependencies/source/0x2/balance/structs.d.ts +88 -0
- package/sdk/src/_generated/_dependencies/source/0x2/balance/structs.js +291 -0
- package/sdk/src/_generated/_dependencies/source/0x2/coin/structs.d.ts +460 -0
- package/sdk/src/_generated/_dependencies/source/0x2/coin/structs.js +1045 -0
- package/sdk/src/_generated/_dependencies/source/0x2/index.d.ts +3 -0
- package/sdk/src/_generated/_dependencies/source/0x2/index.js +6 -0
- package/sdk/src/_generated/_dependencies/source/0x2/object/structs.d.ts +92 -0
- package/sdk/src/_generated/_dependencies/source/0x2/object/structs.js +270 -0
- package/sdk/src/_generated/_dependencies/source/0x2/sui/structs.d.ts +46 -0
- package/sdk/src/_generated/_dependencies/source/0x2/sui/structs.js +142 -0
- package/sdk/src/_generated/_dependencies/source/0x2/table/structs.d.ts +61 -0
- package/sdk/src/_generated/_dependencies/source/0x2/table/structs.js +163 -0
- package/sdk/src/_generated/_dependencies/source/0x2/url/structs.d.ts +53 -0
- package/sdk/src/_generated/_dependencies/source/0x2/url/structs.js +143 -0
- package/sdk/src/_generated/_dependencies/source/0x2/vec-map/structs.d.ts +111 -0
- package/sdk/src/_generated/_dependencies/source/0x2/vec-map/structs.js +325 -0
- package/sdk/src/_generated/_dependencies/source/0x3/index.d.ts +3 -0
- package/sdk/src/_generated/_dependencies/source/0x3/index.js +6 -0
- package/sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.d.ts +487 -0
- package/sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.js +915 -0
- package/sdk/src/_generated/_framework/reified.d.ts +108 -0
- package/sdk/src/_generated/_framework/reified.js +240 -0
- package/sdk/src/_generated/_framework/util.d.ts +35 -0
- package/sdk/src/_generated/_framework/util.js +334 -0
- package/sdk/src/_generated/_framework/vector.d.ts +35 -0
- package/sdk/src/_generated/_framework/vector.js +77 -0
- package/sdk/src/_generated/liquid_staking/cell/structs.d.ts +54 -0
- package/sdk/src/_generated/liquid_staking/cell/structs.js +156 -0
- package/sdk/src/_generated/liquid_staking/fees/functions.d.ts +51 -0
- package/sdk/src/_generated/liquid_staking/fees/functions.js +130 -0
- package/sdk/src/_generated/liquid_staking/fees/structs.d.ts +165 -0
- package/sdk/src/_generated/liquid_staking/fees/structs.js +307 -0
- package/sdk/src/_generated/liquid_staking/index.d.ts +4 -0
- package/sdk/src/_generated/liquid_staking/index.js +10 -0
- package/sdk/src/_generated/liquid_staking/liquid-staking/functions.d.ts +88 -0
- package/sdk/src/_generated/liquid_staking/liquid-staking/functions.js +199 -0
- package/sdk/src/_generated/liquid_staking/liquid-staking/structs.d.ts +955 -0
- package/sdk/src/_generated/liquid_staking/liquid-staking/structs.js +1477 -0
- package/sdk/src/_generated/liquid_staking/storage/structs.d.ts +358 -0
- package/sdk/src/_generated/liquid_staking/storage/structs.js +365 -0
- package/sdk/src/_generated/liquid_staking/version/structs.d.ts +46 -0
- package/sdk/src/_generated/liquid_staking/version/structs.js +143 -0
- package/sdk/src/_generated/liquid_staking/weight/functions.d.ts +19 -0
- package/sdk/src/_generated/liquid_staking/weight/functions.js +44 -0
- package/sdk/src/_generated/liquid_staking/weight/structs.d.ts +205 -0
- package/sdk/src/_generated/liquid_staking/weight/structs.js +332 -0
- package/sdk/src/index.d.ts +44 -0
- package/sdk/src/index.js +234 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/cli/src/index.js
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
const client_1 = require("@mysten/sui/client");
|
|
36
|
+
const ed25519_1 = require("@mysten/sui/keypairs/ed25519");
|
|
37
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
38
|
+
const utils_1 = require("@mysten/sui/utils");
|
|
39
|
+
const commander_1 = require("commander");
|
|
40
|
+
const sdk = __importStar(require("../../sdk/src"));
|
|
41
|
+
const src_1 = require("../../sdk/src");
|
|
42
|
+
const liquid_staking_1 = require("../../sdk/src/_generated/liquid_staking");
|
|
43
|
+
const LIQUID_STAKING_INFO = {
|
|
44
|
+
id: "0xdae271405d47f04ab6c824d3b362b7375844ec987a2627845af715fdcd835795",
|
|
45
|
+
type: "0xba2a31b3b21776d859c9fdfe797f52b069fe8fe0961605ab093ca4eb437d2632::ripleys::RIPLEYS",
|
|
46
|
+
weightHookId: "0xf244912738939d351aa762dd98c075f873fd95f2928db5fd9e74fbb01c9a686c",
|
|
47
|
+
};
|
|
48
|
+
const RPC_URL = "https://fullnode.mainnet.sui.io";
|
|
49
|
+
const keypair = ed25519_1.Ed25519Keypair.fromSecretKey((0, utils_1.fromBase64)(process.env.SUI_SECRET_KEY));
|
|
50
|
+
function mint(options) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
53
|
+
const lstClient = yield src_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
54
|
+
const tx = new transactions_1.Transaction();
|
|
55
|
+
const [sui] = tx.splitCoins(tx.gas, [BigInt(options.amount)]);
|
|
56
|
+
const rSui = lstClient.mint(tx, sui);
|
|
57
|
+
tx.transferObjects([rSui], keypair.toSuiAddress());
|
|
58
|
+
const txResponse = yield client.signAndExecuteTransaction({
|
|
59
|
+
transaction: tx,
|
|
60
|
+
signer: keypair,
|
|
61
|
+
options: {
|
|
62
|
+
showEvents: true,
|
|
63
|
+
showEffects: true,
|
|
64
|
+
showObjectChanges: true,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
console.log(txResponse);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function redeem(options) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
73
|
+
const lstCoins = yield client.getCoins({
|
|
74
|
+
owner: keypair.toSuiAddress(),
|
|
75
|
+
coinType: LIQUID_STAKING_INFO.type,
|
|
76
|
+
limit: 1000,
|
|
77
|
+
});
|
|
78
|
+
const tx = new transactions_1.Transaction();
|
|
79
|
+
const lstClient = yield src_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
80
|
+
if (lstCoins.data.length > 1) {
|
|
81
|
+
tx.mergeCoins(lstCoins.data[0].coinObjectId, lstCoins.data.slice(1).map((c) => c.coinObjectId));
|
|
82
|
+
}
|
|
83
|
+
const [lst] = tx.splitCoins(lstCoins.data[0].coinObjectId, [
|
|
84
|
+
BigInt(options.amount),
|
|
85
|
+
]);
|
|
86
|
+
const sui = lstClient.redeemLst(tx, lst);
|
|
87
|
+
tx.transferObjects([sui], keypair.toSuiAddress());
|
|
88
|
+
const txResponse = yield client.signAndExecuteTransaction({
|
|
89
|
+
transaction: tx,
|
|
90
|
+
signer: keypair,
|
|
91
|
+
options: {
|
|
92
|
+
showEvents: true,
|
|
93
|
+
showEffects: true,
|
|
94
|
+
showObjectChanges: true,
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
console.log(txResponse);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function increaseValidatorStake(options) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
103
|
+
const lstClient = yield src_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
104
|
+
const adminCapId = yield lstClient.getAdminCapId(keypair.toSuiAddress());
|
|
105
|
+
if (!adminCapId)
|
|
106
|
+
return;
|
|
107
|
+
const tx = new transactions_1.Transaction();
|
|
108
|
+
lstClient.increaseValidatorStake(tx, adminCapId, options.validatorAddress, options.amount);
|
|
109
|
+
const txResponse = yield client.signAndExecuteTransaction({
|
|
110
|
+
transaction: tx,
|
|
111
|
+
signer: keypair,
|
|
112
|
+
options: {
|
|
113
|
+
showEvents: true,
|
|
114
|
+
showEffects: true,
|
|
115
|
+
showObjectChanges: true,
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
console.log(txResponse);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function decreaseValidatorStake(options) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
124
|
+
const lstClient = yield src_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
125
|
+
const adminCapId = yield lstClient.getAdminCapId(keypair.toSuiAddress());
|
|
126
|
+
if (!adminCapId)
|
|
127
|
+
return;
|
|
128
|
+
const tx = new transactions_1.Transaction();
|
|
129
|
+
lstClient.decreaseValidatorStake(tx, adminCapId, options.validatorIndex, options.amount);
|
|
130
|
+
const txResponse = yield client.signAndExecuteTransaction({
|
|
131
|
+
transaction: tx,
|
|
132
|
+
signer: keypair,
|
|
133
|
+
options: {
|
|
134
|
+
showEvents: true,
|
|
135
|
+
showEffects: true,
|
|
136
|
+
showObjectChanges: true,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
console.log(txResponse);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
function updateFees(options) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
var _a;
|
|
145
|
+
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
146
|
+
const lstClient = yield src_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
147
|
+
const adminCap = (yield client.getOwnedObjects({
|
|
148
|
+
owner: keypair.toSuiAddress(),
|
|
149
|
+
filter: {
|
|
150
|
+
StructType: `${liquid_staking_1.PACKAGE_ID}::liquid_staking::AdminCap<${LIQUID_STAKING_INFO.type}>`,
|
|
151
|
+
},
|
|
152
|
+
})).data[0];
|
|
153
|
+
const adminCapId = (_a = adminCap.data) === null || _a === void 0 ? void 0 : _a.objectId;
|
|
154
|
+
if (!adminCapId)
|
|
155
|
+
return;
|
|
156
|
+
const tx = new transactions_1.Transaction();
|
|
157
|
+
lstClient.updateFees(tx, adminCapId, options);
|
|
158
|
+
const txResponse = yield client.signAndExecuteTransaction({
|
|
159
|
+
transaction: tx,
|
|
160
|
+
signer: keypair,
|
|
161
|
+
options: {
|
|
162
|
+
showEvents: true,
|
|
163
|
+
showEffects: true,
|
|
164
|
+
showObjectChanges: true,
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
console.log(txResponse);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function initializeWeightHook(options) {
|
|
171
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
+
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
173
|
+
const lstClient = yield src_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
174
|
+
const adminCapId = yield lstClient.getAdminCapId(keypair.toSuiAddress());
|
|
175
|
+
if (!adminCapId)
|
|
176
|
+
return;
|
|
177
|
+
const tx = new transactions_1.Transaction();
|
|
178
|
+
const weightHookAdminCap = lstClient.initializeWeightHook(tx, adminCapId);
|
|
179
|
+
tx.transferObjects([weightHookAdminCap], keypair.toSuiAddress());
|
|
180
|
+
const txResponse = yield client.signAndExecuteTransaction({
|
|
181
|
+
transaction: tx,
|
|
182
|
+
signer: keypair,
|
|
183
|
+
options: {
|
|
184
|
+
showEvents: true,
|
|
185
|
+
showEffects: true,
|
|
186
|
+
showObjectChanges: true,
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
console.log(txResponse);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function setValidatorAddressesAndWeights(options) {
|
|
193
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
194
|
+
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
195
|
+
const lstClient = yield src_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
196
|
+
if (options.validators.length != options.weights.length) {
|
|
197
|
+
throw new Error("Validators and weights arrays must be of the same length");
|
|
198
|
+
}
|
|
199
|
+
const validatorAddressesAndWeights = new Map();
|
|
200
|
+
for (let i = 0; i < options.validators.length; i++) {
|
|
201
|
+
validatorAddressesAndWeights.set(options.validators[i], options.weights[i]);
|
|
202
|
+
}
|
|
203
|
+
console.log(validatorAddressesAndWeights);
|
|
204
|
+
const weightHookAdminCapId = yield lstClient.getWeightHookAdminCapId(keypair.toSuiAddress());
|
|
205
|
+
if (!weightHookAdminCapId)
|
|
206
|
+
return;
|
|
207
|
+
const tx = new transactions_1.Transaction();
|
|
208
|
+
lstClient.setValidatorAddressesAndWeights(tx, LIQUID_STAKING_INFO.weightHookId, weightHookAdminCapId, validatorAddressesAndWeights);
|
|
209
|
+
const txResponse = yield client.signAndExecuteTransaction({
|
|
210
|
+
transaction: tx,
|
|
211
|
+
signer: keypair,
|
|
212
|
+
options: {
|
|
213
|
+
showEvents: true,
|
|
214
|
+
showEffects: true,
|
|
215
|
+
showObjectChanges: true,
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
console.log(txResponse);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function rebalance(options) {
|
|
222
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
223
|
+
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
224
|
+
const lstClient = yield src_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
225
|
+
const tx = new transactions_1.Transaction();
|
|
226
|
+
lstClient.rebalance(tx, LIQUID_STAKING_INFO.weightHookId);
|
|
227
|
+
const txResponse = yield client.signAndExecuteTransaction({
|
|
228
|
+
transaction: tx,
|
|
229
|
+
signer: keypair,
|
|
230
|
+
options: {
|
|
231
|
+
showEvents: true,
|
|
232
|
+
showEffects: true,
|
|
233
|
+
showObjectChanges: true,
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
console.log(txResponse);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
commander_1.program.version("1.0.0").description("Spring Sui CLI");
|
|
240
|
+
commander_1.program
|
|
241
|
+
.command("mint")
|
|
242
|
+
.description("mint some rSui")
|
|
243
|
+
.option("--amount <SUI>", "Amount of SUI in MIST")
|
|
244
|
+
.action(mint);
|
|
245
|
+
commander_1.program
|
|
246
|
+
.command("redeem")
|
|
247
|
+
.description("redeem some SUI")
|
|
248
|
+
.option("--amount <LST>", "Amount of LST to redeem")
|
|
249
|
+
.action(redeem);
|
|
250
|
+
commander_1.program
|
|
251
|
+
.command("increase-validator-stake")
|
|
252
|
+
.description("increase validator stake")
|
|
253
|
+
.option("--validator-address <VALIDATOR>", "Validator address")
|
|
254
|
+
.option("--amount <SUI>", "Amount of SUI to delegate to validator")
|
|
255
|
+
.action(increaseValidatorStake);
|
|
256
|
+
commander_1.program
|
|
257
|
+
.command("decrease-validator-stake")
|
|
258
|
+
.description("decrease validator stake")
|
|
259
|
+
.option("--validator-index <VALIDATOR_INDEX>", "Validator index")
|
|
260
|
+
.option("--amount <SUI>", "Amount of SUI to undelegate from validator")
|
|
261
|
+
.action(decreaseValidatorStake);
|
|
262
|
+
commander_1.program
|
|
263
|
+
.command("update-fees")
|
|
264
|
+
.description("update fees")
|
|
265
|
+
.option("--mint-fee-bps <MINT_FEE_BPS>", "Mint fee bps")
|
|
266
|
+
.option("--redeem-fee-bps <REDEEM_FEE_BPS>", "Redeem fee bps")
|
|
267
|
+
.option("--spread-fee <SPREAD_FEE>", "Spread fee")
|
|
268
|
+
.action(updateFees);
|
|
269
|
+
commander_1.program
|
|
270
|
+
.command("fetch-state")
|
|
271
|
+
.description("fetch the current state of the liquid staking pool")
|
|
272
|
+
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
273
|
+
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
274
|
+
try {
|
|
275
|
+
const state = yield sdk.fetchLiquidStakingInfo(LIQUID_STAKING_INFO, client);
|
|
276
|
+
console.log("Current Liquid Staking State:");
|
|
277
|
+
console.log(JSON.stringify(state, null, 2));
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
console.error("Error fetching state:", error);
|
|
281
|
+
}
|
|
282
|
+
}));
|
|
283
|
+
commander_1.program
|
|
284
|
+
.command("initialize-weight-hook")
|
|
285
|
+
.description("initialize weight hook")
|
|
286
|
+
.action(initializeWeightHook);
|
|
287
|
+
function collect(pair, previous) {
|
|
288
|
+
const [key, value] = pair.split("=");
|
|
289
|
+
if (!value) {
|
|
290
|
+
throw new Error(`Invalid format for ${pair}. Use key=value format.`);
|
|
291
|
+
}
|
|
292
|
+
return Object.assign(Object.assign({}, previous), { [key]: value });
|
|
293
|
+
}
|
|
294
|
+
commander_1.program
|
|
295
|
+
.command("set-validator-addresses-and-weights")
|
|
296
|
+
.description("set validator addresses and weights")
|
|
297
|
+
.option("-v, --validators <VALIDATOR_ADDRESSES...>", "Validator addresses")
|
|
298
|
+
.option("-w, --weights <WEIGHTS...>", "Weights")
|
|
299
|
+
.action(setValidatorAddressesAndWeights);
|
|
300
|
+
commander_1.program
|
|
301
|
+
.command("rebalance")
|
|
302
|
+
.description("rebalance the validator set")
|
|
303
|
+
.action(rebalance);
|
|
304
|
+
commander_1.program.parse(process.argv);
|
package/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@suilend/springsui-cli","version":"1.0.0","private":false,"description":"A CLI for interacting with the SpringSui program","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./cli/src":"./cli/src/index.js","./sdk/src":"./sdk/src/index.js","./sdk/src/_generated/_framework/reified":"./sdk/src/_generated/_framework/reified.js","./sdk/src/_generated/_framework/util":"./sdk/src/_generated/_framework/util.js","./sdk/src/_generated/_framework/vector":"./sdk/src/_generated/_framework/vector.js","./sdk/src/_generated/liquid_staking":"./sdk/src/_generated/liquid_staking/index.js","./sdk/src/_generated/liquid_staking/cell/structs":"./sdk/src/_generated/liquid_staking/cell/structs.js","./sdk/src/_generated/liquid_staking/fees/functions":"./sdk/src/_generated/liquid_staking/fees/functions.js","./sdk/src/_generated/liquid_staking/fees/structs":"./sdk/src/_generated/liquid_staking/fees/structs.js","./sdk/src/_generated/liquid_staking/liquid-staking/functions":"./sdk/src/_generated/liquid_staking/liquid-staking/functions.js","./sdk/src/_generated/liquid_staking/liquid-staking/structs":"./sdk/src/_generated/liquid_staking/liquid-staking/structs.js","./sdk/src/_generated/liquid_staking/storage/structs":"./sdk/src/_generated/liquid_staking/storage/structs.js","./sdk/src/_generated/liquid_staking/version/structs":"./sdk/src/_generated/liquid_staking/version/structs.js","./sdk/src/_generated/liquid_staking/weight/functions":"./sdk/src/_generated/liquid_staking/weight/functions.js","./sdk/src/_generated/liquid_staking/weight/structs":"./sdk/src/_generated/liquid_staking/weight/structs.js","./sdk/src/_generated/_dependencies/source/0x1":"./sdk/src/_generated/_dependencies/source/0x1/index.js","./sdk/src/_generated/_dependencies/source/0x2":"./sdk/src/_generated/_dependencies/source/0x2/index.js","./sdk/src/_generated/_dependencies/source/0x3":"./sdk/src/_generated/_dependencies/source/0x3/index.js","./sdk/src/_generated/_dependencies/source/0x1/ascii/structs":"./sdk/src/_generated/_dependencies/source/0x1/ascii/structs.js","./sdk/src/_generated/_dependencies/source/0x1/option/structs":"./sdk/src/_generated/_dependencies/source/0x1/option/structs.js","./sdk/src/_generated/_dependencies/source/0x1/string/structs":"./sdk/src/_generated/_dependencies/source/0x1/string/structs.js","./sdk/src/_generated/_dependencies/source/0x1/type-name/structs":"./sdk/src/_generated/_dependencies/source/0x1/type-name/structs.js","./sdk/src/_generated/_dependencies/source/0x2/bag/structs":"./sdk/src/_generated/_dependencies/source/0x2/bag/structs.js","./sdk/src/_generated/_dependencies/source/0x2/balance/structs":"./sdk/src/_generated/_dependencies/source/0x2/balance/structs.js","./sdk/src/_generated/_dependencies/source/0x2/coin/structs":"./sdk/src/_generated/_dependencies/source/0x2/coin/structs.js","./sdk/src/_generated/_dependencies/source/0x2/object/structs":"./sdk/src/_generated/_dependencies/source/0x2/object/structs.js","./sdk/src/_generated/_dependencies/source/0x2/sui/structs":"./sdk/src/_generated/_dependencies/source/0x2/sui/structs.js","./sdk/src/_generated/_dependencies/source/0x2/table/structs":"./sdk/src/_generated/_dependencies/source/0x2/table/structs.js","./sdk/src/_generated/_dependencies/source/0x2/url/structs":"./sdk/src/_generated/_dependencies/source/0x2/url/structs.js","./sdk/src/_generated/_dependencies/source/0x2/vec-map/structs":"./sdk/src/_generated/_dependencies/source/0x2/vec-map/structs.js","./sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs":"./sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix \"./src/**/*.ts\"","prettier":"prettier --write \"./src/**/*\"","lint":"bun eslint && bun prettier && bun tsc","release":"bun run build && bun ts-node ./prepublish.ts && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/solendprotocol/liquid-staking.git"},"bugs":{"url":"https://github.com/solendprotocol/liquid-staking/issues"},"dependencies":{"@mysten/bcs":"1.1.0","@mysten/sui":"1.12.0","commander":"^12.1.0","uuid":"^9.0.1"},"devDependencies":{"@types/node":"^20.12.7","ts-node":"^10.9.2","typescript":"^5.3.3"}}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as reified from "../../../../_framework/reified";
|
|
2
|
+
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
3
|
+
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
4
|
+
import { Vector } from "../../../../_framework/vector";
|
|
5
|
+
import { PKG_V10 } from "../index";
|
|
6
|
+
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
7
|
+
export declare function isChar(type: string): boolean;
|
|
8
|
+
export interface CharFields {
|
|
9
|
+
byte: ToField<"u8">;
|
|
10
|
+
}
|
|
11
|
+
export type CharReified = Reified<Char, CharFields>;
|
|
12
|
+
export declare class Char implements StructClass {
|
|
13
|
+
__StructClass: true;
|
|
14
|
+
static readonly $typeName = "0x1::ascii::Char";
|
|
15
|
+
static readonly $numTypeParams = 0;
|
|
16
|
+
static readonly $isPhantom: readonly [];
|
|
17
|
+
readonly $typeName = "0x1::ascii::Char";
|
|
18
|
+
readonly $fullTypeName: `${typeof PKG_V10}::ascii::Char`;
|
|
19
|
+
readonly $typeArgs: [];
|
|
20
|
+
readonly $isPhantom: readonly [];
|
|
21
|
+
readonly byte: ToField<"u8">;
|
|
22
|
+
private constructor();
|
|
23
|
+
static reified(): CharReified;
|
|
24
|
+
static get r(): reified.StructClassReified<Char, CharFields>;
|
|
25
|
+
static phantom(): PhantomReified<ToTypeStr<Char>>;
|
|
26
|
+
static get p(): reified.PhantomReified<"0x1::ascii::Char">;
|
|
27
|
+
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
28
|
+
byte: number;
|
|
29
|
+
}, {
|
|
30
|
+
byte: number;
|
|
31
|
+
}>;
|
|
32
|
+
static fromFields(fields: Record<string, any>): Char;
|
|
33
|
+
static fromFieldsWithTypes(item: FieldsWithTypes): Char;
|
|
34
|
+
static fromBcs(data: Uint8Array): Char;
|
|
35
|
+
toJSONField(): {
|
|
36
|
+
byte: number;
|
|
37
|
+
};
|
|
38
|
+
toJSON(): {
|
|
39
|
+
byte: number;
|
|
40
|
+
$typeName: string;
|
|
41
|
+
$typeArgs: [];
|
|
42
|
+
};
|
|
43
|
+
static fromJSONField(field: any): Char;
|
|
44
|
+
static fromJSON(json: Record<string, any>): Char;
|
|
45
|
+
static fromSuiParsedData(content: SuiParsedData): Char;
|
|
46
|
+
static fromSuiObjectData(data: SuiObjectData): Char;
|
|
47
|
+
static fetch(client: SuiClient, id: string): Promise<Char>;
|
|
48
|
+
}
|
|
49
|
+
export declare function isString(type: string): boolean;
|
|
50
|
+
export interface StringFields {
|
|
51
|
+
bytes: ToField<Vector<"u8">>;
|
|
52
|
+
}
|
|
53
|
+
export type StringReified = Reified<String, StringFields>;
|
|
54
|
+
export declare class String implements StructClass {
|
|
55
|
+
__StructClass: true;
|
|
56
|
+
static readonly $typeName = "0x1::ascii::String";
|
|
57
|
+
static readonly $numTypeParams = 0;
|
|
58
|
+
static readonly $isPhantom: readonly [];
|
|
59
|
+
readonly $typeName = "0x1::ascii::String";
|
|
60
|
+
readonly $fullTypeName: `${typeof PKG_V10}::ascii::String`;
|
|
61
|
+
readonly $typeArgs: [];
|
|
62
|
+
readonly $isPhantom: readonly [];
|
|
63
|
+
readonly bytes: ToField<Vector<"u8">>;
|
|
64
|
+
private constructor();
|
|
65
|
+
static reified(): StringReified;
|
|
66
|
+
static get r(): reified.StructClassReified<String, StringFields>;
|
|
67
|
+
static phantom(): PhantomReified<ToTypeStr<String>>;
|
|
68
|
+
static get p(): reified.PhantomReified<"0x1::ascii::String">;
|
|
69
|
+
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
70
|
+
bytes: number[];
|
|
71
|
+
}, {
|
|
72
|
+
bytes: Iterable<number> & {
|
|
73
|
+
length: number;
|
|
74
|
+
};
|
|
75
|
+
}>;
|
|
76
|
+
static fromFields(fields: Record<string, any>): String;
|
|
77
|
+
static fromFieldsWithTypes(item: FieldsWithTypes): String;
|
|
78
|
+
static fromBcs(data: Uint8Array): String;
|
|
79
|
+
toJSONField(): {
|
|
80
|
+
bytes: number[];
|
|
81
|
+
};
|
|
82
|
+
toJSON(): {
|
|
83
|
+
bytes: number[];
|
|
84
|
+
$typeName: string;
|
|
85
|
+
$typeArgs: [];
|
|
86
|
+
};
|
|
87
|
+
static fromJSONField(field: any): String;
|
|
88
|
+
static fromJSON(json: Record<string, any>): String;
|
|
89
|
+
static fromSuiParsedData(content: SuiParsedData): String;
|
|
90
|
+
static fromSuiObjectData(data: SuiObjectData): String;
|
|
91
|
+
static fetch(client: SuiClient, id: string): Promise<String>;
|
|
92
|
+
}
|