@typus/typus-perp-sdk 1.1.31-testnet → 1.1.32-type-test
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/index.js
CHANGED
|
@@ -35,58 +35,59 @@ var plugin = (0, transactions_1.namedPackagesPlugin)({ url: mvrPlugin });
|
|
|
35
35
|
transactions_1.Transaction.registerGlobalSerializationPlugin("namedPackagesPlugin", plugin);
|
|
36
36
|
exports.PERP_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
37
37
|
? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
|
|
38
|
-
: "
|
|
38
|
+
: "0x29d1dcc803ec1cc1b4c98a8c818c655ecf432ebd2f85757bffc21806d329e240";
|
|
39
39
|
exports.PERP_PUBLISHED_AT = exports.NETWORK == "MAINNET" ? "0x9eda9afa0b42bf908766c42d02a549c271d7d0ae02c8c58c5075858f8f4d3b69" : "@typus/perp";
|
|
40
40
|
exports.PERP_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
41
41
|
? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
|
|
42
42
|
: "0x585924f160f83ef16f8927ec117e4d740abb6f4e571ecfa89ff3e973042cb1b9";
|
|
43
43
|
exports.STAKE_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
44
44
|
? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
|
|
45
|
-
: "
|
|
45
|
+
: "0xcfe3d323fec2dde129480328dbcf075bc47bac50f916f33746d74f1c875acd2e";
|
|
46
46
|
exports.STAKE_PUBLISHED_AT = exports.NETWORK == "MAINNET"
|
|
47
47
|
? "0xdf96424bc1ba70a6e53c07b2b55c597eccb8a21f722a917a5b4c9d8514b2d858"
|
|
48
|
-
: "
|
|
48
|
+
: "0xcfe3d323fec2dde129480328dbcf075bc47bac50f916f33746d74f1c875acd2e";
|
|
49
49
|
exports.STAKE_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
50
50
|
? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
|
|
51
51
|
: "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
|
|
52
52
|
// Registry
|
|
53
53
|
exports.LP_POOL = exports.NETWORK == "MAINNET"
|
|
54
54
|
? "0xfee68e535bf24702be28fa38ea2d5946e617e0035027d5ca29dbed99efd82aaa"
|
|
55
|
-
: "
|
|
55
|
+
: "0x351312d71a8834cd978649ef065dc48928eaf07a279566bc93050a89c2b1edae";
|
|
56
56
|
exports.LIQUIDITY_POOL = exports.NETWORK == "MAINNET"
|
|
57
57
|
? "0x9973b7dd68ab8ba18702d913191a4c62c597847d9cd9f0b5bd97f1b938fc9a0a"
|
|
58
|
-
: "
|
|
58
|
+
: "0x185f5713a04a01dbb2ef1ca603177b21c26a8a1f7c3b60b0b94c77c31dd4602d";
|
|
59
59
|
exports.LIQUIDITY_POOL_0 = exports.NETWORK == "MAINNET"
|
|
60
60
|
? "0x98110aae0ffaf294259066380a2d35aba74e42860f1e87ee9c201f471eb3ba03"
|
|
61
|
-
: "
|
|
61
|
+
: "0x310a065075d2d49a09440402fcf8d2238886111c063cddaa4c118b09b1790e5e";
|
|
62
62
|
// MarketRegistry
|
|
63
63
|
exports.MARKET = exports.NETWORK == "MAINNET"
|
|
64
64
|
? "0xc969d946a2b6b917a83b5fb71765793c4a52149e50d2c8cf5c01d7421fc7cd73"
|
|
65
|
-
: "
|
|
65
|
+
: "0x00fdefdaa281113998afe29b3b8906a8f7bfdfc031891da3b9d7ddc08a924919";
|
|
66
66
|
// MARKET_0 = 0x442cc2c27cadaf287a5f4413967b4dacc6532bc9063875efbc7b178e5add3e4e
|
|
67
|
+
// testnet MARKET_0 = 0x7f427b15136ab0f5919e66612ff343f9c34d2733e636c95f6d9563a596a4b6ac
|
|
67
68
|
exports.PERP_VERSION = exports.NETWORK == "MAINNET"
|
|
68
69
|
? "0xa12c282a068328833ec4a9109fc77803ec1f523f8da1bb0f82bac8450335f0c9"
|
|
69
|
-
: "
|
|
70
|
+
: "0xfd3699c86cda99e542e4517dc3ad4d9164806664fcbcc23981ad0d5101b87abd";
|
|
70
71
|
// LpRegistry
|
|
71
72
|
exports.TLP = exports.NETWORK == "MAINNET"
|
|
72
73
|
? "0xc0a8cc0201d202321cd40b3f19fcf4cc88d6b63ceac0de55b08a2ab16f8a721e"
|
|
73
|
-
: "
|
|
74
|
+
: ""; // deprecated in new version TLP
|
|
74
75
|
exports.TLP_TOKEN = exports.NETWORK == "MAINNET"
|
|
75
76
|
? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5::tlp::TLP"
|
|
76
|
-
: "
|
|
77
|
+
: "0xc44ba56ee8f91195facaf7a5a39b5522e0e8268a21b324275757ecc8baaa4e11::itlp_typus::ITLP_TYPUS";
|
|
77
78
|
exports.TLP_TREASURY_CAP = exports.NETWORK == "MAINNET"
|
|
78
79
|
? "0x77c75fb1d78cca25b5e2d69decfe2837abf95c4ef44b809868e6ca20f42b63bc"
|
|
79
|
-
: "
|
|
80
|
+
: "0x118bd86c1885a02c2c8f8bb017b40b4a928d5dad1aa68802158171427f4c19c9";
|
|
80
81
|
// StakePoolRegistry
|
|
81
82
|
exports.STAKE_POOL = exports.NETWORK == "MAINNET"
|
|
82
83
|
? "0x2cdf93717f87a8a7aeb98b27777b3b643f0ae2b277f44e6bcda0fc655a47d3e0"
|
|
83
|
-
: "
|
|
84
|
+
: "0xc48d38a6cd76ac6628ba98f1bdad7ade8d4b5273066aa4408a81e5e00a92363e";
|
|
84
85
|
exports.STAKE_POOL_0 = exports.NETWORK == "MAINNET"
|
|
85
86
|
? "0x5c984987380805fbaaf78f41d8ff1973807b6c85176aa87cf5a58518e0a87418"
|
|
86
|
-
: "
|
|
87
|
+
: "0xce188b7277324a817a91ce1953dd1d71f2dbb4685364caa90eb430c9ac453dc8";
|
|
87
88
|
exports.STAKE_POOL_VERSION = exports.NETWORK == "MAINNET"
|
|
88
89
|
? "0xdf3ed1599218b2415b2cd7fa06296f7f647676019b2873ec18e55a626c584f1b"
|
|
89
|
-
: "
|
|
90
|
+
: "0x138583562f9f8fc6261e8fd752a105eb42c8887f83efaba87b42a757f3d98765";
|
|
90
91
|
exports.COMPETITION_CONFIG = exports.NETWORK == "MAINNET"
|
|
91
92
|
? "0x36056abf9adde86f81667dad680a8ac98868c9fc1cb4d519fd2222d5d4522906"
|
|
92
|
-
: "
|
|
93
|
+
: "0xbb246d6ee24d7c751777d81cbf95ffcfcda26910fecfdcfedab81b2b8e48dfe5";
|
|
@@ -3,6 +3,7 @@ import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../
|
|
|
3
3
|
import { FieldsWithTypes } from "../../_framework/util";
|
|
4
4
|
import { PKG_V1 } from "../index";
|
|
5
5
|
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
6
|
+
import { BcsType, BcsStruct } from "@mysten/sui/bcs";
|
|
6
7
|
export declare function isLpRegistry(type: string): boolean;
|
|
7
8
|
export interface LpRegistryFields {
|
|
8
9
|
id: ToField<UID>;
|
|
@@ -23,10 +24,10 @@ export declare class LpRegistry implements StructClass {
|
|
|
23
24
|
static get r(): import("../../_framework/reified").StructClassReified<LpRegistry, LpRegistryFields>;
|
|
24
25
|
static phantom(): PhantomReified<ToTypeStr<LpRegistry>>;
|
|
25
26
|
static get p(): PhantomReified<"0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5::tlp::LpRegistry" | "0x585924f160f83ef16f8927ec117e4d740abb6f4e571ecfa89ff3e973042cb1b9::tlp::LpRegistry">;
|
|
26
|
-
static get bcs():
|
|
27
|
-
id:
|
|
28
|
-
id:
|
|
29
|
-
bytes:
|
|
27
|
+
static get bcs(): BcsStruct<{
|
|
28
|
+
id: BcsStruct<{
|
|
29
|
+
id: BcsStruct<{
|
|
30
|
+
bytes: BcsType<string, string, string>;
|
|
30
31
|
}, string>;
|
|
31
32
|
}, string>;
|
|
32
33
|
}, string>;
|
|
@@ -67,8 +68,8 @@ export declare class TLP implements StructClass {
|
|
|
67
68
|
static get r(): import("../../_framework/reified").StructClassReified<TLP, TLPFields>;
|
|
68
69
|
static phantom(): PhantomReified<ToTypeStr<TLP>>;
|
|
69
70
|
static get p(): PhantomReified<"0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5::tlp::TLP" | "0x585924f160f83ef16f8927ec117e4d740abb6f4e571ecfa89ff3e973042cb1b9::tlp::TLP">;
|
|
70
|
-
static get bcs():
|
|
71
|
-
dummy_field:
|
|
71
|
+
static get bcs(): BcsStruct<{
|
|
72
|
+
dummy_field: BcsType<boolean, boolean, "bool">;
|
|
72
73
|
}, string>;
|
|
73
74
|
static fromFields(fields: Record<string, any>): TLP;
|
|
74
75
|
static fromFieldsWithTypes(item: FieldsWithTypes): TLP;
|
|
@@ -87,3 +88,34 @@ export declare class TLP implements StructClass {
|
|
|
87
88
|
static fromSuiObjectData(data: SuiObjectData): TLP;
|
|
88
89
|
static fetch(client: SuiClient, id: string): Promise<TLP>;
|
|
89
90
|
}
|
|
91
|
+
export declare class MoveStruct<T extends Record<string, BcsType<any>>, const Name extends string = string> extends BcsStruct<T, Name> {
|
|
92
|
+
}
|
|
93
|
+
export type UnsettledBidReceiptType = typeof UnsettledBidReceipt.$inferType;
|
|
94
|
+
export declare const UnsettledBidReceipt: MoveStruct<{
|
|
95
|
+
/** A vector of `TypusBidReceipt` structs. */
|
|
96
|
+
receipt: BcsType<boolean[], Iterable<boolean> & {
|
|
97
|
+
length: number;
|
|
98
|
+
}, string>;
|
|
99
|
+
/** The ID of the position. */
|
|
100
|
+
position_id: BcsType<string, string | number | bigint, "u64">;
|
|
101
|
+
/** The address of the user. */
|
|
102
|
+
user: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
103
|
+
/** A vector of the token types. */
|
|
104
|
+
token_types: BcsType<boolean[], Iterable<boolean> & {
|
|
105
|
+
length: number;
|
|
106
|
+
}, string>;
|
|
107
|
+
/** The sign of the unrealized PNL. */
|
|
108
|
+
unrealized_pnl_sign: BcsType<boolean, boolean, "bool">;
|
|
109
|
+
/** The unrealized PNL. */
|
|
110
|
+
unrealized_pnl: BcsType<string, string | number | bigint, "u64">;
|
|
111
|
+
/** The unrealized trading fee. */
|
|
112
|
+
unrealized_trading_fee: BcsType<string, string | number | bigint, "u64">;
|
|
113
|
+
/** The unrealized borrow fee. */
|
|
114
|
+
unrealized_borrow_fee: BcsType<string, string | number | bigint, "u64">;
|
|
115
|
+
/** The sign of the unrealized funding fee. */
|
|
116
|
+
unrealized_funding_fee_sign: BcsType<boolean, boolean, "bool">;
|
|
117
|
+
/** The unrealized funding fee. */
|
|
118
|
+
unrealized_funding_fee: BcsType<string, string | number | bigint, "u64">;
|
|
119
|
+
/** The unrealized liquidator fee. */
|
|
120
|
+
unrealized_liquidator_fee: BcsType<string, string | number | bigint, "u64">;
|
|
121
|
+
}, "@typus/perp::escrow::UnsettledBidReceipt">;
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
var __assign = (this && this.__assign) || function () {
|
|
3
18
|
__assign = Object.assign || function(t) {
|
|
4
19
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -72,15 +87,15 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
72
87
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
73
88
|
};
|
|
74
89
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
|
-
exports.TLP = exports.LpRegistry = void 0;
|
|
90
|
+
exports.UnsettledBidReceipt = exports.MoveStruct = exports.TLP = exports.LpRegistry = void 0;
|
|
76
91
|
exports.isLpRegistry = isLpRegistry;
|
|
77
92
|
exports.isTLP = isTLP;
|
|
78
93
|
var structs_1 = require("../../_dependencies/source/0x2/object/structs");
|
|
79
94
|
var reified_1 = require("../../_framework/reified");
|
|
80
95
|
var util_1 = require("../../_framework/util");
|
|
81
96
|
var index_1 = require("../index");
|
|
82
|
-
var bcs_1 = require("@mysten/sui/bcs");
|
|
83
97
|
var utils_1 = require("@mysten/sui/utils");
|
|
98
|
+
var bcs_1 = require("@mysten/sui/bcs");
|
|
84
99
|
/* ============================== LpRegistry =============================== */
|
|
85
100
|
function isLpRegistry(type) {
|
|
86
101
|
type = (0, util_1.compressSuiType)(type);
|
|
@@ -363,3 +378,39 @@ var TLP = /** @class */ (function () {
|
|
|
363
378
|
return TLP;
|
|
364
379
|
}());
|
|
365
380
|
exports.TLP = TLP;
|
|
381
|
+
var $moduleName = "@typus/perp::escrow";
|
|
382
|
+
var MoveStruct = /** @class */ (function (_super) {
|
|
383
|
+
__extends(MoveStruct, _super);
|
|
384
|
+
function MoveStruct() {
|
|
385
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
386
|
+
}
|
|
387
|
+
return MoveStruct;
|
|
388
|
+
}(bcs_1.BcsStruct));
|
|
389
|
+
exports.MoveStruct = MoveStruct;
|
|
390
|
+
exports.UnsettledBidReceipt = new MoveStruct({
|
|
391
|
+
name: "".concat($moduleName, "::UnsettledBidReceipt"),
|
|
392
|
+
fields: {
|
|
393
|
+
/** A vector of `TypusBidReceipt` structs. */
|
|
394
|
+
receipt: bcs_1.bcs.vector(bcs_1.bcs.Bool),
|
|
395
|
+
/** The ID of the position. */
|
|
396
|
+
position_id: bcs_1.bcs.u64(),
|
|
397
|
+
/** The address of the user. */
|
|
398
|
+
user: bcs_1.bcs.Address,
|
|
399
|
+
/** A vector of the token types. */
|
|
400
|
+
token_types: bcs_1.bcs.vector(bcs_1.bcs.Bool),
|
|
401
|
+
/** The sign of the unrealized PNL. */
|
|
402
|
+
unrealized_pnl_sign: bcs_1.bcs.bool(),
|
|
403
|
+
/** The unrealized PNL. */
|
|
404
|
+
unrealized_pnl: bcs_1.bcs.u64(),
|
|
405
|
+
/** The unrealized trading fee. */
|
|
406
|
+
unrealized_trading_fee: bcs_1.bcs.u64(),
|
|
407
|
+
/** The unrealized borrow fee. */
|
|
408
|
+
unrealized_borrow_fee: bcs_1.bcs.u64(),
|
|
409
|
+
/** The sign of the unrealized funding fee. */
|
|
410
|
+
unrealized_funding_fee_sign: bcs_1.bcs.bool(),
|
|
411
|
+
/** The unrealized funding fee. */
|
|
412
|
+
unrealized_funding_fee: bcs_1.bcs.u64(),
|
|
413
|
+
/** The unrealized liquidator fee. */
|
|
414
|
+
unrealized_liquidator_fee: bcs_1.bcs.u64(),
|
|
415
|
+
},
|
|
416
|
+
});
|
package/dist/src/user/history.js
CHANGED
|
@@ -373,7 +373,7 @@ function getGraphQLEvents(module_1, sender_1) {
|
|
|
373
373
|
senderFilter = "sender: \"".concat(sender, "\"");
|
|
374
374
|
}
|
|
375
375
|
graphql = JSON.stringify({
|
|
376
|
-
query: "\n {\n events(\n last: 50,\n ".concat(before, "\n filter: {\n
|
|
376
|
+
query: "\n {\n events(\n last: 50,\n ".concat(before, "\n filter: {\n eventType: \"").concat(module, "\",\n ").concat(senderFilter, "\n }\n ) {\n pageInfo {\n hasPreviousPage\n hasNextPage\n startCursor\n endCursor\n }\n edges { cursor }\n nodes {\n transactionBlock { digest }\n sendingModule {\n name\n package { digest }\n }\n sender { address }\n timestamp\n contents {\n type { repr }\n json\n }\n }\n }}\n "),
|
|
377
377
|
});
|
|
378
378
|
return [4 /*yield*/, fetch("https://graphql.".concat(src_1.NETWORK.toLowerCase(), ".sui.io/graphql"), {
|
|
379
379
|
method: "POST",
|
|
@@ -90,7 +90,6 @@ function createTradingOrderWithBidReceiptByAutoBid(config, tx, pythClient, input
|
|
|
90
90
|
signalIndex: input.signalIndex,
|
|
91
91
|
strategyIndex: input.strategyIndex,
|
|
92
92
|
user: input.user,
|
|
93
|
-
share: input.share,
|
|
94
93
|
});
|
|
95
94
|
cToken = constants_1.tokenType[__1.NETWORK][TOKEN];
|
|
96
95
|
bToken = constants_1.tokenType[__1.NETWORK][input.bToken];
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typus/typus-perp-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.32-type-test",
|
|
4
4
|
"repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
|
|
5
5
|
"author": "Typus",
|
|
6
6
|
"description": "typus perp sdk",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@typus/typus-sdk": "1.8.
|
|
9
|
+
"@typus/typus-sdk": "1.8.24"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@types/bs58": "^4.0.1",
|
|
@@ -35,4 +35,4 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/Typus-Lab/typus-perp-sdk#readme",
|
|
37
37
|
"packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
|
|
38
|
-
}
|
|
38
|
+
}
|