@suilend/springsui-cli 1.0.0 → 1.0.2
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/README.md +7 -0
- package/cli/src/index.js +57 -17
- package/package.json +1 -1
- package/sdk/src/_generated/_dependencies/source/0x1/ascii/structs.d.ts +3 -3
- package/sdk/src/_generated/_dependencies/source/0x1/ascii/structs.js +4 -4
- package/sdk/src/_generated/_dependencies/source/0x1/index.d.ts +1 -1
- package/sdk/src/_generated/_dependencies/source/0x1/index.js +2 -2
- package/sdk/src/_generated/_dependencies/source/0x1/option/structs.d.ts +2 -2
- package/sdk/src/_generated/_dependencies/source/0x1/option/structs.js +2 -2
- package/sdk/src/_generated/_dependencies/source/0x1/string/structs.d.ts +2 -2
- package/sdk/src/_generated/_dependencies/source/0x1/string/structs.js +2 -2
- package/sdk/src/_generated/_dependencies/source/0x1/type-name/structs.d.ts +2 -2
- package/sdk/src/_generated/_dependencies/source/0x1/type-name/structs.js +2 -2
- package/sdk/src/_generated/_dependencies/source/0x3/index.d.ts +1 -1
- package/sdk/src/_generated/_dependencies/source/0x3/index.js +2 -2
- package/sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.d.ts +7 -7
- package/sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.js +12 -12
- package/sdk/src/_generated/liquid_staking/cell/structs.d.ts +2 -2
- package/sdk/src/_generated/liquid_staking/fees/structs.d.ts +6 -6
- package/sdk/src/_generated/liquid_staking/index.d.ts +2 -2
- package/sdk/src/_generated/liquid_staking/index.js +3 -3
- package/sdk/src/_generated/liquid_staking/liquid-staking/functions.d.ts +1 -1
- package/sdk/src/_generated/liquid_staking/liquid-staking/functions.js +1 -1
- package/sdk/src/_generated/liquid_staking/liquid-staking/structs.d.ts +28 -28
- package/sdk/src/_generated/liquid_staking/storage/structs.d.ts +6 -6
- package/sdk/src/_generated/liquid_staking/version/structs.d.ts +3 -3
- package/sdk/src/_generated/liquid_staking/weight/functions.d.ts +20 -0
- package/sdk/src/_generated/liquid_staking/weight/functions.js +41 -0
- package/sdk/src/_generated/liquid_staking/weight/structs.d.ts +46 -4
- package/sdk/src/_generated/liquid_staking/weight/structs.js +127 -1
- package/sdk/src/index.d.ts +12 -8
- package/sdk/src/index.js +71 -22
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# springsui/cli
|
|
2
|
+
|
|
3
|
+
A CLI for interacting with the SpringSui program published on npm as [`@suilend/springsui-cli`](https://www.npmjs.com/package/@suilend/springsui-cli).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Got a suggestion, running into issues, or have a question? Join our [#dev-support](https://discord.com/channels/1202984617087598622/1238023733403193385) channel on Discord.
|
package/cli/src/index.js
CHANGED
|
@@ -37,20 +37,23 @@ const ed25519_1 = require("@mysten/sui/keypairs/ed25519");
|
|
|
37
37
|
const transactions_1 = require("@mysten/sui/transactions");
|
|
38
38
|
const utils_1 = require("@mysten/sui/utils");
|
|
39
39
|
const commander_1 = require("commander");
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const liquid_staking_1 = require("
|
|
40
|
+
const springsui_sdk_1 = require("@suilend/springsui-sdk");
|
|
41
|
+
const sdk = __importStar(require("@suilend/springsui-sdk"));
|
|
42
|
+
const liquid_staking_1 = require("@suilend/springsui-sdk/_generated/liquid_staking");
|
|
43
43
|
const LIQUID_STAKING_INFO = {
|
|
44
|
-
id: "
|
|
45
|
-
type: "
|
|
46
|
-
weightHookId: "
|
|
44
|
+
id: "0x15eda7330c8f99c30e430b4d82fd7ab2af3ead4ae17046fcb224aa9bad394f6b",
|
|
45
|
+
type: "0x83556891f4a0f233ce7b05cfe7f957d4020492a34f5405b2cb9377d060bef4bf::spring_sui::SPRING_SUI",
|
|
46
|
+
weightHookId: "0xbbafcb2d7399c0846f8185da3f273ad5b26b3b35993050affa44cfa890f1f144",
|
|
47
47
|
};
|
|
48
48
|
const RPC_URL = "https://fullnode.mainnet.sui.io";
|
|
49
49
|
const keypair = ed25519_1.Ed25519Keypair.fromSecretKey((0, utils_1.fromBase64)(process.env.SUI_SECRET_KEY));
|
|
50
|
+
// const keypair = Ed25519Keypair.fromSecretKey(
|
|
51
|
+
// fromHex(fs.readFileSync(process.env.SUI_SECRET_KEY_PATH!).toString()),
|
|
52
|
+
// );
|
|
50
53
|
function mint(options) {
|
|
51
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
55
|
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
53
|
-
const lstClient = yield
|
|
56
|
+
const lstClient = yield springsui_sdk_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
54
57
|
const tx = new transactions_1.Transaction();
|
|
55
58
|
const [sui] = tx.splitCoins(tx.gas, [BigInt(options.amount)]);
|
|
56
59
|
const rSui = lstClient.mint(tx, sui);
|
|
@@ -76,7 +79,7 @@ function redeem(options) {
|
|
|
76
79
|
limit: 1000,
|
|
77
80
|
});
|
|
78
81
|
const tx = new transactions_1.Transaction();
|
|
79
|
-
const lstClient = yield
|
|
82
|
+
const lstClient = yield springsui_sdk_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
80
83
|
if (lstCoins.data.length > 1) {
|
|
81
84
|
tx.mergeCoins(lstCoins.data[0].coinObjectId, lstCoins.data.slice(1).map((c) => c.coinObjectId));
|
|
82
85
|
}
|
|
@@ -100,7 +103,7 @@ function redeem(options) {
|
|
|
100
103
|
function increaseValidatorStake(options) {
|
|
101
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
105
|
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
103
|
-
const lstClient = yield
|
|
106
|
+
const lstClient = yield springsui_sdk_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
104
107
|
const adminCapId = yield lstClient.getAdminCapId(keypair.toSuiAddress());
|
|
105
108
|
if (!adminCapId)
|
|
106
109
|
return;
|
|
@@ -121,7 +124,7 @@ function increaseValidatorStake(options) {
|
|
|
121
124
|
function decreaseValidatorStake(options) {
|
|
122
125
|
return __awaiter(this, void 0, void 0, function* () {
|
|
123
126
|
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
124
|
-
const lstClient = yield
|
|
127
|
+
const lstClient = yield springsui_sdk_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
125
128
|
const adminCapId = yield lstClient.getAdminCapId(keypair.toSuiAddress());
|
|
126
129
|
if (!adminCapId)
|
|
127
130
|
return;
|
|
@@ -143,7 +146,7 @@ function updateFees(options) {
|
|
|
143
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
144
147
|
var _a;
|
|
145
148
|
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
146
|
-
const lstClient = yield
|
|
149
|
+
const lstClient = yield springsui_sdk_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
147
150
|
const adminCap = (yield client.getOwnedObjects({
|
|
148
151
|
owner: keypair.toSuiAddress(),
|
|
149
152
|
filter: {
|
|
@@ -170,7 +173,7 @@ function updateFees(options) {
|
|
|
170
173
|
function initializeWeightHook(options) {
|
|
171
174
|
return __awaiter(this, void 0, void 0, function* () {
|
|
172
175
|
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
173
|
-
const lstClient = yield
|
|
176
|
+
const lstClient = yield springsui_sdk_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
174
177
|
const adminCapId = yield lstClient.getAdminCapId(keypair.toSuiAddress());
|
|
175
178
|
if (!adminCapId)
|
|
176
179
|
return;
|
|
@@ -192,16 +195,16 @@ function initializeWeightHook(options) {
|
|
|
192
195
|
function setValidatorAddressesAndWeights(options) {
|
|
193
196
|
return __awaiter(this, void 0, void 0, function* () {
|
|
194
197
|
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
195
|
-
const lstClient = yield
|
|
198
|
+
const lstClient = yield springsui_sdk_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
196
199
|
if (options.validators.length != options.weights.length) {
|
|
197
200
|
throw new Error("Validators and weights arrays must be of the same length");
|
|
198
201
|
}
|
|
199
|
-
const validatorAddressesAndWeights =
|
|
202
|
+
const validatorAddressesAndWeights = {};
|
|
200
203
|
for (let i = 0; i < options.validators.length; i++) {
|
|
201
|
-
validatorAddressesAndWeights
|
|
204
|
+
validatorAddressesAndWeights[options.validators[i]] = options.weights[i];
|
|
202
205
|
}
|
|
203
206
|
console.log(validatorAddressesAndWeights);
|
|
204
|
-
const weightHookAdminCapId = yield
|
|
207
|
+
const weightHookAdminCapId = yield springsui_sdk_1.LstClient.getWeightHookAdminCapId(client, keypair.toSuiAddress(), LIQUID_STAKING_INFO.type);
|
|
205
208
|
if (!weightHookAdminCapId)
|
|
206
209
|
return;
|
|
207
210
|
const tx = new transactions_1.Transaction();
|
|
@@ -221,7 +224,7 @@ function setValidatorAddressesAndWeights(options) {
|
|
|
221
224
|
function rebalance(options) {
|
|
222
225
|
return __awaiter(this, void 0, void 0, function* () {
|
|
223
226
|
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
224
|
-
const lstClient = yield
|
|
227
|
+
const lstClient = yield springsui_sdk_1.LstClient.initialize(client, LIQUID_STAKING_INFO);
|
|
225
228
|
const tx = new transactions_1.Transaction();
|
|
226
229
|
lstClient.rebalance(tx, LIQUID_STAKING_INFO.weightHookId);
|
|
227
230
|
const txResponse = yield client.signAndExecuteTransaction({
|
|
@@ -236,6 +239,38 @@ function rebalance(options) {
|
|
|
236
239
|
console.log(txResponse);
|
|
237
240
|
});
|
|
238
241
|
}
|
|
242
|
+
function createNewLst(options) {
|
|
243
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
+
var _a;
|
|
245
|
+
const client = new client_1.SuiClient({ url: RPC_URL });
|
|
246
|
+
const treasuryCap = yield client.getObject({
|
|
247
|
+
id: options.treasuryCap,
|
|
248
|
+
options: {
|
|
249
|
+
showContent: true,
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
console.log(treasuryCap);
|
|
253
|
+
// '0x2::coin::TreasuryCap<0xdc0c8026236f1be172ba03d7d689bfd663497cc5a730bf367bfb2e2c72ec6df8::ripleys::RIPLEYS>'
|
|
254
|
+
const type = ((_a = treasuryCap.data) === null || _a === void 0 ? void 0 : _a.content).type;
|
|
255
|
+
if (!type)
|
|
256
|
+
return;
|
|
257
|
+
const coinType = type.substring(type.indexOf("<") + 1, type.lastIndexOf(">"));
|
|
258
|
+
console.log(coinType);
|
|
259
|
+
const tx = new transactions_1.Transaction();
|
|
260
|
+
const weightHookAdminCap = springsui_sdk_1.LstClient.createNewLst(tx, options.treasuryCap, coinType);
|
|
261
|
+
tx.transferObjects([tx.object(weightHookAdminCap)], keypair.toSuiAddress());
|
|
262
|
+
const txResponse = yield client.signAndExecuteTransaction({
|
|
263
|
+
transaction: tx,
|
|
264
|
+
signer: keypair,
|
|
265
|
+
options: {
|
|
266
|
+
showEvents: true,
|
|
267
|
+
showEffects: true,
|
|
268
|
+
showObjectChanges: true,
|
|
269
|
+
},
|
|
270
|
+
});
|
|
271
|
+
console.log(txResponse);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
239
274
|
commander_1.program.version("1.0.0").description("Spring Sui CLI");
|
|
240
275
|
commander_1.program
|
|
241
276
|
.command("mint")
|
|
@@ -301,4 +336,9 @@ commander_1.program
|
|
|
301
336
|
.command("rebalance")
|
|
302
337
|
.description("rebalance the validator set")
|
|
303
338
|
.action(rebalance);
|
|
339
|
+
commander_1.program
|
|
340
|
+
.command("create-new-lst")
|
|
341
|
+
.description("create a new liquid staking pool")
|
|
342
|
+
.option("--treasury-cap <TREASURY_CAP>", "Treasury cap")
|
|
343
|
+
.action(createNewLst);
|
|
304
344
|
commander_1.program.parse(process.argv);
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/springsui-cli","version":"1.0.
|
|
1
|
+
{"name":"@suilend/springsui-cli","version":"1.0.2","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 --noEmit","release":"bun run build && bun ts-node ./release.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.14.2","commander":"^12.1.0","uuid":"^9.0.1"},"devDependencies":{"ts-node":"^10.9.2"}}
|
|
@@ -2,7 +2,7 @@ import * as reified from "../../../../_framework/reified";
|
|
|
2
2
|
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
3
3
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
4
4
|
import { Vector } from "../../../../_framework/vector";
|
|
5
|
-
import {
|
|
5
|
+
import { PKG_V11 } from "../index";
|
|
6
6
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
7
7
|
export declare function isChar(type: string): boolean;
|
|
8
8
|
export interface CharFields {
|
|
@@ -15,7 +15,7 @@ export declare class Char implements StructClass {
|
|
|
15
15
|
static readonly $numTypeParams = 0;
|
|
16
16
|
static readonly $isPhantom: readonly [];
|
|
17
17
|
readonly $typeName = "0x1::ascii::Char";
|
|
18
|
-
readonly $fullTypeName: `${typeof
|
|
18
|
+
readonly $fullTypeName: `${typeof PKG_V11}::ascii::Char`;
|
|
19
19
|
readonly $typeArgs: [];
|
|
20
20
|
readonly $isPhantom: readonly [];
|
|
21
21
|
readonly byte: ToField<"u8">;
|
|
@@ -57,7 +57,7 @@ export declare class String implements StructClass {
|
|
|
57
57
|
static readonly $numTypeParams = 0;
|
|
58
58
|
static readonly $isPhantom: readonly [];
|
|
59
59
|
readonly $typeName = "0x1::ascii::String";
|
|
60
|
-
readonly $fullTypeName: `${typeof
|
|
60
|
+
readonly $fullTypeName: `${typeof PKG_V11}::ascii::String`;
|
|
61
61
|
readonly $typeArgs: [];
|
|
62
62
|
readonly $isPhantom: readonly [];
|
|
63
63
|
readonly bytes: ToField<Vector<"u8">>;
|
|
@@ -44,7 +44,7 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
44
44
|
/* ============================== Char =============================== */
|
|
45
45
|
function isChar(type) {
|
|
46
46
|
type = (0, util_1.compressSuiType)(type);
|
|
47
|
-
return type === `${index_1.
|
|
47
|
+
return type === `${index_1.PKG_V11}::ascii::Char`;
|
|
48
48
|
}
|
|
49
49
|
class Char {
|
|
50
50
|
constructor(typeArgs, fields) {
|
|
@@ -159,13 +159,13 @@ class Char {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
exports.Char = Char;
|
|
162
|
-
Char.$typeName = `${index_1.
|
|
162
|
+
Char.$typeName = `${index_1.PKG_V11}::ascii::Char`;
|
|
163
163
|
Char.$numTypeParams = 0;
|
|
164
164
|
Char.$isPhantom = [];
|
|
165
165
|
/* ============================== String =============================== */
|
|
166
166
|
function isString(type) {
|
|
167
167
|
type = (0, util_1.compressSuiType)(type);
|
|
168
|
-
return type === `${index_1.
|
|
168
|
+
return type === `${index_1.PKG_V11}::ascii::String`;
|
|
169
169
|
}
|
|
170
170
|
class String {
|
|
171
171
|
constructor(typeArgs, fields) {
|
|
@@ -284,6 +284,6 @@ class String {
|
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
exports.String = String;
|
|
287
|
-
String.$typeName = `${index_1.
|
|
287
|
+
String.$typeName = `${index_1.PKG_V11}::ascii::String`;
|
|
288
288
|
String.$numTypeParams = 0;
|
|
289
289
|
String.$isPhantom = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PKG_V11 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
|
|
4
4
|
exports.PACKAGE_ID = "0x1";
|
|
5
5
|
exports.PUBLISHED_AT = "0x1";
|
|
6
|
-
exports.
|
|
6
|
+
exports.PKG_V11 = "0x1";
|
|
@@ -2,7 +2,7 @@ import * as reified from "../../../../_framework/reified";
|
|
|
2
2
|
import { PhantomReified, Reified, StructClass, ToField, ToTypeArgument, ToTypeStr, TypeArgument } from "../../../../_framework/reified";
|
|
3
3
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
4
4
|
import { Vector } from "../../../../_framework/vector";
|
|
5
|
-
import {
|
|
5
|
+
import { PKG_V11 } from "../index";
|
|
6
6
|
import { BcsType } from "@mysten/sui/bcs";
|
|
7
7
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
8
8
|
export declare function isOption(type: string): boolean;
|
|
@@ -17,7 +17,7 @@ export declare class Option<Element extends TypeArgument> implements StructClass
|
|
|
17
17
|
static readonly $isPhantom: readonly [false];
|
|
18
18
|
__inner: Element;
|
|
19
19
|
readonly $typeName = "0x1::option::Option";
|
|
20
|
-
readonly $fullTypeName: `${typeof
|
|
20
|
+
readonly $fullTypeName: `${typeof PKG_V11}::option::Option<${ToTypeStr<Element>}>`;
|
|
21
21
|
readonly $typeArgs: [ToTypeStr<Element>];
|
|
22
22
|
readonly $isPhantom: readonly [false];
|
|
23
23
|
readonly vec: ToField<Vector<Element>>;
|
|
@@ -43,7 +43,7 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
43
43
|
/* ============================== Option =============================== */
|
|
44
44
|
function isOption(type) {
|
|
45
45
|
type = (0, util_1.compressSuiType)(type);
|
|
46
|
-
return type.startsWith(`${index_1.
|
|
46
|
+
return type.startsWith(`${index_1.PKG_V11}::option::Option` + "<");
|
|
47
47
|
}
|
|
48
48
|
class Option {
|
|
49
49
|
constructor(typeArgs, fields) {
|
|
@@ -175,6 +175,6 @@ class Option {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
exports.Option = Option;
|
|
178
|
-
Option.$typeName = `${index_1.
|
|
178
|
+
Option.$typeName = `${index_1.PKG_V11}::option::Option`;
|
|
179
179
|
Option.$numTypeParams = 1;
|
|
180
180
|
Option.$isPhantom = [false];
|
|
@@ -2,7 +2,7 @@ import * as reified from "../../../../_framework/reified";
|
|
|
2
2
|
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
3
3
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
4
4
|
import { Vector } from "../../../../_framework/vector";
|
|
5
|
-
import {
|
|
5
|
+
import { PKG_V11 } from "../index";
|
|
6
6
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
7
7
|
export declare function isString(type: string): boolean;
|
|
8
8
|
export interface StringFields {
|
|
@@ -15,7 +15,7 @@ export declare class String implements StructClass {
|
|
|
15
15
|
static readonly $numTypeParams = 0;
|
|
16
16
|
static readonly $isPhantom: readonly [];
|
|
17
17
|
readonly $typeName = "0x1::string::String";
|
|
18
|
-
readonly $fullTypeName: `${typeof
|
|
18
|
+
readonly $fullTypeName: `${typeof PKG_V11}::string::String`;
|
|
19
19
|
readonly $typeArgs: [];
|
|
20
20
|
readonly $isPhantom: readonly [];
|
|
21
21
|
readonly bytes: ToField<Vector<"u8">>;
|
|
@@ -43,7 +43,7 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
43
43
|
/* ============================== String =============================== */
|
|
44
44
|
function isString(type) {
|
|
45
45
|
type = (0, util_1.compressSuiType)(type);
|
|
46
|
-
return type === `${index_1.
|
|
46
|
+
return type === `${index_1.PKG_V11}::string::String`;
|
|
47
47
|
}
|
|
48
48
|
class String {
|
|
49
49
|
constructor(typeArgs, fields) {
|
|
@@ -162,6 +162,6 @@ class String {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
exports.String = String;
|
|
165
|
-
String.$typeName = `${index_1.
|
|
165
|
+
String.$typeName = `${index_1.PKG_V11}::string::String`;
|
|
166
166
|
String.$numTypeParams = 0;
|
|
167
167
|
String.$isPhantom = [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
2
2
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
3
|
import { String } from "../ascii/structs";
|
|
4
|
-
import {
|
|
4
|
+
import { PKG_V11 } from "../index";
|
|
5
5
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
6
6
|
export declare function isTypeName(type: string): boolean;
|
|
7
7
|
export interface TypeNameFields {
|
|
@@ -14,7 +14,7 @@ export declare class TypeName implements StructClass {
|
|
|
14
14
|
static readonly $numTypeParams = 0;
|
|
15
15
|
static readonly $isPhantom: readonly [];
|
|
16
16
|
readonly $typeName = "0x1::type_name::TypeName";
|
|
17
|
-
readonly $fullTypeName: `${typeof
|
|
17
|
+
readonly $fullTypeName: `${typeof PKG_V11}::type_name::TypeName`;
|
|
18
18
|
readonly $typeArgs: [];
|
|
19
19
|
readonly $isPhantom: readonly [];
|
|
20
20
|
readonly name: ToField<String>;
|
|
@@ -20,7 +20,7 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
20
20
|
/* ============================== TypeName =============================== */
|
|
21
21
|
function isTypeName(type) {
|
|
22
22
|
type = (0, util_1.compressSuiType)(type);
|
|
23
|
-
return type === `${index_1.
|
|
23
|
+
return type === `${index_1.PKG_V11}::type_name::TypeName`;
|
|
24
24
|
}
|
|
25
25
|
class TypeName {
|
|
26
26
|
constructor(typeArgs, fields) {
|
|
@@ -139,6 +139,6 @@ class TypeName {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
exports.TypeName = TypeName;
|
|
142
|
-
TypeName.$typeName = `${index_1.
|
|
142
|
+
TypeName.$typeName = `${index_1.PKG_V11}::type_name::TypeName`;
|
|
143
143
|
TypeName.$numTypeParams = 0;
|
|
144
144
|
TypeName.$isPhantom = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PKG_V17 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
|
|
4
4
|
exports.PACKAGE_ID = "0x3";
|
|
5
5
|
exports.PUBLISHED_AT = "0x3";
|
|
6
|
-
exports.
|
|
6
|
+
exports.PKG_V17 = "0x3";
|
|
@@ -7,7 +7,7 @@ import { Balance } from "../../0x2/balance/structs";
|
|
|
7
7
|
import { ID, UID } from "../../0x2/object/structs";
|
|
8
8
|
import { SUI } from "../../0x2/sui/structs";
|
|
9
9
|
import { Table } from "../../0x2/table/structs";
|
|
10
|
-
import {
|
|
10
|
+
import { PKG_V17 } from "../index";
|
|
11
11
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
12
12
|
export declare function isFungibleStakedSui(type: string): boolean;
|
|
13
13
|
export interface FungibleStakedSuiFields {
|
|
@@ -22,7 +22,7 @@ export declare class FungibleStakedSui implements StructClass {
|
|
|
22
22
|
static readonly $numTypeParams = 0;
|
|
23
23
|
static readonly $isPhantom: readonly [];
|
|
24
24
|
readonly $typeName = "0x3::staking_pool::FungibleStakedSui";
|
|
25
|
-
readonly $fullTypeName: `${typeof
|
|
25
|
+
readonly $fullTypeName: `${typeof PKG_V17}::staking_pool::FungibleStakedSui`;
|
|
26
26
|
readonly $typeArgs: [];
|
|
27
27
|
readonly $isPhantom: readonly [];
|
|
28
28
|
readonly id: ToField<UID>;
|
|
@@ -88,7 +88,7 @@ export declare class FungibleStakedSuiData implements StructClass {
|
|
|
88
88
|
static readonly $numTypeParams = 0;
|
|
89
89
|
static readonly $isPhantom: readonly [];
|
|
90
90
|
readonly $typeName = "0x3::staking_pool::FungibleStakedSuiData";
|
|
91
|
-
readonly $fullTypeName: `${typeof
|
|
91
|
+
readonly $fullTypeName: `${typeof PKG_V17}::staking_pool::FungibleStakedSuiData`;
|
|
92
92
|
readonly $typeArgs: [];
|
|
93
93
|
readonly $isPhantom: readonly [];
|
|
94
94
|
readonly id: ToField<UID>;
|
|
@@ -156,7 +156,7 @@ export declare class FungibleStakedSuiDataKey implements StructClass {
|
|
|
156
156
|
static readonly $numTypeParams = 0;
|
|
157
157
|
static readonly $isPhantom: readonly [];
|
|
158
158
|
readonly $typeName = "0x3::staking_pool::FungibleStakedSuiDataKey";
|
|
159
|
-
readonly $fullTypeName: `${typeof
|
|
159
|
+
readonly $fullTypeName: `${typeof PKG_V17}::staking_pool::FungibleStakedSuiDataKey`;
|
|
160
160
|
readonly $typeArgs: [];
|
|
161
161
|
readonly $isPhantom: readonly [];
|
|
162
162
|
readonly dummyField: ToField<"bool">;
|
|
@@ -199,7 +199,7 @@ export declare class PoolTokenExchangeRate implements StructClass {
|
|
|
199
199
|
static readonly $numTypeParams = 0;
|
|
200
200
|
static readonly $isPhantom: readonly [];
|
|
201
201
|
readonly $typeName = "0x3::staking_pool::PoolTokenExchangeRate";
|
|
202
|
-
readonly $fullTypeName: `${typeof
|
|
202
|
+
readonly $fullTypeName: `${typeof PKG_V17}::staking_pool::PoolTokenExchangeRate`;
|
|
203
203
|
readonly $typeArgs: [];
|
|
204
204
|
readonly $isPhantom: readonly [];
|
|
205
205
|
readonly suiAmount: ToField<"u64">;
|
|
@@ -249,7 +249,7 @@ export declare class StakedSui implements StructClass {
|
|
|
249
249
|
static readonly $numTypeParams = 0;
|
|
250
250
|
static readonly $isPhantom: readonly [];
|
|
251
251
|
readonly $typeName = "0x3::staking_pool::StakedSui";
|
|
252
|
-
readonly $fullTypeName: `${typeof
|
|
252
|
+
readonly $fullTypeName: `${typeof PKG_V17}::staking_pool::StakedSui`;
|
|
253
253
|
readonly $typeArgs: [];
|
|
254
254
|
readonly $isPhantom: readonly [];
|
|
255
255
|
readonly id: ToField<UID>;
|
|
@@ -336,7 +336,7 @@ export declare class StakingPool implements StructClass {
|
|
|
336
336
|
static readonly $numTypeParams = 0;
|
|
337
337
|
static readonly $isPhantom: readonly [];
|
|
338
338
|
readonly $typeName = "0x3::staking_pool::StakingPool";
|
|
339
|
-
readonly $fullTypeName: `${typeof
|
|
339
|
+
readonly $fullTypeName: `${typeof PKG_V17}::staking_pool::StakingPool`;
|
|
340
340
|
readonly $typeArgs: [];
|
|
341
341
|
readonly $isPhantom: readonly [];
|
|
342
342
|
readonly id: ToField<UID>;
|
|
@@ -54,7 +54,7 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
54
54
|
/* ============================== FungibleStakedSui =============================== */
|
|
55
55
|
function isFungibleStakedSui(type) {
|
|
56
56
|
type = (0, util_1.compressSuiType)(type);
|
|
57
|
-
return type === `${index_1.
|
|
57
|
+
return type === `${index_1.PKG_V17}::staking_pool::FungibleStakedSui`;
|
|
58
58
|
}
|
|
59
59
|
class FungibleStakedSui {
|
|
60
60
|
constructor(typeArgs, fields) {
|
|
@@ -186,13 +186,13 @@ class FungibleStakedSui {
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
exports.FungibleStakedSui = FungibleStakedSui;
|
|
189
|
-
FungibleStakedSui.$typeName = `${index_1.
|
|
189
|
+
FungibleStakedSui.$typeName = `${index_1.PKG_V17}::staking_pool::FungibleStakedSui`;
|
|
190
190
|
FungibleStakedSui.$numTypeParams = 0;
|
|
191
191
|
FungibleStakedSui.$isPhantom = [];
|
|
192
192
|
/* ============================== FungibleStakedSuiData =============================== */
|
|
193
193
|
function isFungibleStakedSuiData(type) {
|
|
194
194
|
type = (0, util_1.compressSuiType)(type);
|
|
195
|
-
return type === `${index_1.
|
|
195
|
+
return type === `${index_1.PKG_V17}::staking_pool::FungibleStakedSuiData`;
|
|
196
196
|
}
|
|
197
197
|
class FungibleStakedSuiData {
|
|
198
198
|
constructor(typeArgs, fields) {
|
|
@@ -324,13 +324,13 @@ class FungibleStakedSuiData {
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
exports.FungibleStakedSuiData = FungibleStakedSuiData;
|
|
327
|
-
FungibleStakedSuiData.$typeName = `${index_1.
|
|
327
|
+
FungibleStakedSuiData.$typeName = `${index_1.PKG_V17}::staking_pool::FungibleStakedSuiData`;
|
|
328
328
|
FungibleStakedSuiData.$numTypeParams = 0;
|
|
329
329
|
FungibleStakedSuiData.$isPhantom = [];
|
|
330
330
|
/* ============================== FungibleStakedSuiDataKey =============================== */
|
|
331
331
|
function isFungibleStakedSuiDataKey(type) {
|
|
332
332
|
type = (0, util_1.compressSuiType)(type);
|
|
333
|
-
return type === `${index_1.
|
|
333
|
+
return type === `${index_1.PKG_V17}::staking_pool::FungibleStakedSuiDataKey`;
|
|
334
334
|
}
|
|
335
335
|
class FungibleStakedSuiDataKey {
|
|
336
336
|
constructor(typeArgs, fields) {
|
|
@@ -450,13 +450,13 @@ class FungibleStakedSuiDataKey {
|
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
exports.FungibleStakedSuiDataKey = FungibleStakedSuiDataKey;
|
|
453
|
-
FungibleStakedSuiDataKey.$typeName = `${index_1.
|
|
453
|
+
FungibleStakedSuiDataKey.$typeName = `${index_1.PKG_V17}::staking_pool::FungibleStakedSuiDataKey`;
|
|
454
454
|
FungibleStakedSuiDataKey.$numTypeParams = 0;
|
|
455
455
|
FungibleStakedSuiDataKey.$isPhantom = [];
|
|
456
456
|
/* ============================== PoolTokenExchangeRate =============================== */
|
|
457
457
|
function isPoolTokenExchangeRate(type) {
|
|
458
458
|
type = (0, util_1.compressSuiType)(type);
|
|
459
|
-
return type === `${index_1.
|
|
459
|
+
return type === `${index_1.PKG_V17}::staking_pool::PoolTokenExchangeRate`;
|
|
460
460
|
}
|
|
461
461
|
class PoolTokenExchangeRate {
|
|
462
462
|
constructor(typeArgs, fields) {
|
|
@@ -582,13 +582,13 @@ class PoolTokenExchangeRate {
|
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
exports.PoolTokenExchangeRate = PoolTokenExchangeRate;
|
|
585
|
-
PoolTokenExchangeRate.$typeName = `${index_1.
|
|
585
|
+
PoolTokenExchangeRate.$typeName = `${index_1.PKG_V17}::staking_pool::PoolTokenExchangeRate`;
|
|
586
586
|
PoolTokenExchangeRate.$numTypeParams = 0;
|
|
587
587
|
PoolTokenExchangeRate.$isPhantom = [];
|
|
588
588
|
/* ============================== StakedSui =============================== */
|
|
589
589
|
function isStakedSui(type) {
|
|
590
590
|
type = (0, util_1.compressSuiType)(type);
|
|
591
|
-
return type === `${index_1.
|
|
591
|
+
return type === `${index_1.PKG_V17}::staking_pool::StakedSui`;
|
|
592
592
|
}
|
|
593
593
|
class StakedSui {
|
|
594
594
|
constructor(typeArgs, fields) {
|
|
@@ -725,13 +725,13 @@ class StakedSui {
|
|
|
725
725
|
}
|
|
726
726
|
}
|
|
727
727
|
exports.StakedSui = StakedSui;
|
|
728
|
-
StakedSui.$typeName = `${index_1.
|
|
728
|
+
StakedSui.$typeName = `${index_1.PKG_V17}::staking_pool::StakedSui`;
|
|
729
729
|
StakedSui.$numTypeParams = 0;
|
|
730
730
|
StakedSui.$isPhantom = [];
|
|
731
731
|
/* ============================== StakingPool =============================== */
|
|
732
732
|
function isStakingPool(type) {
|
|
733
733
|
type = (0, util_1.compressSuiType)(type);
|
|
734
|
-
return type === `${index_1.
|
|
734
|
+
return type === `${index_1.PKG_V17}::staking_pool::StakingPool`;
|
|
735
735
|
}
|
|
736
736
|
class StakingPool {
|
|
737
737
|
constructor(typeArgs, fields) {
|
|
@@ -910,6 +910,6 @@ class StakingPool {
|
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
912
|
exports.StakingPool = StakingPool;
|
|
913
|
-
StakingPool.$typeName = `${index_1.
|
|
913
|
+
StakingPool.$typeName = `${index_1.PKG_V17}::staking_pool::StakingPool`;
|
|
914
914
|
StakingPool.$numTypeParams = 0;
|
|
915
915
|
StakingPool.$isPhantom = [];
|
|
@@ -11,10 +11,10 @@ export interface CellFields<Element extends TypeArgument> {
|
|
|
11
11
|
export type CellReified<Element extends TypeArgument> = Reified<Cell<Element>, CellFields<Element>>;
|
|
12
12
|
export declare class Cell<Element extends TypeArgument> implements StructClass {
|
|
13
13
|
__StructClass: true;
|
|
14
|
-
static readonly $typeName = "
|
|
14
|
+
static readonly $typeName = "0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::cell::Cell";
|
|
15
15
|
static readonly $numTypeParams = 1;
|
|
16
16
|
static readonly $isPhantom: readonly [false];
|
|
17
|
-
readonly $typeName = "
|
|
17
|
+
readonly $typeName = "0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::cell::Cell";
|
|
18
18
|
readonly $fullTypeName: `${typeof PKG_V1}::cell::Cell<${ToTypeStr<Element>}>`;
|
|
19
19
|
readonly $typeArgs: [ToTypeStr<Element>];
|
|
20
20
|
readonly $isPhantom: readonly [false];
|
|
@@ -16,10 +16,10 @@ export interface FeeConfigFields {
|
|
|
16
16
|
export type FeeConfigReified = Reified<FeeConfig, FeeConfigFields>;
|
|
17
17
|
export declare class FeeConfig implements StructClass {
|
|
18
18
|
__StructClass: true;
|
|
19
|
-
static readonly $typeName = "
|
|
19
|
+
static readonly $typeName = "0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::fees::FeeConfig";
|
|
20
20
|
static readonly $numTypeParams = 0;
|
|
21
21
|
static readonly $isPhantom: readonly [];
|
|
22
|
-
readonly $typeName = "
|
|
22
|
+
readonly $typeName = "0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::fees::FeeConfig";
|
|
23
23
|
readonly $fullTypeName: `${typeof PKG_V1}::fees::FeeConfig`;
|
|
24
24
|
readonly $typeArgs: [];
|
|
25
25
|
readonly $isPhantom: readonly [];
|
|
@@ -34,7 +34,7 @@ export declare class FeeConfig implements StructClass {
|
|
|
34
34
|
static reified(): FeeConfigReified;
|
|
35
35
|
static get r(): import("../../_framework/reified").StructClassReified<FeeConfig, FeeConfigFields>;
|
|
36
36
|
static phantom(): PhantomReified<ToTypeStr<FeeConfig>>;
|
|
37
|
-
static get p(): PhantomReified<"
|
|
37
|
+
static get p(): PhantomReified<"0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::fees::FeeConfig">;
|
|
38
38
|
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
39
39
|
sui_mint_fee_bps: string;
|
|
40
40
|
staked_sui_mint_fee_bps: string;
|
|
@@ -108,10 +108,10 @@ export interface FeeConfigBuilderFields {
|
|
|
108
108
|
export type FeeConfigBuilderReified = Reified<FeeConfigBuilder, FeeConfigBuilderFields>;
|
|
109
109
|
export declare class FeeConfigBuilder implements StructClass {
|
|
110
110
|
__StructClass: true;
|
|
111
|
-
static readonly $typeName = "
|
|
111
|
+
static readonly $typeName = "0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::fees::FeeConfigBuilder";
|
|
112
112
|
static readonly $numTypeParams = 0;
|
|
113
113
|
static readonly $isPhantom: readonly [];
|
|
114
|
-
readonly $typeName = "
|
|
114
|
+
readonly $typeName = "0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::fees::FeeConfigBuilder";
|
|
115
115
|
readonly $fullTypeName: `${typeof PKG_V1}::fees::FeeConfigBuilder`;
|
|
116
116
|
readonly $typeArgs: [];
|
|
117
117
|
readonly $isPhantom: readonly [];
|
|
@@ -120,7 +120,7 @@ export declare class FeeConfigBuilder implements StructClass {
|
|
|
120
120
|
static reified(): FeeConfigBuilderReified;
|
|
121
121
|
static get r(): import("../../_framework/reified").StructClassReified<FeeConfigBuilder, FeeConfigBuilderFields>;
|
|
122
122
|
static phantom(): PhantomReified<ToTypeStr<FeeConfigBuilder>>;
|
|
123
|
-
static get p(): PhantomReified<"
|
|
123
|
+
static get p(): PhantomReified<"0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::fees::FeeConfigBuilder">;
|
|
124
124
|
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
125
125
|
fields: {
|
|
126
126
|
id: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const PACKAGE_ID = "
|
|
1
|
+
export declare const PACKAGE_ID = "0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7";
|
|
2
2
|
export declare var PUBLISHED_AT: string;
|
|
3
3
|
export declare function setPublishedAt(publishedAt: string): void;
|
|
4
|
-
export declare const PKG_V1 = "
|
|
4
|
+
export declare const PKG_V1 = "0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7";
|