@suilend/springsui-cli 1.0.13 → 2.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/bytecode.js +28 -30
- package/cli/src/index.js +51 -86
- package/package.json +1 -1
- package/sdk/src/_generated/_dependencies/source/0x1/ascii/structs.d.ts +7 -7
- package/sdk/src/_generated/_dependencies/source/0x1/ascii/structs.js +35 -75
- package/sdk/src/_generated/_dependencies/source/0x1/index.js +3 -6
- package/sdk/src/_generated/_dependencies/source/0x1/option/structs.d.ts +3 -3
- package/sdk/src/_generated/_dependencies/source/0x1/option/structs.js +31 -69
- package/sdk/src/_generated/_dependencies/source/0x1/string/structs.d.ts +4 -4
- package/sdk/src/_generated/_dependencies/source/0x1/string/structs.js +21 -59
- package/sdk/src/_generated/_dependencies/source/0x1/type-name/structs.d.ts +5 -5
- package/sdk/src/_generated/_dependencies/source/0x1/type-name/structs.js +20 -25
- package/sdk/src/_generated/_dependencies/source/0x2/bag/structs.d.ts +7 -7
- package/sdk/src/_generated/_dependencies/source/0x2/bag/structs.js +24 -29
- package/sdk/src/_generated/_dependencies/source/0x2/balance/structs.d.ts +7 -7
- package/sdk/src/_generated/_dependencies/source/0x2/balance/structs.js +49 -56
- package/sdk/src/_generated/_dependencies/source/0x2/coin/structs.d.ts +52 -52
- package/sdk/src/_generated/_dependencies/source/0x2/coin/structs.js +206 -223
- package/sdk/src/_generated/_dependencies/source/0x2/index.js +3 -6
- package/sdk/src/_generated/_dependencies/source/0x2/object/structs.d.ts +8 -8
- package/sdk/src/_generated/_dependencies/source/0x2/object/structs.js +34 -41
- package/sdk/src/_generated/_dependencies/source/0x2/sui/structs.d.ts +4 -4
- package/sdk/src/_generated/_dependencies/source/0x2/sui/structs.js +19 -24
- package/sdk/src/_generated/_dependencies/source/0x2/table/structs.d.ts +7 -7
- package/sdk/src/_generated/_dependencies/source/0x2/table/structs.js +31 -36
- package/sdk/src/_generated/_dependencies/source/0x2/url/structs.d.ts +5 -5
- package/sdk/src/_generated/_dependencies/source/0x2/url/structs.js +20 -25
- package/sdk/src/_generated/_dependencies/source/0x2/vec-map/structs.d.ts +5 -5
- package/sdk/src/_generated/_dependencies/source/0x2/vec-map/structs.js +57 -97
- package/sdk/src/_generated/_dependencies/source/0x3/index.js +3 -6
- package/sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.d.ts +60 -60
- package/sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.js +170 -218
- package/sdk/src/_generated/_framework/reified.d.ts +2 -2
- package/sdk/src/_generated/_framework/reified.js +27 -40
- package/sdk/src/_generated/_framework/util.d.ts +2 -14
- package/sdk/src/_generated/_framework/util.js +26 -40
- package/sdk/src/_generated/_framework/vector.d.ts +4 -4
- package/sdk/src/_generated/_framework/vector.js +16 -21
- package/sdk/src/_generated/liquid_staking/cell/structs.d.ts +4 -4
- package/sdk/src/_generated/liquid_staking/cell/structs.js +31 -36
- package/sdk/src/_generated/liquid_staking/fees/functions.js +55 -75
- package/sdk/src/_generated/liquid_staking/fees/structs.d.ts +21 -21
- package/sdk/src/_generated/liquid_staking/fees/structs.js +58 -65
- package/sdk/src/_generated/liquid_staking/index.js +6 -10
- package/sdk/src/_generated/liquid_staking/liquid-staking/functions.js +86 -107
- package/sdk/src/_generated/liquid_staking/liquid-staking/structs.d.ts +98 -98
- package/sdk/src/_generated/liquid_staking/liquid-staking/structs.js +264 -320
- package/sdk/src/_generated/liquid_staking/storage/structs.d.ts +31 -31
- package/sdk/src/_generated/liquid_staking/storage/structs.js +85 -125
- package/sdk/src/_generated/liquid_staking/version/structs.d.ts +4 -4
- package/sdk/src/_generated/liquid_staking/version/structs.js +19 -24
- package/sdk/src/_generated/liquid_staking/weight/functions.js +44 -56
- package/sdk/src/_generated/liquid_staking/weight/structs.d.ts +41 -41
- package/sdk/src/_generated/liquid_staking/weight/structs.js +128 -141
- package/sdk/src/client.d.ts +16 -16
- package/sdk/src/client.js +39 -82
- package/sdk/src/index.js +2 -18
- package/sdk/src/lib/index.js +1 -17
- package/sdk/src/lib/transactions.d.ts +1 -1
- package/sdk/src/lib/transactions.js +3 -8
|
@@ -1,37 +1,3 @@
|
|
|
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 () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -41,53 +7,41 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
41
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
8
|
});
|
|
43
9
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const structs_4 = require("../../_dependencies/source/0x2/coin/structs");
|
|
61
|
-
const structs_5 = require("../../_dependencies/source/0x2/object/structs");
|
|
62
|
-
const structs_6 = require("../../_dependencies/source/0x2/sui/structs");
|
|
63
|
-
const reified_1 = require("../../_framework/reified");
|
|
64
|
-
const util_1 = require("../../_framework/util");
|
|
65
|
-
const structs_7 = require("../cell/structs");
|
|
66
|
-
const structs_8 = require("../fees/structs");
|
|
67
|
-
const index_1 = require("../index");
|
|
68
|
-
const structs_9 = require("../storage/structs");
|
|
69
|
-
const structs_10 = require("../version/structs");
|
|
70
|
-
const bcs_1 = require("@mysten/sui/bcs");
|
|
71
|
-
const utils_1 = require("@mysten/sui/utils");
|
|
10
|
+
import * as reified from "../../_framework/reified";
|
|
11
|
+
import { TypeName } from "../../_dependencies/source/0x1/type-name/structs";
|
|
12
|
+
import { Bag } from "../../_dependencies/source/0x2/bag/structs";
|
|
13
|
+
import { Balance } from "../../_dependencies/source/0x2/balance/structs";
|
|
14
|
+
import { TreasuryCap } from "../../_dependencies/source/0x2/coin/structs";
|
|
15
|
+
import { ID, UID } from "../../_dependencies/source/0x2/object/structs";
|
|
16
|
+
import { SUI } from "../../_dependencies/source/0x2/sui/structs";
|
|
17
|
+
import { assertFieldsWithTypesArgsMatch, assertReifiedTypeArgsMatch, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, extractType, phantom, } from "../../_framework/reified";
|
|
18
|
+
import { composeSuiType, compressSuiType, parseTypeName, } from "../../_framework/util";
|
|
19
|
+
import { Cell } from "../cell/structs";
|
|
20
|
+
import { FeeConfig } from "../fees/structs";
|
|
21
|
+
import { PKG_V1 } from "../index";
|
|
22
|
+
import { Storage } from "../storage/structs";
|
|
23
|
+
import { Version } from "../version/structs";
|
|
24
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
25
|
+
import { fromBase64 } from "@mysten/sui/utils";
|
|
72
26
|
/* ============================== AdminCap =============================== */
|
|
73
|
-
function isAdminCap(type) {
|
|
74
|
-
type =
|
|
75
|
-
return type.startsWith(`${
|
|
27
|
+
export function isAdminCap(type) {
|
|
28
|
+
type = compressSuiType(type);
|
|
29
|
+
return type.startsWith(`${PKG_V1}::liquid_staking::AdminCap` + "<");
|
|
76
30
|
}
|
|
77
|
-
class AdminCap {
|
|
31
|
+
export class AdminCap {
|
|
78
32
|
constructor(typeArgs, fields) {
|
|
79
33
|
this.__StructClass = true;
|
|
80
34
|
this.$typeName = AdminCap.$typeName;
|
|
81
35
|
this.$isPhantom = AdminCap.$isPhantom;
|
|
82
|
-
this.$fullTypeName =
|
|
36
|
+
this.$fullTypeName = composeSuiType(AdminCap.$typeName, ...typeArgs);
|
|
83
37
|
this.$typeArgs = typeArgs;
|
|
84
38
|
this.id = fields.id;
|
|
85
39
|
}
|
|
86
40
|
static reified(P) {
|
|
87
41
|
return {
|
|
88
42
|
typeName: AdminCap.$typeName,
|
|
89
|
-
fullTypeName:
|
|
90
|
-
typeArgs: [
|
|
43
|
+
fullTypeName: composeSuiType(AdminCap.$typeName, ...[extractType(P)]),
|
|
44
|
+
typeArgs: [extractType(P)],
|
|
91
45
|
isPhantom: AdminCap.$isPhantom,
|
|
92
46
|
reifiedTypeArgs: [P],
|
|
93
47
|
fromFields: (fields) => AdminCap.fromFields(P, fields),
|
|
@@ -100,7 +54,7 @@ class AdminCap {
|
|
|
100
54
|
fromSuiObjectData: (content) => AdminCap.fromSuiObjectData(P, content),
|
|
101
55
|
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return AdminCap.fetch(client, P, id); }),
|
|
102
56
|
new: (fields) => {
|
|
103
|
-
return new AdminCap([
|
|
57
|
+
return new AdminCap([extractType(P)], fields);
|
|
104
58
|
},
|
|
105
59
|
kind: "StructClassReified",
|
|
106
60
|
};
|
|
@@ -109,28 +63,28 @@ class AdminCap {
|
|
|
109
63
|
return AdminCap.reified;
|
|
110
64
|
}
|
|
111
65
|
static phantom(P) {
|
|
112
|
-
return
|
|
66
|
+
return phantom(AdminCap.reified(P));
|
|
113
67
|
}
|
|
114
68
|
static get p() {
|
|
115
69
|
return AdminCap.phantom;
|
|
116
70
|
}
|
|
117
71
|
static get bcs() {
|
|
118
|
-
return
|
|
119
|
-
id:
|
|
72
|
+
return bcs.struct("AdminCap", {
|
|
73
|
+
id: UID.bcs,
|
|
120
74
|
});
|
|
121
75
|
}
|
|
122
76
|
static fromFields(typeArg, fields) {
|
|
123
77
|
return AdminCap.reified(typeArg).new({
|
|
124
|
-
id:
|
|
78
|
+
id: decodeFromFields(UID.reified(), fields.id),
|
|
125
79
|
});
|
|
126
80
|
}
|
|
127
81
|
static fromFieldsWithTypes(typeArg, item) {
|
|
128
82
|
if (!isAdminCap(item.type)) {
|
|
129
83
|
throw new Error("not a AdminCap type");
|
|
130
84
|
}
|
|
131
|
-
|
|
85
|
+
assertFieldsWithTypesArgsMatch(item, [typeArg]);
|
|
132
86
|
return AdminCap.reified(typeArg).new({
|
|
133
|
-
id:
|
|
87
|
+
id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id),
|
|
134
88
|
});
|
|
135
89
|
}
|
|
136
90
|
static fromBcs(typeArg, data) {
|
|
@@ -146,14 +100,14 @@ class AdminCap {
|
|
|
146
100
|
}
|
|
147
101
|
static fromJSONField(typeArg, field) {
|
|
148
102
|
return AdminCap.reified(typeArg).new({
|
|
149
|
-
id:
|
|
103
|
+
id: decodeFromJSONField(UID.reified(), field.id),
|
|
150
104
|
});
|
|
151
105
|
}
|
|
152
106
|
static fromJSON(typeArg, json) {
|
|
153
107
|
if (json.$typeName !== AdminCap.$typeName) {
|
|
154
108
|
throw new Error("not a WithTwoGenerics json object");
|
|
155
109
|
}
|
|
156
|
-
|
|
110
|
+
assertReifiedTypeArgsMatch(composeSuiType(AdminCap.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg]);
|
|
157
111
|
return AdminCap.fromJSONField(typeArg, json);
|
|
158
112
|
}
|
|
159
113
|
static fromSuiParsedData(typeArg, content) {
|
|
@@ -170,16 +124,16 @@ class AdminCap {
|
|
|
170
124
|
if (data.bcs.dataType !== "moveObject" || !isAdminCap(data.bcs.type)) {
|
|
171
125
|
throw new Error(`object at is not a AdminCap object`);
|
|
172
126
|
}
|
|
173
|
-
const gotTypeArgs =
|
|
127
|
+
const gotTypeArgs = parseTypeName(data.bcs.type).typeArgs;
|
|
174
128
|
if (gotTypeArgs.length !== 1) {
|
|
175
129
|
throw new Error(`type argument mismatch: expected 1 type argument but got '${gotTypeArgs.length}'`);
|
|
176
130
|
}
|
|
177
|
-
const gotTypeArg =
|
|
178
|
-
const expectedTypeArg =
|
|
179
|
-
if (gotTypeArg !==
|
|
131
|
+
const gotTypeArg = compressSuiType(gotTypeArgs[0]);
|
|
132
|
+
const expectedTypeArg = compressSuiType(extractType(typeArg));
|
|
133
|
+
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
180
134
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
181
135
|
}
|
|
182
|
-
return AdminCap.fromBcs(typeArg, (
|
|
136
|
+
return AdminCap.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
183
137
|
}
|
|
184
138
|
if (data.content) {
|
|
185
139
|
return AdminCap.fromSuiParsedData(typeArg, data.content);
|
|
@@ -201,21 +155,20 @@ class AdminCap {
|
|
|
201
155
|
});
|
|
202
156
|
}
|
|
203
157
|
}
|
|
204
|
-
|
|
205
|
-
AdminCap.$typeName = `${index_1.PKG_V1}::liquid_staking::AdminCap`;
|
|
158
|
+
AdminCap.$typeName = `${PKG_V1}::liquid_staking::AdminCap`;
|
|
206
159
|
AdminCap.$numTypeParams = 1;
|
|
207
160
|
AdminCap.$isPhantom = [true];
|
|
208
161
|
/* ============================== CollectFeesEvent =============================== */
|
|
209
|
-
function isCollectFeesEvent(type) {
|
|
210
|
-
type =
|
|
211
|
-
return type === `${
|
|
162
|
+
export function isCollectFeesEvent(type) {
|
|
163
|
+
type = compressSuiType(type);
|
|
164
|
+
return type === `${PKG_V1}::liquid_staking::CollectFeesEvent`;
|
|
212
165
|
}
|
|
213
|
-
class CollectFeesEvent {
|
|
166
|
+
export class CollectFeesEvent {
|
|
214
167
|
constructor(typeArgs, fields) {
|
|
215
168
|
this.__StructClass = true;
|
|
216
169
|
this.$typeName = CollectFeesEvent.$typeName;
|
|
217
170
|
this.$isPhantom = CollectFeesEvent.$isPhantom;
|
|
218
|
-
this.$fullTypeName =
|
|
171
|
+
this.$fullTypeName = composeSuiType(CollectFeesEvent.$typeName, ...typeArgs);
|
|
219
172
|
this.$typeArgs = typeArgs;
|
|
220
173
|
this.typename = fields.typename;
|
|
221
174
|
this.amount = fields.amount;
|
|
@@ -223,7 +176,7 @@ class CollectFeesEvent {
|
|
|
223
176
|
static reified() {
|
|
224
177
|
return {
|
|
225
178
|
typeName: CollectFeesEvent.$typeName,
|
|
226
|
-
fullTypeName:
|
|
179
|
+
fullTypeName: composeSuiType(CollectFeesEvent.$typeName, ...[]),
|
|
227
180
|
typeArgs: [],
|
|
228
181
|
isPhantom: CollectFeesEvent.$isPhantom,
|
|
229
182
|
reifiedTypeArgs: [],
|
|
@@ -246,21 +199,21 @@ class CollectFeesEvent {
|
|
|
246
199
|
return CollectFeesEvent.reified();
|
|
247
200
|
}
|
|
248
201
|
static phantom() {
|
|
249
|
-
return
|
|
202
|
+
return phantom(CollectFeesEvent.reified());
|
|
250
203
|
}
|
|
251
204
|
static get p() {
|
|
252
205
|
return CollectFeesEvent.phantom();
|
|
253
206
|
}
|
|
254
207
|
static get bcs() {
|
|
255
|
-
return
|
|
256
|
-
typename:
|
|
257
|
-
amount:
|
|
208
|
+
return bcs.struct("CollectFeesEvent", {
|
|
209
|
+
typename: TypeName.bcs,
|
|
210
|
+
amount: bcs.u64(),
|
|
258
211
|
});
|
|
259
212
|
}
|
|
260
213
|
static fromFields(fields) {
|
|
261
214
|
return CollectFeesEvent.reified().new({
|
|
262
|
-
typename:
|
|
263
|
-
amount:
|
|
215
|
+
typename: decodeFromFields(TypeName.reified(), fields.typename),
|
|
216
|
+
amount: decodeFromFields("u64", fields.amount),
|
|
264
217
|
});
|
|
265
218
|
}
|
|
266
219
|
static fromFieldsWithTypes(item) {
|
|
@@ -268,8 +221,8 @@ class CollectFeesEvent {
|
|
|
268
221
|
throw new Error("not a CollectFeesEvent type");
|
|
269
222
|
}
|
|
270
223
|
return CollectFeesEvent.reified().new({
|
|
271
|
-
typename:
|
|
272
|
-
amount:
|
|
224
|
+
typename: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.typename),
|
|
225
|
+
amount: decodeFromFieldsWithTypes("u64", item.fields.amount),
|
|
273
226
|
});
|
|
274
227
|
}
|
|
275
228
|
static fromBcs(data) {
|
|
@@ -286,8 +239,8 @@ class CollectFeesEvent {
|
|
|
286
239
|
}
|
|
287
240
|
static fromJSONField(field) {
|
|
288
241
|
return CollectFeesEvent.reified().new({
|
|
289
|
-
typename:
|
|
290
|
-
amount:
|
|
242
|
+
typename: decodeFromJSONField(TypeName.reified(), field.typename),
|
|
243
|
+
amount: decodeFromJSONField("u64", field.amount),
|
|
291
244
|
});
|
|
292
245
|
}
|
|
293
246
|
static fromJSON(json) {
|
|
@@ -311,7 +264,7 @@ class CollectFeesEvent {
|
|
|
311
264
|
!isCollectFeesEvent(data.bcs.type)) {
|
|
312
265
|
throw new Error(`object at is not a CollectFeesEvent object`);
|
|
313
266
|
}
|
|
314
|
-
return CollectFeesEvent.fromBcs((
|
|
267
|
+
return CollectFeesEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
315
268
|
}
|
|
316
269
|
if (data.content) {
|
|
317
270
|
return CollectFeesEvent.fromSuiParsedData(data.content);
|
|
@@ -333,21 +286,20 @@ class CollectFeesEvent {
|
|
|
333
286
|
});
|
|
334
287
|
}
|
|
335
288
|
}
|
|
336
|
-
|
|
337
|
-
CollectFeesEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::CollectFeesEvent`;
|
|
289
|
+
CollectFeesEvent.$typeName = `${PKG_V1}::liquid_staking::CollectFeesEvent`;
|
|
338
290
|
CollectFeesEvent.$numTypeParams = 0;
|
|
339
291
|
CollectFeesEvent.$isPhantom = [];
|
|
340
292
|
/* ============================== CreateEvent =============================== */
|
|
341
|
-
function isCreateEvent(type) {
|
|
342
|
-
type =
|
|
343
|
-
return type === `${
|
|
293
|
+
export function isCreateEvent(type) {
|
|
294
|
+
type = compressSuiType(type);
|
|
295
|
+
return type === `${PKG_V1}::liquid_staking::CreateEvent`;
|
|
344
296
|
}
|
|
345
|
-
class CreateEvent {
|
|
297
|
+
export class CreateEvent {
|
|
346
298
|
constructor(typeArgs, fields) {
|
|
347
299
|
this.__StructClass = true;
|
|
348
300
|
this.$typeName = CreateEvent.$typeName;
|
|
349
301
|
this.$isPhantom = CreateEvent.$isPhantom;
|
|
350
|
-
this.$fullTypeName =
|
|
302
|
+
this.$fullTypeName = composeSuiType(CreateEvent.$typeName, ...typeArgs);
|
|
351
303
|
this.$typeArgs = typeArgs;
|
|
352
304
|
this.typename = fields.typename;
|
|
353
305
|
this.liquidStakingInfoId = fields.liquidStakingInfoId;
|
|
@@ -355,7 +307,7 @@ class CreateEvent {
|
|
|
355
307
|
static reified() {
|
|
356
308
|
return {
|
|
357
309
|
typeName: CreateEvent.$typeName,
|
|
358
|
-
fullTypeName:
|
|
310
|
+
fullTypeName: composeSuiType(CreateEvent.$typeName, ...[]),
|
|
359
311
|
typeArgs: [],
|
|
360
312
|
isPhantom: CreateEvent.$isPhantom,
|
|
361
313
|
reifiedTypeArgs: [],
|
|
@@ -378,21 +330,21 @@ class CreateEvent {
|
|
|
378
330
|
return CreateEvent.reified();
|
|
379
331
|
}
|
|
380
332
|
static phantom() {
|
|
381
|
-
return
|
|
333
|
+
return phantom(CreateEvent.reified());
|
|
382
334
|
}
|
|
383
335
|
static get p() {
|
|
384
336
|
return CreateEvent.phantom();
|
|
385
337
|
}
|
|
386
338
|
static get bcs() {
|
|
387
|
-
return
|
|
388
|
-
typename:
|
|
389
|
-
liquid_staking_info_id:
|
|
339
|
+
return bcs.struct("CreateEvent", {
|
|
340
|
+
typename: TypeName.bcs,
|
|
341
|
+
liquid_staking_info_id: ID.bcs,
|
|
390
342
|
});
|
|
391
343
|
}
|
|
392
344
|
static fromFields(fields) {
|
|
393
345
|
return CreateEvent.reified().new({
|
|
394
|
-
typename:
|
|
395
|
-
liquidStakingInfoId:
|
|
346
|
+
typename: decodeFromFields(TypeName.reified(), fields.typename),
|
|
347
|
+
liquidStakingInfoId: decodeFromFields(ID.reified(), fields.liquid_staking_info_id),
|
|
396
348
|
});
|
|
397
349
|
}
|
|
398
350
|
static fromFieldsWithTypes(item) {
|
|
@@ -400,8 +352,8 @@ class CreateEvent {
|
|
|
400
352
|
throw new Error("not a CreateEvent type");
|
|
401
353
|
}
|
|
402
354
|
return CreateEvent.reified().new({
|
|
403
|
-
typename:
|
|
404
|
-
liquidStakingInfoId:
|
|
355
|
+
typename: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.typename),
|
|
356
|
+
liquidStakingInfoId: decodeFromFieldsWithTypes(ID.reified(), item.fields.liquid_staking_info_id),
|
|
405
357
|
});
|
|
406
358
|
}
|
|
407
359
|
static fromBcs(data) {
|
|
@@ -418,8 +370,8 @@ class CreateEvent {
|
|
|
418
370
|
}
|
|
419
371
|
static fromJSONField(field) {
|
|
420
372
|
return CreateEvent.reified().new({
|
|
421
|
-
typename:
|
|
422
|
-
liquidStakingInfoId:
|
|
373
|
+
typename: decodeFromJSONField(TypeName.reified(), field.typename),
|
|
374
|
+
liquidStakingInfoId: decodeFromJSONField(ID.reified(), field.liquidStakingInfoId),
|
|
423
375
|
});
|
|
424
376
|
}
|
|
425
377
|
static fromJSON(json) {
|
|
@@ -442,7 +394,7 @@ class CreateEvent {
|
|
|
442
394
|
if (data.bcs.dataType !== "moveObject" || !isCreateEvent(data.bcs.type)) {
|
|
443
395
|
throw new Error(`object at is not a CreateEvent object`);
|
|
444
396
|
}
|
|
445
|
-
return CreateEvent.fromBcs((
|
|
397
|
+
return CreateEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
446
398
|
}
|
|
447
399
|
if (data.content) {
|
|
448
400
|
return CreateEvent.fromSuiParsedData(data.content);
|
|
@@ -464,21 +416,20 @@ class CreateEvent {
|
|
|
464
416
|
});
|
|
465
417
|
}
|
|
466
418
|
}
|
|
467
|
-
|
|
468
|
-
CreateEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::CreateEvent`;
|
|
419
|
+
CreateEvent.$typeName = `${PKG_V1}::liquid_staking::CreateEvent`;
|
|
469
420
|
CreateEvent.$numTypeParams = 0;
|
|
470
421
|
CreateEvent.$isPhantom = [];
|
|
471
422
|
/* ============================== DecreaseValidatorStakeEvent =============================== */
|
|
472
|
-
function isDecreaseValidatorStakeEvent(type) {
|
|
473
|
-
type =
|
|
474
|
-
return type === `${
|
|
423
|
+
export function isDecreaseValidatorStakeEvent(type) {
|
|
424
|
+
type = compressSuiType(type);
|
|
425
|
+
return type === `${PKG_V1}::liquid_staking::DecreaseValidatorStakeEvent`;
|
|
475
426
|
}
|
|
476
|
-
class DecreaseValidatorStakeEvent {
|
|
427
|
+
export class DecreaseValidatorStakeEvent {
|
|
477
428
|
constructor(typeArgs, fields) {
|
|
478
429
|
this.__StructClass = true;
|
|
479
430
|
this.$typeName = DecreaseValidatorStakeEvent.$typeName;
|
|
480
431
|
this.$isPhantom = DecreaseValidatorStakeEvent.$isPhantom;
|
|
481
|
-
this.$fullTypeName =
|
|
432
|
+
this.$fullTypeName = composeSuiType(DecreaseValidatorStakeEvent.$typeName, ...typeArgs);
|
|
482
433
|
this.$typeArgs = typeArgs;
|
|
483
434
|
this.typename = fields.typename;
|
|
484
435
|
this.stakingPoolId = fields.stakingPoolId;
|
|
@@ -487,7 +438,7 @@ class DecreaseValidatorStakeEvent {
|
|
|
487
438
|
static reified() {
|
|
488
439
|
return {
|
|
489
440
|
typeName: DecreaseValidatorStakeEvent.$typeName,
|
|
490
|
-
fullTypeName:
|
|
441
|
+
fullTypeName: composeSuiType(DecreaseValidatorStakeEvent.$typeName, ...[]),
|
|
491
442
|
typeArgs: [],
|
|
492
443
|
isPhantom: DecreaseValidatorStakeEvent.$isPhantom,
|
|
493
444
|
reifiedTypeArgs: [],
|
|
@@ -510,23 +461,23 @@ class DecreaseValidatorStakeEvent {
|
|
|
510
461
|
return DecreaseValidatorStakeEvent.reified();
|
|
511
462
|
}
|
|
512
463
|
static phantom() {
|
|
513
|
-
return
|
|
464
|
+
return phantom(DecreaseValidatorStakeEvent.reified());
|
|
514
465
|
}
|
|
515
466
|
static get p() {
|
|
516
467
|
return DecreaseValidatorStakeEvent.phantom();
|
|
517
468
|
}
|
|
518
469
|
static get bcs() {
|
|
519
|
-
return
|
|
520
|
-
typename:
|
|
521
|
-
staking_pool_id:
|
|
522
|
-
amount:
|
|
470
|
+
return bcs.struct("DecreaseValidatorStakeEvent", {
|
|
471
|
+
typename: TypeName.bcs,
|
|
472
|
+
staking_pool_id: ID.bcs,
|
|
473
|
+
amount: bcs.u64(),
|
|
523
474
|
});
|
|
524
475
|
}
|
|
525
476
|
static fromFields(fields) {
|
|
526
477
|
return DecreaseValidatorStakeEvent.reified().new({
|
|
527
|
-
typename:
|
|
528
|
-
stakingPoolId:
|
|
529
|
-
amount:
|
|
478
|
+
typename: decodeFromFields(TypeName.reified(), fields.typename),
|
|
479
|
+
stakingPoolId: decodeFromFields(ID.reified(), fields.staking_pool_id),
|
|
480
|
+
amount: decodeFromFields("u64", fields.amount),
|
|
530
481
|
});
|
|
531
482
|
}
|
|
532
483
|
static fromFieldsWithTypes(item) {
|
|
@@ -534,9 +485,9 @@ class DecreaseValidatorStakeEvent {
|
|
|
534
485
|
throw new Error("not a DecreaseValidatorStakeEvent type");
|
|
535
486
|
}
|
|
536
487
|
return DecreaseValidatorStakeEvent.reified().new({
|
|
537
|
-
typename:
|
|
538
|
-
stakingPoolId:
|
|
539
|
-
amount:
|
|
488
|
+
typename: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.typename),
|
|
489
|
+
stakingPoolId: decodeFromFieldsWithTypes(ID.reified(), item.fields.staking_pool_id),
|
|
490
|
+
amount: decodeFromFieldsWithTypes("u64", item.fields.amount),
|
|
540
491
|
});
|
|
541
492
|
}
|
|
542
493
|
static fromBcs(data) {
|
|
@@ -554,9 +505,9 @@ class DecreaseValidatorStakeEvent {
|
|
|
554
505
|
}
|
|
555
506
|
static fromJSONField(field) {
|
|
556
507
|
return DecreaseValidatorStakeEvent.reified().new({
|
|
557
|
-
typename:
|
|
558
|
-
stakingPoolId:
|
|
559
|
-
amount:
|
|
508
|
+
typename: decodeFromJSONField(TypeName.reified(), field.typename),
|
|
509
|
+
stakingPoolId: decodeFromJSONField(ID.reified(), field.stakingPoolId),
|
|
510
|
+
amount: decodeFromJSONField("u64", field.amount),
|
|
560
511
|
});
|
|
561
512
|
}
|
|
562
513
|
static fromJSON(json) {
|
|
@@ -580,7 +531,7 @@ class DecreaseValidatorStakeEvent {
|
|
|
580
531
|
!isDecreaseValidatorStakeEvent(data.bcs.type)) {
|
|
581
532
|
throw new Error(`object at is not a DecreaseValidatorStakeEvent object`);
|
|
582
533
|
}
|
|
583
|
-
return DecreaseValidatorStakeEvent.fromBcs((
|
|
534
|
+
return DecreaseValidatorStakeEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
584
535
|
}
|
|
585
536
|
if (data.content) {
|
|
586
537
|
return DecreaseValidatorStakeEvent.fromSuiParsedData(data.content);
|
|
@@ -602,21 +553,20 @@ class DecreaseValidatorStakeEvent {
|
|
|
602
553
|
});
|
|
603
554
|
}
|
|
604
555
|
}
|
|
605
|
-
|
|
606
|
-
DecreaseValidatorStakeEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::DecreaseValidatorStakeEvent`;
|
|
556
|
+
DecreaseValidatorStakeEvent.$typeName = `${PKG_V1}::liquid_staking::DecreaseValidatorStakeEvent`;
|
|
607
557
|
DecreaseValidatorStakeEvent.$numTypeParams = 0;
|
|
608
558
|
DecreaseValidatorStakeEvent.$isPhantom = [];
|
|
609
559
|
/* ============================== EpochChangedEvent =============================== */
|
|
610
|
-
function isEpochChangedEvent(type) {
|
|
611
|
-
type =
|
|
612
|
-
return type === `${
|
|
560
|
+
export function isEpochChangedEvent(type) {
|
|
561
|
+
type = compressSuiType(type);
|
|
562
|
+
return type === `${PKG_V1}::liquid_staking::EpochChangedEvent`;
|
|
613
563
|
}
|
|
614
|
-
class EpochChangedEvent {
|
|
564
|
+
export class EpochChangedEvent {
|
|
615
565
|
constructor(typeArgs, fields) {
|
|
616
566
|
this.__StructClass = true;
|
|
617
567
|
this.$typeName = EpochChangedEvent.$typeName;
|
|
618
568
|
this.$isPhantom = EpochChangedEvent.$isPhantom;
|
|
619
|
-
this.$fullTypeName =
|
|
569
|
+
this.$fullTypeName = composeSuiType(EpochChangedEvent.$typeName, ...typeArgs);
|
|
620
570
|
this.$typeArgs = typeArgs;
|
|
621
571
|
this.typename = fields.typename;
|
|
622
572
|
this.oldSuiSupply = fields.oldSuiSupply;
|
|
@@ -627,7 +577,7 @@ class EpochChangedEvent {
|
|
|
627
577
|
static reified() {
|
|
628
578
|
return {
|
|
629
579
|
typeName: EpochChangedEvent.$typeName,
|
|
630
|
-
fullTypeName:
|
|
580
|
+
fullTypeName: composeSuiType(EpochChangedEvent.$typeName, ...[]),
|
|
631
581
|
typeArgs: [],
|
|
632
582
|
isPhantom: EpochChangedEvent.$isPhantom,
|
|
633
583
|
reifiedTypeArgs: [],
|
|
@@ -650,27 +600,27 @@ class EpochChangedEvent {
|
|
|
650
600
|
return EpochChangedEvent.reified();
|
|
651
601
|
}
|
|
652
602
|
static phantom() {
|
|
653
|
-
return
|
|
603
|
+
return phantom(EpochChangedEvent.reified());
|
|
654
604
|
}
|
|
655
605
|
static get p() {
|
|
656
606
|
return EpochChangedEvent.phantom();
|
|
657
607
|
}
|
|
658
608
|
static get bcs() {
|
|
659
|
-
return
|
|
660
|
-
typename:
|
|
661
|
-
old_sui_supply:
|
|
662
|
-
new_sui_supply:
|
|
663
|
-
lst_supply:
|
|
664
|
-
spread_fee:
|
|
609
|
+
return bcs.struct("EpochChangedEvent", {
|
|
610
|
+
typename: TypeName.bcs,
|
|
611
|
+
old_sui_supply: bcs.u64(),
|
|
612
|
+
new_sui_supply: bcs.u64(),
|
|
613
|
+
lst_supply: bcs.u64(),
|
|
614
|
+
spread_fee: bcs.u64(),
|
|
665
615
|
});
|
|
666
616
|
}
|
|
667
617
|
static fromFields(fields) {
|
|
668
618
|
return EpochChangedEvent.reified().new({
|
|
669
|
-
typename:
|
|
670
|
-
oldSuiSupply:
|
|
671
|
-
newSuiSupply:
|
|
672
|
-
lstSupply:
|
|
673
|
-
spreadFee:
|
|
619
|
+
typename: decodeFromFields(TypeName.reified(), fields.typename),
|
|
620
|
+
oldSuiSupply: decodeFromFields("u64", fields.old_sui_supply),
|
|
621
|
+
newSuiSupply: decodeFromFields("u64", fields.new_sui_supply),
|
|
622
|
+
lstSupply: decodeFromFields("u64", fields.lst_supply),
|
|
623
|
+
spreadFee: decodeFromFields("u64", fields.spread_fee),
|
|
674
624
|
});
|
|
675
625
|
}
|
|
676
626
|
static fromFieldsWithTypes(item) {
|
|
@@ -678,11 +628,11 @@ class EpochChangedEvent {
|
|
|
678
628
|
throw new Error("not a EpochChangedEvent type");
|
|
679
629
|
}
|
|
680
630
|
return EpochChangedEvent.reified().new({
|
|
681
|
-
typename:
|
|
682
|
-
oldSuiSupply:
|
|
683
|
-
newSuiSupply:
|
|
684
|
-
lstSupply:
|
|
685
|
-
spreadFee:
|
|
631
|
+
typename: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.typename),
|
|
632
|
+
oldSuiSupply: decodeFromFieldsWithTypes("u64", item.fields.old_sui_supply),
|
|
633
|
+
newSuiSupply: decodeFromFieldsWithTypes("u64", item.fields.new_sui_supply),
|
|
634
|
+
lstSupply: decodeFromFieldsWithTypes("u64", item.fields.lst_supply),
|
|
635
|
+
spreadFee: decodeFromFieldsWithTypes("u64", item.fields.spread_fee),
|
|
686
636
|
});
|
|
687
637
|
}
|
|
688
638
|
static fromBcs(data) {
|
|
@@ -702,11 +652,11 @@ class EpochChangedEvent {
|
|
|
702
652
|
}
|
|
703
653
|
static fromJSONField(field) {
|
|
704
654
|
return EpochChangedEvent.reified().new({
|
|
705
|
-
typename:
|
|
706
|
-
oldSuiSupply:
|
|
707
|
-
newSuiSupply:
|
|
708
|
-
lstSupply:
|
|
709
|
-
spreadFee:
|
|
655
|
+
typename: decodeFromJSONField(TypeName.reified(), field.typename),
|
|
656
|
+
oldSuiSupply: decodeFromJSONField("u64", field.oldSuiSupply),
|
|
657
|
+
newSuiSupply: decodeFromJSONField("u64", field.newSuiSupply),
|
|
658
|
+
lstSupply: decodeFromJSONField("u64", field.lstSupply),
|
|
659
|
+
spreadFee: decodeFromJSONField("u64", field.spreadFee),
|
|
710
660
|
});
|
|
711
661
|
}
|
|
712
662
|
static fromJSON(json) {
|
|
@@ -730,7 +680,7 @@ class EpochChangedEvent {
|
|
|
730
680
|
!isEpochChangedEvent(data.bcs.type)) {
|
|
731
681
|
throw new Error(`object at is not a EpochChangedEvent object`);
|
|
732
682
|
}
|
|
733
|
-
return EpochChangedEvent.fromBcs((
|
|
683
|
+
return EpochChangedEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
734
684
|
}
|
|
735
685
|
if (data.content) {
|
|
736
686
|
return EpochChangedEvent.fromSuiParsedData(data.content);
|
|
@@ -752,21 +702,20 @@ class EpochChangedEvent {
|
|
|
752
702
|
});
|
|
753
703
|
}
|
|
754
704
|
}
|
|
755
|
-
|
|
756
|
-
EpochChangedEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::EpochChangedEvent`;
|
|
705
|
+
EpochChangedEvent.$typeName = `${PKG_V1}::liquid_staking::EpochChangedEvent`;
|
|
757
706
|
EpochChangedEvent.$numTypeParams = 0;
|
|
758
707
|
EpochChangedEvent.$isPhantom = [];
|
|
759
708
|
/* ============================== IncreaseValidatorStakeEvent =============================== */
|
|
760
|
-
function isIncreaseValidatorStakeEvent(type) {
|
|
761
|
-
type =
|
|
762
|
-
return type === `${
|
|
709
|
+
export function isIncreaseValidatorStakeEvent(type) {
|
|
710
|
+
type = compressSuiType(type);
|
|
711
|
+
return type === `${PKG_V1}::liquid_staking::IncreaseValidatorStakeEvent`;
|
|
763
712
|
}
|
|
764
|
-
class IncreaseValidatorStakeEvent {
|
|
713
|
+
export class IncreaseValidatorStakeEvent {
|
|
765
714
|
constructor(typeArgs, fields) {
|
|
766
715
|
this.__StructClass = true;
|
|
767
716
|
this.$typeName = IncreaseValidatorStakeEvent.$typeName;
|
|
768
717
|
this.$isPhantom = IncreaseValidatorStakeEvent.$isPhantom;
|
|
769
|
-
this.$fullTypeName =
|
|
718
|
+
this.$fullTypeName = composeSuiType(IncreaseValidatorStakeEvent.$typeName, ...typeArgs);
|
|
770
719
|
this.$typeArgs = typeArgs;
|
|
771
720
|
this.typename = fields.typename;
|
|
772
721
|
this.stakingPoolId = fields.stakingPoolId;
|
|
@@ -775,7 +724,7 @@ class IncreaseValidatorStakeEvent {
|
|
|
775
724
|
static reified() {
|
|
776
725
|
return {
|
|
777
726
|
typeName: IncreaseValidatorStakeEvent.$typeName,
|
|
778
|
-
fullTypeName:
|
|
727
|
+
fullTypeName: composeSuiType(IncreaseValidatorStakeEvent.$typeName, ...[]),
|
|
779
728
|
typeArgs: [],
|
|
780
729
|
isPhantom: IncreaseValidatorStakeEvent.$isPhantom,
|
|
781
730
|
reifiedTypeArgs: [],
|
|
@@ -798,23 +747,23 @@ class IncreaseValidatorStakeEvent {
|
|
|
798
747
|
return IncreaseValidatorStakeEvent.reified();
|
|
799
748
|
}
|
|
800
749
|
static phantom() {
|
|
801
|
-
return
|
|
750
|
+
return phantom(IncreaseValidatorStakeEvent.reified());
|
|
802
751
|
}
|
|
803
752
|
static get p() {
|
|
804
753
|
return IncreaseValidatorStakeEvent.phantom();
|
|
805
754
|
}
|
|
806
755
|
static get bcs() {
|
|
807
|
-
return
|
|
808
|
-
typename:
|
|
809
|
-
staking_pool_id:
|
|
810
|
-
amount:
|
|
756
|
+
return bcs.struct("IncreaseValidatorStakeEvent", {
|
|
757
|
+
typename: TypeName.bcs,
|
|
758
|
+
staking_pool_id: ID.bcs,
|
|
759
|
+
amount: bcs.u64(),
|
|
811
760
|
});
|
|
812
761
|
}
|
|
813
762
|
static fromFields(fields) {
|
|
814
763
|
return IncreaseValidatorStakeEvent.reified().new({
|
|
815
|
-
typename:
|
|
816
|
-
stakingPoolId:
|
|
817
|
-
amount:
|
|
764
|
+
typename: decodeFromFields(TypeName.reified(), fields.typename),
|
|
765
|
+
stakingPoolId: decodeFromFields(ID.reified(), fields.staking_pool_id),
|
|
766
|
+
amount: decodeFromFields("u64", fields.amount),
|
|
818
767
|
});
|
|
819
768
|
}
|
|
820
769
|
static fromFieldsWithTypes(item) {
|
|
@@ -822,9 +771,9 @@ class IncreaseValidatorStakeEvent {
|
|
|
822
771
|
throw new Error("not a IncreaseValidatorStakeEvent type");
|
|
823
772
|
}
|
|
824
773
|
return IncreaseValidatorStakeEvent.reified().new({
|
|
825
|
-
typename:
|
|
826
|
-
stakingPoolId:
|
|
827
|
-
amount:
|
|
774
|
+
typename: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.typename),
|
|
775
|
+
stakingPoolId: decodeFromFieldsWithTypes(ID.reified(), item.fields.staking_pool_id),
|
|
776
|
+
amount: decodeFromFieldsWithTypes("u64", item.fields.amount),
|
|
828
777
|
});
|
|
829
778
|
}
|
|
830
779
|
static fromBcs(data) {
|
|
@@ -842,9 +791,9 @@ class IncreaseValidatorStakeEvent {
|
|
|
842
791
|
}
|
|
843
792
|
static fromJSONField(field) {
|
|
844
793
|
return IncreaseValidatorStakeEvent.reified().new({
|
|
845
|
-
typename:
|
|
846
|
-
stakingPoolId:
|
|
847
|
-
amount:
|
|
794
|
+
typename: decodeFromJSONField(TypeName.reified(), field.typename),
|
|
795
|
+
stakingPoolId: decodeFromJSONField(ID.reified(), field.stakingPoolId),
|
|
796
|
+
amount: decodeFromJSONField("u64", field.amount),
|
|
848
797
|
});
|
|
849
798
|
}
|
|
850
799
|
static fromJSON(json) {
|
|
@@ -868,7 +817,7 @@ class IncreaseValidatorStakeEvent {
|
|
|
868
817
|
!isIncreaseValidatorStakeEvent(data.bcs.type)) {
|
|
869
818
|
throw new Error(`object at is not a IncreaseValidatorStakeEvent object`);
|
|
870
819
|
}
|
|
871
|
-
return IncreaseValidatorStakeEvent.fromBcs((
|
|
820
|
+
return IncreaseValidatorStakeEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
872
821
|
}
|
|
873
822
|
if (data.content) {
|
|
874
823
|
return IncreaseValidatorStakeEvent.fromSuiParsedData(data.content);
|
|
@@ -890,28 +839,27 @@ class IncreaseValidatorStakeEvent {
|
|
|
890
839
|
});
|
|
891
840
|
}
|
|
892
841
|
}
|
|
893
|
-
|
|
894
|
-
IncreaseValidatorStakeEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::IncreaseValidatorStakeEvent`;
|
|
842
|
+
IncreaseValidatorStakeEvent.$typeName = `${PKG_V1}::liquid_staking::IncreaseValidatorStakeEvent`;
|
|
895
843
|
IncreaseValidatorStakeEvent.$numTypeParams = 0;
|
|
896
844
|
IncreaseValidatorStakeEvent.$isPhantom = [];
|
|
897
845
|
/* ============================== LIQUID_STAKING =============================== */
|
|
898
|
-
function isLIQUID_STAKING(type) {
|
|
899
|
-
type =
|
|
900
|
-
return type === `${
|
|
846
|
+
export function isLIQUID_STAKING(type) {
|
|
847
|
+
type = compressSuiType(type);
|
|
848
|
+
return type === `${PKG_V1}::liquid_staking::LIQUID_STAKING`;
|
|
901
849
|
}
|
|
902
|
-
class LIQUID_STAKING {
|
|
850
|
+
export class LIQUID_STAKING {
|
|
903
851
|
constructor(typeArgs, fields) {
|
|
904
852
|
this.__StructClass = true;
|
|
905
853
|
this.$typeName = LIQUID_STAKING.$typeName;
|
|
906
854
|
this.$isPhantom = LIQUID_STAKING.$isPhantom;
|
|
907
|
-
this.$fullTypeName =
|
|
855
|
+
this.$fullTypeName = composeSuiType(LIQUID_STAKING.$typeName, ...typeArgs);
|
|
908
856
|
this.$typeArgs = typeArgs;
|
|
909
857
|
this.dummyField = fields.dummyField;
|
|
910
858
|
}
|
|
911
859
|
static reified() {
|
|
912
860
|
return {
|
|
913
861
|
typeName: LIQUID_STAKING.$typeName,
|
|
914
|
-
fullTypeName:
|
|
862
|
+
fullTypeName: composeSuiType(LIQUID_STAKING.$typeName, ...[]),
|
|
915
863
|
typeArgs: [],
|
|
916
864
|
isPhantom: LIQUID_STAKING.$isPhantom,
|
|
917
865
|
reifiedTypeArgs: [],
|
|
@@ -934,19 +882,19 @@ class LIQUID_STAKING {
|
|
|
934
882
|
return LIQUID_STAKING.reified();
|
|
935
883
|
}
|
|
936
884
|
static phantom() {
|
|
937
|
-
return
|
|
885
|
+
return phantom(LIQUID_STAKING.reified());
|
|
938
886
|
}
|
|
939
887
|
static get p() {
|
|
940
888
|
return LIQUID_STAKING.phantom();
|
|
941
889
|
}
|
|
942
890
|
static get bcs() {
|
|
943
|
-
return
|
|
944
|
-
dummy_field:
|
|
891
|
+
return bcs.struct("LIQUID_STAKING", {
|
|
892
|
+
dummy_field: bcs.bool(),
|
|
945
893
|
});
|
|
946
894
|
}
|
|
947
895
|
static fromFields(fields) {
|
|
948
896
|
return LIQUID_STAKING.reified().new({
|
|
949
|
-
dummyField:
|
|
897
|
+
dummyField: decodeFromFields("bool", fields.dummy_field),
|
|
950
898
|
});
|
|
951
899
|
}
|
|
952
900
|
static fromFieldsWithTypes(item) {
|
|
@@ -954,7 +902,7 @@ class LIQUID_STAKING {
|
|
|
954
902
|
throw new Error("not a LIQUID_STAKING type");
|
|
955
903
|
}
|
|
956
904
|
return LIQUID_STAKING.reified().new({
|
|
957
|
-
dummyField:
|
|
905
|
+
dummyField: decodeFromFieldsWithTypes("bool", item.fields.dummy_field),
|
|
958
906
|
});
|
|
959
907
|
}
|
|
960
908
|
static fromBcs(data) {
|
|
@@ -970,7 +918,7 @@ class LIQUID_STAKING {
|
|
|
970
918
|
}
|
|
971
919
|
static fromJSONField(field) {
|
|
972
920
|
return LIQUID_STAKING.reified().new({
|
|
973
|
-
dummyField:
|
|
921
|
+
dummyField: decodeFromJSONField("bool", field.dummyField),
|
|
974
922
|
});
|
|
975
923
|
}
|
|
976
924
|
static fromJSON(json) {
|
|
@@ -994,7 +942,7 @@ class LIQUID_STAKING {
|
|
|
994
942
|
!isLIQUID_STAKING(data.bcs.type)) {
|
|
995
943
|
throw new Error(`object at is not a LIQUID_STAKING object`);
|
|
996
944
|
}
|
|
997
|
-
return LIQUID_STAKING.fromBcs((
|
|
945
|
+
return LIQUID_STAKING.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
998
946
|
}
|
|
999
947
|
if (data.content) {
|
|
1000
948
|
return LIQUID_STAKING.fromSuiParsedData(data.content);
|
|
@@ -1016,21 +964,20 @@ class LIQUID_STAKING {
|
|
|
1016
964
|
});
|
|
1017
965
|
}
|
|
1018
966
|
}
|
|
1019
|
-
|
|
1020
|
-
LIQUID_STAKING.$typeName = `${index_1.PKG_V1}::liquid_staking::LIQUID_STAKING`;
|
|
967
|
+
LIQUID_STAKING.$typeName = `${PKG_V1}::liquid_staking::LIQUID_STAKING`;
|
|
1021
968
|
LIQUID_STAKING.$numTypeParams = 0;
|
|
1022
969
|
LIQUID_STAKING.$isPhantom = [];
|
|
1023
970
|
/* ============================== LiquidStakingInfo =============================== */
|
|
1024
|
-
function isLiquidStakingInfo(type) {
|
|
1025
|
-
type =
|
|
1026
|
-
return type.startsWith(`${
|
|
971
|
+
export function isLiquidStakingInfo(type) {
|
|
972
|
+
type = compressSuiType(type);
|
|
973
|
+
return type.startsWith(`${PKG_V1}::liquid_staking::LiquidStakingInfo` + "<");
|
|
1027
974
|
}
|
|
1028
|
-
class LiquidStakingInfo {
|
|
975
|
+
export class LiquidStakingInfo {
|
|
1029
976
|
constructor(typeArgs, fields) {
|
|
1030
977
|
this.__StructClass = true;
|
|
1031
978
|
this.$typeName = LiquidStakingInfo.$typeName;
|
|
1032
979
|
this.$isPhantom = LiquidStakingInfo.$isPhantom;
|
|
1033
|
-
this.$fullTypeName =
|
|
980
|
+
this.$fullTypeName = composeSuiType(LiquidStakingInfo.$typeName, ...typeArgs);
|
|
1034
981
|
this.$typeArgs = typeArgs;
|
|
1035
982
|
this.id = fields.id;
|
|
1036
983
|
this.lstTreasuryCap = fields.lstTreasuryCap;
|
|
@@ -1044,8 +991,8 @@ class LiquidStakingInfo {
|
|
|
1044
991
|
static reified(P) {
|
|
1045
992
|
return {
|
|
1046
993
|
typeName: LiquidStakingInfo.$typeName,
|
|
1047
|
-
fullTypeName:
|
|
1048
|
-
typeArgs: [
|
|
994
|
+
fullTypeName: composeSuiType(LiquidStakingInfo.$typeName, ...[extractType(P)]),
|
|
995
|
+
typeArgs: [extractType(P)],
|
|
1049
996
|
isPhantom: LiquidStakingInfo.$isPhantom,
|
|
1050
997
|
reifiedTypeArgs: [P],
|
|
1051
998
|
fromFields: (fields) => LiquidStakingInfo.fromFields(P, fields),
|
|
@@ -1058,7 +1005,7 @@ class LiquidStakingInfo {
|
|
|
1058
1005
|
fromSuiObjectData: (content) => LiquidStakingInfo.fromSuiObjectData(P, content),
|
|
1059
1006
|
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return LiquidStakingInfo.fetch(client, P, id); }),
|
|
1060
1007
|
new: (fields) => {
|
|
1061
|
-
return new LiquidStakingInfo([
|
|
1008
|
+
return new LiquidStakingInfo([extractType(P)], fields);
|
|
1062
1009
|
},
|
|
1063
1010
|
kind: "StructClassReified",
|
|
1064
1011
|
};
|
|
@@ -1067,49 +1014,49 @@ class LiquidStakingInfo {
|
|
|
1067
1014
|
return LiquidStakingInfo.reified;
|
|
1068
1015
|
}
|
|
1069
1016
|
static phantom(P) {
|
|
1070
|
-
return
|
|
1017
|
+
return phantom(LiquidStakingInfo.reified(P));
|
|
1071
1018
|
}
|
|
1072
1019
|
static get p() {
|
|
1073
1020
|
return LiquidStakingInfo.phantom;
|
|
1074
1021
|
}
|
|
1075
1022
|
static get bcs() {
|
|
1076
|
-
return
|
|
1077
|
-
id:
|
|
1078
|
-
lst_treasury_cap:
|
|
1079
|
-
fee_config:
|
|
1080
|
-
fees:
|
|
1081
|
-
accrued_spread_fees:
|
|
1082
|
-
storage:
|
|
1083
|
-
version:
|
|
1084
|
-
extra_fields:
|
|
1023
|
+
return bcs.struct("LiquidStakingInfo", {
|
|
1024
|
+
id: UID.bcs,
|
|
1025
|
+
lst_treasury_cap: TreasuryCap.bcs,
|
|
1026
|
+
fee_config: Cell.bcs(FeeConfig.bcs),
|
|
1027
|
+
fees: Balance.bcs,
|
|
1028
|
+
accrued_spread_fees: bcs.u64(),
|
|
1029
|
+
storage: Storage.bcs,
|
|
1030
|
+
version: Version.bcs,
|
|
1031
|
+
extra_fields: Bag.bcs,
|
|
1085
1032
|
});
|
|
1086
1033
|
}
|
|
1087
1034
|
static fromFields(typeArg, fields) {
|
|
1088
1035
|
return LiquidStakingInfo.reified(typeArg).new({
|
|
1089
|
-
id:
|
|
1090
|
-
lstTreasuryCap:
|
|
1091
|
-
feeConfig:
|
|
1092
|
-
fees:
|
|
1093
|
-
accruedSpreadFees:
|
|
1094
|
-
storage:
|
|
1095
|
-
version:
|
|
1096
|
-
extraFields:
|
|
1036
|
+
id: decodeFromFields(UID.reified(), fields.id),
|
|
1037
|
+
lstTreasuryCap: decodeFromFields(TreasuryCap.reified(typeArg), fields.lst_treasury_cap),
|
|
1038
|
+
feeConfig: decodeFromFields(Cell.reified(FeeConfig.reified()), fields.fee_config),
|
|
1039
|
+
fees: decodeFromFields(Balance.reified(reified.phantom(SUI.reified())), fields.fees),
|
|
1040
|
+
accruedSpreadFees: decodeFromFields("u64", fields.accrued_spread_fees),
|
|
1041
|
+
storage: decodeFromFields(Storage.reified(), fields.storage),
|
|
1042
|
+
version: decodeFromFields(Version.reified(), fields.version),
|
|
1043
|
+
extraFields: decodeFromFields(Bag.reified(), fields.extra_fields),
|
|
1097
1044
|
});
|
|
1098
1045
|
}
|
|
1099
1046
|
static fromFieldsWithTypes(typeArg, item) {
|
|
1100
1047
|
if (!isLiquidStakingInfo(item.type)) {
|
|
1101
1048
|
throw new Error("not a LiquidStakingInfo type");
|
|
1102
1049
|
}
|
|
1103
|
-
|
|
1050
|
+
assertFieldsWithTypesArgsMatch(item, [typeArg]);
|
|
1104
1051
|
return LiquidStakingInfo.reified(typeArg).new({
|
|
1105
|
-
id:
|
|
1106
|
-
lstTreasuryCap:
|
|
1107
|
-
feeConfig:
|
|
1108
|
-
fees:
|
|
1109
|
-
accruedSpreadFees:
|
|
1110
|
-
storage:
|
|
1111
|
-
version:
|
|
1112
|
-
extraFields:
|
|
1052
|
+
id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id),
|
|
1053
|
+
lstTreasuryCap: decodeFromFieldsWithTypes(TreasuryCap.reified(typeArg), item.fields.lst_treasury_cap),
|
|
1054
|
+
feeConfig: decodeFromFieldsWithTypes(Cell.reified(FeeConfig.reified()), item.fields.fee_config),
|
|
1055
|
+
fees: decodeFromFieldsWithTypes(Balance.reified(reified.phantom(SUI.reified())), item.fields.fees),
|
|
1056
|
+
accruedSpreadFees: decodeFromFieldsWithTypes("u64", item.fields.accrued_spread_fees),
|
|
1057
|
+
storage: decodeFromFieldsWithTypes(Storage.reified(), item.fields.storage),
|
|
1058
|
+
version: decodeFromFieldsWithTypes(Version.reified(), item.fields.version),
|
|
1059
|
+
extraFields: decodeFromFieldsWithTypes(Bag.reified(), item.fields.extra_fields),
|
|
1113
1060
|
});
|
|
1114
1061
|
}
|
|
1115
1062
|
static fromBcs(typeArg, data) {
|
|
@@ -1132,21 +1079,21 @@ class LiquidStakingInfo {
|
|
|
1132
1079
|
}
|
|
1133
1080
|
static fromJSONField(typeArg, field) {
|
|
1134
1081
|
return LiquidStakingInfo.reified(typeArg).new({
|
|
1135
|
-
id:
|
|
1136
|
-
lstTreasuryCap:
|
|
1137
|
-
feeConfig:
|
|
1138
|
-
fees:
|
|
1139
|
-
accruedSpreadFees:
|
|
1140
|
-
storage:
|
|
1141
|
-
version:
|
|
1142
|
-
extraFields:
|
|
1082
|
+
id: decodeFromJSONField(UID.reified(), field.id),
|
|
1083
|
+
lstTreasuryCap: decodeFromJSONField(TreasuryCap.reified(typeArg), field.lstTreasuryCap),
|
|
1084
|
+
feeConfig: decodeFromJSONField(Cell.reified(FeeConfig.reified()), field.feeConfig),
|
|
1085
|
+
fees: decodeFromJSONField(Balance.reified(reified.phantom(SUI.reified())), field.fees),
|
|
1086
|
+
accruedSpreadFees: decodeFromJSONField("u64", field.accruedSpreadFees),
|
|
1087
|
+
storage: decodeFromJSONField(Storage.reified(), field.storage),
|
|
1088
|
+
version: decodeFromJSONField(Version.reified(), field.version),
|
|
1089
|
+
extraFields: decodeFromJSONField(Bag.reified(), field.extraFields),
|
|
1143
1090
|
});
|
|
1144
1091
|
}
|
|
1145
1092
|
static fromJSON(typeArg, json) {
|
|
1146
1093
|
if (json.$typeName !== LiquidStakingInfo.$typeName) {
|
|
1147
1094
|
throw new Error("not a WithTwoGenerics json object");
|
|
1148
1095
|
}
|
|
1149
|
-
|
|
1096
|
+
assertReifiedTypeArgsMatch(composeSuiType(LiquidStakingInfo.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg]);
|
|
1150
1097
|
return LiquidStakingInfo.fromJSONField(typeArg, json);
|
|
1151
1098
|
}
|
|
1152
1099
|
static fromSuiParsedData(typeArg, content) {
|
|
@@ -1164,16 +1111,16 @@ class LiquidStakingInfo {
|
|
|
1164
1111
|
!isLiquidStakingInfo(data.bcs.type)) {
|
|
1165
1112
|
throw new Error(`object at is not a LiquidStakingInfo object`);
|
|
1166
1113
|
}
|
|
1167
|
-
const gotTypeArgs =
|
|
1114
|
+
const gotTypeArgs = parseTypeName(data.bcs.type).typeArgs;
|
|
1168
1115
|
if (gotTypeArgs.length !== 1) {
|
|
1169
1116
|
throw new Error(`type argument mismatch: expected 1 type argument but got '${gotTypeArgs.length}'`);
|
|
1170
1117
|
}
|
|
1171
|
-
const gotTypeArg =
|
|
1172
|
-
const expectedTypeArg =
|
|
1173
|
-
if (gotTypeArg !==
|
|
1118
|
+
const gotTypeArg = compressSuiType(gotTypeArgs[0]);
|
|
1119
|
+
const expectedTypeArg = compressSuiType(extractType(typeArg));
|
|
1120
|
+
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
1174
1121
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
1175
1122
|
}
|
|
1176
|
-
return LiquidStakingInfo.fromBcs(typeArg, (
|
|
1123
|
+
return LiquidStakingInfo.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
1177
1124
|
}
|
|
1178
1125
|
if (data.content) {
|
|
1179
1126
|
return LiquidStakingInfo.fromSuiParsedData(typeArg, data.content);
|
|
@@ -1195,21 +1142,20 @@ class LiquidStakingInfo {
|
|
|
1195
1142
|
});
|
|
1196
1143
|
}
|
|
1197
1144
|
}
|
|
1198
|
-
|
|
1199
|
-
LiquidStakingInfo.$typeName = `${index_1.PKG_V1}::liquid_staking::LiquidStakingInfo`;
|
|
1145
|
+
LiquidStakingInfo.$typeName = `${PKG_V1}::liquid_staking::LiquidStakingInfo`;
|
|
1200
1146
|
LiquidStakingInfo.$numTypeParams = 1;
|
|
1201
1147
|
LiquidStakingInfo.$isPhantom = [true];
|
|
1202
1148
|
/* ============================== MintEvent =============================== */
|
|
1203
|
-
function isMintEvent(type) {
|
|
1204
|
-
type =
|
|
1205
|
-
return type === `${
|
|
1149
|
+
export function isMintEvent(type) {
|
|
1150
|
+
type = compressSuiType(type);
|
|
1151
|
+
return type === `${PKG_V1}::liquid_staking::MintEvent`;
|
|
1206
1152
|
}
|
|
1207
|
-
class MintEvent {
|
|
1153
|
+
export class MintEvent {
|
|
1208
1154
|
constructor(typeArgs, fields) {
|
|
1209
1155
|
this.__StructClass = true;
|
|
1210
1156
|
this.$typeName = MintEvent.$typeName;
|
|
1211
1157
|
this.$isPhantom = MintEvent.$isPhantom;
|
|
1212
|
-
this.$fullTypeName =
|
|
1158
|
+
this.$fullTypeName = composeSuiType(MintEvent.$typeName, ...typeArgs);
|
|
1213
1159
|
this.$typeArgs = typeArgs;
|
|
1214
1160
|
this.typename = fields.typename;
|
|
1215
1161
|
this.suiAmountIn = fields.suiAmountIn;
|
|
@@ -1219,7 +1165,7 @@ class MintEvent {
|
|
|
1219
1165
|
static reified() {
|
|
1220
1166
|
return {
|
|
1221
1167
|
typeName: MintEvent.$typeName,
|
|
1222
|
-
fullTypeName:
|
|
1168
|
+
fullTypeName: composeSuiType(MintEvent.$typeName, ...[]),
|
|
1223
1169
|
typeArgs: [],
|
|
1224
1170
|
isPhantom: MintEvent.$isPhantom,
|
|
1225
1171
|
reifiedTypeArgs: [],
|
|
@@ -1242,25 +1188,25 @@ class MintEvent {
|
|
|
1242
1188
|
return MintEvent.reified();
|
|
1243
1189
|
}
|
|
1244
1190
|
static phantom() {
|
|
1245
|
-
return
|
|
1191
|
+
return phantom(MintEvent.reified());
|
|
1246
1192
|
}
|
|
1247
1193
|
static get p() {
|
|
1248
1194
|
return MintEvent.phantom();
|
|
1249
1195
|
}
|
|
1250
1196
|
static get bcs() {
|
|
1251
|
-
return
|
|
1252
|
-
typename:
|
|
1253
|
-
sui_amount_in:
|
|
1254
|
-
lst_amount_out:
|
|
1255
|
-
fee_amount:
|
|
1197
|
+
return bcs.struct("MintEvent", {
|
|
1198
|
+
typename: TypeName.bcs,
|
|
1199
|
+
sui_amount_in: bcs.u64(),
|
|
1200
|
+
lst_amount_out: bcs.u64(),
|
|
1201
|
+
fee_amount: bcs.u64(),
|
|
1256
1202
|
});
|
|
1257
1203
|
}
|
|
1258
1204
|
static fromFields(fields) {
|
|
1259
1205
|
return MintEvent.reified().new({
|
|
1260
|
-
typename:
|
|
1261
|
-
suiAmountIn:
|
|
1262
|
-
lstAmountOut:
|
|
1263
|
-
feeAmount:
|
|
1206
|
+
typename: decodeFromFields(TypeName.reified(), fields.typename),
|
|
1207
|
+
suiAmountIn: decodeFromFields("u64", fields.sui_amount_in),
|
|
1208
|
+
lstAmountOut: decodeFromFields("u64", fields.lst_amount_out),
|
|
1209
|
+
feeAmount: decodeFromFields("u64", fields.fee_amount),
|
|
1264
1210
|
});
|
|
1265
1211
|
}
|
|
1266
1212
|
static fromFieldsWithTypes(item) {
|
|
@@ -1268,10 +1214,10 @@ class MintEvent {
|
|
|
1268
1214
|
throw new Error("not a MintEvent type");
|
|
1269
1215
|
}
|
|
1270
1216
|
return MintEvent.reified().new({
|
|
1271
|
-
typename:
|
|
1272
|
-
suiAmountIn:
|
|
1273
|
-
lstAmountOut:
|
|
1274
|
-
feeAmount:
|
|
1217
|
+
typename: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.typename),
|
|
1218
|
+
suiAmountIn: decodeFromFieldsWithTypes("u64", item.fields.sui_amount_in),
|
|
1219
|
+
lstAmountOut: decodeFromFieldsWithTypes("u64", item.fields.lst_amount_out),
|
|
1220
|
+
feeAmount: decodeFromFieldsWithTypes("u64", item.fields.fee_amount),
|
|
1275
1221
|
});
|
|
1276
1222
|
}
|
|
1277
1223
|
static fromBcs(data) {
|
|
@@ -1290,10 +1236,10 @@ class MintEvent {
|
|
|
1290
1236
|
}
|
|
1291
1237
|
static fromJSONField(field) {
|
|
1292
1238
|
return MintEvent.reified().new({
|
|
1293
|
-
typename:
|
|
1294
|
-
suiAmountIn:
|
|
1295
|
-
lstAmountOut:
|
|
1296
|
-
feeAmount:
|
|
1239
|
+
typename: decodeFromJSONField(TypeName.reified(), field.typename),
|
|
1240
|
+
suiAmountIn: decodeFromJSONField("u64", field.suiAmountIn),
|
|
1241
|
+
lstAmountOut: decodeFromJSONField("u64", field.lstAmountOut),
|
|
1242
|
+
feeAmount: decodeFromJSONField("u64", field.feeAmount),
|
|
1297
1243
|
});
|
|
1298
1244
|
}
|
|
1299
1245
|
static fromJSON(json) {
|
|
@@ -1316,7 +1262,7 @@ class MintEvent {
|
|
|
1316
1262
|
if (data.bcs.dataType !== "moveObject" || !isMintEvent(data.bcs.type)) {
|
|
1317
1263
|
throw new Error(`object at is not a MintEvent object`);
|
|
1318
1264
|
}
|
|
1319
|
-
return MintEvent.fromBcs((
|
|
1265
|
+
return MintEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
1320
1266
|
}
|
|
1321
1267
|
if (data.content) {
|
|
1322
1268
|
return MintEvent.fromSuiParsedData(data.content);
|
|
@@ -1338,21 +1284,20 @@ class MintEvent {
|
|
|
1338
1284
|
});
|
|
1339
1285
|
}
|
|
1340
1286
|
}
|
|
1341
|
-
|
|
1342
|
-
MintEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::MintEvent`;
|
|
1287
|
+
MintEvent.$typeName = `${PKG_V1}::liquid_staking::MintEvent`;
|
|
1343
1288
|
MintEvent.$numTypeParams = 0;
|
|
1344
1289
|
MintEvent.$isPhantom = [];
|
|
1345
1290
|
/* ============================== RedeemEvent =============================== */
|
|
1346
|
-
function isRedeemEvent(type) {
|
|
1347
|
-
type =
|
|
1348
|
-
return type === `${
|
|
1291
|
+
export function isRedeemEvent(type) {
|
|
1292
|
+
type = compressSuiType(type);
|
|
1293
|
+
return type === `${PKG_V1}::liquid_staking::RedeemEvent`;
|
|
1349
1294
|
}
|
|
1350
|
-
class RedeemEvent {
|
|
1295
|
+
export class RedeemEvent {
|
|
1351
1296
|
constructor(typeArgs, fields) {
|
|
1352
1297
|
this.__StructClass = true;
|
|
1353
1298
|
this.$typeName = RedeemEvent.$typeName;
|
|
1354
1299
|
this.$isPhantom = RedeemEvent.$isPhantom;
|
|
1355
|
-
this.$fullTypeName =
|
|
1300
|
+
this.$fullTypeName = composeSuiType(RedeemEvent.$typeName, ...typeArgs);
|
|
1356
1301
|
this.$typeArgs = typeArgs;
|
|
1357
1302
|
this.typename = fields.typename;
|
|
1358
1303
|
this.lstAmountIn = fields.lstAmountIn;
|
|
@@ -1362,7 +1307,7 @@ class RedeemEvent {
|
|
|
1362
1307
|
static reified() {
|
|
1363
1308
|
return {
|
|
1364
1309
|
typeName: RedeemEvent.$typeName,
|
|
1365
|
-
fullTypeName:
|
|
1310
|
+
fullTypeName: composeSuiType(RedeemEvent.$typeName, ...[]),
|
|
1366
1311
|
typeArgs: [],
|
|
1367
1312
|
isPhantom: RedeemEvent.$isPhantom,
|
|
1368
1313
|
reifiedTypeArgs: [],
|
|
@@ -1385,25 +1330,25 @@ class RedeemEvent {
|
|
|
1385
1330
|
return RedeemEvent.reified();
|
|
1386
1331
|
}
|
|
1387
1332
|
static phantom() {
|
|
1388
|
-
return
|
|
1333
|
+
return phantom(RedeemEvent.reified());
|
|
1389
1334
|
}
|
|
1390
1335
|
static get p() {
|
|
1391
1336
|
return RedeemEvent.phantom();
|
|
1392
1337
|
}
|
|
1393
1338
|
static get bcs() {
|
|
1394
|
-
return
|
|
1395
|
-
typename:
|
|
1396
|
-
lst_amount_in:
|
|
1397
|
-
sui_amount_out:
|
|
1398
|
-
fee_amount:
|
|
1339
|
+
return bcs.struct("RedeemEvent", {
|
|
1340
|
+
typename: TypeName.bcs,
|
|
1341
|
+
lst_amount_in: bcs.u64(),
|
|
1342
|
+
sui_amount_out: bcs.u64(),
|
|
1343
|
+
fee_amount: bcs.u64(),
|
|
1399
1344
|
});
|
|
1400
1345
|
}
|
|
1401
1346
|
static fromFields(fields) {
|
|
1402
1347
|
return RedeemEvent.reified().new({
|
|
1403
|
-
typename:
|
|
1404
|
-
lstAmountIn:
|
|
1405
|
-
suiAmountOut:
|
|
1406
|
-
feeAmount:
|
|
1348
|
+
typename: decodeFromFields(TypeName.reified(), fields.typename),
|
|
1349
|
+
lstAmountIn: decodeFromFields("u64", fields.lst_amount_in),
|
|
1350
|
+
suiAmountOut: decodeFromFields("u64", fields.sui_amount_out),
|
|
1351
|
+
feeAmount: decodeFromFields("u64", fields.fee_amount),
|
|
1407
1352
|
});
|
|
1408
1353
|
}
|
|
1409
1354
|
static fromFieldsWithTypes(item) {
|
|
@@ -1411,10 +1356,10 @@ class RedeemEvent {
|
|
|
1411
1356
|
throw new Error("not a RedeemEvent type");
|
|
1412
1357
|
}
|
|
1413
1358
|
return RedeemEvent.reified().new({
|
|
1414
|
-
typename:
|
|
1415
|
-
lstAmountIn:
|
|
1416
|
-
suiAmountOut:
|
|
1417
|
-
feeAmount:
|
|
1359
|
+
typename: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.typename),
|
|
1360
|
+
lstAmountIn: decodeFromFieldsWithTypes("u64", item.fields.lst_amount_in),
|
|
1361
|
+
suiAmountOut: decodeFromFieldsWithTypes("u64", item.fields.sui_amount_out),
|
|
1362
|
+
feeAmount: decodeFromFieldsWithTypes("u64", item.fields.fee_amount),
|
|
1418
1363
|
});
|
|
1419
1364
|
}
|
|
1420
1365
|
static fromBcs(data) {
|
|
@@ -1433,10 +1378,10 @@ class RedeemEvent {
|
|
|
1433
1378
|
}
|
|
1434
1379
|
static fromJSONField(field) {
|
|
1435
1380
|
return RedeemEvent.reified().new({
|
|
1436
|
-
typename:
|
|
1437
|
-
lstAmountIn:
|
|
1438
|
-
suiAmountOut:
|
|
1439
|
-
feeAmount:
|
|
1381
|
+
typename: decodeFromJSONField(TypeName.reified(), field.typename),
|
|
1382
|
+
lstAmountIn: decodeFromJSONField("u64", field.lstAmountIn),
|
|
1383
|
+
suiAmountOut: decodeFromJSONField("u64", field.suiAmountOut),
|
|
1384
|
+
feeAmount: decodeFromJSONField("u64", field.feeAmount),
|
|
1440
1385
|
});
|
|
1441
1386
|
}
|
|
1442
1387
|
static fromJSON(json) {
|
|
@@ -1459,7 +1404,7 @@ class RedeemEvent {
|
|
|
1459
1404
|
if (data.bcs.dataType !== "moveObject" || !isRedeemEvent(data.bcs.type)) {
|
|
1460
1405
|
throw new Error(`object at is not a RedeemEvent object`);
|
|
1461
1406
|
}
|
|
1462
|
-
return RedeemEvent.fromBcs((
|
|
1407
|
+
return RedeemEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
1463
1408
|
}
|
|
1464
1409
|
if (data.content) {
|
|
1465
1410
|
return RedeemEvent.fromSuiParsedData(data.content);
|
|
@@ -1481,7 +1426,6 @@ class RedeemEvent {
|
|
|
1481
1426
|
});
|
|
1482
1427
|
}
|
|
1483
1428
|
}
|
|
1484
|
-
|
|
1485
|
-
RedeemEvent.$typeName = `${index_1.PKG_V1}::liquid_staking::RedeemEvent`;
|
|
1429
|
+
RedeemEvent.$typeName = `${PKG_V1}::liquid_staking::RedeemEvent`;
|
|
1486
1430
|
RedeemEvent.$numTypeParams = 0;
|
|
1487
1431
|
RedeemEvent.$isPhantom = [];
|