@nightlylabs/dex-sdk 0.3.22 → 0.3.24
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/index.cjs +3 -14
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +2 -3
- package/package.json +57 -56
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/index.ts
|
|
@@ -68,7 +58,6 @@ module.exports = __toCommonJS(index_exports);
|
|
|
68
58
|
|
|
69
59
|
// src/client.ts
|
|
70
60
|
var import_ts_sdk3 = require("@aptos-labs/ts-sdk");
|
|
71
|
-
var import_isomorphic_ws = __toESM(require("isomorphic-ws"), 1);
|
|
72
61
|
var import_uuid = require("uuid");
|
|
73
62
|
|
|
74
63
|
// generated_types_testnet/index.ts
|
|
@@ -23852,7 +23841,7 @@ var AccountSequenceNumber = class {
|
|
|
23852
23841
|
};
|
|
23853
23842
|
|
|
23854
23843
|
// src/client.ts
|
|
23855
|
-
var getRandomId = () => (0, import_uuid.
|
|
23844
|
+
var getRandomId = () => (0, import_uuid.v7)();
|
|
23856
23845
|
var Client = class _Client {
|
|
23857
23846
|
constructor(connection, enableWs, url, apiKey, chainId, params, networkMode = "testnet") {
|
|
23858
23847
|
this._apiKeySequenceNumber = 0;
|
|
@@ -24417,7 +24406,7 @@ var Client = class _Client {
|
|
|
24417
24406
|
}
|
|
24418
24407
|
static async initWebSocket(url, timeout = 5e3) {
|
|
24419
24408
|
return new Promise((resolve, reject) => {
|
|
24420
|
-
const ws = new
|
|
24409
|
+
const ws = new WebSocket(
|
|
24421
24410
|
`${url.replace("http", "ws").replace("https", "wss")}` + "/v1/ws" /* Ws */
|
|
24422
24411
|
);
|
|
24423
24412
|
const timer = setTimeout(() => {
|
|
@@ -24444,7 +24433,7 @@ var Client = class _Client {
|
|
|
24444
24433
|
}
|
|
24445
24434
|
// Method to check if WebSocket is connected
|
|
24446
24435
|
isWebSocketConnected() {
|
|
24447
|
-
return this._ws !== void 0 && this._ws.readyState ===
|
|
24436
|
+
return this._ws !== void 0 && this._ws.readyState === WebSocket.OPEN;
|
|
24448
24437
|
}
|
|
24449
24438
|
sendWsMessage(message) {
|
|
24450
24439
|
if (!this._ws) throw new Error("WebSocket is not connected");
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as _aptos_labs_ts_sdk from '@aptos-labs/ts-sdk';
|
|
2
2
|
import { Aptos, Account, MultiAgentTransaction, AccountAuthenticator, SimpleTransaction, MoveModule, EntryFunctionABI } from '@aptos-labs/ts-sdk';
|
|
3
|
-
import WebSocket from 'isomorphic-ws';
|
|
4
3
|
|
|
5
4
|
type NetworkMode = 'testnet' | 'mainnet';
|
|
6
5
|
interface NetworkConfig {
|
|
@@ -4733,6 +4732,7 @@ interface WsLiquidatedCollateral {
|
|
|
4733
4732
|
}
|
|
4734
4733
|
interface GlobalLiquidation {
|
|
4735
4734
|
userId: string;
|
|
4735
|
+
liquidationId: string;
|
|
4736
4736
|
liquidationValue: string;
|
|
4737
4737
|
unpaidDebtInUsd: string;
|
|
4738
4738
|
liquidatedPositions: WsLiquidatedPosition[];
|
|
@@ -4751,6 +4751,7 @@ interface WsPartialLiquidatedPosition {
|
|
|
4751
4751
|
}
|
|
4752
4752
|
interface GlobalPartialLiquidation {
|
|
4753
4753
|
userId: string;
|
|
4754
|
+
liquidationId: string;
|
|
4754
4755
|
liquidationValue: string;
|
|
4755
4756
|
liquidatedPositions: WsPartialLiquidatedPosition[];
|
|
4756
4757
|
}
|
|
@@ -4762,6 +4763,7 @@ interface Lend {
|
|
|
4762
4763
|
}
|
|
4763
4764
|
interface Liquidation {
|
|
4764
4765
|
userId: string;
|
|
4766
|
+
liquidationId: string;
|
|
4765
4767
|
liquidationValue: string;
|
|
4766
4768
|
unpaidDebtInUsd: string;
|
|
4767
4769
|
liquidatedPositions: WsLiquidatedPosition[];
|
|
@@ -4810,6 +4812,7 @@ interface OracleUpdates {
|
|
|
4810
4812
|
}
|
|
4811
4813
|
interface PartialLiquidation {
|
|
4812
4814
|
userId: string;
|
|
4815
|
+
liquidationId: string;
|
|
4813
4816
|
liquidationValue: string;
|
|
4814
4817
|
liquidatedPositions: WsPartialLiquidatedPosition[];
|
|
4815
4818
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as _aptos_labs_ts_sdk from '@aptos-labs/ts-sdk';
|
|
2
2
|
import { Aptos, Account, MultiAgentTransaction, AccountAuthenticator, SimpleTransaction, MoveModule, EntryFunctionABI } from '@aptos-labs/ts-sdk';
|
|
3
|
-
import WebSocket from 'isomorphic-ws';
|
|
4
3
|
|
|
5
4
|
type NetworkMode = 'testnet' | 'mainnet';
|
|
6
5
|
interface NetworkConfig {
|
|
@@ -4733,6 +4732,7 @@ interface WsLiquidatedCollateral {
|
|
|
4733
4732
|
}
|
|
4734
4733
|
interface GlobalLiquidation {
|
|
4735
4734
|
userId: string;
|
|
4735
|
+
liquidationId: string;
|
|
4736
4736
|
liquidationValue: string;
|
|
4737
4737
|
unpaidDebtInUsd: string;
|
|
4738
4738
|
liquidatedPositions: WsLiquidatedPosition[];
|
|
@@ -4751,6 +4751,7 @@ interface WsPartialLiquidatedPosition {
|
|
|
4751
4751
|
}
|
|
4752
4752
|
interface GlobalPartialLiquidation {
|
|
4753
4753
|
userId: string;
|
|
4754
|
+
liquidationId: string;
|
|
4754
4755
|
liquidationValue: string;
|
|
4755
4756
|
liquidatedPositions: WsPartialLiquidatedPosition[];
|
|
4756
4757
|
}
|
|
@@ -4762,6 +4763,7 @@ interface Lend {
|
|
|
4762
4763
|
}
|
|
4763
4764
|
interface Liquidation {
|
|
4764
4765
|
userId: string;
|
|
4766
|
+
liquidationId: string;
|
|
4765
4767
|
liquidationValue: string;
|
|
4766
4768
|
unpaidDebtInUsd: string;
|
|
4767
4769
|
liquidatedPositions: WsLiquidatedPosition[];
|
|
@@ -4810,6 +4812,7 @@ interface OracleUpdates {
|
|
|
4810
4812
|
}
|
|
4811
4813
|
interface PartialLiquidation {
|
|
4812
4814
|
userId: string;
|
|
4815
|
+
liquidationId: string;
|
|
4813
4816
|
liquidationValue: string;
|
|
4814
4817
|
liquidatedPositions: WsPartialLiquidatedPosition[];
|
|
4815
4818
|
}
|
package/dist/index.js
CHANGED
|
@@ -16,8 +16,7 @@ import {
|
|
|
16
16
|
RawTransaction,
|
|
17
17
|
SimpleTransaction
|
|
18
18
|
} from "@aptos-labs/ts-sdk";
|
|
19
|
-
import
|
|
20
|
-
import { v4 as uuidv4 } from "uuid";
|
|
19
|
+
import { v7 as uuidv7 } from "uuid";
|
|
21
20
|
|
|
22
21
|
// generated_types_testnet/index.ts
|
|
23
22
|
var generated_types_testnet_exports = {};
|
|
@@ -23800,7 +23799,7 @@ var AccountSequenceNumber = class {
|
|
|
23800
23799
|
};
|
|
23801
23800
|
|
|
23802
23801
|
// src/client.ts
|
|
23803
|
-
var getRandomId = () =>
|
|
23802
|
+
var getRandomId = () => uuidv7();
|
|
23804
23803
|
var Client = class _Client {
|
|
23805
23804
|
constructor(connection, enableWs, url, apiKey, chainId, params, networkMode = "testnet") {
|
|
23806
23805
|
this._apiKeySequenceNumber = 0;
|
package/package.json
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nightlylabs/dex-sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
|
-
"import":
|
|
8
|
-
|
|
7
|
+
"import": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"require": {
|
|
12
|
+
"types": "./dist/index.d.cts",
|
|
13
|
+
"default": "./dist/index.cjs"
|
|
14
|
+
}
|
|
9
15
|
}
|
|
10
16
|
},
|
|
11
|
-
"main": "./dist/index.cjs",
|
|
12
|
-
"module": "./dist/index.js",
|
|
13
17
|
"types": "./dist/index.d.ts",
|
|
14
18
|
"files": [
|
|
15
19
|
"dist"
|
|
@@ -18,67 +22,64 @@
|
|
|
18
22
|
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
19
23
|
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
20
24
|
"clean": "rm -rf dist",
|
|
21
|
-
"test": "
|
|
22
|
-
"test:watch": "
|
|
23
|
-
"generate-types": "
|
|
25
|
+
"test": "bun test",
|
|
26
|
+
"test:watch": "bun test --watch",
|
|
27
|
+
"generate-types": "bun scripts/generate-types.ts",
|
|
24
28
|
"typecheck": "tsc --noEmit",
|
|
25
29
|
"typeshare": "typeshare ../backend --lang=typescript --output-file=./typeshareTypes.ts",
|
|
26
|
-
"test:client": "
|
|
27
|
-
"testnet:init-exchange": "
|
|
28
|
-
"testnet:setup-exchange": "
|
|
29
|
-
"testnet:redeploy": "
|
|
30
|
-
"testnet:add-dev": "
|
|
31
|
-
"testnet:remove-dev": "
|
|
32
|
-
"testnet:add-token-to-oracle": "
|
|
33
|
-
"testnet:add-token": "
|
|
34
|
-
"testnet:add-perp-market": "
|
|
35
|
-
"testnet:test-indexer": "
|
|
36
|
-
"testnet:update-oracle-prices": "
|
|
37
|
-
"testnet:settle-user": "
|
|
38
|
-
"testnet:settle-market": "
|
|
39
|
-
"testnet:set-fee-data": "
|
|
40
|
-
"testnet:set-system-haircut": "
|
|
41
|
-
"testnet:update-fee-tiers": "
|
|
42
|
-
"testnet:predeposit-to-vault": "
|
|
43
|
-
"mainnet:setup-exchange": "
|
|
44
|
-
"mainnet:init-exchange": "
|
|
45
|
-
"mainnet:add-dev": "
|
|
46
|
-
"mainnet:remove-dev": "
|
|
47
|
-
"mainnet:add-token-to-oracle": "
|
|
48
|
-
"mainnet:add-token": "
|
|
49
|
-
"mainnet:add-perp-market": "
|
|
50
|
-
"mainnet:settle-user": "
|
|
51
|
-
"mainnet:settle-market": "
|
|
52
|
-
"mainnet:set-fee-data": "
|
|
53
|
-
"mainnet:set-system-haircut": "
|
|
54
|
-
"mainnet:update-fee-tiers": "
|
|
55
|
-
"mainnet:predeposit-to-vault": "
|
|
56
|
-
"mainnet:redeploy:start": "
|
|
57
|
-
"mainnet:redeploy:finish": "
|
|
58
|
-
"mainnet:large-packages": "
|
|
30
|
+
"test:client": "bun test src/client.test.ts",
|
|
31
|
+
"testnet:init-exchange": "bun scripts/testnet/testnet-initExchange.ts",
|
|
32
|
+
"testnet:setup-exchange": "bun scripts/testnet/testnet-setupExchange.ts > testnet-setup-exchange.txt",
|
|
33
|
+
"testnet:redeploy": "bun scripts/testnet/testnet-redeploy.ts > testnet-redeploy.txt",
|
|
34
|
+
"testnet:add-dev": "bun scripts/testnet/testnet-addDev.ts",
|
|
35
|
+
"testnet:remove-dev": "bun scripts/testnet/testnet-removeDev.ts",
|
|
36
|
+
"testnet:add-token-to-oracle": "bun scripts/testnet/testnet-addTokenToOracle.ts",
|
|
37
|
+
"testnet:add-token": "bun scripts/testnet/testnet-addToken.ts",
|
|
38
|
+
"testnet:add-perp-market": "bun scripts/testnet/testnet-addPerpMarket.ts",
|
|
39
|
+
"testnet:test-indexer": "bun scripts/testnet/testnet-testIndexer.ts",
|
|
40
|
+
"testnet:update-oracle-prices": "bun scripts/testnet/testnet-updateOraclePrices.ts",
|
|
41
|
+
"testnet:settle-user": "bun scripts/testnet/testnet-settleUser.ts",
|
|
42
|
+
"testnet:settle-market": "bun scripts/testnet/testnet-settleMarket.ts",
|
|
43
|
+
"testnet:set-fee-data": "bun scripts/testnet/testnet-setFeeData.ts",
|
|
44
|
+
"testnet:set-system-haircut": "bun scripts/testnet/testnet-setSystemHaircut.ts",
|
|
45
|
+
"testnet:update-fee-tiers": "bun scripts/testnet/testnet-updateFeeTiers.ts",
|
|
46
|
+
"testnet:predeposit-to-vault": "bun scripts/testnet/testnet-predepositToVault.ts",
|
|
47
|
+
"mainnet:setup-exchange": "bun scripts/mainnet/mainnet-setupExchange.ts",
|
|
48
|
+
"mainnet:init-exchange": "bun scripts/mainnet/mainnet-initExchange.ts",
|
|
49
|
+
"mainnet:add-dev": "bun scripts/mainnet/mainnet-addDev.ts",
|
|
50
|
+
"mainnet:remove-dev": "bun scripts/mainnet/mainnet-removeDev.ts",
|
|
51
|
+
"mainnet:add-token-to-oracle": "bun scripts/mainnet/mainnet-addTokenToOracle.ts",
|
|
52
|
+
"mainnet:add-token": "bun scripts/mainnet/mainnet-addToken.ts",
|
|
53
|
+
"mainnet:add-perp-market": "bun scripts/mainnet/mainnet-addPerpMarket.ts",
|
|
54
|
+
"mainnet:settle-user": "bun scripts/mainnet/mainnet-settleUser.ts",
|
|
55
|
+
"mainnet:settle-market": "bun scripts/mainnet/mainnet-settleMarket.ts",
|
|
56
|
+
"mainnet:set-fee-data": "bun scripts/mainnet/mainnet-setFeeData.ts",
|
|
57
|
+
"mainnet:set-system-haircut": "bun scripts/mainnet/mainnet-setSystemHaircut.ts",
|
|
58
|
+
"mainnet:update-fee-tiers": "bun scripts/mainnet/mainnet-updateFeeTiers.ts",
|
|
59
|
+
"mainnet:predeposit-to-vault": "bun scripts/mainnet/mainnet-predepositToVault.ts",
|
|
60
|
+
"mainnet:redeploy:start": "bun scripts/mainnet/mainnet-redeploy-start.ts",
|
|
61
|
+
"mainnet:redeploy:finish": "bun scripts/mainnet/mainnet-redeploy-finish.ts",
|
|
62
|
+
"mainnet:large-packages": "bun scripts/mainnet/large_packages_module.ts"
|
|
59
63
|
},
|
|
60
64
|
"keywords": [],
|
|
61
65
|
"author": "",
|
|
62
66
|
"license": "ISC",
|
|
63
|
-
"packageManager": "
|
|
67
|
+
"packageManager": "bun@1.3.9",
|
|
64
68
|
"dependencies": {
|
|
65
69
|
"@aptos-labs/ts-sdk": "5.1.1",
|
|
66
|
-
"@solana/spl-token": "
|
|
67
|
-
"@solana/web3.js": "
|
|
68
|
-
"decimal.js": "
|
|
69
|
-
"
|
|
70
|
-
"uuid": "^11.0.5"
|
|
70
|
+
"@solana/spl-token": "0.4.14",
|
|
71
|
+
"@solana/web3.js": "1.98.4",
|
|
72
|
+
"decimal.js": "10.6.0",
|
|
73
|
+
"uuid": "13.0.0"
|
|
71
74
|
},
|
|
72
75
|
"devDependencies": {
|
|
73
|
-
"@changesets/cli": "
|
|
74
|
-
"@ledgerhq/hw-app-aptos": "
|
|
75
|
-
"@ledgerhq/hw-transport-node-hid": "
|
|
76
|
+
"@changesets/cli": "2.29.8",
|
|
77
|
+
"@ledgerhq/hw-app-aptos": "6.35.0",
|
|
78
|
+
"@ledgerhq/hw-transport-node-hid": "6.30.0",
|
|
76
79
|
"@thalalabs/surf": "1.9.3",
|
|
77
|
-
"@types/
|
|
78
|
-
"dotenv": "
|
|
79
|
-
"tsup": "
|
|
80
|
-
"
|
|
81
|
-
"typescript": "^5.7.3",
|
|
82
|
-
"vitest": "^3.0.4"
|
|
80
|
+
"@types/bun": "1.3.9",
|
|
81
|
+
"dotenv": "16.6.1",
|
|
82
|
+
"tsup": "8.5.1",
|
|
83
|
+
"typescript": "5.9.3"
|
|
83
84
|
}
|
|
84
85
|
}
|