@suilend/sdk 1.1.30 → 1.1.31
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 +3 -3
- package/_generated/_dependencies/source/0x1/ascii/structs.js +4 -4
- package/_generated/_dependencies/source/0x1/index.d.ts +1 -1
- package/_generated/_dependencies/source/0x1/index.js +2 -2
- package/_generated/_dependencies/source/0x1/option/structs.d.ts +2 -2
- package/_generated/_dependencies/source/0x1/option/structs.js +2 -2
- package/_generated/_dependencies/source/0x1/type-name/structs.d.ts +2 -2
- package/_generated/_dependencies/source/0x1/type-name/structs.js +2 -2
- package/_generated/_dependencies/source/0x2/bag/structs.d.ts +2 -2
- package/_generated/_dependencies/source/0x2/bag/structs.js +2 -2
- package/_generated/_dependencies/source/0x2/balance/structs.d.ts +3 -3
- package/_generated/_dependencies/source/0x2/balance/structs.js +4 -4
- package/_generated/_dependencies/source/0x2/index.d.ts +1 -1
- package/_generated/_dependencies/source/0x2/index.js +2 -2
- package/_generated/_dependencies/source/0x2/object/structs.d.ts +3 -3
- package/_generated/_dependencies/source/0x2/object/structs.js +4 -4
- package/_generated/_dependencies/source/0x2/object-table/structs.d.ts +2 -2
- package/_generated/_dependencies/source/0x2/object-table/structs.js +2 -2
- package/_generated/suilend/index.d.ts +2 -0
- package/_generated/suilend/index.js +9 -3
- package/_generated/suilend/lending-market/functions.d.ts +9 -2
- package/_generated/suilend/lending-market/functions.js +22 -9
- package/_generated/suilend/lending-market/structs.d.ts +101 -1
- package/_generated/suilend/lending-market/structs.js +272 -1
- package/_generated/suilend/reserve/structs.d.ts +6 -6
- package/_generated/suilend/reserve/structs.js +6 -6
- package/_generated/suilend/reserve-config/functions.d.ts +2 -2
- package/_generated/suilend/reserve-config/functions.js +14 -14
- package/client.d.ts +3 -1
- package/client.js +32 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import * as reified from "../../../../_framework/reified";
|
|
|
2
2
|
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
3
3
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
4
4
|
import { Vector } from "../../../../_framework/vector";
|
|
5
|
-
import {
|
|
5
|
+
import { PKG_V13 } from "../index";
|
|
6
6
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
7
7
|
export declare function isChar(type: string): boolean;
|
|
8
8
|
export interface CharFields {
|
|
@@ -15,7 +15,7 @@ export declare class Char implements StructClass {
|
|
|
15
15
|
static readonly $numTypeParams = 0;
|
|
16
16
|
static readonly $isPhantom: readonly [];
|
|
17
17
|
readonly $typeName = "0x1::ascii::Char";
|
|
18
|
-
readonly $fullTypeName: `${typeof
|
|
18
|
+
readonly $fullTypeName: `${typeof PKG_V13}::ascii::Char`;
|
|
19
19
|
readonly $typeArgs: [];
|
|
20
20
|
readonly $isPhantom: readonly [];
|
|
21
21
|
readonly byte: ToField<"u8">;
|
|
@@ -57,7 +57,7 @@ export declare class String implements StructClass {
|
|
|
57
57
|
static readonly $numTypeParams = 0;
|
|
58
58
|
static readonly $isPhantom: readonly [];
|
|
59
59
|
readonly $typeName = "0x1::ascii::String";
|
|
60
|
-
readonly $fullTypeName: `${typeof
|
|
60
|
+
readonly $fullTypeName: `${typeof PKG_V13}::ascii::String`;
|
|
61
61
|
readonly $typeArgs: [];
|
|
62
62
|
readonly $isPhantom: readonly [];
|
|
63
63
|
readonly bytes: ToField<Vector<"u8">>;
|
|
@@ -54,7 +54,7 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
54
54
|
/* ============================== Char =============================== */
|
|
55
55
|
function isChar(type) {
|
|
56
56
|
type = (0, util_1.compressSuiType)(type);
|
|
57
|
-
return type === `${index_1.
|
|
57
|
+
return type === `${index_1.PKG_V13}::ascii::Char`;
|
|
58
58
|
}
|
|
59
59
|
class Char {
|
|
60
60
|
constructor(typeArgs, fields) {
|
|
@@ -169,13 +169,13 @@ class Char {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
exports.Char = Char;
|
|
172
|
-
Char.$typeName = `${index_1.
|
|
172
|
+
Char.$typeName = `${index_1.PKG_V13}::ascii::Char`;
|
|
173
173
|
Char.$numTypeParams = 0;
|
|
174
174
|
Char.$isPhantom = [];
|
|
175
175
|
/* ============================== String =============================== */
|
|
176
176
|
function isString(type) {
|
|
177
177
|
type = (0, util_1.compressSuiType)(type);
|
|
178
|
-
return type === `${index_1.
|
|
178
|
+
return type === `${index_1.PKG_V13}::ascii::String`;
|
|
179
179
|
}
|
|
180
180
|
class String {
|
|
181
181
|
constructor(typeArgs, fields) {
|
|
@@ -294,6 +294,6 @@ class String {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
exports.String = String;
|
|
297
|
-
String.$typeName = `${index_1.
|
|
297
|
+
String.$typeName = `${index_1.PKG_V13}::ascii::String`;
|
|
298
298
|
String.$numTypeParams = 0;
|
|
299
299
|
String.$isPhantom = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PKG_V13 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
|
|
4
4
|
exports.PACKAGE_ID = "0x1";
|
|
5
5
|
exports.PUBLISHED_AT = "0x1";
|
|
6
|
-
exports.
|
|
6
|
+
exports.PKG_V13 = "0x1";
|
|
@@ -2,7 +2,7 @@ import * as reified from "../../../../_framework/reified";
|
|
|
2
2
|
import { PhantomReified, Reified, StructClass, ToField, ToTypeArgument, ToTypeStr, TypeArgument } from "../../../../_framework/reified";
|
|
3
3
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
4
4
|
import { Vector } from "../../../../_framework/vector";
|
|
5
|
-
import {
|
|
5
|
+
import { PKG_V13 } from "../index";
|
|
6
6
|
import { BcsType } from "@mysten/sui/bcs";
|
|
7
7
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
8
8
|
export declare function isOption(type: string): boolean;
|
|
@@ -17,7 +17,7 @@ export declare class Option<Element extends TypeArgument> implements StructClass
|
|
|
17
17
|
static readonly $isPhantom: readonly [false];
|
|
18
18
|
__inner: Element;
|
|
19
19
|
readonly $typeName = "0x1::option::Option";
|
|
20
|
-
readonly $fullTypeName: `${typeof
|
|
20
|
+
readonly $fullTypeName: `${typeof PKG_V13}::option::Option<${ToTypeStr<Element>}>`;
|
|
21
21
|
readonly $typeArgs: [ToTypeStr<Element>];
|
|
22
22
|
readonly $isPhantom: readonly [false];
|
|
23
23
|
readonly vec: ToField<Vector<Element>>;
|
|
@@ -53,7 +53,7 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
53
53
|
/* ============================== Option =============================== */
|
|
54
54
|
function isOption(type) {
|
|
55
55
|
type = (0, util_1.compressSuiType)(type);
|
|
56
|
-
return type.startsWith(`${index_1.
|
|
56
|
+
return type.startsWith(`${index_1.PKG_V13}::option::Option` + "<");
|
|
57
57
|
}
|
|
58
58
|
class Option {
|
|
59
59
|
constructor(typeArgs, fields) {
|
|
@@ -185,6 +185,6 @@ class Option {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
exports.Option = Option;
|
|
188
|
-
Option.$typeName = `${index_1.
|
|
188
|
+
Option.$typeName = `${index_1.PKG_V13}::option::Option`;
|
|
189
189
|
Option.$numTypeParams = 1;
|
|
190
190
|
Option.$isPhantom = [false];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
2
2
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
3
|
import { String } from "../ascii/structs";
|
|
4
|
-
import {
|
|
4
|
+
import { PKG_V13 } from "../index";
|
|
5
5
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
6
6
|
export declare function isTypeName(type: string): boolean;
|
|
7
7
|
export interface TypeNameFields {
|
|
@@ -14,7 +14,7 @@ export declare class TypeName implements StructClass {
|
|
|
14
14
|
static readonly $numTypeParams = 0;
|
|
15
15
|
static readonly $isPhantom: readonly [];
|
|
16
16
|
readonly $typeName = "0x1::type_name::TypeName";
|
|
17
|
-
readonly $fullTypeName: `${typeof
|
|
17
|
+
readonly $fullTypeName: `${typeof PKG_V13}::type_name::TypeName`;
|
|
18
18
|
readonly $typeArgs: [];
|
|
19
19
|
readonly $isPhantom: readonly [];
|
|
20
20
|
readonly name: ToField<String>;
|
|
@@ -20,7 +20,7 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
20
20
|
/* ============================== TypeName =============================== */
|
|
21
21
|
function isTypeName(type) {
|
|
22
22
|
type = (0, util_1.compressSuiType)(type);
|
|
23
|
-
return type === `${index_1.
|
|
23
|
+
return type === `${index_1.PKG_V13}::type_name::TypeName`;
|
|
24
24
|
}
|
|
25
25
|
class TypeName {
|
|
26
26
|
constructor(typeArgs, fields) {
|
|
@@ -139,6 +139,6 @@ class TypeName {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
exports.TypeName = TypeName;
|
|
142
|
-
TypeName.$typeName = `${index_1.
|
|
142
|
+
TypeName.$typeName = `${index_1.PKG_V13}::type_name::TypeName`;
|
|
143
143
|
TypeName.$numTypeParams = 0;
|
|
144
144
|
TypeName.$isPhantom = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
2
2
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
|
-
import {
|
|
3
|
+
import { PKG_V30 } from "../index";
|
|
4
4
|
import { UID } from "../object/structs";
|
|
5
5
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
6
6
|
export declare function isBag(type: string): boolean;
|
|
@@ -15,7 +15,7 @@ export declare class Bag implements StructClass {
|
|
|
15
15
|
static readonly $numTypeParams = 0;
|
|
16
16
|
static readonly $isPhantom: readonly [];
|
|
17
17
|
readonly $typeName = "0x2::bag::Bag";
|
|
18
|
-
readonly $fullTypeName: `${typeof
|
|
18
|
+
readonly $fullTypeName: `${typeof PKG_V30}::bag::Bag`;
|
|
19
19
|
readonly $typeArgs: [];
|
|
20
20
|
readonly $isPhantom: readonly [];
|
|
21
21
|
readonly id: ToField<UID>;
|
|
@@ -20,7 +20,7 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
20
20
|
/* ============================== Bag =============================== */
|
|
21
21
|
function isBag(type) {
|
|
22
22
|
type = (0, util_1.compressSuiType)(type);
|
|
23
|
-
return type === `${index_1.
|
|
23
|
+
return type === `${index_1.PKG_V30}::bag::Bag`;
|
|
24
24
|
}
|
|
25
25
|
class Bag {
|
|
26
26
|
constructor(typeArgs, fields) {
|
|
@@ -144,6 +144,6 @@ class Bag {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
exports.Bag = Bag;
|
|
147
|
-
Bag.$typeName = `${index_1.
|
|
147
|
+
Bag.$typeName = `${index_1.PKG_V30}::bag::Bag`;
|
|
148
148
|
Bag.$numTypeParams = 0;
|
|
149
149
|
Bag.$isPhantom = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToPhantomTypeArgument, ToTypeStr } from "../../../../_framework/reified";
|
|
2
2
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
|
-
import {
|
|
3
|
+
import { PKG_V30 } from "../index";
|
|
4
4
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
5
5
|
export declare function isBalance(type: string): boolean;
|
|
6
6
|
export interface BalanceFields<T extends PhantomTypeArgument> {
|
|
@@ -13,7 +13,7 @@ export declare class Balance<T extends PhantomTypeArgument> implements StructCla
|
|
|
13
13
|
static readonly $numTypeParams = 1;
|
|
14
14
|
static readonly $isPhantom: readonly [true];
|
|
15
15
|
readonly $typeName = "0x2::balance::Balance";
|
|
16
|
-
readonly $fullTypeName: `${typeof
|
|
16
|
+
readonly $fullTypeName: `${typeof PKG_V30}::balance::Balance<${PhantomToTypeStr<T>}>`;
|
|
17
17
|
readonly $typeArgs: [PhantomToTypeStr<T>];
|
|
18
18
|
readonly $isPhantom: readonly [true];
|
|
19
19
|
readonly value: ToField<"u64">;
|
|
@@ -55,7 +55,7 @@ export declare class Supply<T extends PhantomTypeArgument> implements StructClas
|
|
|
55
55
|
static readonly $numTypeParams = 1;
|
|
56
56
|
static readonly $isPhantom: readonly [true];
|
|
57
57
|
readonly $typeName = "0x2::balance::Supply";
|
|
58
|
-
readonly $fullTypeName: `${typeof
|
|
58
|
+
readonly $fullTypeName: `${typeof PKG_V30}::balance::Supply<${PhantomToTypeStr<T>}>`;
|
|
59
59
|
readonly $typeArgs: [PhantomToTypeStr<T>];
|
|
60
60
|
readonly $isPhantom: readonly [true];
|
|
61
61
|
readonly value: ToField<"u64">;
|
|
@@ -20,7 +20,7 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
20
20
|
/* ============================== Balance =============================== */
|
|
21
21
|
function isBalance(type) {
|
|
22
22
|
type = (0, util_1.compressSuiType)(type);
|
|
23
|
-
return type.startsWith(`${index_1.
|
|
23
|
+
return type.startsWith(`${index_1.PKG_V30}::balance::Balance` + "<");
|
|
24
24
|
}
|
|
25
25
|
class Balance {
|
|
26
26
|
constructor(typeArgs, fields) {
|
|
@@ -150,13 +150,13 @@ class Balance {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
exports.Balance = Balance;
|
|
153
|
-
Balance.$typeName = `${index_1.
|
|
153
|
+
Balance.$typeName = `${index_1.PKG_V30}::balance::Balance`;
|
|
154
154
|
Balance.$numTypeParams = 1;
|
|
155
155
|
Balance.$isPhantom = [true];
|
|
156
156
|
/* ============================== Supply =============================== */
|
|
157
157
|
function isSupply(type) {
|
|
158
158
|
type = (0, util_1.compressSuiType)(type);
|
|
159
|
-
return type.startsWith(`${index_1.
|
|
159
|
+
return type.startsWith(`${index_1.PKG_V30}::balance::Supply` + "<");
|
|
160
160
|
}
|
|
161
161
|
class Supply {
|
|
162
162
|
constructor(typeArgs, fields) {
|
|
@@ -286,6 +286,6 @@ class Supply {
|
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
exports.Supply = Supply;
|
|
289
|
-
Supply.$typeName = `${index_1.
|
|
289
|
+
Supply.$typeName = `${index_1.PKG_V30}::balance::Supply`;
|
|
290
290
|
Supply.$numTypeParams = 1;
|
|
291
291
|
Supply.$isPhantom = [true];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PKG_V30 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
|
|
4
4
|
exports.PACKAGE_ID = "0x2";
|
|
5
5
|
exports.PUBLISHED_AT = "0x2";
|
|
6
|
-
exports.
|
|
6
|
+
exports.PKG_V30 = "0x2";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
2
2
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
|
-
import {
|
|
3
|
+
import { PKG_V30 } from "../index";
|
|
4
4
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
5
5
|
export declare function isID(type: string): boolean;
|
|
6
6
|
export interface IDFields {
|
|
@@ -13,7 +13,7 @@ export declare class ID implements StructClass {
|
|
|
13
13
|
static readonly $numTypeParams = 0;
|
|
14
14
|
static readonly $isPhantom: readonly [];
|
|
15
15
|
readonly $typeName = "0x2::object::ID";
|
|
16
|
-
readonly $fullTypeName: `${typeof
|
|
16
|
+
readonly $fullTypeName: `${typeof PKG_V30}::object::ID`;
|
|
17
17
|
readonly $typeArgs: [];
|
|
18
18
|
readonly $isPhantom: readonly [];
|
|
19
19
|
readonly bytes: ToField<"address">;
|
|
@@ -55,7 +55,7 @@ export declare class UID implements StructClass {
|
|
|
55
55
|
static readonly $numTypeParams = 0;
|
|
56
56
|
static readonly $isPhantom: readonly [];
|
|
57
57
|
readonly $typeName = "0x2::object::UID";
|
|
58
|
-
readonly $fullTypeName: `${typeof
|
|
58
|
+
readonly $fullTypeName: `${typeof PKG_V30}::object::UID`;
|
|
59
59
|
readonly $typeArgs: [];
|
|
60
60
|
readonly $isPhantom: readonly [];
|
|
61
61
|
readonly id: ToField<ID>;
|
|
@@ -20,7 +20,7 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
20
20
|
/* ============================== ID =============================== */
|
|
21
21
|
function isID(type) {
|
|
22
22
|
type = (0, util_1.compressSuiType)(type);
|
|
23
|
-
return type === `${index_1.
|
|
23
|
+
return type === `${index_1.PKG_V30}::object::ID`;
|
|
24
24
|
}
|
|
25
25
|
class ID {
|
|
26
26
|
constructor(typeArgs, fields) {
|
|
@@ -143,13 +143,13 @@ class ID {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
exports.ID = ID;
|
|
146
|
-
ID.$typeName = `${index_1.
|
|
146
|
+
ID.$typeName = `${index_1.PKG_V30}::object::ID`;
|
|
147
147
|
ID.$numTypeParams = 0;
|
|
148
148
|
ID.$isPhantom = [];
|
|
149
149
|
/* ============================== UID =============================== */
|
|
150
150
|
function isUID(type) {
|
|
151
151
|
type = (0, util_1.compressSuiType)(type);
|
|
152
|
-
return type === `${index_1.
|
|
152
|
+
return type === `${index_1.PKG_V30}::object::UID`;
|
|
153
153
|
}
|
|
154
154
|
class UID {
|
|
155
155
|
constructor(typeArgs, fields) {
|
|
@@ -265,6 +265,6 @@ class UID {
|
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
exports.UID = UID;
|
|
268
|
-
UID.$typeName = `${index_1.
|
|
268
|
+
UID.$typeName = `${index_1.PKG_V30}::object::UID`;
|
|
269
269
|
UID.$numTypeParams = 0;
|
|
270
270
|
UID.$isPhantom = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToPhantomTypeArgument, ToTypeStr } from "../../../../_framework/reified";
|
|
2
2
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
|
-
import {
|
|
3
|
+
import { PKG_V30 } from "../index";
|
|
4
4
|
import { UID } from "../object/structs";
|
|
5
5
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
6
6
|
export declare function isObjectTable(type: string): boolean;
|
|
@@ -15,7 +15,7 @@ export declare class ObjectTable<K extends PhantomTypeArgument, V extends Phanto
|
|
|
15
15
|
static readonly $numTypeParams = 2;
|
|
16
16
|
static readonly $isPhantom: readonly [true, true];
|
|
17
17
|
readonly $typeName = "0x2::object_table::ObjectTable";
|
|
18
|
-
readonly $fullTypeName: `${typeof
|
|
18
|
+
readonly $fullTypeName: `${typeof PKG_V30}::object_table::ObjectTable<${PhantomToTypeStr<K>}, ${PhantomToTypeStr<V>}>`;
|
|
19
19
|
readonly $typeArgs: [PhantomToTypeStr<K>, PhantomToTypeStr<V>];
|
|
20
20
|
readonly $isPhantom: readonly [true, true];
|
|
21
21
|
readonly id: ToField<UID>;
|
|
@@ -20,7 +20,7 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
20
20
|
/* ============================== ObjectTable =============================== */
|
|
21
21
|
function isObjectTable(type) {
|
|
22
22
|
type = (0, util_1.compressSuiType)(type);
|
|
23
|
-
return type.startsWith(`${index_1.
|
|
23
|
+
return type.startsWith(`${index_1.PKG_V30}::object_table::ObjectTable` + "<");
|
|
24
24
|
}
|
|
25
25
|
class ObjectTable {
|
|
26
26
|
constructor(typeArgs, fields) {
|
|
@@ -158,6 +158,6 @@ class ObjectTable {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
exports.ObjectTable = ObjectTable;
|
|
161
|
-
ObjectTable.$typeName = `${index_1.
|
|
161
|
+
ObjectTable.$typeName = `${index_1.PKG_V30}::object_table::ObjectTable`;
|
|
162
162
|
ObjectTable.$numTypeParams = 2;
|
|
163
163
|
ObjectTable.$isPhantom = [true, true];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const PACKAGE_ID: string;
|
|
2
2
|
export declare let PUBLISHED_AT: string;
|
|
3
3
|
export declare const PKG_V1: string;
|
|
4
|
+
export declare const PKG_V8: string;
|
|
5
|
+
export declare const PKG_V10: string;
|
|
4
6
|
export declare function setPublishedAt(publishedAt: string): void;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PKG_V1 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
|
|
3
|
+
exports.PKG_V10 = exports.PKG_V8 = exports.PKG_V1 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
|
|
4
4
|
exports.setPublishedAt = setPublishedAt;
|
|
5
5
|
exports.PACKAGE_ID = process.env.NEXT_PUBLIC_USE_BETA_MARKET
|
|
6
6
|
? "0x1f54a9a2d71799553197e9ea24557797c6398d6a65f2d4d3818c9304b75d5e21"
|
|
7
7
|
: "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf";
|
|
8
8
|
exports.PUBLISHED_AT = process.env.NEXT_PUBLIC_USE_BETA_MARKET
|
|
9
|
-
? "
|
|
10
|
-
: "
|
|
9
|
+
? "0xe5ed361add4433f4d23e56fc0e3bacab39b93592d5e65d508e33fd19ff696669"
|
|
10
|
+
: "0xe37cc7bb50fd9b6dbd3873df66fa2c554e973697f50ef97707311dc78bd08444";
|
|
11
11
|
exports.PKG_V1 = process.env.NEXT_PUBLIC_USE_BETA_MARKET
|
|
12
12
|
? "0x1f54a9a2d71799553197e9ea24557797c6398d6a65f2d4d3818c9304b75d5e21"
|
|
13
13
|
: "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf";
|
|
14
|
+
exports.PKG_V8 = process.env.NEXT_PUBLIC_USE_BETA_MARKET
|
|
15
|
+
? "0xe5ed361add4433f4d23e56fc0e3bacab39b93592d5e65d508e33fd19ff696669"
|
|
16
|
+
: "0x5b54b47971238403d6ade3c8c2cc75814cb55145a5184af916bb5b12aaf184cb";
|
|
17
|
+
exports.PKG_V10 = process.env.NEXT_PUBLIC_USE_BETA_MARKET
|
|
18
|
+
? "0xe5ed361add4433f4d23e56fc0e3bacab39b93592d5e65d508e33fd19ff696669"
|
|
19
|
+
: "0xe37cc7bb50fd9b6dbd3873df66fa2c554e973697f50ef97707311dc78bd08444";
|
|
14
20
|
function setPublishedAt(publishedAt) {
|
|
15
21
|
exports.PUBLISHED_AT = publishedAt;
|
|
16
22
|
}
|
|
@@ -7,12 +7,12 @@ export interface BorrowArgs {
|
|
|
7
7
|
amount: bigint | TransactionArgument;
|
|
8
8
|
}
|
|
9
9
|
export declare function borrow(tx: Transaction, typeArgs: [string, string], args: BorrowArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
10
|
-
export declare function init(tx: Transaction, otw: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
11
10
|
export interface MigrateArgs {
|
|
12
11
|
lendingMarketOwnerCap: TransactionObjectInput;
|
|
13
12
|
lendingMarket: TransactionObjectInput;
|
|
14
13
|
}
|
|
15
14
|
export declare function migrate(tx: Transaction, typeArg: string, args: MigrateArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
15
|
+
export declare function init(tx: Transaction, otw: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
16
16
|
export interface ClaimFeesArgs {
|
|
17
17
|
lendingMarket: TransactionObjectInput;
|
|
18
18
|
reserveArrayIndex: bigint | TransactionArgument;
|
|
@@ -76,7 +76,7 @@ export interface InitStakerArgs {
|
|
|
76
76
|
suiReserveArrayIndex: bigint | TransactionArgument;
|
|
77
77
|
treasuryCap: TransactionObjectInput;
|
|
78
78
|
}
|
|
79
|
-
export declare function initStaker(tx: Transaction,
|
|
79
|
+
export declare function initStaker(tx: Transaction, typeArgs: [string, string], args: InitStakerArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
80
80
|
export interface MaxBorrowAmountArgs {
|
|
81
81
|
rateLimiter: TransactionObjectInput;
|
|
82
82
|
obligation: TransactionObjectInput;
|
|
@@ -246,6 +246,13 @@ export interface RefreshReservePriceArgs {
|
|
|
246
246
|
priceInfo: TransactionObjectInput;
|
|
247
247
|
}
|
|
248
248
|
export declare function refreshReservePrice(tx: Transaction, typeArg: string, args: RefreshReservePriceArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
249
|
+
export interface SetFeeReceiversArgs {
|
|
250
|
+
lendingMarketOwnerCap: TransactionObjectInput;
|
|
251
|
+
lendingMarket: TransactionObjectInput;
|
|
252
|
+
receivers: Array<string | TransactionArgument> | TransactionArgument;
|
|
253
|
+
weights: Array<bigint | TransactionArgument> | TransactionArgument;
|
|
254
|
+
}
|
|
255
|
+
export declare function setFeeReceivers(tx: Transaction, typeArg: string, args: SetFeeReceiversArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
249
256
|
export interface UpdateRateLimiterConfigArgs {
|
|
250
257
|
lendingMarketOwnerCap: TransactionObjectInput;
|
|
251
258
|
lendingMarket: TransactionObjectInput;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.borrow = borrow;
|
|
4
|
-
exports.init = init;
|
|
5
4
|
exports.migrate = migrate;
|
|
5
|
+
exports.init = init;
|
|
6
6
|
exports.claimFees = claimFees;
|
|
7
7
|
exports.addPoolReward = addPoolReward;
|
|
8
8
|
exports.cancelPoolReward = cancelPoolReward;
|
|
@@ -39,6 +39,7 @@ exports.rateLimiterExemptionAmount = rateLimiterExemptionAmount;
|
|
|
39
39
|
exports.redeemCtokensAndWithdrawLiquidity = redeemCtokensAndWithdrawLiquidity;
|
|
40
40
|
exports.redeemCtokensAndWithdrawLiquidityRequest = redeemCtokensAndWithdrawLiquidityRequest;
|
|
41
41
|
exports.refreshReservePrice = refreshReservePrice;
|
|
42
|
+
exports.setFeeReceivers = setFeeReceivers;
|
|
42
43
|
exports.updateRateLimiterConfig = updateRateLimiterConfig;
|
|
43
44
|
const __1 = require("..");
|
|
44
45
|
const structs_1 = require("../../_dependencies/source/0x2/object/structs");
|
|
@@ -57,12 +58,6 @@ function borrow(tx, typeArgs, args) {
|
|
|
57
58
|
],
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
|
-
function init(tx, otw) {
|
|
61
|
-
return tx.moveCall({
|
|
62
|
-
target: `${__1.PUBLISHED_AT}::lending_market::init`,
|
|
63
|
-
arguments: [(0, util_1.obj)(tx, otw)],
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
61
|
function migrate(tx, typeArg, args) {
|
|
67
62
|
return tx.moveCall({
|
|
68
63
|
target: `${__1.PUBLISHED_AT}::lending_market::migrate`,
|
|
@@ -73,6 +68,12 @@ function migrate(tx, typeArg, args) {
|
|
|
73
68
|
],
|
|
74
69
|
});
|
|
75
70
|
}
|
|
71
|
+
function init(tx, otw) {
|
|
72
|
+
return tx.moveCall({
|
|
73
|
+
target: `${__1.PUBLISHED_AT}::lending_market::init`,
|
|
74
|
+
arguments: [(0, util_1.obj)(tx, otw)],
|
|
75
|
+
});
|
|
76
|
+
}
|
|
76
77
|
function claimFees(tx, typeArgs, args) {
|
|
77
78
|
return tx.moveCall({
|
|
78
79
|
target: `${__1.PUBLISHED_AT}::lending_market::claim_fees`,
|
|
@@ -171,10 +172,10 @@ function fulfillLiquidityRequest(tx, typeArgs, args) {
|
|
|
171
172
|
],
|
|
172
173
|
});
|
|
173
174
|
}
|
|
174
|
-
function initStaker(tx,
|
|
175
|
+
function initStaker(tx, typeArgs, args) {
|
|
175
176
|
return tx.moveCall({
|
|
176
177
|
target: `${__1.PUBLISHED_AT}::lending_market::init_staker`,
|
|
177
|
-
typeArguments:
|
|
178
|
+
typeArguments: typeArgs,
|
|
178
179
|
arguments: [
|
|
179
180
|
(0, util_1.obj)(tx, args.lendingMarket),
|
|
180
181
|
(0, util_1.obj)(tx, args.lendingMarketOwnerCap),
|
|
@@ -493,6 +494,18 @@ function refreshReservePrice(tx, typeArg, args) {
|
|
|
493
494
|
],
|
|
494
495
|
});
|
|
495
496
|
}
|
|
497
|
+
function setFeeReceivers(tx, typeArg, args) {
|
|
498
|
+
return tx.moveCall({
|
|
499
|
+
target: `${__1.PUBLISHED_AT}::lending_market::set_fee_receivers`,
|
|
500
|
+
typeArguments: [typeArg],
|
|
501
|
+
arguments: [
|
|
502
|
+
(0, util_1.obj)(tx, args.lendingMarketOwnerCap),
|
|
503
|
+
(0, util_1.obj)(tx, args.lendingMarket),
|
|
504
|
+
(0, util_1.pure)(tx, args.receivers, `vector<address>`),
|
|
505
|
+
(0, util_1.pure)(tx, args.weights, `vector<u64>`),
|
|
506
|
+
],
|
|
507
|
+
});
|
|
508
|
+
}
|
|
496
509
|
function updateRateLimiterConfig(tx, typeArg, args) {
|
|
497
510
|
return tx.moveCall({
|
|
498
511
|
target: `${__1.PUBLISHED_AT}::lending_market::update_rate_limiter_config`,
|
|
@@ -6,7 +6,7 @@ import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructC
|
|
|
6
6
|
import { FieldsWithTypes } from "../../_framework/util";
|
|
7
7
|
import { Vector } from "../../_framework/vector";
|
|
8
8
|
import { Decimal } from "../decimal/structs";
|
|
9
|
-
import { PKG_V1 } from "../index";
|
|
9
|
+
import { PKG_V1, PKG_V10 } from "../index";
|
|
10
10
|
import { Obligation } from "../obligation/structs";
|
|
11
11
|
import { RateLimiter } from "../rate-limiter/structs";
|
|
12
12
|
import { Reserve } from "../reserve/structs";
|
|
@@ -429,6 +429,106 @@ export declare class DepositEvent implements StructClass {
|
|
|
429
429
|
static fromSuiObjectData(data: SuiObjectData): DepositEvent;
|
|
430
430
|
static fetch(client: SuiClient, id: string): Promise<DepositEvent>;
|
|
431
431
|
}
|
|
432
|
+
export declare function isFeeReceivers(type: string): boolean;
|
|
433
|
+
export interface FeeReceiversFields {
|
|
434
|
+
receivers: ToField<Vector<"address">>;
|
|
435
|
+
weights: ToField<Vector<"u64">>;
|
|
436
|
+
totalWeight: ToField<"u64">;
|
|
437
|
+
}
|
|
438
|
+
export type FeeReceiversReified = Reified<FeeReceivers, FeeReceiversFields>;
|
|
439
|
+
export declare class FeeReceivers implements StructClass {
|
|
440
|
+
__StructClass: true;
|
|
441
|
+
static readonly $typeName: string;
|
|
442
|
+
static readonly $numTypeParams = 0;
|
|
443
|
+
static readonly $isPhantom: readonly [];
|
|
444
|
+
readonly $typeName: string;
|
|
445
|
+
readonly $fullTypeName: `${typeof PKG_V10}::lending_market::FeeReceivers`;
|
|
446
|
+
readonly $typeArgs: [];
|
|
447
|
+
readonly $isPhantom: readonly [];
|
|
448
|
+
readonly receivers: ToField<Vector<"address">>;
|
|
449
|
+
readonly weights: ToField<Vector<"u64">>;
|
|
450
|
+
readonly totalWeight: ToField<"u64">;
|
|
451
|
+
private constructor();
|
|
452
|
+
static reified(): FeeReceiversReified;
|
|
453
|
+
static get r(): reified.StructClassReified<FeeReceivers, FeeReceiversFields>;
|
|
454
|
+
static phantom(): PhantomReified<ToTypeStr<FeeReceivers>>;
|
|
455
|
+
static get p(): reified.PhantomReified<"0xe5ed361add4433f4d23e56fc0e3bacab39b93592d5e65d508e33fd19ff696669::lending_market::FeeReceivers" | "0xe37cc7bb50fd9b6dbd3873df66fa2c554e973697f50ef97707311dc78bd08444::lending_market::FeeReceivers">;
|
|
456
|
+
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
457
|
+
receivers: string[];
|
|
458
|
+
weights: string[];
|
|
459
|
+
total_weight: string;
|
|
460
|
+
}, {
|
|
461
|
+
receivers: Iterable<string> & {
|
|
462
|
+
length: number;
|
|
463
|
+
};
|
|
464
|
+
weights: Iterable<string | number | bigint> & {
|
|
465
|
+
length: number;
|
|
466
|
+
};
|
|
467
|
+
total_weight: string | number | bigint;
|
|
468
|
+
}>;
|
|
469
|
+
static fromFields(fields: Record<string, any>): FeeReceivers;
|
|
470
|
+
static fromFieldsWithTypes(item: FieldsWithTypes): FeeReceivers;
|
|
471
|
+
static fromBcs(data: Uint8Array): FeeReceivers;
|
|
472
|
+
toJSONField(): {
|
|
473
|
+
receivers: string[];
|
|
474
|
+
weights: string[];
|
|
475
|
+
totalWeight: string;
|
|
476
|
+
};
|
|
477
|
+
toJSON(): {
|
|
478
|
+
receivers: string[];
|
|
479
|
+
weights: string[];
|
|
480
|
+
totalWeight: string;
|
|
481
|
+
$typeName: string;
|
|
482
|
+
$typeArgs: [];
|
|
483
|
+
};
|
|
484
|
+
static fromJSONField(field: any): FeeReceivers;
|
|
485
|
+
static fromJSON(json: Record<string, any>): FeeReceivers;
|
|
486
|
+
static fromSuiParsedData(content: SuiParsedData): FeeReceivers;
|
|
487
|
+
static fromSuiObjectData(data: SuiObjectData): FeeReceivers;
|
|
488
|
+
static fetch(client: SuiClient, id: string): Promise<FeeReceivers>;
|
|
489
|
+
}
|
|
490
|
+
export declare function isFeeReceiversKey(type: string): boolean;
|
|
491
|
+
export interface FeeReceiversKeyFields {
|
|
492
|
+
dummyField: ToField<"bool">;
|
|
493
|
+
}
|
|
494
|
+
export type FeeReceiversKeyReified = Reified<FeeReceiversKey, FeeReceiversKeyFields>;
|
|
495
|
+
export declare class FeeReceiversKey implements StructClass {
|
|
496
|
+
__StructClass: true;
|
|
497
|
+
static readonly $typeName: string;
|
|
498
|
+
static readonly $numTypeParams = 0;
|
|
499
|
+
static readonly $isPhantom: readonly [];
|
|
500
|
+
readonly $typeName: string;
|
|
501
|
+
readonly $fullTypeName: `${typeof PKG_V10}::lending_market::FeeReceiversKey`;
|
|
502
|
+
readonly $typeArgs: [];
|
|
503
|
+
readonly $isPhantom: readonly [];
|
|
504
|
+
readonly dummyField: ToField<"bool">;
|
|
505
|
+
private constructor();
|
|
506
|
+
static reified(): FeeReceiversKeyReified;
|
|
507
|
+
static get r(): reified.StructClassReified<FeeReceiversKey, FeeReceiversKeyFields>;
|
|
508
|
+
static phantom(): PhantomReified<ToTypeStr<FeeReceiversKey>>;
|
|
509
|
+
static get p(): reified.PhantomReified<"0xe5ed361add4433f4d23e56fc0e3bacab39b93592d5e65d508e33fd19ff696669::lending_market::FeeReceiversKey" | "0xe37cc7bb50fd9b6dbd3873df66fa2c554e973697f50ef97707311dc78bd08444::lending_market::FeeReceiversKey">;
|
|
510
|
+
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
511
|
+
dummy_field: boolean;
|
|
512
|
+
}, {
|
|
513
|
+
dummy_field: boolean;
|
|
514
|
+
}>;
|
|
515
|
+
static fromFields(fields: Record<string, any>): FeeReceiversKey;
|
|
516
|
+
static fromFieldsWithTypes(item: FieldsWithTypes): FeeReceiversKey;
|
|
517
|
+
static fromBcs(data: Uint8Array): FeeReceiversKey;
|
|
518
|
+
toJSONField(): {
|
|
519
|
+
dummyField: boolean;
|
|
520
|
+
};
|
|
521
|
+
toJSON(): {
|
|
522
|
+
dummyField: boolean;
|
|
523
|
+
$typeName: string;
|
|
524
|
+
$typeArgs: [];
|
|
525
|
+
};
|
|
526
|
+
static fromJSONField(field: any): FeeReceiversKey;
|
|
527
|
+
static fromJSON(json: Record<string, any>): FeeReceiversKey;
|
|
528
|
+
static fromSuiParsedData(content: SuiParsedData): FeeReceiversKey;
|
|
529
|
+
static fromSuiObjectData(data: SuiObjectData): FeeReceiversKey;
|
|
530
|
+
static fetch(client: SuiClient, id: string): Promise<FeeReceiversKey>;
|
|
531
|
+
}
|
|
432
532
|
export declare function isForgiveEvent(type: string): boolean;
|
|
433
533
|
export interface ForgiveEventFields {
|
|
434
534
|
lendingMarketId: ToField<"address">;
|
|
@@ -42,12 +42,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
exports.WithdrawEvent = exports.RepayEvent = exports.RateLimiterExemption = exports.ObligationOwnerCap = exports.LiquidateEvent = exports.LendingMarketOwnerCap = exports.LendingMarket = exports.LENDING_MARKET = exports.ForgiveEvent = exports.DepositEvent = exports.ClaimRewardEvent = exports.BorrowEvent = exports.RedeemEvent = exports.MintEvent = void 0;
|
|
45
|
+
exports.WithdrawEvent = exports.RepayEvent = exports.RateLimiterExemption = exports.ObligationOwnerCap = exports.LiquidateEvent = exports.LendingMarketOwnerCap = exports.LendingMarket = exports.LENDING_MARKET = exports.ForgiveEvent = exports.FeeReceiversKey = exports.FeeReceivers = exports.DepositEvent = exports.ClaimRewardEvent = exports.BorrowEvent = exports.RedeemEvent = exports.MintEvent = void 0;
|
|
46
46
|
exports.isMintEvent = isMintEvent;
|
|
47
47
|
exports.isRedeemEvent = isRedeemEvent;
|
|
48
48
|
exports.isBorrowEvent = isBorrowEvent;
|
|
49
49
|
exports.isClaimRewardEvent = isClaimRewardEvent;
|
|
50
50
|
exports.isDepositEvent = isDepositEvent;
|
|
51
|
+
exports.isFeeReceivers = isFeeReceivers;
|
|
52
|
+
exports.isFeeReceiversKey = isFeeReceiversKey;
|
|
51
53
|
exports.isForgiveEvent = isForgiveEvent;
|
|
52
54
|
exports.isLENDING_MARKET = isLENDING_MARKET;
|
|
53
55
|
exports.isLendingMarket = isLendingMarket;
|
|
@@ -905,6 +907,275 @@ exports.DepositEvent = DepositEvent;
|
|
|
905
907
|
DepositEvent.$typeName = `${index_1.PKG_V1}::lending_market::DepositEvent`;
|
|
906
908
|
DepositEvent.$numTypeParams = 0;
|
|
907
909
|
DepositEvent.$isPhantom = [];
|
|
910
|
+
/* ============================== FeeReceivers =============================== */
|
|
911
|
+
function isFeeReceivers(type) {
|
|
912
|
+
type = (0, util_1.compressSuiType)(type);
|
|
913
|
+
return type === `${index_1.PKG_V10}::lending_market::FeeReceivers`;
|
|
914
|
+
}
|
|
915
|
+
class FeeReceivers {
|
|
916
|
+
constructor(typeArgs, fields) {
|
|
917
|
+
this.__StructClass = true;
|
|
918
|
+
this.$typeName = FeeReceivers.$typeName;
|
|
919
|
+
this.$isPhantom = FeeReceivers.$isPhantom;
|
|
920
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(FeeReceivers.$typeName, ...typeArgs);
|
|
921
|
+
this.$typeArgs = typeArgs;
|
|
922
|
+
this.receivers = fields.receivers;
|
|
923
|
+
this.weights = fields.weights;
|
|
924
|
+
this.totalWeight = fields.totalWeight;
|
|
925
|
+
}
|
|
926
|
+
static reified() {
|
|
927
|
+
return {
|
|
928
|
+
typeName: FeeReceivers.$typeName,
|
|
929
|
+
fullTypeName: (0, util_1.composeSuiType)(FeeReceivers.$typeName, ...[]),
|
|
930
|
+
typeArgs: [],
|
|
931
|
+
isPhantom: FeeReceivers.$isPhantom,
|
|
932
|
+
reifiedTypeArgs: [],
|
|
933
|
+
fromFields: (fields) => FeeReceivers.fromFields(fields),
|
|
934
|
+
fromFieldsWithTypes: (item) => FeeReceivers.fromFieldsWithTypes(item),
|
|
935
|
+
fromBcs: (data) => FeeReceivers.fromBcs(data),
|
|
936
|
+
bcs: FeeReceivers.bcs,
|
|
937
|
+
fromJSONField: (field) => FeeReceivers.fromJSONField(field),
|
|
938
|
+
fromJSON: (json) => FeeReceivers.fromJSON(json),
|
|
939
|
+
fromSuiParsedData: (content) => FeeReceivers.fromSuiParsedData(content),
|
|
940
|
+
fromSuiObjectData: (content) => FeeReceivers.fromSuiObjectData(content),
|
|
941
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return FeeReceivers.fetch(client, id); }),
|
|
942
|
+
new: (fields) => {
|
|
943
|
+
return new FeeReceivers([], fields);
|
|
944
|
+
},
|
|
945
|
+
kind: "StructClassReified",
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
static get r() {
|
|
949
|
+
return FeeReceivers.reified();
|
|
950
|
+
}
|
|
951
|
+
static phantom() {
|
|
952
|
+
return (0, reified_1.phantom)(FeeReceivers.reified());
|
|
953
|
+
}
|
|
954
|
+
static get p() {
|
|
955
|
+
return FeeReceivers.phantom();
|
|
956
|
+
}
|
|
957
|
+
static get bcs() {
|
|
958
|
+
return bcs_1.bcs.struct("FeeReceivers", {
|
|
959
|
+
receivers: bcs_1.bcs.vector(bcs_1.bcs
|
|
960
|
+
.bytes(32)
|
|
961
|
+
.transform({
|
|
962
|
+
input: (val) => (0, utils_1.fromHEX)(val),
|
|
963
|
+
output: (val) => (0, utils_1.toHEX)(val),
|
|
964
|
+
})),
|
|
965
|
+
weights: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
966
|
+
total_weight: bcs_1.bcs.u64(),
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
static fromFields(fields) {
|
|
970
|
+
return FeeReceivers.reified().new({
|
|
971
|
+
receivers: (0, reified_1.decodeFromFields)(reified.vector("address"), fields.receivers),
|
|
972
|
+
weights: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.weights),
|
|
973
|
+
totalWeight: (0, reified_1.decodeFromFields)("u64", fields.total_weight),
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
static fromFieldsWithTypes(item) {
|
|
977
|
+
if (!isFeeReceivers(item.type)) {
|
|
978
|
+
throw new Error("not a FeeReceivers type");
|
|
979
|
+
}
|
|
980
|
+
return FeeReceivers.reified().new({
|
|
981
|
+
receivers: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("address"), item.fields.receivers),
|
|
982
|
+
weights: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.weights),
|
|
983
|
+
totalWeight: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.total_weight),
|
|
984
|
+
});
|
|
985
|
+
}
|
|
986
|
+
static fromBcs(data) {
|
|
987
|
+
return FeeReceivers.fromFields(FeeReceivers.bcs.parse(data));
|
|
988
|
+
}
|
|
989
|
+
toJSONField() {
|
|
990
|
+
return {
|
|
991
|
+
receivers: (0, reified_1.fieldToJSON)(`vector<address>`, this.receivers),
|
|
992
|
+
weights: (0, reified_1.fieldToJSON)(`vector<u64>`, this.weights),
|
|
993
|
+
totalWeight: this.totalWeight.toString(),
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
toJSON() {
|
|
997
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
998
|
+
}
|
|
999
|
+
static fromJSONField(field) {
|
|
1000
|
+
return FeeReceivers.reified().new({
|
|
1001
|
+
receivers: (0, reified_1.decodeFromJSONField)(reified.vector("address"), field.receivers),
|
|
1002
|
+
weights: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.weights),
|
|
1003
|
+
totalWeight: (0, reified_1.decodeFromJSONField)("u64", field.totalWeight),
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
static fromJSON(json) {
|
|
1007
|
+
if (json.$typeName !== FeeReceivers.$typeName) {
|
|
1008
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
1009
|
+
}
|
|
1010
|
+
return FeeReceivers.fromJSONField(json);
|
|
1011
|
+
}
|
|
1012
|
+
static fromSuiParsedData(content) {
|
|
1013
|
+
if (content.dataType !== "moveObject") {
|
|
1014
|
+
throw new Error("not an object");
|
|
1015
|
+
}
|
|
1016
|
+
if (!isFeeReceivers(content.type)) {
|
|
1017
|
+
throw new Error(`object at ${content.fields.id} is not a FeeReceivers object`);
|
|
1018
|
+
}
|
|
1019
|
+
return FeeReceivers.fromFieldsWithTypes(content);
|
|
1020
|
+
}
|
|
1021
|
+
static fromSuiObjectData(data) {
|
|
1022
|
+
if (data.bcs) {
|
|
1023
|
+
if (data.bcs.dataType !== "moveObject" ||
|
|
1024
|
+
!isFeeReceivers(data.bcs.type)) {
|
|
1025
|
+
throw new Error(`object at is not a FeeReceivers object`);
|
|
1026
|
+
}
|
|
1027
|
+
return FeeReceivers.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1028
|
+
}
|
|
1029
|
+
if (data.content) {
|
|
1030
|
+
return FeeReceivers.fromSuiParsedData(data.content);
|
|
1031
|
+
}
|
|
1032
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1033
|
+
}
|
|
1034
|
+
static fetch(client, id) {
|
|
1035
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1036
|
+
var _a, _b;
|
|
1037
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
1038
|
+
if (res.error) {
|
|
1039
|
+
throw new Error(`error fetching FeeReceivers object at id ${id}: ${res.error.code}`);
|
|
1040
|
+
}
|
|
1041
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
1042
|
+
!isFeeReceivers(res.data.bcs.type)) {
|
|
1043
|
+
throw new Error(`object at id ${id} is not a FeeReceivers object`);
|
|
1044
|
+
}
|
|
1045
|
+
return FeeReceivers.fromSuiObjectData(res.data);
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
exports.FeeReceivers = FeeReceivers;
|
|
1050
|
+
FeeReceivers.$typeName = `${index_1.PKG_V10}::lending_market::FeeReceivers`;
|
|
1051
|
+
FeeReceivers.$numTypeParams = 0;
|
|
1052
|
+
FeeReceivers.$isPhantom = [];
|
|
1053
|
+
/* ============================== FeeReceiversKey =============================== */
|
|
1054
|
+
function isFeeReceiversKey(type) {
|
|
1055
|
+
type = (0, util_1.compressSuiType)(type);
|
|
1056
|
+
return type === `${index_1.PKG_V10}::lending_market::FeeReceiversKey`;
|
|
1057
|
+
}
|
|
1058
|
+
class FeeReceiversKey {
|
|
1059
|
+
constructor(typeArgs, fields) {
|
|
1060
|
+
this.__StructClass = true;
|
|
1061
|
+
this.$typeName = FeeReceiversKey.$typeName;
|
|
1062
|
+
this.$isPhantom = FeeReceiversKey.$isPhantom;
|
|
1063
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(FeeReceiversKey.$typeName, ...typeArgs);
|
|
1064
|
+
this.$typeArgs = typeArgs;
|
|
1065
|
+
this.dummyField = fields.dummyField;
|
|
1066
|
+
}
|
|
1067
|
+
static reified() {
|
|
1068
|
+
return {
|
|
1069
|
+
typeName: FeeReceiversKey.$typeName,
|
|
1070
|
+
fullTypeName: (0, util_1.composeSuiType)(FeeReceiversKey.$typeName, ...[]),
|
|
1071
|
+
typeArgs: [],
|
|
1072
|
+
isPhantom: FeeReceiversKey.$isPhantom,
|
|
1073
|
+
reifiedTypeArgs: [],
|
|
1074
|
+
fromFields: (fields) => FeeReceiversKey.fromFields(fields),
|
|
1075
|
+
fromFieldsWithTypes: (item) => FeeReceiversKey.fromFieldsWithTypes(item),
|
|
1076
|
+
fromBcs: (data) => FeeReceiversKey.fromBcs(data),
|
|
1077
|
+
bcs: FeeReceiversKey.bcs,
|
|
1078
|
+
fromJSONField: (field) => FeeReceiversKey.fromJSONField(field),
|
|
1079
|
+
fromJSON: (json) => FeeReceiversKey.fromJSON(json),
|
|
1080
|
+
fromSuiParsedData: (content) => FeeReceiversKey.fromSuiParsedData(content),
|
|
1081
|
+
fromSuiObjectData: (content) => FeeReceiversKey.fromSuiObjectData(content),
|
|
1082
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return FeeReceiversKey.fetch(client, id); }),
|
|
1083
|
+
new: (fields) => {
|
|
1084
|
+
return new FeeReceiversKey([], fields);
|
|
1085
|
+
},
|
|
1086
|
+
kind: "StructClassReified",
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
static get r() {
|
|
1090
|
+
return FeeReceiversKey.reified();
|
|
1091
|
+
}
|
|
1092
|
+
static phantom() {
|
|
1093
|
+
return (0, reified_1.phantom)(FeeReceiversKey.reified());
|
|
1094
|
+
}
|
|
1095
|
+
static get p() {
|
|
1096
|
+
return FeeReceiversKey.phantom();
|
|
1097
|
+
}
|
|
1098
|
+
static get bcs() {
|
|
1099
|
+
return bcs_1.bcs.struct("FeeReceiversKey", {
|
|
1100
|
+
dummy_field: bcs_1.bcs.bool(),
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
static fromFields(fields) {
|
|
1104
|
+
return FeeReceiversKey.reified().new({
|
|
1105
|
+
dummyField: (0, reified_1.decodeFromFields)("bool", fields.dummy_field),
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
static fromFieldsWithTypes(item) {
|
|
1109
|
+
if (!isFeeReceiversKey(item.type)) {
|
|
1110
|
+
throw new Error("not a FeeReceiversKey type");
|
|
1111
|
+
}
|
|
1112
|
+
return FeeReceiversKey.reified().new({
|
|
1113
|
+
dummyField: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.dummy_field),
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
static fromBcs(data) {
|
|
1117
|
+
return FeeReceiversKey.fromFields(FeeReceiversKey.bcs.parse(data));
|
|
1118
|
+
}
|
|
1119
|
+
toJSONField() {
|
|
1120
|
+
return {
|
|
1121
|
+
dummyField: this.dummyField,
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
toJSON() {
|
|
1125
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1126
|
+
}
|
|
1127
|
+
static fromJSONField(field) {
|
|
1128
|
+
return FeeReceiversKey.reified().new({
|
|
1129
|
+
dummyField: (0, reified_1.decodeFromJSONField)("bool", field.dummyField),
|
|
1130
|
+
});
|
|
1131
|
+
}
|
|
1132
|
+
static fromJSON(json) {
|
|
1133
|
+
if (json.$typeName !== FeeReceiversKey.$typeName) {
|
|
1134
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
1135
|
+
}
|
|
1136
|
+
return FeeReceiversKey.fromJSONField(json);
|
|
1137
|
+
}
|
|
1138
|
+
static fromSuiParsedData(content) {
|
|
1139
|
+
if (content.dataType !== "moveObject") {
|
|
1140
|
+
throw new Error("not an object");
|
|
1141
|
+
}
|
|
1142
|
+
if (!isFeeReceiversKey(content.type)) {
|
|
1143
|
+
throw new Error(`object at ${content.fields.id} is not a FeeReceiversKey object`);
|
|
1144
|
+
}
|
|
1145
|
+
return FeeReceiversKey.fromFieldsWithTypes(content);
|
|
1146
|
+
}
|
|
1147
|
+
static fromSuiObjectData(data) {
|
|
1148
|
+
if (data.bcs) {
|
|
1149
|
+
if (data.bcs.dataType !== "moveObject" ||
|
|
1150
|
+
!isFeeReceiversKey(data.bcs.type)) {
|
|
1151
|
+
throw new Error(`object at is not a FeeReceiversKey object`);
|
|
1152
|
+
}
|
|
1153
|
+
return FeeReceiversKey.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1154
|
+
}
|
|
1155
|
+
if (data.content) {
|
|
1156
|
+
return FeeReceiversKey.fromSuiParsedData(data.content);
|
|
1157
|
+
}
|
|
1158
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1159
|
+
}
|
|
1160
|
+
static fetch(client, id) {
|
|
1161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1162
|
+
var _a, _b;
|
|
1163
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
1164
|
+
if (res.error) {
|
|
1165
|
+
throw new Error(`error fetching FeeReceiversKey object at id ${id}: ${res.error.code}`);
|
|
1166
|
+
}
|
|
1167
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
1168
|
+
!isFeeReceiversKey(res.data.bcs.type)) {
|
|
1169
|
+
throw new Error(`object at id ${id} is not a FeeReceiversKey object`);
|
|
1170
|
+
}
|
|
1171
|
+
return FeeReceiversKey.fromSuiObjectData(res.data);
|
|
1172
|
+
});
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
exports.FeeReceiversKey = FeeReceiversKey;
|
|
1176
|
+
FeeReceiversKey.$typeName = `${index_1.PKG_V10}::lending_market::FeeReceiversKey`;
|
|
1177
|
+
FeeReceiversKey.$numTypeParams = 0;
|
|
1178
|
+
FeeReceiversKey.$isPhantom = [];
|
|
908
1179
|
/* ============================== ForgiveEvent =============================== */
|
|
909
1180
|
function isForgiveEvent(type) {
|
|
910
1181
|
type = (0, util_1.compressSuiType)(type);
|
|
@@ -7,7 +7,7 @@ import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructC
|
|
|
7
7
|
import { FieldsWithTypes } from "../../_framework/util";
|
|
8
8
|
import { Cell } from "../cell/structs";
|
|
9
9
|
import { Decimal } from "../decimal/structs";
|
|
10
|
-
import { PKG_V1 } from "../index";
|
|
10
|
+
import { PKG_V1, PKG_V8 } from "../index";
|
|
11
11
|
import { PoolRewardManager } from "../liquidity-mining/structs";
|
|
12
12
|
import { ReserveConfig } from "../reserve-config/structs";
|
|
13
13
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
@@ -215,7 +215,7 @@ export declare class ClaimStakingRewardsEvent implements StructClass {
|
|
|
215
215
|
static readonly $numTypeParams = 0;
|
|
216
216
|
static readonly $isPhantom: readonly [];
|
|
217
217
|
readonly $typeName: string;
|
|
218
|
-
readonly $fullTypeName: `${typeof
|
|
218
|
+
readonly $fullTypeName: `${typeof PKG_V8}::reserve::ClaimStakingRewardsEvent`;
|
|
219
219
|
readonly $typeArgs: [];
|
|
220
220
|
readonly $isPhantom: readonly [];
|
|
221
221
|
readonly lendingMarketId: ToField<"address">;
|
|
@@ -226,7 +226,7 @@ export declare class ClaimStakingRewardsEvent implements StructClass {
|
|
|
226
226
|
static reified(): ClaimStakingRewardsEventReified;
|
|
227
227
|
static get r(): reified.StructClassReified<ClaimStakingRewardsEvent, ClaimStakingRewardsEventFields>;
|
|
228
228
|
static phantom(): PhantomReified<ToTypeStr<ClaimStakingRewardsEvent>>;
|
|
229
|
-
static get p(): reified.PhantomReified<"
|
|
229
|
+
static get p(): reified.PhantomReified<"0xe5ed361add4433f4d23e56fc0e3bacab39b93592d5e65d508e33fd19ff696669::reserve::ClaimStakingRewardsEvent" | "0x5b54b47971238403d6ade3c8c2cc75814cb55145a5184af916bb5b12aaf184cb::reserve::ClaimStakingRewardsEvent">;
|
|
230
230
|
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
231
231
|
lending_market_id: string;
|
|
232
232
|
coin_type: {
|
|
@@ -493,7 +493,7 @@ export declare class LiquidityRequest<P extends PhantomTypeArgument, T extends P
|
|
|
493
493
|
static readonly $numTypeParams = 2;
|
|
494
494
|
static readonly $isPhantom: readonly [true, true];
|
|
495
495
|
readonly $typeName: string;
|
|
496
|
-
readonly $fullTypeName: `${typeof
|
|
496
|
+
readonly $fullTypeName: `${typeof PKG_V8}::reserve::LiquidityRequest<${PhantomToTypeStr<P>}, ${PhantomToTypeStr<T>}>`;
|
|
497
497
|
readonly $typeArgs: [PhantomToTypeStr<P>, PhantomToTypeStr<T>];
|
|
498
498
|
readonly $isPhantom: readonly [true, true];
|
|
499
499
|
readonly amount: ToField<"u64">;
|
|
@@ -1220,7 +1220,7 @@ export declare class StakerKey implements StructClass {
|
|
|
1220
1220
|
static readonly $numTypeParams = 0;
|
|
1221
1221
|
static readonly $isPhantom: readonly [];
|
|
1222
1222
|
readonly $typeName: string;
|
|
1223
|
-
readonly $fullTypeName: `${typeof
|
|
1223
|
+
readonly $fullTypeName: `${typeof PKG_V8}::reserve::StakerKey`;
|
|
1224
1224
|
readonly $typeArgs: [];
|
|
1225
1225
|
readonly $isPhantom: readonly [];
|
|
1226
1226
|
readonly dummyField: ToField<"bool">;
|
|
@@ -1228,7 +1228,7 @@ export declare class StakerKey implements StructClass {
|
|
|
1228
1228
|
static reified(): StakerKeyReified;
|
|
1229
1229
|
static get r(): reified.StructClassReified<StakerKey, StakerKeyFields>;
|
|
1230
1230
|
static phantom(): PhantomReified<ToTypeStr<StakerKey>>;
|
|
1231
|
-
static get p(): reified.PhantomReified<"
|
|
1231
|
+
static get p(): reified.PhantomReified<"0xe5ed361add4433f4d23e56fc0e3bacab39b93592d5e65d508e33fd19ff696669::reserve::StakerKey" | "0x5b54b47971238403d6ade3c8c2cc75814cb55145a5184af916bb5b12aaf184cb::reserve::StakerKey">;
|
|
1232
1232
|
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
1233
1233
|
dummy_field: boolean;
|
|
1234
1234
|
}, {
|
|
@@ -494,7 +494,7 @@ CToken.$isPhantom = [true, true];
|
|
|
494
494
|
/* ============================== ClaimStakingRewardsEvent =============================== */
|
|
495
495
|
function isClaimStakingRewardsEvent(type) {
|
|
496
496
|
type = (0, util_1.compressSuiType)(type);
|
|
497
|
-
return type === `${index_1.
|
|
497
|
+
return type === `${index_1.PKG_V8}::reserve::ClaimStakingRewardsEvent`;
|
|
498
498
|
}
|
|
499
499
|
class ClaimStakingRewardsEvent {
|
|
500
500
|
constructor(typeArgs, fields) {
|
|
@@ -642,7 +642,7 @@ class ClaimStakingRewardsEvent {
|
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
exports.ClaimStakingRewardsEvent = ClaimStakingRewardsEvent;
|
|
645
|
-
ClaimStakingRewardsEvent.$typeName = `${index_1.
|
|
645
|
+
ClaimStakingRewardsEvent.$typeName = `${index_1.PKG_V8}::reserve::ClaimStakingRewardsEvent`;
|
|
646
646
|
ClaimStakingRewardsEvent.$numTypeParams = 0;
|
|
647
647
|
ClaimStakingRewardsEvent.$isPhantom = [];
|
|
648
648
|
/* ============================== InterestUpdateEvent =============================== */
|
|
@@ -863,7 +863,7 @@ InterestUpdateEvent.$isPhantom = [];
|
|
|
863
863
|
/* ============================== LiquidityRequest =============================== */
|
|
864
864
|
function isLiquidityRequest(type) {
|
|
865
865
|
type = (0, util_1.compressSuiType)(type);
|
|
866
|
-
return type.startsWith(`${index_1.
|
|
866
|
+
return type.startsWith(`${index_1.PKG_V8}::reserve::LiquidityRequest` + "<");
|
|
867
867
|
}
|
|
868
868
|
class LiquidityRequest {
|
|
869
869
|
constructor(typeArgs, fields) {
|
|
@@ -1002,7 +1002,7 @@ class LiquidityRequest {
|
|
|
1002
1002
|
}
|
|
1003
1003
|
}
|
|
1004
1004
|
exports.LiquidityRequest = LiquidityRequest;
|
|
1005
|
-
LiquidityRequest.$typeName = `${index_1.
|
|
1005
|
+
LiquidityRequest.$typeName = `${index_1.PKG_V8}::reserve::LiquidityRequest`;
|
|
1006
1006
|
LiquidityRequest.$numTypeParams = 2;
|
|
1007
1007
|
LiquidityRequest.$isPhantom = [true, true];
|
|
1008
1008
|
/* ============================== Reserve =============================== */
|
|
@@ -1478,7 +1478,7 @@ ReserveAssetDataEvent.$isPhantom = [];
|
|
|
1478
1478
|
/* ============================== StakerKey =============================== */
|
|
1479
1479
|
function isStakerKey(type) {
|
|
1480
1480
|
type = (0, util_1.compressSuiType)(type);
|
|
1481
|
-
return type === `${index_1.
|
|
1481
|
+
return type === `${index_1.PKG_V8}::reserve::StakerKey`;
|
|
1482
1482
|
}
|
|
1483
1483
|
class StakerKey {
|
|
1484
1484
|
constructor(typeArgs, fields) {
|
|
@@ -1597,6 +1597,6 @@ class StakerKey {
|
|
|
1597
1597
|
}
|
|
1598
1598
|
}
|
|
1599
1599
|
exports.StakerKey = StakerKey;
|
|
1600
|
-
StakerKey.$typeName = `${index_1.
|
|
1600
|
+
StakerKey.$typeName = `${index_1.PKG_V8}::reserve::StakerKey`;
|
|
1601
1601
|
StakerKey.$numTypeParams = 0;
|
|
1602
1602
|
StakerKey.$isPhantom = [];
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { GenericArg } from "../../_framework/util";
|
|
2
2
|
import { Transaction, TransactionArgument, TransactionObjectInput } from "@mysten/sui/transactions";
|
|
3
|
-
export declare function destroy(tx: Transaction, config: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
4
3
|
export interface SetArgs {
|
|
5
4
|
builder: TransactionObjectInput;
|
|
6
5
|
field: GenericArg;
|
|
7
6
|
value: GenericArg;
|
|
8
7
|
}
|
|
9
8
|
export declare function set(tx: Transaction, typeArgs: [string, string], args: SetArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
9
|
+
export declare function destroy(tx: Transaction, config: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
10
|
+
export declare function from(tx: Transaction, config: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
10
11
|
export interface SetSpreadFeeBpsArgs {
|
|
11
12
|
builder: TransactionObjectInput;
|
|
12
13
|
spreadFeeBps: bigint | TransactionArgument;
|
|
13
14
|
}
|
|
14
15
|
export declare function setSpreadFeeBps(tx: Transaction, args: SetSpreadFeeBpsArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
15
16
|
export declare function spreadFee(tx: Transaction, config: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
16
|
-
export declare function from(tx: Transaction, config: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
17
17
|
export declare function borrowFee(tx: Transaction, config: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
18
18
|
export declare function borrowLimit(tx: Transaction, config: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
19
19
|
export declare function borrowLimitUsd(tx: Transaction, config: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.destroy = destroy;
|
|
4
3
|
exports.set = set;
|
|
4
|
+
exports.destroy = destroy;
|
|
5
|
+
exports.from = from;
|
|
5
6
|
exports.setSpreadFeeBps = setSpreadFeeBps;
|
|
6
7
|
exports.spreadFee = spreadFee;
|
|
7
|
-
exports.from = from;
|
|
8
8
|
exports.borrowFee = borrowFee;
|
|
9
9
|
exports.borrowLimit = borrowLimit;
|
|
10
10
|
exports.borrowLimitUsd = borrowLimitUsd;
|
|
@@ -41,12 +41,6 @@ exports.validateReserveConfig = validateReserveConfig;
|
|
|
41
41
|
exports.validateUtilsAndAprs = validateUtilsAndAprs;
|
|
42
42
|
const __1 = require("..");
|
|
43
43
|
const util_1 = require("../../_framework/util");
|
|
44
|
-
function destroy(tx, config) {
|
|
45
|
-
return tx.moveCall({
|
|
46
|
-
target: `${__1.PUBLISHED_AT}::reserve_config::destroy`,
|
|
47
|
-
arguments: [(0, util_1.obj)(tx, config)],
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
44
|
function set(tx, typeArgs, args) {
|
|
51
45
|
return tx.moveCall({
|
|
52
46
|
target: `${__1.PUBLISHED_AT}::reserve_config::set`,
|
|
@@ -58,6 +52,18 @@ function set(tx, typeArgs, args) {
|
|
|
58
52
|
],
|
|
59
53
|
});
|
|
60
54
|
}
|
|
55
|
+
function destroy(tx, config) {
|
|
56
|
+
return tx.moveCall({
|
|
57
|
+
target: `${__1.PUBLISHED_AT}::reserve_config::destroy`,
|
|
58
|
+
arguments: [(0, util_1.obj)(tx, config)],
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function from(tx, config) {
|
|
62
|
+
return tx.moveCall({
|
|
63
|
+
target: `${__1.PUBLISHED_AT}::reserve_config::from`,
|
|
64
|
+
arguments: [(0, util_1.obj)(tx, config)],
|
|
65
|
+
});
|
|
66
|
+
}
|
|
61
67
|
function setSpreadFeeBps(tx, args) {
|
|
62
68
|
return tx.moveCall({
|
|
63
69
|
target: `${__1.PUBLISHED_AT}::reserve_config::set_spread_fee_bps`,
|
|
@@ -70,12 +76,6 @@ function spreadFee(tx, config) {
|
|
|
70
76
|
arguments: [(0, util_1.obj)(tx, config)],
|
|
71
77
|
});
|
|
72
78
|
}
|
|
73
|
-
function from(tx, config) {
|
|
74
|
-
return tx.moveCall({
|
|
75
|
-
target: `${__1.PUBLISHED_AT}::reserve_config::from`,
|
|
76
|
-
arguments: [(0, util_1.obj)(tx, config)],
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
79
|
function borrowFee(tx, config) {
|
|
80
80
|
return tx.moveCall({
|
|
81
81
|
target: `${__1.PUBLISHED_AT}::reserve_config::borrow_fee`,
|
package/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SuiClient } from "@mysten/sui/client";
|
|
2
2
|
import { Transaction, TransactionObjectInput, TransactionResult } from "@mysten/sui/transactions";
|
|
3
3
|
import { SuiPriceServiceConnection, SuiPythClient } from "@pythnetwork/pyth-sui-js";
|
|
4
|
-
import { LendingMarket, ObligationOwnerCap } from "./_generated/suilend/lending-market/structs";
|
|
4
|
+
import { FeeReceivers, LendingMarket, ObligationOwnerCap } from "./_generated/suilend/lending-market/structs";
|
|
5
5
|
import { Obligation } from "./_generated/suilend/obligation/structs";
|
|
6
6
|
import { NewConfigArgs as CreateRateLimiterConfigArgs } from "./_generated/suilend/rate-limiter/functions";
|
|
7
7
|
import { CreateReserveConfigArgs } from "./_generated/suilend/reserve-config/functions";
|
|
@@ -21,6 +21,7 @@ export declare class SuilendClient {
|
|
|
21
21
|
pythConnection: SuiPriceServiceConnection;
|
|
22
22
|
constructor(lendingMarket: LendingMarket<string>, client: SuiClient);
|
|
23
23
|
static initialize(lendingMarketId: string, lendingMarketType: string, client: SuiClient): Promise<SuilendClient>;
|
|
24
|
+
static getFeeReceivers(client: SuiClient, lendingMarketId: string): Promise<FeeReceivers>;
|
|
24
25
|
static createNewLendingMarket(registryId: string, lendingMarketType: string, transaction: Transaction): {
|
|
25
26
|
$kind: "NestedResult";
|
|
26
27
|
NestedResult: [number, number];
|
|
@@ -61,5 +62,6 @@ export declare class SuilendClient {
|
|
|
61
62
|
liquidate(transaction: Transaction, obligation: Obligation<string>, repayCoinType: string, withdrawCoinType: string, repayCoinId: TransactionObjectInput): Promise<TransactionResult>;
|
|
62
63
|
migrate(transaction: Transaction, lendingMarketOwnerCapId: string): TransactionResult;
|
|
63
64
|
claimFees(transaction: Transaction, coinType: string): TransactionResult;
|
|
65
|
+
setFeeReceiversAndWeights(transaction: Transaction, lendingMarketOwnerCapId: string, receivers: string[], weights: bigint[]): TransactionResult;
|
|
64
66
|
redeemCtokensAndWithdrawLiquidity(ownerId: string, ctokenCoinTypes: string[], transaction: Transaction): Promise<void>;
|
|
65
67
|
}
|
package/client.js
CHANGED
|
@@ -66,6 +66,23 @@ class SuilendClient {
|
|
|
66
66
|
return new SuilendClient(lendingMarket, client);
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
+
static getFeeReceivers(client, lendingMarketId) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
var _a;
|
|
72
|
+
const feeReceiver = yield client.getDynamicFieldObject({
|
|
73
|
+
parentId: lendingMarketId,
|
|
74
|
+
name: {
|
|
75
|
+
type: `${suilend_1.PKG_V10}::lending_market::FeeReceiversKey`,
|
|
76
|
+
value: {
|
|
77
|
+
dummy_field: false,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
const data = ((_a = feeReceiver.data) === null || _a === void 0 ? void 0 : _a.content).fields.value.fields;
|
|
82
|
+
const feeReceivers = structs_2.FeeReceivers.fromFields(data);
|
|
83
|
+
return feeReceivers;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
69
86
|
static createNewLendingMarket(registryId, lendingMarketType, transaction) {
|
|
70
87
|
const [ownerCap, lendingMarket] = (0, functions_2.createLendingMarket)(transaction, lendingMarketType, transaction.object(registryId));
|
|
71
88
|
transaction.moveCall({
|
|
@@ -393,6 +410,13 @@ class SuilendClient {
|
|
|
393
410
|
clock: transaction.object(utils_1.SUI_CLOCK_OBJECT_ID),
|
|
394
411
|
deposit: ctokens,
|
|
395
412
|
});
|
|
413
|
+
if (isSui(coinType)) {
|
|
414
|
+
(0, functions_1.rebalanceStaker)(transaction, this.lendingMarket.$typeArgs[0], {
|
|
415
|
+
lendingMarket: transaction.object(this.lendingMarket.id),
|
|
416
|
+
suiReserveArrayIndex: transaction.pure.u64(this.findReserveArrayIndex(coinType)),
|
|
417
|
+
systemState: transaction.object(utils_1.SUI_SYSTEM_STATE_OBJECT_ID),
|
|
418
|
+
});
|
|
419
|
+
}
|
|
396
420
|
}
|
|
397
421
|
depositIntoObligation(ownerId, coinType, value, transaction, obligationOwnerCapId) {
|
|
398
422
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -582,6 +606,14 @@ class SuilendClient {
|
|
|
582
606
|
reserveArrayIndex: transaction.pure.u64(this.findReserveArrayIndex(coinType)),
|
|
583
607
|
});
|
|
584
608
|
}
|
|
609
|
+
setFeeReceiversAndWeights(transaction, lendingMarketOwnerCapId, receivers, weights) {
|
|
610
|
+
return (0, functions_1.setFeeReceivers)(transaction, this.lendingMarket.$typeArgs[0], {
|
|
611
|
+
lendingMarketOwnerCap: transaction.object(lendingMarketOwnerCapId),
|
|
612
|
+
lendingMarket: transaction.object(this.lendingMarket.id),
|
|
613
|
+
receivers,
|
|
614
|
+
weights,
|
|
615
|
+
});
|
|
616
|
+
}
|
|
585
617
|
redeemCtokensAndWithdrawLiquidity(ownerId, ctokenCoinTypes, transaction) {
|
|
586
618
|
return __awaiter(this, void 0, void 0, function* () {
|
|
587
619
|
const mergeCoinsMap = {};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/sdk","version":"1.1.
|
|
1
|
+
{"name":"@suilend/sdk","version":"1.1.31","private":false,"description":"A TypeScript SDK for interacting with the Suilend program","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./client":"./client.js","./constants":"./constants.js","./types":"./types.js","./api/events":"./api/events.js","./api":"./api/index.js","./parsers/apiReserveAssetDataEvent":"./parsers/apiReserveAssetDataEvent.js","./parsers":"./parsers/index.js","./parsers/lendingMarket":"./parsers/lendingMarket.js","./parsers/obligation":"./parsers/obligation.js","./parsers/rateLimiter":"./parsers/rateLimiter.js","./parsers/reserve":"./parsers/reserve.js","./utils/events":"./utils/events.js","./utils":"./utils/index.js","./utils/obligation":"./utils/obligation.js","./utils/simulate":"./utils/simulate.js","./_generated/_framework/reified":"./_generated/_framework/reified.js","./_generated/_framework/util":"./_generated/_framework/util.js","./_generated/_framework/vector":"./_generated/_framework/vector.js","./_generated/suilend":"./_generated/suilend/index.js","./_generated/suilend/cell/structs":"./_generated/suilend/cell/structs.js","./_generated/suilend/decimal/structs":"./_generated/suilend/decimal/structs.js","./_generated/suilend/lending-market/functions":"./_generated/suilend/lending-market/functions.js","./_generated/suilend/lending-market/structs":"./_generated/suilend/lending-market/structs.js","./_generated/suilend/lending-market-registry/functions":"./_generated/suilend/lending-market-registry/functions.js","./_generated/suilend/liquidity-mining/structs":"./_generated/suilend/liquidity-mining/structs.js","./_generated/suilend/obligation/structs":"./_generated/suilend/obligation/structs.js","./_generated/suilend/rate-limiter/functions":"./_generated/suilend/rate-limiter/functions.js","./_generated/suilend/rate-limiter/structs":"./_generated/suilend/rate-limiter/structs.js","./_generated/suilend/reserve/structs":"./_generated/suilend/reserve/structs.js","./_generated/suilend/reserve-config/functions":"./_generated/suilend/reserve-config/functions.js","./_generated/suilend/reserve-config/structs":"./_generated/suilend/reserve-config/structs.js","./_generated/_dependencies/source/0x1":"./_generated/_dependencies/source/0x1/index.js","./_generated/_dependencies/source/0x2":"./_generated/_dependencies/source/0x2/index.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/index.js","./_generated/_dependencies/source/0x1/ascii/structs":"./_generated/_dependencies/source/0x1/ascii/structs.js","./_generated/_dependencies/source/0x1/option/structs":"./_generated/_dependencies/source/0x1/option/structs.js","./_generated/_dependencies/source/0x1/type-name/structs":"./_generated/_dependencies/source/0x1/type-name/structs.js","./_generated/_dependencies/source/0x2/bag/structs":"./_generated/_dependencies/source/0x2/bag/structs.js","./_generated/_dependencies/source/0x2/balance/structs":"./_generated/_dependencies/source/0x2/balance/structs.js","./_generated/_dependencies/source/0x2/object/structs":"./_generated/_dependencies/source/0x2/object/structs.js","./_generated/_dependencies/source/0x2/object-table/structs":"./_generated/_dependencies/source/0x2/object-table/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix \"./src/**/*.ts\"","prettier":"prettier --write \"./src/**/*\"","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ts-node ./release.ts && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/solendprotocol/suilend-public.git"},"bugs":{"url":"https://github.com/solendprotocol/suilend-public/issues"},"dependencies":{"@mysten/bcs":"1.2.1","@mysten/sui":"1.20.0","@pythnetwork/pyth-sui-js":"^2.1.0","bignumber.js":"^9.1.2","p-limit":"3.1.0","uuid":"^11.0.3"},"devDependencies":{"ts-node":"^10.9.2"}}
|