@typus/typus-perp-sdk 1.1.5 → 1.1.7
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/dist/src/api/sentio.d.ts +1 -1
- package/dist/src/api/sentio.js +8 -4
- package/dist/src/fetch.d.ts +10 -1
- package/dist/src/fetch.js +21 -8
- package/dist/src/index.js +1 -1
- package/dist/src/typus_perp/lp-pool/functions.d.ts +34 -0
- package/dist/src/typus_perp/lp-pool/functions.js +56 -0
- package/dist/src/typus_perp/lp-pool/structs.d.ts +774 -0
- package/dist/src/typus_perp/lp-pool/structs.js +1952 -498
- package/dist/src/typus_perp/trading/functions.d.ts +105 -10
- package/dist/src/typus_perp/trading/functions.js +152 -16
- package/dist/src/typus_perp/user-account/functions.d.ts +36 -0
- package/dist/src/typus_perp/user-account/functions.js +70 -0
- package/dist/src/typus_perp/user-account/structs.d.ts +168 -0
- package/dist/src/typus_perp/user-account/structs.js +448 -0
- package/dist/src/user/history.d.ts +4 -1
- package/dist/src/user/history.js +196 -9
- package/dist/src/user/order.d.ts +4 -0
- package/dist/src/user/order.js +48 -0
- package/dist/src/user/orderWithBidReceipt.js +2 -4
- package/package.json +1 -1
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { Transaction, TransactionArgument, TransactionObjectInput } from "@mysten/sui/transactions";
|
|
2
|
+
export interface AddDelegateUserArgs {
|
|
3
|
+
version: TransactionObjectInput;
|
|
4
|
+
registry: TransactionObjectInput;
|
|
5
|
+
marketIndex: bigint | TransactionArgument;
|
|
6
|
+
user: string | TransactionArgument;
|
|
7
|
+
}
|
|
8
|
+
export declare function addDelegateUser(tx: Transaction, args: AddDelegateUserArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
2
9
|
export interface AddTradingSymbolArgs {
|
|
3
10
|
version: TransactionObjectInput;
|
|
4
11
|
registry: TransactionObjectInput;
|
|
@@ -65,7 +72,7 @@ export interface CancelTradingOrderArgs {
|
|
|
65
72
|
orderUser: string | TransactionArgument | TransactionArgument | null;
|
|
66
73
|
}
|
|
67
74
|
export declare function cancelTradingOrder(tx: Transaction, typeArgs: [string, string], args: CancelTradingOrderArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
68
|
-
export interface
|
|
75
|
+
export interface CheckCollateralEnoughWhenAddingPositionArgs {
|
|
69
76
|
symbolMarket: TransactionObjectInput;
|
|
70
77
|
order: TransactionObjectInput;
|
|
71
78
|
collateralOraclePrice: bigint | TransactionArgument;
|
|
@@ -74,7 +81,17 @@ export interface CheckCollateralEnoughArgs {
|
|
|
74
81
|
tradingPairOraclePriceDecimal: bigint | TransactionArgument;
|
|
75
82
|
tradingFeeMbp: bigint | TransactionArgument;
|
|
76
83
|
}
|
|
77
|
-
export declare function
|
|
84
|
+
export declare function checkCollateralEnoughWhenAddingPosition(tx: Transaction, typeArg: string, args: CheckCollateralEnoughWhenAddingPositionArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
85
|
+
export interface CheckCollateralEnoughWhenReducingPositionArgs {
|
|
86
|
+
symbolMarket: TransactionObjectInput;
|
|
87
|
+
order: TransactionObjectInput;
|
|
88
|
+
collateralOraclePrice: bigint | TransactionArgument;
|
|
89
|
+
collateralOraclePriceDecimal: bigint | TransactionArgument;
|
|
90
|
+
tradingPairOraclePrice: bigint | TransactionArgument;
|
|
91
|
+
tradingPairOraclePriceDecimal: bigint | TransactionArgument;
|
|
92
|
+
tradingFeeMbp: bigint | TransactionArgument;
|
|
93
|
+
}
|
|
94
|
+
export declare function checkCollateralEnoughWhenReducingPosition(tx: Transaction, typeArg: string, args: CheckCollateralEnoughWhenReducingPositionArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
78
95
|
export interface CheckOptionCollateralEnoughArgs {
|
|
79
96
|
dovRegistry: TransactionObjectInput;
|
|
80
97
|
typusOracleTradingSymbol: TransactionObjectInput;
|
|
@@ -89,6 +106,11 @@ export interface CheckOptionCollateralEnoughArgs {
|
|
|
89
106
|
clock: TransactionObjectInput;
|
|
90
107
|
}
|
|
91
108
|
export declare function checkOptionCollateralEnough(tx: Transaction, typeArg: string, args: CheckOptionCollateralEnoughArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
109
|
+
export interface CheckPositionUserMatchedArgs {
|
|
110
|
+
position: TransactionObjectInput;
|
|
111
|
+
user: string | TransactionArgument;
|
|
112
|
+
}
|
|
113
|
+
export declare function checkPositionUserMatched(tx: Transaction, args: CheckPositionUserMatchedArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
92
114
|
export interface CheckReserveEnoughArgs {
|
|
93
115
|
symbolMarket: TransactionObjectInput;
|
|
94
116
|
liquidityPool: TransactionObjectInput;
|
|
@@ -99,6 +121,18 @@ export interface CheckReserveEnoughArgs {
|
|
|
99
121
|
tradingPairOraclePriceDecimal: bigint | TransactionArgument;
|
|
100
122
|
}
|
|
101
123
|
export declare function checkReserveEnough(tx: Transaction, typeArg: string, args: CheckReserveEnoughArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
124
|
+
export interface CollectPositionFundingFeeArgs {
|
|
125
|
+
version: TransactionObjectInput;
|
|
126
|
+
registry: TransactionObjectInput;
|
|
127
|
+
poolRegistry: TransactionObjectInput;
|
|
128
|
+
typusOracleCToken: TransactionObjectInput;
|
|
129
|
+
typusOracleTradingSymbol: TransactionObjectInput;
|
|
130
|
+
clock: TransactionObjectInput;
|
|
131
|
+
marketIndex: bigint | TransactionArgument;
|
|
132
|
+
poolIndex: bigint | TransactionArgument;
|
|
133
|
+
positionId: bigint | TransactionArgument;
|
|
134
|
+
}
|
|
135
|
+
export declare function collectPositionFundingFee(tx: Transaction, typeArgs: [string, string], args: CollectPositionFundingFeeArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
102
136
|
export interface CreateTradingOrderArgs {
|
|
103
137
|
version: TransactionObjectInput;
|
|
104
138
|
registry: TransactionObjectInput;
|
|
@@ -181,6 +215,38 @@ export interface CreateTradingOrderWithBidReceiptV2Args {
|
|
|
181
215
|
user: string | TransactionArgument;
|
|
182
216
|
}
|
|
183
217
|
export declare function createTradingOrderWithBidReceiptV2(tx: Transaction, typeArgs: [string, string, string], args: CreateTradingOrderWithBidReceiptV2Args, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
218
|
+
export interface CreateTradingOrderWithBidReceiptV3Args {
|
|
219
|
+
version: TransactionObjectInput;
|
|
220
|
+
registry: TransactionObjectInput;
|
|
221
|
+
poolRegistry: TransactionObjectInput;
|
|
222
|
+
dovRegistry: TransactionObjectInput;
|
|
223
|
+
typusOracleCToken: TransactionObjectInput;
|
|
224
|
+
typusOracleTradingSymbol: TransactionObjectInput;
|
|
225
|
+
clock: TransactionObjectInput;
|
|
226
|
+
marketIndex: bigint | TransactionArgument;
|
|
227
|
+
poolIndex: bigint | TransactionArgument;
|
|
228
|
+
typusEcosystemVersion: TransactionObjectInput;
|
|
229
|
+
typusUserRegistry: TransactionObjectInput;
|
|
230
|
+
typusLeaderboardRegistry: TransactionObjectInput;
|
|
231
|
+
tailsStakingRegistry: TransactionObjectInput;
|
|
232
|
+
competitionConfig: TransactionObjectInput;
|
|
233
|
+
collateralBidReceipt: TransactionObjectInput;
|
|
234
|
+
isLong: boolean | TransactionArgument;
|
|
235
|
+
}
|
|
236
|
+
export declare function createTradingOrderWithBidReceiptV3(tx: Transaction, typeArgs: [string, string, string], args: CreateTradingOrderWithBidReceiptV3Args, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
237
|
+
export interface CreateUserAccountArgs {
|
|
238
|
+
version: TransactionObjectInput;
|
|
239
|
+
registry: TransactionObjectInput;
|
|
240
|
+
marketIndex: bigint | TransactionArgument;
|
|
241
|
+
}
|
|
242
|
+
export declare function createUserAccount(tx: Transaction, args: CreateUserAccountArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
243
|
+
export interface DepositUserAccountArgs {
|
|
244
|
+
version: TransactionObjectInput;
|
|
245
|
+
registry: TransactionObjectInput;
|
|
246
|
+
marketIndex: bigint | TransactionArgument;
|
|
247
|
+
collateral: TransactionObjectInput;
|
|
248
|
+
}
|
|
249
|
+
export declare function depositUserAccount(tx: Transaction, typeArg: string, args: DepositUserAccountArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
184
250
|
export declare function deprecated(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
185
251
|
export interface ExecuteOptionCollateralOrder_Args {
|
|
186
252
|
version: TransactionObjectInput;
|
|
@@ -215,7 +281,6 @@ export interface ExecuteOrder_Args {
|
|
|
215
281
|
collateralOraclePriceDecimal: bigint | TransactionArgument;
|
|
216
282
|
tradingPairOraclePrice: bigint | TransactionArgument;
|
|
217
283
|
tradingPairOraclePriceDecimal: bigint | TransactionArgument;
|
|
218
|
-
tradingFeeMbp: bigint | TransactionArgument;
|
|
219
284
|
typusEcosystemVersion: TransactionObjectInput;
|
|
220
285
|
typusUserRegistry: TransactionObjectInput;
|
|
221
286
|
typusLeaderboardRegistry: TransactionObjectInput;
|
|
@@ -309,6 +374,11 @@ export interface GetMaxReleasingCollateralAmountArgs {
|
|
|
309
374
|
positionId: bigint | TransactionArgument;
|
|
310
375
|
}
|
|
311
376
|
export declare function getMaxReleasingCollateralAmount(tx: Transaction, typeArgs: [string, string], args: GetMaxReleasingCollateralAmountArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
377
|
+
export interface GetMutMarketIdArgs {
|
|
378
|
+
registry: TransactionObjectInput;
|
|
379
|
+
marketIndex: bigint | TransactionArgument;
|
|
380
|
+
}
|
|
381
|
+
export declare function getMutMarketId(tx: Transaction, args: GetMutMarketIdArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
312
382
|
export interface GetMutOrdersArgs {
|
|
313
383
|
symbolMarket: TransactionObjectInput;
|
|
314
384
|
isTokenCollateral: boolean | TransactionArgument;
|
|
@@ -321,6 +391,11 @@ export interface GetOrdersArgs {
|
|
|
321
391
|
orderTypeTag: number | TransactionArgument;
|
|
322
392
|
}
|
|
323
393
|
export declare function getOrders(tx: Transaction, args: GetOrdersArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
394
|
+
export interface GetTradingFeeConfigArgs {
|
|
395
|
+
marketConfig: TransactionObjectInput;
|
|
396
|
+
isOptionPosition: boolean | TransactionArgument;
|
|
397
|
+
}
|
|
398
|
+
export declare function getTradingFeeConfig(tx: Transaction, args: GetTradingFeeConfigArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
324
399
|
export interface GetUserOrdersArgs {
|
|
325
400
|
version: TransactionObjectInput;
|
|
326
401
|
registry: TransactionObjectInput;
|
|
@@ -348,7 +423,12 @@ export interface IncreaseCollateralArgs {
|
|
|
348
423
|
collateral: TransactionObjectInput;
|
|
349
424
|
}
|
|
350
425
|
export declare function increaseCollateral(tx: Transaction, typeArgs: [string, string], args: IncreaseCollateralArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
351
|
-
export
|
|
426
|
+
export interface InitUserAccountTableArgs {
|
|
427
|
+
version: TransactionObjectInput;
|
|
428
|
+
registry: TransactionObjectInput;
|
|
429
|
+
marketIndex: bigint | TransactionArgument;
|
|
430
|
+
}
|
|
431
|
+
export declare function initUserAccountTable(tx: Transaction, args: InitUserAccountTableArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
352
432
|
export interface LiquidateArgs {
|
|
353
433
|
version: TransactionObjectInput;
|
|
354
434
|
registry: TransactionObjectInput;
|
|
@@ -408,12 +488,6 @@ export interface ManagerCloseOptionPositionV2Args {
|
|
|
408
488
|
positionId: bigint | TransactionArgument;
|
|
409
489
|
}
|
|
410
490
|
export declare function managerCloseOptionPositionV2(tx: Transaction, typeArgs: [string, string, string], args: ManagerCloseOptionPositionV2Args, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
411
|
-
export interface ManagerHotfixRemoveMarketSymbolArgs {
|
|
412
|
-
version: TransactionObjectInput;
|
|
413
|
-
registry: TransactionObjectInput;
|
|
414
|
-
marketIndex: bigint | TransactionArgument;
|
|
415
|
-
}
|
|
416
|
-
export declare function managerHotfixRemoveMarketSymbol(tx: Transaction, typeArg: string, args: ManagerHotfixRemoveMarketSymbolArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
417
491
|
export interface ManagerReducePositionArgs {
|
|
418
492
|
version: TransactionObjectInput;
|
|
419
493
|
registry: TransactionObjectInput;
|
|
@@ -634,6 +708,13 @@ export interface RemoveTradingSymbolArgs {
|
|
|
634
708
|
marketIndex: bigint | TransactionArgument;
|
|
635
709
|
}
|
|
636
710
|
export declare function removeTradingSymbol(tx: Transaction, typeArg: string, args: RemoveTradingSymbolArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
711
|
+
export interface RemoveUserAccountArgs {
|
|
712
|
+
version: TransactionObjectInput;
|
|
713
|
+
registry: TransactionObjectInput;
|
|
714
|
+
marketIndex: bigint | TransactionArgument;
|
|
715
|
+
userAccountCap: TransactionObjectInput;
|
|
716
|
+
}
|
|
717
|
+
export declare function removeUserAccount(tx: Transaction, args: RemoveUserAccountArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
637
718
|
export interface ResumeMarketArgs {
|
|
638
719
|
version: TransactionObjectInput;
|
|
639
720
|
registry: TransactionObjectInput;
|
|
@@ -646,6 +727,12 @@ export interface ResumeTradingSymbolArgs {
|
|
|
646
727
|
marketIndex: bigint | TransactionArgument;
|
|
647
728
|
}
|
|
648
729
|
export declare function resumeTradingSymbol(tx: Transaction, typeArg: string, args: ResumeTradingSymbolArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
730
|
+
export interface ReturnToUserArgs {
|
|
731
|
+
marketId: TransactionObjectInput;
|
|
732
|
+
balance: TransactionObjectInput;
|
|
733
|
+
user: string | TransactionArgument;
|
|
734
|
+
}
|
|
735
|
+
export declare function returnToUser(tx: Transaction, typeArg: string, args: ReturnToUserArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
649
736
|
export interface SettleReceiptCollateralArgs {
|
|
650
737
|
version: TransactionObjectInput;
|
|
651
738
|
registry: TransactionObjectInput;
|
|
@@ -715,3 +802,11 @@ export interface UpdateProtocolFeeShareBpArgs {
|
|
|
715
802
|
protocolFeeShareBp: bigint | TransactionArgument;
|
|
716
803
|
}
|
|
717
804
|
export declare function updateProtocolFeeShareBp(tx: Transaction, args: UpdateProtocolFeeShareBpArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
805
|
+
export interface WithdrawUserAccountArgs {
|
|
806
|
+
version: TransactionObjectInput;
|
|
807
|
+
registry: TransactionObjectInput;
|
|
808
|
+
marketIndex: bigint | TransactionArgument;
|
|
809
|
+
amount: bigint | TransactionArgument | TransactionArgument | null;
|
|
810
|
+
userAccountCap: TransactionObjectInput;
|
|
811
|
+
}
|
|
812
|
+
export declare function withdrawUserAccount(tx: Transaction, typeArg: string, args: WithdrawUserAccountArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addDelegateUser = addDelegateUser;
|
|
3
4
|
exports.addTradingSymbol = addTradingSymbol;
|
|
4
5
|
exports.adjustMarketInfoUserOrderSize = adjustMarketInfoUserOrderSize;
|
|
5
6
|
exports.adjustMarketInfoUserPositionSize = adjustMarketInfoUserPositionSize;
|
|
6
7
|
exports.calculateTradingFeeRateMbp = calculateTradingFeeRateMbp;
|
|
7
8
|
exports.cancelLinkedOrders = cancelLinkedOrders;
|
|
8
9
|
exports.cancelTradingOrder = cancelTradingOrder;
|
|
9
|
-
exports.
|
|
10
|
+
exports.checkCollateralEnoughWhenAddingPosition = checkCollateralEnoughWhenAddingPosition;
|
|
11
|
+
exports.checkCollateralEnoughWhenReducingPosition = checkCollateralEnoughWhenReducingPosition;
|
|
10
12
|
exports.checkOptionCollateralEnough = checkOptionCollateralEnough;
|
|
13
|
+
exports.checkPositionUserMatched = checkPositionUserMatched;
|
|
11
14
|
exports.checkReserveEnough = checkReserveEnough;
|
|
15
|
+
exports.collectPositionFundingFee = collectPositionFundingFee;
|
|
12
16
|
exports.createTradingOrder = createTradingOrder;
|
|
13
17
|
exports.createTradingOrderV2 = createTradingOrderV2;
|
|
14
18
|
exports.createTradingOrderWithBidReceipt = createTradingOrderWithBidReceipt;
|
|
15
19
|
exports.createTradingOrderWithBidReceiptV2 = createTradingOrderWithBidReceiptV2;
|
|
20
|
+
exports.createTradingOrderWithBidReceiptV3 = createTradingOrderWithBidReceiptV3;
|
|
21
|
+
exports.createUserAccount = createUserAccount;
|
|
22
|
+
exports.depositUserAccount = depositUserAccount;
|
|
16
23
|
exports.deprecated = deprecated;
|
|
17
24
|
exports.executeOptionCollateralOrder_ = executeOptionCollateralOrder_;
|
|
18
25
|
exports.executeOrder_ = executeOrder_;
|
|
@@ -26,17 +33,18 @@ exports.getLinkedPosition = getLinkedPosition;
|
|
|
26
33
|
exports.getLiquidationInfo = getLiquidationInfo;
|
|
27
34
|
exports.getMarketsBcs = getMarketsBcs;
|
|
28
35
|
exports.getMaxReleasingCollateralAmount = getMaxReleasingCollateralAmount;
|
|
36
|
+
exports.getMutMarketId = getMutMarketId;
|
|
29
37
|
exports.getMutOrders = getMutOrders;
|
|
30
38
|
exports.getOrders = getOrders;
|
|
39
|
+
exports.getTradingFeeConfig = getTradingFeeConfig;
|
|
31
40
|
exports.getUserOrders = getUserOrders;
|
|
32
41
|
exports.getUserPositions = getUserPositions;
|
|
33
42
|
exports.increaseCollateral = increaseCollateral;
|
|
34
|
-
exports.
|
|
43
|
+
exports.initUserAccountTable = initUserAccountTable;
|
|
35
44
|
exports.liquidate = liquidate;
|
|
36
45
|
exports.managerCancelOrderByOpenInterestLimit = managerCancelOrderByOpenInterestLimit;
|
|
37
46
|
exports.managerCloseOptionPosition = managerCloseOptionPosition;
|
|
38
47
|
exports.managerCloseOptionPositionV2 = managerCloseOptionPositionV2;
|
|
39
|
-
exports.managerHotfixRemoveMarketSymbol = managerHotfixRemoveMarketSymbol;
|
|
40
48
|
exports.managerReducePosition = managerReducePosition;
|
|
41
49
|
exports.managerReducePositionV2 = managerReducePositionV2;
|
|
42
50
|
exports.managerRemoveOrder = managerRemoveOrder;
|
|
@@ -53,8 +61,10 @@ exports.releaseCollateral = releaseCollateral;
|
|
|
53
61
|
exports.removeLinkedOrder_ = removeLinkedOrder_;
|
|
54
62
|
exports.removeLinkedOrders = removeLinkedOrders;
|
|
55
63
|
exports.removeTradingSymbol = removeTradingSymbol;
|
|
64
|
+
exports.removeUserAccount = removeUserAccount;
|
|
56
65
|
exports.resumeMarket = resumeMarket;
|
|
57
66
|
exports.resumeTradingSymbol = resumeTradingSymbol;
|
|
67
|
+
exports.returnToUser = returnToUser;
|
|
58
68
|
exports.settleReceiptCollateral = settleReceiptCollateral;
|
|
59
69
|
exports.suspendMarket = suspendMarket;
|
|
60
70
|
exports.suspendTradingSymbol = suspendTradingSymbol;
|
|
@@ -63,10 +73,18 @@ exports.tradingSymbolExists = tradingSymbolExists;
|
|
|
63
73
|
exports.updateFundingRate = updateFundingRate;
|
|
64
74
|
exports.updateMarketConfig = updateMarketConfig;
|
|
65
75
|
exports.updateProtocolFeeShareBp = updateProtocolFeeShareBp;
|
|
76
|
+
exports.withdrawUserAccount = withdrawUserAccount;
|
|
66
77
|
var __1 = require("..");
|
|
67
78
|
var structs_1 = require("../../_dependencies/source/0x1/option/structs");
|
|
68
79
|
var structs_2 = require("../../_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs");
|
|
69
80
|
var util_1 = require("../../_framework/util");
|
|
81
|
+
function addDelegateUser(tx, args, published_at) {
|
|
82
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
83
|
+
return tx.moveCall({
|
|
84
|
+
target: "".concat(published_at, "::trading::add_delegate_user"),
|
|
85
|
+
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.marketIndex, "u64"), (0, util_1.pure)(tx, args.user, "address")],
|
|
86
|
+
});
|
|
87
|
+
}
|
|
70
88
|
function addTradingSymbol(tx, typeArg, args, published_at) {
|
|
71
89
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
72
90
|
return tx.moveCall({
|
|
@@ -166,10 +184,26 @@ function cancelTradingOrder(tx, typeArgs, args, published_at) {
|
|
|
166
184
|
],
|
|
167
185
|
});
|
|
168
186
|
}
|
|
169
|
-
function
|
|
187
|
+
function checkCollateralEnoughWhenAddingPosition(tx, typeArg, args, published_at) {
|
|
188
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
189
|
+
return tx.moveCall({
|
|
190
|
+
target: "".concat(published_at, "::trading::check_collateral_enough_when_adding_position"),
|
|
191
|
+
typeArguments: [typeArg],
|
|
192
|
+
arguments: [
|
|
193
|
+
(0, util_1.obj)(tx, args.symbolMarket),
|
|
194
|
+
(0, util_1.obj)(tx, args.order),
|
|
195
|
+
(0, util_1.pure)(tx, args.collateralOraclePrice, "u64"),
|
|
196
|
+
(0, util_1.pure)(tx, args.collateralOraclePriceDecimal, "u64"),
|
|
197
|
+
(0, util_1.pure)(tx, args.tradingPairOraclePrice, "u64"),
|
|
198
|
+
(0, util_1.pure)(tx, args.tradingPairOraclePriceDecimal, "u64"),
|
|
199
|
+
(0, util_1.pure)(tx, args.tradingFeeMbp, "u64"),
|
|
200
|
+
],
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
function checkCollateralEnoughWhenReducingPosition(tx, typeArg, args, published_at) {
|
|
170
204
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
171
205
|
return tx.moveCall({
|
|
172
|
-
target: "".concat(published_at, "::trading::
|
|
206
|
+
target: "".concat(published_at, "::trading::check_collateral_enough_when_reducing_position"),
|
|
173
207
|
typeArguments: [typeArg],
|
|
174
208
|
arguments: [
|
|
175
209
|
(0, util_1.obj)(tx, args.symbolMarket),
|
|
@@ -202,6 +236,13 @@ function checkOptionCollateralEnough(tx, typeArg, args, published_at) {
|
|
|
202
236
|
],
|
|
203
237
|
});
|
|
204
238
|
}
|
|
239
|
+
function checkPositionUserMatched(tx, args, published_at) {
|
|
240
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
241
|
+
return tx.moveCall({
|
|
242
|
+
target: "".concat(published_at, "::trading::check_position_user_matched"),
|
|
243
|
+
arguments: [(0, util_1.obj)(tx, args.position), (0, util_1.pure)(tx, args.user, "address")],
|
|
244
|
+
});
|
|
245
|
+
}
|
|
205
246
|
function checkReserveEnough(tx, typeArg, args, published_at) {
|
|
206
247
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
207
248
|
return tx.moveCall({
|
|
@@ -218,6 +259,24 @@ function checkReserveEnough(tx, typeArg, args, published_at) {
|
|
|
218
259
|
],
|
|
219
260
|
});
|
|
220
261
|
}
|
|
262
|
+
function collectPositionFundingFee(tx, typeArgs, args, published_at) {
|
|
263
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
264
|
+
return tx.moveCall({
|
|
265
|
+
target: "".concat(published_at, "::trading::collect_position_funding_fee"),
|
|
266
|
+
typeArguments: typeArgs,
|
|
267
|
+
arguments: [
|
|
268
|
+
(0, util_1.obj)(tx, args.version),
|
|
269
|
+
(0, util_1.obj)(tx, args.registry),
|
|
270
|
+
(0, util_1.obj)(tx, args.poolRegistry),
|
|
271
|
+
(0, util_1.obj)(tx, args.typusOracleCToken),
|
|
272
|
+
(0, util_1.obj)(tx, args.typusOracleTradingSymbol),
|
|
273
|
+
(0, util_1.obj)(tx, args.clock),
|
|
274
|
+
(0, util_1.pure)(tx, args.marketIndex, "u64"),
|
|
275
|
+
(0, util_1.pure)(tx, args.poolIndex, "u64"),
|
|
276
|
+
(0, util_1.pure)(tx, args.positionId, "u64"),
|
|
277
|
+
],
|
|
278
|
+
});
|
|
279
|
+
}
|
|
221
280
|
function createTradingOrder(tx, typeArgs, args, published_at) {
|
|
222
281
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
223
282
|
return tx.moveCall({
|
|
@@ -324,6 +383,46 @@ function createTradingOrderWithBidReceiptV2(tx, typeArgs, args, published_at) {
|
|
|
324
383
|
],
|
|
325
384
|
});
|
|
326
385
|
}
|
|
386
|
+
function createTradingOrderWithBidReceiptV3(tx, typeArgs, args, published_at) {
|
|
387
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
388
|
+
return tx.moveCall({
|
|
389
|
+
target: "".concat(published_at, "::trading::create_trading_order_with_bid_receipt_v3"),
|
|
390
|
+
typeArguments: typeArgs,
|
|
391
|
+
arguments: [
|
|
392
|
+
(0, util_1.obj)(tx, args.version),
|
|
393
|
+
(0, util_1.obj)(tx, args.registry),
|
|
394
|
+
(0, util_1.obj)(tx, args.poolRegistry),
|
|
395
|
+
(0, util_1.obj)(tx, args.dovRegistry),
|
|
396
|
+
(0, util_1.obj)(tx, args.typusOracleCToken),
|
|
397
|
+
(0, util_1.obj)(tx, args.typusOracleTradingSymbol),
|
|
398
|
+
(0, util_1.obj)(tx, args.clock),
|
|
399
|
+
(0, util_1.pure)(tx, args.marketIndex, "u64"),
|
|
400
|
+
(0, util_1.pure)(tx, args.poolIndex, "u64"),
|
|
401
|
+
(0, util_1.obj)(tx, args.typusEcosystemVersion),
|
|
402
|
+
(0, util_1.obj)(tx, args.typusUserRegistry),
|
|
403
|
+
(0, util_1.obj)(tx, args.typusLeaderboardRegistry),
|
|
404
|
+
(0, util_1.obj)(tx, args.tailsStakingRegistry),
|
|
405
|
+
(0, util_1.obj)(tx, args.competitionConfig),
|
|
406
|
+
(0, util_1.obj)(tx, args.collateralBidReceipt),
|
|
407
|
+
(0, util_1.pure)(tx, args.isLong, "bool"),
|
|
408
|
+
],
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
function createUserAccount(tx, args, published_at) {
|
|
412
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
413
|
+
return tx.moveCall({
|
|
414
|
+
target: "".concat(published_at, "::trading::create_user_account"),
|
|
415
|
+
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.marketIndex, "u64")],
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
function depositUserAccount(tx, typeArg, args, published_at) {
|
|
419
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
420
|
+
return tx.moveCall({
|
|
421
|
+
target: "".concat(published_at, "::trading::deposit_user_account"),
|
|
422
|
+
typeArguments: [typeArg],
|
|
423
|
+
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.marketIndex, "u64"), (0, util_1.obj)(tx, args.collateral)],
|
|
424
|
+
});
|
|
425
|
+
}
|
|
327
426
|
function deprecated(tx, published_at) {
|
|
328
427
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
329
428
|
return tx.moveCall({ target: "".concat(published_at, "::trading::deprecated"), arguments: [] });
|
|
@@ -372,7 +471,6 @@ function executeOrder_(tx, typeArg, args, published_at) {
|
|
|
372
471
|
(0, util_1.pure)(tx, args.collateralOraclePriceDecimal, "u64"),
|
|
373
472
|
(0, util_1.pure)(tx, args.tradingPairOraclePrice, "u64"),
|
|
374
473
|
(0, util_1.pure)(tx, args.tradingPairOraclePriceDecimal, "u64"),
|
|
375
|
-
(0, util_1.pure)(tx, args.tradingFeeMbp, "u64"),
|
|
376
474
|
(0, util_1.obj)(tx, args.typusEcosystemVersion),
|
|
377
475
|
(0, util_1.obj)(tx, args.typusUserRegistry),
|
|
378
476
|
(0, util_1.obj)(tx, args.typusLeaderboardRegistry),
|
|
@@ -508,6 +606,13 @@ function getMaxReleasingCollateralAmount(tx, typeArgs, args, published_at) {
|
|
|
508
606
|
],
|
|
509
607
|
});
|
|
510
608
|
}
|
|
609
|
+
function getMutMarketId(tx, args, published_at) {
|
|
610
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
611
|
+
return tx.moveCall({
|
|
612
|
+
target: "".concat(published_at, "::trading::get_mut_market_id"),
|
|
613
|
+
arguments: [(0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.marketIndex, "u64")],
|
|
614
|
+
});
|
|
615
|
+
}
|
|
511
616
|
function getMutOrders(tx, args, published_at) {
|
|
512
617
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
513
618
|
return tx.moveCall({
|
|
@@ -522,6 +627,13 @@ function getOrders(tx, args, published_at) {
|
|
|
522
627
|
arguments: [(0, util_1.obj)(tx, args.symbolMarket), (0, util_1.pure)(tx, args.isTokenCollateral, "bool"), (0, util_1.pure)(tx, args.orderTypeTag, "u8")],
|
|
523
628
|
});
|
|
524
629
|
}
|
|
630
|
+
function getTradingFeeConfig(tx, args, published_at) {
|
|
631
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
632
|
+
return tx.moveCall({
|
|
633
|
+
target: "".concat(published_at, "::trading::get_trading_fee_config"),
|
|
634
|
+
arguments: [(0, util_1.obj)(tx, args.marketConfig), (0, util_1.pure)(tx, args.isOptionPosition, "bool")],
|
|
635
|
+
});
|
|
636
|
+
}
|
|
525
637
|
function getUserOrders(tx, args, published_at) {
|
|
526
638
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
527
639
|
return tx.moveCall({
|
|
@@ -555,9 +667,12 @@ function increaseCollateral(tx, typeArgs, args, published_at) {
|
|
|
555
667
|
],
|
|
556
668
|
});
|
|
557
669
|
}
|
|
558
|
-
function
|
|
670
|
+
function initUserAccountTable(tx, args, published_at) {
|
|
559
671
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
560
|
-
return tx.moveCall({
|
|
672
|
+
return tx.moveCall({
|
|
673
|
+
target: "".concat(published_at, "::trading::init_user_account_table"),
|
|
674
|
+
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.marketIndex, "u64")],
|
|
675
|
+
});
|
|
561
676
|
}
|
|
562
677
|
function liquidate(tx, typeArgs, args, published_at) {
|
|
563
678
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
@@ -642,14 +757,6 @@ function managerCloseOptionPositionV2(tx, typeArgs, args, published_at) {
|
|
|
642
757
|
],
|
|
643
758
|
});
|
|
644
759
|
}
|
|
645
|
-
function managerHotfixRemoveMarketSymbol(tx, typeArg, args, published_at) {
|
|
646
|
-
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
647
|
-
return tx.moveCall({
|
|
648
|
-
target: "".concat(published_at, "::trading::manager_hotfix_remove_market_symbol"),
|
|
649
|
-
typeArguments: [typeArg],
|
|
650
|
-
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.marketIndex, "u64")],
|
|
651
|
-
});
|
|
652
|
-
}
|
|
653
760
|
function managerReducePosition(tx, typeArgs, args, published_at) {
|
|
654
761
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
655
762
|
return tx.moveCall({
|
|
@@ -958,6 +1065,13 @@ function removeTradingSymbol(tx, typeArg, args, published_at) {
|
|
|
958
1065
|
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.marketIndex, "u64")],
|
|
959
1066
|
});
|
|
960
1067
|
}
|
|
1068
|
+
function removeUserAccount(tx, args, published_at) {
|
|
1069
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
1070
|
+
return tx.moveCall({
|
|
1071
|
+
target: "".concat(published_at, "::trading::remove_user_account"),
|
|
1072
|
+
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.marketIndex, "u64"), (0, util_1.obj)(tx, args.userAccountCap)],
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
961
1075
|
function resumeMarket(tx, args, published_at) {
|
|
962
1076
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
963
1077
|
return tx.moveCall({
|
|
@@ -973,6 +1087,14 @@ function resumeTradingSymbol(tx, typeArg, args, published_at) {
|
|
|
973
1087
|
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.marketIndex, "u64")],
|
|
974
1088
|
});
|
|
975
1089
|
}
|
|
1090
|
+
function returnToUser(tx, typeArg, args, published_at) {
|
|
1091
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
1092
|
+
return tx.moveCall({
|
|
1093
|
+
target: "".concat(published_at, "::trading::return_to_user"),
|
|
1094
|
+
typeArguments: [typeArg],
|
|
1095
|
+
arguments: [(0, util_1.obj)(tx, args.marketId), (0, util_1.obj)(tx, args.balance), (0, util_1.pure)(tx, args.user, "address")],
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
976
1098
|
function settleReceiptCollateral(tx, typeArgs, args, published_at) {
|
|
977
1099
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
978
1100
|
return tx.moveCall({
|
|
@@ -1080,3 +1202,17 @@ function updateProtocolFeeShareBp(tx, args, published_at) {
|
|
|
1080
1202
|
],
|
|
1081
1203
|
});
|
|
1082
1204
|
}
|
|
1205
|
+
function withdrawUserAccount(tx, typeArg, args, published_at) {
|
|
1206
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
1207
|
+
return tx.moveCall({
|
|
1208
|
+
target: "".concat(published_at, "::trading::withdraw_user_account"),
|
|
1209
|
+
typeArguments: [typeArg],
|
|
1210
|
+
arguments: [
|
|
1211
|
+
(0, util_1.obj)(tx, args.version),
|
|
1212
|
+
(0, util_1.obj)(tx, args.registry),
|
|
1213
|
+
(0, util_1.pure)(tx, args.marketIndex, "u64"),
|
|
1214
|
+
(0, util_1.pure)(tx, args.amount, "".concat(structs_1.Option.$typeName, "<u64>")),
|
|
1215
|
+
(0, util_1.obj)(tx, args.userAccountCap),
|
|
1216
|
+
],
|
|
1217
|
+
});
|
|
1218
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Transaction, TransactionArgument, TransactionObjectInput } from "@mysten/sui/transactions";
|
|
2
|
+
export interface AddDelegateUserArgs {
|
|
3
|
+
userAccount: TransactionObjectInput;
|
|
4
|
+
user: string | TransactionArgument;
|
|
5
|
+
}
|
|
6
|
+
export declare function addDelegateUser(tx: Transaction, args: AddDelegateUserArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
7
|
+
export declare function checkOwner(tx: Transaction, userAccount: TransactionObjectInput, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
8
|
+
export interface DepositArgs {
|
|
9
|
+
userAccount: TransactionObjectInput;
|
|
10
|
+
balance: TransactionObjectInput;
|
|
11
|
+
}
|
|
12
|
+
export declare function deposit(tx: Transaction, typeArg: string, args: DepositArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
13
|
+
export interface GetMutUserAccountArgs {
|
|
14
|
+
marketId: TransactionObjectInput;
|
|
15
|
+
user: string | TransactionArgument;
|
|
16
|
+
}
|
|
17
|
+
export declare function getMutUserAccount(tx: Transaction, args: GetMutUserAccountArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
18
|
+
export declare function getUserAccountOwner(tx: Transaction, userAccountCap: TransactionObjectInput, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
19
|
+
export interface HasUserAccountArgs {
|
|
20
|
+
marketId: TransactionObjectInput;
|
|
21
|
+
user: string | TransactionArgument;
|
|
22
|
+
}
|
|
23
|
+
export declare function hasUserAccount(tx: Transaction, args: HasUserAccountArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
24
|
+
export declare function newUserAccount(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
25
|
+
export interface RemoveUserAccountArgs {
|
|
26
|
+
marketId: TransactionObjectInput;
|
|
27
|
+
user: string | TransactionArgument;
|
|
28
|
+
userAccountCap: TransactionObjectInput;
|
|
29
|
+
}
|
|
30
|
+
export declare function removeUserAccount(tx: Transaction, args: RemoveUserAccountArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
31
|
+
export interface WithdrawArgs {
|
|
32
|
+
userAccount: TransactionObjectInput;
|
|
33
|
+
amount: bigint | TransactionArgument | TransactionArgument | null;
|
|
34
|
+
userAccountCap: TransactionObjectInput;
|
|
35
|
+
}
|
|
36
|
+
export declare function withdraw(tx: Transaction, typeArg: string, args: WithdrawArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addDelegateUser = addDelegateUser;
|
|
4
|
+
exports.checkOwner = checkOwner;
|
|
5
|
+
exports.deposit = deposit;
|
|
6
|
+
exports.getMutUserAccount = getMutUserAccount;
|
|
7
|
+
exports.getUserAccountOwner = getUserAccountOwner;
|
|
8
|
+
exports.hasUserAccount = hasUserAccount;
|
|
9
|
+
exports.newUserAccount = newUserAccount;
|
|
10
|
+
exports.removeUserAccount = removeUserAccount;
|
|
11
|
+
exports.withdraw = withdraw;
|
|
12
|
+
var __1 = require("..");
|
|
13
|
+
var structs_1 = require("../../_dependencies/source/0x1/option/structs");
|
|
14
|
+
var util_1 = require("../../_framework/util");
|
|
15
|
+
function addDelegateUser(tx, args, published_at) {
|
|
16
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
17
|
+
return tx.moveCall({
|
|
18
|
+
target: "".concat(published_at, "::user_account::add_delegate_user"),
|
|
19
|
+
arguments: [(0, util_1.obj)(tx, args.userAccount), (0, util_1.pure)(tx, args.user, "address")],
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function checkOwner(tx, userAccount, published_at) {
|
|
23
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
24
|
+
return tx.moveCall({ target: "".concat(published_at, "::user_account::check_owner"), arguments: [(0, util_1.obj)(tx, userAccount)] });
|
|
25
|
+
}
|
|
26
|
+
function deposit(tx, typeArg, args, published_at) {
|
|
27
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
28
|
+
return tx.moveCall({
|
|
29
|
+
target: "".concat(published_at, "::user_account::deposit"),
|
|
30
|
+
typeArguments: [typeArg],
|
|
31
|
+
arguments: [(0, util_1.obj)(tx, args.userAccount), (0, util_1.obj)(tx, args.balance)],
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function getMutUserAccount(tx, args, published_at) {
|
|
35
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
36
|
+
return tx.moveCall({
|
|
37
|
+
target: "".concat(published_at, "::user_account::get_mut_user_account"),
|
|
38
|
+
arguments: [(0, util_1.obj)(tx, args.marketId), (0, util_1.pure)(tx, args.user, "address")],
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function getUserAccountOwner(tx, userAccountCap, published_at) {
|
|
42
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
43
|
+
return tx.moveCall({ target: "".concat(published_at, "::user_account::get_user_account_owner"), arguments: [(0, util_1.obj)(tx, userAccountCap)] });
|
|
44
|
+
}
|
|
45
|
+
function hasUserAccount(tx, args, published_at) {
|
|
46
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
47
|
+
return tx.moveCall({
|
|
48
|
+
target: "".concat(published_at, "::user_account::has_user_account"),
|
|
49
|
+
arguments: [(0, util_1.obj)(tx, args.marketId), (0, util_1.pure)(tx, args.user, "address")],
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function newUserAccount(tx, published_at) {
|
|
53
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
54
|
+
return tx.moveCall({ target: "".concat(published_at, "::user_account::new_user_account"), arguments: [] });
|
|
55
|
+
}
|
|
56
|
+
function removeUserAccount(tx, args, published_at) {
|
|
57
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
58
|
+
return tx.moveCall({
|
|
59
|
+
target: "".concat(published_at, "::user_account::remove_user_account"),
|
|
60
|
+
arguments: [(0, util_1.obj)(tx, args.marketId), (0, util_1.pure)(tx, args.user, "address"), (0, util_1.obj)(tx, args.userAccountCap)],
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function withdraw(tx, typeArg, args, published_at) {
|
|
64
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
65
|
+
return tx.moveCall({
|
|
66
|
+
target: "".concat(published_at, "::user_account::withdraw"),
|
|
67
|
+
typeArguments: [typeArg],
|
|
68
|
+
arguments: [(0, util_1.obj)(tx, args.userAccount), (0, util_1.pure)(tx, args.amount, "".concat(structs_1.Option.$typeName, "<u64>")), (0, util_1.obj)(tx, args.userAccountCap)],
|
|
69
|
+
});
|
|
70
|
+
}
|