@ton/blueprint 0.41.0 → 0.43.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ton Tech
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/cli/cli.js CHANGED
File without changes
@@ -130,6 +130,8 @@ Runs ${chalk_1.default.green('npm test [...args]')}, which by default executes $
130
130
 
131
131
  ${chalk_1.default.bold('Options:')}
132
132
  ${chalk_1.default.cyan('--gas-report')}, ${chalk_1.default.cyan('-g')} - Run tests and compare with the last snapshot's metrics
133
+ ${chalk_1.default.cyan('--ui')} - Connects to sandbox UI server
134
+ ${chalk_1.default.cyan('--coverage')} - Collects tests coverage
133
135
 
134
136
  ${chalk_1.default.bold('SEE ALSO')}
135
137
  ${chalk_1.default.cyan('blueprint snapshot')}
@@ -140,6 +142,8 @@ Verifies a deployed contract on ${chalk_1.default.underline('https://verifier.to
140
142
 
141
143
  ${chalk_1.default.bold('Flags:')}
142
144
  ${chalk_1.default.cyan('--mainnet')}, ${chalk_1.default.cyan('--testnet')} - selects network
145
+ ${chalk_1.default.cyan('--verifier')} - specifies the verifier ID to use (default: ${chalk_1.default.cyan('verifier.ton.org')})
146
+ ${chalk_1.default.cyan('--list-verifiers')} - lists all available verifiers for the selected network (or both networks if none selected)
143
147
  ${chalk_1.default.cyan('--compiler-version')} - specifies the exact compiler version to use (e.g. ${chalk_1.default.cyan('0.4.4-newops.1')}). Note: this does not change the underlying compiler itself.
144
148
  ${chalk_1.default.cyan('--custom')} [api-endpoint] - use custom API (requires --custom-type)
145
149
  ${chalk_1.default.cyan('--custom-version')} - API version (v2 default)
@@ -3,6 +3,6 @@ export declare const argSpec: {
3
3
  '--gas-report': BooleanConstructor;
4
4
  '-g': string;
5
5
  '--coverage': BooleanConstructor;
6
+ '--ui': BooleanConstructor;
6
7
  };
7
- export declare function coverage(): Promise<void>;
8
8
  export declare const test: Runner;
package/dist/cli/test.js CHANGED
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.test = exports.argSpec = void 0;
7
- exports.coverage = coverage;
8
7
  const child_process_1 = require("child_process");
9
8
  const arg_1 = __importDefault(require("arg"));
10
9
  const constants_1 = require("./constants");
@@ -12,6 +11,7 @@ exports.argSpec = {
12
11
  '--gas-report': Boolean,
13
12
  '-g': '--gas-report',
14
13
  '--coverage': Boolean,
14
+ '--ui': Boolean,
15
15
  };
16
16
  async function coverage() {
17
17
  (0, child_process_1.execSync)(`npm test -- --reporters @ton/blueprint/dist/jest/CoverageReporter --setupFilesAfterEnv @ton/blueprint/dist/jest/coverageSetup`, {
@@ -35,6 +35,9 @@ const test = async (args, ui) => {
35
35
  if (localArgs['--gas-report']) {
36
36
  testArgs = testArgs.slice(1);
37
37
  }
38
+ if (localArgs['--ui']) {
39
+ testArgs = [...testArgs.slice(1), '--setupFilesAfterEnv', '@ton/sandbox/dist/jest/uiSetup'];
40
+ }
38
41
  (0, child_process_1.execSync)(`npm test -- ${testArgs.join(' ')}`, {
39
42
  stdio: 'inherit',
40
43
  env: {
@@ -13,33 +13,68 @@ const createNetworkProvider_1 = require("../network/createNetworkProvider");
13
13
  const build_1 = require("./build");
14
14
  const utils_1 = require("../utils");
15
15
  const constants_1 = require("./constants");
16
- async function getBackends() {
17
- let backendsProd;
18
- let backendsTestnet;
16
+ const DEFAULT_VERIFIER_ID = 'verifier.ton.org';
17
+ const VERIFIER_CONFIG_URL = 'https://raw.githubusercontent.com/ton-community/contract-verifier-config/main/config.json';
18
+ const MAINNET_VERIFIER_REGISTRY = core_1.Address.parse('EQD-BJSVUJviud_Qv7Ymfd3qzXdrmV525e3YDzWQoHIAiInL');
19
+ const TESTNET_VERIFIER_REGISTRY = core_1.Address.parse('EQCsdKYwUaXkgJkz2l0ol6qT_WxeRbE_wBCwnEybmR0u5TO8');
20
+ async function getVerifierConfig() {
19
21
  try {
20
- const response = await fetch('https://raw.githubusercontent.com/ton-community/contract-verifier-config/main/config.json');
21
- if (response.status !== 200) {
22
- throw new Error(response.status + ' ' + response.statusText);
22
+ const response = await fetch(VERIFIER_CONFIG_URL);
23
+ if (!response.ok) {
24
+ throw new Error(`Failed to fetch verifier config: ${response.status} ${response.statusText}`);
23
25
  }
24
- const config = await response.json();
25
- backendsProd = config.backends;
26
- backendsTestnet = config.backendsTestnet;
26
+ return await response.json();
27
27
  }
28
- catch (e) {
29
- throw new Error('Unable to fetch contract verifer backends: ' + e);
28
+ catch (error) {
29
+ const errorMessage = error instanceof Error ? error.message : String(error);
30
+ throw new Error(`Unable to fetch contract verifier config: ${errorMessage}`);
31
+ }
32
+ }
33
+ async function listVerifiers(ui) {
34
+ try {
35
+ const config = await getVerifierConfig();
36
+ ui.write('\nAvailable verifiers:');
37
+ const mainnetVerifiers = config.verifiers.filter((v) => v.network === 'mainnet');
38
+ const testnetVerifiers = config.verifiers.filter((v) => v.network === 'testnet');
39
+ if (mainnetVerifiers.length > 0) {
40
+ ui.write('\n Mainnet:');
41
+ mainnetVerifiers.forEach((v) => {
42
+ ui.write(` - ${v.id}`);
43
+ });
44
+ }
45
+ if (testnetVerifiers.length > 0) {
46
+ ui.write('\n Testnet:');
47
+ testnetVerifiers.forEach((v) => {
48
+ ui.write(` - ${v.id}`);
49
+ });
50
+ }
51
+ if (mainnetVerifiers.length === 0 && testnetVerifiers.length === 0) {
52
+ ui.write(' (none)');
53
+ }
54
+ ui.write('');
55
+ }
56
+ catch (error) {
57
+ const errorMessage = error instanceof Error ? error.message : String(error);
58
+ throw new Error(`Unable to list verifiers: ${errorMessage}`);
59
+ }
60
+ }
61
+ async function getBackends(verifierId, network) {
62
+ try {
63
+ const config = await getVerifierConfig();
64
+ const verifierConfig = config.verifiers.find((v) => v.id === verifierId && v.network === network);
65
+ if (!verifierConfig) {
66
+ const availableVerifiers = config.verifiers
67
+ .filter((v) => v.network === network)
68
+ .map((v) => v.id)
69
+ .join(', ');
70
+ throw new Error(`Verifier '${verifierId}' not found for ${network} network. Available verifiers: ${availableVerifiers || 'none'}`);
71
+ }
72
+ return verifierConfig.backends;
73
+ }
74
+ catch (error) {
75
+ const errorMessage = error instanceof Error ? error.message : String(error);
76
+ throw new Error(`Unable to fetch contract verifier backends: ${errorMessage}`);
30
77
  }
31
- return {
32
- mainnet: {
33
- sourceRegistry: core_1.Address.parse('EQD-BJSVUJviud_Qv7Ymfd3qzXdrmV525e3YDzWQoHIAiInL'),
34
- backends: backendsProd,
35
- id: 'orbs.com',
36
- },
37
- testnet: {
38
- sourceRegistry: core_1.Address.parse('EQCsdKYwUaXkgJkz2l0ol6qT_WxeRbE_wBCwnEybmR0u5TO8'),
39
- backends: backendsTestnet,
40
- id: 'orbs-testnet',
41
- },
42
- };
43
78
  }
44
79
  function removeRandom(els) {
45
80
  return els.splice(Math.floor(Math.random() * els.length), 1)[0];
@@ -139,6 +174,10 @@ const verify = async (_args, ui, context) => {
139
174
  ui.write(constants_1.helpMessages['verify']);
140
175
  return;
141
176
  }
177
+ if (localArgs['--list-verifiers']) {
178
+ await listVerifiers(ui);
179
+ return;
180
+ }
142
181
  const preciseVersion = localArgs['--compiler-version'];
143
182
  const selectedContract = await (0, build_1.selectContract)(ui, (0, Runner_1.extractFirstArg)(localArgs));
144
183
  const networkProvider = await (0, createNetworkProvider_1.createNetworkProvider)(ui, localArgs, context.config, false);
@@ -258,16 +297,19 @@ const verify = async (_args, ui, context) => {
258
297
  fd.append('json', new Blob([JSON.stringify(src)], {
259
298
  type: 'application/json',
260
299
  }), 'blob');
261
- const backends = await getBackends();
262
- const backend = backends[network];
263
- const sourceRegistry = networkProvider.open(new SourceRegistry(backend.sourceRegistry));
300
+ const verifierId = localArgs['--verifier'] ?? DEFAULT_VERIFIER_ID;
301
+ const sourceRegistryAddress = network === 'mainnet' ? MAINNET_VERIFIER_REGISTRY : TESTNET_VERIFIER_REGISTRY;
302
+ const sourceRegistry = networkProvider.open(new SourceRegistry(sourceRegistryAddress));
264
303
  const verifierRegistry = networkProvider.open(new VerifierRegistry(await sourceRegistry.getVerifierRegistry()));
265
- const verifier = (await verifierRegistry.getVerifiers()).find((v) => v.name === backend.id);
266
- if (verifier === undefined) {
267
- throw new Error('Could not find verifier');
304
+ const verifiers = await verifierRegistry.getVerifiers();
305
+ const verifier = verifiers.find((v) => v.name === verifierId);
306
+ if (!verifier) {
307
+ const availableVerifiers = verifiers.map((v) => v.name).join(', ');
308
+ throw new Error(`Verifier '${verifierId}' is not registered in the verifier registry. Available verifiers: ${availableVerifiers || 'none'}`);
268
309
  }
269
- const remainingBackends = [...backend.backends];
270
- const sourceResponse = await fetch(removeRandom(remainingBackends) + '/source', {
310
+ const backends = await getBackends(verifierId, network);
311
+ const backendUrl = removeRandom(backends);
312
+ const sourceResponse = await fetch(`${backendUrl}/source`, {
271
313
  method: 'POST',
272
314
  body: fd,
273
315
  });
@@ -281,9 +323,9 @@ const verify = async (_args, ui, context) => {
281
323
  let msgCell = sourceResult.msgCell;
282
324
  let acquiredSigs = 1;
283
325
  while (acquiredSigs < verifier.quorum) {
284
- const curBackend = removeRandom(remainingBackends);
285
- ui.write(`Using backend: ${curBackend}`);
286
- const signResponse = await fetch(curBackend + '/sign', {
326
+ const backendUrl = removeRandom(backends);
327
+ ui.write(`Using backend: ${backendUrl}`);
328
+ const signResponse = await fetch(`${backendUrl}/sign`, {
287
329
  method: 'POST',
288
330
  body: JSON.stringify({
289
331
  messageCell: msgCell,
@@ -303,6 +345,7 @@ const verify = async (_args, ui, context) => {
303
345
  value: (0, core_1.toNano)('0.5'),
304
346
  body: c,
305
347
  });
306
- ui.write(`Contract successfully verified at https://verifier.ton.org/${addr}`);
348
+ const testnetFlag = network === 'testnet' ? '?testnet=true' : '';
349
+ ui.write(`Contract successfully verified at https://verifier.ton.org/${addr}${testnetFlag}`);
307
350
  };
308
351
  exports.verify = verify;
@@ -0,0 +1 @@
1
+ export type SupportedLang = 'tact' | 'tolk' | 'func';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,6 +3,7 @@ import { CompilableConfig, CompilerConfig } from './CompilerConfig';
3
3
  import { FuncCompileResult } from './func/compile.func';
4
4
  import { TactCompileResult } from './tact/compile.tact';
5
5
  import { TolkCompileResult } from './tolk/compile.tolk';
6
+ import { SupportedLang } from './SupportedLang';
6
7
  export declare function getCompilablesDirectory(): Promise<string>;
7
8
  export declare function extractCompilableConfig(path: string): CompilableConfig;
8
9
  export declare const COMPILE_END = ".compile.ts";
@@ -25,7 +26,7 @@ export declare const COMPILE_END = ".compile.ts";
25
26
  export declare function getCompilerConfigForContract(name: string): Promise<CompilerConfig>;
26
27
  export type CompileResult = TactCompileResult | FuncCompileResult | TolkCompileResult;
27
28
  export declare function getCompilerOptions(config: CompilerConfig): Promise<{
28
- lang: 'tact' | 'tolk' | 'func';
29
+ lang: SupportedLang;
29
30
  version: string;
30
31
  }>;
31
32
  export declare function libraryCellFromCode(code: Cell): Cell;
@@ -1,6 +1,8 @@
1
+ import { Network } from '../network/Network';
2
+ import { NetworkVersion } from '../network/NetworkVersion';
1
3
  export type CustomNetwork = {
2
4
  endpoint: string;
3
- version?: 'v2' | 'v4' | 'tonapi' | 'liteclient';
5
+ version?: NetworkVersion;
4
6
  key?: string;
5
- type?: 'mainnet' | 'testnet' | 'custom';
7
+ type?: Network;
6
8
  };
@@ -4,6 +4,7 @@ import { ContractAdapter } from '@ton-api/ton-adapter';
4
4
  import { LiteClient } from 'ton-lite-client';
5
5
  import { UIProvider } from '../ui/UIProvider';
6
6
  import { Explorer } from './Explorer';
7
+ import { Network } from './Network';
7
8
  export type BlueprintTonClient = TonClient4 | TonClient | ContractAdapter | LiteClient;
8
9
  type BlockchainConfig = ReturnType<typeof parseFullConfig>;
9
10
  export interface SenderWithSendResult extends Sender {
@@ -15,9 +16,9 @@ export interface SenderWithSendResult extends Sender {
15
16
  export interface NetworkProvider {
16
17
  /**
17
18
  * Returns the current network type.
18
- * @returns {'mainnet' | 'testnet' | 'custom'} The type of network.
19
+ * @returns {Network} The type of network.
19
20
  */
20
- network(): 'mainnet' | 'testnet' | 'custom';
21
+ network(): Network;
21
22
  /**
22
23
  * Returns the current explorer type.
23
24
  * @returns {Explorer} The type of explorer.
@@ -0,0 +1 @@
1
+ export type NetworkVersion = 'v2' | 'v4' | 'tonapi' | 'liteclient';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -17,6 +17,8 @@ export declare const argSpec: {
17
17
  '--tonviewer': BooleanConstructor;
18
18
  '--toncx': BooleanConstructor;
19
19
  '--dton': BooleanConstructor;
20
+ '--verifier': StringConstructor;
21
+ '--list-verifiers': BooleanConstructor;
20
22
  };
21
23
  export type Args = arg.Result<typeof argSpec>;
22
24
  export declare function createNetworkProvider(ui: UIProvider, args: Args, config?: Config, allowCustom?: boolean): Promise<NetworkProvider>;
@@ -37,6 +37,8 @@ exports.argSpec = {
37
37
  '--tonviewer': Boolean,
38
38
  '--toncx': Boolean,
39
39
  '--dton': Boolean,
40
+ '--verifier': String,
41
+ '--list-verifiers': Boolean,
40
42
  };
41
43
  class SendProviderSender {
42
44
  get lastSendResult() {
@@ -1,5 +1,15 @@
1
1
  {{name}}.ts
2
- import { Address, beginCell, Cell, Contract, contractAddress, ContractProvider, Sender, SendMode } from '@ton/core';
2
+ import {
3
+ Address,
4
+ beginCell,
5
+ Cell,
6
+ Contract,
7
+ ContractABI,
8
+ contractAddress,
9
+ ContractProvider,
10
+ Sender,
11
+ SendMode
12
+ } from '@ton/core';
3
13
 
4
14
  export type {{name}}Config = {
5
15
  id: number;
@@ -15,6 +25,8 @@ export const Opcodes = {
15
25
  };
16
26
 
17
27
  export class {{name}} implements Contract {
28
+ abi: ContractABI = { name: '{{name}}' }
29
+
18
30
  constructor(readonly address: Address, readonly init?: { code: Cell; data: Cell }) {}
19
31
 
20
32
  static createFromAddress(address: Address) {
@@ -1,5 +1,15 @@
1
1
  {{name}}.ts
2
- import { Address, beginCell, Cell, Contract, contractAddress, ContractProvider, Sender, SendMode } from '@ton/core';
2
+ import {
3
+ Address,
4
+ beginCell,
5
+ Cell,
6
+ Contract,
7
+ ContractABI,
8
+ contractAddress,
9
+ ContractProvider,
10
+ Sender,
11
+ SendMode
12
+ } from '@ton/core';
3
13
 
4
14
  export type {{name}}Config = {};
5
15
 
@@ -8,6 +18,8 @@ export function {{loweredName}}ConfigToCell(config: {{name}}Config): Cell {
8
18
  }
9
19
 
10
20
  export class {{name}} implements Contract {
21
+ abi: ContractABI = { name: '{{name}}' }
22
+
11
23
  constructor(readonly address: Address, readonly init?: { code: Cell; data: Cell }) {}
12
24
 
13
25
  static createFromAddress(address: Address) {
@@ -1,5 +1,15 @@
1
1
  {{name}}.ts
2
- import { Address, beginCell, Cell, Contract, contractAddress, ContractProvider, Sender, SendMode } from '@ton/core';
2
+ import {
3
+ Address,
4
+ beginCell,
5
+ Cell,
6
+ Contract,
7
+ ContractABI,
8
+ contractAddress,
9
+ ContractProvider,
10
+ Sender,
11
+ SendMode
12
+ } from '@ton/core';
3
13
 
4
14
  export type {{name}}Config = {
5
15
  id: number;
@@ -16,6 +26,8 @@ export const Opcodes = {
16
26
  };
17
27
 
18
28
  export class {{name}} implements Contract {
29
+ abi: ContractABI = { name: '{{name}}' }
30
+
19
31
  constructor(readonly address: Address, readonly init?: { code: Cell; data: Cell }) {}
20
32
 
21
33
  static createFromAddress(address: Address) {
@@ -1,5 +1,15 @@
1
1
  {{name}}.ts
2
- import { Address, beginCell, Cell, Contract, contractAddress, ContractProvider, Sender, SendMode } from '@ton/core';
2
+ import {
3
+ Address,
4
+ beginCell,
5
+ Cell,
6
+ Contract,
7
+ ContractABI,
8
+ contractAddress,
9
+ ContractProvider,
10
+ Sender,
11
+ SendMode
12
+ } from '@ton/core';
3
13
 
4
14
  export type {{name}}Config = {};
5
15
 
@@ -8,6 +18,8 @@ export function {{loweredName}}ConfigToCell(config: {{name}}Config): Cell {
8
18
  }
9
19
 
10
20
  export class {{name}} implements Contract {
21
+ abi: ContractABI = { name: '{{name}}' }
22
+
11
23
  constructor(readonly address: Address, readonly init?: { code: Cell; data: Cell }) {}
12
24
 
13
25
  static createFromAddress(address: Address) {
package/package.json CHANGED
@@ -1,71 +1,71 @@
1
1
  {
2
- "name": "@ton/blueprint",
3
- "version": "0.41.0",
4
- "description": "Framework for development of TON smart contracts",
5
- "main": "dist/index.js",
6
- "bin": "./dist/cli/cli.js",
7
- "author": "TonTech",
8
- "license": "MIT",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/ton-org/blueprint.git"
12
- },
13
- "files": [
14
- "dist/**/*"
15
- ],
16
- "scripts": {
17
- "build": "rm -rf dist && tsc && cp -r src/templates dist/",
18
- "test": "jest src",
19
- "release": "yarn build && yarn publish --access public",
20
- "lint": "eslint . --max-warnings 0",
21
- "lint:fix": "eslint . --max-warnings 0 --fix"
22
- },
23
- "prettier": "@ton/toolchain/prettier",
24
- "devDependencies": {
25
- "@tact-lang/compiler": "^1.6.13",
26
- "@ton-community/func-js": "^0.10.0",
27
- "@ton/core": "^0.61.0",
28
- "@ton/crypto": "^3.3.0",
29
- "@ton/sandbox": "^0.37.1",
30
- "@ton/tolk-js": "^1.0.0",
31
- "@ton/ton": "^15.3.1",
32
- "@ton/toolchain": "the-ton-tech/toolchain#v1.4.0",
33
- "@types/inquirer": "^8.2.6",
34
- "@types/jest": "^30.0.0",
35
- "@types/node": "^20.2.5",
36
- "@types/qrcode-terminal": "^0.12.0",
37
- "eslint": "^9.28.0",
38
- "globals": "^16.4.0",
39
- "jest": "^30.0.5",
40
- "ts-jest": "^29.4.1",
41
- "typescript": "^5.8.3"
42
- },
43
- "peerDependencies": {
44
- "@tact-lang/compiler": ">=1.6.5",
45
- "@ton-community/func-js": ">=0.10.0",
46
- "@ton/core": ">=0.61.0",
47
- "@ton/crypto": ">=3.3.0",
48
- "@ton/sandbox": "^0.37.1",
49
- "@ton/tolk-js": ">=0.13.0",
50
- "@ton/ton": ">=15.2.1"
51
- },
52
- "peerDependenciesMeta": {
53
- "@ton/sandbox": {
54
- "optional": true
55
- }
56
- },
57
- "dependencies": {
58
- "@ton-api/client": "^0.2.0",
59
- "@ton-api/ton-adapter": "^0.2.0",
60
- "@tonconnect/sdk": "^2.2.0",
61
- "arg": "^5.0.2",
62
- "axios": "^1.7.7",
63
- "chalk": "^4.1.0",
64
- "dotenv": "^16.1.4",
65
- "inquirer": "^8.2.5",
66
- "qrcode-terminal": "^0.12.0",
67
- "ton-lite-client": "^3.1.1",
68
- "ts-node": "^10.9.1"
69
- },
70
- "packageManager": "yarn@4.9.2"
71
- }
2
+ "name": "@ton/blueprint",
3
+ "version": "0.43.0",
4
+ "description": "Framework for development of TON smart contracts",
5
+ "main": "dist/index.js",
6
+ "bin": "./dist/cli/cli.js",
7
+ "author": "TonTech",
8
+ "license": "MIT",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/ton-org/blueprint.git"
12
+ },
13
+ "files": [
14
+ "dist/**/*"
15
+ ],
16
+ "scripts": {
17
+ "build": "rm -rf dist && tsc && cp -r src/templates dist/",
18
+ "test": "jest src",
19
+ "release": "yarn build && yarn publish --access public",
20
+ "lint": "eslint . --max-warnings 0",
21
+ "lint:fix": "eslint . --max-warnings 0 --fix"
22
+ },
23
+ "prettier": "@ton/toolchain/prettier",
24
+ "devDependencies": {
25
+ "@tact-lang/compiler": "^1.6.13",
26
+ "@ton-community/func-js": "^0.10.0",
27
+ "@ton/core": "^0.61.0",
28
+ "@ton/crypto": "^3.3.0",
29
+ "@ton/sandbox": "^0.40.0",
30
+ "@ton/tolk-js": "^1.0.0",
31
+ "@ton/ton": "^15.3.1",
32
+ "@ton/toolchain": "the-ton-tech/toolchain#v1.6.0",
33
+ "@types/inquirer": "^8.2.6",
34
+ "@types/jest": "^30.0.0",
35
+ "@types/node": "^20.2.5",
36
+ "@types/qrcode-terminal": "^0.12.0",
37
+ "eslint": "^9.28.0",
38
+ "globals": "^16.4.0",
39
+ "jest": "^30.0.5",
40
+ "ts-jest": "^29.4.1",
41
+ "typescript": "^5.8.3"
42
+ },
43
+ "peerDependencies": {
44
+ "@tact-lang/compiler": ">=1.6.5",
45
+ "@ton-community/func-js": ">=0.10.0",
46
+ "@ton/core": ">=0.61.0",
47
+ "@ton/crypto": ">=3.3.0",
48
+ "@ton/sandbox": ">=0.40.0",
49
+ "@ton/tolk-js": ">=0.13.0",
50
+ "@ton/ton": ">=15.2.1"
51
+ },
52
+ "peerDependenciesMeta": {
53
+ "@ton/sandbox": {
54
+ "optional": true
55
+ }
56
+ },
57
+ "dependencies": {
58
+ "@ton-api/client": "^0.2.0",
59
+ "@ton-api/ton-adapter": "^0.2.0",
60
+ "@tonconnect/sdk": "^2.2.0",
61
+ "arg": "^5.0.2",
62
+ "axios": "^1.7.7",
63
+ "chalk": "^4.1.0",
64
+ "dotenv": "^16.1.4",
65
+ "inquirer": "^8.2.5",
66
+ "qrcode-terminal": "^0.12.0",
67
+ "ton-lite-client": "^3.1.1",
68
+ "ts-node": "^10.9.1"
69
+ },
70
+ "packageManager": "yarn@4.9.2"
71
+ }
package/CHANGELOG.md DELETED
@@ -1,525 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [0.41.0] - 2025-09-23
9
-
10
- ### Added
11
-
12
- - Added `blueprint test --coverage` command
13
-
14
- ### Changed
15
-
16
- - When creating a contract, if the input contract name is invalid, blueprint does not exit, but asks for the name again
17
-
18
- ## [0.40.0] - 2025-08-18
19
-
20
- ### Added
21
-
22
- - Added `libraryHash` and `libraryBoc` to the build result when building libraries
23
-
24
- ## [0.39.1] - 2025-08-05
25
-
26
- ### Added
27
-
28
- - Added `--compiler-version` flag to support precise version selection when verifying
29
-
30
- ## [0.39.0] - 2025-08-04
31
-
32
- ### Added
33
-
34
- - Added `buildLibrary` wrapper compile config and `compile` function option to convert the built code into a library
35
-
36
- ## [0.38.0] - 2025-07-07
37
-
38
- ### Fixed
39
-
40
- - Fixed contracts not compiling in subfolders
41
-
42
- ### Changed
43
-
44
- - Changed contracts templates positions in `create` command
45
- - Changed counter template to match Tolk v1.0
46
-
47
- ## [0.37.0] - 2025-06-26
48
-
49
- ### Added
50
-
51
- - Added debugger support
52
-
53
- ## [0.36.1] - 2025-06-17
54
-
55
- ### Fixed
56
-
57
- - Fixed contract creation on Windows
58
-
59
- ## [0.36.0] - 2025-06-16
60
-
61
- ### Added
62
-
63
- - Added `getConfig` and `getContractState` methods to network provider
64
- - Added `getNormalizedExtMessageHash` function
65
- - Added `NetworkProvider.waitForLastTransaction` method
66
-
67
- ### Fixed
68
-
69
- - Use `Dirent.parentPath` instead of `.path` which is deprecated
70
-
71
- ## [0.35.1] - 2025-06-13
72
-
73
- ### Fixed
74
-
75
- - Fixed Tolk counter template
76
-
77
- ## [0.35.0] - 2025-06-02
78
-
79
- ### Added
80
-
81
- - Added ton lite client network provider
82
- - Added tolk verifier
83
- - Wallet v4 extended support: added v4r1, v4 is treated as v4r2
84
- - Added possibility to specify custom `manifestUrl` in blueprint configuration
85
- - Added documentation about the [Tact plugin by TON Studio](https://plugins.jetbrains.com/plugin/27290-tact)
86
- - Added tolk v0.13 support
87
-
88
- ### Changed
89
-
90
- - Updated documentation about Tact wrappers
91
-
92
- ## [0.34.0] - 2025-05-20
93
-
94
- ### Added
95
-
96
- - Added config option to look for wrappers recursively
97
- - Exported `getCompilerConfigForContract` function for plugin support
98
- - Added request timout configuration
99
- - Added docs for script args
100
- - Added the `rename` command which renames contracts
101
- - Added the `pack` command which builds and prepares a publish-ready package of contracts' wrappers
102
- - Added support for wallet IDs in mnemonic provider. Environment variables `WALLET_ID` or `SUBWALLET_NUMBER` should be set, or a .env file with them must be present in order for it to be usable
103
- - Added command `blueprint snapshot` to run tests with metric collection and write new benchmark report
104
- - Added option `blueprint test --gas-report` to run tests and compare with the last snapshot metrics
105
-
106
- ### Fixed
107
-
108
- - Fix address format in testnet
109
-
110
- ### Changed
111
-
112
- - Updated FunC stdlib
113
-
114
- ## [0.33.1] - 2025-05-16
115
-
116
- ### Fixed
117
-
118
- - Fixed blueprint build command failure in Tact projects
119
-
120
- ## [0.33.0] - 2025-05-16
121
-
122
- ### Added
123
-
124
- - Added `tact.config.json` support
125
- - Added tolk v0.12 support
126
-
127
- ### Fixed
128
-
129
- - Fixed tact counter deploy script error
130
-
131
- ## [0.32.1] - 2025-05-06
132
-
133
- ### Fixed
134
-
135
- - Fix unexpected code duplication on parralel compile
136
-
137
- ## [0.32.0] - 2025-05-02
138
-
139
- ### Added
140
-
141
- - Compiler version is now shown during contract build
142
- - Added 'All Contracts' option to build wizard
143
- - Added function to build all tact contracts, required for rebuilding before tests
144
-
145
- ### Changed
146
-
147
- - Made error of non-PascalCase contract names nicer
148
-
149
- ### Fixed
150
-
151
- - `blueprint build --all` now exits with a non-zero exit code on failure
152
-
153
- ## [0.31.1] - 2025-04-24
154
-
155
- ### Fixed
156
-
157
- - Fixed build directory creation
158
-
159
- ## [0.31.0] - 2025-04-24
160
-
161
- ### Added
162
-
163
- - Added Fift output for FunC and Tolk build command
164
- - Added API reference in code
165
-
166
- ### Changed
167
-
168
- - Improved CLI appearance
169
-
170
- ## [0.30.0] - 2025-04-08
171
-
172
- ### Fixed
173
-
174
- - Fixed Tact compilation
175
-
176
- ### Changed
177
-
178
- - Updated Tact templates and `@tact-lang/compiler` dependency to v1.6.5
179
-
180
- ## [0.29.0] - 2025-03-02
181
-
182
- ### Changed
183
-
184
- - Tolk's stderr is now printed on successful builds
185
-
186
- ## [0.28.0] - 2025-01-17
187
-
188
- ### Changed
189
-
190
- - Moved compilers to peer dependencies, allowing end users to use their preferred versions of compilers
191
-
192
- ## [0.27.0] - 2024-12-18
193
-
194
- ### Changed
195
-
196
- - Updated `@ton-community/func-js` dependency to v0.9.0
197
-
198
- ## [0.26.0] - 2024-11-26
199
-
200
- ### Added
201
-
202
- - Added support for tonapi as an API provider
203
-
204
- ## [0.25.0] - 2024-11-02
205
-
206
- ### Added
207
-
208
- - Support for Tolk, "next-generation FunC", a new language for writing smart contracts in TON. [Tolk overview](https://docs.ton.org/develop/tolk/overview)
209
-
210
- ## [0.24.0] - 2024-09-16
211
-
212
- ### Added
213
-
214
- - Added support for wallet v5 in the Mnemonic provider
215
-
216
- ### Changed
217
-
218
- - Changed the default API provider to Toncenter v2 (instead of Orbs TON Access). Rate limited requests are automatically retried
219
- - Updated dependencies
220
-
221
- ### Removed
222
-
223
- - Removed the specialized TonHub connector. Use TON Connect instead
224
-
225
- ## [0.23.0] - 2024-09-11
226
-
227
- ### Changed
228
-
229
- - Toncenter v2 is now used by default instead of orbs access. Rate limited API requests are automatically retried
230
-
231
- ### Removed
232
-
233
- - Removed `@orbs-network/ton-access` dependency
234
-
235
- ## [0.22.0] - 2024-07-08
236
-
237
- ### Added
238
-
239
- - Added support for scripts in subdirectories, for example `scripts/counter/deploy.ts`
240
- - Added the ability to specify test files in `blueprint test` command, for example `blueprint test Counter`
241
-
242
- ### Changed
243
-
244
- - Separated compilables and wrappers
245
-
246
- ### Fixed
247
-
248
- - Fixed `code overflow` error when generating QR code for ton:// link
249
-
250
- ## [0.21.0] - 2024-05-27
251
-
252
- ### Changed
253
-
254
- - Changed `contract.tact.template` counter template to return remaining value from the message
255
- - Updated TON Connect manifest
256
-
257
- ## [0.20.0] - 2024-05-07
258
-
259
- ### Added
260
-
261
- - Added auto-sourcing of root `tact.config.json` files for merging compilation options with `wrappers/*.compile.ts`
262
- - Added a warning for disabling `debug` in contract wrappers of Tact before doing production deployments
263
-
264
- ### Changed
265
-
266
- - Changed `@tact-lang/compiler` dependency to be `^1.3.0` instead of `^1.2.0`
267
- - Changed `compile.ts.template` template for Tact to have `debug` set to `true` by default
268
- - Changed `contract.tact.template` empty template for Tact to mention implicit empty `init()` function
269
-
270
- ## [0.19.1] - 2024-04-12
271
-
272
- ### Fixed
273
-
274
- - Fixed `verify` command
275
-
276
- ### Changed
277
-
278
- - Updated readme to reflect the fact that blueprint no longer automatically adds `jsonRPC` to custom v2 endpoints
279
-
280
- ## [0.19.0] - 2024-03-27
281
-
282
- ### Changed
283
-
284
- - Updated dependencies: func-js to 0.7.0, tonconnect sdk to 2.2.0
285
-
286
- ## [0.18.0] - 2024-03-13
287
-
288
- ### Changed
289
-
290
- - Changed `@tact-lang/compiler` dependency to be `^1.2.0` instead of `^1.1.5`
291
- - Updated the Tact counter template to use the new `+=` operator from Tact v1.2.0
292
-
293
- ## [0.17.0] - 2024-03-01
294
-
295
- This release contains a breaking change.
296
-
297
- ### Changed
298
-
299
- - Blueprint no longer automatically adds `jsonRPC` to custom v2 endpoints
300
-
301
- ### Added
302
-
303
- - Added `set` command which can currently set func version (run `blueprint set func`)
304
- - Added `open` and `getTransactions` to `WrappedContractProvider`
305
- - Added cell hash to build artifacts
306
-
307
- ## [0.16.0] - 2024-02-15
308
-
309
- ### Added
310
-
311
- - Added the `network` entry to the global config, which allows one to specify a custom network to be used instead of having to add `--custom` flags on each run
312
- - Added the `convert` command which attempts to convert a legacy bash build script into a blueprint `.compile.ts` file
313
- - Added the ability to pass any user data into the compile hooks
314
-
315
- ### Changed
316
-
317
- - Improved the `verify` command
318
-
319
- ## [0.15.0] - 2023-12-15
320
-
321
- ### Added
322
-
323
- - Added flags `--custom-version`, `--custom-key`, `--custom-type` to `run` and `verify` commands to allow better control over custom API behavior
324
-
325
- ### Changed
326
-
327
- - `--custom` now always adds `jsonRPC` to API URL for v2 APIs
328
-
329
- ### Fixed
330
-
331
- - Fixed argument handling
332
-
333
- ## [0.14.2] - 2023-12-01
334
-
335
- ### Changed
336
-
337
- - Changed `@tact-lang/compiler` dependency to be `^1.1.5` instead of `^1.1.3`
338
-
339
- ## [0.14.1] - 2023-12-01
340
-
341
- ### Fixed
342
-
343
- - Fixed test templates (added missing imports)
344
-
345
- ## [0.14.0] - 2023-11-23
346
-
347
- ### Added
348
-
349
- - Added `verify` command to quickly verify contracts on [verifier.ton.org](https://verifier.ton.org)
350
-
351
- ## [0.13.0] - 2023-11-05
352
-
353
- ### Added
354
-
355
- - Added plugin support
356
- - Added custom API v2 endpoints
357
-
358
- ### Changed
359
-
360
- - Improved docs
361
- - Changed deployed contract explorer link to use tonviewer
362
- - Moved `deployer` to the global `describe` context in default tests
363
-
364
- ## [0.12.1] - 2023-07-31
365
-
366
- ### Changed
367
-
368
- - Updated all dependencies to @ton organization packages
369
-
370
- ## [0.12.0] - 2023-07-14
371
-
372
- ### Fixed
373
-
374
- - Fixed Tact imports
375
- - Fixed missing newlines when printing error messages while building contracts
376
-
377
- ## [0.11.0] - 2023-07-03
378
-
379
- ### Added
380
-
381
- - Added an `options` field to the `tact` variant of `CompilerConfig`, which is of the same type as the `options` of the Tact compiler, and includes fields such as `debug`, `experimental`, etc
382
-
383
- ### Changed
384
-
385
- - Updated Tact to 1.1.3
386
-
387
- ## [0.10.0] - 2023-06-06
388
-
389
- ### Added
390
-
391
- - Added two optional fields to the `CompilerConfig`: `preCompileHook?: () => Promise<void>` and `postCompileHook?: (code: Cell) => Promise<void>`. The former one gets called before any compilation of the respective contract happens, the latter one - after any compilation with the compiled code cell (they are called both during the `build` command and when calling the `compile` function for the respective contracts)
392
-
393
- ### Changed
394
-
395
- - Changed the `run` command to only show `.ts` scripts
396
-
397
- ## [0.9.0] - 2023-04-21
398
-
399
- ### Changed
400
-
401
- - Updated dependencies, of note: func-js to use func 0.4.3, Tact to 1.1.1
402
-
403
- ## [0.8.0] - 2023-04-07
404
-
405
- ### Changed
406
-
407
- - Changed the `help` command to contain significantly more detailed help for every command
408
- - Added the `success: true` requirement to every template test
409
- - Updated dependencies
410
-
411
- ## [0.7.0] - 2023-04-03
412
-
413
- This release contains a breaking change.
414
-
415
- ### Changed
416
-
417
- - Changed the return type of `networkProvider.api()` and the type used internally in `NetworkProvider` from `TonClient` to `TonClient4`. This is a breaking change
418
- - Updated dependencies
419
-
420
- ## [0.6.1] - 2023-03-27
421
-
422
- ### Changed
423
-
424
- - Changed `UIProvider.prompt` return type from `Promise<void>` to `Promise<boolean>`
425
-
426
- ## [0.6.0] - 2023-03-21
427
-
428
- ### Added
429
-
430
- - Added support for [Tact](https://github.com/tact-lang/tact), including Tact smart contract templates
431
- - Added `--all` option for `build` command
432
-
433
- ### Changed
434
-
435
- - Updated dependencies
436
-
437
- ## [0.5.0] - 2023-03-13
438
-
439
- ### Changed
440
-
441
- - `SendProvider` now returns `Promise<any>` instead of `Promise<void>` from `sendTransaction`. This allows providers using TON Connect and TonHub to return the results from their backends to the end user
442
-
443
- ## [0.4.1] - 2023-03-02
444
-
445
- ### Changed
446
-
447
- - Changed ton peer dependency version to `>=13.4.1`
448
-
449
- ## [0.4.0] - 2023-03-01
450
-
451
- This release contains a breaking change.
452
-
453
- ### Changed
454
-
455
- - Changed ton-core peer dependency version to `>=0.48.0`. This is a breaking change
456
-
457
- ### Added
458
-
459
- - Added a new mnemonic deployer. Environment variables `WALLET_MNEMONIC` and `WALLET_VERSION` must be set, or a .env file with them must be present in order for it to be usable. Tonkeeper's v4R2 wallet corresponds to v4 version in blueprint
460
- - Added the ability to choose the explorer for the deployed contracts. Pass one of the CLI flags `--tonscan`, `--tonapi`, `--toncx`, `--dton` to choose. Tonscan is the default
461
- - Added ton-crypto peer dependency of version `>=3.2.0`
462
-
463
- ### Fixed
464
-
465
- - Fixed TonHub deployer's `Sent transaction` message
466
- - Fixed `SendMode.PAY_GAS_SEPARATLY` (missing E) typo in accordance with ton-core update
467
- - Fixed a crash when using `blueprint run` with flags but no file name
468
-
469
- ## [0.3.0] - 2023-02-27
470
-
471
- ### Added
472
-
473
- - Added an increment counter script for the counter template
474
- - Added `isContractDeployed(address)` method to `NetworkProvider`
475
- - Added `waitForDeploy(address, attempts?, sleepDuration?)` method to `NetworkProvider`
476
-
477
- ### Fixed
478
-
479
- - Fixed exit code 1 on Windows even in case of successful execution
480
- - Fixed paths to `.fc` files in `.compile.ts` files on Windows
481
- - Fixed `TonConnectProvider` output
482
-
483
- ### Changed
484
-
485
- - Converted ```Deployer sender does not support `bounce` ``` error into a warning
486
- - Added an optional `init?: { code?: Cell; data?: Cell }` argument to `provider` method on `NetworkProvider`
487
- - `createNetworkProvider` now requires a `UIProvider`
488
- - Removed excessive comments from counter template contract
489
- - Changed deploy script templates to use `sendDeploy` and `waitForDeploy` instead of `deploy`
490
- - Refactored test templates to create `Blockchain` and deploy contract in `beforeEach`
491
- - Disabled file choice menu when there is only 1 file
492
-
493
- ### Deprecated
494
-
495
- - Deprecated `deploy` method on `NetworkProvider`. Users are advised to use self-implemented `sendDeploy` (or similar) methods on their `Contract` instances together with `isContractDeployed` or `waitForDeploy` on `NetworkProvider`
496
-
497
- ## [0.2.0] - 2023-02-09
498
-
499
- ### Added
500
-
501
- - Added `blueprint test` command
502
- - Added a pretty help message
503
- - Added a hint to indicate that contract names must be PascalCase, and a restriction that contract names must start with a capital letter
504
- - Added a better error message on an unknown command
505
-
506
- ### Fixed
507
-
508
- - Fixed counter templates
509
- - Fixed an issue where using `networkProvider.provider` and `networkProvider.open` would lead to `Deployer sender does not support "bounce"` message when trying to send internal messages
510
-
511
- ### Changed
512
-
513
- - `networkProvider.provider` and `networkProvider.open` now wrap `TonClient`'s `ContractProvider` instead of directly using it for better control over passed arguments
514
- - Removed unnecessary `await` keywords from all templates
515
-
516
- ## [0.1.0] - 2023-02-03
517
-
518
- ### Added
519
-
520
- - Added fully interactive and fully non-interactive modes for the `create` command
521
- - Added `input(message)` method to `UIProvider` and `InquirerUIProvider`
522
-
523
- ### Fixed
524
-
525
- - File selection (compilation files in `build` and scripts in `run`) now accepts CLI argument hints in any case