@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,1477 @@
|
|
|
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
|
+
exports.RedeemEvent = exports.MintEvent = exports.LiquidStakingInfo = exports.LIQUID_STAKING = exports.IncreaseValidatorStakeEvent = exports.EpochChangedEvent = exports.DecreaseValidatorStakeEvent = exports.CreateEvent = exports.CollectFeesEvent = exports.AdminCap = void 0;
|
|
36
|
+
exports.isAdminCap = isAdminCap;
|
|
37
|
+
exports.isCollectFeesEvent = isCollectFeesEvent;
|
|
38
|
+
exports.isCreateEvent = isCreateEvent;
|
|
39
|
+
exports.isDecreaseValidatorStakeEvent = isDecreaseValidatorStakeEvent;
|
|
40
|
+
exports.isEpochChangedEvent = isEpochChangedEvent;
|
|
41
|
+
exports.isIncreaseValidatorStakeEvent = isIncreaseValidatorStakeEvent;
|
|
42
|
+
exports.isLIQUID_STAKING = isLIQUID_STAKING;
|
|
43
|
+
exports.isLiquidStakingInfo = isLiquidStakingInfo;
|
|
44
|
+
exports.isMintEvent = isMintEvent;
|
|
45
|
+
exports.isRedeemEvent = isRedeemEvent;
|
|
46
|
+
const reified = __importStar(require("../../_framework/reified"));
|
|
47
|
+
const structs_1 = require("../../_dependencies/source/0x1/type-name/structs");
|
|
48
|
+
const structs_2 = require("../../_dependencies/source/0x2/bag/structs");
|
|
49
|
+
const structs_3 = require("../../_dependencies/source/0x2/balance/structs");
|
|
50
|
+
const structs_4 = require("../../_dependencies/source/0x2/coin/structs");
|
|
51
|
+
const structs_5 = require("../../_dependencies/source/0x2/object/structs");
|
|
52
|
+
const structs_6 = require("../../_dependencies/source/0x2/sui/structs");
|
|
53
|
+
const reified_1 = require("../../_framework/reified");
|
|
54
|
+
const util_1 = require("../../_framework/util");
|
|
55
|
+
const structs_7 = require("../cell/structs");
|
|
56
|
+
const structs_8 = require("../fees/structs");
|
|
57
|
+
const index_1 = require("../index");
|
|
58
|
+
const structs_9 = require("../storage/structs");
|
|
59
|
+
const structs_10 = require("../version/structs");
|
|
60
|
+
const bcs_1 = require("@mysten/sui/bcs");
|
|
61
|
+
const utils_1 = require("@mysten/sui/utils");
|
|
62
|
+
/* ============================== AdminCap =============================== */
|
|
63
|
+
function isAdminCap(type) {
|
|
64
|
+
type = (0, util_1.compressSuiType)(type);
|
|
65
|
+
return type.startsWith(`${index_1.PKG_V1}::liquid_staking::AdminCap` + "<");
|
|
66
|
+
}
|
|
67
|
+
class AdminCap {
|
|
68
|
+
constructor(typeArgs, fields) {
|
|
69
|
+
this.__StructClass = true;
|
|
70
|
+
this.$typeName = AdminCap.$typeName;
|
|
71
|
+
this.$isPhantom = AdminCap.$isPhantom;
|
|
72
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(AdminCap.$typeName, ...typeArgs);
|
|
73
|
+
this.$typeArgs = typeArgs;
|
|
74
|
+
this.id = fields.id;
|
|
75
|
+
}
|
|
76
|
+
static reified(P) {
|
|
77
|
+
return {
|
|
78
|
+
typeName: AdminCap.$typeName,
|
|
79
|
+
fullTypeName: (0, util_1.composeSuiType)(AdminCap.$typeName, ...[(0, reified_1.extractType)(P)]),
|
|
80
|
+
typeArgs: [(0, reified_1.extractType)(P)],
|
|
81
|
+
isPhantom: AdminCap.$isPhantom,
|
|
82
|
+
reifiedTypeArgs: [P],
|
|
83
|
+
fromFields: (fields) => AdminCap.fromFields(P, fields),
|
|
84
|
+
fromFieldsWithTypes: (item) => AdminCap.fromFieldsWithTypes(P, item),
|
|
85
|
+
fromBcs: (data) => AdminCap.fromBcs(P, data),
|
|
86
|
+
bcs: AdminCap.bcs,
|
|
87
|
+
fromJSONField: (field) => AdminCap.fromJSONField(P, field),
|
|
88
|
+
fromJSON: (json) => AdminCap.fromJSON(P, json),
|
|
89
|
+
fromSuiParsedData: (content) => AdminCap.fromSuiParsedData(P, content),
|
|
90
|
+
fromSuiObjectData: (content) => AdminCap.fromSuiObjectData(P, content),
|
|
91
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return AdminCap.fetch(client, P, id); }),
|
|
92
|
+
new: (fields) => {
|
|
93
|
+
return new AdminCap([(0, reified_1.extractType)(P)], fields);
|
|
94
|
+
},
|
|
95
|
+
kind: "StructClassReified",
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
static get r() {
|
|
99
|
+
return AdminCap.reified;
|
|
100
|
+
}
|
|
101
|
+
static phantom(P) {
|
|
102
|
+
return (0, reified_1.phantom)(AdminCap.reified(P));
|
|
103
|
+
}
|
|
104
|
+
static get p() {
|
|
105
|
+
return AdminCap.phantom;
|
|
106
|
+
}
|
|
107
|
+
static get bcs() {
|
|
108
|
+
return bcs_1.bcs.struct("AdminCap", {
|
|
109
|
+
id: structs_5.UID.bcs,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
static fromFields(typeArg, fields) {
|
|
113
|
+
return AdminCap.reified(typeArg).new({
|
|
114
|
+
id: (0, reified_1.decodeFromFields)(structs_5.UID.reified(), fields.id),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
static fromFieldsWithTypes(typeArg, item) {
|
|
118
|
+
if (!isAdminCap(item.type)) {
|
|
119
|
+
throw new Error("not a AdminCap type");
|
|
120
|
+
}
|
|
121
|
+
(0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
|
|
122
|
+
return AdminCap.reified(typeArg).new({
|
|
123
|
+
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.UID.reified(), item.fields.id),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
static fromBcs(typeArg, data) {
|
|
127
|
+
return AdminCap.fromFields(typeArg, AdminCap.bcs.parse(data));
|
|
128
|
+
}
|
|
129
|
+
toJSONField() {
|
|
130
|
+
return {
|
|
131
|
+
id: this.id,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
toJSON() {
|
|
135
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
136
|
+
}
|
|
137
|
+
static fromJSONField(typeArg, field) {
|
|
138
|
+
return AdminCap.reified(typeArg).new({
|
|
139
|
+
id: (0, reified_1.decodeFromJSONField)(structs_5.UID.reified(), field.id),
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
static fromJSON(typeArg, json) {
|
|
143
|
+
if (json.$typeName !== AdminCap.$typeName) {
|
|
144
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
145
|
+
}
|
|
146
|
+
(0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(AdminCap.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
|
|
147
|
+
return AdminCap.fromJSONField(typeArg, json);
|
|
148
|
+
}
|
|
149
|
+
static fromSuiParsedData(typeArg, content) {
|
|
150
|
+
if (content.dataType !== "moveObject") {
|
|
151
|
+
throw new Error("not an object");
|
|
152
|
+
}
|
|
153
|
+
if (!isAdminCap(content.type)) {
|
|
154
|
+
throw new Error(`object at ${content.fields.id} is not a AdminCap object`);
|
|
155
|
+
}
|
|
156
|
+
return AdminCap.fromFieldsWithTypes(typeArg, content);
|
|
157
|
+
}
|
|
158
|
+
static fromSuiObjectData(typeArg, data) {
|
|
159
|
+
if (data.bcs) {
|
|
160
|
+
if (data.bcs.dataType !== "moveObject" || !isAdminCap(data.bcs.type)) {
|
|
161
|
+
throw new Error(`object at is not a AdminCap object`);
|
|
162
|
+
}
|
|
163
|
+
const gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
|
|
164
|
+
if (gotTypeArgs.length !== 1) {
|
|
165
|
+
throw new Error(`type argument mismatch: expected 1 type argument but got '${gotTypeArgs.length}'`);
|
|
166
|
+
}
|
|
167
|
+
const gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
|
|
168
|
+
const expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
|
|
169
|
+
if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
|
|
170
|
+
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
171
|
+
}
|
|
172
|
+
return AdminCap.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
173
|
+
}
|
|
174
|
+
if (data.content) {
|
|
175
|
+
return AdminCap.fromSuiParsedData(typeArg, data.content);
|
|
176
|
+
}
|
|
177
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
178
|
+
}
|
|
179
|
+
static fetch(client, typeArg, id) {
|
|
180
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
var _a, _b;
|
|
182
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
183
|
+
if (res.error) {
|
|
184
|
+
throw new Error(`error fetching AdminCap object at id ${id}: ${res.error.code}`);
|
|
185
|
+
}
|
|
186
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
187
|
+
!isAdminCap(res.data.bcs.type)) {
|
|
188
|
+
throw new Error(`object at id ${id} is not a AdminCap object`);
|
|
189
|
+
}
|
|
190
|
+
return AdminCap.fromSuiObjectData(typeArg, res.data);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
exports.AdminCap = AdminCap;
|
|
195
|
+
AdminCap.$typeName = `${index_1.PKG_V1}::liquid_staking::AdminCap`;
|
|
196
|
+
AdminCap.$numTypeParams = 1;
|
|
197
|
+
AdminCap.$isPhantom = [true];
|
|
198
|
+
/* ============================== CollectFeesEvent =============================== */
|
|
199
|
+
function isCollectFeesEvent(type) {
|
|
200
|
+
type = (0, util_1.compressSuiType)(type);
|
|
201
|
+
return type === `${index_1.PKG_V1}::liquid_staking::CollectFeesEvent`;
|
|
202
|
+
}
|
|
203
|
+
class CollectFeesEvent {
|
|
204
|
+
constructor(typeArgs, fields) {
|
|
205
|
+
this.__StructClass = true;
|
|
206
|
+
this.$typeName = CollectFeesEvent.$typeName;
|
|
207
|
+
this.$isPhantom = CollectFeesEvent.$isPhantom;
|
|
208
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(CollectFeesEvent.$typeName, ...typeArgs);
|
|
209
|
+
this.$typeArgs = typeArgs;
|
|
210
|
+
this.typename = fields.typename;
|
|
211
|
+
this.amount = fields.amount;
|
|
212
|
+
}
|
|
213
|
+
static reified() {
|
|
214
|
+
return {
|
|
215
|
+
typeName: CollectFeesEvent.$typeName,
|
|
216
|
+
fullTypeName: (0, util_1.composeSuiType)(CollectFeesEvent.$typeName, ...[]),
|
|
217
|
+
typeArgs: [],
|
|
218
|
+
isPhantom: CollectFeesEvent.$isPhantom,
|
|
219
|
+
reifiedTypeArgs: [],
|
|
220
|
+
fromFields: (fields) => CollectFeesEvent.fromFields(fields),
|
|
221
|
+
fromFieldsWithTypes: (item) => CollectFeesEvent.fromFieldsWithTypes(item),
|
|
222
|
+
fromBcs: (data) => CollectFeesEvent.fromBcs(data),
|
|
223
|
+
bcs: CollectFeesEvent.bcs,
|
|
224
|
+
fromJSONField: (field) => CollectFeesEvent.fromJSONField(field),
|
|
225
|
+
fromJSON: (json) => CollectFeesEvent.fromJSON(json),
|
|
226
|
+
fromSuiParsedData: (content) => CollectFeesEvent.fromSuiParsedData(content),
|
|
227
|
+
fromSuiObjectData: (content) => CollectFeesEvent.fromSuiObjectData(content),
|
|
228
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return CollectFeesEvent.fetch(client, id); }),
|
|
229
|
+
new: (fields) => {
|
|
230
|
+
return new CollectFeesEvent([], fields);
|
|
231
|
+
},
|
|
232
|
+
kind: "StructClassReified",
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
static get r() {
|
|
236
|
+
return CollectFeesEvent.reified();
|
|
237
|
+
}
|
|
238
|
+
static phantom() {
|
|
239
|
+
return (0, reified_1.phantom)(CollectFeesEvent.reified());
|
|
240
|
+
}
|
|
241
|
+
static get p() {
|
|
242
|
+
return CollectFeesEvent.phantom();
|
|
243
|
+
}
|
|
244
|
+
static get bcs() {
|
|
245
|
+
return bcs_1.bcs.struct("CollectFeesEvent", {
|
|
246
|
+
typename: structs_1.TypeName.bcs,
|
|
247
|
+
amount: bcs_1.bcs.u64(),
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
static fromFields(fields) {
|
|
251
|
+
return CollectFeesEvent.reified().new({
|
|
252
|
+
typename: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.typename),
|
|
253
|
+
amount: (0, reified_1.decodeFromFields)("u64", fields.amount),
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
static fromFieldsWithTypes(item) {
|
|
257
|
+
if (!isCollectFeesEvent(item.type)) {
|
|
258
|
+
throw new Error("not a CollectFeesEvent type");
|
|
259
|
+
}
|
|
260
|
+
return CollectFeesEvent.reified().new({
|
|
261
|
+
typename: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.typename),
|
|
262
|
+
amount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.amount),
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
static fromBcs(data) {
|
|
266
|
+
return CollectFeesEvent.fromFields(CollectFeesEvent.bcs.parse(data));
|
|
267
|
+
}
|
|
268
|
+
toJSONField() {
|
|
269
|
+
return {
|
|
270
|
+
typename: this.typename.toJSONField(),
|
|
271
|
+
amount: this.amount.toString(),
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
toJSON() {
|
|
275
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
276
|
+
}
|
|
277
|
+
static fromJSONField(field) {
|
|
278
|
+
return CollectFeesEvent.reified().new({
|
|
279
|
+
typename: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.typename),
|
|
280
|
+
amount: (0, reified_1.decodeFromJSONField)("u64", field.amount),
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
static fromJSON(json) {
|
|
284
|
+
if (json.$typeName !== CollectFeesEvent.$typeName) {
|
|
285
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
286
|
+
}
|
|
287
|
+
return CollectFeesEvent.fromJSONField(json);
|
|
288
|
+
}
|
|
289
|
+
static fromSuiParsedData(content) {
|
|
290
|
+
if (content.dataType !== "moveObject") {
|
|
291
|
+
throw new Error("not an object");
|
|
292
|
+
}
|
|
293
|
+
if (!isCollectFeesEvent(content.type)) {
|
|
294
|
+
throw new Error(`object at ${content.fields.id} is not a CollectFeesEvent object`);
|
|
295
|
+
}
|
|
296
|
+
return CollectFeesEvent.fromFieldsWithTypes(content);
|
|
297
|
+
}
|
|
298
|
+
static fromSuiObjectData(data) {
|
|
299
|
+
if (data.bcs) {
|
|
300
|
+
if (data.bcs.dataType !== "moveObject" ||
|
|
301
|
+
!isCollectFeesEvent(data.bcs.type)) {
|
|
302
|
+
throw new Error(`object at is not a CollectFeesEvent object`);
|
|
303
|
+
}
|
|
304
|
+
return CollectFeesEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
305
|
+
}
|
|
306
|
+
if (data.content) {
|
|
307
|
+
return CollectFeesEvent.fromSuiParsedData(data.content);
|
|
308
|
+
}
|
|
309
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
310
|
+
}
|
|
311
|
+
static fetch(client, id) {
|
|
312
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
313
|
+
var _a, _b;
|
|
314
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
315
|
+
if (res.error) {
|
|
316
|
+
throw new Error(`error fetching CollectFeesEvent object at id ${id}: ${res.error.code}`);
|
|
317
|
+
}
|
|
318
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
319
|
+
!isCollectFeesEvent(res.data.bcs.type)) {
|
|
320
|
+
throw new Error(`object at id ${id} is not a CollectFeesEvent object`);
|
|
321
|
+
}
|
|
322
|
+
return CollectFeesEvent.fromSuiObjectData(res.data);
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
exports.CollectFeesEvent = CollectFeesEvent;
|
|
327
|
+
CollectFeesEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::CollectFeesEvent`;
|
|
328
|
+
CollectFeesEvent.$numTypeParams = 0;
|
|
329
|
+
CollectFeesEvent.$isPhantom = [];
|
|
330
|
+
/* ============================== CreateEvent =============================== */
|
|
331
|
+
function isCreateEvent(type) {
|
|
332
|
+
type = (0, util_1.compressSuiType)(type);
|
|
333
|
+
return type === `${index_1.PKG_V1}::liquid_staking::CreateEvent`;
|
|
334
|
+
}
|
|
335
|
+
class CreateEvent {
|
|
336
|
+
constructor(typeArgs, fields) {
|
|
337
|
+
this.__StructClass = true;
|
|
338
|
+
this.$typeName = CreateEvent.$typeName;
|
|
339
|
+
this.$isPhantom = CreateEvent.$isPhantom;
|
|
340
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(CreateEvent.$typeName, ...typeArgs);
|
|
341
|
+
this.$typeArgs = typeArgs;
|
|
342
|
+
this.typename = fields.typename;
|
|
343
|
+
this.liquidStakingInfoId = fields.liquidStakingInfoId;
|
|
344
|
+
}
|
|
345
|
+
static reified() {
|
|
346
|
+
return {
|
|
347
|
+
typeName: CreateEvent.$typeName,
|
|
348
|
+
fullTypeName: (0, util_1.composeSuiType)(CreateEvent.$typeName, ...[]),
|
|
349
|
+
typeArgs: [],
|
|
350
|
+
isPhantom: CreateEvent.$isPhantom,
|
|
351
|
+
reifiedTypeArgs: [],
|
|
352
|
+
fromFields: (fields) => CreateEvent.fromFields(fields),
|
|
353
|
+
fromFieldsWithTypes: (item) => CreateEvent.fromFieldsWithTypes(item),
|
|
354
|
+
fromBcs: (data) => CreateEvent.fromBcs(data),
|
|
355
|
+
bcs: CreateEvent.bcs,
|
|
356
|
+
fromJSONField: (field) => CreateEvent.fromJSONField(field),
|
|
357
|
+
fromJSON: (json) => CreateEvent.fromJSON(json),
|
|
358
|
+
fromSuiParsedData: (content) => CreateEvent.fromSuiParsedData(content),
|
|
359
|
+
fromSuiObjectData: (content) => CreateEvent.fromSuiObjectData(content),
|
|
360
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return CreateEvent.fetch(client, id); }),
|
|
361
|
+
new: (fields) => {
|
|
362
|
+
return new CreateEvent([], fields);
|
|
363
|
+
},
|
|
364
|
+
kind: "StructClassReified",
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
static get r() {
|
|
368
|
+
return CreateEvent.reified();
|
|
369
|
+
}
|
|
370
|
+
static phantom() {
|
|
371
|
+
return (0, reified_1.phantom)(CreateEvent.reified());
|
|
372
|
+
}
|
|
373
|
+
static get p() {
|
|
374
|
+
return CreateEvent.phantom();
|
|
375
|
+
}
|
|
376
|
+
static get bcs() {
|
|
377
|
+
return bcs_1.bcs.struct("CreateEvent", {
|
|
378
|
+
typename: structs_1.TypeName.bcs,
|
|
379
|
+
liquid_staking_info_id: structs_5.ID.bcs,
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
static fromFields(fields) {
|
|
383
|
+
return CreateEvent.reified().new({
|
|
384
|
+
typename: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.typename),
|
|
385
|
+
liquidStakingInfoId: (0, reified_1.decodeFromFields)(structs_5.ID.reified(), fields.liquid_staking_info_id),
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
static fromFieldsWithTypes(item) {
|
|
389
|
+
if (!isCreateEvent(item.type)) {
|
|
390
|
+
throw new Error("not a CreateEvent type");
|
|
391
|
+
}
|
|
392
|
+
return CreateEvent.reified().new({
|
|
393
|
+
typename: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.typename),
|
|
394
|
+
liquidStakingInfoId: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.ID.reified(), item.fields.liquid_staking_info_id),
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
static fromBcs(data) {
|
|
398
|
+
return CreateEvent.fromFields(CreateEvent.bcs.parse(data));
|
|
399
|
+
}
|
|
400
|
+
toJSONField() {
|
|
401
|
+
return {
|
|
402
|
+
typename: this.typename.toJSONField(),
|
|
403
|
+
liquidStakingInfoId: this.liquidStakingInfoId,
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
toJSON() {
|
|
407
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
408
|
+
}
|
|
409
|
+
static fromJSONField(field) {
|
|
410
|
+
return CreateEvent.reified().new({
|
|
411
|
+
typename: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.typename),
|
|
412
|
+
liquidStakingInfoId: (0, reified_1.decodeFromJSONField)(structs_5.ID.reified(), field.liquidStakingInfoId),
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
static fromJSON(json) {
|
|
416
|
+
if (json.$typeName !== CreateEvent.$typeName) {
|
|
417
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
418
|
+
}
|
|
419
|
+
return CreateEvent.fromJSONField(json);
|
|
420
|
+
}
|
|
421
|
+
static fromSuiParsedData(content) {
|
|
422
|
+
if (content.dataType !== "moveObject") {
|
|
423
|
+
throw new Error("not an object");
|
|
424
|
+
}
|
|
425
|
+
if (!isCreateEvent(content.type)) {
|
|
426
|
+
throw new Error(`object at ${content.fields.id} is not a CreateEvent object`);
|
|
427
|
+
}
|
|
428
|
+
return CreateEvent.fromFieldsWithTypes(content);
|
|
429
|
+
}
|
|
430
|
+
static fromSuiObjectData(data) {
|
|
431
|
+
if (data.bcs) {
|
|
432
|
+
if (data.bcs.dataType !== "moveObject" || !isCreateEvent(data.bcs.type)) {
|
|
433
|
+
throw new Error(`object at is not a CreateEvent object`);
|
|
434
|
+
}
|
|
435
|
+
return CreateEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
436
|
+
}
|
|
437
|
+
if (data.content) {
|
|
438
|
+
return CreateEvent.fromSuiParsedData(data.content);
|
|
439
|
+
}
|
|
440
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
441
|
+
}
|
|
442
|
+
static fetch(client, id) {
|
|
443
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
444
|
+
var _a, _b;
|
|
445
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
446
|
+
if (res.error) {
|
|
447
|
+
throw new Error(`error fetching CreateEvent object at id ${id}: ${res.error.code}`);
|
|
448
|
+
}
|
|
449
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
450
|
+
!isCreateEvent(res.data.bcs.type)) {
|
|
451
|
+
throw new Error(`object at id ${id} is not a CreateEvent object`);
|
|
452
|
+
}
|
|
453
|
+
return CreateEvent.fromSuiObjectData(res.data);
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
exports.CreateEvent = CreateEvent;
|
|
458
|
+
CreateEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::CreateEvent`;
|
|
459
|
+
CreateEvent.$numTypeParams = 0;
|
|
460
|
+
CreateEvent.$isPhantom = [];
|
|
461
|
+
/* ============================== DecreaseValidatorStakeEvent =============================== */
|
|
462
|
+
function isDecreaseValidatorStakeEvent(type) {
|
|
463
|
+
type = (0, util_1.compressSuiType)(type);
|
|
464
|
+
return type === `${index_1.PKG_V1}::liquid_staking::DecreaseValidatorStakeEvent`;
|
|
465
|
+
}
|
|
466
|
+
class DecreaseValidatorStakeEvent {
|
|
467
|
+
constructor(typeArgs, fields) {
|
|
468
|
+
this.__StructClass = true;
|
|
469
|
+
this.$typeName = DecreaseValidatorStakeEvent.$typeName;
|
|
470
|
+
this.$isPhantom = DecreaseValidatorStakeEvent.$isPhantom;
|
|
471
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(DecreaseValidatorStakeEvent.$typeName, ...typeArgs);
|
|
472
|
+
this.$typeArgs = typeArgs;
|
|
473
|
+
this.typename = fields.typename;
|
|
474
|
+
this.stakingPoolId = fields.stakingPoolId;
|
|
475
|
+
this.amount = fields.amount;
|
|
476
|
+
}
|
|
477
|
+
static reified() {
|
|
478
|
+
return {
|
|
479
|
+
typeName: DecreaseValidatorStakeEvent.$typeName,
|
|
480
|
+
fullTypeName: (0, util_1.composeSuiType)(DecreaseValidatorStakeEvent.$typeName, ...[]),
|
|
481
|
+
typeArgs: [],
|
|
482
|
+
isPhantom: DecreaseValidatorStakeEvent.$isPhantom,
|
|
483
|
+
reifiedTypeArgs: [],
|
|
484
|
+
fromFields: (fields) => DecreaseValidatorStakeEvent.fromFields(fields),
|
|
485
|
+
fromFieldsWithTypes: (item) => DecreaseValidatorStakeEvent.fromFieldsWithTypes(item),
|
|
486
|
+
fromBcs: (data) => DecreaseValidatorStakeEvent.fromBcs(data),
|
|
487
|
+
bcs: DecreaseValidatorStakeEvent.bcs,
|
|
488
|
+
fromJSONField: (field) => DecreaseValidatorStakeEvent.fromJSONField(field),
|
|
489
|
+
fromJSON: (json) => DecreaseValidatorStakeEvent.fromJSON(json),
|
|
490
|
+
fromSuiParsedData: (content) => DecreaseValidatorStakeEvent.fromSuiParsedData(content),
|
|
491
|
+
fromSuiObjectData: (content) => DecreaseValidatorStakeEvent.fromSuiObjectData(content),
|
|
492
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return DecreaseValidatorStakeEvent.fetch(client, id); }),
|
|
493
|
+
new: (fields) => {
|
|
494
|
+
return new DecreaseValidatorStakeEvent([], fields);
|
|
495
|
+
},
|
|
496
|
+
kind: "StructClassReified",
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
static get r() {
|
|
500
|
+
return DecreaseValidatorStakeEvent.reified();
|
|
501
|
+
}
|
|
502
|
+
static phantom() {
|
|
503
|
+
return (0, reified_1.phantom)(DecreaseValidatorStakeEvent.reified());
|
|
504
|
+
}
|
|
505
|
+
static get p() {
|
|
506
|
+
return DecreaseValidatorStakeEvent.phantom();
|
|
507
|
+
}
|
|
508
|
+
static get bcs() {
|
|
509
|
+
return bcs_1.bcs.struct("DecreaseValidatorStakeEvent", {
|
|
510
|
+
typename: structs_1.TypeName.bcs,
|
|
511
|
+
staking_pool_id: structs_5.ID.bcs,
|
|
512
|
+
amount: bcs_1.bcs.u64(),
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
static fromFields(fields) {
|
|
516
|
+
return DecreaseValidatorStakeEvent.reified().new({
|
|
517
|
+
typename: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.typename),
|
|
518
|
+
stakingPoolId: (0, reified_1.decodeFromFields)(structs_5.ID.reified(), fields.staking_pool_id),
|
|
519
|
+
amount: (0, reified_1.decodeFromFields)("u64", fields.amount),
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
static fromFieldsWithTypes(item) {
|
|
523
|
+
if (!isDecreaseValidatorStakeEvent(item.type)) {
|
|
524
|
+
throw new Error("not a DecreaseValidatorStakeEvent type");
|
|
525
|
+
}
|
|
526
|
+
return DecreaseValidatorStakeEvent.reified().new({
|
|
527
|
+
typename: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.typename),
|
|
528
|
+
stakingPoolId: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.ID.reified(), item.fields.staking_pool_id),
|
|
529
|
+
amount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.amount),
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
static fromBcs(data) {
|
|
533
|
+
return DecreaseValidatorStakeEvent.fromFields(DecreaseValidatorStakeEvent.bcs.parse(data));
|
|
534
|
+
}
|
|
535
|
+
toJSONField() {
|
|
536
|
+
return {
|
|
537
|
+
typename: this.typename.toJSONField(),
|
|
538
|
+
stakingPoolId: this.stakingPoolId,
|
|
539
|
+
amount: this.amount.toString(),
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
toJSON() {
|
|
543
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
544
|
+
}
|
|
545
|
+
static fromJSONField(field) {
|
|
546
|
+
return DecreaseValidatorStakeEvent.reified().new({
|
|
547
|
+
typename: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.typename),
|
|
548
|
+
stakingPoolId: (0, reified_1.decodeFromJSONField)(structs_5.ID.reified(), field.stakingPoolId),
|
|
549
|
+
amount: (0, reified_1.decodeFromJSONField)("u64", field.amount),
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
static fromJSON(json) {
|
|
553
|
+
if (json.$typeName !== DecreaseValidatorStakeEvent.$typeName) {
|
|
554
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
555
|
+
}
|
|
556
|
+
return DecreaseValidatorStakeEvent.fromJSONField(json);
|
|
557
|
+
}
|
|
558
|
+
static fromSuiParsedData(content) {
|
|
559
|
+
if (content.dataType !== "moveObject") {
|
|
560
|
+
throw new Error("not an object");
|
|
561
|
+
}
|
|
562
|
+
if (!isDecreaseValidatorStakeEvent(content.type)) {
|
|
563
|
+
throw new Error(`object at ${content.fields.id} is not a DecreaseValidatorStakeEvent object`);
|
|
564
|
+
}
|
|
565
|
+
return DecreaseValidatorStakeEvent.fromFieldsWithTypes(content);
|
|
566
|
+
}
|
|
567
|
+
static fromSuiObjectData(data) {
|
|
568
|
+
if (data.bcs) {
|
|
569
|
+
if (data.bcs.dataType !== "moveObject" ||
|
|
570
|
+
!isDecreaseValidatorStakeEvent(data.bcs.type)) {
|
|
571
|
+
throw new Error(`object at is not a DecreaseValidatorStakeEvent object`);
|
|
572
|
+
}
|
|
573
|
+
return DecreaseValidatorStakeEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
574
|
+
}
|
|
575
|
+
if (data.content) {
|
|
576
|
+
return DecreaseValidatorStakeEvent.fromSuiParsedData(data.content);
|
|
577
|
+
}
|
|
578
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
579
|
+
}
|
|
580
|
+
static fetch(client, id) {
|
|
581
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
582
|
+
var _a, _b;
|
|
583
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
584
|
+
if (res.error) {
|
|
585
|
+
throw new Error(`error fetching DecreaseValidatorStakeEvent object at id ${id}: ${res.error.code}`);
|
|
586
|
+
}
|
|
587
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
588
|
+
!isDecreaseValidatorStakeEvent(res.data.bcs.type)) {
|
|
589
|
+
throw new Error(`object at id ${id} is not a DecreaseValidatorStakeEvent object`);
|
|
590
|
+
}
|
|
591
|
+
return DecreaseValidatorStakeEvent.fromSuiObjectData(res.data);
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
exports.DecreaseValidatorStakeEvent = DecreaseValidatorStakeEvent;
|
|
596
|
+
DecreaseValidatorStakeEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::DecreaseValidatorStakeEvent`;
|
|
597
|
+
DecreaseValidatorStakeEvent.$numTypeParams = 0;
|
|
598
|
+
DecreaseValidatorStakeEvent.$isPhantom = [];
|
|
599
|
+
/* ============================== EpochChangedEvent =============================== */
|
|
600
|
+
function isEpochChangedEvent(type) {
|
|
601
|
+
type = (0, util_1.compressSuiType)(type);
|
|
602
|
+
return type === `${index_1.PKG_V1}::liquid_staking::EpochChangedEvent`;
|
|
603
|
+
}
|
|
604
|
+
class EpochChangedEvent {
|
|
605
|
+
constructor(typeArgs, fields) {
|
|
606
|
+
this.__StructClass = true;
|
|
607
|
+
this.$typeName = EpochChangedEvent.$typeName;
|
|
608
|
+
this.$isPhantom = EpochChangedEvent.$isPhantom;
|
|
609
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(EpochChangedEvent.$typeName, ...typeArgs);
|
|
610
|
+
this.$typeArgs = typeArgs;
|
|
611
|
+
this.typename = fields.typename;
|
|
612
|
+
this.oldSuiSupply = fields.oldSuiSupply;
|
|
613
|
+
this.newSuiSupply = fields.newSuiSupply;
|
|
614
|
+
this.lstSupply = fields.lstSupply;
|
|
615
|
+
this.spreadFee = fields.spreadFee;
|
|
616
|
+
}
|
|
617
|
+
static reified() {
|
|
618
|
+
return {
|
|
619
|
+
typeName: EpochChangedEvent.$typeName,
|
|
620
|
+
fullTypeName: (0, util_1.composeSuiType)(EpochChangedEvent.$typeName, ...[]),
|
|
621
|
+
typeArgs: [],
|
|
622
|
+
isPhantom: EpochChangedEvent.$isPhantom,
|
|
623
|
+
reifiedTypeArgs: [],
|
|
624
|
+
fromFields: (fields) => EpochChangedEvent.fromFields(fields),
|
|
625
|
+
fromFieldsWithTypes: (item) => EpochChangedEvent.fromFieldsWithTypes(item),
|
|
626
|
+
fromBcs: (data) => EpochChangedEvent.fromBcs(data),
|
|
627
|
+
bcs: EpochChangedEvent.bcs,
|
|
628
|
+
fromJSONField: (field) => EpochChangedEvent.fromJSONField(field),
|
|
629
|
+
fromJSON: (json) => EpochChangedEvent.fromJSON(json),
|
|
630
|
+
fromSuiParsedData: (content) => EpochChangedEvent.fromSuiParsedData(content),
|
|
631
|
+
fromSuiObjectData: (content) => EpochChangedEvent.fromSuiObjectData(content),
|
|
632
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return EpochChangedEvent.fetch(client, id); }),
|
|
633
|
+
new: (fields) => {
|
|
634
|
+
return new EpochChangedEvent([], fields);
|
|
635
|
+
},
|
|
636
|
+
kind: "StructClassReified",
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
static get r() {
|
|
640
|
+
return EpochChangedEvent.reified();
|
|
641
|
+
}
|
|
642
|
+
static phantom() {
|
|
643
|
+
return (0, reified_1.phantom)(EpochChangedEvent.reified());
|
|
644
|
+
}
|
|
645
|
+
static get p() {
|
|
646
|
+
return EpochChangedEvent.phantom();
|
|
647
|
+
}
|
|
648
|
+
static get bcs() {
|
|
649
|
+
return bcs_1.bcs.struct("EpochChangedEvent", {
|
|
650
|
+
typename: structs_1.TypeName.bcs,
|
|
651
|
+
old_sui_supply: bcs_1.bcs.u64(),
|
|
652
|
+
new_sui_supply: bcs_1.bcs.u64(),
|
|
653
|
+
lst_supply: bcs_1.bcs.u64(),
|
|
654
|
+
spread_fee: bcs_1.bcs.u64(),
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
static fromFields(fields) {
|
|
658
|
+
return EpochChangedEvent.reified().new({
|
|
659
|
+
typename: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.typename),
|
|
660
|
+
oldSuiSupply: (0, reified_1.decodeFromFields)("u64", fields.old_sui_supply),
|
|
661
|
+
newSuiSupply: (0, reified_1.decodeFromFields)("u64", fields.new_sui_supply),
|
|
662
|
+
lstSupply: (0, reified_1.decodeFromFields)("u64", fields.lst_supply),
|
|
663
|
+
spreadFee: (0, reified_1.decodeFromFields)("u64", fields.spread_fee),
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
static fromFieldsWithTypes(item) {
|
|
667
|
+
if (!isEpochChangedEvent(item.type)) {
|
|
668
|
+
throw new Error("not a EpochChangedEvent type");
|
|
669
|
+
}
|
|
670
|
+
return EpochChangedEvent.reified().new({
|
|
671
|
+
typename: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.typename),
|
|
672
|
+
oldSuiSupply: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.old_sui_supply),
|
|
673
|
+
newSuiSupply: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.new_sui_supply),
|
|
674
|
+
lstSupply: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lst_supply),
|
|
675
|
+
spreadFee: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.spread_fee),
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
static fromBcs(data) {
|
|
679
|
+
return EpochChangedEvent.fromFields(EpochChangedEvent.bcs.parse(data));
|
|
680
|
+
}
|
|
681
|
+
toJSONField() {
|
|
682
|
+
return {
|
|
683
|
+
typename: this.typename.toJSONField(),
|
|
684
|
+
oldSuiSupply: this.oldSuiSupply.toString(),
|
|
685
|
+
newSuiSupply: this.newSuiSupply.toString(),
|
|
686
|
+
lstSupply: this.lstSupply.toString(),
|
|
687
|
+
spreadFee: this.spreadFee.toString(),
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
toJSON() {
|
|
691
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
692
|
+
}
|
|
693
|
+
static fromJSONField(field) {
|
|
694
|
+
return EpochChangedEvent.reified().new({
|
|
695
|
+
typename: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.typename),
|
|
696
|
+
oldSuiSupply: (0, reified_1.decodeFromJSONField)("u64", field.oldSuiSupply),
|
|
697
|
+
newSuiSupply: (0, reified_1.decodeFromJSONField)("u64", field.newSuiSupply),
|
|
698
|
+
lstSupply: (0, reified_1.decodeFromJSONField)("u64", field.lstSupply),
|
|
699
|
+
spreadFee: (0, reified_1.decodeFromJSONField)("u64", field.spreadFee),
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
static fromJSON(json) {
|
|
703
|
+
if (json.$typeName !== EpochChangedEvent.$typeName) {
|
|
704
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
705
|
+
}
|
|
706
|
+
return EpochChangedEvent.fromJSONField(json);
|
|
707
|
+
}
|
|
708
|
+
static fromSuiParsedData(content) {
|
|
709
|
+
if (content.dataType !== "moveObject") {
|
|
710
|
+
throw new Error("not an object");
|
|
711
|
+
}
|
|
712
|
+
if (!isEpochChangedEvent(content.type)) {
|
|
713
|
+
throw new Error(`object at ${content.fields.id} is not a EpochChangedEvent object`);
|
|
714
|
+
}
|
|
715
|
+
return EpochChangedEvent.fromFieldsWithTypes(content);
|
|
716
|
+
}
|
|
717
|
+
static fromSuiObjectData(data) {
|
|
718
|
+
if (data.bcs) {
|
|
719
|
+
if (data.bcs.dataType !== "moveObject" ||
|
|
720
|
+
!isEpochChangedEvent(data.bcs.type)) {
|
|
721
|
+
throw new Error(`object at is not a EpochChangedEvent object`);
|
|
722
|
+
}
|
|
723
|
+
return EpochChangedEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
724
|
+
}
|
|
725
|
+
if (data.content) {
|
|
726
|
+
return EpochChangedEvent.fromSuiParsedData(data.content);
|
|
727
|
+
}
|
|
728
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
729
|
+
}
|
|
730
|
+
static fetch(client, id) {
|
|
731
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
732
|
+
var _a, _b;
|
|
733
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
734
|
+
if (res.error) {
|
|
735
|
+
throw new Error(`error fetching EpochChangedEvent object at id ${id}: ${res.error.code}`);
|
|
736
|
+
}
|
|
737
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
738
|
+
!isEpochChangedEvent(res.data.bcs.type)) {
|
|
739
|
+
throw new Error(`object at id ${id} is not a EpochChangedEvent object`);
|
|
740
|
+
}
|
|
741
|
+
return EpochChangedEvent.fromSuiObjectData(res.data);
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
exports.EpochChangedEvent = EpochChangedEvent;
|
|
746
|
+
EpochChangedEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::EpochChangedEvent`;
|
|
747
|
+
EpochChangedEvent.$numTypeParams = 0;
|
|
748
|
+
EpochChangedEvent.$isPhantom = [];
|
|
749
|
+
/* ============================== IncreaseValidatorStakeEvent =============================== */
|
|
750
|
+
function isIncreaseValidatorStakeEvent(type) {
|
|
751
|
+
type = (0, util_1.compressSuiType)(type);
|
|
752
|
+
return type === `${index_1.PKG_V1}::liquid_staking::IncreaseValidatorStakeEvent`;
|
|
753
|
+
}
|
|
754
|
+
class IncreaseValidatorStakeEvent {
|
|
755
|
+
constructor(typeArgs, fields) {
|
|
756
|
+
this.__StructClass = true;
|
|
757
|
+
this.$typeName = IncreaseValidatorStakeEvent.$typeName;
|
|
758
|
+
this.$isPhantom = IncreaseValidatorStakeEvent.$isPhantom;
|
|
759
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(IncreaseValidatorStakeEvent.$typeName, ...typeArgs);
|
|
760
|
+
this.$typeArgs = typeArgs;
|
|
761
|
+
this.typename = fields.typename;
|
|
762
|
+
this.stakingPoolId = fields.stakingPoolId;
|
|
763
|
+
this.amount = fields.amount;
|
|
764
|
+
}
|
|
765
|
+
static reified() {
|
|
766
|
+
return {
|
|
767
|
+
typeName: IncreaseValidatorStakeEvent.$typeName,
|
|
768
|
+
fullTypeName: (0, util_1.composeSuiType)(IncreaseValidatorStakeEvent.$typeName, ...[]),
|
|
769
|
+
typeArgs: [],
|
|
770
|
+
isPhantom: IncreaseValidatorStakeEvent.$isPhantom,
|
|
771
|
+
reifiedTypeArgs: [],
|
|
772
|
+
fromFields: (fields) => IncreaseValidatorStakeEvent.fromFields(fields),
|
|
773
|
+
fromFieldsWithTypes: (item) => IncreaseValidatorStakeEvent.fromFieldsWithTypes(item),
|
|
774
|
+
fromBcs: (data) => IncreaseValidatorStakeEvent.fromBcs(data),
|
|
775
|
+
bcs: IncreaseValidatorStakeEvent.bcs,
|
|
776
|
+
fromJSONField: (field) => IncreaseValidatorStakeEvent.fromJSONField(field),
|
|
777
|
+
fromJSON: (json) => IncreaseValidatorStakeEvent.fromJSON(json),
|
|
778
|
+
fromSuiParsedData: (content) => IncreaseValidatorStakeEvent.fromSuiParsedData(content),
|
|
779
|
+
fromSuiObjectData: (content) => IncreaseValidatorStakeEvent.fromSuiObjectData(content),
|
|
780
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return IncreaseValidatorStakeEvent.fetch(client, id); }),
|
|
781
|
+
new: (fields) => {
|
|
782
|
+
return new IncreaseValidatorStakeEvent([], fields);
|
|
783
|
+
},
|
|
784
|
+
kind: "StructClassReified",
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
static get r() {
|
|
788
|
+
return IncreaseValidatorStakeEvent.reified();
|
|
789
|
+
}
|
|
790
|
+
static phantom() {
|
|
791
|
+
return (0, reified_1.phantom)(IncreaseValidatorStakeEvent.reified());
|
|
792
|
+
}
|
|
793
|
+
static get p() {
|
|
794
|
+
return IncreaseValidatorStakeEvent.phantom();
|
|
795
|
+
}
|
|
796
|
+
static get bcs() {
|
|
797
|
+
return bcs_1.bcs.struct("IncreaseValidatorStakeEvent", {
|
|
798
|
+
typename: structs_1.TypeName.bcs,
|
|
799
|
+
staking_pool_id: structs_5.ID.bcs,
|
|
800
|
+
amount: bcs_1.bcs.u64(),
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
static fromFields(fields) {
|
|
804
|
+
return IncreaseValidatorStakeEvent.reified().new({
|
|
805
|
+
typename: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.typename),
|
|
806
|
+
stakingPoolId: (0, reified_1.decodeFromFields)(structs_5.ID.reified(), fields.staking_pool_id),
|
|
807
|
+
amount: (0, reified_1.decodeFromFields)("u64", fields.amount),
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
static fromFieldsWithTypes(item) {
|
|
811
|
+
if (!isIncreaseValidatorStakeEvent(item.type)) {
|
|
812
|
+
throw new Error("not a IncreaseValidatorStakeEvent type");
|
|
813
|
+
}
|
|
814
|
+
return IncreaseValidatorStakeEvent.reified().new({
|
|
815
|
+
typename: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.typename),
|
|
816
|
+
stakingPoolId: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.ID.reified(), item.fields.staking_pool_id),
|
|
817
|
+
amount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.amount),
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
static fromBcs(data) {
|
|
821
|
+
return IncreaseValidatorStakeEvent.fromFields(IncreaseValidatorStakeEvent.bcs.parse(data));
|
|
822
|
+
}
|
|
823
|
+
toJSONField() {
|
|
824
|
+
return {
|
|
825
|
+
typename: this.typename.toJSONField(),
|
|
826
|
+
stakingPoolId: this.stakingPoolId,
|
|
827
|
+
amount: this.amount.toString(),
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
toJSON() {
|
|
831
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
832
|
+
}
|
|
833
|
+
static fromJSONField(field) {
|
|
834
|
+
return IncreaseValidatorStakeEvent.reified().new({
|
|
835
|
+
typename: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.typename),
|
|
836
|
+
stakingPoolId: (0, reified_1.decodeFromJSONField)(structs_5.ID.reified(), field.stakingPoolId),
|
|
837
|
+
amount: (0, reified_1.decodeFromJSONField)("u64", field.amount),
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
static fromJSON(json) {
|
|
841
|
+
if (json.$typeName !== IncreaseValidatorStakeEvent.$typeName) {
|
|
842
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
843
|
+
}
|
|
844
|
+
return IncreaseValidatorStakeEvent.fromJSONField(json);
|
|
845
|
+
}
|
|
846
|
+
static fromSuiParsedData(content) {
|
|
847
|
+
if (content.dataType !== "moveObject") {
|
|
848
|
+
throw new Error("not an object");
|
|
849
|
+
}
|
|
850
|
+
if (!isIncreaseValidatorStakeEvent(content.type)) {
|
|
851
|
+
throw new Error(`object at ${content.fields.id} is not a IncreaseValidatorStakeEvent object`);
|
|
852
|
+
}
|
|
853
|
+
return IncreaseValidatorStakeEvent.fromFieldsWithTypes(content);
|
|
854
|
+
}
|
|
855
|
+
static fromSuiObjectData(data) {
|
|
856
|
+
if (data.bcs) {
|
|
857
|
+
if (data.bcs.dataType !== "moveObject" ||
|
|
858
|
+
!isIncreaseValidatorStakeEvent(data.bcs.type)) {
|
|
859
|
+
throw new Error(`object at is not a IncreaseValidatorStakeEvent object`);
|
|
860
|
+
}
|
|
861
|
+
return IncreaseValidatorStakeEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
862
|
+
}
|
|
863
|
+
if (data.content) {
|
|
864
|
+
return IncreaseValidatorStakeEvent.fromSuiParsedData(data.content);
|
|
865
|
+
}
|
|
866
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
867
|
+
}
|
|
868
|
+
static fetch(client, id) {
|
|
869
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
870
|
+
var _a, _b;
|
|
871
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
872
|
+
if (res.error) {
|
|
873
|
+
throw new Error(`error fetching IncreaseValidatorStakeEvent object at id ${id}: ${res.error.code}`);
|
|
874
|
+
}
|
|
875
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
876
|
+
!isIncreaseValidatorStakeEvent(res.data.bcs.type)) {
|
|
877
|
+
throw new Error(`object at id ${id} is not a IncreaseValidatorStakeEvent object`);
|
|
878
|
+
}
|
|
879
|
+
return IncreaseValidatorStakeEvent.fromSuiObjectData(res.data);
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
exports.IncreaseValidatorStakeEvent = IncreaseValidatorStakeEvent;
|
|
884
|
+
IncreaseValidatorStakeEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::IncreaseValidatorStakeEvent`;
|
|
885
|
+
IncreaseValidatorStakeEvent.$numTypeParams = 0;
|
|
886
|
+
IncreaseValidatorStakeEvent.$isPhantom = [];
|
|
887
|
+
/* ============================== LIQUID_STAKING =============================== */
|
|
888
|
+
function isLIQUID_STAKING(type) {
|
|
889
|
+
type = (0, util_1.compressSuiType)(type);
|
|
890
|
+
return type === `${index_1.PKG_V1}::liquid_staking::LIQUID_STAKING`;
|
|
891
|
+
}
|
|
892
|
+
class LIQUID_STAKING {
|
|
893
|
+
constructor(typeArgs, fields) {
|
|
894
|
+
this.__StructClass = true;
|
|
895
|
+
this.$typeName = LIQUID_STAKING.$typeName;
|
|
896
|
+
this.$isPhantom = LIQUID_STAKING.$isPhantom;
|
|
897
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(LIQUID_STAKING.$typeName, ...typeArgs);
|
|
898
|
+
this.$typeArgs = typeArgs;
|
|
899
|
+
this.dummyField = fields.dummyField;
|
|
900
|
+
}
|
|
901
|
+
static reified() {
|
|
902
|
+
return {
|
|
903
|
+
typeName: LIQUID_STAKING.$typeName,
|
|
904
|
+
fullTypeName: (0, util_1.composeSuiType)(LIQUID_STAKING.$typeName, ...[]),
|
|
905
|
+
typeArgs: [],
|
|
906
|
+
isPhantom: LIQUID_STAKING.$isPhantom,
|
|
907
|
+
reifiedTypeArgs: [],
|
|
908
|
+
fromFields: (fields) => LIQUID_STAKING.fromFields(fields),
|
|
909
|
+
fromFieldsWithTypes: (item) => LIQUID_STAKING.fromFieldsWithTypes(item),
|
|
910
|
+
fromBcs: (data) => LIQUID_STAKING.fromBcs(data),
|
|
911
|
+
bcs: LIQUID_STAKING.bcs,
|
|
912
|
+
fromJSONField: (field) => LIQUID_STAKING.fromJSONField(field),
|
|
913
|
+
fromJSON: (json) => LIQUID_STAKING.fromJSON(json),
|
|
914
|
+
fromSuiParsedData: (content) => LIQUID_STAKING.fromSuiParsedData(content),
|
|
915
|
+
fromSuiObjectData: (content) => LIQUID_STAKING.fromSuiObjectData(content),
|
|
916
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return LIQUID_STAKING.fetch(client, id); }),
|
|
917
|
+
new: (fields) => {
|
|
918
|
+
return new LIQUID_STAKING([], fields);
|
|
919
|
+
},
|
|
920
|
+
kind: "StructClassReified",
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
static get r() {
|
|
924
|
+
return LIQUID_STAKING.reified();
|
|
925
|
+
}
|
|
926
|
+
static phantom() {
|
|
927
|
+
return (0, reified_1.phantom)(LIQUID_STAKING.reified());
|
|
928
|
+
}
|
|
929
|
+
static get p() {
|
|
930
|
+
return LIQUID_STAKING.phantom();
|
|
931
|
+
}
|
|
932
|
+
static get bcs() {
|
|
933
|
+
return bcs_1.bcs.struct("LIQUID_STAKING", {
|
|
934
|
+
dummy_field: bcs_1.bcs.bool(),
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
static fromFields(fields) {
|
|
938
|
+
return LIQUID_STAKING.reified().new({
|
|
939
|
+
dummyField: (0, reified_1.decodeFromFields)("bool", fields.dummy_field),
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
static fromFieldsWithTypes(item) {
|
|
943
|
+
if (!isLIQUID_STAKING(item.type)) {
|
|
944
|
+
throw new Error("not a LIQUID_STAKING type");
|
|
945
|
+
}
|
|
946
|
+
return LIQUID_STAKING.reified().new({
|
|
947
|
+
dummyField: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.dummy_field),
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
static fromBcs(data) {
|
|
951
|
+
return LIQUID_STAKING.fromFields(LIQUID_STAKING.bcs.parse(data));
|
|
952
|
+
}
|
|
953
|
+
toJSONField() {
|
|
954
|
+
return {
|
|
955
|
+
dummyField: this.dummyField,
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
toJSON() {
|
|
959
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
960
|
+
}
|
|
961
|
+
static fromJSONField(field) {
|
|
962
|
+
return LIQUID_STAKING.reified().new({
|
|
963
|
+
dummyField: (0, reified_1.decodeFromJSONField)("bool", field.dummyField),
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
static fromJSON(json) {
|
|
967
|
+
if (json.$typeName !== LIQUID_STAKING.$typeName) {
|
|
968
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
969
|
+
}
|
|
970
|
+
return LIQUID_STAKING.fromJSONField(json);
|
|
971
|
+
}
|
|
972
|
+
static fromSuiParsedData(content) {
|
|
973
|
+
if (content.dataType !== "moveObject") {
|
|
974
|
+
throw new Error("not an object");
|
|
975
|
+
}
|
|
976
|
+
if (!isLIQUID_STAKING(content.type)) {
|
|
977
|
+
throw new Error(`object at ${content.fields.id} is not a LIQUID_STAKING object`);
|
|
978
|
+
}
|
|
979
|
+
return LIQUID_STAKING.fromFieldsWithTypes(content);
|
|
980
|
+
}
|
|
981
|
+
static fromSuiObjectData(data) {
|
|
982
|
+
if (data.bcs) {
|
|
983
|
+
if (data.bcs.dataType !== "moveObject" ||
|
|
984
|
+
!isLIQUID_STAKING(data.bcs.type)) {
|
|
985
|
+
throw new Error(`object at is not a LIQUID_STAKING object`);
|
|
986
|
+
}
|
|
987
|
+
return LIQUID_STAKING.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
988
|
+
}
|
|
989
|
+
if (data.content) {
|
|
990
|
+
return LIQUID_STAKING.fromSuiParsedData(data.content);
|
|
991
|
+
}
|
|
992
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
993
|
+
}
|
|
994
|
+
static fetch(client, id) {
|
|
995
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
996
|
+
var _a, _b;
|
|
997
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
998
|
+
if (res.error) {
|
|
999
|
+
throw new Error(`error fetching LIQUID_STAKING object at id ${id}: ${res.error.code}`);
|
|
1000
|
+
}
|
|
1001
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
1002
|
+
!isLIQUID_STAKING(res.data.bcs.type)) {
|
|
1003
|
+
throw new Error(`object at id ${id} is not a LIQUID_STAKING object`);
|
|
1004
|
+
}
|
|
1005
|
+
return LIQUID_STAKING.fromSuiObjectData(res.data);
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
exports.LIQUID_STAKING = LIQUID_STAKING;
|
|
1010
|
+
LIQUID_STAKING.$typeName = `${index_1.PKG_V1}::liquid_staking::LIQUID_STAKING`;
|
|
1011
|
+
LIQUID_STAKING.$numTypeParams = 0;
|
|
1012
|
+
LIQUID_STAKING.$isPhantom = [];
|
|
1013
|
+
/* ============================== LiquidStakingInfo =============================== */
|
|
1014
|
+
function isLiquidStakingInfo(type) {
|
|
1015
|
+
type = (0, util_1.compressSuiType)(type);
|
|
1016
|
+
return type.startsWith(`${index_1.PKG_V1}::liquid_staking::LiquidStakingInfo` + "<");
|
|
1017
|
+
}
|
|
1018
|
+
class LiquidStakingInfo {
|
|
1019
|
+
constructor(typeArgs, fields) {
|
|
1020
|
+
this.__StructClass = true;
|
|
1021
|
+
this.$typeName = LiquidStakingInfo.$typeName;
|
|
1022
|
+
this.$isPhantom = LiquidStakingInfo.$isPhantom;
|
|
1023
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(LiquidStakingInfo.$typeName, ...typeArgs);
|
|
1024
|
+
this.$typeArgs = typeArgs;
|
|
1025
|
+
this.id = fields.id;
|
|
1026
|
+
this.lstTreasuryCap = fields.lstTreasuryCap;
|
|
1027
|
+
this.feeConfig = fields.feeConfig;
|
|
1028
|
+
this.fees = fields.fees;
|
|
1029
|
+
this.accruedSpreadFees = fields.accruedSpreadFees;
|
|
1030
|
+
this.storage = fields.storage;
|
|
1031
|
+
this.version = fields.version;
|
|
1032
|
+
this.extraFields = fields.extraFields;
|
|
1033
|
+
}
|
|
1034
|
+
static reified(P) {
|
|
1035
|
+
return {
|
|
1036
|
+
typeName: LiquidStakingInfo.$typeName,
|
|
1037
|
+
fullTypeName: (0, util_1.composeSuiType)(LiquidStakingInfo.$typeName, ...[(0, reified_1.extractType)(P)]),
|
|
1038
|
+
typeArgs: [(0, reified_1.extractType)(P)],
|
|
1039
|
+
isPhantom: LiquidStakingInfo.$isPhantom,
|
|
1040
|
+
reifiedTypeArgs: [P],
|
|
1041
|
+
fromFields: (fields) => LiquidStakingInfo.fromFields(P, fields),
|
|
1042
|
+
fromFieldsWithTypes: (item) => LiquidStakingInfo.fromFieldsWithTypes(P, item),
|
|
1043
|
+
fromBcs: (data) => LiquidStakingInfo.fromBcs(P, data),
|
|
1044
|
+
bcs: LiquidStakingInfo.bcs,
|
|
1045
|
+
fromJSONField: (field) => LiquidStakingInfo.fromJSONField(P, field),
|
|
1046
|
+
fromJSON: (json) => LiquidStakingInfo.fromJSON(P, json),
|
|
1047
|
+
fromSuiParsedData: (content) => LiquidStakingInfo.fromSuiParsedData(P, content),
|
|
1048
|
+
fromSuiObjectData: (content) => LiquidStakingInfo.fromSuiObjectData(P, content),
|
|
1049
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return LiquidStakingInfo.fetch(client, P, id); }),
|
|
1050
|
+
new: (fields) => {
|
|
1051
|
+
return new LiquidStakingInfo([(0, reified_1.extractType)(P)], fields);
|
|
1052
|
+
},
|
|
1053
|
+
kind: "StructClassReified",
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1056
|
+
static get r() {
|
|
1057
|
+
return LiquidStakingInfo.reified;
|
|
1058
|
+
}
|
|
1059
|
+
static phantom(P) {
|
|
1060
|
+
return (0, reified_1.phantom)(LiquidStakingInfo.reified(P));
|
|
1061
|
+
}
|
|
1062
|
+
static get p() {
|
|
1063
|
+
return LiquidStakingInfo.phantom;
|
|
1064
|
+
}
|
|
1065
|
+
static get bcs() {
|
|
1066
|
+
return bcs_1.bcs.struct("LiquidStakingInfo", {
|
|
1067
|
+
id: structs_5.UID.bcs,
|
|
1068
|
+
lst_treasury_cap: structs_4.TreasuryCap.bcs,
|
|
1069
|
+
fee_config: structs_7.Cell.bcs(structs_8.FeeConfig.bcs),
|
|
1070
|
+
fees: structs_3.Balance.bcs,
|
|
1071
|
+
accrued_spread_fees: bcs_1.bcs.u64(),
|
|
1072
|
+
storage: structs_9.Storage.bcs,
|
|
1073
|
+
version: structs_10.Version.bcs,
|
|
1074
|
+
extra_fields: structs_2.Bag.bcs,
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
static fromFields(typeArg, fields) {
|
|
1078
|
+
return LiquidStakingInfo.reified(typeArg).new({
|
|
1079
|
+
id: (0, reified_1.decodeFromFields)(structs_5.UID.reified(), fields.id),
|
|
1080
|
+
lstTreasuryCap: (0, reified_1.decodeFromFields)(structs_4.TreasuryCap.reified(typeArg), fields.lst_treasury_cap),
|
|
1081
|
+
feeConfig: (0, reified_1.decodeFromFields)(structs_7.Cell.reified(structs_8.FeeConfig.reified()), fields.fee_config),
|
|
1082
|
+
fees: (0, reified_1.decodeFromFields)(structs_3.Balance.reified(reified.phantom(structs_6.SUI.reified())), fields.fees),
|
|
1083
|
+
accruedSpreadFees: (0, reified_1.decodeFromFields)("u64", fields.accrued_spread_fees),
|
|
1084
|
+
storage: (0, reified_1.decodeFromFields)(structs_9.Storage.reified(), fields.storage),
|
|
1085
|
+
version: (0, reified_1.decodeFromFields)(structs_10.Version.reified(), fields.version),
|
|
1086
|
+
extraFields: (0, reified_1.decodeFromFields)(structs_2.Bag.reified(), fields.extra_fields),
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
static fromFieldsWithTypes(typeArg, item) {
|
|
1090
|
+
if (!isLiquidStakingInfo(item.type)) {
|
|
1091
|
+
throw new Error("not a LiquidStakingInfo type");
|
|
1092
|
+
}
|
|
1093
|
+
(0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
|
|
1094
|
+
return LiquidStakingInfo.reified(typeArg).new({
|
|
1095
|
+
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.UID.reified(), item.fields.id),
|
|
1096
|
+
lstTreasuryCap: (0, reified_1.decodeFromFieldsWithTypes)(structs_4.TreasuryCap.reified(typeArg), item.fields.lst_treasury_cap),
|
|
1097
|
+
feeConfig: (0, reified_1.decodeFromFieldsWithTypes)(structs_7.Cell.reified(structs_8.FeeConfig.reified()), item.fields.fee_config),
|
|
1098
|
+
fees: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.Balance.reified(reified.phantom(structs_6.SUI.reified())), item.fields.fees),
|
|
1099
|
+
accruedSpreadFees: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.accrued_spread_fees),
|
|
1100
|
+
storage: (0, reified_1.decodeFromFieldsWithTypes)(structs_9.Storage.reified(), item.fields.storage),
|
|
1101
|
+
version: (0, reified_1.decodeFromFieldsWithTypes)(structs_10.Version.reified(), item.fields.version),
|
|
1102
|
+
extraFields: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.Bag.reified(), item.fields.extra_fields),
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
static fromBcs(typeArg, data) {
|
|
1106
|
+
return LiquidStakingInfo.fromFields(typeArg, LiquidStakingInfo.bcs.parse(data));
|
|
1107
|
+
}
|
|
1108
|
+
toJSONField() {
|
|
1109
|
+
return {
|
|
1110
|
+
id: this.id,
|
|
1111
|
+
lstTreasuryCap: this.lstTreasuryCap.toJSONField(),
|
|
1112
|
+
feeConfig: this.feeConfig.toJSONField(),
|
|
1113
|
+
fees: this.fees.toJSONField(),
|
|
1114
|
+
accruedSpreadFees: this.accruedSpreadFees.toString(),
|
|
1115
|
+
storage: this.storage.toJSONField(),
|
|
1116
|
+
version: this.version.toJSONField(),
|
|
1117
|
+
extraFields: this.extraFields.toJSONField(),
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
toJSON() {
|
|
1121
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1122
|
+
}
|
|
1123
|
+
static fromJSONField(typeArg, field) {
|
|
1124
|
+
return LiquidStakingInfo.reified(typeArg).new({
|
|
1125
|
+
id: (0, reified_1.decodeFromJSONField)(structs_5.UID.reified(), field.id),
|
|
1126
|
+
lstTreasuryCap: (0, reified_1.decodeFromJSONField)(structs_4.TreasuryCap.reified(typeArg), field.lstTreasuryCap),
|
|
1127
|
+
feeConfig: (0, reified_1.decodeFromJSONField)(structs_7.Cell.reified(structs_8.FeeConfig.reified()), field.feeConfig),
|
|
1128
|
+
fees: (0, reified_1.decodeFromJSONField)(structs_3.Balance.reified(reified.phantom(structs_6.SUI.reified())), field.fees),
|
|
1129
|
+
accruedSpreadFees: (0, reified_1.decodeFromJSONField)("u64", field.accruedSpreadFees),
|
|
1130
|
+
storage: (0, reified_1.decodeFromJSONField)(structs_9.Storage.reified(), field.storage),
|
|
1131
|
+
version: (0, reified_1.decodeFromJSONField)(structs_10.Version.reified(), field.version),
|
|
1132
|
+
extraFields: (0, reified_1.decodeFromJSONField)(structs_2.Bag.reified(), field.extraFields),
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
static fromJSON(typeArg, json) {
|
|
1136
|
+
if (json.$typeName !== LiquidStakingInfo.$typeName) {
|
|
1137
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
1138
|
+
}
|
|
1139
|
+
(0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(LiquidStakingInfo.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
|
|
1140
|
+
return LiquidStakingInfo.fromJSONField(typeArg, json);
|
|
1141
|
+
}
|
|
1142
|
+
static fromSuiParsedData(typeArg, content) {
|
|
1143
|
+
if (content.dataType !== "moveObject") {
|
|
1144
|
+
throw new Error("not an object");
|
|
1145
|
+
}
|
|
1146
|
+
if (!isLiquidStakingInfo(content.type)) {
|
|
1147
|
+
throw new Error(`object at ${content.fields.id} is not a LiquidStakingInfo object`);
|
|
1148
|
+
}
|
|
1149
|
+
return LiquidStakingInfo.fromFieldsWithTypes(typeArg, content);
|
|
1150
|
+
}
|
|
1151
|
+
static fromSuiObjectData(typeArg, data) {
|
|
1152
|
+
if (data.bcs) {
|
|
1153
|
+
if (data.bcs.dataType !== "moveObject" ||
|
|
1154
|
+
!isLiquidStakingInfo(data.bcs.type)) {
|
|
1155
|
+
throw new Error(`object at is not a LiquidStakingInfo object`);
|
|
1156
|
+
}
|
|
1157
|
+
const gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
|
|
1158
|
+
if (gotTypeArgs.length !== 1) {
|
|
1159
|
+
throw new Error(`type argument mismatch: expected 1 type argument but got '${gotTypeArgs.length}'`);
|
|
1160
|
+
}
|
|
1161
|
+
const gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
|
|
1162
|
+
const expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
|
|
1163
|
+
if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
|
|
1164
|
+
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
1165
|
+
}
|
|
1166
|
+
return LiquidStakingInfo.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1167
|
+
}
|
|
1168
|
+
if (data.content) {
|
|
1169
|
+
return LiquidStakingInfo.fromSuiParsedData(typeArg, data.content);
|
|
1170
|
+
}
|
|
1171
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1172
|
+
}
|
|
1173
|
+
static fetch(client, typeArg, id) {
|
|
1174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1175
|
+
var _a, _b;
|
|
1176
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
1177
|
+
if (res.error) {
|
|
1178
|
+
throw new Error(`error fetching LiquidStakingInfo object at id ${id}: ${res.error.code}`);
|
|
1179
|
+
}
|
|
1180
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
1181
|
+
!isLiquidStakingInfo(res.data.bcs.type)) {
|
|
1182
|
+
throw new Error(`object at id ${id} is not a LiquidStakingInfo object`);
|
|
1183
|
+
}
|
|
1184
|
+
return LiquidStakingInfo.fromSuiObjectData(typeArg, res.data);
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
exports.LiquidStakingInfo = LiquidStakingInfo;
|
|
1189
|
+
LiquidStakingInfo.$typeName = `${index_1.PKG_V1}::liquid_staking::LiquidStakingInfo`;
|
|
1190
|
+
LiquidStakingInfo.$numTypeParams = 1;
|
|
1191
|
+
LiquidStakingInfo.$isPhantom = [true];
|
|
1192
|
+
/* ============================== MintEvent =============================== */
|
|
1193
|
+
function isMintEvent(type) {
|
|
1194
|
+
type = (0, util_1.compressSuiType)(type);
|
|
1195
|
+
return type === `${index_1.PKG_V1}::liquid_staking::MintEvent`;
|
|
1196
|
+
}
|
|
1197
|
+
class MintEvent {
|
|
1198
|
+
constructor(typeArgs, fields) {
|
|
1199
|
+
this.__StructClass = true;
|
|
1200
|
+
this.$typeName = MintEvent.$typeName;
|
|
1201
|
+
this.$isPhantom = MintEvent.$isPhantom;
|
|
1202
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(MintEvent.$typeName, ...typeArgs);
|
|
1203
|
+
this.$typeArgs = typeArgs;
|
|
1204
|
+
this.typename = fields.typename;
|
|
1205
|
+
this.suiAmountIn = fields.suiAmountIn;
|
|
1206
|
+
this.lstAmountOut = fields.lstAmountOut;
|
|
1207
|
+
this.feeAmount = fields.feeAmount;
|
|
1208
|
+
}
|
|
1209
|
+
static reified() {
|
|
1210
|
+
return {
|
|
1211
|
+
typeName: MintEvent.$typeName,
|
|
1212
|
+
fullTypeName: (0, util_1.composeSuiType)(MintEvent.$typeName, ...[]),
|
|
1213
|
+
typeArgs: [],
|
|
1214
|
+
isPhantom: MintEvent.$isPhantom,
|
|
1215
|
+
reifiedTypeArgs: [],
|
|
1216
|
+
fromFields: (fields) => MintEvent.fromFields(fields),
|
|
1217
|
+
fromFieldsWithTypes: (item) => MintEvent.fromFieldsWithTypes(item),
|
|
1218
|
+
fromBcs: (data) => MintEvent.fromBcs(data),
|
|
1219
|
+
bcs: MintEvent.bcs,
|
|
1220
|
+
fromJSONField: (field) => MintEvent.fromJSONField(field),
|
|
1221
|
+
fromJSON: (json) => MintEvent.fromJSON(json),
|
|
1222
|
+
fromSuiParsedData: (content) => MintEvent.fromSuiParsedData(content),
|
|
1223
|
+
fromSuiObjectData: (content) => MintEvent.fromSuiObjectData(content),
|
|
1224
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return MintEvent.fetch(client, id); }),
|
|
1225
|
+
new: (fields) => {
|
|
1226
|
+
return new MintEvent([], fields);
|
|
1227
|
+
},
|
|
1228
|
+
kind: "StructClassReified",
|
|
1229
|
+
};
|
|
1230
|
+
}
|
|
1231
|
+
static get r() {
|
|
1232
|
+
return MintEvent.reified();
|
|
1233
|
+
}
|
|
1234
|
+
static phantom() {
|
|
1235
|
+
return (0, reified_1.phantom)(MintEvent.reified());
|
|
1236
|
+
}
|
|
1237
|
+
static get p() {
|
|
1238
|
+
return MintEvent.phantom();
|
|
1239
|
+
}
|
|
1240
|
+
static get bcs() {
|
|
1241
|
+
return bcs_1.bcs.struct("MintEvent", {
|
|
1242
|
+
typename: structs_1.TypeName.bcs,
|
|
1243
|
+
sui_amount_in: bcs_1.bcs.u64(),
|
|
1244
|
+
lst_amount_out: bcs_1.bcs.u64(),
|
|
1245
|
+
fee_amount: bcs_1.bcs.u64(),
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
static fromFields(fields) {
|
|
1249
|
+
return MintEvent.reified().new({
|
|
1250
|
+
typename: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.typename),
|
|
1251
|
+
suiAmountIn: (0, reified_1.decodeFromFields)("u64", fields.sui_amount_in),
|
|
1252
|
+
lstAmountOut: (0, reified_1.decodeFromFields)("u64", fields.lst_amount_out),
|
|
1253
|
+
feeAmount: (0, reified_1.decodeFromFields)("u64", fields.fee_amount),
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
static fromFieldsWithTypes(item) {
|
|
1257
|
+
if (!isMintEvent(item.type)) {
|
|
1258
|
+
throw new Error("not a MintEvent type");
|
|
1259
|
+
}
|
|
1260
|
+
return MintEvent.reified().new({
|
|
1261
|
+
typename: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.typename),
|
|
1262
|
+
suiAmountIn: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.sui_amount_in),
|
|
1263
|
+
lstAmountOut: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lst_amount_out),
|
|
1264
|
+
feeAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.fee_amount),
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
static fromBcs(data) {
|
|
1268
|
+
return MintEvent.fromFields(MintEvent.bcs.parse(data));
|
|
1269
|
+
}
|
|
1270
|
+
toJSONField() {
|
|
1271
|
+
return {
|
|
1272
|
+
typename: this.typename.toJSONField(),
|
|
1273
|
+
suiAmountIn: this.suiAmountIn.toString(),
|
|
1274
|
+
lstAmountOut: this.lstAmountOut.toString(),
|
|
1275
|
+
feeAmount: this.feeAmount.toString(),
|
|
1276
|
+
};
|
|
1277
|
+
}
|
|
1278
|
+
toJSON() {
|
|
1279
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1280
|
+
}
|
|
1281
|
+
static fromJSONField(field) {
|
|
1282
|
+
return MintEvent.reified().new({
|
|
1283
|
+
typename: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.typename),
|
|
1284
|
+
suiAmountIn: (0, reified_1.decodeFromJSONField)("u64", field.suiAmountIn),
|
|
1285
|
+
lstAmountOut: (0, reified_1.decodeFromJSONField)("u64", field.lstAmountOut),
|
|
1286
|
+
feeAmount: (0, reified_1.decodeFromJSONField)("u64", field.feeAmount),
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
static fromJSON(json) {
|
|
1290
|
+
if (json.$typeName !== MintEvent.$typeName) {
|
|
1291
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
1292
|
+
}
|
|
1293
|
+
return MintEvent.fromJSONField(json);
|
|
1294
|
+
}
|
|
1295
|
+
static fromSuiParsedData(content) {
|
|
1296
|
+
if (content.dataType !== "moveObject") {
|
|
1297
|
+
throw new Error("not an object");
|
|
1298
|
+
}
|
|
1299
|
+
if (!isMintEvent(content.type)) {
|
|
1300
|
+
throw new Error(`object at ${content.fields.id} is not a MintEvent object`);
|
|
1301
|
+
}
|
|
1302
|
+
return MintEvent.fromFieldsWithTypes(content);
|
|
1303
|
+
}
|
|
1304
|
+
static fromSuiObjectData(data) {
|
|
1305
|
+
if (data.bcs) {
|
|
1306
|
+
if (data.bcs.dataType !== "moveObject" || !isMintEvent(data.bcs.type)) {
|
|
1307
|
+
throw new Error(`object at is not a MintEvent object`);
|
|
1308
|
+
}
|
|
1309
|
+
return MintEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1310
|
+
}
|
|
1311
|
+
if (data.content) {
|
|
1312
|
+
return MintEvent.fromSuiParsedData(data.content);
|
|
1313
|
+
}
|
|
1314
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1315
|
+
}
|
|
1316
|
+
static fetch(client, id) {
|
|
1317
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1318
|
+
var _a, _b;
|
|
1319
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
1320
|
+
if (res.error) {
|
|
1321
|
+
throw new Error(`error fetching MintEvent object at id ${id}: ${res.error.code}`);
|
|
1322
|
+
}
|
|
1323
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
1324
|
+
!isMintEvent(res.data.bcs.type)) {
|
|
1325
|
+
throw new Error(`object at id ${id} is not a MintEvent object`);
|
|
1326
|
+
}
|
|
1327
|
+
return MintEvent.fromSuiObjectData(res.data);
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
exports.MintEvent = MintEvent;
|
|
1332
|
+
MintEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::MintEvent`;
|
|
1333
|
+
MintEvent.$numTypeParams = 0;
|
|
1334
|
+
MintEvent.$isPhantom = [];
|
|
1335
|
+
/* ============================== RedeemEvent =============================== */
|
|
1336
|
+
function isRedeemEvent(type) {
|
|
1337
|
+
type = (0, util_1.compressSuiType)(type);
|
|
1338
|
+
return type === `${index_1.PKG_V1}::liquid_staking::RedeemEvent`;
|
|
1339
|
+
}
|
|
1340
|
+
class RedeemEvent {
|
|
1341
|
+
constructor(typeArgs, fields) {
|
|
1342
|
+
this.__StructClass = true;
|
|
1343
|
+
this.$typeName = RedeemEvent.$typeName;
|
|
1344
|
+
this.$isPhantom = RedeemEvent.$isPhantom;
|
|
1345
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(RedeemEvent.$typeName, ...typeArgs);
|
|
1346
|
+
this.$typeArgs = typeArgs;
|
|
1347
|
+
this.typename = fields.typename;
|
|
1348
|
+
this.lstAmountIn = fields.lstAmountIn;
|
|
1349
|
+
this.suiAmountOut = fields.suiAmountOut;
|
|
1350
|
+
this.feeAmount = fields.feeAmount;
|
|
1351
|
+
}
|
|
1352
|
+
static reified() {
|
|
1353
|
+
return {
|
|
1354
|
+
typeName: RedeemEvent.$typeName,
|
|
1355
|
+
fullTypeName: (0, util_1.composeSuiType)(RedeemEvent.$typeName, ...[]),
|
|
1356
|
+
typeArgs: [],
|
|
1357
|
+
isPhantom: RedeemEvent.$isPhantom,
|
|
1358
|
+
reifiedTypeArgs: [],
|
|
1359
|
+
fromFields: (fields) => RedeemEvent.fromFields(fields),
|
|
1360
|
+
fromFieldsWithTypes: (item) => RedeemEvent.fromFieldsWithTypes(item),
|
|
1361
|
+
fromBcs: (data) => RedeemEvent.fromBcs(data),
|
|
1362
|
+
bcs: RedeemEvent.bcs,
|
|
1363
|
+
fromJSONField: (field) => RedeemEvent.fromJSONField(field),
|
|
1364
|
+
fromJSON: (json) => RedeemEvent.fromJSON(json),
|
|
1365
|
+
fromSuiParsedData: (content) => RedeemEvent.fromSuiParsedData(content),
|
|
1366
|
+
fromSuiObjectData: (content) => RedeemEvent.fromSuiObjectData(content),
|
|
1367
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return RedeemEvent.fetch(client, id); }),
|
|
1368
|
+
new: (fields) => {
|
|
1369
|
+
return new RedeemEvent([], fields);
|
|
1370
|
+
},
|
|
1371
|
+
kind: "StructClassReified",
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
static get r() {
|
|
1375
|
+
return RedeemEvent.reified();
|
|
1376
|
+
}
|
|
1377
|
+
static phantom() {
|
|
1378
|
+
return (0, reified_1.phantom)(RedeemEvent.reified());
|
|
1379
|
+
}
|
|
1380
|
+
static get p() {
|
|
1381
|
+
return RedeemEvent.phantom();
|
|
1382
|
+
}
|
|
1383
|
+
static get bcs() {
|
|
1384
|
+
return bcs_1.bcs.struct("RedeemEvent", {
|
|
1385
|
+
typename: structs_1.TypeName.bcs,
|
|
1386
|
+
lst_amount_in: bcs_1.bcs.u64(),
|
|
1387
|
+
sui_amount_out: bcs_1.bcs.u64(),
|
|
1388
|
+
fee_amount: bcs_1.bcs.u64(),
|
|
1389
|
+
});
|
|
1390
|
+
}
|
|
1391
|
+
static fromFields(fields) {
|
|
1392
|
+
return RedeemEvent.reified().new({
|
|
1393
|
+
typename: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.typename),
|
|
1394
|
+
lstAmountIn: (0, reified_1.decodeFromFields)("u64", fields.lst_amount_in),
|
|
1395
|
+
suiAmountOut: (0, reified_1.decodeFromFields)("u64", fields.sui_amount_out),
|
|
1396
|
+
feeAmount: (0, reified_1.decodeFromFields)("u64", fields.fee_amount),
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
static fromFieldsWithTypes(item) {
|
|
1400
|
+
if (!isRedeemEvent(item.type)) {
|
|
1401
|
+
throw new Error("not a RedeemEvent type");
|
|
1402
|
+
}
|
|
1403
|
+
return RedeemEvent.reified().new({
|
|
1404
|
+
typename: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.typename),
|
|
1405
|
+
lstAmountIn: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lst_amount_in),
|
|
1406
|
+
suiAmountOut: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.sui_amount_out),
|
|
1407
|
+
feeAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.fee_amount),
|
|
1408
|
+
});
|
|
1409
|
+
}
|
|
1410
|
+
static fromBcs(data) {
|
|
1411
|
+
return RedeemEvent.fromFields(RedeemEvent.bcs.parse(data));
|
|
1412
|
+
}
|
|
1413
|
+
toJSONField() {
|
|
1414
|
+
return {
|
|
1415
|
+
typename: this.typename.toJSONField(),
|
|
1416
|
+
lstAmountIn: this.lstAmountIn.toString(),
|
|
1417
|
+
suiAmountOut: this.suiAmountOut.toString(),
|
|
1418
|
+
feeAmount: this.feeAmount.toString(),
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
toJSON() {
|
|
1422
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1423
|
+
}
|
|
1424
|
+
static fromJSONField(field) {
|
|
1425
|
+
return RedeemEvent.reified().new({
|
|
1426
|
+
typename: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.typename),
|
|
1427
|
+
lstAmountIn: (0, reified_1.decodeFromJSONField)("u64", field.lstAmountIn),
|
|
1428
|
+
suiAmountOut: (0, reified_1.decodeFromJSONField)("u64", field.suiAmountOut),
|
|
1429
|
+
feeAmount: (0, reified_1.decodeFromJSONField)("u64", field.feeAmount),
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
static fromJSON(json) {
|
|
1433
|
+
if (json.$typeName !== RedeemEvent.$typeName) {
|
|
1434
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
1435
|
+
}
|
|
1436
|
+
return RedeemEvent.fromJSONField(json);
|
|
1437
|
+
}
|
|
1438
|
+
static fromSuiParsedData(content) {
|
|
1439
|
+
if (content.dataType !== "moveObject") {
|
|
1440
|
+
throw new Error("not an object");
|
|
1441
|
+
}
|
|
1442
|
+
if (!isRedeemEvent(content.type)) {
|
|
1443
|
+
throw new Error(`object at ${content.fields.id} is not a RedeemEvent object`);
|
|
1444
|
+
}
|
|
1445
|
+
return RedeemEvent.fromFieldsWithTypes(content);
|
|
1446
|
+
}
|
|
1447
|
+
static fromSuiObjectData(data) {
|
|
1448
|
+
if (data.bcs) {
|
|
1449
|
+
if (data.bcs.dataType !== "moveObject" || !isRedeemEvent(data.bcs.type)) {
|
|
1450
|
+
throw new Error(`object at is not a RedeemEvent object`);
|
|
1451
|
+
}
|
|
1452
|
+
return RedeemEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1453
|
+
}
|
|
1454
|
+
if (data.content) {
|
|
1455
|
+
return RedeemEvent.fromSuiParsedData(data.content);
|
|
1456
|
+
}
|
|
1457
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1458
|
+
}
|
|
1459
|
+
static fetch(client, id) {
|
|
1460
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1461
|
+
var _a, _b;
|
|
1462
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
1463
|
+
if (res.error) {
|
|
1464
|
+
throw new Error(`error fetching RedeemEvent object at id ${id}: ${res.error.code}`);
|
|
1465
|
+
}
|
|
1466
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
1467
|
+
!isRedeemEvent(res.data.bcs.type)) {
|
|
1468
|
+
throw new Error(`object at id ${id} is not a RedeemEvent object`);
|
|
1469
|
+
}
|
|
1470
|
+
return RedeemEvent.fromSuiObjectData(res.data);
|
|
1471
|
+
});
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
exports.RedeemEvent = RedeemEvent;
|
|
1475
|
+
RedeemEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::RedeemEvent`;
|
|
1476
|
+
RedeemEvent.$numTypeParams = 0;
|
|
1477
|
+
RedeemEvent.$isPhantom = [];
|