@decibeltrade/sdk 0.2.1 → 0.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/.env +2 -0
- package/.turbo/turbo-build.log +4 -5
- package/dist/abi/generate-abis.js +44 -9
- package/dist/abi/json/testnet.json +166 -165
- package/dist/abi/types.js +2 -1
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +15 -10
- package/dist/base.js +26 -19
- package/dist/constants.d.ts +4 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +46 -37
- package/dist/fee-pay.js +4 -1
- package/dist/gas/gas-price-manager.js +7 -3
- package/dist/index.js +26 -10
- package/dist/order-event.types.js +2 -1
- package/dist/order-status.js +23 -16
- package/dist/read/account-overview/account-overview.reader.js +9 -5
- package/dist/read/account-overview/account-overview.types.js +29 -23
- package/dist/read/base-reader.js +9 -5
- package/dist/read/candlesticks/candlesticks.reader.js +12 -8
- package/dist/read/candlesticks/candlesticks.types.js +20 -14
- package/dist/read/delegations/delegations.reader.js +8 -4
- package/dist/read/delegations/delegations.types.js +12 -6
- package/dist/read/index.js +68 -50
- package/dist/read/leaderboard/leaderboard.reader.js +10 -6
- package/dist/read/leaderboard/leaderboard.types.js +13 -10
- package/dist/read/market-contexts/market-contexts.reader.js +8 -4
- package/dist/read/market-contexts/market-contexts.types.js +17 -11
- package/dist/read/market-depth/market-depth.reader.js +13 -9
- package/dist/read/market-depth/market-depth.types.js +14 -8
- package/dist/read/market-prices/market-prices.reader.js +15 -11
- package/dist/read/market-prices/market-prices.types.js +25 -22
- package/dist/read/market-trades/market-trades.reader.js +12 -8
- package/dist/read/market-trades/market-trades.types.js +21 -18
- package/dist/read/markets/markets.reader.js +11 -7
- package/dist/read/markets/markets.types.js +35 -32
- package/dist/read/pagination.types.js +11 -4
- package/dist/read/portfolio-chart/portfolio-chart.reader.js +8 -4
- package/dist/read/portfolio-chart/portfolio-chart.types.js +11 -5
- package/dist/read/types.js +75 -58
- package/dist/read/user-active-twaps/user-active-twaps.reader.js +9 -5
- package/dist/read/user-active-twaps/user-active-twaps.types.js +24 -18
- package/dist/read/user-bulk-orders/user-bulk-orders.reader.js +9 -5
- package/dist/read/user-bulk-orders/user-bulk-orders.types.js +22 -16
- package/dist/read/user-funding-history/user-funding-history.reader.js +9 -5
- package/dist/read/user-funding-history/user-funding-history.types.js +19 -13
- package/dist/read/user-notifications/user-notifications.reader.js +8 -4
- package/dist/read/user-notifications/user-notifications.types.js +25 -19
- package/dist/read/user-open-orders/user-open-orders.reader.js +9 -5
- package/dist/read/user-open-orders/user-open-orders.types.js +33 -27
- package/dist/read/user-order-history/user-order-history.reader.js +9 -5
- package/dist/read/user-order-history/user-order-history.types.js +38 -32
- package/dist/read/user-positions/user-positions.reader.d.ts +0 -1
- package/dist/read/user-positions/user-positions.reader.d.ts.map +1 -1
- package/dist/read/user-positions/user-positions.reader.js +9 -5
- package/dist/read/user-positions/user-positions.types.d.ts +33 -243
- package/dist/read/user-positions/user-positions.types.d.ts.map +1 -1
- package/dist/read/user-positions/user-positions.types.js +27 -22
- package/dist/read/user-subaccounts/user-subaccounts.reader.js +8 -4
- package/dist/read/user-subaccounts/user-subaccounts.types.js +14 -8
- package/dist/read/user-trade-history/user-trade-history.reader.js +9 -5
- package/dist/read/user-trade-history/user-trade-history.types.js +24 -18
- package/dist/read/vaults/vaults.reader.d.ts +1 -1
- package/dist/read/vaults/vaults.reader.d.ts.map +1 -1
- package/dist/read/vaults/vaults.reader.js +14 -6
- package/dist/read/vaults/vaults.types.d.ts +12 -3
- package/dist/read/vaults/vaults.types.d.ts.map +1 -1
- package/dist/read/vaults/vaults.types.js +59 -52
- package/dist/read/ws-subscription.d.ts +1 -1
- package/dist/read/ws-subscription.js +19 -12
- package/dist/subaccount-types.js +10 -4
- package/dist/transaction-builder.js +16 -11
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils.d.ts +7 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +63 -29
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +26 -20
- package/package.json +1 -2
- package/readme.md +2 -2
- package/src/abi/json/testnet.json +166 -165
- package/src/admin.ts +1 -0
- package/src/base.ts +5 -1
- package/src/constants.ts +8 -5
- package/src/read/user-positions/user-positions.types.ts +0 -1
- package/src/read/vaults/vaults.reader.ts +2 -0
- package/src/read/vaults/vaults.types.ts +5 -2
- package/src/read/ws-subscription.ts +2 -2
- package/src/utils.ts +49 -3
- package/src/write.ts +4 -2
package/.env
ADDED
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
|
|
2
|
+
> @decibeltrade/sdk@0.1.4 build /Users/sid/Desktop/Decibel/etna/typescript/packages/sdk
|
|
3
|
+
> tsc
|
|
4
|
+
|
|
@@ -1,15 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* ABI fetcher that gets all ABIs used by the Decibel SDK
|
|
3
4
|
* Based on actual function calls found in the SDK source code
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
const ts_sdk_1 = require("@aptos-labs/ts-sdk");
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const path = __importStar(require("path"));
|
|
43
|
+
const constants_1 = require("../constants");
|
|
9
44
|
// @Todo: There should be a global config that takes care of config across all the packages and apps
|
|
10
45
|
// @Todo: Generate ABIs for all the networks as well, or as per global config depending upon how that will work
|
|
11
46
|
// Remove NETNA_CONFIG and use getSdkConfig() instead once we implement it as a global config
|
|
12
|
-
const CONFIGS = [NETNA_CONFIG, TESTNET_CONFIG];
|
|
47
|
+
const CONFIGS = [constants_1.NETNA_CONFIG, constants_1.TESTNET_CONFIG];
|
|
13
48
|
// All modules used in the SDK (extracted from source code analysis)
|
|
14
49
|
const SDK_MODULES = [
|
|
15
50
|
"admin_apis",
|
|
@@ -25,9 +60,9 @@ const SDK_MODULES = [
|
|
|
25
60
|
*/
|
|
26
61
|
function getAbiFilename(config) {
|
|
27
62
|
// For CUSTOM networks, use a more descriptive name based on the config
|
|
28
|
-
if (config.network === Network.CUSTOM) {
|
|
63
|
+
if (config.network === ts_sdk_1.Network.CUSTOM) {
|
|
29
64
|
// Check if it's NETNA by comparing package address or other unique identifier
|
|
30
|
-
if (config.deployment.package === NETNA_CONFIG.deployment.package) {
|
|
65
|
+
if (config.deployment.package === constants_1.NETNA_CONFIG.deployment.package) {
|
|
31
66
|
return "json/netna.json";
|
|
32
67
|
}
|
|
33
68
|
return "json/custom.json";
|
|
@@ -45,13 +80,13 @@ async function fetchAllAbis(config) {
|
|
|
45
80
|
console.error("❌ Error: config.package or CONFIG.fullnodeUrl is not set");
|
|
46
81
|
process.exit(1);
|
|
47
82
|
}
|
|
48
|
-
const aptosConfig = new AptosConfig({
|
|
83
|
+
const aptosConfig = new ts_sdk_1.AptosConfig({
|
|
49
84
|
network: config.network,
|
|
50
85
|
fullnode: config.fullnodeUrl,
|
|
51
86
|
});
|
|
52
87
|
const abis = {};
|
|
53
88
|
const errors = [];
|
|
54
|
-
const aptos = new Aptos(aptosConfig);
|
|
89
|
+
const aptos = new ts_sdk_1.Aptos(aptosConfig);
|
|
55
90
|
// Fetch entire modules at once (much more efficient!)
|
|
56
91
|
for (const module of SDK_MODULES) {
|
|
57
92
|
try {
|