@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,37 +7,29 @@ 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
|
-
const structs_2 = require("../../0x2/bag/structs");
|
|
57
|
-
const structs_3 = require("../../0x2/balance/structs");
|
|
58
|
-
const structs_4 = require("../../0x2/object/structs");
|
|
59
|
-
const structs_5 = require("../../0x2/sui/structs");
|
|
60
|
-
const structs_6 = require("../../0x2/table/structs");
|
|
61
|
-
const index_1 = require("../index");
|
|
62
|
-
const bcs_1 = require("@mysten/sui/bcs");
|
|
63
|
-
const utils_1 = require("@mysten/sui/utils");
|
|
10
|
+
import * as reified from "../../../../_framework/reified";
|
|
11
|
+
import { decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, fieldToJSON, phantom, } from "../../../../_framework/reified";
|
|
12
|
+
import { composeSuiType, compressSuiType, } from "../../../../_framework/util";
|
|
13
|
+
import { Option } from "../../0x1/option/structs";
|
|
14
|
+
import { Bag } from "../../0x2/bag/structs";
|
|
15
|
+
import { Balance } from "../../0x2/balance/structs";
|
|
16
|
+
import { ID, UID } from "../../0x2/object/structs";
|
|
17
|
+
import { SUI } from "../../0x2/sui/structs";
|
|
18
|
+
import { Table } from "../../0x2/table/structs";
|
|
19
|
+
import { PKG_V19 } from "../index";
|
|
20
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
21
|
+
import { fromBase64 } from "@mysten/sui/utils";
|
|
64
22
|
/* ============================== FungibleStakedSui =============================== */
|
|
65
|
-
function isFungibleStakedSui(type) {
|
|
66
|
-
type =
|
|
67
|
-
return type === `${
|
|
23
|
+
export function isFungibleStakedSui(type) {
|
|
24
|
+
type = compressSuiType(type);
|
|
25
|
+
return type === `${PKG_V19}::staking_pool::FungibleStakedSui`;
|
|
68
26
|
}
|
|
69
|
-
class FungibleStakedSui {
|
|
27
|
+
export class FungibleStakedSui {
|
|
70
28
|
constructor(typeArgs, fields) {
|
|
71
29
|
this.__StructClass = true;
|
|
72
30
|
this.$typeName = FungibleStakedSui.$typeName;
|
|
73
31
|
this.$isPhantom = FungibleStakedSui.$isPhantom;
|
|
74
|
-
this.$fullTypeName =
|
|
32
|
+
this.$fullTypeName = composeSuiType(FungibleStakedSui.$typeName, ...typeArgs);
|
|
75
33
|
this.$typeArgs = typeArgs;
|
|
76
34
|
this.id = fields.id;
|
|
77
35
|
this.poolId = fields.poolId;
|
|
@@ -80,7 +38,7 @@ class FungibleStakedSui {
|
|
|
80
38
|
static reified() {
|
|
81
39
|
return {
|
|
82
40
|
typeName: FungibleStakedSui.$typeName,
|
|
83
|
-
fullTypeName:
|
|
41
|
+
fullTypeName: composeSuiType(FungibleStakedSui.$typeName, ...[]),
|
|
84
42
|
typeArgs: [],
|
|
85
43
|
isPhantom: FungibleStakedSui.$isPhantom,
|
|
86
44
|
reifiedTypeArgs: [],
|
|
@@ -103,23 +61,23 @@ class FungibleStakedSui {
|
|
|
103
61
|
return FungibleStakedSui.reified();
|
|
104
62
|
}
|
|
105
63
|
static phantom() {
|
|
106
|
-
return
|
|
64
|
+
return phantom(FungibleStakedSui.reified());
|
|
107
65
|
}
|
|
108
66
|
static get p() {
|
|
109
67
|
return FungibleStakedSui.phantom();
|
|
110
68
|
}
|
|
111
69
|
static get bcs() {
|
|
112
|
-
return
|
|
113
|
-
id:
|
|
114
|
-
pool_id:
|
|
115
|
-
value:
|
|
70
|
+
return bcs.struct("FungibleStakedSui", {
|
|
71
|
+
id: UID.bcs,
|
|
72
|
+
pool_id: ID.bcs,
|
|
73
|
+
value: bcs.u64(),
|
|
116
74
|
});
|
|
117
75
|
}
|
|
118
76
|
static fromFields(fields) {
|
|
119
77
|
return FungibleStakedSui.reified().new({
|
|
120
|
-
id:
|
|
121
|
-
poolId:
|
|
122
|
-
value:
|
|
78
|
+
id: decodeFromFields(UID.reified(), fields.id),
|
|
79
|
+
poolId: decodeFromFields(ID.reified(), fields.pool_id),
|
|
80
|
+
value: decodeFromFields("u64", fields.value),
|
|
123
81
|
});
|
|
124
82
|
}
|
|
125
83
|
static fromFieldsWithTypes(item) {
|
|
@@ -127,9 +85,9 @@ class FungibleStakedSui {
|
|
|
127
85
|
throw new Error("not a FungibleStakedSui type");
|
|
128
86
|
}
|
|
129
87
|
return FungibleStakedSui.reified().new({
|
|
130
|
-
id:
|
|
131
|
-
poolId:
|
|
132
|
-
value:
|
|
88
|
+
id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id),
|
|
89
|
+
poolId: decodeFromFieldsWithTypes(ID.reified(), item.fields.pool_id),
|
|
90
|
+
value: decodeFromFieldsWithTypes("u64", item.fields.value),
|
|
133
91
|
});
|
|
134
92
|
}
|
|
135
93
|
static fromBcs(data) {
|
|
@@ -147,9 +105,9 @@ class FungibleStakedSui {
|
|
|
147
105
|
}
|
|
148
106
|
static fromJSONField(field) {
|
|
149
107
|
return FungibleStakedSui.reified().new({
|
|
150
|
-
id:
|
|
151
|
-
poolId:
|
|
152
|
-
value:
|
|
108
|
+
id: decodeFromJSONField(UID.reified(), field.id),
|
|
109
|
+
poolId: decodeFromJSONField(ID.reified(), field.poolId),
|
|
110
|
+
value: decodeFromJSONField("u64", field.value),
|
|
153
111
|
});
|
|
154
112
|
}
|
|
155
113
|
static fromJSON(json) {
|
|
@@ -173,7 +131,7 @@ class FungibleStakedSui {
|
|
|
173
131
|
!isFungibleStakedSui(data.bcs.type)) {
|
|
174
132
|
throw new Error(`object at is not a FungibleStakedSui object`);
|
|
175
133
|
}
|
|
176
|
-
return FungibleStakedSui.fromBcs((
|
|
134
|
+
return FungibleStakedSui.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
177
135
|
}
|
|
178
136
|
if (data.content) {
|
|
179
137
|
return FungibleStakedSui.fromSuiParsedData(data.content);
|
|
@@ -195,21 +153,20 @@ class FungibleStakedSui {
|
|
|
195
153
|
});
|
|
196
154
|
}
|
|
197
155
|
}
|
|
198
|
-
|
|
199
|
-
FungibleStakedSui.$typeName = `${index_1.PKG_V19}::staking_pool::FungibleStakedSui`;
|
|
156
|
+
FungibleStakedSui.$typeName = `${PKG_V19}::staking_pool::FungibleStakedSui`;
|
|
200
157
|
FungibleStakedSui.$numTypeParams = 0;
|
|
201
158
|
FungibleStakedSui.$isPhantom = [];
|
|
202
159
|
/* ============================== FungibleStakedSuiData =============================== */
|
|
203
|
-
function isFungibleStakedSuiData(type) {
|
|
204
|
-
type =
|
|
205
|
-
return type === `${
|
|
160
|
+
export function isFungibleStakedSuiData(type) {
|
|
161
|
+
type = compressSuiType(type);
|
|
162
|
+
return type === `${PKG_V19}::staking_pool::FungibleStakedSuiData`;
|
|
206
163
|
}
|
|
207
|
-
class FungibleStakedSuiData {
|
|
164
|
+
export class FungibleStakedSuiData {
|
|
208
165
|
constructor(typeArgs, fields) {
|
|
209
166
|
this.__StructClass = true;
|
|
210
167
|
this.$typeName = FungibleStakedSuiData.$typeName;
|
|
211
168
|
this.$isPhantom = FungibleStakedSuiData.$isPhantom;
|
|
212
|
-
this.$fullTypeName =
|
|
169
|
+
this.$fullTypeName = composeSuiType(FungibleStakedSuiData.$typeName, ...typeArgs);
|
|
213
170
|
this.$typeArgs = typeArgs;
|
|
214
171
|
this.id = fields.id;
|
|
215
172
|
this.totalSupply = fields.totalSupply;
|
|
@@ -218,7 +175,7 @@ class FungibleStakedSuiData {
|
|
|
218
175
|
static reified() {
|
|
219
176
|
return {
|
|
220
177
|
typeName: FungibleStakedSuiData.$typeName,
|
|
221
|
-
fullTypeName:
|
|
178
|
+
fullTypeName: composeSuiType(FungibleStakedSuiData.$typeName, ...[]),
|
|
222
179
|
typeArgs: [],
|
|
223
180
|
isPhantom: FungibleStakedSuiData.$isPhantom,
|
|
224
181
|
reifiedTypeArgs: [],
|
|
@@ -241,23 +198,23 @@ class FungibleStakedSuiData {
|
|
|
241
198
|
return FungibleStakedSuiData.reified();
|
|
242
199
|
}
|
|
243
200
|
static phantom() {
|
|
244
|
-
return
|
|
201
|
+
return phantom(FungibleStakedSuiData.reified());
|
|
245
202
|
}
|
|
246
203
|
static get p() {
|
|
247
204
|
return FungibleStakedSuiData.phantom();
|
|
248
205
|
}
|
|
249
206
|
static get bcs() {
|
|
250
|
-
return
|
|
251
|
-
id:
|
|
252
|
-
total_supply:
|
|
253
|
-
principal:
|
|
207
|
+
return bcs.struct("FungibleStakedSuiData", {
|
|
208
|
+
id: UID.bcs,
|
|
209
|
+
total_supply: bcs.u64(),
|
|
210
|
+
principal: Balance.bcs,
|
|
254
211
|
});
|
|
255
212
|
}
|
|
256
213
|
static fromFields(fields) {
|
|
257
214
|
return FungibleStakedSuiData.reified().new({
|
|
258
|
-
id:
|
|
259
|
-
totalSupply:
|
|
260
|
-
principal:
|
|
215
|
+
id: decodeFromFields(UID.reified(), fields.id),
|
|
216
|
+
totalSupply: decodeFromFields("u64", fields.total_supply),
|
|
217
|
+
principal: decodeFromFields(Balance.reified(reified.phantom(SUI.reified())), fields.principal),
|
|
261
218
|
});
|
|
262
219
|
}
|
|
263
220
|
static fromFieldsWithTypes(item) {
|
|
@@ -265,9 +222,9 @@ class FungibleStakedSuiData {
|
|
|
265
222
|
throw new Error("not a FungibleStakedSuiData type");
|
|
266
223
|
}
|
|
267
224
|
return FungibleStakedSuiData.reified().new({
|
|
268
|
-
id:
|
|
269
|
-
totalSupply:
|
|
270
|
-
principal:
|
|
225
|
+
id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id),
|
|
226
|
+
totalSupply: decodeFromFieldsWithTypes("u64", item.fields.total_supply),
|
|
227
|
+
principal: decodeFromFieldsWithTypes(Balance.reified(reified.phantom(SUI.reified())), item.fields.principal),
|
|
271
228
|
});
|
|
272
229
|
}
|
|
273
230
|
static fromBcs(data) {
|
|
@@ -285,9 +242,9 @@ class FungibleStakedSuiData {
|
|
|
285
242
|
}
|
|
286
243
|
static fromJSONField(field) {
|
|
287
244
|
return FungibleStakedSuiData.reified().new({
|
|
288
|
-
id:
|
|
289
|
-
totalSupply:
|
|
290
|
-
principal:
|
|
245
|
+
id: decodeFromJSONField(UID.reified(), field.id),
|
|
246
|
+
totalSupply: decodeFromJSONField("u64", field.totalSupply),
|
|
247
|
+
principal: decodeFromJSONField(Balance.reified(reified.phantom(SUI.reified())), field.principal),
|
|
291
248
|
});
|
|
292
249
|
}
|
|
293
250
|
static fromJSON(json) {
|
|
@@ -311,7 +268,7 @@ class FungibleStakedSuiData {
|
|
|
311
268
|
!isFungibleStakedSuiData(data.bcs.type)) {
|
|
312
269
|
throw new Error(`object at is not a FungibleStakedSuiData object`);
|
|
313
270
|
}
|
|
314
|
-
return FungibleStakedSuiData.fromBcs((
|
|
271
|
+
return FungibleStakedSuiData.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
315
272
|
}
|
|
316
273
|
if (data.content) {
|
|
317
274
|
return FungibleStakedSuiData.fromSuiParsedData(data.content);
|
|
@@ -333,28 +290,27 @@ class FungibleStakedSuiData {
|
|
|
333
290
|
});
|
|
334
291
|
}
|
|
335
292
|
}
|
|
336
|
-
|
|
337
|
-
FungibleStakedSuiData.$typeName = `${index_1.PKG_V19}::staking_pool::FungibleStakedSuiData`;
|
|
293
|
+
FungibleStakedSuiData.$typeName = `${PKG_V19}::staking_pool::FungibleStakedSuiData`;
|
|
338
294
|
FungibleStakedSuiData.$numTypeParams = 0;
|
|
339
295
|
FungibleStakedSuiData.$isPhantom = [];
|
|
340
296
|
/* ============================== FungibleStakedSuiDataKey =============================== */
|
|
341
|
-
function isFungibleStakedSuiDataKey(type) {
|
|
342
|
-
type =
|
|
343
|
-
return type === `${
|
|
297
|
+
export function isFungibleStakedSuiDataKey(type) {
|
|
298
|
+
type = compressSuiType(type);
|
|
299
|
+
return type === `${PKG_V19}::staking_pool::FungibleStakedSuiDataKey`;
|
|
344
300
|
}
|
|
345
|
-
class FungibleStakedSuiDataKey {
|
|
301
|
+
export class FungibleStakedSuiDataKey {
|
|
346
302
|
constructor(typeArgs, fields) {
|
|
347
303
|
this.__StructClass = true;
|
|
348
304
|
this.$typeName = FungibleStakedSuiDataKey.$typeName;
|
|
349
305
|
this.$isPhantom = FungibleStakedSuiDataKey.$isPhantom;
|
|
350
|
-
this.$fullTypeName =
|
|
306
|
+
this.$fullTypeName = composeSuiType(FungibleStakedSuiDataKey.$typeName, ...typeArgs);
|
|
351
307
|
this.$typeArgs = typeArgs;
|
|
352
308
|
this.dummyField = fields.dummyField;
|
|
353
309
|
}
|
|
354
310
|
static reified() {
|
|
355
311
|
return {
|
|
356
312
|
typeName: FungibleStakedSuiDataKey.$typeName,
|
|
357
|
-
fullTypeName:
|
|
313
|
+
fullTypeName: composeSuiType(FungibleStakedSuiDataKey.$typeName, ...[]),
|
|
358
314
|
typeArgs: [],
|
|
359
315
|
isPhantom: FungibleStakedSuiDataKey.$isPhantom,
|
|
360
316
|
reifiedTypeArgs: [],
|
|
@@ -377,19 +333,19 @@ class FungibleStakedSuiDataKey {
|
|
|
377
333
|
return FungibleStakedSuiDataKey.reified();
|
|
378
334
|
}
|
|
379
335
|
static phantom() {
|
|
380
|
-
return
|
|
336
|
+
return phantom(FungibleStakedSuiDataKey.reified());
|
|
381
337
|
}
|
|
382
338
|
static get p() {
|
|
383
339
|
return FungibleStakedSuiDataKey.phantom();
|
|
384
340
|
}
|
|
385
341
|
static get bcs() {
|
|
386
|
-
return
|
|
387
|
-
dummy_field:
|
|
342
|
+
return bcs.struct("FungibleStakedSuiDataKey", {
|
|
343
|
+
dummy_field: bcs.bool(),
|
|
388
344
|
});
|
|
389
345
|
}
|
|
390
346
|
static fromFields(fields) {
|
|
391
347
|
return FungibleStakedSuiDataKey.reified().new({
|
|
392
|
-
dummyField:
|
|
348
|
+
dummyField: decodeFromFields("bool", fields.dummy_field),
|
|
393
349
|
});
|
|
394
350
|
}
|
|
395
351
|
static fromFieldsWithTypes(item) {
|
|
@@ -397,7 +353,7 @@ class FungibleStakedSuiDataKey {
|
|
|
397
353
|
throw new Error("not a FungibleStakedSuiDataKey type");
|
|
398
354
|
}
|
|
399
355
|
return FungibleStakedSuiDataKey.reified().new({
|
|
400
|
-
dummyField:
|
|
356
|
+
dummyField: decodeFromFieldsWithTypes("bool", item.fields.dummy_field),
|
|
401
357
|
});
|
|
402
358
|
}
|
|
403
359
|
static fromBcs(data) {
|
|
@@ -413,7 +369,7 @@ class FungibleStakedSuiDataKey {
|
|
|
413
369
|
}
|
|
414
370
|
static fromJSONField(field) {
|
|
415
371
|
return FungibleStakedSuiDataKey.reified().new({
|
|
416
|
-
dummyField:
|
|
372
|
+
dummyField: decodeFromJSONField("bool", field.dummyField),
|
|
417
373
|
});
|
|
418
374
|
}
|
|
419
375
|
static fromJSON(json) {
|
|
@@ -437,7 +393,7 @@ class FungibleStakedSuiDataKey {
|
|
|
437
393
|
!isFungibleStakedSuiDataKey(data.bcs.type)) {
|
|
438
394
|
throw new Error(`object at is not a FungibleStakedSuiDataKey object`);
|
|
439
395
|
}
|
|
440
|
-
return FungibleStakedSuiDataKey.fromBcs((
|
|
396
|
+
return FungibleStakedSuiDataKey.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
441
397
|
}
|
|
442
398
|
if (data.content) {
|
|
443
399
|
return FungibleStakedSuiDataKey.fromSuiParsedData(data.content);
|
|
@@ -459,21 +415,20 @@ class FungibleStakedSuiDataKey {
|
|
|
459
415
|
});
|
|
460
416
|
}
|
|
461
417
|
}
|
|
462
|
-
|
|
463
|
-
FungibleStakedSuiDataKey.$typeName = `${index_1.PKG_V19}::staking_pool::FungibleStakedSuiDataKey`;
|
|
418
|
+
FungibleStakedSuiDataKey.$typeName = `${PKG_V19}::staking_pool::FungibleStakedSuiDataKey`;
|
|
464
419
|
FungibleStakedSuiDataKey.$numTypeParams = 0;
|
|
465
420
|
FungibleStakedSuiDataKey.$isPhantom = [];
|
|
466
421
|
/* ============================== PoolTokenExchangeRate =============================== */
|
|
467
|
-
function isPoolTokenExchangeRate(type) {
|
|
468
|
-
type =
|
|
469
|
-
return type === `${
|
|
422
|
+
export function isPoolTokenExchangeRate(type) {
|
|
423
|
+
type = compressSuiType(type);
|
|
424
|
+
return type === `${PKG_V19}::staking_pool::PoolTokenExchangeRate`;
|
|
470
425
|
}
|
|
471
|
-
class PoolTokenExchangeRate {
|
|
426
|
+
export class PoolTokenExchangeRate {
|
|
472
427
|
constructor(typeArgs, fields) {
|
|
473
428
|
this.__StructClass = true;
|
|
474
429
|
this.$typeName = PoolTokenExchangeRate.$typeName;
|
|
475
430
|
this.$isPhantom = PoolTokenExchangeRate.$isPhantom;
|
|
476
|
-
this.$fullTypeName =
|
|
431
|
+
this.$fullTypeName = composeSuiType(PoolTokenExchangeRate.$typeName, ...typeArgs);
|
|
477
432
|
this.$typeArgs = typeArgs;
|
|
478
433
|
this.suiAmount = fields.suiAmount;
|
|
479
434
|
this.poolTokenAmount = fields.poolTokenAmount;
|
|
@@ -481,7 +436,7 @@ class PoolTokenExchangeRate {
|
|
|
481
436
|
static reified() {
|
|
482
437
|
return {
|
|
483
438
|
typeName: PoolTokenExchangeRate.$typeName,
|
|
484
|
-
fullTypeName:
|
|
439
|
+
fullTypeName: composeSuiType(PoolTokenExchangeRate.$typeName, ...[]),
|
|
485
440
|
typeArgs: [],
|
|
486
441
|
isPhantom: PoolTokenExchangeRate.$isPhantom,
|
|
487
442
|
reifiedTypeArgs: [],
|
|
@@ -504,21 +459,21 @@ class PoolTokenExchangeRate {
|
|
|
504
459
|
return PoolTokenExchangeRate.reified();
|
|
505
460
|
}
|
|
506
461
|
static phantom() {
|
|
507
|
-
return
|
|
462
|
+
return phantom(PoolTokenExchangeRate.reified());
|
|
508
463
|
}
|
|
509
464
|
static get p() {
|
|
510
465
|
return PoolTokenExchangeRate.phantom();
|
|
511
466
|
}
|
|
512
467
|
static get bcs() {
|
|
513
|
-
return
|
|
514
|
-
sui_amount:
|
|
515
|
-
pool_token_amount:
|
|
468
|
+
return bcs.struct("PoolTokenExchangeRate", {
|
|
469
|
+
sui_amount: bcs.u64(),
|
|
470
|
+
pool_token_amount: bcs.u64(),
|
|
516
471
|
});
|
|
517
472
|
}
|
|
518
473
|
static fromFields(fields) {
|
|
519
474
|
return PoolTokenExchangeRate.reified().new({
|
|
520
|
-
suiAmount:
|
|
521
|
-
poolTokenAmount:
|
|
475
|
+
suiAmount: decodeFromFields("u64", fields.sui_amount),
|
|
476
|
+
poolTokenAmount: decodeFromFields("u64", fields.pool_token_amount),
|
|
522
477
|
});
|
|
523
478
|
}
|
|
524
479
|
static fromFieldsWithTypes(item) {
|
|
@@ -526,8 +481,8 @@ class PoolTokenExchangeRate {
|
|
|
526
481
|
throw new Error("not a PoolTokenExchangeRate type");
|
|
527
482
|
}
|
|
528
483
|
return PoolTokenExchangeRate.reified().new({
|
|
529
|
-
suiAmount:
|
|
530
|
-
poolTokenAmount:
|
|
484
|
+
suiAmount: decodeFromFieldsWithTypes("u64", item.fields.sui_amount),
|
|
485
|
+
poolTokenAmount: decodeFromFieldsWithTypes("u64", item.fields.pool_token_amount),
|
|
531
486
|
});
|
|
532
487
|
}
|
|
533
488
|
static fromBcs(data) {
|
|
@@ -544,8 +499,8 @@ class PoolTokenExchangeRate {
|
|
|
544
499
|
}
|
|
545
500
|
static fromJSONField(field) {
|
|
546
501
|
return PoolTokenExchangeRate.reified().new({
|
|
547
|
-
suiAmount:
|
|
548
|
-
poolTokenAmount:
|
|
502
|
+
suiAmount: decodeFromJSONField("u64", field.suiAmount),
|
|
503
|
+
poolTokenAmount: decodeFromJSONField("u64", field.poolTokenAmount),
|
|
549
504
|
});
|
|
550
505
|
}
|
|
551
506
|
static fromJSON(json) {
|
|
@@ -569,7 +524,7 @@ class PoolTokenExchangeRate {
|
|
|
569
524
|
!isPoolTokenExchangeRate(data.bcs.type)) {
|
|
570
525
|
throw new Error(`object at is not a PoolTokenExchangeRate object`);
|
|
571
526
|
}
|
|
572
|
-
return PoolTokenExchangeRate.fromBcs((
|
|
527
|
+
return PoolTokenExchangeRate.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
573
528
|
}
|
|
574
529
|
if (data.content) {
|
|
575
530
|
return PoolTokenExchangeRate.fromSuiParsedData(data.content);
|
|
@@ -591,21 +546,20 @@ class PoolTokenExchangeRate {
|
|
|
591
546
|
});
|
|
592
547
|
}
|
|
593
548
|
}
|
|
594
|
-
|
|
595
|
-
PoolTokenExchangeRate.$typeName = `${index_1.PKG_V19}::staking_pool::PoolTokenExchangeRate`;
|
|
549
|
+
PoolTokenExchangeRate.$typeName = `${PKG_V19}::staking_pool::PoolTokenExchangeRate`;
|
|
596
550
|
PoolTokenExchangeRate.$numTypeParams = 0;
|
|
597
551
|
PoolTokenExchangeRate.$isPhantom = [];
|
|
598
552
|
/* ============================== StakedSui =============================== */
|
|
599
|
-
function isStakedSui(type) {
|
|
600
|
-
type =
|
|
601
|
-
return type === `${
|
|
553
|
+
export function isStakedSui(type) {
|
|
554
|
+
type = compressSuiType(type);
|
|
555
|
+
return type === `${PKG_V19}::staking_pool::StakedSui`;
|
|
602
556
|
}
|
|
603
|
-
class StakedSui {
|
|
557
|
+
export class StakedSui {
|
|
604
558
|
constructor(typeArgs, fields) {
|
|
605
559
|
this.__StructClass = true;
|
|
606
560
|
this.$typeName = StakedSui.$typeName;
|
|
607
561
|
this.$isPhantom = StakedSui.$isPhantom;
|
|
608
|
-
this.$fullTypeName =
|
|
562
|
+
this.$fullTypeName = composeSuiType(StakedSui.$typeName, ...typeArgs);
|
|
609
563
|
this.$typeArgs = typeArgs;
|
|
610
564
|
this.id = fields.id;
|
|
611
565
|
this.poolId = fields.poolId;
|
|
@@ -615,7 +569,7 @@ class StakedSui {
|
|
|
615
569
|
static reified() {
|
|
616
570
|
return {
|
|
617
571
|
typeName: StakedSui.$typeName,
|
|
618
|
-
fullTypeName:
|
|
572
|
+
fullTypeName: composeSuiType(StakedSui.$typeName, ...[]),
|
|
619
573
|
typeArgs: [],
|
|
620
574
|
isPhantom: StakedSui.$isPhantom,
|
|
621
575
|
reifiedTypeArgs: [],
|
|
@@ -638,25 +592,25 @@ class StakedSui {
|
|
|
638
592
|
return StakedSui.reified();
|
|
639
593
|
}
|
|
640
594
|
static phantom() {
|
|
641
|
-
return
|
|
595
|
+
return phantom(StakedSui.reified());
|
|
642
596
|
}
|
|
643
597
|
static get p() {
|
|
644
598
|
return StakedSui.phantom();
|
|
645
599
|
}
|
|
646
600
|
static get bcs() {
|
|
647
|
-
return
|
|
648
|
-
id:
|
|
649
|
-
pool_id:
|
|
650
|
-
stake_activation_epoch:
|
|
651
|
-
principal:
|
|
601
|
+
return bcs.struct("StakedSui", {
|
|
602
|
+
id: UID.bcs,
|
|
603
|
+
pool_id: ID.bcs,
|
|
604
|
+
stake_activation_epoch: bcs.u64(),
|
|
605
|
+
principal: Balance.bcs,
|
|
652
606
|
});
|
|
653
607
|
}
|
|
654
608
|
static fromFields(fields) {
|
|
655
609
|
return StakedSui.reified().new({
|
|
656
|
-
id:
|
|
657
|
-
poolId:
|
|
658
|
-
stakeActivationEpoch:
|
|
659
|
-
principal:
|
|
610
|
+
id: decodeFromFields(UID.reified(), fields.id),
|
|
611
|
+
poolId: decodeFromFields(ID.reified(), fields.pool_id),
|
|
612
|
+
stakeActivationEpoch: decodeFromFields("u64", fields.stake_activation_epoch),
|
|
613
|
+
principal: decodeFromFields(Balance.reified(reified.phantom(SUI.reified())), fields.principal),
|
|
660
614
|
});
|
|
661
615
|
}
|
|
662
616
|
static fromFieldsWithTypes(item) {
|
|
@@ -664,10 +618,10 @@ class StakedSui {
|
|
|
664
618
|
throw new Error("not a StakedSui type");
|
|
665
619
|
}
|
|
666
620
|
return StakedSui.reified().new({
|
|
667
|
-
id:
|
|
668
|
-
poolId:
|
|
669
|
-
stakeActivationEpoch:
|
|
670
|
-
principal:
|
|
621
|
+
id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id),
|
|
622
|
+
poolId: decodeFromFieldsWithTypes(ID.reified(), item.fields.pool_id),
|
|
623
|
+
stakeActivationEpoch: decodeFromFieldsWithTypes("u64", item.fields.stake_activation_epoch),
|
|
624
|
+
principal: decodeFromFieldsWithTypes(Balance.reified(reified.phantom(SUI.reified())), item.fields.principal),
|
|
671
625
|
});
|
|
672
626
|
}
|
|
673
627
|
static fromBcs(data) {
|
|
@@ -686,10 +640,10 @@ class StakedSui {
|
|
|
686
640
|
}
|
|
687
641
|
static fromJSONField(field) {
|
|
688
642
|
return StakedSui.reified().new({
|
|
689
|
-
id:
|
|
690
|
-
poolId:
|
|
691
|
-
stakeActivationEpoch:
|
|
692
|
-
principal:
|
|
643
|
+
id: decodeFromJSONField(UID.reified(), field.id),
|
|
644
|
+
poolId: decodeFromJSONField(ID.reified(), field.poolId),
|
|
645
|
+
stakeActivationEpoch: decodeFromJSONField("u64", field.stakeActivationEpoch),
|
|
646
|
+
principal: decodeFromJSONField(Balance.reified(reified.phantom(SUI.reified())), field.principal),
|
|
693
647
|
});
|
|
694
648
|
}
|
|
695
649
|
static fromJSON(json) {
|
|
@@ -712,7 +666,7 @@ class StakedSui {
|
|
|
712
666
|
if (data.bcs.dataType !== "moveObject" || !isStakedSui(data.bcs.type)) {
|
|
713
667
|
throw new Error(`object at is not a StakedSui object`);
|
|
714
668
|
}
|
|
715
|
-
return StakedSui.fromBcs((
|
|
669
|
+
return StakedSui.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
716
670
|
}
|
|
717
671
|
if (data.content) {
|
|
718
672
|
return StakedSui.fromSuiParsedData(data.content);
|
|
@@ -734,21 +688,20 @@ class StakedSui {
|
|
|
734
688
|
});
|
|
735
689
|
}
|
|
736
690
|
}
|
|
737
|
-
|
|
738
|
-
StakedSui.$typeName = `${index_1.PKG_V19}::staking_pool::StakedSui`;
|
|
691
|
+
StakedSui.$typeName = `${PKG_V19}::staking_pool::StakedSui`;
|
|
739
692
|
StakedSui.$numTypeParams = 0;
|
|
740
693
|
StakedSui.$isPhantom = [];
|
|
741
694
|
/* ============================== StakingPool =============================== */
|
|
742
|
-
function isStakingPool(type) {
|
|
743
|
-
type =
|
|
744
|
-
return type === `${
|
|
695
|
+
export function isStakingPool(type) {
|
|
696
|
+
type = compressSuiType(type);
|
|
697
|
+
return type === `${PKG_V19}::staking_pool::StakingPool`;
|
|
745
698
|
}
|
|
746
|
-
class StakingPool {
|
|
699
|
+
export class StakingPool {
|
|
747
700
|
constructor(typeArgs, fields) {
|
|
748
701
|
this.__StructClass = true;
|
|
749
702
|
this.$typeName = StakingPool.$typeName;
|
|
750
703
|
this.$isPhantom = StakingPool.$isPhantom;
|
|
751
|
-
this.$fullTypeName =
|
|
704
|
+
this.$fullTypeName = composeSuiType(StakingPool.$typeName, ...typeArgs);
|
|
752
705
|
this.$typeArgs = typeArgs;
|
|
753
706
|
this.id = fields.id;
|
|
754
707
|
this.activationEpoch = fields.activationEpoch;
|
|
@@ -765,7 +718,7 @@ class StakingPool {
|
|
|
765
718
|
static reified() {
|
|
766
719
|
return {
|
|
767
720
|
typeName: StakingPool.$typeName,
|
|
768
|
-
fullTypeName:
|
|
721
|
+
fullTypeName: composeSuiType(StakingPool.$typeName, ...[]),
|
|
769
722
|
typeArgs: [],
|
|
770
723
|
isPhantom: StakingPool.$isPhantom,
|
|
771
724
|
reifiedTypeArgs: [],
|
|
@@ -788,39 +741,39 @@ class StakingPool {
|
|
|
788
741
|
return StakingPool.reified();
|
|
789
742
|
}
|
|
790
743
|
static phantom() {
|
|
791
|
-
return
|
|
744
|
+
return phantom(StakingPool.reified());
|
|
792
745
|
}
|
|
793
746
|
static get p() {
|
|
794
747
|
return StakingPool.phantom();
|
|
795
748
|
}
|
|
796
749
|
static get bcs() {
|
|
797
|
-
return
|
|
798
|
-
id:
|
|
799
|
-
activation_epoch:
|
|
800
|
-
deactivation_epoch:
|
|
801
|
-
sui_balance:
|
|
802
|
-
rewards_pool:
|
|
803
|
-
pool_token_balance:
|
|
804
|
-
exchange_rates:
|
|
805
|
-
pending_stake:
|
|
806
|
-
pending_total_sui_withdraw:
|
|
807
|
-
pending_pool_token_withdraw:
|
|
808
|
-
extra_fields:
|
|
750
|
+
return bcs.struct("StakingPool", {
|
|
751
|
+
id: UID.bcs,
|
|
752
|
+
activation_epoch: Option.bcs(bcs.u64()),
|
|
753
|
+
deactivation_epoch: Option.bcs(bcs.u64()),
|
|
754
|
+
sui_balance: bcs.u64(),
|
|
755
|
+
rewards_pool: Balance.bcs,
|
|
756
|
+
pool_token_balance: bcs.u64(),
|
|
757
|
+
exchange_rates: Table.bcs,
|
|
758
|
+
pending_stake: bcs.u64(),
|
|
759
|
+
pending_total_sui_withdraw: bcs.u64(),
|
|
760
|
+
pending_pool_token_withdraw: bcs.u64(),
|
|
761
|
+
extra_fields: Bag.bcs,
|
|
809
762
|
});
|
|
810
763
|
}
|
|
811
764
|
static fromFields(fields) {
|
|
812
765
|
return StakingPool.reified().new({
|
|
813
|
-
id:
|
|
814
|
-
activationEpoch:
|
|
815
|
-
deactivationEpoch:
|
|
816
|
-
suiBalance:
|
|
817
|
-
rewardsPool:
|
|
818
|
-
poolTokenBalance:
|
|
819
|
-
exchangeRates:
|
|
820
|
-
pendingStake:
|
|
821
|
-
pendingTotalSuiWithdraw:
|
|
822
|
-
pendingPoolTokenWithdraw:
|
|
823
|
-
extraFields:
|
|
766
|
+
id: decodeFromFields(UID.reified(), fields.id),
|
|
767
|
+
activationEpoch: decodeFromFields(Option.reified("u64"), fields.activation_epoch),
|
|
768
|
+
deactivationEpoch: decodeFromFields(Option.reified("u64"), fields.deactivation_epoch),
|
|
769
|
+
suiBalance: decodeFromFields("u64", fields.sui_balance),
|
|
770
|
+
rewardsPool: decodeFromFields(Balance.reified(reified.phantom(SUI.reified())), fields.rewards_pool),
|
|
771
|
+
poolTokenBalance: decodeFromFields("u64", fields.pool_token_balance),
|
|
772
|
+
exchangeRates: decodeFromFields(Table.reified(reified.phantom("u64"), reified.phantom(PoolTokenExchangeRate.reified())), fields.exchange_rates),
|
|
773
|
+
pendingStake: decodeFromFields("u64", fields.pending_stake),
|
|
774
|
+
pendingTotalSuiWithdraw: decodeFromFields("u64", fields.pending_total_sui_withdraw),
|
|
775
|
+
pendingPoolTokenWithdraw: decodeFromFields("u64", fields.pending_pool_token_withdraw),
|
|
776
|
+
extraFields: decodeFromFields(Bag.reified(), fields.extra_fields),
|
|
824
777
|
});
|
|
825
778
|
}
|
|
826
779
|
static fromFieldsWithTypes(item) {
|
|
@@ -828,17 +781,17 @@ class StakingPool {
|
|
|
828
781
|
throw new Error("not a StakingPool type");
|
|
829
782
|
}
|
|
830
783
|
return StakingPool.reified().new({
|
|
831
|
-
id:
|
|
832
|
-
activationEpoch:
|
|
833
|
-
deactivationEpoch:
|
|
834
|
-
suiBalance:
|
|
835
|
-
rewardsPool:
|
|
836
|
-
poolTokenBalance:
|
|
837
|
-
exchangeRates:
|
|
838
|
-
pendingStake:
|
|
839
|
-
pendingTotalSuiWithdraw:
|
|
840
|
-
pendingPoolTokenWithdraw:
|
|
841
|
-
extraFields:
|
|
784
|
+
id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id),
|
|
785
|
+
activationEpoch: decodeFromFieldsWithTypes(Option.reified("u64"), item.fields.activation_epoch),
|
|
786
|
+
deactivationEpoch: decodeFromFieldsWithTypes(Option.reified("u64"), item.fields.deactivation_epoch),
|
|
787
|
+
suiBalance: decodeFromFieldsWithTypes("u64", item.fields.sui_balance),
|
|
788
|
+
rewardsPool: decodeFromFieldsWithTypes(Balance.reified(reified.phantom(SUI.reified())), item.fields.rewards_pool),
|
|
789
|
+
poolTokenBalance: decodeFromFieldsWithTypes("u64", item.fields.pool_token_balance),
|
|
790
|
+
exchangeRates: decodeFromFieldsWithTypes(Table.reified(reified.phantom("u64"), reified.phantom(PoolTokenExchangeRate.reified())), item.fields.exchange_rates),
|
|
791
|
+
pendingStake: decodeFromFieldsWithTypes("u64", item.fields.pending_stake),
|
|
792
|
+
pendingTotalSuiWithdraw: decodeFromFieldsWithTypes("u64", item.fields.pending_total_sui_withdraw),
|
|
793
|
+
pendingPoolTokenWithdraw: decodeFromFieldsWithTypes("u64", item.fields.pending_pool_token_withdraw),
|
|
794
|
+
extraFields: decodeFromFieldsWithTypes(Bag.reified(), item.fields.extra_fields),
|
|
842
795
|
});
|
|
843
796
|
}
|
|
844
797
|
static fromBcs(data) {
|
|
@@ -847,8 +800,8 @@ class StakingPool {
|
|
|
847
800
|
toJSONField() {
|
|
848
801
|
return {
|
|
849
802
|
id: this.id,
|
|
850
|
-
activationEpoch:
|
|
851
|
-
deactivationEpoch:
|
|
803
|
+
activationEpoch: fieldToJSON(`${Option.$typeName}<u64>`, this.activationEpoch),
|
|
804
|
+
deactivationEpoch: fieldToJSON(`${Option.$typeName}<u64>`, this.deactivationEpoch),
|
|
852
805
|
suiBalance: this.suiBalance.toString(),
|
|
853
806
|
rewardsPool: this.rewardsPool.toJSONField(),
|
|
854
807
|
poolTokenBalance: this.poolTokenBalance.toString(),
|
|
@@ -864,17 +817,17 @@ class StakingPool {
|
|
|
864
817
|
}
|
|
865
818
|
static fromJSONField(field) {
|
|
866
819
|
return StakingPool.reified().new({
|
|
867
|
-
id:
|
|
868
|
-
activationEpoch:
|
|
869
|
-
deactivationEpoch:
|
|
870
|
-
suiBalance:
|
|
871
|
-
rewardsPool:
|
|
872
|
-
poolTokenBalance:
|
|
873
|
-
exchangeRates:
|
|
874
|
-
pendingStake:
|
|
875
|
-
pendingTotalSuiWithdraw:
|
|
876
|
-
pendingPoolTokenWithdraw:
|
|
877
|
-
extraFields:
|
|
820
|
+
id: decodeFromJSONField(UID.reified(), field.id),
|
|
821
|
+
activationEpoch: decodeFromJSONField(Option.reified("u64"), field.activationEpoch),
|
|
822
|
+
deactivationEpoch: decodeFromJSONField(Option.reified("u64"), field.deactivationEpoch),
|
|
823
|
+
suiBalance: decodeFromJSONField("u64", field.suiBalance),
|
|
824
|
+
rewardsPool: decodeFromJSONField(Balance.reified(reified.phantom(SUI.reified())), field.rewardsPool),
|
|
825
|
+
poolTokenBalance: decodeFromJSONField("u64", field.poolTokenBalance),
|
|
826
|
+
exchangeRates: decodeFromJSONField(Table.reified(reified.phantom("u64"), reified.phantom(PoolTokenExchangeRate.reified())), field.exchangeRates),
|
|
827
|
+
pendingStake: decodeFromJSONField("u64", field.pendingStake),
|
|
828
|
+
pendingTotalSuiWithdraw: decodeFromJSONField("u64", field.pendingTotalSuiWithdraw),
|
|
829
|
+
pendingPoolTokenWithdraw: decodeFromJSONField("u64", field.pendingPoolTokenWithdraw),
|
|
830
|
+
extraFields: decodeFromJSONField(Bag.reified(), field.extraFields),
|
|
878
831
|
});
|
|
879
832
|
}
|
|
880
833
|
static fromJSON(json) {
|
|
@@ -897,7 +850,7 @@ class StakingPool {
|
|
|
897
850
|
if (data.bcs.dataType !== "moveObject" || !isStakingPool(data.bcs.type)) {
|
|
898
851
|
throw new Error(`object at is not a StakingPool object`);
|
|
899
852
|
}
|
|
900
|
-
return StakingPool.fromBcs((
|
|
853
|
+
return StakingPool.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
901
854
|
}
|
|
902
855
|
if (data.content) {
|
|
903
856
|
return StakingPool.fromSuiParsedData(data.content);
|
|
@@ -919,7 +872,6 @@ class StakingPool {
|
|
|
919
872
|
});
|
|
920
873
|
}
|
|
921
874
|
}
|
|
922
|
-
|
|
923
|
-
StakingPool.$typeName = `${index_1.PKG_V19}::staking_pool::StakingPool`;
|
|
875
|
+
StakingPool.$typeName = `${PKG_V19}::staking_pool::StakingPool`;
|
|
924
876
|
StakingPool.$numTypeParams = 0;
|
|
925
877
|
StakingPool.$isPhantom = [];
|