@suilend/sdk 12.7.0 → 13.0.0-next.g122801a

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.
Files changed (86) hide show
  1. package/_generated/_dependencies/pyth-2/price-identifier/structs.d.ts +46 -0
  2. package/_generated/_dependencies/{source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e → pyth-2}/price-identifier/structs.js +45 -25
  3. package/_generated/_dependencies/std/ascii/structs.d.ts +100 -0
  4. package/_generated/_dependencies/{source/0x1 → std}/ascii/structs.js +153 -103
  5. package/_generated/_dependencies/{source/0x1 → std}/option/structs.d.ts +29 -21
  6. package/_generated/_dependencies/std/option/structs.js +155 -0
  7. package/_generated/_dependencies/std/type-name/structs.d.ts +65 -0
  8. package/_generated/_dependencies/{source/0x1 → std}/type-name/structs.js +49 -22
  9. package/_generated/_dependencies/sui/bag/structs.d.ts +75 -0
  10. package/_generated/_dependencies/sui/bag/structs.js +154 -0
  11. package/_generated/_dependencies/{source/0x2 → sui}/balance/structs.d.ts +80 -60
  12. package/_generated/_dependencies/sui/balance/structs.js +306 -0
  13. package/_generated/_dependencies/sui/object/structs.d.ts +104 -0
  14. package/_generated/_dependencies/{source/0x2 → sui}/object/structs.js +98 -46
  15. package/_generated/_dependencies/{source/0x2 → sui}/object-table/structs.d.ts +37 -30
  16. package/_generated/_dependencies/sui/object-table/structs.js +164 -0
  17. package/_generated/_envs/index.d.ts +3 -0
  18. package/_generated/_envs/index.js +18 -0
  19. package/_generated/_envs/mainnet.d.ts +2 -0
  20. package/_generated/_envs/mainnet.js +490 -0
  21. package/_generated/_framework/env.d.ts +137 -0
  22. package/_generated/_framework/env.js +261 -0
  23. package/_generated/_framework/reified.d.ts +68 -36
  24. package/_generated/_framework/reified.js +110 -98
  25. package/_generated/_framework/util.d.ts +4 -4
  26. package/_generated/_framework/util.js +82 -79
  27. package/_generated/_framework/vector.d.ts +11 -9
  28. package/_generated/_framework/vector.js +10 -10
  29. package/_generated/suilend/cell/structs.d.ts +24 -22
  30. package/_generated/suilend/cell/structs.js +68 -24
  31. package/_generated/suilend/decimal/structs.d.ts +28 -24
  32. package/_generated/suilend/decimal/structs.js +45 -24
  33. package/_generated/suilend/index.d.ts +5 -6
  34. package/_generated/suilend/index.js +10 -19
  35. package/_generated/suilend/lending-market/functions.d.ts +1123 -149
  36. package/_generated/suilend/lending-market/functions.js +1121 -207
  37. package/_generated/suilend/lending-market/structs.d.ts +985 -1290
  38. package/_generated/suilend/lending-market/structs.js +2482 -1282
  39. package/_generated/suilend/lending-market-registry/functions.d.ts +32 -3
  40. package/_generated/suilend/lending-market-registry/functions.js +30 -6
  41. package/_generated/suilend/liquidity-mining/structs.d.ts +200 -333
  42. package/_generated/suilend/liquidity-mining/structs.js +449 -319
  43. package/_generated/suilend/obligation/structs.d.ts +406 -918
  44. package/_generated/suilend/obligation/structs.js +786 -596
  45. package/_generated/suilend/rate-limiter/functions.d.ts +134 -15
  46. package/_generated/suilend/rate-limiter/functions.js +139 -21
  47. package/_generated/suilend/rate-limiter/structs.d.ts +72 -80
  48. package/_generated/suilend/rate-limiter/structs.js +98 -48
  49. package/_generated/suilend/reserve/structs.d.ts +611 -904
  50. package/_generated/suilend/reserve/structs.js +1528 -736
  51. package/_generated/suilend/reserve-config/functions.d.ts +718 -96
  52. package/_generated/suilend/reserve-config/functions.js +751 -157
  53. package/_generated/suilend/reserve-config/structs.d.ts +148 -163
  54. package/_generated/suilend/reserve-config/structs.js +260 -94
  55. package/client.d.ts +2 -2
  56. package/client.js +22 -39
  57. package/lib/initialize.d.ts +617 -83
  58. package/lib/initialize.js +151 -48
  59. package/lib/proCompatible.js +5 -5
  60. package/package.json +1 -1
  61. package/parsers/lendingMarket.d.ts +9 -9
  62. package/parsers/obligation.d.ts +14 -14
  63. package/parsers/obligation.js +4 -4
  64. package/parsers/rateLimiter.d.ts +1 -1
  65. package/parsers/reserve.d.ts +12 -12
  66. package/parsers/reserve.js +2 -2
  67. package/strategies.d.ts +14 -14
  68. package/utils/obligation.d.ts +3 -0
  69. package/utils/obligation.js +10 -0
  70. package/utils/simulate.d.ts +1 -1
  71. package/utils/simulate.js +5 -5
  72. package/_generated/_dependencies/source/0x1/ascii/structs.d.ts +0 -84
  73. package/_generated/_dependencies/source/0x1/index.d.ts +0 -3
  74. package/_generated/_dependencies/source/0x1/index.js +0 -3
  75. package/_generated/_dependencies/source/0x1/option/structs.js +0 -110
  76. package/_generated/_dependencies/source/0x1/type-name/structs.d.ts +0 -47
  77. package/_generated/_dependencies/source/0x2/bag/structs.d.ts +0 -52
  78. package/_generated/_dependencies/source/0x2/bag/structs.js +0 -113
  79. package/_generated/_dependencies/source/0x2/balance/structs.js +0 -210
  80. package/_generated/_dependencies/source/0x2/index.d.ts +0 -3
  81. package/_generated/_dependencies/source/0x2/index.js +0 -3
  82. package/_generated/_dependencies/source/0x2/object/structs.d.ts +0 -82
  83. package/_generated/_dependencies/source/0x2/object-table/structs.js +0 -115
  84. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/index.d.ts +0 -4
  85. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/index.js +0 -4
  86. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.d.ts +0 -46
