@ton/blueprint 0.23.0-debugger.1 → 0.23.0

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/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.23.0] - 2024-09-11
9
+
10
+ ### Changed
11
+
12
+ - Toncenter v2 is now used by default instead of orbs access. Rate limited API requests are automatically retried
13
+
14
+ ### Removed
15
+
16
+ - Removed `@orbs-network/ton-access` dependency
17
+
8
18
  ## [0.22.0] - 2024-07-08
9
19
 
10
20
  ### Added
@@ -16,7 +16,6 @@ export type TactCompilerConfig = {
16
16
  export type FuncCompilerConfig = {
17
17
  lang?: 'func';
18
18
  optLevel?: number;
19
- debugInfo?: boolean;
20
19
  } & ({
21
20
  targets: string[];
22
21
  sources?: SourceResolver | SourcesMap;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { SourcesArray, DebugInfo } from '@ton-community/func-js';
2
+ import { SourcesArray } from '@ton-community/func-js';
3
3
  import { Cell } from '@ton/core';
4
4
  import { TactCompilerConfig } from './CompilerConfig';
5
5
  export declare function getCompilablesDirectory(): Promise<string>;
@@ -10,7 +10,6 @@ export type FuncCompileResult = {
10
10
  targets: string[];
11
11
  snapshot: SourcesArray;
12
12
  version: string;
13
- debugInfo?: DebugInfo;
14
13
  };
15
14
  export type TactCompileResult = {
16
15
  lang: 'tact';
@@ -22,6 +21,5 @@ export type CompileResult = TactCompileResult | FuncCompileResult;
22
21
  export declare function doCompile(name: string, opts?: CompileOpts): Promise<CompileResult>;
23
22
  export type CompileOpts = {
24
23
  hookUserData?: any;
25
- debugInfo?: boolean;
26
24
  };
27
25
  export declare function compile(name: string, opts?: CompileOpts): Promise<Cell>;
@@ -70,7 +70,6 @@ async function doCompileFunc(config) {
70
70
  targets,
71
71
  snapshot: cr.snapshot,
72
72
  version: (await (0, func_js_1.compilerVersion)()).funcVersion,
73
- debugInfo: cr.debugInfo,
74
73
  };
75
74
  }
76
75
  function findTactBoc(fs) {
@@ -131,14 +130,10 @@ async function doCompileInner(name, config) {
131
130
  targets: config.targets,
132
131
  sources: config.sources ?? ((path) => (0, fs_1.readFileSync)(path).toString()),
133
132
  optLevel: config.optLevel,
134
- debugInfo: config.debugInfo,
135
133
  });
136
134
  }
137
135
  async function doCompile(name, opts) {
138
136
  const config = await getCompilerConfigForContract(name);
139
- if (opts?.debugInfo && config.lang === 'func') {
140
- config.debugInfo = true;
141
- }
142
137
  if (config.preCompileHook !== undefined) {
143
138
  await config.preCompileHook({
144
139
  userData: opts?.hookUserData,
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { tonDeepLink, sleep } from './utils';
2
2
  export { NetworkProvider } from './network/NetworkProvider';
3
3
  export { createNetworkProvider } from './network/createNetworkProvider';
4
- export { compile, CompileOpts, CompileResult, FuncCompileResult, TactCompileResult, doCompile } from './compile/compile';
4
+ export { compile, CompileOpts } from './compile/compile';
5
5
  export { CompilerConfig, HookParams } from './compile/CompilerConfig';
6
6
  export { UIProvider } from './ui/UIProvider';
7
7
  export { Config } from './config/Config';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildAll = exports.buildOne = exports.doCompile = exports.compile = exports.createNetworkProvider = exports.sleep = exports.tonDeepLink = void 0;
3
+ exports.buildAll = exports.buildOne = exports.compile = exports.createNetworkProvider = exports.sleep = exports.tonDeepLink = void 0;
4
4
  var utils_1 = require("./utils");
5
5
  Object.defineProperty(exports, "tonDeepLink", { enumerable: true, get: function () { return utils_1.tonDeepLink; } });
6
6
  Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return utils_1.sleep; } });
@@ -8,7 +8,6 @@ var createNetworkProvider_1 = require("./network/createNetworkProvider");
8
8
  Object.defineProperty(exports, "createNetworkProvider", { enumerable: true, get: function () { return createNetworkProvider_1.createNetworkProvider; } });
9
9
  var compile_1 = require("./compile/compile");
10
10
  Object.defineProperty(exports, "compile", { enumerable: true, get: function () { return compile_1.compile; } });
11
- Object.defineProperty(exports, "doCompile", { enumerable: true, get: function () { return compile_1.doCompile; } });
12
11
  var build_1 = require("./build");
13
12
  Object.defineProperty(exports, "buildOne", { enumerable: true, get: function () { return build_1.buildOne; } });
14
13
  Object.defineProperty(exports, "buildAll", { enumerable: true, get: function () { return build_1.buildAll; } });
@@ -22,12 +22,14 @@ const TonConnectProvider_1 = require("./send/TonConnectProvider");
22
22
  const TonHubProvider_1 = require("./send/TonHubProvider");
23
23
  const core_1 = require("@ton/core");
24
24
  const ton_1 = require("@ton/ton");
25
- const ton_access_1 = require("@orbs-network/ton-access");
26
25
  const FSStorage_1 = require("./storage/FSStorage");
27
26
  const path_1 = __importDefault(require("path"));
28
27
  const paths_1 = require("../paths");
29
28
  const crypto_1 = require("@ton/crypto");
30
29
  const MnemonicProvider_1 = require("./send/MnemonicProvider");
30
+ const axios_1 = __importDefault(require("axios"));
31
+ const INITIAL_DELAY = 400;
32
+ const MAX_ATTEMPTS = 4;
31
33
  exports.argSpec = {
32
34
  '--mainnet': Boolean,
33
35
  '--testnet': Boolean,
@@ -353,8 +355,29 @@ class NetworkProviderBuilder {
353
355
  }
354
356
  }
355
357
  else {
356
- tc = new ton_1.TonClient4({
357
- endpoint: await (0, ton_access_1.getHttpV4Endpoint)({ network }),
358
+ tc = new ton_1.TonClient({
359
+ endpoint: network === 'mainnet' ? 'https://toncenter.com/api/v2/jsonRPC' : 'https://testnet.toncenter.com/api/v2/jsonRPC',
360
+ httpAdapter: async (config) => {
361
+ let r;
362
+ let delay = INITIAL_DELAY;
363
+ let attempts = 0;
364
+ while (true) {
365
+ r = await (0, axios_1.default)({
366
+ ...config,
367
+ adapter: undefined,
368
+ validateStatus: (status) => (status >= 200 && status < 300) || status === 429,
369
+ });
370
+ if (r.status !== 429) {
371
+ return r;
372
+ }
373
+ await (0, utils_1.sleep)(delay);
374
+ delay *= 2;
375
+ attempts++;
376
+ if (attempts >= MAX_ATTEMPTS) {
377
+ throw new Error('Max attempts reached');
378
+ }
379
+ }
380
+ }
358
381
  });
359
382
  }
360
383
  const sendProvider = await this.chooseSendProvider(network, tc);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ton/blueprint",
3
- "version": "0.23.0-debugger.1",
3
+ "version": "0.23.0",
4
4
  "description": "Framework for development of TON smart contracts",
5
5
  "main": "dist/index.js",
6
6
  "bin": "./dist/cli/cli.js",
@@ -34,9 +34,8 @@
34
34
  "@ton/ton": ">=13.11.0"
35
35
  },
36
36
  "dependencies": {
37
- "@orbs-network/ton-access": "^2.3.3",
38
37
  "@tact-lang/compiler": "^1.4.0",
39
- "@ton-community/func-js": "^0.8.0-debuginfo.1",
38
+ "@ton-community/func-js": "^0.7.0",
40
39
  "@tonconnect/sdk": "^2.2.0",
41
40
  "arg": "^5.0.2",
42
41
  "chalk": "^4.1.0",