@pioneer-platform/ton-network 8.11.2 → 8.11.3

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.
@@ -1 +1,2 @@
1
- $ tsc -p .
1
+
2
+ $ tsc -p .
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @pioneer-platform/ton-network
2
2
 
3
+ ## 8.11.3
4
+
5
+ ### Patch Changes
6
+
7
+ - chore: fix: move @types/pdfkit to dependencies for Docker --production build
8
+
3
9
  ## 8.11.2
4
10
 
5
11
  ### Patch Changes
package/lib/index.js CHANGED
@@ -67,8 +67,11 @@ var axiosLib = require('axios');
67
67
  var Axios = axiosLib.default || axiosLib;
68
68
  var https = require('https');
69
69
  var log = require('@pioneer-platform/loggerdog')();
70
- // Default TON mainnet API (TonCenter)
71
- var DEFAULT_API_URL = "https://toncenter.com/api/v2";
70
+ // Default TON mainnet API (NOWNodes with API key from env)
71
+ var NOWNODES_API_KEY = process.env.NOWNODES_API_KEY;
72
+ var DEFAULT_API_URL = NOWNODES_API_KEY
73
+ ? "https://ton.nownodes.io"
74
+ : "https://toncenter.com/api/v2";
72
75
  // Network constants
73
76
  exports.NETWORK_ID = 'ton:-239';
74
77
  exports.CHAIN_SYMBOL = 'TON';
@@ -106,13 +109,21 @@ module.exports = {
106
109
  case 1:
107
110
  _a.trys.push([1, 3, , 4]);
108
111
  apiUrl = url || process.env['TON_API_URL'] || DEFAULT_API_URL;
109
- apiKey = (settings === null || settings === void 0 ? void 0 : settings.apiKey) || process.env['TONCENTER_API_KEY'] || null;
112
+ apiKey = (settings === null || settings === void 0 ? void 0 : settings.apiKey) || process.env['NOWNODES_API_KEY'] || process.env['TONCENTER_API_KEY'] || null;
110
113
  log.info(tag, "Initializing TON network...");
111
114
  log.info(tag, "API Endpoint:", apiUrl);
112
115
  log.info(tag, "API Key configured:", apiKey ? "Yes" : "No (rate limited)");
116
+ log.info(tag, "NOWNODES_API_KEY from env:", process.env['NOWNODES_API_KEY'] ? "SET" : "NOT SET");
117
+ log.info(tag, "DEFAULT_API_URL value:", DEFAULT_API_URL);
113
118
  headers = { 'Content-Type': 'application/json' };
114
119
  if (apiKey) {
115
- headers['X-API-Key'] = apiKey;
120
+ // NOWNodes uses 'api-key' header, TonCenter uses 'X-API-Key'
121
+ if (apiUrl.includes('nownodes.io')) {
122
+ headers['api-key'] = apiKey;
123
+ }
124
+ else {
125
+ headers['X-API-Key'] = apiKey;
126
+ }
116
127
  }
117
128
  return [4 /*yield*/, axios({
118
129
  url: "".concat(apiUrl, "/getMasterchainInfo"),
@@ -218,7 +229,13 @@ module.exports = {
218
229
  function getHeaders() {
219
230
  var headers = { 'Content-Type': 'application/json' };
220
231
  if (apiKey) {
221
- headers['X-API-Key'] = apiKey;
232
+ // NOWNodes uses 'api-key' header, TonCenter uses 'X-API-Key'
233
+ if (apiUrl.includes('nownodes.io')) {
234
+ headers['api-key'] = apiKey;
235
+ }
236
+ else {
237
+ headers['X-API-Key'] = apiKey;
238
+ }
222
239
  }
223
240
  return headers;
224
241
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/ton-network",
3
- "version": "8.11.2",
3
+ "version": "8.11.3",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "description": "Pioneer Platform TON Network module",