@decibeltrade/sdk 0.2.8 → 0.2.9
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/abi/generate-abis.js +17 -16
- package/dist/abi/json/netna.json +812 -3
- package/dist/abi/json/testnet.json +1023 -217
- package/dist/admin.d.ts +3 -0
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +22 -3
- package/dist/base.d.ts +4 -0
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +23 -3
- package/dist/constants.d.ts +12 -3
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -10
- package/dist/fee-pay.d.ts +4 -2
- package/dist/fee-pay.d.ts.map +1 -1
- package/dist/fee-pay.js +38 -3
- package/dist/read/candlesticks/candlesticks.types.d.ts +8 -0
- package/dist/read/candlesticks/candlesticks.types.d.ts.map +1 -1
- package/dist/read/candlesticks/candlesticks.types.js +8 -0
- package/dist/read/index.d.ts +2 -0
- package/dist/read/index.d.ts.map +1 -1
- package/dist/read/index.js +4 -1
- package/dist/read/market-trades/market-trades.reader.js +1 -1
- package/dist/read/market-trades/market-trades.types.d.ts +18 -15
- package/dist/read/market-trades/market-trades.types.d.ts.map +1 -1
- package/dist/read/market-trades/market-trades.types.js +4 -1
- package/dist/read/types.d.ts +1 -0
- package/dist/read/types.d.ts.map +1 -1
- package/dist/read/types.js +1 -0
- package/dist/read/user-active-twaps/user-active-twaps.reader.d.ts +1 -1
- package/dist/read/user-active-twaps/user-active-twaps.types.d.ts +15 -3
- package/dist/read/user-active-twaps/user-active-twaps.types.d.ts.map +1 -1
- package/dist/read/user-active-twaps/user-active-twaps.types.js +1 -1
- package/dist/read/user-fund-history/user-fund-history.reader.d.ts +13 -0
- package/dist/read/user-fund-history/user-fund-history.reader.d.ts.map +1 -0
- package/dist/read/user-fund-history/user-fund-history.reader.js +24 -0
- package/dist/read/user-fund-history/user-fund-history.types.d.ts +37 -0
- package/dist/read/user-fund-history/user-fund-history.types.d.ts.map +1 -0
- package/dist/read/user-fund-history/user-fund-history.types.js +13 -0
- package/dist/read/user-funding-history/user-funding-history.reader.d.ts +14 -10
- package/dist/read/user-funding-history/user-funding-history.reader.d.ts.map +1 -1
- package/dist/read/user-funding-history/user-funding-history.reader.js +3 -2
- package/dist/read/user-funding-history/user-funding-history.types.d.ts +15 -11
- package/dist/read/user-funding-history/user-funding-history.types.d.ts.map +1 -1
- package/dist/read/user-funding-history/user-funding-history.types.js +3 -2
- package/dist/read/user-notifications/user-notifications.types.d.ts +7 -2
- package/dist/read/user-notifications/user-notifications.types.d.ts.map +1 -1
- package/dist/read/user-notifications/user-notifications.types.js +1 -0
- package/dist/read/user-open-orders/user-open-orders.reader.d.ts +27 -24
- package/dist/read/user-open-orders/user-open-orders.reader.d.ts.map +1 -1
- package/dist/read/user-open-orders/user-open-orders.reader.js +11 -2
- package/dist/read/user-open-orders/user-open-orders.types.d.ts +32 -25
- package/dist/read/user-open-orders/user-open-orders.types.d.ts.map +1 -1
- package/dist/read/user-open-orders/user-open-orders.types.js +2 -1
- package/dist/read/user-order-history/user-order-history.reader.d.ts +1 -1
- package/dist/read/user-order-history/user-order-history.reader.d.ts.map +1 -1
- package/dist/read/user-order-history/user-order-history.reader.js +11 -4
- package/dist/read/user-order-history/user-order-history.types.d.ts +2 -0
- package/dist/read/user-order-history/user-order-history.types.d.ts.map +1 -1
- package/dist/read/user-trade-history/user-trade-history.reader.d.ts +19 -15
- package/dist/read/user-trade-history/user-trade-history.reader.d.ts.map +1 -1
- package/dist/read/user-trade-history/user-trade-history.reader.js +3 -2
- package/dist/read/user-trade-history/user-trade-history.types.d.ts +39 -17
- package/dist/read/user-trade-history/user-trade-history.types.d.ts.map +1 -1
- package/dist/read/user-trade-history/user-trade-history.types.js +3 -2
- package/dist/read/vaults/vaults.reader.d.ts +31 -3
- package/dist/read/vaults/vaults.reader.d.ts.map +1 -1
- package/dist/read/vaults/vaults.reader.js +32 -0
- package/dist/read/vaults/vaults.types.d.ts +60 -4
- package/dist/read/vaults/vaults.types.d.ts.map +1 -1
- package/dist/read/vaults/vaults.types.js +2 -2
- package/dist/read/ws-subscription.d.ts +2 -1
- package/dist/read/ws-subscription.d.ts.map +1 -1
- package/dist/read/ws-subscription.js +8 -2
- package/dist/release-config.d.ts +2 -6
- package/dist/release-config.d.ts.map +1 -1
- package/dist/release-config.js +9 -10
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils.d.ts +12 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +41 -8
- package/dist/write.d.ts +3 -2
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +35 -48
- package/package.json +3 -2
- package/readme.md +8 -3
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
6
6
|
import * as fs from "fs";
|
|
7
7
|
import * as path from "path";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
8
9
|
import { NETNA_CONFIG, TESTNET_CONFIG } from "../constants";
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = path.dirname(__filename);
|
|
9
12
|
// @Todo: There should be a global config that takes care of config across all the packages and apps
|
|
10
13
|
// @Todo: Generate ABIs for all the networks as well, or as per global config depending upon how that will work
|
|
11
14
|
// Remove NETNA_CONFIG and use getSdkConfig() instead once we implement it as a global config
|
|
@@ -66,16 +69,16 @@ async function fetchAllAbis(config) {
|
|
|
66
69
|
}
|
|
67
70
|
// Debug: Log the ABI structure
|
|
68
71
|
console.log("📋 ABI structure for", module, ":", Object.keys(moduleInfo.abi));
|
|
69
|
-
// Get
|
|
72
|
+
// Get entry functions and view functions from the module
|
|
70
73
|
const exposedFunctions = moduleInfo.abi.exposed_functions;
|
|
71
|
-
const
|
|
72
|
-
console.log("🔍 Found", exposedFunctions.length, "exposed functions in", module);
|
|
73
|
-
console.log("🧩 Keeping",
|
|
74
|
-
for (const func of
|
|
74
|
+
const relevantFunctions = exposedFunctions.filter((f) => f.is_entry || f.is_view);
|
|
75
|
+
console.log("🔍 Found", exposedFunctions.length, "exposed/view functions in", module);
|
|
76
|
+
console.log("🧩 Keeping", relevantFunctions.length, "functions in", module);
|
|
77
|
+
for (const func of relevantFunctions) {
|
|
75
78
|
const functionId = `${config.deployment.package}::${module}::${func.name}`;
|
|
76
79
|
abis[functionId] = func;
|
|
77
80
|
}
|
|
78
|
-
console.log("✅ Successfully collected",
|
|
81
|
+
console.log("✅ Successfully collected", relevantFunctions.length, "functions (entry + view) from", module);
|
|
79
82
|
}
|
|
80
83
|
catch (error) {
|
|
81
84
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -123,13 +126,11 @@ async function fetchAllAbis(config) {
|
|
|
123
126
|
console.log("🎉 ABI fetching complete!");
|
|
124
127
|
}
|
|
125
128
|
// Run the script
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
})();
|
|
135
|
-
}
|
|
129
|
+
// Process configs sequentially to avoid race conditions
|
|
130
|
+
void (async () => {
|
|
131
|
+
for (const config of CONFIGS) {
|
|
132
|
+
await fetchAllAbis(config).catch((error) => {
|
|
133
|
+
console.error(`❌ Failed to fetch ABIs for ${config.network}:`, error);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
})();
|