@typus/typus-perp-sdk 1.1.32-codegen-exp7 → 1.1.32-codegen-exp9
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/client.js +34 -3
- package/dist/src/fetch.d.ts +2 -2
- package/dist/src/fetch.js +42 -40
- package/dist/src/generated/typus_perp/admin.d.ts +158 -1
- package/dist/src/generated/typus_perp/admin.js +211 -0
- package/dist/src/generated/typus_perp/competition.d.ts +39 -1
- package/dist/src/generated/typus_perp/competition.js +46 -0
- package/dist/src/generated/typus_perp/deps/sui/table.d.ts +31 -0
- package/dist/src/generated/typus_perp/{tlp.js → deps/sui/table.js} +28 -13
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +0 -8
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +3 -11
- package/dist/src/generated/typus_perp/error.d.ts +443 -0
- package/dist/src/generated/typus_perp/error.js +788 -0
- package/dist/src/generated/typus_perp/escrow.d.ts +51 -1
- package/dist/src/generated/typus_perp/escrow.js +63 -0
- package/dist/src/generated/typus_perp/lp_pool.d.ts +2 -476
- package/dist/src/generated/typus_perp/lp_pool.js +19 -492
- package/dist/src/generated/typus_perp/position.d.ts +1016 -1
- package/dist/src/generated/typus_perp/position.js +1187 -0
- package/dist/src/generated/typus_perp/profit_vault.d.ts +272 -0
- package/dist/src/generated/typus_perp/profit_vault.js +321 -0
- package/dist/src/generated/typus_perp/symbol.d.ts +30 -1
- package/dist/src/generated/typus_perp/symbol.js +42 -0
- package/dist/src/generated/typus_perp/trading.d.ts +56 -418
- package/dist/src/generated/typus_perp/trading.js +124 -552
- package/dist/src/generated/typus_perp/treasury_caps.d.ts +32 -1
- package/dist/src/generated/typus_perp/treasury_caps.js +40 -0
- package/dist/src/generated/typus_perp/user_account.d.ts +107 -1
- package/dist/src/generated/typus_perp/user_account.js +149 -0
- package/dist/src/generated/typus_stake_pool/admin.d.ts +9 -25
- package/dist/src/generated/typus_stake_pool/admin.js +11 -36
- package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +56 -4
- package/dist/src/generated/typus_stake_pool/stake_pool.js +68 -4
- package/dist/src/generated/utils/index.js +3 -0
- package/dist/src/grpc/graphql.d.ts +6 -6
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +13 -19
- package/dist/src/user/order.js +1 -6
- package/dist/src/user/orderWithBidReceipt.js +3 -3
- package/package.json +2 -2
- package/dist/src/generated/typus_perp/lending.d.ts +0 -47
- package/dist/src/generated/typus_perp/lending.js +0 -50
- package/dist/src/generated/typus_perp/tlp.d.ts +0 -13
|
@@ -33,11 +33,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.HarvestPerUserShareEvent = exports.UnstakeEvent = exports.UnsubscribeEvent = exports.SnapshotEvent = exports.UpdatePoolInfoU64PaddingEvent = exports.StakeEvent = exports.WithdrawIncentiveEvent = exports.DepositIncentiveEvent = exports.UpdateIncentiveConfigEvent = exports.UpdateUnlockCountdownTsMsEvent = exports.RemoveIncentiveTokenEvent = exports.ActivateIncentiveTokenEvent = exports.DeactivateIncentiveTokenEvent = exports.AddIncentiveTokenEvent = exports.AutoCompoundEvent = exports.NewStakePoolEvent = exports.LpUserShare = exports.DeactivatingShares = exports.StakePool = exports.Incentive = exports.IncentiveInfo = exports.IncentiveConfig = exports.StakePoolConfig = exports.StakePoolInfo = exports.StakePoolRegistry = void 0;
|
|
36
|
+
exports.HarvestPerUserShareEvent = exports.UnstakeEvent = exports.UnsubscribeEvent = exports.SnapshotEvent = exports.UpdatePoolInfoU64PaddingEvent = exports.StakeEvent = exports.WithdrawIncentiveEvent = exports.DepositIncentiveEvent = exports.UpdateIncentiveConfigEvent = exports.UpdateUnlockCountdownTsMsEvent = exports.RemoveIncentiveTokenEvent = exports.ActivateIncentiveTokenEvent = exports.DeactivateIncentiveTokenEvent = exports.ActivateStakePoolEvent = exports.DeactivateStakePoolEvent = exports.AddIncentiveTokenEvent = exports.AutoCompoundEvent = exports.NewStakePoolEvent = exports.LpUserShare = exports.DeactivatingShares = exports.StakePool = exports.Incentive = exports.IncentiveInfo = exports.IncentiveConfig = exports.StakePoolConfig = exports.StakePoolInfo = exports.StakePoolRegistry = void 0;
|
|
37
37
|
exports.init = init;
|
|
38
38
|
exports.newStakePool = newStakePool;
|
|
39
39
|
exports.autoCompound = autoCompound;
|
|
40
40
|
exports.addIncentiveToken = addIncentiveToken;
|
|
41
|
+
exports.deactivateStakePool = deactivateStakePool;
|
|
42
|
+
exports.activateStakePool = activateStakePool;
|
|
41
43
|
exports.deactivateIncentiveToken = deactivateIncentiveToken;
|
|
42
44
|
exports.activateIncentiveToken = activateIncentiveToken;
|
|
43
45
|
exports.removeIncentiveToken = removeIncentiveToken;
|
|
@@ -45,7 +47,7 @@ exports.updateUnlockCountdownTsMs = updateUnlockCountdownTsMs;
|
|
|
45
47
|
exports.updateIncentiveConfig = updateIncentiveConfig;
|
|
46
48
|
exports.allocateIncentive = allocateIncentive;
|
|
47
49
|
exports.depositIncentive = depositIncentive;
|
|
48
|
-
exports.
|
|
50
|
+
exports.withdrawIncentive = withdrawIncentive;
|
|
49
51
|
exports.stake = stake;
|
|
50
52
|
exports.updatePoolInfoU64Padding = updatePoolInfoU64Padding;
|
|
51
53
|
exports.snapshot = snapshot;
|
|
@@ -66,6 +68,7 @@ exports.getIncentive = getIncentive;
|
|
|
66
68
|
exports.getMutIncentive = getMutIncentive;
|
|
67
69
|
exports.removeIncentive = removeIncentive;
|
|
68
70
|
exports.getLastIncentivePriceIndex = getLastIncentivePriceIndex;
|
|
71
|
+
exports.checkStakePoolActive = checkStakePoolActive;
|
|
69
72
|
/**************************************************************
|
|
70
73
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
71
74
|
**************************************************************/
|
|
@@ -241,6 +244,22 @@ exports.AddIncentiveTokenEvent = new index_1.MoveStruct({
|
|
|
241
244
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
242
245
|
},
|
|
243
246
|
});
|
|
247
|
+
exports.DeactivateStakePoolEvent = new index_1.MoveStruct({
|
|
248
|
+
name: `${$moduleName}::DeactivateStakePoolEvent`,
|
|
249
|
+
fields: {
|
|
250
|
+
sender: bcs_1.bcs.Address,
|
|
251
|
+
index: bcs_1.bcs.u64(),
|
|
252
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
exports.ActivateStakePoolEvent = new index_1.MoveStruct({
|
|
256
|
+
name: `${$moduleName}::ActivateStakePoolEvent`,
|
|
257
|
+
fields: {
|
|
258
|
+
sender: bcs_1.bcs.Address,
|
|
259
|
+
index: bcs_1.bcs.u64(),
|
|
260
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
261
|
+
},
|
|
262
|
+
});
|
|
244
263
|
exports.DeactivateIncentiveTokenEvent = new index_1.MoveStruct({
|
|
245
264
|
name: `${$moduleName}::DeactivateIncentiveTokenEvent`,
|
|
246
265
|
fields: {
|
|
@@ -444,6 +463,38 @@ function addIncentiveToken(options) {
|
|
|
444
463
|
typeArguments: options.typeArguments,
|
|
445
464
|
});
|
|
446
465
|
}
|
|
466
|
+
/** [Authorized Function] Activates a stake pool. */
|
|
467
|
+
function deactivateStakePool(options) {
|
|
468
|
+
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
469
|
+
const argumentsTypes = [
|
|
470
|
+
`${packageAddress}::admin::Version`,
|
|
471
|
+
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
472
|
+
"u64",
|
|
473
|
+
];
|
|
474
|
+
const parameterNames = ["version", "registry", "index"];
|
|
475
|
+
return (tx) => tx.moveCall({
|
|
476
|
+
package: packageAddress,
|
|
477
|
+
module: "stake_pool",
|
|
478
|
+
function: "deactivate_stake_pool",
|
|
479
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
/** [Authorized Function] Activates a stake pool. */
|
|
483
|
+
function activateStakePool(options) {
|
|
484
|
+
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
485
|
+
const argumentsTypes = [
|
|
486
|
+
`${packageAddress}::admin::Version`,
|
|
487
|
+
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
488
|
+
"u64",
|
|
489
|
+
];
|
|
490
|
+
const parameterNames = ["version", "registry", "index"];
|
|
491
|
+
return (tx) => tx.moveCall({
|
|
492
|
+
package: packageAddress,
|
|
493
|
+
module: "stake_pool",
|
|
494
|
+
function: "activate_stake_pool",
|
|
495
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
496
|
+
});
|
|
497
|
+
}
|
|
447
498
|
/** [Authorized Function] Deactivates an incentive token. */
|
|
448
499
|
function deactivateIncentiveToken(options) {
|
|
449
500
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
@@ -451,6 +502,7 @@ function deactivateIncentiveToken(options) {
|
|
|
451
502
|
`${packageAddress}::admin::Version`,
|
|
452
503
|
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
453
504
|
"u64",
|
|
505
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
454
506
|
];
|
|
455
507
|
const parameterNames = ["version", "registry", "index"];
|
|
456
508
|
return (tx) => tx.moveCall({
|
|
@@ -468,6 +520,7 @@ function activateIncentiveToken(options) {
|
|
|
468
520
|
`${packageAddress}::admin::Version`,
|
|
469
521
|
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
470
522
|
"u64",
|
|
523
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
471
524
|
];
|
|
472
525
|
const parameterNames = ["version", "registry", "index"];
|
|
473
526
|
return (tx) => tx.moveCall({
|
|
@@ -569,7 +622,7 @@ function depositIncentive(options) {
|
|
|
569
622
|
});
|
|
570
623
|
}
|
|
571
624
|
/** [Authorized Function] Withdraws incentive tokens. */
|
|
572
|
-
function
|
|
625
|
+
function withdrawIncentive(options) {
|
|
573
626
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
574
627
|
const argumentsTypes = [
|
|
575
628
|
`${packageAddress}::admin::Version`,
|
|
@@ -582,7 +635,7 @@ function withdrawIncentiveV2(options) {
|
|
|
582
635
|
return (tx) => tx.moveCall({
|
|
583
636
|
package: packageAddress,
|
|
584
637
|
module: "stake_pool",
|
|
585
|
-
function: "
|
|
638
|
+
function: "withdraw_incentive",
|
|
586
639
|
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
587
640
|
typeArguments: options.typeArguments,
|
|
588
641
|
});
|
|
@@ -872,3 +925,14 @@ function getLastIncentivePriceIndex(options) {
|
|
|
872
925
|
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
873
926
|
});
|
|
874
927
|
}
|
|
928
|
+
function checkStakePoolActive(options) {
|
|
929
|
+
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
930
|
+
const argumentsTypes = [`${packageAddress}::stake_pool::StakePool`];
|
|
931
|
+
const parameterNames = ["stakePool"];
|
|
932
|
+
return (tx) => tx.moveCall({
|
|
933
|
+
package: packageAddress,
|
|
934
|
+
module: "stake_pool",
|
|
935
|
+
function: "check_stake_pool_active",
|
|
936
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
937
|
+
});
|
|
938
|
+
}
|
|
@@ -94,6 +94,9 @@ function normalizeMoveArguments(args, argTypes, parameterNames) {
|
|
|
94
94
|
}
|
|
95
95
|
const name = parameterNames[index];
|
|
96
96
|
arg = args[name];
|
|
97
|
+
if (arg === undefined) {
|
|
98
|
+
throw new Error(`Parameter ${name} is required`);
|
|
99
|
+
}
|
|
97
100
|
}
|
|
98
101
|
index += 1;
|
|
99
102
|
if (typeof arg === "function" || (0, transactions_1.isArgument)(arg)) {
|
|
@@ -8,6 +8,12 @@ export declare function getDynamicFields(gqlClient: SuiGraphQLClient, id: string
|
|
|
8
8
|
json: unknown;
|
|
9
9
|
} | null;
|
|
10
10
|
value: {
|
|
11
|
+
__typename: "MoveValue";
|
|
12
|
+
type: {
|
|
13
|
+
repr: string;
|
|
14
|
+
} | null;
|
|
15
|
+
json: unknown;
|
|
16
|
+
} | {
|
|
11
17
|
__typename: "MoveObject";
|
|
12
18
|
contents: {
|
|
13
19
|
type: {
|
|
@@ -15,12 +21,6 @@ export declare function getDynamicFields(gqlClient: SuiGraphQLClient, id: string
|
|
|
15
21
|
} | null;
|
|
16
22
|
json: unknown;
|
|
17
23
|
} | null;
|
|
18
|
-
} | {
|
|
19
|
-
__typename: "MoveValue";
|
|
20
|
-
type: {
|
|
21
|
-
repr: string;
|
|
22
|
-
} | null;
|
|
23
|
-
json: unknown;
|
|
24
24
|
} | null;
|
|
25
25
|
}[];
|
|
26
26
|
} | null | undefined>;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,10 +3,8 @@ export * from "./user";
|
|
|
3
3
|
export declare const NETWORK: string;
|
|
4
4
|
export declare const PERP_PACKAGE_ID: string;
|
|
5
5
|
export declare const PERP_PUBLISHED_AT: string;
|
|
6
|
-
export declare const PERP_PKG_V1: string;
|
|
7
6
|
export declare const STAKE_PACKAGE_ID: string;
|
|
8
7
|
export declare const STAKE_PUBLISHED_AT: string;
|
|
9
|
-
export declare const STAKE_PKG_V1: string;
|
|
10
8
|
export declare const LP_POOL: string;
|
|
11
9
|
export declare const LIQUIDITY_POOL: string;
|
|
12
10
|
export declare const MARKET: string;
|
package/dist/src/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.COMPETITION_CONFIG = exports.STAKE_POOL_VERSION = exports.STAKE_POOL = exports.TLP_TREASURY_CAP = exports.PERP_VERSION = exports.MARKET = exports.LIQUIDITY_POOL = exports.LP_POOL = exports.
|
|
20
|
+
exports.COMPETITION_CONFIG = exports.STAKE_POOL_VERSION = exports.STAKE_POOL = exports.TLP_TREASURY_CAP = exports.PERP_VERSION = exports.MARKET = exports.LIQUIDITY_POOL = exports.LP_POOL = exports.STAKE_PUBLISHED_AT = exports.STAKE_PACKAGE_ID = exports.PERP_PUBLISHED_AT = exports.PERP_PACKAGE_ID = exports.NETWORK = void 0;
|
|
21
21
|
__exportStar(require("./fetch"), exports);
|
|
22
22
|
__exportStar(require("./user"), exports);
|
|
23
23
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
@@ -27,47 +27,41 @@ dotenv_1.default.config();
|
|
|
27
27
|
exports.NETWORK = process.env.NEXT_PUBLIC_CLUSTER == "testnet" ? "TESTNET" : "MAINNET";
|
|
28
28
|
exports.PERP_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
29
29
|
? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
|
|
30
|
-
: "
|
|
30
|
+
: "0x94cd358f552e9dd5df837de85939a9d1d682e97480740a203121e6f4c0078853";
|
|
31
31
|
exports.PERP_PUBLISHED_AT = exports.NETWORK == "MAINNET"
|
|
32
32
|
? "0x9eda9afa0b42bf908766c42d02a549c271d7d0ae02c8c58c5075858f8f4d3b69"
|
|
33
|
-
: "
|
|
34
|
-
exports.PERP_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
35
|
-
? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
|
|
36
|
-
: "0x29d1dcc803ec1cc1b4c98a8c818c655ecf432ebd2f85757bffc21806d329e240";
|
|
33
|
+
: "0x7adddfb77658ff43ad0281e264fdb43403a1b97bc2f6328b55279dfb4253e1e0";
|
|
37
34
|
exports.STAKE_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
38
35
|
? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
|
|
39
|
-
: "
|
|
36
|
+
: "0x02b94b340a8810f6c451bc244dc2dd8d9d50cf86d727798969ca2c287c3186aa";
|
|
40
37
|
exports.STAKE_PUBLISHED_AT = exports.NETWORK == "MAINNET"
|
|
41
38
|
? "0xdf96424bc1ba70a6e53c07b2b55c597eccb8a21f722a917a5b4c9d8514b2d858"
|
|
42
|
-
: "
|
|
43
|
-
exports.STAKE_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
44
|
-
? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
|
|
45
|
-
: "0xa59d5f571a6f57ee5faf842ec633245afb78ca3721b8b1194052c69ad6a12230";
|
|
39
|
+
: "0x02b94b340a8810f6c451bc244dc2dd8d9d50cf86d727798969ca2c287c3186aa";
|
|
46
40
|
// lp_pool::Registry
|
|
47
41
|
exports.LP_POOL = exports.NETWORK == "MAINNET"
|
|
48
42
|
? "0xfee68e535bf24702be28fa38ea2d5946e617e0035027d5ca29dbed99efd82aaa"
|
|
49
|
-
: "
|
|
43
|
+
: "0x85fa3cc6dc0fa8b47dda95ba0335fe1cec61dde4a2a8486ccd040f94d399b4c3";
|
|
50
44
|
// liquidity_pool_registry
|
|
51
45
|
exports.LIQUIDITY_POOL = exports.NETWORK == "MAINNET"
|
|
52
46
|
? "0x9973b7dd68ab8ba18702d913191a4c62c597847d9cd9f0b5bd97f1b938fc9a0a"
|
|
53
|
-
: "
|
|
47
|
+
: "0xe034d157764f273df5a1e264a3c0f78d8f922c37f942c340dabb1d66244c72ba";
|
|
54
48
|
// MarketRegistry
|
|
55
49
|
exports.MARKET = exports.NETWORK == "MAINNET"
|
|
56
50
|
? "0xc969d946a2b6b917a83b5fb71765793c4a52149e50d2c8cf5c01d7421fc7cd73"
|
|
57
|
-
: "
|
|
51
|
+
: "0xd0685e3eca9530f0618625d4a617a80db09f000609285b32a85f863da6baf811";
|
|
58
52
|
exports.PERP_VERSION = exports.NETWORK == "MAINNET"
|
|
59
53
|
? "0xa12c282a068328833ec4a9109fc77803ec1f523f8da1bb0f82bac8450335f0c9"
|
|
60
|
-
: "
|
|
54
|
+
: "0xbb0615832168e64e301db2ebd6ad71b3fe170d7e217ccd0c08714de56b41676b";
|
|
61
55
|
exports.TLP_TREASURY_CAP = exports.NETWORK == "MAINNET"
|
|
62
56
|
? "0x77c75fb1d78cca25b5e2d69decfe2837abf95c4ef44b809868e6ca20f42b63bc"
|
|
63
|
-
: "
|
|
57
|
+
: "0x1b39c2a5bc109ac520787c62f924da9244343e869bad755157e6e3e22bd7b7ae";
|
|
64
58
|
// StakePoolRegistry
|
|
65
59
|
exports.STAKE_POOL = exports.NETWORK == "MAINNET"
|
|
66
60
|
? "0x2cdf93717f87a8a7aeb98b27777b3b643f0ae2b277f44e6bcda0fc655a47d3e0"
|
|
67
|
-
: "
|
|
61
|
+
: "0x8e5e5435c3fcd77f07cf097c5fbd381af7c2b394420ea035685662215471e578";
|
|
68
62
|
exports.STAKE_POOL_VERSION = exports.NETWORK == "MAINNET"
|
|
69
63
|
? "0xdf3ed1599218b2415b2cd7fa06296f7f647676019b2873ec18e55a626c584f1b"
|
|
70
|
-
: "
|
|
64
|
+
: "0x02b94b340a8810f6c451bc244dc2dd8d9d50cf86d727798969ca2c287c3186aa";
|
|
71
65
|
exports.COMPETITION_CONFIG = exports.NETWORK == "MAINNET"
|
|
72
66
|
? "0x36056abf9adde86f81667dad680a8ac98868c9fc1cb4d519fd2222d5d4522906"
|
|
73
|
-
: "
|
|
67
|
+
: "0x2b811b120177839555aabdc2c28b28078170e663e855d29aa9072013d4fc918d";
|
package/dist/src/user/order.js
CHANGED
|
@@ -47,7 +47,7 @@ async function createTradingOrder(client, tx, input) {
|
|
|
47
47
|
for (let token of tokens) {
|
|
48
48
|
(0, utils_1.updateOracleWithPythUsd)(client.pythClient, tx, client.config.package.oracle, token);
|
|
49
49
|
}
|
|
50
|
-
tx.add((0, trading_1.
|
|
50
|
+
tx.add((0, trading_1.createTradingOrder)({
|
|
51
51
|
arguments: {
|
|
52
52
|
version: __1.PERP_VERSION,
|
|
53
53
|
registry: __1.MARKET,
|
|
@@ -56,9 +56,6 @@ async function createTradingOrder(client, tx, input) {
|
|
|
56
56
|
poolIndex: BigInt(input.perpIndex),
|
|
57
57
|
typusOracleCToken: constants_1.oracle[__1.NETWORK][TOKEN],
|
|
58
58
|
typusOracleTradingSymbol: constants_1.oracle[__1.NETWORK][BASE_TOKEN],
|
|
59
|
-
typusEcosystemVersion: client.config.version.typus,
|
|
60
|
-
typusUserRegistry: client.config.registry.typus.user,
|
|
61
|
-
typusLeaderboardRegistry: client.config.registry.typus.leaderboard,
|
|
62
59
|
collateral: coin,
|
|
63
60
|
size: BigInt(input.size),
|
|
64
61
|
triggerPrice: BigInt(input.triggerPrice),
|
|
@@ -66,8 +63,6 @@ async function createTradingOrder(client, tx, input) {
|
|
|
66
63
|
isStopOrder: input.isStopOrder,
|
|
67
64
|
reduceOnly: input.reduceOnly,
|
|
68
65
|
linkedPositionId: input.linkedPositionId ? BigInt(input.linkedPositionId) : null,
|
|
69
|
-
tailsStakingRegistry: client.config.registry.typus.tailsStaking,
|
|
70
|
-
competitionConfig: __1.COMPETITION_CONFIG,
|
|
71
66
|
},
|
|
72
67
|
typeArguments: [cToken, baseToken],
|
|
73
68
|
}));
|
|
@@ -31,7 +31,7 @@ async function createTradingOrderWithBidReceiptByAutoBid(client, tx, input) {
|
|
|
31
31
|
let cToken = constants_1.tokenType[__1.NETWORK][TOKEN];
|
|
32
32
|
let bToken = constants_1.tokenType[__1.NETWORK][input.bToken];
|
|
33
33
|
let baseToken = constants_1.tokenType[__1.NETWORK][BASE_TOKEN];
|
|
34
|
-
tx.add((0, trading_1.
|
|
34
|
+
tx.add((0, trading_1.createTradingOrderWithBidReceipt)({
|
|
35
35
|
arguments: {
|
|
36
36
|
version: __1.PERP_VERSION,
|
|
37
37
|
registry: __1.MARKET,
|
|
@@ -76,7 +76,7 @@ async function createTradingOrderWithBidReceipt(client, tx, input) {
|
|
|
76
76
|
let cToken = constants_1.tokenType[__1.NETWORK][TOKEN];
|
|
77
77
|
let bToken = constants_1.tokenType[__1.NETWORK][input.bToken];
|
|
78
78
|
let baseToken = constants_1.tokenType[__1.NETWORK][BASE_TOKEN];
|
|
79
|
-
tx.add((0, trading_1.
|
|
79
|
+
tx.add((0, trading_1.createTradingOrderWithBidReceipt)({
|
|
80
80
|
arguments: {
|
|
81
81
|
version: __1.PERP_VERSION,
|
|
82
82
|
registry: __1.MARKET,
|
|
@@ -113,7 +113,7 @@ async function reduceOptionCollateralPositionSize(client, tx, input) {
|
|
|
113
113
|
let cToken = constants_1.tokenType[__1.NETWORK][TOKEN];
|
|
114
114
|
let bToken = constants_1.tokenType[__1.NETWORK][input.bToken];
|
|
115
115
|
let baseToken = constants_1.tokenType[__1.NETWORK][BASE_TOKEN];
|
|
116
|
-
tx.add((0, trading_1.
|
|
116
|
+
tx.add((0, trading_1.reduceOptionCollateralPositionSize)({
|
|
117
117
|
arguments: {
|
|
118
118
|
version: __1.PERP_VERSION,
|
|
119
119
|
registry: __1.MARKET,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typus/typus-perp-sdk",
|
|
3
|
-
"version": "1.1.32-codegen-
|
|
3
|
+
"version": "1.1.32-codegen-exp9",
|
|
4
4
|
"repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
|
|
5
5
|
"author": "Typus",
|
|
6
6
|
"description": "typus perp sdk",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"url": "https://github.com/Typus-Lab/typus-perp-sdk/issues"
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://github.com/Typus-Lab/typus-perp-sdk#readme",
|
|
46
|
-
"packageManager": "yarn@4.10.3"
|
|
46
|
+
"packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
|
|
47
47
|
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/**
|
|
5
|
-
* The `lending` module provides functions for interacting with the Scallop lending
|
|
6
|
-
* protocol.
|
|
7
|
-
*/
|
|
8
|
-
import { type Transaction } from "@mysten/sui/transactions";
|
|
9
|
-
import { type RawTransactionArgument } from "../utils/index";
|
|
10
|
-
export interface DepositScallopBasicArguments {
|
|
11
|
-
balance: RawTransactionArgument<string>;
|
|
12
|
-
scallopVersion: RawTransactionArgument<string>;
|
|
13
|
-
scallopMarket: RawTransactionArgument<string>;
|
|
14
|
-
}
|
|
15
|
-
export interface DepositScallopBasicOptions {
|
|
16
|
-
package?: string;
|
|
17
|
-
arguments: DepositScallopBasicArguments | [
|
|
18
|
-
balance: RawTransactionArgument<string>,
|
|
19
|
-
scallopVersion: RawTransactionArgument<string>,
|
|
20
|
-
scallopMarket: RawTransactionArgument<string>
|
|
21
|
-
];
|
|
22
|
-
typeArguments: [string];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Deposits a token into the Scallop lending protocol. WARNING: no authority check
|
|
26
|
-
* inside
|
|
27
|
-
*/
|
|
28
|
-
export declare function depositScallopBasic(options: DepositScallopBasicOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
29
|
-
export interface WithdrawScallopBasicArguments {
|
|
30
|
-
marketCoin: RawTransactionArgument<string>;
|
|
31
|
-
scallopVersion: RawTransactionArgument<string>;
|
|
32
|
-
scallopMarket: RawTransactionArgument<string>;
|
|
33
|
-
}
|
|
34
|
-
export interface WithdrawScallopBasicOptions {
|
|
35
|
-
package?: string;
|
|
36
|
-
arguments: WithdrawScallopBasicArguments | [
|
|
37
|
-
marketCoin: RawTransactionArgument<string>,
|
|
38
|
-
scallopVersion: RawTransactionArgument<string>,
|
|
39
|
-
scallopMarket: RawTransactionArgument<string>
|
|
40
|
-
];
|
|
41
|
-
typeArguments: [string];
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Withdraws a token from the Scallop lending protocol. WARNING: no authority check
|
|
45
|
-
* inside
|
|
46
|
-
*/
|
|
47
|
-
export declare function withdrawScallopBasic(options: WithdrawScallopBasicOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**************************************************************
|
|
3
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
4
|
-
**************************************************************/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.depositScallopBasic = depositScallopBasic;
|
|
7
|
-
exports.withdrawScallopBasic = withdrawScallopBasic;
|
|
8
|
-
const index_1 = require("../utils/index");
|
|
9
|
-
/**
|
|
10
|
-
* Deposits a token into the Scallop lending protocol. WARNING: no authority check
|
|
11
|
-
* inside
|
|
12
|
-
*/
|
|
13
|
-
function depositScallopBasic(options) {
|
|
14
|
-
const packageAddress = options.package ?? "@typus/perp";
|
|
15
|
-
const argumentsTypes = [
|
|
16
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
|
|
17
|
-
"0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf::version::Version",
|
|
18
|
-
"0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf::market::Market",
|
|
19
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
20
|
-
];
|
|
21
|
-
const parameterNames = ["balance", "scallopVersion", "scallopMarket"];
|
|
22
|
-
return (tx) => tx.moveCall({
|
|
23
|
-
package: packageAddress,
|
|
24
|
-
module: "lending",
|
|
25
|
-
function: "deposit_scallop_basic",
|
|
26
|
-
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
27
|
-
typeArguments: options.typeArguments,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Withdraws a token from the Scallop lending protocol. WARNING: no authority check
|
|
32
|
-
* inside
|
|
33
|
-
*/
|
|
34
|
-
function withdrawScallopBasic(options) {
|
|
35
|
-
const packageAddress = options.package ?? "@typus/perp";
|
|
36
|
-
const argumentsTypes = [
|
|
37
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf::reserve::MarketCoin<${options.typeArguments[0]}>>`,
|
|
38
|
-
"0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf::version::Version",
|
|
39
|
-
"0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf::market::Market",
|
|
40
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
41
|
-
];
|
|
42
|
-
const parameterNames = ["marketCoin", "scallopVersion", "scallopMarket"];
|
|
43
|
-
return (tx) => tx.moveCall({
|
|
44
|
-
package: packageAddress,
|
|
45
|
-
module: "lending",
|
|
46
|
-
function: "withdraw_scallop_basic",
|
|
47
|
-
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
48
|
-
typeArguments: options.typeArguments,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/** The `tlp` module defines the TLP token and its associated functions. */
|
|
5
|
-
import { MoveStruct } from "../utils/index";
|
|
6
|
-
export declare const LpRegistry: MoveStruct<{
|
|
7
|
-
id: MoveStruct<{
|
|
8
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
9
|
-
}, "0x2::object::UID">;
|
|
10
|
-
}, "@typus/perp::tlp::LpRegistry">;
|
|
11
|
-
export declare const TLP: MoveStruct<{
|
|
12
|
-
dummy_field: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
13
|
-
}, "@typus/perp::tlp::TLP">;
|