@suilend/sdk 12.7.0 → 13.0.0-next.g803bba0
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/pyth-2/price-identifier/structs.d.ts +46 -0
- package/_generated/_dependencies/{source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e → pyth-2}/price-identifier/structs.js +45 -25
- package/_generated/_dependencies/std/ascii/structs.d.ts +100 -0
- package/_generated/_dependencies/{source/0x1 → std}/ascii/structs.js +153 -103
- package/_generated/_dependencies/{source/0x1 → std}/option/structs.d.ts +29 -21
- package/_generated/_dependencies/std/option/structs.js +155 -0
- package/_generated/_dependencies/std/type-name/structs.d.ts +65 -0
- package/_generated/_dependencies/{source/0x1 → std}/type-name/structs.js +49 -22
- package/_generated/_dependencies/sui/bag/structs.d.ts +75 -0
- package/_generated/_dependencies/sui/bag/structs.js +154 -0
- package/_generated/_dependencies/{source/0x2 → sui}/balance/structs.d.ts +80 -60
- package/_generated/_dependencies/sui/balance/structs.js +306 -0
- package/_generated/_dependencies/sui/object/structs.d.ts +104 -0
- package/_generated/_dependencies/{source/0x2 → sui}/object/structs.js +98 -46
- package/_generated/_dependencies/{source/0x2 → sui}/object-table/structs.d.ts +37 -30
- package/_generated/_dependencies/sui/object-table/structs.js +164 -0
- package/_generated/_envs/index.d.ts +3 -0
- package/_generated/_envs/index.js +18 -0
- package/_generated/_envs/mainnet.d.ts +2 -0
- package/_generated/_envs/mainnet.js +490 -0
- package/_generated/_framework/env.d.ts +137 -0
- package/_generated/_framework/env.js +261 -0
- package/_generated/_framework/reified.d.ts +68 -36
- package/_generated/_framework/reified.js +110 -98
- package/_generated/_framework/util.d.ts +4 -4
- package/_generated/_framework/util.js +82 -79
- package/_generated/_framework/vector.d.ts +11 -9
- package/_generated/_framework/vector.js +10 -10
- package/_generated/suilend/cell/structs.d.ts +24 -22
- package/_generated/suilend/cell/structs.js +68 -24
- package/_generated/suilend/decimal/structs.d.ts +28 -24
- package/_generated/suilend/decimal/structs.js +45 -24
- package/_generated/suilend/index.d.ts +5 -6
- package/_generated/suilend/index.js +10 -19
- package/_generated/suilend/lending-market/functions.d.ts +1123 -149
- package/_generated/suilend/lending-market/functions.js +1121 -207
- package/_generated/suilend/lending-market/structs.d.ts +985 -1290
- package/_generated/suilend/lending-market/structs.js +2482 -1282
- package/_generated/suilend/lending-market-registry/functions.d.ts +32 -3
- package/_generated/suilend/lending-market-registry/functions.js +30 -6
- package/_generated/suilend/liquidity-mining/structs.d.ts +200 -333
- package/_generated/suilend/liquidity-mining/structs.js +449 -319
- package/_generated/suilend/obligation/structs.d.ts +406 -918
- package/_generated/suilend/obligation/structs.js +786 -596
- package/_generated/suilend/rate-limiter/functions.d.ts +134 -15
- package/_generated/suilend/rate-limiter/functions.js +139 -21
- package/_generated/suilend/rate-limiter/structs.d.ts +72 -80
- package/_generated/suilend/rate-limiter/structs.js +98 -48
- package/_generated/suilend/reserve/structs.d.ts +611 -904
- package/_generated/suilend/reserve/structs.js +1528 -736
- package/_generated/suilend/reserve-config/functions.d.ts +718 -96
- package/_generated/suilend/reserve-config/functions.js +751 -157
- package/_generated/suilend/reserve-config/structs.d.ts +148 -163
- package/_generated/suilend/reserve-config/structs.js +260 -94
- package/client.d.ts +2 -2
- package/client.js +22 -39
- package/lib/initialize.d.ts +76 -76
- package/lib/initialize.js +10 -10
- package/lib/proCompatible.js +5 -5
- package/package.json +1 -1
- package/parsers/lendingMarket.d.ts +9 -9
- package/parsers/obligation.d.ts +14 -14
- package/parsers/obligation.js +4 -4
- package/parsers/rateLimiter.d.ts +1 -1
- package/parsers/reserve.d.ts +12 -12
- package/parsers/reserve.js +2 -2
- package/strategies.d.ts +14 -14
- package/utils/simulate.d.ts +1 -1
- package/utils/simulate.js +5 -5
- package/_generated/_dependencies/source/0x1/ascii/structs.d.ts +0 -84
- package/_generated/_dependencies/source/0x1/index.d.ts +0 -3
- package/_generated/_dependencies/source/0x1/index.js +0 -3
- package/_generated/_dependencies/source/0x1/option/structs.js +0 -110
- package/_generated/_dependencies/source/0x1/type-name/structs.d.ts +0 -47
- package/_generated/_dependencies/source/0x2/bag/structs.d.ts +0 -52
- package/_generated/_dependencies/source/0x2/bag/structs.js +0 -113
- package/_generated/_dependencies/source/0x2/balance/structs.js +0 -210
- package/_generated/_dependencies/source/0x2/index.d.ts +0 -3
- package/_generated/_dependencies/source/0x2/index.js +0 -3
- package/_generated/_dependencies/source/0x2/object/structs.d.ts +0 -82
- package/_generated/_dependencies/source/0x2/object-table/structs.js +0 -115
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/index.d.ts +0 -4
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/index.js +0 -4
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.d.ts +0 -46
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
2
|
-
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
|
-
import { PKG_V30 } from "../index";
|
|
4
|
-
import { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
5
|
-
export declare function isID(type: string): boolean;
|
|
6
|
-
export interface IDFields {
|
|
7
|
-
bytes: ToField<"address">;
|
|
8
|
-
}
|
|
9
|
-
export type IDReified = Reified<ID, IDFields>;
|
|
10
|
-
export declare class ID implements StructClass {
|
|
11
|
-
__StructClass: true;
|
|
12
|
-
static readonly $typeName = "0x2::object::ID";
|
|
13
|
-
static readonly $numTypeParams = 0;
|
|
14
|
-
static readonly $isPhantom: readonly [];
|
|
15
|
-
readonly $typeName = "0x2::object::ID";
|
|
16
|
-
readonly $fullTypeName: `${typeof PKG_V30}::object::ID`;
|
|
17
|
-
readonly $typeArgs: [];
|
|
18
|
-
readonly $isPhantom: readonly [];
|
|
19
|
-
readonly bytes: ToField<"address">;
|
|
20
|
-
private constructor();
|
|
21
|
-
static reified(): IDReified;
|
|
22
|
-
static get r(): import("../../../../_framework/reified").StructClassReified<ID, IDFields>;
|
|
23
|
-
static phantom(): PhantomReified<ToTypeStr<ID>>;
|
|
24
|
-
static get p(): PhantomReified<"0x2::object::ID">;
|
|
25
|
-
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
26
|
-
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
27
|
-
}, string>;
|
|
28
|
-
static fromFields(fields: Record<string, any>): ID;
|
|
29
|
-
static fromFieldsWithTypes(item: FieldsWithTypes): ID;
|
|
30
|
-
static fromBcs(data: Uint8Array): ID;
|
|
31
|
-
toJSONField(): {
|
|
32
|
-
bytes: string;
|
|
33
|
-
};
|
|
34
|
-
toJSON(): {
|
|
35
|
-
bytes: string;
|
|
36
|
-
$typeName: string;
|
|
37
|
-
$typeArgs: [];
|
|
38
|
-
};
|
|
39
|
-
static fromJSONField(field: any): ID;
|
|
40
|
-
static fromJSON(json: Record<string, any>): ID;
|
|
41
|
-
static fetch(client: SuiGrpcClient, id: string): Promise<ID>;
|
|
42
|
-
}
|
|
43
|
-
export declare function isUID(type: string): boolean;
|
|
44
|
-
export interface UIDFields {
|
|
45
|
-
id: ToField<ID>;
|
|
46
|
-
}
|
|
47
|
-
export type UIDReified = Reified<UID, UIDFields>;
|
|
48
|
-
export declare class UID implements StructClass {
|
|
49
|
-
__StructClass: true;
|
|
50
|
-
static readonly $typeName = "0x2::object::UID";
|
|
51
|
-
static readonly $numTypeParams = 0;
|
|
52
|
-
static readonly $isPhantom: readonly [];
|
|
53
|
-
readonly $typeName = "0x2::object::UID";
|
|
54
|
-
readonly $fullTypeName: `${typeof PKG_V30}::object::UID`;
|
|
55
|
-
readonly $typeArgs: [];
|
|
56
|
-
readonly $isPhantom: readonly [];
|
|
57
|
-
readonly id: ToField<ID>;
|
|
58
|
-
private constructor();
|
|
59
|
-
static reified(): UIDReified;
|
|
60
|
-
static get r(): import("../../../../_framework/reified").StructClassReified<UID, UIDFields>;
|
|
61
|
-
static phantom(): PhantomReified<ToTypeStr<UID>>;
|
|
62
|
-
static get p(): PhantomReified<"0x2::object::UID">;
|
|
63
|
-
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
64
|
-
id: import("@mysten/bcs").BcsStruct<{
|
|
65
|
-
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
66
|
-
}, string>;
|
|
67
|
-
}, string>;
|
|
68
|
-
static fromFields(fields: Record<string, any>): UID;
|
|
69
|
-
static fromFieldsWithTypes(item: FieldsWithTypes): UID;
|
|
70
|
-
static fromBcs(data: Uint8Array): UID;
|
|
71
|
-
toJSONField(): {
|
|
72
|
-
id: string;
|
|
73
|
-
};
|
|
74
|
-
toJSON(): {
|
|
75
|
-
id: string;
|
|
76
|
-
$typeName: string;
|
|
77
|
-
$typeArgs: [];
|
|
78
|
-
};
|
|
79
|
-
static fromJSONField(field: any): UID;
|
|
80
|
-
static fromJSON(json: Record<string, any>): UID;
|
|
81
|
-
static fetch(client: SuiGrpcClient, id: string): Promise<UID>;
|
|
82
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { assertFieldsWithTypesArgsMatch, assertReifiedTypeArgsMatch, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, extractType, phantom, } from "../../../../_framework/reified.js";
|
|
2
|
-
import { composeSuiType, compressSuiType, } from "../../../../_framework/util.js";
|
|
3
|
-
import { PKG_V30 } from "../index.js";
|
|
4
|
-
import { UID } from "../object/structs.js";
|
|
5
|
-
import { bcs } from "@mysten/sui/bcs";
|
|
6
|
-
/* ============================== ObjectTable =============================== */
|
|
7
|
-
export function isObjectTable(type) {
|
|
8
|
-
type = compressSuiType(type);
|
|
9
|
-
return type.startsWith(`${PKG_V30}::object_table::ObjectTable` + "<");
|
|
10
|
-
}
|
|
11
|
-
export class ObjectTable {
|
|
12
|
-
__StructClass = true;
|
|
13
|
-
static $typeName = `${PKG_V30}::object_table::ObjectTable`;
|
|
14
|
-
static $numTypeParams = 2;
|
|
15
|
-
static $isPhantom = [true, true];
|
|
16
|
-
$typeName = ObjectTable.$typeName;
|
|
17
|
-
$fullTypeName;
|
|
18
|
-
$typeArgs;
|
|
19
|
-
$isPhantom = ObjectTable.$isPhantom;
|
|
20
|
-
id;
|
|
21
|
-
size;
|
|
22
|
-
constructor(typeArgs, fields) {
|
|
23
|
-
this.$fullTypeName = composeSuiType(ObjectTable.$typeName, ...typeArgs);
|
|
24
|
-
this.$typeArgs = typeArgs;
|
|
25
|
-
this.id = fields.id;
|
|
26
|
-
this.size = fields.size;
|
|
27
|
-
}
|
|
28
|
-
static reified(K, V) {
|
|
29
|
-
return {
|
|
30
|
-
typeName: ObjectTable.$typeName,
|
|
31
|
-
fullTypeName: composeSuiType(ObjectTable.$typeName, ...[extractType(K), extractType(V)]),
|
|
32
|
-
typeArgs: [extractType(K), extractType(V)],
|
|
33
|
-
isPhantom: ObjectTable.$isPhantom,
|
|
34
|
-
reifiedTypeArgs: [K, V],
|
|
35
|
-
fromFields: (fields) => ObjectTable.fromFields([K, V], fields),
|
|
36
|
-
fromFieldsWithTypes: (item) => ObjectTable.fromFieldsWithTypes([K, V], item),
|
|
37
|
-
fromBcs: (data) => ObjectTable.fromBcs([K, V], data),
|
|
38
|
-
bcs: ObjectTable.bcs,
|
|
39
|
-
fromJSONField: (field) => ObjectTable.fromJSONField([K, V], field),
|
|
40
|
-
fromJSON: (json) => ObjectTable.fromJSON([K, V], json),
|
|
41
|
-
fetch: async (client, id) => ObjectTable.fetch(client, [K, V], id),
|
|
42
|
-
new: (fields) => {
|
|
43
|
-
return new ObjectTable([extractType(K), extractType(V)], fields);
|
|
44
|
-
},
|
|
45
|
-
kind: "StructClassReified",
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
static get r() {
|
|
49
|
-
return ObjectTable.reified;
|
|
50
|
-
}
|
|
51
|
-
static phantom(K, V) {
|
|
52
|
-
return phantom(ObjectTable.reified(K, V));
|
|
53
|
-
}
|
|
54
|
-
static get p() {
|
|
55
|
-
return ObjectTable.phantom;
|
|
56
|
-
}
|
|
57
|
-
static get bcs() {
|
|
58
|
-
return bcs.struct("ObjectTable", {
|
|
59
|
-
id: UID.bcs,
|
|
60
|
-
size: bcs.u64(),
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
static fromFields(typeArgs, fields) {
|
|
64
|
-
return ObjectTable.reified(typeArgs[0], typeArgs[1]).new({
|
|
65
|
-
id: decodeFromFields(UID.reified(), fields.id),
|
|
66
|
-
size: decodeFromFields("u64", fields.size),
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
static fromFieldsWithTypes(typeArgs, item) {
|
|
70
|
-
if (!isObjectTable(item.type)) {
|
|
71
|
-
throw new Error("not a ObjectTable type");
|
|
72
|
-
}
|
|
73
|
-
assertFieldsWithTypesArgsMatch(item, typeArgs);
|
|
74
|
-
return ObjectTable.reified(typeArgs[0], typeArgs[1]).new({
|
|
75
|
-
id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id),
|
|
76
|
-
size: decodeFromFieldsWithTypes("u64", item.fields.size),
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
static fromBcs(typeArgs, data) {
|
|
80
|
-
return ObjectTable.fromFields(typeArgs, ObjectTable.bcs.parse(data));
|
|
81
|
-
}
|
|
82
|
-
toJSONField() {
|
|
83
|
-
return {
|
|
84
|
-
id: this.id,
|
|
85
|
-
size: this.size.toString(),
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
toJSON() {
|
|
89
|
-
return {
|
|
90
|
-
$typeName: this.$typeName,
|
|
91
|
-
$typeArgs: this.$typeArgs,
|
|
92
|
-
...this.toJSONField(),
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
static fromJSONField(typeArgs, field) {
|
|
96
|
-
return ObjectTable.reified(typeArgs[0], typeArgs[1]).new({
|
|
97
|
-
id: decodeFromJSONField(UID.reified(), field.id),
|
|
98
|
-
size: decodeFromJSONField("u64", field.size),
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
static fromJSON(typeArgs, json) {
|
|
102
|
-
if (json.$typeName !== ObjectTable.$typeName) {
|
|
103
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
104
|
-
}
|
|
105
|
-
assertReifiedTypeArgsMatch(composeSuiType(ObjectTable.$typeName, ...typeArgs.map(extractType)), json.$typeArgs, typeArgs);
|
|
106
|
-
return ObjectTable.fromJSONField(typeArgs, json);
|
|
107
|
-
}
|
|
108
|
-
static async fetch(client, typeArgs, id) {
|
|
109
|
-
const { object } = await client.getObject({ objectId: id, include: { content: true } });
|
|
110
|
-
if (!isObjectTable(object.type)) {
|
|
111
|
-
throw new Error(`object at id ${id} is not a ObjectTable object`);
|
|
112
|
-
}
|
|
113
|
-
return ObjectTable.fromBcs(typeArgs, object.content);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const PACKAGE_ID = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e";
|
|
2
|
-
export declare const PUBLISHED_AT = "0x4e20ddf36af412a4096f9014f4a565af9e812db9a05cc40254846cf6ed0ad91";
|
|
3
|
-
export declare const PKG_V2 = "0x4e20ddf36af412a4096f9014f4a565af9e812db9a05cc40254846cf6ed0ad91";
|
|
4
|
-
export declare const PKG_V1 = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e";
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export const PACKAGE_ID = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e";
|
|
2
|
-
export const PUBLISHED_AT = "0x4e20ddf36af412a4096f9014f4a565af9e812db9a05cc40254846cf6ed0ad91";
|
|
3
|
-
export const PKG_V2 = "0x4e20ddf36af412a4096f9014f4a565af9e812db9a05cc40254846cf6ed0ad91";
|
|
4
|
-
export const PKG_V1 = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e";
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as reified from "../../../../_framework/reified";
|
|
2
|
-
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
3
|
-
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
4
|
-
import { Vector } from "../../../../_framework/vector";
|
|
5
|
-
import { PKG_V1 } from "../index";
|
|
6
|
-
import { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
7
|
-
export declare function isPriceIdentifier(type: string): boolean;
|
|
8
|
-
export interface PriceIdentifierFields {
|
|
9
|
-
bytes: ToField<Vector<"u8">>;
|
|
10
|
-
}
|
|
11
|
-
export type PriceIdentifierReified = Reified<PriceIdentifier, PriceIdentifierFields>;
|
|
12
|
-
export declare class PriceIdentifier implements StructClass {
|
|
13
|
-
__StructClass: true;
|
|
14
|
-
static readonly $typeName = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_identifier::PriceIdentifier";
|
|
15
|
-
static readonly $numTypeParams = 0;
|
|
16
|
-
static readonly $isPhantom: readonly [];
|
|
17
|
-
readonly $typeName = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_identifier::PriceIdentifier";
|
|
18
|
-
readonly $fullTypeName: `${typeof PKG_V1}::price_identifier::PriceIdentifier`;
|
|
19
|
-
readonly $typeArgs: [];
|
|
20
|
-
readonly $isPhantom: readonly [];
|
|
21
|
-
readonly bytes: ToField<Vector<"u8">>;
|
|
22
|
-
private constructor();
|
|
23
|
-
static reified(): PriceIdentifierReified;
|
|
24
|
-
static get r(): reified.StructClassReified<PriceIdentifier, PriceIdentifierFields>;
|
|
25
|
-
static phantom(): PhantomReified<ToTypeStr<PriceIdentifier>>;
|
|
26
|
-
static get p(): reified.PhantomReified<"0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_identifier::PriceIdentifier">;
|
|
27
|
-
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
28
|
-
bytes: import("@mysten/bcs").BcsType<number[], Iterable<number> & {
|
|
29
|
-
length: number;
|
|
30
|
-
}, string>;
|
|
31
|
-
}, string>;
|
|
32
|
-
static fromFields(fields: Record<string, any>): PriceIdentifier;
|
|
33
|
-
static fromFieldsWithTypes(item: FieldsWithTypes): PriceIdentifier;
|
|
34
|
-
static fromBcs(data: Uint8Array): PriceIdentifier;
|
|
35
|
-
toJSONField(): {
|
|
36
|
-
bytes: number[];
|
|
37
|
-
};
|
|
38
|
-
toJSON(): {
|
|
39
|
-
bytes: number[];
|
|
40
|
-
$typeName: string;
|
|
41
|
-
$typeArgs: [];
|
|
42
|
-
};
|
|
43
|
-
static fromJSONField(field: any): PriceIdentifier;
|
|
44
|
-
static fromJSON(json: Record<string, any>): PriceIdentifier;
|
|
45
|
-
static fetch(client: SuiGrpcClient, id: string): Promise<PriceIdentifier>;
|
|
46
|
-
}
|