@@ -1,741 +1,311 @@
1
- import * as reified from "../../_framework/reified";
2
- import { TypeName } from "../../_dependencies/source/0x1/type-name/structs";
3
- import { ID, UID } from "../../_dependencies/source/0x2/object/structs";
4
- import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToPhantomTypeArgument, ToTypeStr } from "../../_framework/reified";
5
- import { FieldsWithTypes } from "../../_framework/util";
6
- import { Vector } from "../../_framework/vector";
7
- import { Decimal } from "../decimal/structs";
8
- import { PKG_V1, PKG_V11 } from "../index";
9
- import { UserRewardManager } from "../liquidity-mining/structs";
10
- import { SuiGrpcClient } from "@mysten/sui/grpc";
11
- export declare function isBorrow(type: string): boolean;
12
- export interface BorrowFields {
13
- coinType: ToField<TypeName>;
14
- reserveArrayIndex: ToField<"u64">;
15
- borrowedAmount: ToField<Decimal>;
16
- cumulativeBorrowRate: ToField<Decimal>;
17
- marketValue: ToField<Decimal>;
18
- userRewardManagerIndex: ToField<"u64">;
19
- }
20
- export type BorrowReified = Reified<Borrow, BorrowFields>;
21
- export declare class Borrow implements StructClass {
22
- __StructClass: true;
23
- static readonly $typeName: string;
24
- static readonly $numTypeParams = 0;
25
- static readonly $isPhantom: readonly [];
26
- readonly $typeName: string;
27
- readonly $fullTypeName: `${typeof PKG_V1}::obligation::Borrow`;
28
- readonly $typeArgs: [];
29
- readonly $isPhantom: readonly [];
30
- readonly coinType: ToField<TypeName>;
31
- readonly reserveArrayIndex: ToField<"u64">;
32
- readonly borrowedAmount: ToField<Decimal>;
33
- readonly cumulativeBorrowRate: ToField<Decimal>;
34
- readonly marketValue: ToField<Decimal>;
35
- readonly userRewardManagerIndex: ToField<"u64">;
36
- private constructor();
37
- static reified(): BorrowReified;
38
- static get r(): reified.StructClassReified<Borrow, BorrowFields>;
39
- static phantom(): PhantomReified<ToTypeStr<Borrow>>;
40
- static get p(): reified.PhantomReified<"0x1f54a9a2d71799553197e9ea24557797c6398d6a65f2d4d3818c9304b75d5e21::obligation::Borrow" | "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::obligation::Borrow">;
41
- static get bcs(): import("@mysten/bcs").BcsStruct<{
42
- coin_type: import("@mysten/bcs").BcsStruct<{
43
- name: import("@mysten/bcs").BcsStruct<{
44
- bytes: import("@mysten/bcs").BcsType<number[], Iterable<number> & {
45
- length: number;
46
- }, string>;
47
- }, string>;
48
- }, string>;
49
- reserve_array_index: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
50
- borrowed_amount: import("@mysten/bcs").BcsStruct<{
51
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
52
- }, string>;
53
- cumulative_borrow_rate: import("@mysten/bcs").BcsStruct<{
54
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
55
- }, string>;
56
- market_value: import("@mysten/bcs").BcsStruct<{
57
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
58
- }, string>;
59
- user_reward_manager_index: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
60
- }, string>;
61
- static fromFields(fields: Record<string, any>): Borrow;
62
- static fromFieldsWithTypes(item: FieldsWithTypes): Borrow;
63
- static fromBcs(data: Uint8Array): Borrow;
64
- toJSONField(): {
65
- coinType: {
66
- name: string;
67
- };
68
- reserveArrayIndex: string;
69
- borrowedAmount: {
70
- value: string;
71
- };
72
- cumulativeBorrowRate: {
73
- value: string;
74
- };
75
- marketValue: {
76
- value: string;
77
- };
78
- userRewardManagerIndex: string;
79
- };
80
- toJSON(): {
81
- coinType: {
82
- name: string;
83
- };
84
- reserveArrayIndex: string;
85
- borrowedAmount: {
86
- value: string;
87
- };
88
- cumulativeBorrowRate: {
89
- value: string;
90
- };
91
- marketValue: {
92
- value: string;
93
- };
94
- userRewardManagerIndex: string;
95
- $typeName: string;
96
- $typeArgs: [];
97
- };
98
- static fromJSONField(field: any): Borrow;
99
- static fromJSON(json: Record<string, any>): Borrow;
100
- static fetch(client: SuiGrpcClient, id: string): Promise<Borrow>;
101
- }
102
- export declare function isBorrowRecord(type: string): boolean;
103
- export interface BorrowRecordFields {
104
- coinType: ToField<TypeName>;
105
- reserveArrayIndex: ToField<"u64">;
106
- borrowedAmount: ToField<Decimal>;
107
- cumulativeBorrowRate: ToField<Decimal>;
108
- marketValue: ToField<Decimal>;
109
- userRewardManagerIndex: ToField<"u64">;
1
+ import type { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client';
2
+ import { TypeName } from '../../_dependencies/std/type-name/structs';
3
+ import { ID, UID } from '../../_dependencies/sui/object/structs';
4
+ import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToJSON, ToPhantomTypeArgument, ToTypeStr } from '../../_framework/reified';
5
+ import { FieldsWithTypes } from '../../_framework/util';
6
+ import { Vector } from '../../_framework/vector';
7
+ import { Decimal } from '../decimal/structs';
8
+ import { UserRewardManager } from '../liquidity-mining/structs';
9
+ export declare function isObligation(type: string): boolean;
10
+ export interface ObligationFields<P extends PhantomTypeArgument> {
11
+ id: ToField<UID>;
12
+ lendingMarketId: ToField<ID>;
13
+ /**
14
+ * all deposits in the obligation. there is at most one deposit per coin type
15
+ * There should never be a deposit object with a zeroed amount
16
+ */
17
+ deposits: ToField<Vector<Deposit>>;
18
+ /**
19
+ * all borrows in the obligation. there is at most one deposit per coin type
20
+ * There should never be a borrow object with a zeroed amount
21
+ */
22
+ borrows: ToField<Vector<Borrow>>;
23
+ /** value of all deposits in USD */
24
+ depositedValueUsd: ToField<Decimal>;
25
+ /**
26
+ * sum(deposit value * open ltv) for all deposits.
27
+ * if weighted_borrowed_value_usd > allowed_borrow_value_usd,
28
+ * the obligation is not healthy
29
+ */
30
+ allowedBorrowValueUsd: ToField<Decimal>;
31
+ /**
32
+ * sum(deposit value * close ltv) for all deposits
33
+ * if weighted_borrowed_value_usd > unhealthy_borrow_value_usd,
34
+ * the obligation is unhealthy and can be liquidated
35
+ */
36
+ unhealthyBorrowValueUsd: ToField<Decimal>;
37
+ superUnhealthyBorrowValueUsd: ToField<Decimal>;
38
+ /** value of all borrows in USD */
39
+ unweightedBorrowedValueUsd: ToField<Decimal>;
40
+ /** weighted value of all borrows in USD. used when checking if an obligation is liquidatable */
41
+ weightedBorrowedValueUsd: ToField<Decimal>;
42
+ /**
43
+ * weighted value of all borrows in USD, but using the upper bound of the market value
44
+ * used to limit borrows and withdraws
45
+ */
46
+ weightedBorrowedValueUpperBoundUsd: ToField<Decimal>;
47
+ borrowingIsolatedAsset: ToField<'bool'>;
48
+ userRewardManagers: ToField<Vector<UserRewardManager>>;
49
+ /** unused */
50
+ badDebtUsd: ToField<Decimal>;
51
+ /** unused */
52
+ closable: ToField<'bool'>;
110
53
  }
111
- export type BorrowRecordReified = Reified<BorrowRecord, BorrowRecordFields>;
112
- export declare class BorrowRecord implements StructClass {
54
+ export type ObligationReified<P extends PhantomTypeArgument> = Reified<Obligation<P>, ObligationFields<P>>;
55
+ export type ObligationJSONField<P extends PhantomTypeArgument> = {
56
+ id: string;
57
+ lendingMarketId: string;
58
+ deposits: ToJSON<Deposit>[];
59
+ borrows: ToJSON<Borrow>[];
60
+ depositedValueUsd: ToJSON<Decimal>;
61
+ allowedBorrowValueUsd: ToJSON<Decimal>;
62
+ unhealthyBorrowValueUsd: ToJSON<Decimal>;
63
+ superUnhealthyBorrowValueUsd: ToJSON<Decimal>;
64
+ unweightedBorrowedValueUsd: ToJSON<Decimal>;
65
+ weightedBorrowedValueUsd: ToJSON<Decimal>;
66
+ weightedBorrowedValueUpperBoundUsd: ToJSON<Decimal>;
67
+ borrowingIsolatedAsset: boolean;
68
+ userRewardManagers: ToJSON<UserRewardManager>[];
69
+ badDebtUsd: ToJSON<Decimal>;
70
+ closable: boolean;
71
+ };
72
+ export type ObligationJSON<P extends PhantomTypeArgument> = {
73
+ $typeName: typeof Obligation.$typeName;
74
+ $typeArgs: [PhantomToTypeStr<P>];
75
+ } & ObligationJSONField<P>;
76
+ export declare class Obligation<P extends PhantomTypeArgument> implements StructClass {
113
77
  __StructClass: true;
114
- static readonly $typeName: string;
115
- static readonly $numTypeParams = 0;
116
- static readonly $isPhantom: readonly [];
117
- readonly $typeName: string;
118
- readonly $fullTypeName: `${typeof PKG_V1}::obligation::BorrowRecord`;
119
- readonly $typeArgs: [];
120
- readonly $isPhantom: readonly [];
121
- readonly coinType: ToField<TypeName>;
122
- readonly reserveArrayIndex: ToField<"u64">;
123
- readonly borrowedAmount: ToField<Decimal>;
124
- readonly cumulativeBorrowRate: ToField<Decimal>;
125
- readonly marketValue: ToField<Decimal>;
126
- readonly userRewardManagerIndex: ToField<"u64">;
78
+ static get $typeName(): `${string}::obligation::Obligation`;
79
+ static readonly $numTypeParams = 1;
80
+ static readonly $isPhantom: readonly [true];
81
+ readonly $typeName: typeof Obligation.$typeName;
82
+ readonly $fullTypeName: `${string}::obligation::Obligation<${PhantomToTypeStr<P>}>`;
83
+ readonly $typeArgs: [PhantomToTypeStr<P>];
84
+ readonly $isPhantom: typeof Obligation.$isPhantom;
85
+ readonly id: ToField<UID>;
86
+ readonly lendingMarketId: ToField<ID>;
87
+ /**
88
+ * all deposits in the obligation. there is at most one deposit per coin type
89
+ * There should never be a deposit object with a zeroed amount
90
+ */
91
+ readonly deposits: ToField<Vector<Deposit>>;
92
+ /**
93
+ * all borrows in the obligation. there is at most one deposit per coin type
94
+ * There should never be a borrow object with a zeroed amount
95
+ */
96
+ readonly borrows: ToField<Vector<Borrow>>;
97
+ /** value of all deposits in USD */
98
+ readonly depositedValueUsd: ToField<Decimal>;
99
+ /**
100
+ * sum(deposit value * open ltv) for all deposits.
101
+ * if weighted_borrowed_value_usd > allowed_borrow_value_usd,
102
+ * the obligation is not healthy
103
+ */
104
+ readonly allowedBorrowValueUsd: ToField<Decimal>;
105
+ /**
106
+ * sum(deposit value * close ltv) for all deposits
107
+ * if weighted_borrowed_value_usd > unhealthy_borrow_value_usd,
108
+ * the obligation is unhealthy and can be liquidated
109
+ */
110
+ readonly unhealthyBorrowValueUsd: ToField<Decimal>;
111
+ readonly superUnhealthyBorrowValueUsd: ToField<Decimal>;
112
+ /** value of all borrows in USD */
113
+ readonly unweightedBorrowedValueUsd: ToField<Decimal>;
114
+ /** weighted value of all borrows in USD. used when checking if an obligation is liquidatable */
115
+ readonly weightedBorrowedValueUsd: ToField<Decimal>;
116
+ /**
117
+ * weighted value of all borrows in USD, but using the upper bound of the market value
118
+ * used to limit borrows and withdraws
119
+ */
120
+ readonly weightedBorrowedValueUpperBoundUsd: ToField<Decimal>;
121
+ readonly borrowingIsolatedAsset: ToField<'bool'>;
122
+ readonly userRewardManagers: ToField<Vector<UserRewardManager>>;
123
+ /** unused */
124
+ readonly badDebtUsd: ToField<Decimal>;
125
+ /** unused */
126
+ readonly closable: ToField<'bool'>;
127
127
  private constructor();
128
- static reified(): BorrowRecordReified;
129
- static get r(): reified.StructClassReified<BorrowRecord, BorrowRecordFields>;
130
- static phantom(): PhantomReified<ToTypeStr<BorrowRecord>>;
131
- static get p(): reified.PhantomReified<"0x1f54a9a2d71799553197e9ea24557797c6398d6a65f2d4d3818c9304b75d5e21::obligation::BorrowRecord" | "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::obligation::BorrowRecord">;
132
- static get bcs(): import("@mysten/bcs").BcsStruct<{
133
- coin_type: import("@mysten/bcs").BcsStruct<{
134
- name: import("@mysten/bcs").BcsStruct<{
135
- bytes: import("@mysten/bcs").BcsType<number[], Iterable<number> & {
136
- length: number;
137
- }, string>;
138
- }, string>;
139
- }, string>;
140
- reserve_array_index: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
141
- borrowed_amount: import("@mysten/bcs").BcsStruct<{
142
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
143
- }, string>;
144
- cumulative_borrow_rate: import("@mysten/bcs").BcsStruct<{
145
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
146
- }, string>;
147
- market_value: import("@mysten/bcs").BcsStruct<{
148
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
149
- }, string>;
150
- user_reward_manager_index: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
151
- }, string>;
152
- static fromFields(fields: Record<string, any>): BorrowRecord;
153
- static fromFieldsWithTypes(item: FieldsWithTypes): BorrowRecord;
154
- static fromBcs(data: Uint8Array): BorrowRecord;
155
- toJSONField(): {
156
- coinType: {
157
- name: string;
158
- };
159
- reserveArrayIndex: string;
160
- borrowedAmount: {
161
- value: string;
162
- };
163
- cumulativeBorrowRate: {
164
- value: string;
165
- };
166
- marketValue: {
167
- value: string;
168
- };
169
- userRewardManagerIndex: string;
170
- };
171
- toJSON(): {
172
- coinType: {
173
- name: string;
174
- };
175
- reserveArrayIndex: string;
176
- borrowedAmount: {
177
- value: string;
178
- };
179
- cumulativeBorrowRate: {
180
- value: string;
181
- };
182
- marketValue: {
183
- value: string;
184
- };
185
- userRewardManagerIndex: string;
186
- $typeName: string;
187
- $typeArgs: [];
188
- };
189
- static fromJSONField(field: any): BorrowRecord;
190
- static fromJSON(json: Record<string, any>): BorrowRecord;
191
- static fetch(client: SuiGrpcClient, id: string): Promise<BorrowRecord>;
128
+ static reified<P extends PhantomReified<PhantomTypeArgument>>(P: P): ObligationReified<ToPhantomTypeArgument<P>>;
129
+ static get r(): typeof Obligation.reified;
130
+ static phantom<P extends PhantomReified<PhantomTypeArgument>>(P: P): PhantomReified<ToTypeStr<Obligation<ToPhantomTypeArgument<P>>>>;
131
+ static get p(): typeof Obligation.phantom;
132
+ private static instantiateBcs;
133
+ private static cachedBcs;
134
+ static get bcs(): ReturnType<typeof Obligation.instantiateBcs>;
135
+ static fromFields<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, fields: Record<string, any>): Obligation<ToPhantomTypeArgument<P>>;
136
+ static fromFieldsWithTypes<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, item: FieldsWithTypes): Obligation<ToPhantomTypeArgument<P>>;
137
+ static fromBcs<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, data: Uint8Array): Obligation<ToPhantomTypeArgument<P>>;
138
+ toJSONField(): ObligationJSONField<P>;
139
+ toJSON(): ObligationJSON<P>;
140
+ static fromJSONField<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, field: any): Obligation<ToPhantomTypeArgument<P>>;
141
+ static fromJSON<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, json: Record<string, any>): Obligation<ToPhantomTypeArgument<P>>;
142
+ static fromCoreObject<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, obj: SuiClientTypes.Object<{
143
+ content: true;
144
+ }>): Obligation<ToPhantomTypeArgument<P>>;
145
+ static fetch<P extends PhantomReified<PhantomTypeArgument>>(client: ClientWithCoreApi, typeArg: P, id: string): Promise<Obligation<ToPhantomTypeArgument<P>>>;
192
146
  }
