@typus/typus-perp-sdk 1.0.15 → 1.0.16
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/fetch.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ import { LpUserShare, StakePool } from "./typus_stake_pool/stake-pool/structs";
|
|
|
5
5
|
import { PythClient, TypusConfig } from "@typus/typus-sdk/dist/src/utils";
|
|
6
6
|
import { TypusBidReceipt } from "./_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/vault/structs";
|
|
7
7
|
export declare function getLpPools(config: TypusConfig): Promise<LiquidityPool[]>;
|
|
8
|
+
export declare function getLpPool(config: TypusConfig, objectId?: string): Promise<LiquidityPool>;
|
|
8
9
|
export declare function getStakePools(config: TypusConfig): Promise<StakePool[]>;
|
|
10
|
+
export declare function getStakePool(config: TypusConfig, objectId?: string): Promise<StakePool>;
|
|
9
11
|
export interface MarketsData {
|
|
10
12
|
markets: Markets;
|
|
11
13
|
symbolMarkets: SymbolMarket[];
|
package/dist/src/fetch.js
CHANGED
|
@@ -48,7 +48,9 @@ var __values = (this && this.__values) || function(o) {
|
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
50
|
exports.getLpPools = getLpPools;
|
|
51
|
+
exports.getLpPool = getLpPool;
|
|
51
52
|
exports.getStakePools = getStakePools;
|
|
53
|
+
exports.getStakePool = getStakePool;
|
|
52
54
|
exports.getMarkets = getMarkets;
|
|
53
55
|
exports.getUserOrders = getUserOrders;
|
|
54
56
|
exports.getUserPositions = getUserPositions;
|
|
@@ -116,6 +118,22 @@ function getLpPools(config) {
|
|
|
116
118
|
});
|
|
117
119
|
});
|
|
118
120
|
}
|
|
121
|
+
function getLpPool(config_1) {
|
|
122
|
+
return __awaiter(this, arguments, void 0, function (config, objectId) {
|
|
123
|
+
var provider, lpPool;
|
|
124
|
+
if (objectId === void 0) { objectId = _1.LIQUIDITY_POOL_0; }
|
|
125
|
+
return __generator(this, function (_a) {
|
|
126
|
+
switch (_a.label) {
|
|
127
|
+
case 0:
|
|
128
|
+
provider = new client_1.SuiClient({ url: config.rpcEndpoint });
|
|
129
|
+
return [4 /*yield*/, structs_2.LiquidityPool.fetch(provider, objectId)];
|
|
130
|
+
case 1:
|
|
131
|
+
lpPool = _a.sent();
|
|
132
|
+
return [2 /*return*/, lpPool];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
119
137
|
function getStakePools(config) {
|
|
120
138
|
return __awaiter(this, void 0, void 0, function () {
|
|
121
139
|
var provider, dynamicFields, stakePools, _a, _b, field, stakePool, e_2_1;
|
|
@@ -163,6 +181,22 @@ function getStakePools(config) {
|
|
|
163
181
|
});
|
|
164
182
|
});
|
|
165
183
|
}
|
|
184
|
+
function getStakePool(config_1) {
|
|
185
|
+
return __awaiter(this, arguments, void 0, function (config, objectId) {
|
|
186
|
+
var provider, stakePool;
|
|
187
|
+
if (objectId === void 0) { objectId = _1.STAKE_POOL_0; }
|
|
188
|
+
return __generator(this, function (_a) {
|
|
189
|
+
switch (_a.label) {
|
|
190
|
+
case 0:
|
|
191
|
+
provider = new client_1.SuiClient({ url: config.rpcEndpoint });
|
|
192
|
+
return [4 /*yield*/, structs_4.StakePool.fetch(provider, objectId)];
|
|
193
|
+
case 1:
|
|
194
|
+
stakePool = _a.sent();
|
|
195
|
+
return [2 /*return*/, stakePool];
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
}
|
|
166
200
|
function getMarkets(config, input) {
|
|
167
201
|
return __awaiter(this, void 0, void 0, function () {
|
|
168
202
|
var provider, transaction, devInspectTransactionBlockResult, bytes, reader, marketIndex, results;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ export * from "./user";
|
|
|
3
3
|
export declare const NETWORK: string;
|
|
4
4
|
export declare const LP_POOL: string;
|
|
5
5
|
export declare const LIQUIDITY_POOL: string;
|
|
6
|
+
export declare const LIQUIDITY_POOL_0: string;
|
|
6
7
|
export declare const MARKET: string;
|
|
7
8
|
export declare const TLP: string;
|
|
8
9
|
export declare const TLP_TOKEN: string;
|
|
9
10
|
export declare const TLP_TREASURY_CAP: string;
|
|
10
11
|
export declare const STAKE_POOL: string;
|
|
12
|
+
export declare const STAKE_POOL_0: string;
|
|
11
13
|
export declare const PERP_VERSION: string;
|
|
12
14
|
export declare const STAKE_POOL_VERSION: 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.STAKE_POOL_VERSION = exports.PERP_VERSION = exports.STAKE_POOL = exports.TLP_TREASURY_CAP = exports.TLP_TOKEN = exports.TLP = exports.MARKET = exports.LIQUIDITY_POOL = exports.LP_POOL = exports.NETWORK = void 0;
|
|
20
|
+
exports.STAKE_POOL_VERSION = exports.PERP_VERSION = exports.STAKE_POOL_0 = exports.STAKE_POOL = exports.TLP_TREASURY_CAP = exports.TLP_TOKEN = exports.TLP = exports.MARKET = exports.LIQUIDITY_POOL_0 = exports.LIQUIDITY_POOL = exports.LP_POOL = exports.NETWORK = void 0;
|
|
21
21
|
__exportStar(require("./fetch"), exports);
|
|
22
22
|
__exportStar(require("./user"), exports);
|
|
23
23
|
var dotenv_1 = __importDefault(require("dotenv"));
|
|
@@ -28,10 +28,12 @@ console.log("Load .env NEXT_PUBLIC_CLUSTER: ".concat(process.env.NEXT_PUBLIC_CLU
|
|
|
28
28
|
console.log("Initializing Typus Perp SDK for ".concat(exports.NETWORK));
|
|
29
29
|
exports.LP_POOL = exports.NETWORK == "MAINNET" ? "" : "0xf85bb9b6bbe877e43e9a79f9c59d57331884f7519825f1116d8634806cd167e1";
|
|
30
30
|
exports.LIQUIDITY_POOL = exports.NETWORK == "MAINNET" ? "" : "0x93bc498e59e97c93820c14687a9a340bc794eada7f7ce0f458bb25190bdd395e";
|
|
31
|
+
exports.LIQUIDITY_POOL_0 = exports.NETWORK == "MAINNET" ? "" : "0xc0bf75a16dbd11f0d52b27d933d4e1efaa8bdfbe3cdb89587464465aad1b6606";
|
|
31
32
|
exports.MARKET = exports.NETWORK == "MAINNET" ? "" : "0xb73983f279effad13b455846c192a2eb402ed453f84a1e627c9e34cfd329bf92";
|
|
32
33
|
exports.TLP = exports.NETWORK == "MAINNET" ? "" : "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509";
|
|
33
34
|
exports.TLP_TOKEN = exports.NETWORK == "MAINNET" ? "" : "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509::tlp::TLP";
|
|
34
35
|
exports.TLP_TREASURY_CAP = exports.NETWORK == "MAINNET" ? "" : "0x7d9c6f9dfceb4788c21388f77e4ccf83e1b3f10282ae272b379402e92c97bbf6";
|
|
35
36
|
exports.STAKE_POOL = exports.NETWORK == "MAINNET" ? "" : "0x27efed0157eea40aa1a8483622edeb48ca8c3fa3073f9e662503280a22a4e51b";
|
|
37
|
+
exports.STAKE_POOL_0 = exports.NETWORK == "MAINNET" ? "" : "0xf784850926a300257546695fcb23333bcc0b2fdc4bd492b5174a3eb0e3fd4f00";
|
|
36
38
|
exports.PERP_VERSION = exports.NETWORK == "MAINNET" ? "" : "0xa3066f440d0e2fa74b1c98e55c316ce63b208be87b018b089bf39d5dd11e8dfd";
|
|
37
39
|
exports.STAKE_POOL_VERSION = exports.NETWORK == "MAINNET" ? "" : "0x25868624d2254a14eb513ae2b276fb56ca355ffd6cdd8ee05c5a51620f3f1bf3";
|
|
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PKG_V1 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
|
|
4
4
|
var index_1 = require("../index");
|
|
5
5
|
exports.PACKAGE_ID = index_1.NETWORK == "MAINNET" ? "" : "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509";
|
|
6
|
-
exports.PUBLISHED_AT = index_1.NETWORK == "MAINNET" ? "" : "
|
|
6
|
+
exports.PUBLISHED_AT = index_1.NETWORK == "MAINNET" ? "" : "0xbeb23d2d58881dbe45c2493d20d86e079600e367d7b5de5a28e5ec10acd28793";
|
|
7
7
|
exports.PKG_V1 = index_1.NETWORK == "MAINNET" ? "" : "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509";
|
|
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PKG_V1 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
|
|
4
4
|
var index_1 = require("../index");
|
|
5
5
|
exports.PACKAGE_ID = index_1.NETWORK == "MAINNET" ? "" : "0x6db1e799c84de3665b86c7db8db3478b76fef05b194bbe53b479207d85776895";
|
|
6
|
-
exports.PUBLISHED_AT = index_1.NETWORK == "MAINNET" ? "" : "
|
|
6
|
+
exports.PUBLISHED_AT = index_1.NETWORK == "MAINNET" ? "" : "0x837d01f8b606489a4dc7e739b0ab9a65672aa1e414f768d5ad232bbf7722dad3";
|
|
7
7
|
exports.PKG_V1 = index_1.NETWORK == "MAINNET" ? "" : "0x6db1e799c84de3665b86c7db8db3478b76fef05b194bbe53b479207d85776895";
|