@suilend/sdk 3.0.3 → 3.0.5
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.js +4 -4
- package/_generated/_dependencies/source/0x1/option/structs.js +4 -4
- package/_generated/_dependencies/source/0x1/type-name/structs.js +4 -4
- package/_generated/_dependencies/source/0x2/bag/structs.js +4 -4
- package/_generated/_dependencies/source/0x2/balance/structs.js +3 -3
- package/_generated/_dependencies/source/0x2/object/structs.js +3 -3
- package/_generated/_dependencies/source/0x2/object-table/structs.js +4 -4
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.js +3 -3
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.js +4 -4
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.js +5 -5
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.js +4 -4
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.js +5 -5
- package/_generated/_framework/reified.js +2 -2
- package/_generated/_framework/vector.js +2 -2
- package/_generated/suilend/cell/structs.js +4 -4
- package/_generated/suilend/decimal/structs.js +3 -3
- package/_generated/suilend/lending-market/functions.js +4 -4
- package/_generated/suilend/lending-market/structs.js +11 -11
- package/_generated/suilend/lending-market-registry/functions.js +2 -2
- package/_generated/suilend/liquidity-mining/structs.js +9 -9
- package/_generated/suilend/obligation/structs.js +8 -8
- package/_generated/suilend/rate-limiter/functions.js +2 -2
- package/_generated/suilend/rate-limiter/structs.js +4 -4
- package/_generated/suilend/reserve/structs.js +12 -12
- package/_generated/suilend/reserve-config/functions.js +2 -2
- package/_generated/suilend/reserve-config/structs.js +5 -5
- package/api/index.js +1 -1
- package/client.js +32 -50
- package/index.js +7 -7
- package/lib/index.js +5 -5
- package/lib/initialize.js +8 -8
- package/lib/liquidityMining.js +3 -3
- package/lib/pythAdapter.d.ts +1 -2
- package/lib/pythAdapter.js +96 -17
- package/lib/strategyOwnerCap.js +2 -2
- package/margin/margin/admin_cap.d.ts +1 -4
- package/margin/margin/admin_cap.js +15 -9
- package/margin/margin/deps/std/type_name.d.ts +9 -10
- package/margin/margin/deps/std/type_name.js +17 -14
- package/margin/margin/deps/sui/vec_set.d.ts +3 -5
- package/margin/margin/deps/sui/vec_set.js +9 -6
- package/margin/margin/deps/suilend/lending_market.d.ts +1 -4
- package/margin/margin/deps/suilend/lending_market.js +9 -6
- package/margin/margin/market.d.ts +22 -67
- package/margin/margin/market.js +86 -108
- package/margin/margin/permissions.d.ts +9 -16
- package/margin/margin/permissions.js +29 -29
- package/margin/margin/position.d.ts +12 -35
- package/margin/margin/position.js +84 -67
- package/margin/margin/router.d.ts +10 -50
- package/margin/margin/router.js +102 -71
- package/margin/margin/version.d.ts +1 -4
- package/margin/margin/version.js +7 -4
- package/margin/utils/index.d.ts +9 -9
- package/margin/utils/index.js +32 -29
- package/package.json +1 -1
- package/parsers/apiReserveAssetDataEvent.js +1 -1
- package/parsers/index.js +5 -5
- package/parsers/lendingMarket.js +2 -2
- package/parsers/obligation.js +1 -1
- package/parsers/rateLimiter.js +1 -1
- package/parsers/reserve.js +3 -3
- package/strategies.js +101 -42
- package/swap/index.js +2 -2
- package/swap/transaction.js +5 -14
- package/utils/index.js +3 -3
- package/utils/obligation.js +39 -30
- package/utils/simulate.js +4 -4
package/margin/margin/market.js
CHANGED
|
@@ -1,220 +1,198 @@
|
|
|
1
1
|
/**************************************************************
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import * as
|
|
7
|
-
import * as vec_set from
|
|
8
|
-
import * as permissions_1 from
|
|
9
|
-
import * as
|
|
10
|
-
const $moduleName =
|
|
11
|
-
export const Market = new MoveStruct({
|
|
4
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
5
|
+
import { MoveStruct, normalizeMoveArguments, } from "../utils/index.js";
|
|
6
|
+
import * as type_name from "./deps/std/type_name.js";
|
|
7
|
+
import * as vec_set from "./deps/sui/vec_set.js";
|
|
8
|
+
import * as permissions_1 from "./permissions.js";
|
|
9
|
+
import * as version from "./version.js";
|
|
10
|
+
const $moduleName = "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53::market";
|
|
11
|
+
export const Market = new MoveStruct({
|
|
12
|
+
name: `${$moduleName}::Market<phantom BASE, phantom QUOTE>`,
|
|
13
|
+
fields: {
|
|
12
14
|
id: bcs.Address,
|
|
13
15
|
version: version.Version,
|
|
14
16
|
fee_recipient: bcs.Address,
|
|
15
17
|
open_fee_rate: bcs.u64(),
|
|
16
18
|
close_fee_rate: bcs.u64(),
|
|
17
|
-
permissions: vec_set.VecSet(permissions_1.Permission)
|
|
18
|
-
}
|
|
19
|
-
|
|
19
|
+
permissions: vec_set.VecSet(permissions_1.Permission),
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
export const CreateMarketEvent = new MoveStruct({
|
|
23
|
+
name: `${$moduleName}::CreateMarketEvent`,
|
|
24
|
+
fields: {
|
|
20
25
|
market_id: bcs.Address,
|
|
21
26
|
base_token: type_name.TypeName,
|
|
22
27
|
quote_token: type_name.TypeName,
|
|
23
28
|
open_fee_rate: bcs.u64(),
|
|
24
|
-
close_fee_rate: bcs.u64()
|
|
25
|
-
}
|
|
26
|
-
|
|
29
|
+
close_fee_rate: bcs.u64(),
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
export const MarketUpdatedEvent = new MoveStruct({
|
|
33
|
+
name: `${$moduleName}::MarketUpdatedEvent`,
|
|
34
|
+
fields: {
|
|
27
35
|
market_id: bcs.Address,
|
|
28
36
|
open_fee_rate: bcs.u64(),
|
|
29
|
-
close_fee_rate: bcs.u64()
|
|
30
|
-
}
|
|
31
|
-
|
|
37
|
+
close_fee_rate: bcs.u64(),
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
export const UpdateMarketPermissionEvent = new MoveStruct({
|
|
41
|
+
name: `${$moduleName}::UpdateMarketPermissionEvent`,
|
|
42
|
+
fields: {
|
|
32
43
|
market_id: bcs.Address,
|
|
33
44
|
permission: permissions_1.Permission,
|
|
34
45
|
is_pause: bcs.bool(),
|
|
35
|
-
sender: bcs.Address
|
|
36
|
-
}
|
|
46
|
+
sender: bcs.Address,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
37
49
|
export function checkVersion(options) {
|
|
38
50
|
var _a;
|
|
39
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
40
|
-
const argumentsTypes = [
|
|
41
|
-
null
|
|
42
|
-
];
|
|
51
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
52
|
+
const argumentsTypes = [null];
|
|
43
53
|
const parameterNames = ["market"];
|
|
44
54
|
return (tx) => tx.moveCall({
|
|
45
55
|
package: packageAddress,
|
|
46
|
-
module:
|
|
47
|
-
function:
|
|
56
|
+
module: "market",
|
|
57
|
+
function: "check_version",
|
|
48
58
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
49
|
-
typeArguments: options.typeArguments
|
|
59
|
+
typeArguments: options.typeArguments,
|
|
50
60
|
});
|
|
51
61
|
}
|
|
52
62
|
export function upgradeVersion(options) {
|
|
53
63
|
var _a;
|
|
54
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
55
|
-
const argumentsTypes = [
|
|
56
|
-
null,
|
|
57
|
-
null
|
|
58
|
-
];
|
|
64
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
65
|
+
const argumentsTypes = [null, null];
|
|
59
66
|
const parameterNames = ["_", "market"];
|
|
60
67
|
return (tx) => tx.moveCall({
|
|
61
68
|
package: packageAddress,
|
|
62
|
-
module:
|
|
63
|
-
function:
|
|
69
|
+
module: "market",
|
|
70
|
+
function: "upgrade_version",
|
|
64
71
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
65
|
-
typeArguments: options.typeArguments
|
|
72
|
+
typeArguments: options.typeArguments,
|
|
66
73
|
});
|
|
67
74
|
}
|
|
68
75
|
export function createMarket(options) {
|
|
69
76
|
var _a;
|
|
70
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
71
|
-
const argumentsTypes = [
|
|
72
|
-
null,
|
|
73
|
-
'address',
|
|
74
|
-
'u64',
|
|
75
|
-
'u64'
|
|
76
|
-
];
|
|
77
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
78
|
+
const argumentsTypes = [null, "address", "u64", "u64"];
|
|
77
79
|
const parameterNames = ["_", "feeRecipient", "openFeeRate", "closeFeeRate"];
|
|
78
80
|
return (tx) => tx.moveCall({
|
|
79
81
|
package: packageAddress,
|
|
80
|
-
module:
|
|
81
|
-
function:
|
|
82
|
+
module: "market",
|
|
83
|
+
function: "create_market",
|
|
82
84
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
83
|
-
typeArguments: options.typeArguments
|
|
85
|
+
typeArguments: options.typeArguments,
|
|
84
86
|
});
|
|
85
87
|
}
|
|
86
88
|
/** Update a market permission */
|
|
87
89
|
export function updateMarketPermission(options) {
|
|
88
90
|
var _a;
|
|
89
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
90
|
-
const argumentsTypes = [
|
|
91
|
-
null,
|
|
92
|
-
null,
|
|
93
|
-
null,
|
|
94
|
-
'bool'
|
|
95
|
-
];
|
|
91
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
92
|
+
const argumentsTypes = [null, null, null, "bool"];
|
|
96
93
|
const parameterNames = ["_", "market", "permission", "pause"];
|
|
97
94
|
return (tx) => tx.moveCall({
|
|
98
95
|
package: packageAddress,
|
|
99
|
-
module:
|
|
100
|
-
function:
|
|
96
|
+
module: "market",
|
|
97
|
+
function: "update_market_permission",
|
|
101
98
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
102
|
-
typeArguments: options.typeArguments
|
|
99
|
+
typeArguments: options.typeArguments,
|
|
103
100
|
});
|
|
104
101
|
}
|
|
105
102
|
/** Set fee rates */
|
|
106
103
|
export function setFeeRate(options) {
|
|
107
104
|
var _a;
|
|
108
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
109
|
-
const argumentsTypes = [
|
|
110
|
-
null,
|
|
111
|
-
null,
|
|
112
|
-
'u64',
|
|
113
|
-
'u64'
|
|
114
|
-
];
|
|
105
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
106
|
+
const argumentsTypes = [null, null, "u64", "u64"];
|
|
115
107
|
const parameterNames = ["_", "market", "openFee", "closeFee"];
|
|
116
108
|
return (tx) => tx.moveCall({
|
|
117
109
|
package: packageAddress,
|
|
118
|
-
module:
|
|
119
|
-
function:
|
|
110
|
+
module: "market",
|
|
111
|
+
function: "set_fee_rate",
|
|
120
112
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
121
|
-
typeArguments: options.typeArguments
|
|
113
|
+
typeArguments: options.typeArguments,
|
|
122
114
|
});
|
|
123
115
|
}
|
|
124
116
|
/** Set fee recipient address */
|
|
125
117
|
export function setFeeRecipient(options) {
|
|
126
118
|
var _a;
|
|
127
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
128
|
-
const argumentsTypes = [
|
|
129
|
-
null,
|
|
130
|
-
null,
|
|
131
|
-
'address'
|
|
132
|
-
];
|
|
119
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
120
|
+
const argumentsTypes = [null, null, "address"];
|
|
133
121
|
const parameterNames = ["_", "market", "feeRecipient"];
|
|
134
122
|
return (tx) => tx.moveCall({
|
|
135
123
|
package: packageAddress,
|
|
136
|
-
module:
|
|
137
|
-
function:
|
|
124
|
+
module: "market",
|
|
125
|
+
function: "set_fee_recipient",
|
|
138
126
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
139
|
-
typeArguments: options.typeArguments
|
|
127
|
+
typeArguments: options.typeArguments,
|
|
140
128
|
});
|
|
141
129
|
}
|
|
142
130
|
/** Get market ID */
|
|
143
131
|
export function marketId(options) {
|
|
144
132
|
var _a;
|
|
145
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
146
|
-
const argumentsTypes = [
|
|
147
|
-
null
|
|
148
|
-
];
|
|
133
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
134
|
+
const argumentsTypes = [null];
|
|
149
135
|
const parameterNames = ["market"];
|
|
150
136
|
return (tx) => tx.moveCall({
|
|
151
137
|
package: packageAddress,
|
|
152
|
-
module:
|
|
153
|
-
function:
|
|
138
|
+
module: "market",
|
|
139
|
+
function: "market_id",
|
|
154
140
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
155
|
-
typeArguments: options.typeArguments
|
|
141
|
+
typeArguments: options.typeArguments,
|
|
156
142
|
});
|
|
157
143
|
}
|
|
158
144
|
/** Get open fee rate */
|
|
159
145
|
export function openFeeRate(options) {
|
|
160
146
|
var _a;
|
|
161
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
162
|
-
const argumentsTypes = [
|
|
163
|
-
null
|
|
164
|
-
];
|
|
147
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
148
|
+
const argumentsTypes = [null];
|
|
165
149
|
const parameterNames = ["market"];
|
|
166
150
|
return (tx) => tx.moveCall({
|
|
167
151
|
package: packageAddress,
|
|
168
|
-
module:
|
|
169
|
-
function:
|
|
152
|
+
module: "market",
|
|
153
|
+
function: "open_fee_rate",
|
|
170
154
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
171
|
-
typeArguments: options.typeArguments
|
|
155
|
+
typeArguments: options.typeArguments,
|
|
172
156
|
});
|
|
173
157
|
}
|
|
174
158
|
/** Get close fee rate */
|
|
175
159
|
export function closeFeeRate(options) {
|
|
176
160
|
var _a;
|
|
177
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
178
|
-
const argumentsTypes = [
|
|
179
|
-
null
|
|
180
|
-
];
|
|
161
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
162
|
+
const argumentsTypes = [null];
|
|
181
163
|
const parameterNames = ["market"];
|
|
182
164
|
return (tx) => tx.moveCall({
|
|
183
165
|
package: packageAddress,
|
|
184
|
-
module:
|
|
185
|
-
function:
|
|
166
|
+
module: "market",
|
|
167
|
+
function: "close_fee_rate",
|
|
186
168
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
187
|
-
typeArguments: options.typeArguments
|
|
169
|
+
typeArguments: options.typeArguments,
|
|
188
170
|
});
|
|
189
171
|
}
|
|
190
172
|
/** Get fee recipient address */
|
|
191
173
|
export function feeRecipient(options) {
|
|
192
174
|
var _a;
|
|
193
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
194
|
-
const argumentsTypes = [
|
|
195
|
-
null
|
|
196
|
-
];
|
|
175
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
176
|
+
const argumentsTypes = [null];
|
|
197
177
|
const parameterNames = ["market"];
|
|
198
178
|
return (tx) => tx.moveCall({
|
|
199
179
|
package: packageAddress,
|
|
200
|
-
module:
|
|
201
|
-
function:
|
|
180
|
+
module: "market",
|
|
181
|
+
function: "fee_recipient",
|
|
202
182
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
203
|
-
typeArguments: options.typeArguments
|
|
183
|
+
typeArguments: options.typeArguments,
|
|
204
184
|
});
|
|
205
185
|
}
|
|
206
186
|
export function permissions(options) {
|
|
207
187
|
var _a;
|
|
208
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
209
|
-
const argumentsTypes = [
|
|
210
|
-
null
|
|
211
|
-
];
|
|
188
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
189
|
+
const argumentsTypes = [null];
|
|
212
190
|
const parameterNames = ["market"];
|
|
213
191
|
return (tx) => tx.moveCall({
|
|
214
192
|
package: packageAddress,
|
|
215
|
-
module:
|
|
216
|
-
function:
|
|
193
|
+
module: "market",
|
|
194
|
+
function: "permissions",
|
|
217
195
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
218
|
-
typeArguments: options.typeArguments
|
|
196
|
+
typeArguments: options.typeArguments,
|
|
219
197
|
});
|
|
220
198
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**************************************************************
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { type Transaction } from "@mysten/sui/transactions";
|
|
5
|
+
import { MoveEnum } from "../utils/index.js";
|
|
6
6
|
export declare const Permission: MoveEnum<{
|
|
7
7
|
OpenPosition: null;
|
|
8
8
|
ClosePosition: null;
|
|
@@ -14,43 +14,36 @@ export declare const Permission: MoveEnum<{
|
|
|
14
14
|
}, "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53::permissions::Permission">;
|
|
15
15
|
export interface OpenPositionOptions {
|
|
16
16
|
package?: string;
|
|
17
|
-
arguments?: [
|
|
18
|
-
];
|
|
17
|
+
arguments?: [];
|
|
19
18
|
}
|
|
20
19
|
export declare function openPosition(options?: OpenPositionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
21
20
|
export interface ClosePositionOptions {
|
|
22
21
|
package?: string;
|
|
23
|
-
arguments?: [
|
|
24
|
-
];
|
|
22
|
+
arguments?: [];
|
|
25
23
|
}
|
|
26
24
|
export declare function closePosition(options?: ClosePositionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
27
25
|
export interface DepositOptions {
|
|
28
26
|
package?: string;
|
|
29
|
-
arguments?: [
|
|
30
|
-
];
|
|
27
|
+
arguments?: [];
|
|
31
28
|
}
|
|
32
29
|
export declare function deposit(options?: DepositOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
33
30
|
export interface BorrowOptions {
|
|
34
31
|
package?: string;
|
|
35
|
-
arguments?: [
|
|
36
|
-
];
|
|
32
|
+
arguments?: [];
|
|
37
33
|
}
|
|
38
34
|
export declare function borrow(options?: BorrowOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
39
35
|
export interface WithdrawOptions {
|
|
40
36
|
package?: string;
|
|
41
|
-
arguments?: [
|
|
42
|
-
];
|
|
37
|
+
arguments?: [];
|
|
43
38
|
}
|
|
44
39
|
export declare function withdraw(options?: WithdrawOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
45
40
|
export interface RepayOptions {
|
|
46
41
|
package?: string;
|
|
47
|
-
arguments?: [
|
|
48
|
-
];
|
|
42
|
+
arguments?: [];
|
|
49
43
|
}
|
|
50
44
|
export declare function repay(options?: RepayOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
51
45
|
export interface ClaimRewardOptions {
|
|
52
46
|
package?: string;
|
|
53
|
-
arguments?: [
|
|
54
|
-
];
|
|
47
|
+
arguments?: [];
|
|
55
48
|
}
|
|
56
49
|
export declare function claimReward(options?: ClaimRewardOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const Permission = new MoveEnum({ name: `${$moduleName}::Permission`, fields: {
|
|
1
|
+
import { MoveEnum } from "../utils/index.js";
|
|
2
|
+
const $moduleName = "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53::permissions";
|
|
3
|
+
export const Permission = new MoveEnum({
|
|
4
|
+
name: `${$moduleName}::Permission`,
|
|
5
|
+
fields: {
|
|
7
6
|
OpenPosition: null,
|
|
8
7
|
ClosePosition: null,
|
|
9
8
|
Deposit: null,
|
|
10
9
|
Borrow: null,
|
|
11
10
|
Withdraw: null,
|
|
12
11
|
Repay: null,
|
|
13
|
-
ClaimReward: null
|
|
14
|
-
}
|
|
12
|
+
ClaimReward: null,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
15
|
export function openPosition(options = {}) {
|
|
16
16
|
var _a;
|
|
17
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
17
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
18
18
|
return (tx) => tx.moveCall({
|
|
19
19
|
package: packageAddress,
|
|
20
|
-
module:
|
|
21
|
-
function:
|
|
20
|
+
module: "permissions",
|
|
21
|
+
function: "open_position",
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
export function closePosition(options = {}) {
|
|
25
25
|
var _a;
|
|
26
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
26
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
27
27
|
return (tx) => tx.moveCall({
|
|
28
28
|
package: packageAddress,
|
|
29
|
-
module:
|
|
30
|
-
function:
|
|
29
|
+
module: "permissions",
|
|
30
|
+
function: "close_position",
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
export function deposit(options = {}) {
|
|
34
34
|
var _a;
|
|
35
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
35
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
36
36
|
return (tx) => tx.moveCall({
|
|
37
37
|
package: packageAddress,
|
|
38
|
-
module:
|
|
39
|
-
function:
|
|
38
|
+
module: "permissions",
|
|
39
|
+
function: "deposit",
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
export function borrow(options = {}) {
|
|
43
43
|
var _a;
|
|
44
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
44
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
45
45
|
return (tx) => tx.moveCall({
|
|
46
46
|
package: packageAddress,
|
|
47
|
-
module:
|
|
48
|
-
function:
|
|
47
|
+
module: "permissions",
|
|
48
|
+
function: "borrow",
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
export function withdraw(options = {}) {
|
|
52
52
|
var _a;
|
|
53
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
53
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
54
54
|
return (tx) => tx.moveCall({
|
|
55
55
|
package: packageAddress,
|
|
56
|
-
module:
|
|
57
|
-
function:
|
|
56
|
+
module: "permissions",
|
|
57
|
+
function: "withdraw",
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
export function repay(options = {}) {
|
|
61
61
|
var _a;
|
|
62
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
62
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
63
63
|
return (tx) => tx.moveCall({
|
|
64
64
|
package: packageAddress,
|
|
65
|
-
module:
|
|
66
|
-
function:
|
|
65
|
+
module: "permissions",
|
|
66
|
+
function: "repay",
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
export function claimReward(options = {}) {
|
|
70
70
|
var _a;
|
|
71
|
-
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a :
|
|
71
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : "0xd5f3054404ec9275b50985851a5b515728f131a3bdd9c9a5f738a9326b738d53";
|
|
72
72
|
return (tx) => tx.moveCall({
|
|
73
73
|
package: packageAddress,
|
|
74
|
-
module:
|
|
75
|
-
function:
|
|
74
|
+
module: "permissions",
|
|
75
|
+
function: "claim_reward",
|
|
76
76
|
});
|
|
77
77
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
**************************************************************/
|
|
4
|
-
import { MoveStruct, type RawTransactionArgument } from '../utils/index.js';
|
|
5
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
1
|
+
import { type Transaction } from "@mysten/sui/transactions";
|
|
2
|
+
import { MoveStruct, type RawTransactionArgument } from "../utils/index.js";
|
|
6
3
|
export declare const Position: MoveStruct<{
|
|
7
4
|
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
8
5
|
is_long: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
@@ -89,12 +86,8 @@ export interface OwnerArguments {
|
|
|
89
86
|
}
|
|
90
87
|
export interface OwnerOptions {
|
|
91
88
|
package?: string;
|
|
92
|
-
arguments: OwnerArguments | [
|
|
93
|
-
|
|
94
|
-
];
|
|
95
|
-
typeArguments: [
|
|
96
|
-
string
|
|
97
|
-
];
|
|
89
|
+
arguments: OwnerArguments | [position: RawTransactionArgument<string>];
|
|
90
|
+
typeArguments: [string];
|
|
98
91
|
}
|
|
99
92
|
/** Get position owner */
|
|
100
93
|
export declare function owner(options: OwnerOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -103,12 +96,8 @@ export interface IsLongArguments {
|
|
|
103
96
|
}
|
|
104
97
|
export interface IsLongOptions {
|
|
105
98
|
package?: string;
|
|
106
|
-
arguments: IsLongArguments | [
|
|
107
|
-
|
|
108
|
-
];
|
|
109
|
-
typeArguments: [
|
|
110
|
-
string
|
|
111
|
-
];
|
|
99
|
+
arguments: IsLongArguments | [position: RawTransactionArgument<string>];
|
|
100
|
+
typeArguments: [string];
|
|
112
101
|
}
|
|
113
102
|
/** Check if it's a long position */
|
|
114
103
|
export declare function isLong(options: IsLongOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -117,12 +106,8 @@ export interface ObligationIdArguments {
|
|
|
117
106
|
}
|
|
118
107
|
export interface ObligationIdOptions {
|
|
119
108
|
package?: string;
|
|
120
|
-
arguments: ObligationIdArguments | [
|
|
121
|
-
|
|
122
|
-
];
|
|
123
|
-
typeArguments: [
|
|
124
|
-
string
|
|
125
|
-
];
|
|
109
|
+
arguments: ObligationIdArguments | [position: RawTransactionArgument<string>];
|
|
110
|
+
typeArguments: [string];
|
|
126
111
|
}
|
|
127
112
|
export declare function obligationId(options: ObligationIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
128
113
|
export interface LendingMarketIdArguments {
|
|
@@ -130,12 +115,8 @@ export interface LendingMarketIdArguments {
|
|
|
130
115
|
}
|
|
131
116
|
export interface LendingMarketIdOptions {
|
|
132
117
|
package?: string;
|
|
133
|
-
arguments: LendingMarketIdArguments | [
|
|
134
|
-
|
|
135
|
-
];
|
|
136
|
-
typeArguments: [
|
|
137
|
-
string
|
|
138
|
-
];
|
|
118
|
+
arguments: LendingMarketIdArguments | [position: RawTransactionArgument<string>];
|
|
119
|
+
typeArguments: [string];
|
|
139
120
|
}
|
|
140
121
|
export declare function lendingMarketId(options: LendingMarketIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
141
122
|
export interface MarketIdArguments {
|
|
@@ -143,11 +124,7 @@ export interface MarketIdArguments {
|
|
|
143
124
|
}
|
|
144
125
|
export interface MarketIdOptions {
|
|
145
126
|
package?: string;
|
|
146
|
-
arguments: MarketIdArguments | [
|
|
147
|
-
|
|
148
|
-
];
|
|
149
|
-
typeArguments: [
|
|
150
|
-
string
|
|
151
|
-
];
|
|
127
|
+
arguments: MarketIdArguments | [position: RawTransactionArgument<string>];
|
|
128
|
+
typeArguments: [string];
|
|
152
129
|
}
|
|
153
130
|
export declare function marketId(options: MarketIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|