193
147
  export declare function isDeposit(type: string): boolean;
194
148
  export interface DepositFields {
195
149
  coinType: ToField<TypeName>;
196
- reserveArrayIndex: ToField<"u64">;
197
- depositedCtokenAmount: ToField<"u64">;
150
+ reserveArrayIndex: ToField<'u64'>;
151
+ depositedCtokenAmount: ToField<'u64'>;
198
152
  marketValue: ToField<Decimal>;
199
- userRewardManagerIndex: ToField<"u64">;
153
+ userRewardManagerIndex: ToField<'u64'>;
154
+ /** unused */
200
155
  attributedBorrowValue: ToField<Decimal>;
201
156
  }
202
157
  export type DepositReified = Reified<Deposit, DepositFields>;
158
+ export type DepositJSONField = {
159
+ coinType: string;
160
+ reserveArrayIndex: string;
161
+ depositedCtokenAmount: string;
162
+ marketValue: ToJSON<Decimal>;
163
+ userRewardManagerIndex: string;
164
+ attributedBorrowValue: ToJSON<Decimal>;
165
+ };
166
+ export type DepositJSON = {
167
+ $typeName: typeof Deposit.$typeName;
168
+ $typeArgs: [];
169
+ } & DepositJSONField;
203
170
  export declare class Deposit implements StructClass {
204
171
  __StructClass: true;
205
- static readonly $typeName: string;
172
+ static get $typeName(): `${string}::obligation::Deposit`;
206
173
  static readonly $numTypeParams = 0;
207
174
  static readonly $isPhantom: readonly [];
208
- readonly $typeName: string;
209
- readonly $fullTypeName: `${typeof PKG_V1}::obligation::Deposit`;
175
+ readonly $typeName: typeof Deposit.$typeName;
176
+ readonly $fullTypeName: `${string}::obligation::Deposit`;
210
177
  readonly $typeArgs: [];
211
- readonly $isPhantom: readonly [];
178
+ readonly $isPhantom: typeof Deposit.$isPhantom;
212
179
  readonly coinType: ToField<TypeName>;
213
- readonly reserveArrayIndex: ToField<"u64">;
214
- readonly depositedCtokenAmount: ToField<"u64">;
180
+ readonly reserveArrayIndex: ToField<'u64'>;
181
+ readonly depositedCtokenAmount: ToField<'u64'>;
215
182
  readonly marketValue: ToField<Decimal>;
216
- readonly userRewardManagerIndex: ToField<"u64">;
183
+ readonly userRewardManagerIndex: ToField<'u64'>;
184
+ /** unused */
217
185
  readonly attributedBorrowValue: ToField<Decimal>;
218
186
  private constructor();
219
187
  static reified(): DepositReified;
220
- static get r(): reified.StructClassReified<Deposit, DepositFields>;
188
+ static get r(): DepositReified;
221
189
  static phantom(): PhantomReified<ToTypeStr<Deposit>>;
222
- static get p(): reified.PhantomReified<"0x1f54a9a2d71799553197e9ea24557797c6398d6a65f2d4d3818c9304b75d5e21::obligation::Deposit" | "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::obligation::Deposit">;
223
- static get bcs(): import("@mysten/bcs").BcsStruct<{
224
- coin_type: import("@mysten/bcs").BcsStruct<{
225
- name: import("@mysten/bcs").BcsStruct<{
226
- bytes: import("@mysten/bcs").BcsType<number[], Iterable<number> & {
227
- length: number;
228
- }, string>;
229
- }, string>;
230
- }, string>;
231
- reserve_array_index: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
232
- deposited_ctoken_amount: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
233
- market_value: import("@mysten/bcs").BcsStruct<{
234
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
235
- }, string>;
236
- user_reward_manager_index: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
237
- attributed_borrow_value: import("@mysten/bcs").BcsStruct<{
238
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
239
- }, string>;
240
- }, string>;
190
+ static get p(): PhantomReified<ToTypeStr<Deposit>>;
191
+ private static instantiateBcs;
192
+ private static cachedBcs;
193
+ static get bcs(): ReturnType<typeof Deposit.instantiateBcs>;
241
194
  static fromFields(fields: Record<string, any>): Deposit;
242
195
  static fromFieldsWithTypes(item: FieldsWithTypes): Deposit;
243
196
  static fromBcs(data: Uint8Array): Deposit;
244
- toJSONField(): {
245
- coinType: {
246
- name: string;
247
- };
248
- reserveArrayIndex: string;
249
- depositedCtokenAmount: string;
250
- marketValue: {
251
- value: string;
252
- };
253
- userRewardManagerIndex: string;
254
- attributedBorrowValue: {
255
- value: string;
256
- };
257
- };
258
- toJSON(): {
259
- coinType: {
260
- name: string;
261
- };
262
- reserveArrayIndex: string;
263
- depositedCtokenAmount: string;
264
- marketValue: {
265
- value: string;
266
- };
267
- userRewardManagerIndex: string;
268
- attributedBorrowValue: {
269
- value: string;
270
- };
271
- $typeName: string;
272
- $typeArgs: [];
273
- };
197
+ toJSONField(): DepositJSONField;
198
+ toJSON(): DepositJSON;
274
199
  static fromJSONField(field: any): Deposit;
275
200
  static fromJSON(json: Record<string, any>): Deposit;
276
- static fetch(client: SuiGrpcClient, id: string): Promise<Deposit>;
201
+ static fromCoreObject(obj: SuiClientTypes.Object<{
202
+ content: true;
203
+ }>): Deposit;
204
+ static fetch(client: ClientWithCoreApi, id: string): Promise<Deposit>;
277
205
  }
