@suilend/sdk 1.1.99 → 2.0.1
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/_generated/_dependencies/source/0x1/ascii/structs.d.ts +7 -7
- package/_generated/_dependencies/source/0x1/ascii/structs.js +35 -75
- package/_generated/_dependencies/source/0x1/index.js +3 -6
- package/_generated/_dependencies/source/0x1/option/structs.d.ts +3 -3
- package/_generated/_dependencies/source/0x1/option/structs.js +31 -69
- package/_generated/_dependencies/source/0x1/type-name/structs.d.ts +5 -5
- package/_generated/_dependencies/source/0x1/type-name/structs.js +20 -25
- package/_generated/_dependencies/source/0x2/bag/structs.d.ts +7 -7
- package/_generated/_dependencies/source/0x2/bag/structs.js +24 -29
- package/_generated/_dependencies/source/0x2/balance/structs.d.ts +7 -7
- package/_generated/_dependencies/source/0x2/balance/structs.js +49 -56
- package/_generated/_dependencies/source/0x2/index.js +3 -6
- package/_generated/_dependencies/source/0x2/object/structs.d.ts +8 -8
- package/_generated/_dependencies/source/0x2/object/structs.js +34 -41
- package/_generated/_dependencies/source/0x2/object-table/structs.d.ts +7 -7
- package/_generated/_dependencies/source/0x2/object-table/structs.js +31 -36
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.d.ts +5 -5
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.js +23 -28
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/index.js +4 -7
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.d.ts +11 -11
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.js +32 -37
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.d.ts +23 -23
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.js +29 -34
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.d.ts +4 -4
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.js +21 -59
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.d.ts +55 -55
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.js +46 -53
- package/_generated/_framework/reified.d.ts +2 -2
- package/_generated/_framework/reified.js +27 -40
- package/_generated/_framework/util.js +26 -40
- package/_generated/_framework/vector.d.ts +4 -4
- package/_generated/_framework/vector.js +16 -21
- package/_generated/suilend/cell/structs.d.ts +4 -4
- package/_generated/suilend/cell/structs.js +31 -36
- package/_generated/suilend/decimal/structs.d.ts +4 -4
- package/_generated/suilend/decimal/structs.js +19 -24
- package/_generated/suilend/index.js +8 -12
- package/_generated/suilend/lending-market/functions.d.ts +1 -0
- package/_generated/suilend/lending-market/functions.js +271 -302
- package/_generated/suilend/lending-market/structs.d.ts +146 -146
- package/_generated/suilend/lending-market/structs.js +549 -617
- package/_generated/suilend/lending-market-registry/functions.js +7 -11
- package/_generated/suilend/liquidity-mining/structs.d.ts +50 -50
- package/_generated/suilend/liquidity-mining/structs.js +159 -205
- package/_generated/suilend/obligation/structs.d.ts +106 -106
- package/_generated/suilend/obligation/structs.js +313 -363
- package/_generated/suilend/rate-limiter/functions.js +23 -31
- package/_generated/suilend/rate-limiter/structs.d.ts +15 -15
- package/_generated/suilend/rate-limiter/structs.js +49 -56
- package/_generated/suilend/reserve/structs.d.ts +139 -139
- package/_generated/suilend/reserve/structs.js +397 -451
- package/_generated/suilend/reserve-config/functions.js +149 -190
- package/_generated/suilend/reserve-config/structs.d.ts +33 -33
- package/_generated/suilend/reserve-config/structs.js +109 -149
- package/api/events.js +1 -5
- package/api/index.js +1 -17
- package/client.d.ts +10 -10
- package/client.js +118 -128
- package/index.js +7 -23
- package/lib/constants.js +3 -9
- package/lib/index.js +5 -21
- package/lib/initialize.d.ts +3 -3
- package/lib/initialize.js +103 -140
- package/lib/liquidityMining.d.ts +3 -3
- package/lib/liquidityMining.js +57 -72
- package/lib/pyth.js +9 -14
- package/lib/strategyOwnerCap.js +106 -119
- package/lib/transactions.js +2 -7
- package/lib/types.js +4 -7
- package/mmt.js +2 -5
- package/package.json +1 -1
- package/parsers/apiReserveAssetDataEvent.js +25 -33
- package/parsers/index.js +5 -21
- package/parsers/lendingMarket.d.ts +1 -1
- package/parsers/lendingMarket.js +12 -19
- package/parsers/obligation.js +19 -26
- package/parsers/rateLimiter.js +11 -19
- package/parsers/reserve.d.ts +1 -1
- package/parsers/reserve.js +42 -85
- package/strategies.d.ts +11 -11
- package/strategies.js +547 -586
- package/swap/index.js +2 -18
- package/swap/quote.js +57 -65
- package/swap/transaction.d.ts +2 -2
- package/swap/transaction.js +40 -35
- package/utils/events.d.ts +3 -3
- package/utils/events.js +18 -35
- package/utils/index.js +16 -40
- package/utils/obligation.d.ts +4 -4
- package/utils/obligation.js +17 -60
- package/utils/simulate.js +118 -143
|
@@ -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,48 +7,30 @@ 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
|
-
exports.isLiquidateEvent = isLiquidateEvent;
|
|
58
|
-
exports.isObligationOwnerCap = isObligationOwnerCap;
|
|
59
|
-
exports.isRateLimiterExemption = isRateLimiterExemption;
|
|
60
|
-
exports.isRepayEvent = isRepayEvent;
|
|
61
|
-
exports.isWithdrawEvent = isWithdrawEvent;
|
|
62
|
-
const reified = __importStar(require("../../_framework/reified"));
|
|
63
|
-
const structs_1 = require("../../_dependencies/source/0x1/type-name/structs");
|
|
64
|
-
const structs_2 = require("../../_dependencies/source/0x2/object-table/structs");
|
|
65
|
-
const structs_3 = require("../../_dependencies/source/0x2/object/structs");
|
|
66
|
-
const reified_1 = require("../../_framework/reified");
|
|
67
|
-
const util_1 = require("../../_framework/util");
|
|
68
|
-
const structs_4 = require("../decimal/structs");
|
|
69
|
-
const index_1 = require("../index");
|
|
70
|
-
const structs_5 = require("../obligation/structs");
|
|
71
|
-
const structs_6 = require("../rate-limiter/structs");
|
|
72
|
-
const structs_7 = require("../reserve/structs");
|
|
73
|
-
const bcs_1 = require("@mysten/sui/bcs");
|
|
74
|
-
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 { ObjectTable } from "../../_dependencies/source/0x2/object-table/structs";
|
|
13
|
+
import { ID, UID } from "../../_dependencies/source/0x2/object/structs";
|
|
14
|
+
import { assertFieldsWithTypesArgsMatch, assertReifiedTypeArgsMatch, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, extractType, fieldToJSON, phantom, } from "../../_framework/reified";
|
|
15
|
+
import { composeSuiType, compressSuiType, parseTypeName, } from "../../_framework/util";
|
|
16
|
+
import { Decimal } from "../decimal/structs";
|
|
17
|
+
import { PKG_V1, PKG_V10 } from "../index";
|
|
18
|
+
import { Obligation } from "../obligation/structs";
|
|
19
|
+
import { RateLimiter } from "../rate-limiter/structs";
|
|
20
|
+
import { Reserve } from "../reserve/structs";
|
|
21
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
22
|
+
import { fromBase64, fromHex, toHex } from "@mysten/sui/utils";
|
|
75
23
|
/* ============================== MintEvent =============================== */
|
|
76
|
-
function isMintEvent(type) {
|
|
77
|
-
type =
|
|
78
|
-
return type === `${
|
|
24
|
+
export function isMintEvent(type) {
|
|
25
|
+
type = compressSuiType(type);
|
|
26
|
+
return type === `${PKG_V1}::lending_market::MintEvent`;
|
|
79
27
|
}
|
|
80
|
-
class MintEvent {
|
|
28
|
+
export class MintEvent {
|
|
81
29
|
constructor(typeArgs, fields) {
|
|
82
30
|
this.__StructClass = true;
|
|
83
31
|
this.$typeName = MintEvent.$typeName;
|
|
84
32
|
this.$isPhantom = MintEvent.$isPhantom;
|
|
85
|
-
this.$fullTypeName =
|
|
33
|
+
this.$fullTypeName = composeSuiType(MintEvent.$typeName, ...typeArgs);
|
|
86
34
|
this.$typeArgs = typeArgs;
|
|
87
35
|
this.lendingMarketId = fields.lendingMarketId;
|
|
88
36
|
this.coinType = fields.coinType;
|
|
@@ -93,7 +41,7 @@ class MintEvent {
|
|
|
93
41
|
static reified() {
|
|
94
42
|
return {
|
|
95
43
|
typeName: MintEvent.$typeName,
|
|
96
|
-
fullTypeName:
|
|
44
|
+
fullTypeName: composeSuiType(MintEvent.$typeName, ...[]),
|
|
97
45
|
typeArgs: [],
|
|
98
46
|
isPhantom: MintEvent.$isPhantom,
|
|
99
47
|
reifiedTypeArgs: [],
|
|
@@ -116,37 +64,37 @@ class MintEvent {
|
|
|
116
64
|
return MintEvent.reified();
|
|
117
65
|
}
|
|
118
66
|
static phantom() {
|
|
119
|
-
return
|
|
67
|
+
return phantom(MintEvent.reified());
|
|
120
68
|
}
|
|
121
69
|
static get p() {
|
|
122
70
|
return MintEvent.phantom();
|
|
123
71
|
}
|
|
124
72
|
static get bcs() {
|
|
125
|
-
return
|
|
126
|
-
lending_market_id:
|
|
73
|
+
return bcs.struct("MintEvent", {
|
|
74
|
+
lending_market_id: bcs
|
|
127
75
|
.bytes(32)
|
|
128
76
|
.transform({
|
|
129
|
-
input: (val) => (
|
|
130
|
-
output: (val) => (
|
|
77
|
+
input: (val) => fromHex(val),
|
|
78
|
+
output: (val) => toHex(val),
|
|
131
79
|
}),
|
|
132
|
-
coin_type:
|
|
133
|
-
reserve_id:
|
|
80
|
+
coin_type: TypeName.bcs,
|
|
81
|
+
reserve_id: bcs
|
|
134
82
|
.bytes(32)
|
|
135
83
|
.transform({
|
|
136
|
-
input: (val) => (
|
|
137
|
-
output: (val) => (
|
|
84
|
+
input: (val) => fromHex(val),
|
|
85
|
+
output: (val) => toHex(val),
|
|
138
86
|
}),
|
|
139
|
-
liquidity_amount:
|
|
140
|
-
ctoken_amount:
|
|
87
|
+
liquidity_amount: bcs.u64(),
|
|
88
|
+
ctoken_amount: bcs.u64(),
|
|
141
89
|
});
|
|
142
90
|
}
|
|
143
91
|
static fromFields(fields) {
|
|
144
92
|
return MintEvent.reified().new({
|
|
145
|
-
lendingMarketId:
|
|
146
|
-
coinType:
|
|
147
|
-
reserveId:
|
|
148
|
-
liquidityAmount:
|
|
149
|
-
ctokenAmount:
|
|
93
|
+
lendingMarketId: decodeFromFields("address", fields.lending_market_id),
|
|
94
|
+
coinType: decodeFromFields(TypeName.reified(), fields.coin_type),
|
|
95
|
+
reserveId: decodeFromFields("address", fields.reserve_id),
|
|
96
|
+
liquidityAmount: decodeFromFields("u64", fields.liquidity_amount),
|
|
97
|
+
ctokenAmount: decodeFromFields("u64", fields.ctoken_amount),
|
|
150
98
|
});
|
|
151
99
|
}
|
|
152
100
|
static fromFieldsWithTypes(item) {
|
|
@@ -154,11 +102,11 @@ class MintEvent {
|
|
|
154
102
|
throw new Error("not a MintEvent type");
|
|
155
103
|
}
|
|
156
104
|
return MintEvent.reified().new({
|
|
157
|
-
lendingMarketId:
|
|
158
|
-
coinType:
|
|
159
|
-
reserveId:
|
|
160
|
-
liquidityAmount:
|
|
161
|
-
ctokenAmount:
|
|
105
|
+
lendingMarketId: decodeFromFieldsWithTypes("address", item.fields.lending_market_id),
|
|
106
|
+
coinType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.coin_type),
|
|
107
|
+
reserveId: decodeFromFieldsWithTypes("address", item.fields.reserve_id),
|
|
108
|
+
liquidityAmount: decodeFromFieldsWithTypes("u64", item.fields.liquidity_amount),
|
|
109
|
+
ctokenAmount: decodeFromFieldsWithTypes("u64", item.fields.ctoken_amount),
|
|
162
110
|
});
|
|
163
111
|
}
|
|
164
112
|
static fromBcs(data) {
|
|
@@ -178,11 +126,11 @@ class MintEvent {
|
|
|
178
126
|
}
|
|
179
127
|
static fromJSONField(field) {
|
|
180
128
|
return MintEvent.reified().new({
|
|
181
|
-
lendingMarketId:
|
|
182
|
-
coinType:
|
|
183
|
-
reserveId:
|
|
184
|
-
liquidityAmount:
|
|
185
|
-
ctokenAmount:
|
|
129
|
+
lendingMarketId: decodeFromJSONField("address", field.lendingMarketId),
|
|
130
|
+
coinType: decodeFromJSONField(TypeName.reified(), field.coinType),
|
|
131
|
+
reserveId: decodeFromJSONField("address", field.reserveId),
|
|
132
|
+
liquidityAmount: decodeFromJSONField("u64", field.liquidityAmount),
|
|
133
|
+
ctokenAmount: decodeFromJSONField("u64", field.ctokenAmount),
|
|
186
134
|
});
|
|
187
135
|
}
|
|
188
136
|
static fromJSON(json) {
|
|
@@ -205,7 +153,7 @@ class MintEvent {
|
|
|
205
153
|
if (data.bcs.dataType !== "moveObject" || !isMintEvent(data.bcs.type)) {
|
|
206
154
|
throw new Error(`object at is not a MintEvent object`);
|
|
207
155
|
}
|
|
208
|
-
return MintEvent.fromBcs((
|
|
156
|
+
return MintEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
209
157
|
}
|
|
210
158
|
if (data.content) {
|
|
211
159
|
return MintEvent.fromSuiParsedData(data.content);
|
|
@@ -227,21 +175,20 @@ class MintEvent {
|
|
|
227
175
|
});
|
|
228
176
|
}
|
|
229
177
|
}
|
|
230
|
-
|
|
231
|
-
MintEvent.$typeName = `${index_1.PKG_V1}::lending_market::MintEvent`;
|
|
178
|
+
MintEvent.$typeName = `${PKG_V1}::lending_market::MintEvent`;
|
|
232
179
|
MintEvent.$numTypeParams = 0;
|
|
233
180
|
MintEvent.$isPhantom = [];
|
|
234
181
|
/* ============================== RedeemEvent =============================== */
|
|
235
|
-
function isRedeemEvent(type) {
|
|
236
|
-
type =
|
|
237
|
-
return type === `${
|
|
182
|
+
export function isRedeemEvent(type) {
|
|
183
|
+
type = compressSuiType(type);
|
|
184
|
+
return type === `${PKG_V1}::lending_market::RedeemEvent`;
|
|
238
185
|
}
|
|
239
|
-
class RedeemEvent {
|
|
186
|
+
export class RedeemEvent {
|
|
240
187
|
constructor(typeArgs, fields) {
|
|
241
188
|
this.__StructClass = true;
|
|
242
189
|
this.$typeName = RedeemEvent.$typeName;
|
|
243
190
|
this.$isPhantom = RedeemEvent.$isPhantom;
|
|
244
|
-
this.$fullTypeName =
|
|
191
|
+
this.$fullTypeName = composeSuiType(RedeemEvent.$typeName, ...typeArgs);
|
|
245
192
|
this.$typeArgs = typeArgs;
|
|
246
193
|
this.lendingMarketId = fields.lendingMarketId;
|
|
247
194
|
this.coinType = fields.coinType;
|
|
@@ -252,7 +199,7 @@ class RedeemEvent {
|
|
|
252
199
|
static reified() {
|
|
253
200
|
return {
|
|
254
201
|
typeName: RedeemEvent.$typeName,
|
|
255
|
-
fullTypeName:
|
|
202
|
+
fullTypeName: composeSuiType(RedeemEvent.$typeName, ...[]),
|
|
256
203
|
typeArgs: [],
|
|
257
204
|
isPhantom: RedeemEvent.$isPhantom,
|
|
258
205
|
reifiedTypeArgs: [],
|
|
@@ -275,37 +222,37 @@ class RedeemEvent {
|
|
|
275
222
|
return RedeemEvent.reified();
|
|
276
223
|
}
|
|
277
224
|
static phantom() {
|
|
278
|
-
return
|
|
225
|
+
return phantom(RedeemEvent.reified());
|
|
279
226
|
}
|
|
280
227
|
static get p() {
|
|
281
228
|
return RedeemEvent.phantom();
|
|
282
229
|
}
|
|
283
230
|
static get bcs() {
|
|
284
|
-
return
|
|
285
|
-
lending_market_id:
|
|
231
|
+
return bcs.struct("RedeemEvent", {
|
|
232
|
+
lending_market_id: bcs
|
|
286
233
|
.bytes(32)
|
|
287
234
|
.transform({
|
|
288
|
-
input: (val) => (
|
|
289
|
-
output: (val) => (
|
|
235
|
+
input: (val) => fromHex(val),
|
|
236
|
+
output: (val) => toHex(val),
|
|
290
237
|
}),
|
|
291
|
-
coin_type:
|
|
292
|
-
reserve_id:
|
|
238
|
+
coin_type: TypeName.bcs,
|
|
239
|
+
reserve_id: bcs
|
|
293
240
|
.bytes(32)
|
|
294
241
|
.transform({
|
|
295
|
-
input: (val) => (
|
|
296
|
-
output: (val) => (
|
|
242
|
+
input: (val) => fromHex(val),
|
|
243
|
+
output: (val) => toHex(val),
|
|
297
244
|
}),
|
|
298
|
-
ctoken_amount:
|
|
299
|
-
liquidity_amount:
|
|
245
|
+
ctoken_amount: bcs.u64(),
|
|
246
|
+
liquidity_amount: bcs.u64(),
|
|
300
247
|
});
|
|
301
248
|
}
|
|
302
249
|
static fromFields(fields) {
|
|
303
250
|
return RedeemEvent.reified().new({
|
|
304
|
-
lendingMarketId:
|
|
305
|
-
coinType:
|
|
306
|
-
reserveId:
|
|
307
|
-
ctokenAmount:
|
|
308
|
-
liquidityAmount:
|
|
251
|
+
lendingMarketId: decodeFromFields("address", fields.lending_market_id),
|
|
252
|
+
coinType: decodeFromFields(TypeName.reified(), fields.coin_type),
|
|
253
|
+
reserveId: decodeFromFields("address", fields.reserve_id),
|
|
254
|
+
ctokenAmount: decodeFromFields("u64", fields.ctoken_amount),
|
|
255
|
+
liquidityAmount: decodeFromFields("u64", fields.liquidity_amount),
|
|
309
256
|
});
|
|
310
257
|
}
|
|
311
258
|
static fromFieldsWithTypes(item) {
|
|
@@ -313,11 +260,11 @@ class RedeemEvent {
|
|
|
313
260
|
throw new Error("not a RedeemEvent type");
|
|
314
261
|
}
|
|
315
262
|
return RedeemEvent.reified().new({
|
|
316
|
-
lendingMarketId:
|
|
317
|
-
coinType:
|
|
318
|
-
reserveId:
|
|
319
|
-
ctokenAmount:
|
|
320
|
-
liquidityAmount:
|
|
263
|
+
lendingMarketId: decodeFromFieldsWithTypes("address", item.fields.lending_market_id),
|
|
264
|
+
coinType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.coin_type),
|
|
265
|
+
reserveId: decodeFromFieldsWithTypes("address", item.fields.reserve_id),
|
|
266
|
+
ctokenAmount: decodeFromFieldsWithTypes("u64", item.fields.ctoken_amount),
|
|
267
|
+
liquidityAmount: decodeFromFieldsWithTypes("u64", item.fields.liquidity_amount),
|
|
321
268
|
});
|
|
322
269
|
}
|
|
323
270
|
static fromBcs(data) {
|
|
@@ -337,11 +284,11 @@ class RedeemEvent {
|
|
|
337
284
|
}
|
|
338
285
|
static fromJSONField(field) {
|
|
339
286
|
return RedeemEvent.reified().new({
|
|
340
|
-
lendingMarketId:
|
|
341
|
-
coinType:
|
|
342
|
-
reserveId:
|
|
343
|
-
ctokenAmount:
|
|
344
|
-
liquidityAmount:
|
|
287
|
+
lendingMarketId: decodeFromJSONField("address", field.lendingMarketId),
|
|
288
|
+
coinType: decodeFromJSONField(TypeName.reified(), field.coinType),
|
|
289
|
+
reserveId: decodeFromJSONField("address", field.reserveId),
|
|
290
|
+
ctokenAmount: decodeFromJSONField("u64", field.ctokenAmount),
|
|
291
|
+
liquidityAmount: decodeFromJSONField("u64", field.liquidityAmount),
|
|
345
292
|
});
|
|
346
293
|
}
|
|
347
294
|
static fromJSON(json) {
|
|
@@ -364,7 +311,7 @@ class RedeemEvent {
|
|
|
364
311
|
if (data.bcs.dataType !== "moveObject" || !isRedeemEvent(data.bcs.type)) {
|
|
365
312
|
throw new Error(`object at is not a RedeemEvent object`);
|
|
366
313
|
}
|
|
367
|
-
return RedeemEvent.fromBcs((
|
|
314
|
+
return RedeemEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
368
315
|
}
|
|
369
316
|
if (data.content) {
|
|
370
317
|
return RedeemEvent.fromSuiParsedData(data.content);
|
|
@@ -386,21 +333,20 @@ class RedeemEvent {
|
|
|
386
333
|
});
|
|
387
334
|
}
|
|
388
335
|
}
|
|
389
|
-
|
|
390
|
-
RedeemEvent.$typeName = `${index_1.PKG_V1}::lending_market::RedeemEvent`;
|
|
336
|
+
RedeemEvent.$typeName = `${PKG_V1}::lending_market::RedeemEvent`;
|
|
391
337
|
RedeemEvent.$numTypeParams = 0;
|
|
392
338
|
RedeemEvent.$isPhantom = [];
|
|
393
339
|
/* ============================== BorrowEvent =============================== */
|
|
394
|
-
function isBorrowEvent(type) {
|
|
395
|
-
type =
|
|
396
|
-
return type === `${
|
|
340
|
+
export function isBorrowEvent(type) {
|
|
341
|
+
type = compressSuiType(type);
|
|
342
|
+
return type === `${PKG_V1}::lending_market::BorrowEvent`;
|
|
397
343
|
}
|
|
398
|
-
class BorrowEvent {
|
|
344
|
+
export class BorrowEvent {
|
|
399
345
|
constructor(typeArgs, fields) {
|
|
400
346
|
this.__StructClass = true;
|
|
401
347
|
this.$typeName = BorrowEvent.$typeName;
|
|
402
348
|
this.$isPhantom = BorrowEvent.$isPhantom;
|
|
403
|
-
this.$fullTypeName =
|
|
349
|
+
this.$fullTypeName = composeSuiType(BorrowEvent.$typeName, ...typeArgs);
|
|
404
350
|
this.$typeArgs = typeArgs;
|
|
405
351
|
this.lendingMarketId = fields.lendingMarketId;
|
|
406
352
|
this.coinType = fields.coinType;
|
|
@@ -412,7 +358,7 @@ class BorrowEvent {
|
|
|
412
358
|
static reified() {
|
|
413
359
|
return {
|
|
414
360
|
typeName: BorrowEvent.$typeName,
|
|
415
|
-
fullTypeName:
|
|
361
|
+
fullTypeName: composeSuiType(BorrowEvent.$typeName, ...[]),
|
|
416
362
|
typeArgs: [],
|
|
417
363
|
isPhantom: BorrowEvent.$isPhantom,
|
|
418
364
|
reifiedTypeArgs: [],
|
|
@@ -435,44 +381,44 @@ class BorrowEvent {
|
|
|
435
381
|
return BorrowEvent.reified();
|
|
436
382
|
}
|
|
437
383
|
static phantom() {
|
|
438
|
-
return
|
|
384
|
+
return phantom(BorrowEvent.reified());
|
|
439
385
|
}
|
|
440
386
|
static get p() {
|
|
441
387
|
return BorrowEvent.phantom();
|
|
442
388
|
}
|
|
443
389
|
static get bcs() {
|
|
444
|
-
return
|
|
445
|
-
lending_market_id:
|
|
390
|
+
return bcs.struct("BorrowEvent", {
|
|
391
|
+
lending_market_id: bcs
|
|
446
392
|
.bytes(32)
|
|
447
393
|
.transform({
|
|
448
|
-
input: (val) => (
|
|
449
|
-
output: (val) => (
|
|
394
|
+
input: (val) => fromHex(val),
|
|
395
|
+
output: (val) => toHex(val),
|
|
450
396
|
}),
|
|
451
|
-
coin_type:
|
|
452
|
-
reserve_id:
|
|
397
|
+
coin_type: TypeName.bcs,
|
|
398
|
+
reserve_id: bcs
|
|
453
399
|
.bytes(32)
|
|
454
400
|
.transform({
|
|
455
|
-
input: (val) => (
|
|
456
|
-
output: (val) => (
|
|
401
|
+
input: (val) => fromHex(val),
|
|
402
|
+
output: (val) => toHex(val),
|
|
457
403
|
}),
|
|
458
|
-
obligation_id:
|
|
404
|
+
obligation_id: bcs
|
|
459
405
|
.bytes(32)
|
|
460
406
|
.transform({
|
|
461
|
-
input: (val) => (
|
|
462
|
-
output: (val) => (
|
|
407
|
+
input: (val) => fromHex(val),
|
|
408
|
+
output: (val) => toHex(val),
|
|
463
409
|
}),
|
|
464
|
-
liquidity_amount:
|
|
465
|
-
origination_fee_amount:
|
|
410
|
+
liquidity_amount: bcs.u64(),
|
|
411
|
+
origination_fee_amount: bcs.u64(),
|
|
466
412
|
});
|
|
467
413
|
}
|
|
468
414
|
static fromFields(fields) {
|
|
469
415
|
return BorrowEvent.reified().new({
|
|
470
|
-
lendingMarketId:
|
|
471
|
-
coinType:
|
|
472
|
-
reserveId:
|
|
473
|
-
obligationId:
|
|
474
|
-
liquidityAmount:
|
|
475
|
-
originationFeeAmount:
|
|
416
|
+
lendingMarketId: decodeFromFields("address", fields.lending_market_id),
|
|
417
|
+
coinType: decodeFromFields(TypeName.reified(), fields.coin_type),
|
|
418
|
+
reserveId: decodeFromFields("address", fields.reserve_id),
|
|
419
|
+
obligationId: decodeFromFields("address", fields.obligation_id),
|
|
420
|
+
liquidityAmount: decodeFromFields("u64", fields.liquidity_amount),
|
|
421
|
+
originationFeeAmount: decodeFromFields("u64", fields.origination_fee_amount),
|
|
476
422
|
});
|
|
477
423
|
}
|
|
478
424
|
static fromFieldsWithTypes(item) {
|
|
@@ -480,12 +426,12 @@ class BorrowEvent {
|
|
|
480
426
|
throw new Error("not a BorrowEvent type");
|
|
481
427
|
}
|
|
482
428
|
return BorrowEvent.reified().new({
|
|
483
|
-
lendingMarketId:
|
|
484
|
-
coinType:
|
|
485
|
-
reserveId:
|
|
486
|
-
obligationId:
|
|
487
|
-
liquidityAmount:
|
|
488
|
-
originationFeeAmount:
|
|
429
|
+
lendingMarketId: decodeFromFieldsWithTypes("address", item.fields.lending_market_id),
|
|
430
|
+
coinType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.coin_type),
|
|
431
|
+
reserveId: decodeFromFieldsWithTypes("address", item.fields.reserve_id),
|
|
432
|
+
obligationId: decodeFromFieldsWithTypes("address", item.fields.obligation_id),
|
|
433
|
+
liquidityAmount: decodeFromFieldsWithTypes("u64", item.fields.liquidity_amount),
|
|
434
|
+
originationFeeAmount: decodeFromFieldsWithTypes("u64", item.fields.origination_fee_amount),
|
|
489
435
|
});
|
|
490
436
|
}
|
|
491
437
|
static fromBcs(data) {
|
|
@@ -506,12 +452,12 @@ class BorrowEvent {
|
|
|
506
452
|
}
|
|
507
453
|
static fromJSONField(field) {
|
|
508
454
|
return BorrowEvent.reified().new({
|
|
509
|
-
lendingMarketId:
|
|
510
|
-
coinType:
|
|
511
|
-
reserveId:
|
|
512
|
-
obligationId:
|
|
513
|
-
liquidityAmount:
|
|
514
|
-
originationFeeAmount:
|
|
455
|
+
lendingMarketId: decodeFromJSONField("address", field.lendingMarketId),
|
|
456
|
+
coinType: decodeFromJSONField(TypeName.reified(), field.coinType),
|
|
457
|
+
reserveId: decodeFromJSONField("address", field.reserveId),
|
|
458
|
+
obligationId: decodeFromJSONField("address", field.obligationId),
|
|
459
|
+
liquidityAmount: decodeFromJSONField("u64", field.liquidityAmount),
|
|
460
|
+
originationFeeAmount: decodeFromJSONField("u64", field.originationFeeAmount),
|
|
515
461
|
});
|
|
516
462
|
}
|
|
517
463
|
static fromJSON(json) {
|
|
@@ -534,7 +480,7 @@ class BorrowEvent {
|
|
|
534
480
|
if (data.bcs.dataType !== "moveObject" || !isBorrowEvent(data.bcs.type)) {
|
|
535
481
|
throw new Error(`object at is not a BorrowEvent object`);
|
|
536
482
|
}
|
|
537
|
-
return BorrowEvent.fromBcs((
|
|
483
|
+
return BorrowEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
538
484
|
}
|
|
539
485
|
if (data.content) {
|
|
540
486
|
return BorrowEvent.fromSuiParsedData(data.content);
|
|
@@ -556,21 +502,20 @@ class BorrowEvent {
|
|
|
556
502
|
});
|
|
557
503
|
}
|
|
558
504
|
}
|
|
559
|
-
|
|
560
|
-
BorrowEvent.$typeName = `${index_1.PKG_V1}::lending_market::BorrowEvent`;
|
|
505
|
+
BorrowEvent.$typeName = `${PKG_V1}::lending_market::BorrowEvent`;
|
|
561
506
|
BorrowEvent.$numTypeParams = 0;
|
|
562
507
|
BorrowEvent.$isPhantom = [];
|
|
563
508
|
/* ============================== ClaimRewardEvent =============================== */
|
|
564
|
-
function isClaimRewardEvent(type) {
|
|
565
|
-
type =
|
|
566
|
-
return type === `${
|
|
509
|
+
export function isClaimRewardEvent(type) {
|
|
510
|
+
type = compressSuiType(type);
|
|
511
|
+
return type === `${PKG_V1}::lending_market::ClaimRewardEvent`;
|
|
567
512
|
}
|
|
568
|
-
class ClaimRewardEvent {
|
|
513
|
+
export class ClaimRewardEvent {
|
|
569
514
|
constructor(typeArgs, fields) {
|
|
570
515
|
this.__StructClass = true;
|
|
571
516
|
this.$typeName = ClaimRewardEvent.$typeName;
|
|
572
517
|
this.$isPhantom = ClaimRewardEvent.$isPhantom;
|
|
573
|
-
this.$fullTypeName =
|
|
518
|
+
this.$fullTypeName = composeSuiType(ClaimRewardEvent.$typeName, ...typeArgs);
|
|
574
519
|
this.$typeArgs = typeArgs;
|
|
575
520
|
this.lendingMarketId = fields.lendingMarketId;
|
|
576
521
|
this.reserveId = fields.reserveId;
|
|
@@ -583,7 +528,7 @@ class ClaimRewardEvent {
|
|
|
583
528
|
static reified() {
|
|
584
529
|
return {
|
|
585
530
|
typeName: ClaimRewardEvent.$typeName,
|
|
586
|
-
fullTypeName:
|
|
531
|
+
fullTypeName: composeSuiType(ClaimRewardEvent.$typeName, ...[]),
|
|
587
532
|
typeArgs: [],
|
|
588
533
|
isPhantom: ClaimRewardEvent.$isPhantom,
|
|
589
534
|
reifiedTypeArgs: [],
|
|
@@ -606,51 +551,51 @@ class ClaimRewardEvent {
|
|
|
606
551
|
return ClaimRewardEvent.reified();
|
|
607
552
|
}
|
|
608
553
|
static phantom() {
|
|
609
|
-
return
|
|
554
|
+
return phantom(ClaimRewardEvent.reified());
|
|
610
555
|
}
|
|
611
556
|
static get p() {
|
|
612
557
|
return ClaimRewardEvent.phantom();
|
|
613
558
|
}
|
|
614
559
|
static get bcs() {
|
|
615
|
-
return
|
|
616
|
-
lending_market_id:
|
|
560
|
+
return bcs.struct("ClaimRewardEvent", {
|
|
561
|
+
lending_market_id: bcs
|
|
617
562
|
.bytes(32)
|
|
618
563
|
.transform({
|
|
619
|
-
input: (val) => (
|
|
620
|
-
output: (val) => (
|
|
564
|
+
input: (val) => fromHex(val),
|
|
565
|
+
output: (val) => toHex(val),
|
|
621
566
|
}),
|
|
622
|
-
reserve_id:
|
|
567
|
+
reserve_id: bcs
|
|
623
568
|
.bytes(32)
|
|
624
569
|
.transform({
|
|
625
|
-
input: (val) => (
|
|
626
|
-
output: (val) => (
|
|
570
|
+
input: (val) => fromHex(val),
|
|
571
|
+
output: (val) => toHex(val),
|
|
627
572
|
}),
|
|
628
|
-
obligation_id:
|
|
573
|
+
obligation_id: bcs
|
|
629
574
|
.bytes(32)
|
|
630
575
|
.transform({
|
|
631
|
-
input: (val) => (
|
|
632
|
-
output: (val) => (
|
|
576
|
+
input: (val) => fromHex(val),
|
|
577
|
+
output: (val) => toHex(val),
|
|
633
578
|
}),
|
|
634
|
-
is_deposit_reward:
|
|
635
|
-
pool_reward_id:
|
|
579
|
+
is_deposit_reward: bcs.bool(),
|
|
580
|
+
pool_reward_id: bcs
|
|
636
581
|
.bytes(32)
|
|
637
582
|
.transform({
|
|
638
|
-
input: (val) => (
|
|
639
|
-
output: (val) => (
|
|
583
|
+
input: (val) => fromHex(val),
|
|
584
|
+
output: (val) => toHex(val),
|
|
640
585
|
}),
|
|
641
|
-
coin_type:
|
|
642
|
-
liquidity_amount:
|
|
586
|
+
coin_type: TypeName.bcs,
|
|
587
|
+
liquidity_amount: bcs.u64(),
|
|
643
588
|
});
|
|
644
589
|
}
|
|
645
590
|
static fromFields(fields) {
|
|
646
591
|
return ClaimRewardEvent.reified().new({
|
|
647
|
-
lendingMarketId:
|
|
648
|
-
reserveId:
|
|
649
|
-
obligationId:
|
|
650
|
-
isDepositReward:
|
|
651
|
-
poolRewardId:
|
|
652
|
-
coinType:
|
|
653
|
-
liquidityAmount:
|
|
592
|
+
lendingMarketId: decodeFromFields("address", fields.lending_market_id),
|
|
593
|
+
reserveId: decodeFromFields("address", fields.reserve_id),
|
|
594
|
+
obligationId: decodeFromFields("address", fields.obligation_id),
|
|
595
|
+
isDepositReward: decodeFromFields("bool", fields.is_deposit_reward),
|
|
596
|
+
poolRewardId: decodeFromFields("address", fields.pool_reward_id),
|
|
597
|
+
coinType: decodeFromFields(TypeName.reified(), fields.coin_type),
|
|
598
|
+
liquidityAmount: decodeFromFields("u64", fields.liquidity_amount),
|
|
654
599
|
});
|
|
655
600
|
}
|
|
656
601
|
static fromFieldsWithTypes(item) {
|
|
@@ -658,13 +603,13 @@ class ClaimRewardEvent {
|
|
|
658
603
|
throw new Error("not a ClaimRewardEvent type");
|
|
659
604
|
}
|
|
660
605
|
return ClaimRewardEvent.reified().new({
|
|
661
|
-
lendingMarketId:
|
|
662
|
-
reserveId:
|
|
663
|
-
obligationId:
|
|
664
|
-
isDepositReward:
|
|
665
|
-
poolRewardId:
|
|
666
|
-
coinType:
|
|
667
|
-
liquidityAmount:
|
|
606
|
+
lendingMarketId: decodeFromFieldsWithTypes("address", item.fields.lending_market_id),
|
|
607
|
+
reserveId: decodeFromFieldsWithTypes("address", item.fields.reserve_id),
|
|
608
|
+
obligationId: decodeFromFieldsWithTypes("address", item.fields.obligation_id),
|
|
609
|
+
isDepositReward: decodeFromFieldsWithTypes("bool", item.fields.is_deposit_reward),
|
|
610
|
+
poolRewardId: decodeFromFieldsWithTypes("address", item.fields.pool_reward_id),
|
|
611
|
+
coinType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.coin_type),
|
|
612
|
+
liquidityAmount: decodeFromFieldsWithTypes("u64", item.fields.liquidity_amount),
|
|
668
613
|
});
|
|
669
614
|
}
|
|
670
615
|
static fromBcs(data) {
|
|
@@ -686,13 +631,13 @@ class ClaimRewardEvent {
|
|
|
686
631
|
}
|
|
687
632
|
static fromJSONField(field) {
|
|
688
633
|
return ClaimRewardEvent.reified().new({
|
|
689
|
-
lendingMarketId:
|
|
690
|
-
reserveId:
|
|
691
|
-
obligationId:
|
|
692
|
-
isDepositReward:
|
|
693
|
-
poolRewardId:
|
|
694
|
-
coinType:
|
|
695
|
-
liquidityAmount:
|
|
634
|
+
lendingMarketId: decodeFromJSONField("address", field.lendingMarketId),
|
|
635
|
+
reserveId: decodeFromJSONField("address", field.reserveId),
|
|
636
|
+
obligationId: decodeFromJSONField("address", field.obligationId),
|
|
637
|
+
isDepositReward: decodeFromJSONField("bool", field.isDepositReward),
|
|
638
|
+
poolRewardId: decodeFromJSONField("address", field.poolRewardId),
|
|
639
|
+
coinType: decodeFromJSONField(TypeName.reified(), field.coinType),
|
|
640
|
+
liquidityAmount: decodeFromJSONField("u64", field.liquidityAmount),
|
|
696
641
|
});
|
|
697
642
|
}
|
|
698
643
|
static fromJSON(json) {
|
|
@@ -716,7 +661,7 @@ class ClaimRewardEvent {
|
|
|
716
661
|
!isClaimRewardEvent(data.bcs.type)) {
|
|
717
662
|
throw new Error(`object at is not a ClaimRewardEvent object`);
|
|
718
663
|
}
|
|
719
|
-
return ClaimRewardEvent.fromBcs((
|
|
664
|
+
return ClaimRewardEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
720
665
|
}
|
|
721
666
|
if (data.content) {
|
|
722
667
|
return ClaimRewardEvent.fromSuiParsedData(data.content);
|
|
@@ -738,21 +683,20 @@ class ClaimRewardEvent {
|
|
|
738
683
|
});
|
|
739
684
|
}
|
|
740
685
|
}
|
|
741
|
-
|
|
742
|
-
ClaimRewardEvent.$typeName = `${index_1.PKG_V1}::lending_market::ClaimRewardEvent`;
|
|
686
|
+
ClaimRewardEvent.$typeName = `${PKG_V1}::lending_market::ClaimRewardEvent`;
|
|
743
687
|
ClaimRewardEvent.$numTypeParams = 0;
|
|
744
688
|
ClaimRewardEvent.$isPhantom = [];
|
|
745
689
|
/* ============================== DepositEvent =============================== */
|
|
746
|
-
function isDepositEvent(type) {
|
|
747
|
-
type =
|
|
748
|
-
return type === `${
|
|
690
|
+
export function isDepositEvent(type) {
|
|
691
|
+
type = compressSuiType(type);
|
|
692
|
+
return type === `${PKG_V1}::lending_market::DepositEvent`;
|
|
749
693
|
}
|
|
750
|
-
class DepositEvent {
|
|
694
|
+
export class DepositEvent {
|
|
751
695
|
constructor(typeArgs, fields) {
|
|
752
696
|
this.__StructClass = true;
|
|
753
697
|
this.$typeName = DepositEvent.$typeName;
|
|
754
698
|
this.$isPhantom = DepositEvent.$isPhantom;
|
|
755
|
-
this.$fullTypeName =
|
|
699
|
+
this.$fullTypeName = composeSuiType(DepositEvent.$typeName, ...typeArgs);
|
|
756
700
|
this.$typeArgs = typeArgs;
|
|
757
701
|
this.lendingMarketId = fields.lendingMarketId;
|
|
758
702
|
this.coinType = fields.coinType;
|
|
@@ -763,7 +707,7 @@ class DepositEvent {
|
|
|
763
707
|
static reified() {
|
|
764
708
|
return {
|
|
765
709
|
typeName: DepositEvent.$typeName,
|
|
766
|
-
fullTypeName:
|
|
710
|
+
fullTypeName: composeSuiType(DepositEvent.$typeName, ...[]),
|
|
767
711
|
typeArgs: [],
|
|
768
712
|
isPhantom: DepositEvent.$isPhantom,
|
|
769
713
|
reifiedTypeArgs: [],
|
|
@@ -786,42 +730,42 @@ class DepositEvent {
|
|
|
786
730
|
return DepositEvent.reified();
|
|
787
731
|
}
|
|
788
732
|
static phantom() {
|
|
789
|
-
return
|
|
733
|
+
return phantom(DepositEvent.reified());
|
|
790
734
|
}
|
|
791
735
|
static get p() {
|
|
792
736
|
return DepositEvent.phantom();
|
|
793
737
|
}
|
|
794
738
|
static get bcs() {
|
|
795
|
-
return
|
|
796
|
-
lending_market_id:
|
|
739
|
+
return bcs.struct("DepositEvent", {
|
|
740
|
+
lending_market_id: bcs
|
|
797
741
|
.bytes(32)
|
|
798
742
|
.transform({
|
|
799
|
-
input: (val) => (
|
|
800
|
-
output: (val) => (
|
|
743
|
+
input: (val) => fromHex(val),
|
|
744
|
+
output: (val) => toHex(val),
|
|
801
745
|
}),
|
|
802
|
-
coin_type:
|
|
803
|
-
reserve_id:
|
|
746
|
+
coin_type: TypeName.bcs,
|
|
747
|
+
reserve_id: bcs
|
|
804
748
|
.bytes(32)
|
|
805
749
|
.transform({
|
|
806
|
-
input: (val) => (
|
|
807
|
-
output: (val) => (
|
|
750
|
+
input: (val) => fromHex(val),
|
|
751
|
+
output: (val) => toHex(val),
|
|
808
752
|
}),
|
|
809
|
-
obligation_id:
|
|
753
|
+
obligation_id: bcs
|
|
810
754
|
.bytes(32)
|
|
811
755
|
.transform({
|
|
812
|
-
input: (val) => (
|
|
813
|
-
output: (val) => (
|
|
756
|
+
input: (val) => fromHex(val),
|
|
757
|
+
output: (val) => toHex(val),
|
|
814
758
|
}),
|
|
815
|
-
ctoken_amount:
|
|
759
|
+
ctoken_amount: bcs.u64(),
|
|
816
760
|
});
|
|
817
761
|
}
|
|
818
762
|
static fromFields(fields) {
|
|
819
763
|
return DepositEvent.reified().new({
|
|
820
|
-
lendingMarketId:
|
|
821
|
-
coinType:
|
|
822
|
-
reserveId:
|
|
823
|
-
obligationId:
|
|
824
|
-
ctokenAmount:
|
|
764
|
+
lendingMarketId: decodeFromFields("address", fields.lending_market_id),
|
|
765
|
+
coinType: decodeFromFields(TypeName.reified(), fields.coin_type),
|
|
766
|
+
reserveId: decodeFromFields("address", fields.reserve_id),
|
|
767
|
+
obligationId: decodeFromFields("address", fields.obligation_id),
|
|
768
|
+
ctokenAmount: decodeFromFields("u64", fields.ctoken_amount),
|
|
825
769
|
});
|
|
826
770
|
}
|
|
827
771
|
static fromFieldsWithTypes(item) {
|
|
@@ -829,11 +773,11 @@ class DepositEvent {
|
|
|
829
773
|
throw new Error("not a DepositEvent type");
|
|
830
774
|
}
|
|
831
775
|
return DepositEvent.reified().new({
|
|
832
|
-
lendingMarketId:
|
|
833
|
-
coinType:
|
|
834
|
-
reserveId:
|
|
835
|
-
obligationId:
|
|
836
|
-
ctokenAmount:
|
|
776
|
+
lendingMarketId: decodeFromFieldsWithTypes("address", item.fields.lending_market_id),
|
|
777
|
+
coinType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.coin_type),
|
|
778
|
+
reserveId: decodeFromFieldsWithTypes("address", item.fields.reserve_id),
|
|
779
|
+
obligationId: decodeFromFieldsWithTypes("address", item.fields.obligation_id),
|
|
780
|
+
ctokenAmount: decodeFromFieldsWithTypes("u64", item.fields.ctoken_amount),
|
|
837
781
|
});
|
|
838
782
|
}
|
|
839
783
|
static fromBcs(data) {
|
|
@@ -853,11 +797,11 @@ class DepositEvent {
|
|
|
853
797
|
}
|
|
854
798
|
static fromJSONField(field) {
|
|
855
799
|
return DepositEvent.reified().new({
|
|
856
|
-
lendingMarketId:
|
|
857
|
-
coinType:
|
|
858
|
-
reserveId:
|
|
859
|
-
obligationId:
|
|
860
|
-
ctokenAmount:
|
|
800
|
+
lendingMarketId: decodeFromJSONField("address", field.lendingMarketId),
|
|
801
|
+
coinType: decodeFromJSONField(TypeName.reified(), field.coinType),
|
|
802
|
+
reserveId: decodeFromJSONField("address", field.reserveId),
|
|
803
|
+
obligationId: decodeFromJSONField("address", field.obligationId),
|
|
804
|
+
ctokenAmount: decodeFromJSONField("u64", field.ctokenAmount),
|
|
861
805
|
});
|
|
862
806
|
}
|
|
863
807
|
static fromJSON(json) {
|
|
@@ -881,7 +825,7 @@ class DepositEvent {
|
|
|
881
825
|
!isDepositEvent(data.bcs.type)) {
|
|
882
826
|
throw new Error(`object at is not a DepositEvent object`);
|
|
883
827
|
}
|
|
884
|
-
return DepositEvent.fromBcs((
|
|
828
|
+
return DepositEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
885
829
|
}
|
|
886
830
|
if (data.content) {
|
|
887
831
|
return DepositEvent.fromSuiParsedData(data.content);
|
|
@@ -903,21 +847,20 @@ class DepositEvent {
|
|
|
903
847
|
});
|
|
904
848
|
}
|
|
905
849
|
}
|
|
906
|
-
|
|
907
|
-
DepositEvent.$typeName = `${index_1.PKG_V1}::lending_market::DepositEvent`;
|
|
850
|
+
DepositEvent.$typeName = `${PKG_V1}::lending_market::DepositEvent`;
|
|
908
851
|
DepositEvent.$numTypeParams = 0;
|
|
909
852
|
DepositEvent.$isPhantom = [];
|
|
910
853
|
/* ============================== FeeReceivers =============================== */
|
|
911
|
-
function isFeeReceivers(type) {
|
|
912
|
-
type =
|
|
913
|
-
return type === `${
|
|
854
|
+
export function isFeeReceivers(type) {
|
|
855
|
+
type = compressSuiType(type);
|
|
856
|
+
return type === `${PKG_V10}::lending_market::FeeReceivers`;
|
|
914
857
|
}
|
|
915
|
-
class FeeReceivers {
|
|
858
|
+
export class FeeReceivers {
|
|
916
859
|
constructor(typeArgs, fields) {
|
|
917
860
|
this.__StructClass = true;
|
|
918
861
|
this.$typeName = FeeReceivers.$typeName;
|
|
919
862
|
this.$isPhantom = FeeReceivers.$isPhantom;
|
|
920
|
-
this.$fullTypeName =
|
|
863
|
+
this.$fullTypeName = composeSuiType(FeeReceivers.$typeName, ...typeArgs);
|
|
921
864
|
this.$typeArgs = typeArgs;
|
|
922
865
|
this.receivers = fields.receivers;
|
|
923
866
|
this.weights = fields.weights;
|
|
@@ -926,7 +869,7 @@ class FeeReceivers {
|
|
|
926
869
|
static reified() {
|
|
927
870
|
return {
|
|
928
871
|
typeName: FeeReceivers.$typeName,
|
|
929
|
-
fullTypeName:
|
|
872
|
+
fullTypeName: composeSuiType(FeeReceivers.$typeName, ...[]),
|
|
930
873
|
typeArgs: [],
|
|
931
874
|
isPhantom: FeeReceivers.$isPhantom,
|
|
932
875
|
reifiedTypeArgs: [],
|
|
@@ -949,28 +892,28 @@ class FeeReceivers {
|
|
|
949
892
|
return FeeReceivers.reified();
|
|
950
893
|
}
|
|
951
894
|
static phantom() {
|
|
952
|
-
return
|
|
895
|
+
return phantom(FeeReceivers.reified());
|
|
953
896
|
}
|
|
954
897
|
static get p() {
|
|
955
898
|
return FeeReceivers.phantom();
|
|
956
899
|
}
|
|
957
900
|
static get bcs() {
|
|
958
|
-
return
|
|
959
|
-
receivers:
|
|
901
|
+
return bcs.struct("FeeReceivers", {
|
|
902
|
+
receivers: bcs.vector(bcs
|
|
960
903
|
.bytes(32)
|
|
961
904
|
.transform({
|
|
962
|
-
input: (val) => (
|
|
963
|
-
output: (val) => (
|
|
905
|
+
input: (val) => fromHex(val),
|
|
906
|
+
output: (val) => toHex(val),
|
|
964
907
|
})),
|
|
965
|
-
weights:
|
|
966
|
-
total_weight:
|
|
908
|
+
weights: bcs.vector(bcs.u64()),
|
|
909
|
+
total_weight: bcs.u64(),
|
|
967
910
|
});
|
|
968
911
|
}
|
|
969
912
|
static fromFields(fields) {
|
|
970
913
|
return FeeReceivers.reified().new({
|
|
971
|
-
receivers:
|
|
972
|
-
weights:
|
|
973
|
-
totalWeight:
|
|
914
|
+
receivers: decodeFromFields(reified.vector("address"), fields.receivers),
|
|
915
|
+
weights: decodeFromFields(reified.vector("u64"), fields.weights),
|
|
916
|
+
totalWeight: decodeFromFields("u64", fields.total_weight),
|
|
974
917
|
});
|
|
975
918
|
}
|
|
976
919
|
static fromFieldsWithTypes(item) {
|
|
@@ -978,9 +921,9 @@ class FeeReceivers {
|
|
|
978
921
|
throw new Error("not a FeeReceivers type");
|
|
979
922
|
}
|
|
980
923
|
return FeeReceivers.reified().new({
|
|
981
|
-
receivers:
|
|
982
|
-
weights:
|
|
983
|
-
totalWeight:
|
|
924
|
+
receivers: decodeFromFieldsWithTypes(reified.vector("address"), item.fields.receivers),
|
|
925
|
+
weights: decodeFromFieldsWithTypes(reified.vector("u64"), item.fields.weights),
|
|
926
|
+
totalWeight: decodeFromFieldsWithTypes("u64", item.fields.total_weight),
|
|
984
927
|
});
|
|
985
928
|
}
|
|
986
929
|
static fromBcs(data) {
|
|
@@ -988,8 +931,8 @@ class FeeReceivers {
|
|
|
988
931
|
}
|
|
989
932
|
toJSONField() {
|
|
990
933
|
return {
|
|
991
|
-
receivers:
|
|
992
|
-
weights:
|
|
934
|
+
receivers: fieldToJSON(`vector<address>`, this.receivers),
|
|
935
|
+
weights: fieldToJSON(`vector<u64>`, this.weights),
|
|
993
936
|
totalWeight: this.totalWeight.toString(),
|
|
994
937
|
};
|
|
995
938
|
}
|
|
@@ -998,9 +941,9 @@ class FeeReceivers {
|
|
|
998
941
|
}
|
|
999
942
|
static fromJSONField(field) {
|
|
1000
943
|
return FeeReceivers.reified().new({
|
|
1001
|
-
receivers:
|
|
1002
|
-
weights:
|
|
1003
|
-
totalWeight:
|
|
944
|
+
receivers: decodeFromJSONField(reified.vector("address"), field.receivers),
|
|
945
|
+
weights: decodeFromJSONField(reified.vector("u64"), field.weights),
|
|
946
|
+
totalWeight: decodeFromJSONField("u64", field.totalWeight),
|
|
1004
947
|
});
|
|
1005
948
|
}
|
|
1006
949
|
static fromJSON(json) {
|
|
@@ -1024,7 +967,7 @@ class FeeReceivers {
|
|
|
1024
967
|
!isFeeReceivers(data.bcs.type)) {
|
|
1025
968
|
throw new Error(`object at is not a FeeReceivers object`);
|
|
1026
969
|
}
|
|
1027
|
-
return FeeReceivers.fromBcs((
|
|
970
|
+
return FeeReceivers.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
1028
971
|
}
|
|
1029
972
|
if (data.content) {
|
|
1030
973
|
return FeeReceivers.fromSuiParsedData(data.content);
|
|
@@ -1046,28 +989,27 @@ class FeeReceivers {
|
|
|
1046
989
|
});
|
|
1047
990
|
}
|
|
1048
991
|
}
|
|
1049
|
-
|
|
1050
|
-
FeeReceivers.$typeName = `${index_1.PKG_V10}::lending_market::FeeReceivers`;
|
|
992
|
+
FeeReceivers.$typeName = `${PKG_V10}::lending_market::FeeReceivers`;
|
|
1051
993
|
FeeReceivers.$numTypeParams = 0;
|
|
1052
994
|
FeeReceivers.$isPhantom = [];
|
|
1053
995
|
/* ============================== FeeReceiversKey =============================== */
|
|
1054
|
-
function isFeeReceiversKey(type) {
|
|
1055
|
-
type =
|
|
1056
|
-
return type === `${
|
|
996
|
+
export function isFeeReceiversKey(type) {
|
|
997
|
+
type = compressSuiType(type);
|
|
998
|
+
return type === `${PKG_V10}::lending_market::FeeReceiversKey`;
|
|
1057
999
|
}
|
|
1058
|
-
class FeeReceiversKey {
|
|
1000
|
+
export class FeeReceiversKey {
|
|
1059
1001
|
constructor(typeArgs, fields) {
|
|
1060
1002
|
this.__StructClass = true;
|
|
1061
1003
|
this.$typeName = FeeReceiversKey.$typeName;
|
|
1062
1004
|
this.$isPhantom = FeeReceiversKey.$isPhantom;
|
|
1063
|
-
this.$fullTypeName =
|
|
1005
|
+
this.$fullTypeName = composeSuiType(FeeReceiversKey.$typeName, ...typeArgs);
|
|
1064
1006
|
this.$typeArgs = typeArgs;
|
|
1065
1007
|
this.dummyField = fields.dummyField;
|
|
1066
1008
|
}
|
|
1067
1009
|
static reified() {
|
|
1068
1010
|
return {
|
|
1069
1011
|
typeName: FeeReceiversKey.$typeName,
|
|
1070
|
-
fullTypeName:
|
|
1012
|
+
fullTypeName: composeSuiType(FeeReceiversKey.$typeName, ...[]),
|
|
1071
1013
|
typeArgs: [],
|
|
1072
1014
|
isPhantom: FeeReceiversKey.$isPhantom,
|
|
1073
1015
|
reifiedTypeArgs: [],
|
|
@@ -1090,19 +1032,19 @@ class FeeReceiversKey {
|
|
|
1090
1032
|
return FeeReceiversKey.reified();
|
|
1091
1033
|
}
|
|
1092
1034
|
static phantom() {
|
|
1093
|
-
return
|
|
1035
|
+
return phantom(FeeReceiversKey.reified());
|
|
1094
1036
|
}
|
|
1095
1037
|
static get p() {
|
|
1096
1038
|
return FeeReceiversKey.phantom();
|
|
1097
1039
|
}
|
|
1098
1040
|
static get bcs() {
|
|
1099
|
-
return
|
|
1100
|
-
dummy_field:
|
|
1041
|
+
return bcs.struct("FeeReceiversKey", {
|
|
1042
|
+
dummy_field: bcs.bool(),
|
|
1101
1043
|
});
|
|
1102
1044
|
}
|
|
1103
1045
|
static fromFields(fields) {
|
|
1104
1046
|
return FeeReceiversKey.reified().new({
|
|
1105
|
-
dummyField:
|
|
1047
|
+
dummyField: decodeFromFields("bool", fields.dummy_field),
|
|
1106
1048
|
});
|
|
1107
1049
|
}
|
|
1108
1050
|
static fromFieldsWithTypes(item) {
|
|
@@ -1110,7 +1052,7 @@ class FeeReceiversKey {
|
|
|
1110
1052
|
throw new Error("not a FeeReceiversKey type");
|
|
1111
1053
|
}
|
|
1112
1054
|
return FeeReceiversKey.reified().new({
|
|
1113
|
-
dummyField:
|
|
1055
|
+
dummyField: decodeFromFieldsWithTypes("bool", item.fields.dummy_field),
|
|
1114
1056
|
});
|
|
1115
1057
|
}
|
|
1116
1058
|
static fromBcs(data) {
|
|
@@ -1126,7 +1068,7 @@ class FeeReceiversKey {
|
|
|
1126
1068
|
}
|
|
1127
1069
|
static fromJSONField(field) {
|
|
1128
1070
|
return FeeReceiversKey.reified().new({
|
|
1129
|
-
dummyField:
|
|
1071
|
+
dummyField: decodeFromJSONField("bool", field.dummyField),
|
|
1130
1072
|
});
|
|
1131
1073
|
}
|
|
1132
1074
|
static fromJSON(json) {
|
|
@@ -1150,7 +1092,7 @@ class FeeReceiversKey {
|
|
|
1150
1092
|
!isFeeReceiversKey(data.bcs.type)) {
|
|
1151
1093
|
throw new Error(`object at is not a FeeReceiversKey object`);
|
|
1152
1094
|
}
|
|
1153
|
-
return FeeReceiversKey.fromBcs((
|
|
1095
|
+
return FeeReceiversKey.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
1154
1096
|
}
|
|
1155
1097
|
if (data.content) {
|
|
1156
1098
|
return FeeReceiversKey.fromSuiParsedData(data.content);
|
|
@@ -1172,21 +1114,20 @@ class FeeReceiversKey {
|
|
|
1172
1114
|
});
|
|
1173
1115
|
}
|
|
1174
1116
|
}
|
|
1175
|
-
|
|
1176
|
-
FeeReceiversKey.$typeName = `${index_1.PKG_V10}::lending_market::FeeReceiversKey`;
|
|
1117
|
+
FeeReceiversKey.$typeName = `${PKG_V10}::lending_market::FeeReceiversKey`;
|
|
1177
1118
|
FeeReceiversKey.$numTypeParams = 0;
|
|
1178
1119
|
FeeReceiversKey.$isPhantom = [];
|
|
1179
1120
|
/* ============================== ForgiveEvent =============================== */
|
|
1180
|
-
function isForgiveEvent(type) {
|
|
1181
|
-
type =
|
|
1182
|
-
return type === `${
|
|
1121
|
+
export function isForgiveEvent(type) {
|
|
1122
|
+
type = compressSuiType(type);
|
|
1123
|
+
return type === `${PKG_V1}::lending_market::ForgiveEvent`;
|
|
1183
1124
|
}
|
|
1184
|
-
class ForgiveEvent {
|
|
1125
|
+
export class ForgiveEvent {
|
|
1185
1126
|
constructor(typeArgs, fields) {
|
|
1186
1127
|
this.__StructClass = true;
|
|
1187
1128
|
this.$typeName = ForgiveEvent.$typeName;
|
|
1188
1129
|
this.$isPhantom = ForgiveEvent.$isPhantom;
|
|
1189
|
-
this.$fullTypeName =
|
|
1130
|
+
this.$fullTypeName = composeSuiType(ForgiveEvent.$typeName, ...typeArgs);
|
|
1190
1131
|
this.$typeArgs = typeArgs;
|
|
1191
1132
|
this.lendingMarketId = fields.lendingMarketId;
|
|
1192
1133
|
this.coinType = fields.coinType;
|
|
@@ -1197,7 +1138,7 @@ class ForgiveEvent {
|
|
|
1197
1138
|
static reified() {
|
|
1198
1139
|
return {
|
|
1199
1140
|
typeName: ForgiveEvent.$typeName,
|
|
1200
|
-
fullTypeName:
|
|
1141
|
+
fullTypeName: composeSuiType(ForgiveEvent.$typeName, ...[]),
|
|
1201
1142
|
typeArgs: [],
|
|
1202
1143
|
isPhantom: ForgiveEvent.$isPhantom,
|
|
1203
1144
|
reifiedTypeArgs: [],
|
|
@@ -1220,42 +1161,42 @@ class ForgiveEvent {
|
|
|
1220
1161
|
return ForgiveEvent.reified();
|
|
1221
1162
|
}
|
|
1222
1163
|
static phantom() {
|
|
1223
|
-
return
|
|
1164
|
+
return phantom(ForgiveEvent.reified());
|
|
1224
1165
|
}
|
|
1225
1166
|
static get p() {
|
|
1226
1167
|
return ForgiveEvent.phantom();
|
|
1227
1168
|
}
|
|
1228
1169
|
static get bcs() {
|
|
1229
|
-
return
|
|
1230
|
-
lending_market_id:
|
|
1170
|
+
return bcs.struct("ForgiveEvent", {
|
|
1171
|
+
lending_market_id: bcs
|
|
1231
1172
|
.bytes(32)
|
|
1232
1173
|
.transform({
|
|
1233
|
-
input: (val) => (
|
|
1234
|
-
output: (val) => (
|
|
1174
|
+
input: (val) => fromHex(val),
|
|
1175
|
+
output: (val) => toHex(val),
|
|
1235
1176
|
}),
|
|
1236
|
-
coin_type:
|
|
1237
|
-
reserve_id:
|
|
1177
|
+
coin_type: TypeName.bcs,
|
|
1178
|
+
reserve_id: bcs
|
|
1238
1179
|
.bytes(32)
|
|
1239
1180
|
.transform({
|
|
1240
|
-
input: (val) => (
|
|
1241
|
-
output: (val) => (
|
|
1181
|
+
input: (val) => fromHex(val),
|
|
1182
|
+
output: (val) => toHex(val),
|
|
1242
1183
|
}),
|
|
1243
|
-
obligation_id:
|
|
1184
|
+
obligation_id: bcs
|
|
1244
1185
|
.bytes(32)
|
|
1245
1186
|
.transform({
|
|
1246
|
-
input: (val) => (
|
|
1247
|
-
output: (val) => (
|
|
1187
|
+
input: (val) => fromHex(val),
|
|
1188
|
+
output: (val) => toHex(val),
|
|
1248
1189
|
}),
|
|
1249
|
-
liquidity_amount:
|
|
1190
|
+
liquidity_amount: bcs.u64(),
|
|
1250
1191
|
});
|
|
1251
1192
|
}
|
|
1252
1193
|
static fromFields(fields) {
|
|
1253
1194
|
return ForgiveEvent.reified().new({
|
|
1254
|
-
lendingMarketId:
|
|
1255
|
-
coinType:
|
|
1256
|
-
reserveId:
|
|
1257
|
-
obligationId:
|
|
1258
|
-
liquidityAmount:
|
|
1195
|
+
lendingMarketId: decodeFromFields("address", fields.lending_market_id),
|
|
1196
|
+
coinType: decodeFromFields(TypeName.reified(), fields.coin_type),
|
|
1197
|
+
reserveId: decodeFromFields("address", fields.reserve_id),
|
|
1198
|
+
obligationId: decodeFromFields("address", fields.obligation_id),
|
|
1199
|
+
liquidityAmount: decodeFromFields("u64", fields.liquidity_amount),
|
|
1259
1200
|
});
|
|
1260
1201
|
}
|
|
1261
1202
|
static fromFieldsWithTypes(item) {
|
|
@@ -1263,11 +1204,11 @@ class ForgiveEvent {
|
|
|
1263
1204
|
throw new Error("not a ForgiveEvent type");
|
|
1264
1205
|
}
|
|
1265
1206
|
return ForgiveEvent.reified().new({
|
|
1266
|
-
lendingMarketId:
|
|
1267
|
-
coinType:
|
|
1268
|
-
reserveId:
|
|
1269
|
-
obligationId:
|
|
1270
|
-
liquidityAmount:
|
|
1207
|
+
lendingMarketId: decodeFromFieldsWithTypes("address", item.fields.lending_market_id),
|
|
1208
|
+
coinType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.coin_type),
|
|
1209
|
+
reserveId: decodeFromFieldsWithTypes("address", item.fields.reserve_id),
|
|
1210
|
+
obligationId: decodeFromFieldsWithTypes("address", item.fields.obligation_id),
|
|
1211
|
+
liquidityAmount: decodeFromFieldsWithTypes("u64", item.fields.liquidity_amount),
|
|
1271
1212
|
});
|
|
1272
1213
|
}
|
|
1273
1214
|
static fromBcs(data) {
|
|
@@ -1287,11 +1228,11 @@ class ForgiveEvent {
|
|
|
1287
1228
|
}
|
|
1288
1229
|
static fromJSONField(field) {
|
|
1289
1230
|
return ForgiveEvent.reified().new({
|
|
1290
|
-
lendingMarketId:
|
|
1291
|
-
coinType:
|
|
1292
|
-
reserveId:
|
|
1293
|
-
obligationId:
|
|
1294
|
-
liquidityAmount:
|
|
1231
|
+
lendingMarketId: decodeFromJSONField("address", field.lendingMarketId),
|
|
1232
|
+
coinType: decodeFromJSONField(TypeName.reified(), field.coinType),
|
|
1233
|
+
reserveId: decodeFromJSONField("address", field.reserveId),
|
|
1234
|
+
obligationId: decodeFromJSONField("address", field.obligationId),
|
|
1235
|
+
liquidityAmount: decodeFromJSONField("u64", field.liquidityAmount),
|
|
1295
1236
|
});
|
|
1296
1237
|
}
|
|
1297
1238
|
static fromJSON(json) {
|
|
@@ -1315,7 +1256,7 @@ class ForgiveEvent {
|
|
|
1315
1256
|
!isForgiveEvent(data.bcs.type)) {
|
|
1316
1257
|
throw new Error(`object at is not a ForgiveEvent object`);
|
|
1317
1258
|
}
|
|
1318
|
-
return ForgiveEvent.fromBcs((
|
|
1259
|
+
return ForgiveEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
1319
1260
|
}
|
|
1320
1261
|
if (data.content) {
|
|
1321
1262
|
return ForgiveEvent.fromSuiParsedData(data.content);
|
|
@@ -1337,28 +1278,27 @@ class ForgiveEvent {
|
|
|
1337
1278
|
});
|
|
1338
1279
|
}
|
|
1339
1280
|
}
|
|
1340
|
-
|
|
1341
|
-
ForgiveEvent.$typeName = `${index_1.PKG_V1}::lending_market::ForgiveEvent`;
|
|
1281
|
+
ForgiveEvent.$typeName = `${PKG_V1}::lending_market::ForgiveEvent`;
|
|
1342
1282
|
ForgiveEvent.$numTypeParams = 0;
|
|
1343
1283
|
ForgiveEvent.$isPhantom = [];
|
|
1344
1284
|
/* ============================== LENDING_MARKET =============================== */
|
|
1345
|
-
function isLENDING_MARKET(type) {
|
|
1346
|
-
type =
|
|
1347
|
-
return type === `${
|
|
1285
|
+
export function isLENDING_MARKET(type) {
|
|
1286
|
+
type = compressSuiType(type);
|
|
1287
|
+
return type === `${PKG_V1}::lending_market::LENDING_MARKET`;
|
|
1348
1288
|
}
|
|
1349
|
-
class LENDING_MARKET {
|
|
1289
|
+
export class LENDING_MARKET {
|
|
1350
1290
|
constructor(typeArgs, fields) {
|
|
1351
1291
|
this.__StructClass = true;
|
|
1352
1292
|
this.$typeName = LENDING_MARKET.$typeName;
|
|
1353
1293
|
this.$isPhantom = LENDING_MARKET.$isPhantom;
|
|
1354
|
-
this.$fullTypeName =
|
|
1294
|
+
this.$fullTypeName = composeSuiType(LENDING_MARKET.$typeName, ...typeArgs);
|
|
1355
1295
|
this.$typeArgs = typeArgs;
|
|
1356
1296
|
this.dummyField = fields.dummyField;
|
|
1357
1297
|
}
|
|
1358
1298
|
static reified() {
|
|
1359
1299
|
return {
|
|
1360
1300
|
typeName: LENDING_MARKET.$typeName,
|
|
1361
|
-
fullTypeName:
|
|
1301
|
+
fullTypeName: composeSuiType(LENDING_MARKET.$typeName, ...[]),
|
|
1362
1302
|
typeArgs: [],
|
|
1363
1303
|
isPhantom: LENDING_MARKET.$isPhantom,
|
|
1364
1304
|
reifiedTypeArgs: [],
|
|
@@ -1381,19 +1321,19 @@ class LENDING_MARKET {
|
|
|
1381
1321
|
return LENDING_MARKET.reified();
|
|
1382
1322
|
}
|
|
1383
1323
|
static phantom() {
|
|
1384
|
-
return
|
|
1324
|
+
return phantom(LENDING_MARKET.reified());
|
|
1385
1325
|
}
|
|
1386
1326
|
static get p() {
|
|
1387
1327
|
return LENDING_MARKET.phantom();
|
|
1388
1328
|
}
|
|
1389
1329
|
static get bcs() {
|
|
1390
|
-
return
|
|
1391
|
-
dummy_field:
|
|
1330
|
+
return bcs.struct("LENDING_MARKET", {
|
|
1331
|
+
dummy_field: bcs.bool(),
|
|
1392
1332
|
});
|
|
1393
1333
|
}
|
|
1394
1334
|
static fromFields(fields) {
|
|
1395
1335
|
return LENDING_MARKET.reified().new({
|
|
1396
|
-
dummyField:
|
|
1336
|
+
dummyField: decodeFromFields("bool", fields.dummy_field),
|
|
1397
1337
|
});
|
|
1398
1338
|
}
|
|
1399
1339
|
static fromFieldsWithTypes(item) {
|
|
@@ -1401,7 +1341,7 @@ class LENDING_MARKET {
|
|
|
1401
1341
|
throw new Error("not a LENDING_MARKET type");
|
|
1402
1342
|
}
|
|
1403
1343
|
return LENDING_MARKET.reified().new({
|
|
1404
|
-
dummyField:
|
|
1344
|
+
dummyField: decodeFromFieldsWithTypes("bool", item.fields.dummy_field),
|
|
1405
1345
|
});
|
|
1406
1346
|
}
|
|
1407
1347
|
static fromBcs(data) {
|
|
@@ -1417,7 +1357,7 @@ class LENDING_MARKET {
|
|
|
1417
1357
|
}
|
|
1418
1358
|
static fromJSONField(field) {
|
|
1419
1359
|
return LENDING_MARKET.reified().new({
|
|
1420
|
-
dummyField:
|
|
1360
|
+
dummyField: decodeFromJSONField("bool", field.dummyField),
|
|
1421
1361
|
});
|
|
1422
1362
|
}
|
|
1423
1363
|
static fromJSON(json) {
|
|
@@ -1441,7 +1381,7 @@ class LENDING_MARKET {
|
|
|
1441
1381
|
!isLENDING_MARKET(data.bcs.type)) {
|
|
1442
1382
|
throw new Error(`object at is not a LENDING_MARKET object`);
|
|
1443
1383
|
}
|
|
1444
|
-
return LENDING_MARKET.fromBcs((
|
|
1384
|
+
return LENDING_MARKET.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
1445
1385
|
}
|
|
1446
1386
|
if (data.content) {
|
|
1447
1387
|
return LENDING_MARKET.fromSuiParsedData(data.content);
|
|
@@ -1463,21 +1403,20 @@ class LENDING_MARKET {
|
|
|
1463
1403
|
});
|
|
1464
1404
|
}
|
|
1465
1405
|
}
|
|
1466
|
-
|
|
1467
|
-
LENDING_MARKET.$typeName = `${index_1.PKG_V1}::lending_market::LENDING_MARKET`;
|
|
1406
|
+
LENDING_MARKET.$typeName = `${PKG_V1}::lending_market::LENDING_MARKET`;
|
|
1468
1407
|
LENDING_MARKET.$numTypeParams = 0;
|
|
1469
1408
|
LENDING_MARKET.$isPhantom = [];
|
|
1470
1409
|
/* ============================== LendingMarket =============================== */
|
|
1471
|
-
function isLendingMarket(type) {
|
|
1472
|
-
type =
|
|
1473
|
-
return type.startsWith(`${
|
|
1410
|
+
export function isLendingMarket(type) {
|
|
1411
|
+
type = compressSuiType(type);
|
|
1412
|
+
return type.startsWith(`${PKG_V1}::lending_market::LendingMarket` + "<");
|
|
1474
1413
|
}
|
|
1475
|
-
class LendingMarket {
|
|
1414
|
+
export class LendingMarket {
|
|
1476
1415
|
constructor(typeArgs, fields) {
|
|
1477
1416
|
this.__StructClass = true;
|
|
1478
1417
|
this.$typeName = LendingMarket.$typeName;
|
|
1479
1418
|
this.$isPhantom = LendingMarket.$isPhantom;
|
|
1480
|
-
this.$fullTypeName =
|
|
1419
|
+
this.$fullTypeName = composeSuiType(LendingMarket.$typeName, ...typeArgs);
|
|
1481
1420
|
this.$typeArgs = typeArgs;
|
|
1482
1421
|
this.id = fields.id;
|
|
1483
1422
|
this.version = fields.version;
|
|
@@ -1491,8 +1430,8 @@ class LendingMarket {
|
|
|
1491
1430
|
static reified(P) {
|
|
1492
1431
|
return {
|
|
1493
1432
|
typeName: LendingMarket.$typeName,
|
|
1494
|
-
fullTypeName:
|
|
1495
|
-
typeArgs: [
|
|
1433
|
+
fullTypeName: composeSuiType(LendingMarket.$typeName, ...[extractType(P)]),
|
|
1434
|
+
typeArgs: [extractType(P)],
|
|
1496
1435
|
isPhantom: LendingMarket.$isPhantom,
|
|
1497
1436
|
reifiedTypeArgs: [P],
|
|
1498
1437
|
fromFields: (fields) => LendingMarket.fromFields(P, fields),
|
|
@@ -1505,7 +1444,7 @@ class LendingMarket {
|
|
|
1505
1444
|
fromSuiObjectData: (content) => LendingMarket.fromSuiObjectData(P, content),
|
|
1506
1445
|
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return LendingMarket.fetch(client, P, id); }),
|
|
1507
1446
|
new: (fields) => {
|
|
1508
|
-
return new LendingMarket([
|
|
1447
|
+
return new LendingMarket([extractType(P)], fields);
|
|
1509
1448
|
},
|
|
1510
1449
|
kind: "StructClassReified",
|
|
1511
1450
|
};
|
|
@@ -1514,54 +1453,54 @@ class LendingMarket {
|
|
|
1514
1453
|
return LendingMarket.reified;
|
|
1515
1454
|
}
|
|
1516
1455
|
static phantom(P) {
|
|
1517
|
-
return
|
|
1456
|
+
return phantom(LendingMarket.reified(P));
|
|
1518
1457
|
}
|
|
1519
1458
|
static get p() {
|
|
1520
1459
|
return LendingMarket.phantom;
|
|
1521
1460
|
}
|
|
1522
1461
|
static get bcs() {
|
|
1523
|
-
return
|
|
1524
|
-
id:
|
|
1525
|
-
version:
|
|
1526
|
-
reserves:
|
|
1527
|
-
obligations:
|
|
1528
|
-
rate_limiter:
|
|
1529
|
-
fee_receiver:
|
|
1462
|
+
return bcs.struct("LendingMarket", {
|
|
1463
|
+
id: UID.bcs,
|
|
1464
|
+
version: bcs.u64(),
|
|
1465
|
+
reserves: bcs.vector(Reserve.bcs),
|
|
1466
|
+
obligations: ObjectTable.bcs,
|
|
1467
|
+
rate_limiter: RateLimiter.bcs,
|
|
1468
|
+
fee_receiver: bcs
|
|
1530
1469
|
.bytes(32)
|
|
1531
1470
|
.transform({
|
|
1532
|
-
input: (val) => (
|
|
1533
|
-
output: (val) => (
|
|
1471
|
+
input: (val) => fromHex(val),
|
|
1472
|
+
output: (val) => toHex(val),
|
|
1534
1473
|
}),
|
|
1535
|
-
bad_debt_usd:
|
|
1536
|
-
bad_debt_limit_usd:
|
|
1474
|
+
bad_debt_usd: Decimal.bcs,
|
|
1475
|
+
bad_debt_limit_usd: Decimal.bcs,
|
|
1537
1476
|
});
|
|
1538
1477
|
}
|
|
1539
1478
|
static fromFields(typeArg, fields) {
|
|
1540
1479
|
return LendingMarket.reified(typeArg).new({
|
|
1541
|
-
id:
|
|
1542
|
-
version:
|
|
1543
|
-
reserves:
|
|
1544
|
-
obligations:
|
|
1545
|
-
rateLimiter:
|
|
1546
|
-
feeReceiver:
|
|
1547
|
-
badDebtUsd:
|
|
1548
|
-
badDebtLimitUsd:
|
|
1480
|
+
id: decodeFromFields(UID.reified(), fields.id),
|
|
1481
|
+
version: decodeFromFields("u64", fields.version),
|
|
1482
|
+
reserves: decodeFromFields(reified.vector(Reserve.reified(typeArg)), fields.reserves),
|
|
1483
|
+
obligations: decodeFromFields(ObjectTable.reified(reified.phantom(ID.reified()), reified.phantom(Obligation.reified(typeArg))), fields.obligations),
|
|
1484
|
+
rateLimiter: decodeFromFields(RateLimiter.reified(), fields.rate_limiter),
|
|
1485
|
+
feeReceiver: decodeFromFields("address", fields.fee_receiver),
|
|
1486
|
+
badDebtUsd: decodeFromFields(Decimal.reified(), fields.bad_debt_usd),
|
|
1487
|
+
badDebtLimitUsd: decodeFromFields(Decimal.reified(), fields.bad_debt_limit_usd),
|
|
1549
1488
|
});
|
|
1550
1489
|
}
|
|
1551
1490
|
static fromFieldsWithTypes(typeArg, item) {
|
|
1552
1491
|
if (!isLendingMarket(item.type)) {
|
|
1553
1492
|
throw new Error("not a LendingMarket type");
|
|
1554
1493
|
}
|
|
1555
|
-
|
|
1494
|
+
assertFieldsWithTypesArgsMatch(item, [typeArg]);
|
|
1556
1495
|
return LendingMarket.reified(typeArg).new({
|
|
1557
|
-
id:
|
|
1558
|
-
version:
|
|
1559
|
-
reserves:
|
|
1560
|
-
obligations:
|
|
1561
|
-
rateLimiter:
|
|
1562
|
-
feeReceiver:
|
|
1563
|
-
badDebtUsd:
|
|
1564
|
-
badDebtLimitUsd:
|
|
1496
|
+
id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id),
|
|
1497
|
+
version: decodeFromFieldsWithTypes("u64", item.fields.version),
|
|
1498
|
+
reserves: decodeFromFieldsWithTypes(reified.vector(Reserve.reified(typeArg)), item.fields.reserves),
|
|
1499
|
+
obligations: decodeFromFieldsWithTypes(ObjectTable.reified(reified.phantom(ID.reified()), reified.phantom(Obligation.reified(typeArg))), item.fields.obligations),
|
|
1500
|
+
rateLimiter: decodeFromFieldsWithTypes(RateLimiter.reified(), item.fields.rate_limiter),
|
|
1501
|
+
feeReceiver: decodeFromFieldsWithTypes("address", item.fields.fee_receiver),
|
|
1502
|
+
badDebtUsd: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.bad_debt_usd),
|
|
1503
|
+
badDebtLimitUsd: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.bad_debt_limit_usd),
|
|
1565
1504
|
});
|
|
1566
1505
|
}
|
|
1567
1506
|
static fromBcs(typeArg, data) {
|
|
@@ -1571,7 +1510,7 @@ class LendingMarket {
|
|
|
1571
1510
|
return {
|
|
1572
1511
|
id: this.id,
|
|
1573
1512
|
version: this.version.toString(),
|
|
1574
|
-
reserves:
|
|
1513
|
+
reserves: fieldToJSON(`vector<${Reserve.$typeName}<${this.$typeArgs[0]}>>`, this.reserves),
|
|
1575
1514
|
obligations: this.obligations.toJSONField(),
|
|
1576
1515
|
rateLimiter: this.rateLimiter.toJSONField(),
|
|
1577
1516
|
feeReceiver: this.feeReceiver,
|
|
@@ -1584,21 +1523,21 @@ class LendingMarket {
|
|
|
1584
1523
|
}
|
|
1585
1524
|
static fromJSONField(typeArg, field) {
|
|
1586
1525
|
return LendingMarket.reified(typeArg).new({
|
|
1587
|
-
id:
|
|
1588
|
-
version:
|
|
1589
|
-
reserves:
|
|
1590
|
-
obligations:
|
|
1591
|
-
rateLimiter:
|
|
1592
|
-
feeReceiver:
|
|
1593
|
-
badDebtUsd:
|
|
1594
|
-
badDebtLimitUsd:
|
|
1526
|
+
id: decodeFromJSONField(UID.reified(), field.id),
|
|
1527
|
+
version: decodeFromJSONField("u64", field.version),
|
|
1528
|
+
reserves: decodeFromJSONField(reified.vector(Reserve.reified(typeArg)), field.reserves),
|
|
1529
|
+
obligations: decodeFromJSONField(ObjectTable.reified(reified.phantom(ID.reified()), reified.phantom(Obligation.reified(typeArg))), field.obligations),
|
|
1530
|
+
rateLimiter: decodeFromJSONField(RateLimiter.reified(), field.rateLimiter),
|
|
1531
|
+
feeReceiver: decodeFromJSONField("address", field.feeReceiver),
|
|
1532
|
+
badDebtUsd: decodeFromJSONField(Decimal.reified(), field.badDebtUsd),
|
|
1533
|
+
badDebtLimitUsd: decodeFromJSONField(Decimal.reified(), field.badDebtLimitUsd),
|
|
1595
1534
|
});
|
|
1596
1535
|
}
|
|
1597
1536
|
static fromJSON(typeArg, json) {
|
|
1598
1537
|
if (json.$typeName !== LendingMarket.$typeName) {
|
|
1599
1538
|
throw new Error("not a WithTwoGenerics json object");
|
|
1600
1539
|
}
|
|
1601
|
-
|
|
1540
|
+
assertReifiedTypeArgsMatch(composeSuiType(LendingMarket.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg]);
|
|
1602
1541
|
return LendingMarket.fromJSONField(typeArg, json);
|
|
1603
1542
|
}
|
|
1604
1543
|
static fromSuiParsedData(typeArg, content) {
|
|
@@ -1616,16 +1555,16 @@ class LendingMarket {
|
|
|
1616
1555
|
!isLendingMarket(data.bcs.type)) {
|
|
1617
1556
|
throw new Error(`object at is not a LendingMarket object`);
|
|
1618
1557
|
}
|
|
1619
|
-
const gotTypeArgs =
|
|
1558
|
+
const gotTypeArgs = parseTypeName(data.bcs.type).typeArgs;
|
|
1620
1559
|
if (gotTypeArgs.length !== 1) {
|
|
1621
1560
|
throw new Error(`type argument mismatch: expected 1 type argument but got '${gotTypeArgs.length}'`);
|
|
1622
1561
|
}
|
|
1623
|
-
const gotTypeArg =
|
|
1624
|
-
const expectedTypeArg =
|
|
1625
|
-
if (gotTypeArg !==
|
|
1562
|
+
const gotTypeArg = compressSuiType(gotTypeArgs[0]);
|
|
1563
|
+
const expectedTypeArg = compressSuiType(extractType(typeArg));
|
|
1564
|
+
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
1626
1565
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
1627
1566
|
}
|
|
1628
|
-
return LendingMarket.fromBcs(typeArg, (
|
|
1567
|
+
return LendingMarket.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
1629
1568
|
}
|
|
1630
1569
|
if (data.content) {
|
|
1631
1570
|
return LendingMarket.fromSuiParsedData(typeArg, data.content);
|
|
@@ -1647,21 +1586,20 @@ class LendingMarket {
|
|
|
1647
1586
|
});
|
|
1648
1587
|
}
|
|
1649
1588
|
}
|
|
1650
|
-
|
|
1651
|
-
LendingMarket.$typeName = `${index_1.PKG_V1}::lending_market::LendingMarket`;
|
|
1589
|
+
LendingMarket.$typeName = `${PKG_V1}::lending_market::LendingMarket`;
|
|
1652
1590
|
LendingMarket.$numTypeParams = 1;
|
|
1653
1591
|
LendingMarket.$isPhantom = [true];
|
|
1654
1592
|
/* ============================== LendingMarketOwnerCap =============================== */
|
|
1655
|
-
function isLendingMarketOwnerCap(type) {
|
|
1656
|
-
type =
|
|
1657
|
-
return type.startsWith(`${
|
|
1593
|
+
export function isLendingMarketOwnerCap(type) {
|
|
1594
|
+
type = compressSuiType(type);
|
|
1595
|
+
return type.startsWith(`${PKG_V1}::lending_market::LendingMarketOwnerCap` + "<");
|
|
1658
1596
|
}
|
|
1659
|
-
class LendingMarketOwnerCap {
|
|
1597
|
+
export class LendingMarketOwnerCap {
|
|
1660
1598
|
constructor(typeArgs, fields) {
|
|
1661
1599
|
this.__StructClass = true;
|
|
1662
1600
|
this.$typeName = LendingMarketOwnerCap.$typeName;
|
|
1663
1601
|
this.$isPhantom = LendingMarketOwnerCap.$isPhantom;
|
|
1664
|
-
this.$fullTypeName =
|
|
1602
|
+
this.$fullTypeName = composeSuiType(LendingMarketOwnerCap.$typeName, ...typeArgs);
|
|
1665
1603
|
this.$typeArgs = typeArgs;
|
|
1666
1604
|
this.id = fields.id;
|
|
1667
1605
|
this.lendingMarketId = fields.lendingMarketId;
|
|
@@ -1669,8 +1607,8 @@ class LendingMarketOwnerCap {
|
|
|
1669
1607
|
static reified(P) {
|
|
1670
1608
|
return {
|
|
1671
1609
|
typeName: LendingMarketOwnerCap.$typeName,
|
|
1672
|
-
fullTypeName:
|
|
1673
|
-
typeArgs: [
|
|
1610
|
+
fullTypeName: composeSuiType(LendingMarketOwnerCap.$typeName, ...[extractType(P)]),
|
|
1611
|
+
typeArgs: [extractType(P)],
|
|
1674
1612
|
isPhantom: LendingMarketOwnerCap.$isPhantom,
|
|
1675
1613
|
reifiedTypeArgs: [P],
|
|
1676
1614
|
fromFields: (fields) => LendingMarketOwnerCap.fromFields(P, fields),
|
|
@@ -1683,7 +1621,7 @@ class LendingMarketOwnerCap {
|
|
|
1683
1621
|
fromSuiObjectData: (content) => LendingMarketOwnerCap.fromSuiObjectData(P, content),
|
|
1684
1622
|
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return LendingMarketOwnerCap.fetch(client, P, id); }),
|
|
1685
1623
|
new: (fields) => {
|
|
1686
|
-
return new LendingMarketOwnerCap([
|
|
1624
|
+
return new LendingMarketOwnerCap([extractType(P)], fields);
|
|
1687
1625
|
},
|
|
1688
1626
|
kind: "StructClassReified",
|
|
1689
1627
|
};
|
|
@@ -1692,31 +1630,31 @@ class LendingMarketOwnerCap {
|
|
|
1692
1630
|
return LendingMarketOwnerCap.reified;
|
|
1693
1631
|
}
|
|
1694
1632
|
static phantom(P) {
|
|
1695
|
-
return
|
|
1633
|
+
return phantom(LendingMarketOwnerCap.reified(P));
|
|
1696
1634
|
}
|
|
1697
1635
|
static get p() {
|
|
1698
1636
|
return LendingMarketOwnerCap.phantom;
|
|
1699
1637
|
}
|
|
1700
1638
|
static get bcs() {
|
|
1701
|
-
return
|
|
1702
|
-
id:
|
|
1703
|
-
lending_market_id:
|
|
1639
|
+
return bcs.struct("LendingMarketOwnerCap", {
|
|
1640
|
+
id: UID.bcs,
|
|
1641
|
+
lending_market_id: ID.bcs,
|
|
1704
1642
|
});
|
|
1705
1643
|
}
|
|
1706
1644
|
static fromFields(typeArg, fields) {
|
|
1707
1645
|
return LendingMarketOwnerCap.reified(typeArg).new({
|
|
1708
|
-
id:
|
|
1709
|
-
lendingMarketId:
|
|
1646
|
+
id: decodeFromFields(UID.reified(), fields.id),
|
|
1647
|
+
lendingMarketId: decodeFromFields(ID.reified(), fields.lending_market_id),
|
|
1710
1648
|
});
|
|
1711
1649
|
}
|
|
1712
1650
|
static fromFieldsWithTypes(typeArg, item) {
|
|
1713
1651
|
if (!isLendingMarketOwnerCap(item.type)) {
|
|
1714
1652
|
throw new Error("not a LendingMarketOwnerCap type");
|
|
1715
1653
|
}
|
|
1716
|
-
|
|
1654
|
+
assertFieldsWithTypesArgsMatch(item, [typeArg]);
|
|
1717
1655
|
return LendingMarketOwnerCap.reified(typeArg).new({
|
|
1718
|
-
id:
|
|
1719
|
-
lendingMarketId:
|
|
1656
|
+
id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id),
|
|
1657
|
+
lendingMarketId: decodeFromFieldsWithTypes(ID.reified(), item.fields.lending_market_id),
|
|
1720
1658
|
});
|
|
1721
1659
|
}
|
|
1722
1660
|
static fromBcs(typeArg, data) {
|
|
@@ -1733,15 +1671,15 @@ class LendingMarketOwnerCap {
|
|
|
1733
1671
|
}
|
|
1734
1672
|
static fromJSONField(typeArg, field) {
|
|
1735
1673
|
return LendingMarketOwnerCap.reified(typeArg).new({
|
|
1736
|
-
id:
|
|
1737
|
-
lendingMarketId:
|
|
1674
|
+
id: decodeFromJSONField(UID.reified(), field.id),
|
|
1675
|
+
lendingMarketId: decodeFromJSONField(ID.reified(), field.lendingMarketId),
|
|
1738
1676
|
});
|
|
1739
1677
|
}
|
|
1740
1678
|
static fromJSON(typeArg, json) {
|
|
1741
1679
|
if (json.$typeName !== LendingMarketOwnerCap.$typeName) {
|
|
1742
1680
|
throw new Error("not a WithTwoGenerics json object");
|
|
1743
1681
|
}
|
|
1744
|
-
|
|
1682
|
+
assertReifiedTypeArgsMatch(composeSuiType(LendingMarketOwnerCap.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg]);
|
|
1745
1683
|
return LendingMarketOwnerCap.fromJSONField(typeArg, json);
|
|
1746
1684
|
}
|
|
1747
1685
|
static fromSuiParsedData(typeArg, content) {
|
|
@@ -1759,16 +1697,16 @@ class LendingMarketOwnerCap {
|
|
|
1759
1697
|
!isLendingMarketOwnerCap(data.bcs.type)) {
|
|
1760
1698
|
throw new Error(`object at is not a LendingMarketOwnerCap object`);
|
|
1761
1699
|
}
|
|
1762
|
-
const gotTypeArgs =
|
|
1700
|
+
const gotTypeArgs = parseTypeName(data.bcs.type).typeArgs;
|
|
1763
1701
|
if (gotTypeArgs.length !== 1) {
|
|
1764
1702
|
throw new Error(`type argument mismatch: expected 1 type argument but got '${gotTypeArgs.length}'`);
|
|
1765
1703
|
}
|
|
1766
|
-
const gotTypeArg =
|
|
1767
|
-
const expectedTypeArg =
|
|
1768
|
-
if (gotTypeArg !==
|
|
1704
|
+
const gotTypeArg = compressSuiType(gotTypeArgs[0]);
|
|
1705
|
+
const expectedTypeArg = compressSuiType(extractType(typeArg));
|
|
1706
|
+
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
1769
1707
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
1770
1708
|
}
|
|
1771
|
-
return LendingMarketOwnerCap.fromBcs(typeArg, (
|
|
1709
|
+
return LendingMarketOwnerCap.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
1772
1710
|
}
|
|
1773
1711
|
if (data.content) {
|
|
1774
1712
|
return LendingMarketOwnerCap.fromSuiParsedData(typeArg, data.content);
|
|
@@ -1790,21 +1728,20 @@ class LendingMarketOwnerCap {
|
|
|
1790
1728
|
});
|
|
1791
1729
|
}
|
|
1792
1730
|
}
|
|
1793
|
-
|
|
1794
|
-
LendingMarketOwnerCap.$typeName = `${index_1.PKG_V1}::lending_market::LendingMarketOwnerCap`;
|
|
1731
|
+
LendingMarketOwnerCap.$typeName = `${PKG_V1}::lending_market::LendingMarketOwnerCap`;
|
|
1795
1732
|
LendingMarketOwnerCap.$numTypeParams = 1;
|
|
1796
1733
|
LendingMarketOwnerCap.$isPhantom = [true];
|
|
1797
1734
|
/* ============================== LiquidateEvent =============================== */
|
|
1798
|
-
function isLiquidateEvent(type) {
|
|
1799
|
-
type =
|
|
1800
|
-
return type === `${
|
|
1735
|
+
export function isLiquidateEvent(type) {
|
|
1736
|
+
type = compressSuiType(type);
|
|
1737
|
+
return type === `${PKG_V1}::lending_market::LiquidateEvent`;
|
|
1801
1738
|
}
|
|
1802
|
-
class LiquidateEvent {
|
|
1739
|
+
export class LiquidateEvent {
|
|
1803
1740
|
constructor(typeArgs, fields) {
|
|
1804
1741
|
this.__StructClass = true;
|
|
1805
1742
|
this.$typeName = LiquidateEvent.$typeName;
|
|
1806
1743
|
this.$isPhantom = LiquidateEvent.$isPhantom;
|
|
1807
|
-
this.$fullTypeName =
|
|
1744
|
+
this.$fullTypeName = composeSuiType(LiquidateEvent.$typeName, ...typeArgs);
|
|
1808
1745
|
this.$typeArgs = typeArgs;
|
|
1809
1746
|
this.lendingMarketId = fields.lendingMarketId;
|
|
1810
1747
|
this.repayReserveId = fields.repayReserveId;
|
|
@@ -1820,7 +1757,7 @@ class LiquidateEvent {
|
|
|
1820
1757
|
static reified() {
|
|
1821
1758
|
return {
|
|
1822
1759
|
typeName: LiquidateEvent.$typeName,
|
|
1823
|
-
fullTypeName:
|
|
1760
|
+
fullTypeName: composeSuiType(LiquidateEvent.$typeName, ...[]),
|
|
1824
1761
|
typeArgs: [],
|
|
1825
1762
|
isPhantom: LiquidateEvent.$isPhantom,
|
|
1826
1763
|
reifiedTypeArgs: [],
|
|
@@ -1843,57 +1780,57 @@ class LiquidateEvent {
|
|
|
1843
1780
|
return LiquidateEvent.reified();
|
|
1844
1781
|
}
|
|
1845
1782
|
static phantom() {
|
|
1846
|
-
return
|
|
1783
|
+
return phantom(LiquidateEvent.reified());
|
|
1847
1784
|
}
|
|
1848
1785
|
static get p() {
|
|
1849
1786
|
return LiquidateEvent.phantom();
|
|
1850
1787
|
}
|
|
1851
1788
|
static get bcs() {
|
|
1852
|
-
return
|
|
1853
|
-
lending_market_id:
|
|
1789
|
+
return bcs.struct("LiquidateEvent", {
|
|
1790
|
+
lending_market_id: bcs
|
|
1854
1791
|
.bytes(32)
|
|
1855
1792
|
.transform({
|
|
1856
|
-
input: (val) => (
|
|
1857
|
-
output: (val) => (
|
|
1793
|
+
input: (val) => fromHex(val),
|
|
1794
|
+
output: (val) => toHex(val),
|
|
1858
1795
|
}),
|
|
1859
|
-
repay_reserve_id:
|
|
1796
|
+
repay_reserve_id: bcs
|
|
1860
1797
|
.bytes(32)
|
|
1861
1798
|
.transform({
|
|
1862
|
-
input: (val) => (
|
|
1863
|
-
output: (val) => (
|
|
1799
|
+
input: (val) => fromHex(val),
|
|
1800
|
+
output: (val) => toHex(val),
|
|
1864
1801
|
}),
|
|
1865
|
-
withdraw_reserve_id:
|
|
1802
|
+
withdraw_reserve_id: bcs
|
|
1866
1803
|
.bytes(32)
|
|
1867
1804
|
.transform({
|
|
1868
|
-
input: (val) => (
|
|
1869
|
-
output: (val) => (
|
|
1805
|
+
input: (val) => fromHex(val),
|
|
1806
|
+
output: (val) => toHex(val),
|
|
1870
1807
|
}),
|
|
1871
|
-
obligation_id:
|
|
1808
|
+
obligation_id: bcs
|
|
1872
1809
|
.bytes(32)
|
|
1873
1810
|
.transform({
|
|
1874
|
-
input: (val) => (
|
|
1875
|
-
output: (val) => (
|
|
1811
|
+
input: (val) => fromHex(val),
|
|
1812
|
+
output: (val) => toHex(val),
|
|
1876
1813
|
}),
|
|
1877
|
-
repay_coin_type:
|
|
1878
|
-
withdraw_coin_type:
|
|
1879
|
-
repay_amount:
|
|
1880
|
-
withdraw_amount:
|
|
1881
|
-
protocol_fee_amount:
|
|
1882
|
-
liquidator_bonus_amount:
|
|
1814
|
+
repay_coin_type: TypeName.bcs,
|
|
1815
|
+
withdraw_coin_type: TypeName.bcs,
|
|
1816
|
+
repay_amount: bcs.u64(),
|
|
1817
|
+
withdraw_amount: bcs.u64(),
|
|
1818
|
+
protocol_fee_amount: bcs.u64(),
|
|
1819
|
+
liquidator_bonus_amount: bcs.u64(),
|
|
1883
1820
|
});
|
|
1884
1821
|
}
|
|
1885
1822
|
static fromFields(fields) {
|
|
1886
1823
|
return LiquidateEvent.reified().new({
|
|
1887
|
-
lendingMarketId:
|
|
1888
|
-
repayReserveId:
|
|
1889
|
-
withdrawReserveId:
|
|
1890
|
-
obligationId:
|
|
1891
|
-
repayCoinType:
|
|
1892
|
-
withdrawCoinType:
|
|
1893
|
-
repayAmount:
|
|
1894
|
-
withdrawAmount:
|
|
1895
|
-
protocolFeeAmount:
|
|
1896
|
-
liquidatorBonusAmount:
|
|
1824
|
+
lendingMarketId: decodeFromFields("address", fields.lending_market_id),
|
|
1825
|
+
repayReserveId: decodeFromFields("address", fields.repay_reserve_id),
|
|
1826
|
+
withdrawReserveId: decodeFromFields("address", fields.withdraw_reserve_id),
|
|
1827
|
+
obligationId: decodeFromFields("address", fields.obligation_id),
|
|
1828
|
+
repayCoinType: decodeFromFields(TypeName.reified(), fields.repay_coin_type),
|
|
1829
|
+
withdrawCoinType: decodeFromFields(TypeName.reified(), fields.withdraw_coin_type),
|
|
1830
|
+
repayAmount: decodeFromFields("u64", fields.repay_amount),
|
|
1831
|
+
withdrawAmount: decodeFromFields("u64", fields.withdraw_amount),
|
|
1832
|
+
protocolFeeAmount: decodeFromFields("u64", fields.protocol_fee_amount),
|
|
1833
|
+
liquidatorBonusAmount: decodeFromFields("u64", fields.liquidator_bonus_amount),
|
|
1897
1834
|
});
|
|
1898
1835
|
}
|
|
1899
1836
|
static fromFieldsWithTypes(item) {
|
|
@@ -1901,16 +1838,16 @@ class LiquidateEvent {
|
|
|
1901
1838
|
throw new Error("not a LiquidateEvent type");
|
|
1902
1839
|
}
|
|
1903
1840
|
return LiquidateEvent.reified().new({
|
|
1904
|
-
lendingMarketId:
|
|
1905
|
-
repayReserveId:
|
|
1906
|
-
withdrawReserveId:
|
|
1907
|
-
obligationId:
|
|
1908
|
-
repayCoinType:
|
|
1909
|
-
withdrawCoinType:
|
|
1910
|
-
repayAmount:
|
|
1911
|
-
withdrawAmount:
|
|
1912
|
-
protocolFeeAmount:
|
|
1913
|
-
liquidatorBonusAmount:
|
|
1841
|
+
lendingMarketId: decodeFromFieldsWithTypes("address", item.fields.lending_market_id),
|
|
1842
|
+
repayReserveId: decodeFromFieldsWithTypes("address", item.fields.repay_reserve_id),
|
|
1843
|
+
withdrawReserveId: decodeFromFieldsWithTypes("address", item.fields.withdraw_reserve_id),
|
|
1844
|
+
obligationId: decodeFromFieldsWithTypes("address", item.fields.obligation_id),
|
|
1845
|
+
repayCoinType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.repay_coin_type),
|
|
1846
|
+
withdrawCoinType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.withdraw_coin_type),
|
|
1847
|
+
repayAmount: decodeFromFieldsWithTypes("u64", item.fields.repay_amount),
|
|
1848
|
+
withdrawAmount: decodeFromFieldsWithTypes("u64", item.fields.withdraw_amount),
|
|
1849
|
+
protocolFeeAmount: decodeFromFieldsWithTypes("u64", item.fields.protocol_fee_amount),
|
|
1850
|
+
liquidatorBonusAmount: decodeFromFieldsWithTypes("u64", item.fields.liquidator_bonus_amount),
|
|
1914
1851
|
});
|
|
1915
1852
|
}
|
|
1916
1853
|
static fromBcs(data) {
|
|
@@ -1935,16 +1872,16 @@ class LiquidateEvent {
|
|
|
1935
1872
|
}
|
|
1936
1873
|
static fromJSONField(field) {
|
|
1937
1874
|
return LiquidateEvent.reified().new({
|
|
1938
|
-
lendingMarketId:
|
|
1939
|
-
repayReserveId:
|
|
1940
|
-
withdrawReserveId:
|
|
1941
|
-
obligationId:
|
|
1942
|
-
repayCoinType:
|
|
1943
|
-
withdrawCoinType:
|
|
1944
|
-
repayAmount:
|
|
1945
|
-
withdrawAmount:
|
|
1946
|
-
protocolFeeAmount:
|
|
1947
|
-
liquidatorBonusAmount:
|
|
1875
|
+
lendingMarketId: decodeFromJSONField("address", field.lendingMarketId),
|
|
1876
|
+
repayReserveId: decodeFromJSONField("address", field.repayReserveId),
|
|
1877
|
+
withdrawReserveId: decodeFromJSONField("address", field.withdrawReserveId),
|
|
1878
|
+
obligationId: decodeFromJSONField("address", field.obligationId),
|
|
1879
|
+
repayCoinType: decodeFromJSONField(TypeName.reified(), field.repayCoinType),
|
|
1880
|
+
withdrawCoinType: decodeFromJSONField(TypeName.reified(), field.withdrawCoinType),
|
|
1881
|
+
repayAmount: decodeFromJSONField("u64", field.repayAmount),
|
|
1882
|
+
withdrawAmount: decodeFromJSONField("u64", field.withdrawAmount),
|
|
1883
|
+
protocolFeeAmount: decodeFromJSONField("u64", field.protocolFeeAmount),
|
|
1884
|
+
liquidatorBonusAmount: decodeFromJSONField("u64", field.liquidatorBonusAmount),
|
|
1948
1885
|
});
|
|
1949
1886
|
}
|
|
1950
1887
|
static fromJSON(json) {
|
|
@@ -1968,7 +1905,7 @@ class LiquidateEvent {
|
|
|
1968
1905
|
!isLiquidateEvent(data.bcs.type)) {
|
|
1969
1906
|
throw new Error(`object at is not a LiquidateEvent object`);
|
|
1970
1907
|
}
|
|
1971
|
-
return LiquidateEvent.fromBcs((
|
|
1908
|
+
return LiquidateEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
1972
1909
|
}
|
|
1973
1910
|
if (data.content) {
|
|
1974
1911
|
return LiquidateEvent.fromSuiParsedData(data.content);
|
|
@@ -1990,21 +1927,20 @@ class LiquidateEvent {
|
|
|
1990
1927
|
});
|
|
1991
1928
|
}
|
|
1992
1929
|
}
|
|
1993
|
-
|
|
1994
|
-
LiquidateEvent.$typeName = `${index_1.PKG_V1}::lending_market::LiquidateEvent`;
|
|
1930
|
+
LiquidateEvent.$typeName = `${PKG_V1}::lending_market::LiquidateEvent`;
|
|
1995
1931
|
LiquidateEvent.$numTypeParams = 0;
|
|
1996
1932
|
LiquidateEvent.$isPhantom = [];
|
|
1997
1933
|
/* ============================== ObligationOwnerCap =============================== */
|
|
1998
|
-
function isObligationOwnerCap(type) {
|
|
1999
|
-
type =
|
|
2000
|
-
return type.startsWith(`${
|
|
1934
|
+
export function isObligationOwnerCap(type) {
|
|
1935
|
+
type = compressSuiType(type);
|
|
1936
|
+
return type.startsWith(`${PKG_V1}::lending_market::ObligationOwnerCap` + "<");
|
|
2001
1937
|
}
|
|
2002
|
-
class ObligationOwnerCap {
|
|
1938
|
+
export class ObligationOwnerCap {
|
|
2003
1939
|
constructor(typeArgs, fields) {
|
|
2004
1940
|
this.__StructClass = true;
|
|
2005
1941
|
this.$typeName = ObligationOwnerCap.$typeName;
|
|
2006
1942
|
this.$isPhantom = ObligationOwnerCap.$isPhantom;
|
|
2007
|
-
this.$fullTypeName =
|
|
1943
|
+
this.$fullTypeName = composeSuiType(ObligationOwnerCap.$typeName, ...typeArgs);
|
|
2008
1944
|
this.$typeArgs = typeArgs;
|
|
2009
1945
|
this.id = fields.id;
|
|
2010
1946
|
this.obligationId = fields.obligationId;
|
|
@@ -2012,8 +1948,8 @@ class ObligationOwnerCap {
|
|
|
2012
1948
|
static reified(P) {
|
|
2013
1949
|
return {
|
|
2014
1950
|
typeName: ObligationOwnerCap.$typeName,
|
|
2015
|
-
fullTypeName:
|
|
2016
|
-
typeArgs: [
|
|
1951
|
+
fullTypeName: composeSuiType(ObligationOwnerCap.$typeName, ...[extractType(P)]),
|
|
1952
|
+
typeArgs: [extractType(P)],
|
|
2017
1953
|
isPhantom: ObligationOwnerCap.$isPhantom,
|
|
2018
1954
|
reifiedTypeArgs: [P],
|
|
2019
1955
|
fromFields: (fields) => ObligationOwnerCap.fromFields(P, fields),
|
|
@@ -2026,7 +1962,7 @@ class ObligationOwnerCap {
|
|
|
2026
1962
|
fromSuiObjectData: (content) => ObligationOwnerCap.fromSuiObjectData(P, content),
|
|
2027
1963
|
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return ObligationOwnerCap.fetch(client, P, id); }),
|
|
2028
1964
|
new: (fields) => {
|
|
2029
|
-
return new ObligationOwnerCap([
|
|
1965
|
+
return new ObligationOwnerCap([extractType(P)], fields);
|
|
2030
1966
|
},
|
|
2031
1967
|
kind: "StructClassReified",
|
|
2032
1968
|
};
|
|
@@ -2035,31 +1971,31 @@ class ObligationOwnerCap {
|
|
|
2035
1971
|
return ObligationOwnerCap.reified;
|
|
2036
1972
|
}
|
|
2037
1973
|
static phantom(P) {
|
|
2038
|
-
return
|
|
1974
|
+
return phantom(ObligationOwnerCap.reified(P));
|
|
2039
1975
|
}
|
|
2040
1976
|
static get p() {
|
|
2041
1977
|
return ObligationOwnerCap.phantom;
|
|
2042
1978
|
}
|
|
2043
1979
|
static get bcs() {
|
|
2044
|
-
return
|
|
2045
|
-
id:
|
|
2046
|
-
obligation_id:
|
|
1980
|
+
return bcs.struct("ObligationOwnerCap", {
|
|
1981
|
+
id: UID.bcs,
|
|
1982
|
+
obligation_id: ID.bcs,
|
|
2047
1983
|
});
|
|
2048
1984
|
}
|
|
2049
1985
|
static fromFields(typeArg, fields) {
|
|
2050
1986
|
return ObligationOwnerCap.reified(typeArg).new({
|
|
2051
|
-
id:
|
|
2052
|
-
obligationId:
|
|
1987
|
+
id: decodeFromFields(UID.reified(), fields.id),
|
|
1988
|
+
obligationId: decodeFromFields(ID.reified(), fields.obligation_id),
|
|
2053
1989
|
});
|
|
2054
1990
|
}
|
|
2055
1991
|
static fromFieldsWithTypes(typeArg, item) {
|
|
2056
1992
|
if (!isObligationOwnerCap(item.type)) {
|
|
2057
1993
|
throw new Error("not a ObligationOwnerCap type");
|
|
2058
1994
|
}
|
|
2059
|
-
|
|
1995
|
+
assertFieldsWithTypesArgsMatch(item, [typeArg]);
|
|
2060
1996
|
return ObligationOwnerCap.reified(typeArg).new({
|
|
2061
|
-
id:
|
|
2062
|
-
obligationId:
|
|
1997
|
+
id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id),
|
|
1998
|
+
obligationId: decodeFromFieldsWithTypes(ID.reified(), item.fields.obligation_id),
|
|
2063
1999
|
});
|
|
2064
2000
|
}
|
|
2065
2001
|
static fromBcs(typeArg, data) {
|
|
@@ -2076,15 +2012,15 @@ class ObligationOwnerCap {
|
|
|
2076
2012
|
}
|
|
2077
2013
|
static fromJSONField(typeArg, field) {
|
|
2078
2014
|
return ObligationOwnerCap.reified(typeArg).new({
|
|
2079
|
-
id:
|
|
2080
|
-
obligationId:
|
|
2015
|
+
id: decodeFromJSONField(UID.reified(), field.id),
|
|
2016
|
+
obligationId: decodeFromJSONField(ID.reified(), field.obligationId),
|
|
2081
2017
|
});
|
|
2082
2018
|
}
|
|
2083
2019
|
static fromJSON(typeArg, json) {
|
|
2084
2020
|
if (json.$typeName !== ObligationOwnerCap.$typeName) {
|
|
2085
2021
|
throw new Error("not a WithTwoGenerics json object");
|
|
2086
2022
|
}
|
|
2087
|
-
|
|
2023
|
+
assertReifiedTypeArgsMatch(composeSuiType(ObligationOwnerCap.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg]);
|
|
2088
2024
|
return ObligationOwnerCap.fromJSONField(typeArg, json);
|
|
2089
2025
|
}
|
|
2090
2026
|
static fromSuiParsedData(typeArg, content) {
|
|
@@ -2102,16 +2038,16 @@ class ObligationOwnerCap {
|
|
|
2102
2038
|
!isObligationOwnerCap(data.bcs.type)) {
|
|
2103
2039
|
throw new Error(`object at is not a ObligationOwnerCap object`);
|
|
2104
2040
|
}
|
|
2105
|
-
const gotTypeArgs =
|
|
2041
|
+
const gotTypeArgs = parseTypeName(data.bcs.type).typeArgs;
|
|
2106
2042
|
if (gotTypeArgs.length !== 1) {
|
|
2107
2043
|
throw new Error(`type argument mismatch: expected 1 type argument but got '${gotTypeArgs.length}'`);
|
|
2108
2044
|
}
|
|
2109
|
-
const gotTypeArg =
|
|
2110
|
-
const expectedTypeArg =
|
|
2111
|
-
if (gotTypeArg !==
|
|
2045
|
+
const gotTypeArg = compressSuiType(gotTypeArgs[0]);
|
|
2046
|
+
const expectedTypeArg = compressSuiType(extractType(typeArg));
|
|
2047
|
+
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
2112
2048
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
2113
2049
|
}
|
|
2114
|
-
return ObligationOwnerCap.fromBcs(typeArg, (
|
|
2050
|
+
return ObligationOwnerCap.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
2115
2051
|
}
|
|
2116
2052
|
if (data.content) {
|
|
2117
2053
|
return ObligationOwnerCap.fromSuiParsedData(typeArg, data.content);
|
|
@@ -2133,29 +2069,28 @@ class ObligationOwnerCap {
|
|
|
2133
2069
|
});
|
|
2134
2070
|
}
|
|
2135
2071
|
}
|
|
2136
|
-
|
|
2137
|
-
ObligationOwnerCap.$typeName = `${index_1.PKG_V1}::lending_market::ObligationOwnerCap`;
|
|
2072
|
+
ObligationOwnerCap.$typeName = `${PKG_V1}::lending_market::ObligationOwnerCap`;
|
|
2138
2073
|
ObligationOwnerCap.$numTypeParams = 1;
|
|
2139
2074
|
ObligationOwnerCap.$isPhantom = [true];
|
|
2140
2075
|
/* ============================== RateLimiterExemption =============================== */
|
|
2141
|
-
function isRateLimiterExemption(type) {
|
|
2142
|
-
type =
|
|
2143
|
-
return type.startsWith(`${
|
|
2076
|
+
export function isRateLimiterExemption(type) {
|
|
2077
|
+
type = compressSuiType(type);
|
|
2078
|
+
return type.startsWith(`${PKG_V1}::lending_market::RateLimiterExemption` + "<");
|
|
2144
2079
|
}
|
|
2145
|
-
class RateLimiterExemption {
|
|
2080
|
+
export class RateLimiterExemption {
|
|
2146
2081
|
constructor(typeArgs, fields) {
|
|
2147
2082
|
this.__StructClass = true;
|
|
2148
2083
|
this.$typeName = RateLimiterExemption.$typeName;
|
|
2149
2084
|
this.$isPhantom = RateLimiterExemption.$isPhantom;
|
|
2150
|
-
this.$fullTypeName =
|
|
2085
|
+
this.$fullTypeName = composeSuiType(RateLimiterExemption.$typeName, ...typeArgs);
|
|
2151
2086
|
this.$typeArgs = typeArgs;
|
|
2152
2087
|
this.amount = fields.amount;
|
|
2153
2088
|
}
|
|
2154
2089
|
static reified(P, T) {
|
|
2155
2090
|
return {
|
|
2156
2091
|
typeName: RateLimiterExemption.$typeName,
|
|
2157
|
-
fullTypeName:
|
|
2158
|
-
typeArgs: [
|
|
2092
|
+
fullTypeName: composeSuiType(RateLimiterExemption.$typeName, ...[extractType(P), extractType(T)]),
|
|
2093
|
+
typeArgs: [extractType(P), extractType(T)],
|
|
2159
2094
|
isPhantom: RateLimiterExemption.$isPhantom,
|
|
2160
2095
|
reifiedTypeArgs: [P, T],
|
|
2161
2096
|
fromFields: (fields) => RateLimiterExemption.fromFields([P, T], fields),
|
|
@@ -2168,7 +2103,7 @@ class RateLimiterExemption {
|
|
|
2168
2103
|
fromSuiObjectData: (content) => RateLimiterExemption.fromSuiObjectData([P, T], content),
|
|
2169
2104
|
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return RateLimiterExemption.fetch(client, [P, T], id); }),
|
|
2170
2105
|
new: (fields) => {
|
|
2171
|
-
return new RateLimiterExemption([
|
|
2106
|
+
return new RateLimiterExemption([extractType(P), extractType(T)], fields);
|
|
2172
2107
|
},
|
|
2173
2108
|
kind: "StructClassReified",
|
|
2174
2109
|
};
|
|
@@ -2177,28 +2112,28 @@ class RateLimiterExemption {
|
|
|
2177
2112
|
return RateLimiterExemption.reified;
|
|
2178
2113
|
}
|
|
2179
2114
|
static phantom(P, T) {
|
|
2180
|
-
return
|
|
2115
|
+
return phantom(RateLimiterExemption.reified(P, T));
|
|
2181
2116
|
}
|
|
2182
2117
|
static get p() {
|
|
2183
2118
|
return RateLimiterExemption.phantom;
|
|
2184
2119
|
}
|
|
2185
2120
|
static get bcs() {
|
|
2186
|
-
return
|
|
2187
|
-
amount:
|
|
2121
|
+
return bcs.struct("RateLimiterExemption", {
|
|
2122
|
+
amount: bcs.u64(),
|
|
2188
2123
|
});
|
|
2189
2124
|
}
|
|
2190
2125
|
static fromFields(typeArgs, fields) {
|
|
2191
2126
|
return RateLimiterExemption.reified(typeArgs[0], typeArgs[1]).new({
|
|
2192
|
-
amount:
|
|
2127
|
+
amount: decodeFromFields("u64", fields.amount),
|
|
2193
2128
|
});
|
|
2194
2129
|
}
|
|
2195
2130
|
static fromFieldsWithTypes(typeArgs, item) {
|
|
2196
2131
|
if (!isRateLimiterExemption(item.type)) {
|
|
2197
2132
|
throw new Error("not a RateLimiterExemption type");
|
|
2198
2133
|
}
|
|
2199
|
-
|
|
2134
|
+
assertFieldsWithTypesArgsMatch(item, typeArgs);
|
|
2200
2135
|
return RateLimiterExemption.reified(typeArgs[0], typeArgs[1]).new({
|
|
2201
|
-
amount:
|
|
2136
|
+
amount: decodeFromFieldsWithTypes("u64", item.fields.amount),
|
|
2202
2137
|
});
|
|
2203
2138
|
}
|
|
2204
2139
|
static fromBcs(typeArgs, data) {
|
|
@@ -2214,14 +2149,14 @@ class RateLimiterExemption {
|
|
|
2214
2149
|
}
|
|
2215
2150
|
static fromJSONField(typeArgs, field) {
|
|
2216
2151
|
return RateLimiterExemption.reified(typeArgs[0], typeArgs[1]).new({
|
|
2217
|
-
amount:
|
|
2152
|
+
amount: decodeFromJSONField("u64", field.amount),
|
|
2218
2153
|
});
|
|
2219
2154
|
}
|
|
2220
2155
|
static fromJSON(typeArgs, json) {
|
|
2221
2156
|
if (json.$typeName !== RateLimiterExemption.$typeName) {
|
|
2222
2157
|
throw new Error("not a WithTwoGenerics json object");
|
|
2223
2158
|
}
|
|
2224
|
-
|
|
2159
|
+
assertReifiedTypeArgsMatch(composeSuiType(RateLimiterExemption.$typeName, ...typeArgs.map(extractType)), json.$typeArgs, typeArgs);
|
|
2225
2160
|
return RateLimiterExemption.fromJSONField(typeArgs, json);
|
|
2226
2161
|
}
|
|
2227
2162
|
static fromSuiParsedData(typeArgs, content) {
|
|
@@ -2239,18 +2174,18 @@ class RateLimiterExemption {
|
|
|
2239
2174
|
!isRateLimiterExemption(data.bcs.type)) {
|
|
2240
2175
|
throw new Error(`object at is not a RateLimiterExemption object`);
|
|
2241
2176
|
}
|
|
2242
|
-
const gotTypeArgs =
|
|
2177
|
+
const gotTypeArgs = parseTypeName(data.bcs.type).typeArgs;
|
|
2243
2178
|
if (gotTypeArgs.length !== 2) {
|
|
2244
2179
|
throw new Error(`type argument mismatch: expected 2 type arguments but got ${gotTypeArgs.length}`);
|
|
2245
2180
|
}
|
|
2246
2181
|
for (let i = 0; i < 2; i++) {
|
|
2247
|
-
const gotTypeArg =
|
|
2248
|
-
const expectedTypeArg =
|
|
2182
|
+
const gotTypeArg = compressSuiType(gotTypeArgs[i]);
|
|
2183
|
+
const expectedTypeArg = compressSuiType(extractType(typeArgs[i]));
|
|
2249
2184
|
if (gotTypeArg !== expectedTypeArg) {
|
|
2250
2185
|
throw new Error(`type argument mismatch at position ${i}: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
2251
2186
|
}
|
|
2252
2187
|
}
|
|
2253
|
-
return RateLimiterExemption.fromBcs(typeArgs, (
|
|
2188
|
+
return RateLimiterExemption.fromBcs(typeArgs, fromBase64(data.bcs.bcsBytes));
|
|
2254
2189
|
}
|
|
2255
2190
|
if (data.content) {
|
|
2256
2191
|
return RateLimiterExemption.fromSuiParsedData(typeArgs, data.content);
|
|
@@ -2272,21 +2207,20 @@ class RateLimiterExemption {
|
|
|
2272
2207
|
});
|
|
2273
2208
|
}
|
|
2274
2209
|
}
|
|
2275
|
-
|
|
2276
|
-
RateLimiterExemption.$typeName = `${index_1.PKG_V1}::lending_market::RateLimiterExemption`;
|
|
2210
|
+
RateLimiterExemption.$typeName = `${PKG_V1}::lending_market::RateLimiterExemption`;
|
|
2277
2211
|
RateLimiterExemption.$numTypeParams = 2;
|
|
2278
2212
|
RateLimiterExemption.$isPhantom = [true, true];
|
|
2279
2213
|
/* ============================== RepayEvent =============================== */
|
|
2280
|
-
function isRepayEvent(type) {
|
|
2281
|
-
type =
|
|
2282
|
-
return type === `${
|
|
2214
|
+
export function isRepayEvent(type) {
|
|
2215
|
+
type = compressSuiType(type);
|
|
2216
|
+
return type === `${PKG_V1}::lending_market::RepayEvent`;
|
|
2283
2217
|
}
|
|
2284
|
-
class RepayEvent {
|
|
2218
|
+
export class RepayEvent {
|
|
2285
2219
|
constructor(typeArgs, fields) {
|
|
2286
2220
|
this.__StructClass = true;
|
|
2287
2221
|
this.$typeName = RepayEvent.$typeName;
|
|
2288
2222
|
this.$isPhantom = RepayEvent.$isPhantom;
|
|
2289
|
-
this.$fullTypeName =
|
|
2223
|
+
this.$fullTypeName = composeSuiType(RepayEvent.$typeName, ...typeArgs);
|
|
2290
2224
|
this.$typeArgs = typeArgs;
|
|
2291
2225
|
this.lendingMarketId = fields.lendingMarketId;
|
|
2292
2226
|
this.coinType = fields.coinType;
|
|
@@ -2297,7 +2231,7 @@ class RepayEvent {
|
|
|
2297
2231
|
static reified() {
|
|
2298
2232
|
return {
|
|
2299
2233
|
typeName: RepayEvent.$typeName,
|
|
2300
|
-
fullTypeName:
|
|
2234
|
+
fullTypeName: composeSuiType(RepayEvent.$typeName, ...[]),
|
|
2301
2235
|
typeArgs: [],
|
|
2302
2236
|
isPhantom: RepayEvent.$isPhantom,
|
|
2303
2237
|
reifiedTypeArgs: [],
|
|
@@ -2320,42 +2254,42 @@ class RepayEvent {
|
|
|
2320
2254
|
return RepayEvent.reified();
|
|
2321
2255
|
}
|
|
2322
2256
|
static phantom() {
|
|
2323
|
-
return
|
|
2257
|
+
return phantom(RepayEvent.reified());
|
|
2324
2258
|
}
|
|
2325
2259
|
static get p() {
|
|
2326
2260
|
return RepayEvent.phantom();
|
|
2327
2261
|
}
|
|
2328
2262
|
static get bcs() {
|
|
2329
|
-
return
|
|
2330
|
-
lending_market_id:
|
|
2263
|
+
return bcs.struct("RepayEvent", {
|
|
2264
|
+
lending_market_id: bcs
|
|
2331
2265
|
.bytes(32)
|
|
2332
2266
|
.transform({
|
|
2333
|
-
input: (val) => (
|
|
2334
|
-
output: (val) => (
|
|
2267
|
+
input: (val) => fromHex(val),
|
|
2268
|
+
output: (val) => toHex(val),
|
|
2335
2269
|
}),
|
|
2336
|
-
coin_type:
|
|
2337
|
-
reserve_id:
|
|
2270
|
+
coin_type: TypeName.bcs,
|
|
2271
|
+
reserve_id: bcs
|
|
2338
2272
|
.bytes(32)
|
|
2339
2273
|
.transform({
|
|
2340
|
-
input: (val) => (
|
|
2341
|
-
output: (val) => (
|
|
2274
|
+
input: (val) => fromHex(val),
|
|
2275
|
+
output: (val) => toHex(val),
|
|
2342
2276
|
}),
|
|
2343
|
-
obligation_id:
|
|
2277
|
+
obligation_id: bcs
|
|
2344
2278
|
.bytes(32)
|
|
2345
2279
|
.transform({
|
|
2346
|
-
input: (val) => (
|
|
2347
|
-
output: (val) => (
|
|
2280
|
+
input: (val) => fromHex(val),
|
|
2281
|
+
output: (val) => toHex(val),
|
|
2348
2282
|
}),
|
|
2349
|
-
liquidity_amount:
|
|
2283
|
+
liquidity_amount: bcs.u64(),
|
|
2350
2284
|
});
|
|
2351
2285
|
}
|
|
2352
2286
|
static fromFields(fields) {
|
|
2353
2287
|
return RepayEvent.reified().new({
|
|
2354
|
-
lendingMarketId:
|
|
2355
|
-
coinType:
|
|
2356
|
-
reserveId:
|
|
2357
|
-
obligationId:
|
|
2358
|
-
liquidityAmount:
|
|
2288
|
+
lendingMarketId: decodeFromFields("address", fields.lending_market_id),
|
|
2289
|
+
coinType: decodeFromFields(TypeName.reified(), fields.coin_type),
|
|
2290
|
+
reserveId: decodeFromFields("address", fields.reserve_id),
|
|
2291
|
+
obligationId: decodeFromFields("address", fields.obligation_id),
|
|
2292
|
+
liquidityAmount: decodeFromFields("u64", fields.liquidity_amount),
|
|
2359
2293
|
});
|
|
2360
2294
|
}
|
|
2361
2295
|
static fromFieldsWithTypes(item) {
|
|
@@ -2363,11 +2297,11 @@ class RepayEvent {
|
|
|
2363
2297
|
throw new Error("not a RepayEvent type");
|
|
2364
2298
|
}
|
|
2365
2299
|
return RepayEvent.reified().new({
|
|
2366
|
-
lendingMarketId:
|
|
2367
|
-
coinType:
|
|
2368
|
-
reserveId:
|
|
2369
|
-
obligationId:
|
|
2370
|
-
liquidityAmount:
|
|
2300
|
+
lendingMarketId: decodeFromFieldsWithTypes("address", item.fields.lending_market_id),
|
|
2301
|
+
coinType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.coin_type),
|
|
2302
|
+
reserveId: decodeFromFieldsWithTypes("address", item.fields.reserve_id),
|
|
2303
|
+
obligationId: decodeFromFieldsWithTypes("address", item.fields.obligation_id),
|
|
2304
|
+
liquidityAmount: decodeFromFieldsWithTypes("u64", item.fields.liquidity_amount),
|
|
2371
2305
|
});
|
|
2372
2306
|
}
|
|
2373
2307
|
static fromBcs(data) {
|
|
@@ -2387,11 +2321,11 @@ class RepayEvent {
|
|
|
2387
2321
|
}
|
|
2388
2322
|
static fromJSONField(field) {
|
|
2389
2323
|
return RepayEvent.reified().new({
|
|
2390
|
-
lendingMarketId:
|
|
2391
|
-
coinType:
|
|
2392
|
-
reserveId:
|
|
2393
|
-
obligationId:
|
|
2394
|
-
liquidityAmount:
|
|
2324
|
+
lendingMarketId: decodeFromJSONField("address", field.lendingMarketId),
|
|
2325
|
+
coinType: decodeFromJSONField(TypeName.reified(), field.coinType),
|
|
2326
|
+
reserveId: decodeFromJSONField("address", field.reserveId),
|
|
2327
|
+
obligationId: decodeFromJSONField("address", field.obligationId),
|
|
2328
|
+
liquidityAmount: decodeFromJSONField("u64", field.liquidityAmount),
|
|
2395
2329
|
});
|
|
2396
2330
|
}
|
|
2397
2331
|
static fromJSON(json) {
|
|
@@ -2414,7 +2348,7 @@ class RepayEvent {
|
|
|
2414
2348
|
if (data.bcs.dataType !== "moveObject" || !isRepayEvent(data.bcs.type)) {
|
|
2415
2349
|
throw new Error(`object at is not a RepayEvent object`);
|
|
2416
2350
|
}
|
|
2417
|
-
return RepayEvent.fromBcs((
|
|
2351
|
+
return RepayEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
2418
2352
|
}
|
|
2419
2353
|
if (data.content) {
|
|
2420
2354
|
return RepayEvent.fromSuiParsedData(data.content);
|
|
@@ -2436,21 +2370,20 @@ class RepayEvent {
|
|
|
2436
2370
|
});
|
|
2437
2371
|
}
|
|
2438
2372
|
}
|
|
2439
|
-
|
|
2440
|
-
RepayEvent.$typeName = `${index_1.PKG_V1}::lending_market::RepayEvent`;
|
|
2373
|
+
RepayEvent.$typeName = `${PKG_V1}::lending_market::RepayEvent`;
|
|
2441
2374
|
RepayEvent.$numTypeParams = 0;
|
|
2442
2375
|
RepayEvent.$isPhantom = [];
|
|
2443
2376
|
/* ============================== WithdrawEvent =============================== */
|
|
2444
|
-
function isWithdrawEvent(type) {
|
|
2445
|
-
type =
|
|
2446
|
-
return type === `${
|
|
2377
|
+
export function isWithdrawEvent(type) {
|
|
2378
|
+
type = compressSuiType(type);
|
|
2379
|
+
return type === `${PKG_V1}::lending_market::WithdrawEvent`;
|
|
2447
2380
|
}
|
|
2448
|
-
class WithdrawEvent {
|
|
2381
|
+
export class WithdrawEvent {
|
|
2449
2382
|
constructor(typeArgs, fields) {
|
|
2450
2383
|
this.__StructClass = true;
|
|
2451
2384
|
this.$typeName = WithdrawEvent.$typeName;
|
|
2452
2385
|
this.$isPhantom = WithdrawEvent.$isPhantom;
|
|
2453
|
-
this.$fullTypeName =
|
|
2386
|
+
this.$fullTypeName = composeSuiType(WithdrawEvent.$typeName, ...typeArgs);
|
|
2454
2387
|
this.$typeArgs = typeArgs;
|
|
2455
2388
|
this.lendingMarketId = fields.lendingMarketId;
|
|
2456
2389
|
this.coinType = fields.coinType;
|
|
@@ -2461,7 +2394,7 @@ class WithdrawEvent {
|
|
|
2461
2394
|
static reified() {
|
|
2462
2395
|
return {
|
|
2463
2396
|
typeName: WithdrawEvent.$typeName,
|
|
2464
|
-
fullTypeName:
|
|
2397
|
+
fullTypeName: composeSuiType(WithdrawEvent.$typeName, ...[]),
|
|
2465
2398
|
typeArgs: [],
|
|
2466
2399
|
isPhantom: WithdrawEvent.$isPhantom,
|
|
2467
2400
|
reifiedTypeArgs: [],
|
|
@@ -2484,42 +2417,42 @@ class WithdrawEvent {
|
|
|
2484
2417
|
return WithdrawEvent.reified();
|
|
2485
2418
|
}
|
|
2486
2419
|
static phantom() {
|
|
2487
|
-
return
|
|
2420
|
+
return phantom(WithdrawEvent.reified());
|
|
2488
2421
|
}
|
|
2489
2422
|
static get p() {
|
|
2490
2423
|
return WithdrawEvent.phantom();
|
|
2491
2424
|
}
|
|
2492
2425
|
static get bcs() {
|
|
2493
|
-
return
|
|
2494
|
-
lending_market_id:
|
|
2426
|
+
return bcs.struct("WithdrawEvent", {
|
|
2427
|
+
lending_market_id: bcs
|
|
2495
2428
|
.bytes(32)
|
|
2496
2429
|
.transform({
|
|
2497
|
-
input: (val) => (
|
|
2498
|
-
output: (val) => (
|
|
2430
|
+
input: (val) => fromHex(val),
|
|
2431
|
+
output: (val) => toHex(val),
|
|
2499
2432
|
}),
|
|
2500
|
-
coin_type:
|
|
2501
|
-
reserve_id:
|
|
2433
|
+
coin_type: TypeName.bcs,
|
|
2434
|
+
reserve_id: bcs
|
|
2502
2435
|
.bytes(32)
|
|
2503
2436
|
.transform({
|
|
2504
|
-
input: (val) => (
|
|
2505
|
-
output: (val) => (
|
|
2437
|
+
input: (val) => fromHex(val),
|
|
2438
|
+
output: (val) => toHex(val),
|
|
2506
2439
|
}),
|
|
2507
|
-
obligation_id:
|
|
2440
|
+
obligation_id: bcs
|
|
2508
2441
|
.bytes(32)
|
|
2509
2442
|
.transform({
|
|
2510
|
-
input: (val) => (
|
|
2511
|
-
output: (val) => (
|
|
2443
|
+
input: (val) => fromHex(val),
|
|
2444
|
+
output: (val) => toHex(val),
|
|
2512
2445
|
}),
|
|
2513
|
-
ctoken_amount:
|
|
2446
|
+
ctoken_amount: bcs.u64(),
|
|
2514
2447
|
});
|
|
2515
2448
|
}
|
|
2516
2449
|
static fromFields(fields) {
|
|
2517
2450
|
return WithdrawEvent.reified().new({
|
|
2518
|
-
lendingMarketId:
|
|
2519
|
-
coinType:
|
|
2520
|
-
reserveId:
|
|
2521
|
-
obligationId:
|
|
2522
|
-
ctokenAmount:
|
|
2451
|
+
lendingMarketId: decodeFromFields("address", fields.lending_market_id),
|
|
2452
|
+
coinType: decodeFromFields(TypeName.reified(), fields.coin_type),
|
|
2453
|
+
reserveId: decodeFromFields("address", fields.reserve_id),
|
|
2454
|
+
obligationId: decodeFromFields("address", fields.obligation_id),
|
|
2455
|
+
ctokenAmount: decodeFromFields("u64", fields.ctoken_amount),
|
|
2523
2456
|
});
|
|
2524
2457
|
}
|
|
2525
2458
|
static fromFieldsWithTypes(item) {
|
|
@@ -2527,11 +2460,11 @@ class WithdrawEvent {
|
|
|
2527
2460
|
throw new Error("not a WithdrawEvent type");
|
|
2528
2461
|
}
|
|
2529
2462
|
return WithdrawEvent.reified().new({
|
|
2530
|
-
lendingMarketId:
|
|
2531
|
-
coinType:
|
|
2532
|
-
reserveId:
|
|
2533
|
-
obligationId:
|
|
2534
|
-
ctokenAmount:
|
|
2463
|
+
lendingMarketId: decodeFromFieldsWithTypes("address", item.fields.lending_market_id),
|
|
2464
|
+
coinType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.coin_type),
|
|
2465
|
+
reserveId: decodeFromFieldsWithTypes("address", item.fields.reserve_id),
|
|
2466
|
+
obligationId: decodeFromFieldsWithTypes("address", item.fields.obligation_id),
|
|
2467
|
+
ctokenAmount: decodeFromFieldsWithTypes("u64", item.fields.ctoken_amount),
|
|
2535
2468
|
});
|
|
2536
2469
|
}
|
|
2537
2470
|
static fromBcs(data) {
|
|
@@ -2551,11 +2484,11 @@ class WithdrawEvent {
|
|
|
2551
2484
|
}
|
|
2552
2485
|
static fromJSONField(field) {
|
|
2553
2486
|
return WithdrawEvent.reified().new({
|
|
2554
|
-
lendingMarketId:
|
|
2555
|
-
coinType:
|
|
2556
|
-
reserveId:
|
|
2557
|
-
obligationId:
|
|
2558
|
-
ctokenAmount:
|
|
2487
|
+
lendingMarketId: decodeFromJSONField("address", field.lendingMarketId),
|
|
2488
|
+
coinType: decodeFromJSONField(TypeName.reified(), field.coinType),
|
|
2489
|
+
reserveId: decodeFromJSONField("address", field.reserveId),
|
|
2490
|
+
obligationId: decodeFromJSONField("address", field.obligationId),
|
|
2491
|
+
ctokenAmount: decodeFromJSONField("u64", field.ctokenAmount),
|
|
2559
2492
|
});
|
|
2560
2493
|
}
|
|
2561
2494
|
static fromJSON(json) {
|
|
@@ -2579,7 +2512,7 @@ class WithdrawEvent {
|
|
|
2579
2512
|
!isWithdrawEvent(data.bcs.type)) {
|
|
2580
2513
|
throw new Error(`object at is not a WithdrawEvent object`);
|
|
2581
2514
|
}
|
|
2582
|
-
return WithdrawEvent.fromBcs((
|
|
2515
|
+
return WithdrawEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
2583
2516
|
}
|
|
2584
2517
|
if (data.content) {
|
|
2585
2518
|
return WithdrawEvent.fromSuiParsedData(data.content);
|
|
@@ -2601,7 +2534,6 @@ class WithdrawEvent {
|
|
|
2601
2534
|
});
|
|
2602
2535
|
}
|
|
2603
2536
|
}
|
|
2604
|
-
|
|
2605
|
-
WithdrawEvent.$typeName = `${index_1.PKG_V1}::lending_market::WithdrawEvent`;
|
|
2537
|
+
WithdrawEvent.$typeName = `${PKG_V1}::lending_market::WithdrawEvent`;
|
|
2606
2538
|
WithdrawEvent.$numTypeParams = 0;
|
|
2607
2539
|
WithdrawEvent.$isPhantom = [];
|