@decibeltrade/sdk 0.2.7 → 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.
Files changed (150) hide show
  1. package/dist/abi/generate-abis.js +17 -16
  2. package/dist/abi/json/netna.json +812 -3
  3. package/dist/abi/json/testnet.json +1023 -217
  4. package/dist/admin.d.ts +3 -0
  5. package/dist/admin.d.ts.map +1 -1
  6. package/dist/admin.js +22 -3
  7. package/dist/base.d.ts +4 -0
  8. package/dist/base.d.ts.map +1 -1
  9. package/dist/base.js +23 -3
  10. package/dist/constants.d.ts +12 -3
  11. package/dist/constants.d.ts.map +1 -1
  12. package/dist/constants.js +2 -10
  13. package/dist/fee-pay.d.ts +4 -2
  14. package/dist/fee-pay.d.ts.map +1 -1
  15. package/dist/fee-pay.js +38 -3
  16. package/dist/read/candlesticks/candlesticks.types.d.ts +8 -0
  17. package/dist/read/candlesticks/candlesticks.types.d.ts.map +1 -1
  18. package/dist/read/candlesticks/candlesticks.types.js +8 -0
  19. package/dist/read/index.d.ts +2 -0
  20. package/dist/read/index.d.ts.map +1 -1
  21. package/dist/read/index.js +4 -1
  22. package/dist/read/market-trades/market-trades.reader.js +1 -1
  23. package/dist/read/market-trades/market-trades.types.d.ts +18 -15
  24. package/dist/read/market-trades/market-trades.types.d.ts.map +1 -1
  25. package/dist/read/market-trades/market-trades.types.js +4 -1
  26. package/dist/read/types.d.ts +1 -0
  27. package/dist/read/types.d.ts.map +1 -1
  28. package/dist/read/types.js +1 -0
  29. package/dist/read/user-active-twaps/user-active-twaps.reader.d.ts +1 -1
  30. package/dist/read/user-active-twaps/user-active-twaps.types.d.ts +15 -3
  31. package/dist/read/user-active-twaps/user-active-twaps.types.d.ts.map +1 -1
  32. package/dist/read/user-active-twaps/user-active-twaps.types.js +1 -1
  33. package/dist/read/user-fund-history/user-fund-history.reader.d.ts +13 -0
  34. package/dist/read/user-fund-history/user-fund-history.reader.d.ts.map +1 -0
  35. package/dist/read/user-fund-history/user-fund-history.reader.js +24 -0
  36. package/dist/read/user-fund-history/user-fund-history.types.d.ts +37 -0
  37. package/dist/read/user-fund-history/user-fund-history.types.d.ts.map +1 -0
  38. package/dist/read/user-fund-history/user-fund-history.types.js +13 -0
  39. package/dist/read/user-funding-history/user-funding-history.reader.d.ts +14 -10
  40. package/dist/read/user-funding-history/user-funding-history.reader.d.ts.map +1 -1
  41. package/dist/read/user-funding-history/user-funding-history.reader.js +3 -2
  42. package/dist/read/user-funding-history/user-funding-history.types.d.ts +15 -11
  43. package/dist/read/user-funding-history/user-funding-history.types.d.ts.map +1 -1
  44. package/dist/read/user-funding-history/user-funding-history.types.js +3 -2
  45. package/dist/read/user-notifications/user-notifications.types.d.ts +7 -2
  46. package/dist/read/user-notifications/user-notifications.types.d.ts.map +1 -1
  47. package/dist/read/user-notifications/user-notifications.types.js +1 -0
  48. package/dist/read/user-open-orders/user-open-orders.reader.d.ts +27 -24
  49. package/dist/read/user-open-orders/user-open-orders.reader.d.ts.map +1 -1
  50. package/dist/read/user-open-orders/user-open-orders.reader.js +11 -2
  51. package/dist/read/user-open-orders/user-open-orders.types.d.ts +32 -25
  52. package/dist/read/user-open-orders/user-open-orders.types.d.ts.map +1 -1
  53. package/dist/read/user-open-orders/user-open-orders.types.js +2 -1
  54. package/dist/read/user-order-history/user-order-history.reader.d.ts +1 -1
  55. package/dist/read/user-order-history/user-order-history.reader.d.ts.map +1 -1
  56. package/dist/read/user-order-history/user-order-history.reader.js +11 -4
  57. package/dist/read/user-order-history/user-order-history.types.d.ts +2 -0
  58. package/dist/read/user-order-history/user-order-history.types.d.ts.map +1 -1
  59. package/dist/read/user-trade-history/user-trade-history.reader.d.ts +19 -15
  60. package/dist/read/user-trade-history/user-trade-history.reader.d.ts.map +1 -1
  61. package/dist/read/user-trade-history/user-trade-history.reader.js +3 -2
  62. package/dist/read/user-trade-history/user-trade-history.types.d.ts +39 -17
  63. package/dist/read/user-trade-history/user-trade-history.types.d.ts.map +1 -1
  64. package/dist/read/user-trade-history/user-trade-history.types.js +3 -2
  65. package/dist/read/vaults/vaults.reader.d.ts +31 -3
  66. package/dist/read/vaults/vaults.reader.d.ts.map +1 -1
  67. package/dist/read/vaults/vaults.reader.js +32 -0
  68. package/dist/read/vaults/vaults.types.d.ts +60 -4
  69. package/dist/read/vaults/vaults.types.d.ts.map +1 -1
  70. package/dist/read/vaults/vaults.types.js +2 -2
  71. package/dist/read/ws-subscription.d.ts +2 -1
  72. package/dist/read/ws-subscription.d.ts.map +1 -1
  73. package/dist/read/ws-subscription.js +8 -2
  74. package/dist/release-config.d.ts +2 -6
  75. package/dist/release-config.d.ts.map +1 -1
  76. package/dist/release-config.js +9 -10
  77. package/dist/tsconfig.tsbuildinfo +1 -1
  78. package/dist/utils.d.ts +12 -2
  79. package/dist/utils.d.ts.map +1 -1
  80. package/dist/utils.js +41 -8
  81. package/dist/write.d.ts +3 -2
  82. package/dist/write.d.ts.map +1 -1
  83. package/dist/write.js +35 -48
  84. package/package.json +9 -2
  85. package/readme.md +8 -3
  86. package/.github/workflows/npm_publish.yml +0 -58
  87. package/eslint.config.mjs +0 -25
  88. package/src/abi/generate-abis.ts +0 -164
  89. package/src/abi/json/netna.json +0 -1325
  90. package/src/abi/json/testnet.json +0 -1328
  91. package/src/abi/types.ts +0 -23
  92. package/src/admin.ts +0 -287
  93. package/src/base.ts +0 -226
  94. package/src/constants.ts +0 -131
  95. package/src/fee-pay.ts +0 -39
  96. package/src/gas/gas-price-manager.ts +0 -115
  97. package/src/index.ts +0 -11
  98. package/src/order-event.types.ts +0 -65
  99. package/src/order-status.ts +0 -89
  100. package/src/read/account-overview/account-overview.reader.ts +0 -47
  101. package/src/read/account-overview/account-overview.types.ts +0 -47
  102. package/src/read/base-reader.ts +0 -41
  103. package/src/read/candlesticks/candlesticks.reader.ts +0 -61
  104. package/src/read/candlesticks/candlesticks.types.ts +0 -46
  105. package/src/read/delegations/delegations.reader.ts +0 -22
  106. package/src/read/delegations/delegations.types.ts +0 -19
  107. package/src/read/index.ts +0 -288
  108. package/src/read/leaderboard/leaderboard.reader.ts +0 -21
  109. package/src/read/leaderboard/leaderboard.types.ts +0 -26
  110. package/src/read/market-contexts/market-contexts.reader.ts +0 -26
  111. package/src/read/market-contexts/market-contexts.types.ts +0 -17
  112. package/src/read/market-depth/market-depth.reader.ts +0 -60
  113. package/src/read/market-depth/market-depth.types.ts +0 -24
  114. package/src/read/market-prices/market-prices.reader.ts +0 -74
  115. package/src/read/market-prices/market-prices.types.ts +0 -41
  116. package/src/read/market-trades/market-trades.reader.ts +0 -46
  117. package/src/read/market-trades/market-trades.types.ts +0 -34
  118. package/src/read/markets/markets.reader.ts +0 -82
  119. package/src/read/markets/markets.types.ts +0 -54
  120. package/src/read/pagination.types.ts +0 -18
  121. package/src/read/portfolio-chart/portfolio-chart.reader.ts +0 -20
  122. package/src/read/portfolio-chart/portfolio-chart.types.ts +0 -21
  123. package/src/read/types.ts +0 -130
  124. package/src/read/user-active-twaps/user-active-twaps.reader.ts +0 -36
  125. package/src/read/user-active-twaps/user-active-twaps.types.ts +0 -33
  126. package/src/read/user-bulk-orders/user-bulk-orders.reader.ts +0 -37
  127. package/src/read/user-bulk-orders/user-bulk-orders.types.ts +0 -32
  128. package/src/read/user-funding-history/user-funding-history.reader.ts +0 -38
  129. package/src/read/user-funding-history/user-funding-history.types.ts +0 -29
  130. package/src/read/user-notifications/user-notifications.reader.ts +0 -17
  131. package/src/read/user-notifications/user-notifications.types.ts +0 -61
  132. package/src/read/user-open-orders/user-open-orders.reader.ts +0 -36
  133. package/src/read/user-open-orders/user-open-orders.types.ts +0 -42
  134. package/src/read/user-order-history/user-order-history.reader.ts +0 -34
  135. package/src/read/user-order-history/user-order-history.types.ts +0 -48
  136. package/src/read/user-positions/user-positions.reader.ts +0 -55
  137. package/src/read/user-positions/user-positions.types.ts +0 -42
  138. package/src/read/user-subaccounts/user-subaccounts.reader.ts +0 -30
  139. package/src/read/user-subaccounts/user-subaccounts.types.ts +0 -21
  140. package/src/read/user-trade-history/user-trade-history.reader.ts +0 -38
  141. package/src/read/user-trade-history/user-trade-history.types.ts +0 -33
  142. package/src/read/vaults/vaults.reader.ts +0 -81
  143. package/src/read/vaults/vaults.types.ts +0 -109
  144. package/src/read/ws-subscription.ts +0 -206
  145. package/src/release-config.ts +0 -47
  146. package/src/subaccount-types.ts +0 -31
  147. package/src/transaction-builder.ts +0 -76
  148. package/src/utils.ts +0 -289
  149. package/src/write.ts +0 -979
  150. package/tsconfig.json +0 -8
@@ -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 only entry functions from the module
72
+ // Get entry functions and view functions from the module
70
73
  const exposedFunctions = moduleInfo.abi.exposed_functions;
71
- const entryFunctions = exposedFunctions.filter((f) => f.is_entry);
72
- console.log("🔍 Found", exposedFunctions.length, "exposed functions in", module);
73
- console.log("🧩 Keeping", entryFunctions.length, "entry functions in", module);
74
- for (const func of entryFunctions) {
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", entryFunctions.length, "entry functions from", module);
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
- if (require.main === module) {
127
- // Process configs sequentially to avoid race conditions
128
- void (async () => {
129
- for (const config of CONFIGS) {
130
- await fetchAllAbis(config).catch((error) => {
131
- console.error(`❌ Failed to fetch ABIs for ${config.network}:`, error);
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
+ })();