278
- export declare function isDepositRecord(type: string): boolean;
279
- export interface DepositRecordFields {
206
+ export declare function isBorrow(type: string): boolean;
207
+ export interface BorrowFields {
280
208
  coinType: ToField<TypeName>;
281
- reserveArrayIndex: ToField<"u64">;
282
- depositedCtokenAmount: ToField<"u64">;
209
+ reserveArrayIndex: ToField<'u64'>;
210
+ borrowedAmount: ToField<Decimal>;
211
+ cumulativeBorrowRate: ToField<Decimal>;
283
212
  marketValue: ToField<Decimal>;
284
- userRewardManagerIndex: ToField<"u64">;
285
- attributedBorrowValue: ToField<Decimal>;
213
+ userRewardManagerIndex: ToField<'u64'>;
286
214
  }
287
- export type DepositRecordReified = Reified<DepositRecord, DepositRecordFields>;
288
- export declare class DepositRecord implements StructClass {
215
+ export type BorrowReified = Reified<Borrow, BorrowFields>;
216
+ export type BorrowJSONField = {
217
+ coinType: string;
218
+ reserveArrayIndex: string;
219
+ borrowedAmount: ToJSON<Decimal>;
220
+ cumulativeBorrowRate: ToJSON<Decimal>;
221
+ marketValue: ToJSON<Decimal>;
222
+ userRewardManagerIndex: string;
223
+ };
224
+ export type BorrowJSON = {
225
+ $typeName: typeof Borrow.$typeName;
226
+ $typeArgs: [];
227
+ } & BorrowJSONField;
228
+ export declare class Borrow implements StructClass {
289
229
  __StructClass: true;
290
- static readonly $typeName: string;
230
+ static get $typeName(): `${string}::obligation::Borrow`;
291
231
  static readonly $numTypeParams = 0;
292
232
  static readonly $isPhantom: readonly [];
293
- readonly $typeName: string;
294
- readonly $fullTypeName: `${typeof PKG_V1}::obligation::DepositRecord`;
233
+ readonly $typeName: typeof Borrow.$typeName;
234
+ readonly $fullTypeName: `${string}::obligation::Borrow`;
295
235
  readonly $typeArgs: [];
296
- readonly $isPhantom: readonly [];
236
+ readonly $isPhantom: typeof Borrow.$isPhantom;
297
237
  readonly coinType: ToField<TypeName>;
298
- readonly reserveArrayIndex: ToField<"u64">;
299
- readonly depositedCtokenAmount: ToField<"u64">;
238
+ readonly reserveArrayIndex: ToField<'u64'>;
239
+ readonly borrowedAmount: ToField<Decimal>;
240
+ readonly cumulativeBorrowRate: ToField<Decimal>;
300
241
  readonly marketValue: ToField<Decimal>;
301
- readonly userRewardManagerIndex: ToField<"u64">;
302
- readonly attributedBorrowValue: ToField<Decimal>;
242
+ readonly userRewardManagerIndex: ToField<'u64'>;
303
243
  private constructor();
304
- static reified(): DepositRecordReified;
305
- static get r(): reified.StructClassReified<DepositRecord, DepositRecordFields>;
306
- static phantom(): PhantomReified<ToTypeStr<DepositRecord>>;
307
- static get p(): reified.PhantomReified<"0x1f54a9a2d71799553197e9ea24557797c6398d6a65f2d4d3818c9304b75d5e21::obligation::DepositRecord" | "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::obligation::DepositRecord">;
308
- static get bcs(): import("@mysten/bcs").BcsStruct<{
309
- coin_type: import("@mysten/bcs").BcsStruct<{
310
- name: import("@mysten/bcs").BcsStruct<{
311
- bytes: import("@mysten/bcs").BcsType<number[], Iterable<number> & {
312
- length: number;
313
- }, string>;
314
- }, string>;
315
- }, string>;
316
- reserve_array_index: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
317
- deposited_ctoken_amount: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
318
- market_value: import("@mysten/bcs").BcsStruct<{
319
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
320
- }, string>;
321
- user_reward_manager_index: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
322
- attributed_borrow_value: import("@mysten/bcs").BcsStruct<{
323
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
324
- }, string>;
325
- }, string>;
326
- static fromFields(fields: Record<string, any>): DepositRecord;
327
- static fromFieldsWithTypes(item: FieldsWithTypes): DepositRecord;
328
- static fromBcs(data: Uint8Array): DepositRecord;
329
- toJSONField(): {
330
- coinType: {
331
- name: string;
332
- };
333
- reserveArrayIndex: string;
334
- depositedCtokenAmount: string;
335
- marketValue: {
336
- value: string;
337
- };
338
- userRewardManagerIndex: string;
339
- attributedBorrowValue: {
340
- value: string;
341
- };
342
- };
343
- toJSON(): {
344
- coinType: {
345
- name: string;
346
- };
347
- reserveArrayIndex: string;
348
- depositedCtokenAmount: string;
349
- marketValue: {
350
- value: string;
351
- };
352
- userRewardManagerIndex: string;
353
- attributedBorrowValue: {
354
- value: string;
355
- };
356
- $typeName: string;
357
- $typeArgs: [];
358
- };
359
- static fromJSONField(field: any): DepositRecord;
360
- static fromJSON(json: Record<string, any>): DepositRecord;
361
- static fetch(client: SuiGrpcClient, id: string): Promise<DepositRecord>;
244
+ static reified(): BorrowReified;
245
+ static get r(): BorrowReified;
246
+ static phantom(): PhantomReified<ToTypeStr<Borrow>>;
247
+ static get p(): PhantomReified<ToTypeStr<Borrow>>;
248
+ private static instantiateBcs;
249
+ private static cachedBcs;
250
+ static get bcs(): ReturnType<typeof Borrow.instantiateBcs>;
251
+ static fromFields(fields: Record<string, any>): Borrow;
252
+ static fromFieldsWithTypes(item: FieldsWithTypes): Borrow;
253
+ static fromBcs(data: Uint8Array): Borrow;
254
+ toJSONField(): BorrowJSONField;
255
+ toJSON(): BorrowJSON;
256
+ static fromJSONField(field: any): Borrow;
257
+ static fromJSON(json: Record<string, any>): Borrow;
258
+ static fromCoreObject(obj: SuiClientTypes.Object<{
259
+ content: true;
260
+ }>): Borrow;
261
+ static fetch(client: ClientWithCoreApi, id: string): Promise<Borrow>;
362
262
  }
363
263
  export declare function isExistStaleOracles(type: string): boolean;
364
264
  export interface ExistStaleOraclesFields {
365
- dummyField: ToField<"bool">;
265
+ dummyField: ToField<'bool'>;
366
266
  }
367
267
  export type ExistStaleOraclesReified = Reified<ExistStaleOracles, ExistStaleOraclesFields>;
268
+ export type ExistStaleOraclesJSONField = {
269
+ dummyField: boolean;
270
+ };
271
+ export type ExistStaleOraclesJSON = {
272
+ $typeName: typeof ExistStaleOracles.$typeName;
273
+ $typeArgs: [];
274
+ } & ExistStaleOraclesJSONField;
368
275
  export declare class ExistStaleOracles implements StructClass {
369
276
  __StructClass: true;
370
- static readonly $typeName: string;
277
+ static get $typeName(): `${string}::obligation::ExistStaleOracles`;
371
278
  static readonly $numTypeParams = 0;
372
279
  static readonly $isPhantom: readonly [];
373
- readonly $typeName: string;
374
- readonly $fullTypeName: `${typeof PKG_V11}::obligation::ExistStaleOracles`;
280
+ readonly $typeName: typeof ExistStaleOracles.$typeName;
281
+ readonly $fullTypeName: `${string}::obligation::ExistStaleOracles`;
375
282
  readonly $typeArgs: [];
376
- readonly $isPhantom: readonly [];
377
- readonly dummyField: ToField<"bool">;
283
+ readonly $isPhantom: typeof ExistStaleOracles.$isPhantom;
284
+ readonly dummyField: ToField<'bool'>;
378
285
  private constructor();
379
286
  static reified(): ExistStaleOraclesReified;
380
- static get r(): reified.StructClassReified<ExistStaleOracles, ExistStaleOraclesFields>;
287
+ static get r(): ExistStaleOraclesReified;
381
288
  static phantom(): PhantomReified<ToTypeStr<ExistStaleOracles>>;
382
- static get p(): reified.PhantomReified<"0xe5ed361add4433f4d23e56fc0e3bacab39b93592d5e65d508e33fd19ff696669::obligation::ExistStaleOracles" | "0xd2a67633ccb8de063163e25bcfca242929caf5cf1a26c2929dab519ee0b8f331::obligation::ExistStaleOracles">;
383
- static get bcs(): import("@mysten/bcs").BcsStruct<{
384
- dummy_field: import("@mysten/bcs").BcsType<boolean, boolean, "bool">;
385
- }, string>;
289
+ static get p(): PhantomReified<ToTypeStr<ExistStaleOracles>>;
290
+ private static instantiateBcs;
291
+ private static cachedBcs;
292
+ static get bcs(): ReturnType<typeof ExistStaleOracles.instantiateBcs>;
386
293
  static fromFields(fields: Record<string, any>): ExistStaleOracles;
387
294
  static fromFieldsWithTypes(item: FieldsWithTypes): ExistStaleOracles;
388
295
  static fromBcs(data: Uint8Array): ExistStaleOracles;
389
- toJSONField(): {
390
- dummyField: boolean;
391
- };
392
- toJSON(): {
393
- dummyField: boolean;
394
- $typeName: string;
395
- $typeArgs: [];
396
- };
296
+ toJSONField(): ExistStaleOraclesJSONField;
297
+ toJSON(): ExistStaleOraclesJSON;
397
298
  static fromJSONField(field: any): ExistStaleOracles;
398
299
  static fromJSON(json: Record<string, any>): ExistStaleOracles;
399
- static fetch(client: SuiGrpcClient, id: string): Promise<ExistStaleOracles>;
400
- }
401
- export declare function isObligation(type: string): boolean;
402
- export interface ObligationFields<P extends PhantomTypeArgument> {
403
- id: ToField<UID>;
404
- lendingMarketId: ToField<ID>;
405
- deposits: ToField<Vector<Deposit>>;
406
- borrows: ToField<Vector<Borrow>>;
407
- depositedValueUsd: ToField<Decimal>;
408
- allowedBorrowValueUsd: ToField<Decimal>;
409
- unhealthyBorrowValueUsd: ToField<Decimal>;
410
- superUnhealthyBorrowValueUsd: ToField<Decimal>;
411
- unweightedBorrowedValueUsd: ToField<Decimal>;
412
- weightedBorrowedValueUsd: ToField<Decimal>;
413
- weightedBorrowedValueUpperBoundUsd: ToField<Decimal>;
414
- borrowingIsolatedAsset: ToField<"bool">;
415
- userRewardManagers: ToField<Vector<UserRewardManager>>;
416
- badDebtUsd: ToField<Decimal>;
417
- closable: ToField<"bool">;
418
- }
419
- export type ObligationReified<P extends PhantomTypeArgument> = Reified<Obligation<P>, ObligationFields<P>>;
420
- export declare class Obligation<P extends PhantomTypeArgument> implements StructClass {
421
- __StructClass: true;
422
- static readonly $typeName: string;
423
- static readonly $numTypeParams = 1;
424
- static readonly $isPhantom: readonly [true];
425
- readonly $typeName: string;
426
- readonly $fullTypeName: `${typeof PKG_V1}::obligation::Obligation<${PhantomToTypeStr<P>}>`;
427
- readonly $typeArgs: [PhantomToTypeStr<P>];
428
- readonly $isPhantom: readonly [true];
429
- readonly id: ToField<UID>;
430
- readonly lendingMarketId: ToField<ID>;
431
- readonly deposits: ToField<Vector<Deposit>>;
432
- readonly borrows: ToField<Vector<Borrow>>;
433
- readonly depositedValueUsd: ToField<Decimal>;
434
- readonly allowedBorrowValueUsd: ToField<Decimal>;
435
- readonly unhealthyBorrowValueUsd: ToField<Decimal>;
436
- readonly superUnhealthyBorrowValueUsd: ToField<Decimal>;
437
- readonly unweightedBorrowedValueUsd: ToField<Decimal>;
438
- readonly weightedBorrowedValueUsd: ToField<Decimal>;
439
- readonly weightedBorrowedValueUpperBoundUsd: ToField<Decimal>;
440
- readonly borrowingIsolatedAsset: ToField<"bool">;
441
- readonly userRewardManagers: ToField<Vector<UserRewardManager>>;
442
- readonly badDebtUsd: ToField<Decimal>;
443
- readonly closable: ToField<"bool">;
444
- private constructor();
445
- static reified<P extends PhantomReified<PhantomTypeArgument>>(P: P): ObligationReified<ToPhantomTypeArgument<P>>;
446
- static get r(): typeof Obligation.reified;
447
- static phantom<P extends PhantomReified<PhantomTypeArgument>>(P: P): PhantomReified<ToTypeStr<Obligation<ToPhantomTypeArgument<P>>>>;
448
- static get p(): typeof Obligation.phantom;
449
- static get bcs(): import("@mysten/bcs").BcsStruct<{
450
- id: import("@mysten/bcs").BcsStruct<{
451
- id: import("@mysten/bcs").BcsStruct<{
452
- bytes: import("@mysten/bcs").BcsType<string, string, string>;
453
- }, string>;
454
- }, string>;
455
- lending_market_id: import("@mysten/bcs").BcsStruct<{
456
- bytes: import("@mysten/bcs").BcsType<string, string, string>;
457
- }, string>;
458
- deposits: import("@mysten/bcs").BcsType<{
459
- coin_type: {
460
- name: {
461
- bytes: number[];
462
- };
463
- };
464
- reserve_array_index: string;
465
- deposited_ctoken_amount: string;
466
- market_value: {
467
- value: string;
468
- };
469
- user_reward_manager_index: string;
470
- attributed_borrow_value: {
471
- value: string;
472
- };
473
- }[], Iterable<{
474
- coin_type: {
475
- name: {
476
- bytes: Iterable<number> & {
477
- length: number;
478
- };
479
- };
480
- };
481
- reserve_array_index: string | number | bigint;
482
- deposited_ctoken_amount: string | number | bigint;
483
- market_value: {
484
- value: string | number | bigint;
485
- };
486
- user_reward_manager_index: string | number | bigint;
487
- attributed_borrow_value: {
488
- value: string | number | bigint;
489
- };
490
- }> & {
491
- length: number;
492
- }, string>;
493
- borrows: import("@mysten/bcs").BcsType<{
494
- coin_type: {
495
- name: {
496
- bytes: number[];
497
- };
498
- };
499
- reserve_array_index: string;
500
- borrowed_amount: {
501
- value: string;
502
- };
503
- cumulative_borrow_rate: {
504
- value: string;
505
- };
506
- market_value: {
507
- value: string;
508
- };
509
- user_reward_manager_index: string;
510
- }[], Iterable<{
511
- coin_type: {
512
- name: {
513
- bytes: Iterable<number> & {
514
- length: number;
515
- };
516
- };
517
- };
518
- reserve_array_index: string | number | bigint;
519
- borrowed_amount: {
520
- value: string | number | bigint;
521
- };
522
- cumulative_borrow_rate: {
523
- value: string | number | bigint;
524
- };
525
- market_value: {
526
- value: string | number | bigint;
527
- };
528
- user_reward_manager_index: string | number | bigint;
529
- }> & {
530
- length: number;
531
- }, string>;
532
- deposited_value_usd: import("@mysten/bcs").BcsStruct<{
533
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
534
- }, string>;
535
- allowed_borrow_value_usd: import("@mysten/bcs").BcsStruct<{
536
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
537
- }, string>;
538
- unhealthy_borrow_value_usd: import("@mysten/bcs").BcsStruct<{
539
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
540
- }, string>;
541
- super_unhealthy_borrow_value_usd: import("@mysten/bcs").BcsStruct<{
542
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
543
- }, string>;
544
- unweighted_borrowed_value_usd: import("@mysten/bcs").BcsStruct<{
545
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
546
- }, string>;
547
- weighted_borrowed_value_usd: import("@mysten/bcs").BcsStruct<{
548
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
549
- }, string>;
550
- weighted_borrowed_value_upper_bound_usd: import("@mysten/bcs").BcsStruct<{
551
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
552
- }, string>;
553
- borrowing_isolated_asset: import("@mysten/bcs").BcsType<boolean, boolean, "bool">;
554
- user_reward_managers: import("@mysten/bcs").BcsType<{
555
- pool_reward_manager_id: {
556
- bytes: string;
557
- };
558
- share: string;
559
- rewards: any[];
560
- last_update_time_ms: string;
561
- }[], Iterable<{
562
- pool_reward_manager_id: {
563
- bytes: string;
564
- };
565
- share: string | number | bigint;
566
- rewards: Iterable<any> & {
567
- length: number;
568
- };
569
- last_update_time_ms: string | number | bigint;
570
- }> & {
571
- length: number;
572
- }, string>;
573
- bad_debt_usd: import("@mysten/bcs").BcsStruct<{
574
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
575
- }, string>;
576
- closable: import("@mysten/bcs").BcsType<boolean, boolean, "bool">;
577
- }, string>;
578
- static fromFields<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, fields: Record<string, any>): Obligation<ToPhantomTypeArgument<P>>;
579
- static fromFieldsWithTypes<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, item: FieldsWithTypes): Obligation<ToPhantomTypeArgument<P>>;
580
- static fromBcs<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, data: Uint8Array): Obligation<ToPhantomTypeArgument<P>>;
581
- toJSONField(): {
582
- id: string;
583
- lendingMarketId: string;
584
- deposits: {
585
- coinType: {
586
- name: string;
587
- };
588
- reserveArrayIndex: string;
589
- depositedCtokenAmount: string;
590
- marketValue: {
591
- value: string;
592
- };
593
- userRewardManagerIndex: string;
594
- attributedBorrowValue: {
595
- value: string;
596
- };
597
- }[];
598
- borrows: {
599
- coinType: {
600
- name: string;
601
- };
602
- reserveArrayIndex: string;
603
- borrowedAmount: {
604
- value: string;
605
- };
606
- cumulativeBorrowRate: {
607
- value: string;
608
- };
609
- marketValue: {
610
- value: string;
611
- };
612
- userRewardManagerIndex: string;
613
- }[];
614
- depositedValueUsd: {
615
- value: string;
616
- };
617
- allowedBorrowValueUsd: {
618
- value: string;
619
- };
620
- unhealthyBorrowValueUsd: {
621
- value: string;
622
- };
623
- superUnhealthyBorrowValueUsd: {
624
- value: string;
625
- };
626
- unweightedBorrowedValueUsd: {
627
- value: string;
628
- };
629
- weightedBorrowedValueUsd: {
630
- value: string;
631
- };
632
- weightedBorrowedValueUpperBoundUsd: {
633
- value: string;
634
- };
635
- borrowingIsolatedAsset: boolean;
636
- userRewardManagers: {
637
- poolRewardManagerId: string;
638
- share: string;
639
- rewards: ({
640
- poolRewardId: string;
641
- earnedRewards: {
642
- value: string;
643
- };
644
- cumulativeRewardsPerShare: {
645
- value: string;
646
- };
647
- } | null)[];
648
- lastUpdateTimeMs: string;
649
- }[];
650
- badDebtUsd: {
651
- value: string;
652
- };
653
- closable: boolean;
654
- };
655
- toJSON(): {
656
- id: string;
657
- lendingMarketId: string;
658
- deposits: {
659
- coinType: {
660
- name: string;
661
- };
662
- reserveArrayIndex: string;
663
- depositedCtokenAmount: string;
664
- marketValue: {
665
- value: string;
666
- };
667
- userRewardManagerIndex: string;
668
- attributedBorrowValue: {
669
- value: string;
670
- };
671
- }[];
672
- borrows: {
673
- coinType: {
674
- name: string;
675
- };
676
- reserveArrayIndex: string;
677
- borrowedAmount: {
678
- value: string;
679
- };
680
- cumulativeBorrowRate: {
681
- value: string;
682
- };
683
- marketValue: {
684
- value: string;
685
- };
686
- userRewardManagerIndex: string;
687
- }[];
688
- depositedValueUsd: {
689
- value: string;
690
- };
691
- allowedBorrowValueUsd: {
692
- value: string;
693
- };
694
- unhealthyBorrowValueUsd: {
695
- value: string;
696
- };
697
- superUnhealthyBorrowValueUsd: {
698
- value: string;
699
- };
700
- unweightedBorrowedValueUsd: {
701
- value: string;
702
- };
703
- weightedBorrowedValueUsd: {
704
- value: string;
705
- };
706
- weightedBorrowedValueUpperBoundUsd: {
707
- value: string;
708
- };
709
- borrowingIsolatedAsset: boolean;
710
- userRewardManagers: {
711
- poolRewardManagerId: string;
712
- share: string;
713
- rewards: ({
714
- poolRewardId: string;
715
- earnedRewards: {
716
- value: string;
717
- };
718
- cumulativeRewardsPerShare: {
719
- value: string;
720
- };
721
- } | null)[];
722
- lastUpdateTimeMs: string;
723
- }[];
724
- badDebtUsd: {
725
- value: string;
726
- };
727
- closable: boolean;
728
- $typeName: string;
729
- $typeArgs: [reified.PhantomToTypeStr<P>];
730
- };
731
- static fromJSONField<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, field: any): Obligation<ToPhantomTypeArgument<P>>;
732
- static fromJSON<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, json: Record<string, any>): Obligation<ToPhantomTypeArgument<P>>;
733
- static fetch<P extends PhantomReified<PhantomTypeArgument>>(client: SuiGrpcClient, typeArg: P, id: string): Promise<Obligation<ToPhantomTypeArgument<P>>>;
300
+ static fromCoreObject(obj: SuiClientTypes.Object<{
301
+ content: true;
302
+ }>): ExistStaleOracles;
303
+ static fetch(client: ClientWithCoreApi, id: string): Promise<ExistStaleOracles>;
734
304
  }
