@typus/typus-perp-sdk 1.2.0 → 1.2.2
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.d.ts +1 -2
- package/dist/src/client.js +1 -1
- package/dist/src/user/order.js +2 -2
- package/dist/src/user/tlp.js +3 -3
- package/package.json +40 -41
package/dist/src/client.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SuiGraphQLClient } from "@mysten/sui/graphql";
|
|
2
2
|
import { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
3
3
|
import { PythClient, TypusConfig } from "@typus/typus-sdk/dist/src/utils";
|
|
4
|
-
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
|
5
4
|
import { SuiClientTypes } from "@mysten/sui/client";
|
|
6
5
|
export type Network = "MAINNET" | "TESTNET";
|
|
7
6
|
export declare class TypusClient {
|
|
@@ -9,7 +8,7 @@ export declare class TypusClient {
|
|
|
9
8
|
graphQLClient: SuiGraphQLClient;
|
|
10
9
|
pythClient: PythClient;
|
|
11
10
|
config: TypusConfig;
|
|
12
|
-
constructor(config: TypusConfig
|
|
11
|
+
constructor(config: TypusConfig);
|
|
13
12
|
getCoins(params: SuiClientTypes.ListCoinsOptions): Promise<SuiClientTypes.ListCoinsResponse>;
|
|
14
13
|
getObject(params: SuiClientTypes.GetObjectOptions): Promise<SuiClientTypes.GetObjectResponse<{}>>;
|
|
15
14
|
getOwnedObjects(params: SuiClientTypes.ListOwnedObjectsOptions): Promise<SuiClientTypes.ListOwnedObjectsResponse<{}>>;
|
package/dist/src/client.js
CHANGED
|
@@ -9,7 +9,7 @@ const jsonRpc_1 = require("@mysten/sui/jsonRpc");
|
|
|
9
9
|
class TypusClient {
|
|
10
10
|
// user: string;
|
|
11
11
|
// mvr?: Experimental_SuiClientTypes.MvrOptions
|
|
12
|
-
constructor(config
|
|
12
|
+
constructor(config) {
|
|
13
13
|
this.config = config;
|
|
14
14
|
const network = config.network.toLowerCase();
|
|
15
15
|
const mvr = {
|
package/dist/src/user/order.js
CHANGED
|
@@ -81,8 +81,8 @@ function zeroCoin(tx, typeArgs) {
|
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
async function cancelTradingOrder(client, tx, input) {
|
|
84
|
-
let cToken =
|
|
85
|
-
let BASE_TOKEN =
|
|
84
|
+
let cToken = (0, utils_3.normalizeStructTag)(input.order.collateral_token.name);
|
|
85
|
+
let BASE_TOKEN = (0, utils_3.normalizeStructTag)(input.order.symbol.base_token.name);
|
|
86
86
|
let coin = tx.add((0, trading_1.cancelTradingOrder)({
|
|
87
87
|
arguments: {
|
|
88
88
|
version: __1.PERP_VERSION,
|
package/dist/src/user/tlp.js
CHANGED
|
@@ -177,7 +177,7 @@ async function unstakeRedeem(client, tx, input) {
|
|
|
177
177
|
}));
|
|
178
178
|
let balance = tx.moveCall({
|
|
179
179
|
target: `0x2::coin::into_balance`,
|
|
180
|
-
typeArguments: [
|
|
180
|
+
typeArguments: [lpToken],
|
|
181
181
|
arguments: [lpCoin],
|
|
182
182
|
});
|
|
183
183
|
tx.add((0, lp_pool_1.redeem)({
|
|
@@ -187,7 +187,7 @@ async function unstakeRedeem(client, tx, input) {
|
|
|
187
187
|
index: BigInt(input.stakePool.pool_info.index),
|
|
188
188
|
balance,
|
|
189
189
|
},
|
|
190
|
-
typeArguments: [
|
|
190
|
+
typeArguments: [lpToken],
|
|
191
191
|
}));
|
|
192
192
|
return tx;
|
|
193
193
|
}
|
|
@@ -310,7 +310,7 @@ async function swap(client, tx, input) {
|
|
|
310
310
|
return tx;
|
|
311
311
|
}
|
|
312
312
|
async function harvestStakeReward(client, tx, input) {
|
|
313
|
-
let iTokens = input.stakePool.incentives.map((i) => i.token_type.name);
|
|
313
|
+
let iTokens = input.stakePool.incentives.map((i) => (0, utils_1.normalizeStructTag)(i.token_type.name));
|
|
314
314
|
snapshot(client, tx, { perpIndex: input.stakePool.pool_info.index });
|
|
315
315
|
for (let iToken of iTokens) {
|
|
316
316
|
// console.log(iToken);
|
package/package.json
CHANGED
|
@@ -1,42 +1,41 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
2
|
+
"name": "@typus/typus-perp-sdk",
|
|
3
|
+
"version": "1.2.2",
|
|
4
|
+
"repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
|
|
5
|
+
"author": "Typus",
|
|
6
|
+
"description": "typus perp sdk",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@mysten/bcs": "2.0.3",
|
|
10
|
+
"@mysten/sui": "2.13.2",
|
|
11
|
+
"@typus/typus-sdk": "1.9.0",
|
|
12
|
+
"dotenv": "16.4.5"
|
|
13
|
+
},
|
|
14
|
+
"resolutions": {
|
|
15
|
+
"@pythnetwork/pyth-sui-js": "2.3.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/node": "^25.6.0",
|
|
19
|
+
"axios": "1.13.2",
|
|
20
|
+
"bignumber.js": "9.1.2",
|
|
21
|
+
"prettier": "^3.0.0",
|
|
22
|
+
"ts-node": "^10.9.2",
|
|
23
|
+
"tsc-alias": "^1.8.10",
|
|
24
|
+
"tsconfig-paths": "^4.2.0",
|
|
25
|
+
"tslint": "^6.1.3",
|
|
26
|
+
"tslint-config-prettier": "^1.18.0",
|
|
27
|
+
"typescript": "^5.1.6"
|
|
28
|
+
},
|
|
29
|
+
"main": "dist/src/index.js",
|
|
30
|
+
"types": "dist/src/index.d.ts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/Typus-Lab/typus-perp-sdk/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/Typus-Lab/typus-perp-sdk#readme",
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && tsc-alias"
|
|
40
|
+
}
|
|
41
|
+
}
|