735
305
  export declare function isObligationDataEvent(type: string): boolean;
736
306
  export interface ObligationDataEventFields {
737
- lendingMarketId: ToField<"address">;
738
- obligationId: ToField<"address">;
307
+ lendingMarketId: ToField<'address'>;
308
+ obligationId: ToField<'address'>;
739
309
  deposits: ToField<Vector<DepositRecord>>;
740
310
  borrows: ToField<Vector<BorrowRecord>>;
741
311
  depositedValueUsd: ToField<Decimal>;
@@ -745,22 +315,42 @@ export interface ObligationDataEventFields {
745
315
  unweightedBorrowedValueUsd: ToField<Decimal>;
746
316
  weightedBorrowedValueUsd: ToField<Decimal>;
747
317
  weightedBorrowedValueUpperBoundUsd: ToField<Decimal>;
748
- borrowingIsolatedAsset: ToField<"bool">;
318
+ borrowingIsolatedAsset: ToField<'bool'>;
749
319
  badDebtUsd: ToField<Decimal>;
750
- closable: ToField<"bool">;
320
+ closable: ToField<'bool'>;
751
321
  }
752
322
  export type ObligationDataEventReified = Reified<ObligationDataEvent, ObligationDataEventFields>;
323
+ export type ObligationDataEventJSONField = {
324
+ lendingMarketId: string;
325
+ obligationId: string;
326
+ deposits: ToJSON<DepositRecord>[];
327
+ borrows: ToJSON<BorrowRecord>[];
328
+ depositedValueUsd: ToJSON<Decimal>;
329
+ allowedBorrowValueUsd: ToJSON<Decimal>;
330
+ unhealthyBorrowValueUsd: ToJSON<Decimal>;
331
+ superUnhealthyBorrowValueUsd: ToJSON<Decimal>;
332
+ unweightedBorrowedValueUsd: ToJSON<Decimal>;
333
+ weightedBorrowedValueUsd: ToJSON<Decimal>;
334
+ weightedBorrowedValueUpperBoundUsd: ToJSON<Decimal>;
335
+ borrowingIsolatedAsset: boolean;
336
+ badDebtUsd: ToJSON<Decimal>;
337
+ closable: boolean;
338
+ };
339
+ export type ObligationDataEventJSON = {
340
+ $typeName: typeof ObligationDataEvent.$typeName;
341
+ $typeArgs: [];
342
+ } & ObligationDataEventJSONField;
753
343
  export declare class ObligationDataEvent implements StructClass {
754
344
  __StructClass: true;
755
- static readonly $typeName: string;
345
+ static get $typeName(): `${string}::obligation::ObligationDataEvent`;
756
346
  static readonly $numTypeParams = 0;
757
347
  static readonly $isPhantom: readonly [];
758
- readonly $typeName: string;
759
- readonly $fullTypeName: `${typeof PKG_V1}::obligation::ObligationDataEvent`;
348
+ readonly $typeName: typeof ObligationDataEvent.$typeName;
349
+ readonly $fullTypeName: `${string}::obligation::ObligationDataEvent`;
760
350
  readonly $typeArgs: [];
761
- readonly $isPhantom: readonly [];
762
- readonly lendingMarketId: ToField<"address">;
763
- readonly obligationId: ToField<"address">;
351
+ readonly $isPhantom: typeof ObligationDataEvent.$isPhantom;
352
+ readonly lendingMarketId: ToField<'address'>;
353
+ readonly obligationId: ToField<'address'>;
764
354
  readonly deposits: ToField<Vector<DepositRecord>>;
765
355
  readonly borrows: ToField<Vector<BorrowRecord>>;
766
356
  readonly depositedValueUsd: ToField<Decimal>;
@@ -770,244 +360,142 @@ export declare class ObligationDataEvent implements StructClass {
770
360
  readonly unweightedBorrowedValueUsd: ToField<Decimal>;
771
361
  readonly weightedBorrowedValueUsd: ToField<Decimal>;
772
362
  readonly weightedBorrowedValueUpperBoundUsd: ToField<Decimal>;
773
- readonly borrowingIsolatedAsset: ToField<"bool">;
363
+ readonly borrowingIsolatedAsset: ToField<'bool'>;
774
364
  readonly badDebtUsd: ToField<Decimal>;
775
- readonly closable: ToField<"bool">;
365
+ readonly closable: ToField<'bool'>;
776
366
  private constructor();
777
367
  static reified(): ObligationDataEventReified;
778
- static get r(): reified.StructClassReified<ObligationDataEvent, ObligationDataEventFields>;
368
+ static get r(): ObligationDataEventReified;
779
369
  static phantom(): PhantomReified<ToTypeStr<ObligationDataEvent>>;
780
- static get p(): reified.PhantomReified<"0x1f54a9a2d71799553197e9ea24557797c6398d6a65f2d4d3818c9304b75d5e21::obligation::ObligationDataEvent" | "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::obligation::ObligationDataEvent">;
781
- static get bcs(): import("@mysten/bcs").BcsStruct<{
782
- lending_market_id: import("@mysten/bcs").BcsType<string, string, string>;
783
- obligation_id: import("@mysten/bcs").BcsType<string, string, string>;
784
- deposits: import("@mysten/bcs").BcsType<{
785
- coin_type: {
786
- name: {
787
- bytes: number[];
788
- };
789
- };
790
- reserve_array_index: string;
791
- deposited_ctoken_amount: string;
792
- market_value: {
793
- value: string;
794
- };
795
- user_reward_manager_index: string;
796
- attributed_borrow_value: {
797
- value: string;
798
- };
799
- }[], Iterable<{
800
- coin_type: {
801
- name: {
802
- bytes: Iterable<number> & {
803
- length: number;
804
- };
805
- };
806
- };
807
- reserve_array_index: string | number | bigint;
808
- deposited_ctoken_amount: string | number | bigint;
809
- market_value: {
810
- value: string | number | bigint;
811
- };
812
- user_reward_manager_index: string | number | bigint;
813
- attributed_borrow_value: {
814
- value: string | number | bigint;
815
- };
816
- }> & {
817
- length: number;
818
- }, string>;
819
- borrows: import("@mysten/bcs").BcsType<{
820
- coin_type: {
821
- name: {
822
- bytes: number[];
823
- };
824
- };
825
- reserve_array_index: string;
826
- borrowed_amount: {
827
- value: string;
828
- };
829
- cumulative_borrow_rate: {
830
- value: string;
831
- };
832
- market_value: {
833
- value: string;
834
- };
835
- user_reward_manager_index: string;
836
- }[], Iterable<{
837
- coin_type: {
838
- name: {
839
- bytes: Iterable<number> & {
840
- length: number;
841
- };
842
- };
843
- };
844
- reserve_array_index: string | number | bigint;
845
- borrowed_amount: {
846
- value: string | number | bigint;
847
- };
848
- cumulative_borrow_rate: {
849
- value: string | number | bigint;
850
- };
851
- market_value: {
852
- value: string | number | bigint;
853
- };
854
- user_reward_manager_index: string | number | bigint;
855
- }> & {
856
- length: number;
857
- }, string>;
858
- deposited_value_usd: import("@mysten/bcs").BcsStruct<{
859
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
860
- }, string>;
861
- allowed_borrow_value_usd: import("@mysten/bcs").BcsStruct<{
862
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
863
- }, string>;
864
- unhealthy_borrow_value_usd: import("@mysten/bcs").BcsStruct<{
865
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
866
- }, string>;
867
- super_unhealthy_borrow_value_usd: import("@mysten/bcs").BcsStruct<{
868
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
869
- }, string>;
870
- unweighted_borrowed_value_usd: import("@mysten/bcs").BcsStruct<{
871
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
872
- }, string>;
873
- weighted_borrowed_value_usd: import("@mysten/bcs").BcsStruct<{
874
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
875
- }, string>;
876
- weighted_borrowed_value_upper_bound_usd: import("@mysten/bcs").BcsStruct<{
877
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
878
- }, string>;
879
- borrowing_isolated_asset: import("@mysten/bcs").BcsType<boolean, boolean, "bool">;
880
- bad_debt_usd: import("@mysten/bcs").BcsStruct<{
881
- value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u256">;
882
- }, string>;
883
- closable: import("@mysten/bcs").BcsType<boolean, boolean, "bool">;
884
- }, string>;
370
+ static get p(): PhantomReified<ToTypeStr<ObligationDataEvent>>;
371
+ private static instantiateBcs;
372
+ private static cachedBcs;
373
+ static get bcs(): ReturnType<typeof ObligationDataEvent.instantiateBcs>;
885
374
  static fromFields(fields: Record<string, any>): ObligationDataEvent;
886
375
  static fromFieldsWithTypes(item: FieldsWithTypes): ObligationDataEvent;
887
376
  static fromBcs(data: Uint8Array): ObligationDataEvent;
888
- toJSONField(): {
889
- lendingMarketId: string;
890
- obligationId: string;
891
- deposits: {
892
- coinType: {
893
- name: string;
894
- };
895
- reserveArrayIndex: string;
896
- depositedCtokenAmount: string;
897
- marketValue: {
898
- value: string;
899
- };
900
- userRewardManagerIndex: string;
901
- attributedBorrowValue: {
902
- value: string;
903
- };
904
- }[];
905
- borrows: {
906
- coinType: {
907
- name: string;
908
- };
909
- reserveArrayIndex: string;
910
- borrowedAmount: {
911
- value: string;
912
- };
913
- cumulativeBorrowRate: {
914
- value: string;
915
- };
916
- marketValue: {
917
- value: string;
918
- };
919
- userRewardManagerIndex: string;
920
- }[];
921
- depositedValueUsd: {
922
- value: string;
923
- };
924
- allowedBorrowValueUsd: {
925
- value: string;
926
- };
927
- unhealthyBorrowValueUsd: {
928
- value: string;
929
- };
930
- superUnhealthyBorrowValueUsd: {
931
- value: string;
932
- };
933
- unweightedBorrowedValueUsd: {
934
- value: string;
935
- };
936
- weightedBorrowedValueUsd: {
937
- value: string;
938
- };
939
- weightedBorrowedValueUpperBoundUsd: {
940
- value: string;
941
- };
942
- borrowingIsolatedAsset: boolean;
943
- badDebtUsd: {
944
- value: string;
945
- };
946
- closable: boolean;
947
- };
948
- toJSON(): {
949
- lendingMarketId: string;
950
- obligationId: string;
951
- deposits: {
952
- coinType: {
953
- name: string;
954
- };
955
- reserveArrayIndex: string;
956
- depositedCtokenAmount: string;
957
- marketValue: {
958
- value: string;
959
- };
960
- userRewardManagerIndex: string;
961
- attributedBorrowValue: {
962
- value: string;
963
- };
964
- }[];
965
- borrows: {
966
- coinType: {
967
- name: string;
968
- };
969
- reserveArrayIndex: string;
970
- borrowedAmount: {
971
- value: string;
972
- };
973
- cumulativeBorrowRate: {
974
- value: string;
975
- };
976
- marketValue: {
977
- value: string;
978
- };
979
- userRewardManagerIndex: string;
980
- }[];
981
- depositedValueUsd: {
982
- value: string;
983
- };
984
- allowedBorrowValueUsd: {
985
- value: string;
986
- };
987
- unhealthyBorrowValueUsd: {
988
- value: string;
989
- };
990
- superUnhealthyBorrowValueUsd: {
991
- value: string;
992
- };
993
- unweightedBorrowedValueUsd: {
994
- value: string;
995
- };
996
- weightedBorrowedValueUsd: {
997
- value: string;
998
- };
999
- weightedBorrowedValueUpperBoundUsd: {
1000
- value: string;
1001
- };
1002
- borrowingIsolatedAsset: boolean;
1003
- badDebtUsd: {
1004
- value: string;
1005
- };
1006
- closable: boolean;
1007
- $typeName: string;
1008
- $typeArgs: [];
1009
- };
377
+ toJSONField(): ObligationDataEventJSONField;
378
+ toJSON(): ObligationDataEventJSON;
1010
379
  static fromJSONField(field: any): ObligationDataEvent;
1011
380
  static fromJSON(json: Record<string, any>): ObligationDataEvent;
1012
- static fetch(client: SuiGrpcClient, id: string): Promise<ObligationDataEvent>;
381
+ static fromCoreObject(obj: SuiClientTypes.Object<{
382
+ content: true;
383
+ }>): ObligationDataEvent;
384
+ static fetch(client: ClientWithCoreApi, id: string): Promise<ObligationDataEvent>;
385
+ }
386
+ export declare function isDepositRecord(type: string): boolean;
387
+ export interface DepositRecordFields {
388
+ coinType: ToField<TypeName>;
389
+ reserveArrayIndex: ToField<'u64'>;
390
+ depositedCtokenAmount: ToField<'u64'>;
391
+ marketValue: ToField<Decimal>;
392
+ userRewardManagerIndex: ToField<'u64'>;
393
+ /** unused */
394
+ attributedBorrowValue: ToField<Decimal>;
395
+ }
396
+ export type DepositRecordReified = Reified<DepositRecord, DepositRecordFields>;
397
+ export type DepositRecordJSONField = {
398
+ coinType: string;
399
+ reserveArrayIndex: string;
400
+ depositedCtokenAmount: string;
401
+ marketValue: ToJSON<Decimal>;
402
+ userRewardManagerIndex: string;
403
+ attributedBorrowValue: ToJSON<Decimal>;
404
+ };
405
+ export type DepositRecordJSON = {
406
+ $typeName: typeof DepositRecord.$typeName;
407
+ $typeArgs: [];
408
+ } & DepositRecordJSONField;
409
+ export declare class DepositRecord implements StructClass {
410
+ __StructClass: true;
411
+ static get $typeName(): `${string}::obligation::DepositRecord`;
412
+ static readonly $numTypeParams = 0;
413
+ static readonly $isPhantom: readonly [];
414
+ readonly $typeName: typeof DepositRecord.$typeName;
415
+ readonly $fullTypeName: `${string}::obligation::DepositRecord`;
416
+ readonly $typeArgs: [];
417
+ readonly $isPhantom: typeof DepositRecord.$isPhantom;
418
+ readonly coinType: ToField<TypeName>;
419
+ readonly reserveArrayIndex: ToField<'u64'>;
420
+ readonly depositedCtokenAmount: ToField<'u64'>;
421
+ readonly marketValue: ToField<Decimal>;
422
+ readonly userRewardManagerIndex: ToField<'u64'>;
423
+ /** unused */
424
+ readonly attributedBorrowValue: ToField<Decimal>;
425
+ private constructor();
426
+ static reified(): DepositRecordReified;
427
+ static get r(): DepositRecordReified;
428
+ static phantom(): PhantomReified<ToTypeStr<DepositRecord>>;
429
+ static get p(): PhantomReified<ToTypeStr<DepositRecord>>;
430
+ private static instantiateBcs;
431
+ private static cachedBcs;
432
+ static get bcs(): ReturnType<typeof DepositRecord.instantiateBcs>;
433
+ static fromFields(fields: Record<string, any>): DepositRecord;
434
+ static fromFieldsWithTypes(item: FieldsWithTypes): DepositRecord;
435
+ static fromBcs(data: Uint8Array): DepositRecord;
436
+ toJSONField(): DepositRecordJSONField;
437
+ toJSON(): DepositRecordJSON;
438
+ static fromJSONField(field: any): DepositRecord;
439
+ static fromJSON(json: Record<string, any>): DepositRecord;
440
+ static fromCoreObject(obj: SuiClientTypes.Object<{
441
+ content: true;
442
+ }>): DepositRecord;
443
+ static fetch(client: ClientWithCoreApi, id: string): Promise<DepositRecord>;
444
+ }
445
+ export declare function isBorrowRecord(type: string): boolean;
446
+ export interface BorrowRecordFields {
447
+ coinType: ToField<TypeName>;
448
+ reserveArrayIndex: ToField<'u64'>;
449
+ borrowedAmount: ToField<Decimal>;
450
+ cumulativeBorrowRate: ToField<Decimal>;
451
+ marketValue: ToField<Decimal>;
452
+ userRewardManagerIndex: ToField<'u64'>;
453
+ }
454
+ export type BorrowRecordReified = Reified<BorrowRecord, BorrowRecordFields>;
455
+ export type BorrowRecordJSONField = {
456
+ coinType: string;
457
+ reserveArrayIndex: string;
458
+ borrowedAmount: ToJSON<Decimal>;
459
+ cumulativeBorrowRate: ToJSON<Decimal>;
460
+ marketValue: ToJSON<Decimal>;
461
+ userRewardManagerIndex: string;
462
+ };
463
+ export type BorrowRecordJSON = {
464
+ $typeName: typeof BorrowRecord.$typeName;
465
+ $typeArgs: [];
466
+ } & BorrowRecordJSONField;
467
+ export declare class BorrowRecord implements StructClass {
468
+ __StructClass: true;
469
+ static get $typeName(): `${string}::obligation::BorrowRecord`;
470
+ static readonly $numTypeParams = 0;
471
+ static readonly $isPhantom: readonly [];
472
+ readonly $typeName: typeof BorrowRecord.$typeName;
473
+ readonly $fullTypeName: `${string}::obligation::BorrowRecord`;
474
+ readonly $typeArgs: [];
475
+ readonly $isPhantom: typeof BorrowRecord.$isPhantom;
476
+ readonly coinType: ToField<TypeName>;
477
+ readonly reserveArrayIndex: ToField<'u64'>;
478
+ readonly borrowedAmount: ToField<Decimal>;
479
+ readonly cumulativeBorrowRate: ToField<Decimal>;
480
+ readonly marketValue: ToField<Decimal>;
481
+ readonly userRewardManagerIndex: ToField<'u64'>;
482
+ private constructor();
483
+ static reified(): BorrowRecordReified;
484
+ static get r(): BorrowRecordReified;
485
+ static phantom(): PhantomReified<ToTypeStr<BorrowRecord>>;
486
+ static get p(): PhantomReified<ToTypeStr<BorrowRecord>>;
487
+ private static instantiateBcs;
488
+ private static cachedBcs;
489
+ static get bcs(): ReturnType<typeof BorrowRecord.instantiateBcs>;
490
+ static fromFields(fields: Record<string, any>): BorrowRecord;
491
+ static fromFieldsWithTypes(item: FieldsWithTypes): BorrowRecord;
492
+ static fromBcs(data: Uint8Array): BorrowRecord;
493
+ toJSONField(): BorrowRecordJSONField;
494
+ toJSON(): BorrowRecordJSON;
495
+ static fromJSONField(field: any): BorrowRecord;
496
+ static fromJSON(json: Record<string, any>): BorrowRecord;
497
+ static fromCoreObject(obj: SuiClientTypes.Object<{
498
+ content: true;
499
+ }>): BorrowRecord;
500
+ static fetch(client: ClientWithCoreApi, id: string): Promise<BorrowRecord>;
1013
501
  }