@ton/blueprint 0.41.0 → 0.42.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 +10 -0
- package/LICENSE +21 -0
- package/dist/cli/constants.js +2 -0
- package/dist/cli/test.d.ts +1 -1
- package/dist/cli/test.js +4 -1
- package/dist/compile/SupportedLang.d.ts +1 -0
- package/dist/compile/SupportedLang.js +2 -0
- package/dist/compile/compile.d.ts +2 -1
- package/dist/config/CustomNetwork.d.ts +4 -2
- package/dist/network/NetworkProvider.d.ts +3 -2
- package/dist/network/NetworkVersion.d.ts +1 -0
- package/dist/network/NetworkVersion.js +2 -0
- package/dist/templates/func/counter/wrappers/wrapper.ts.template +13 -1
- package/dist/templates/func/empty/wrappers/wrapper.ts.template +13 -1
- package/dist/templates/tolk/counter/wrappers/wrapper.ts.template +13 -1
- package/dist/templates/tolk/empty/wrappers/wrapper.ts.template +13 -1
- package/package.json +4 -4
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.42.0] - 2025-12-04
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Added `blueprint test --ui` command
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Changed `@ton/sandbox` peer dependency to `>=0.40.0`
|
|
17
|
+
|
|
8
18
|
## [0.41.0] - 2025-09-23
|
|
9
19
|
|
|
10
20
|
### Added
|
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/constants.js
CHANGED
|
@@ -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')}
|
package/dist/cli/test.d.ts
CHANGED
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: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type SupportedLang = 'tact' | 'tolk' | 'func';
|
|
@@ -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:
|
|
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?:
|
|
5
|
+
version?: NetworkVersion;
|
|
4
6
|
key?: string;
|
|
5
|
-
type?:
|
|
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 {
|
|
19
|
+
* @returns {Network} The type of network.
|
|
19
20
|
*/
|
|
20
|
-
network():
|
|
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';
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
{{name}}.ts
|
|
2
|
-
import {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ton/blueprint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"description": "Framework for development of TON smart contracts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": "./dist/cli/cli.js",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"@ton-community/func-js": "^0.10.0",
|
|
27
27
|
"@ton/core": "^0.61.0",
|
|
28
28
|
"@ton/crypto": "^3.3.0",
|
|
29
|
-
"@ton/sandbox": "^0.
|
|
29
|
+
"@ton/sandbox": "^0.40.0",
|
|
30
30
|
"@ton/tolk-js": "^1.0.0",
|
|
31
31
|
"@ton/ton": "^15.3.1",
|
|
32
|
-
"@ton/toolchain": "the-ton-tech/toolchain#v1.
|
|
32
|
+
"@ton/toolchain": "the-ton-tech/toolchain#v1.6.0",
|
|
33
33
|
"@types/inquirer": "^8.2.6",
|
|
34
34
|
"@types/jest": "^30.0.0",
|
|
35
35
|
"@types/node": "^20.2.5",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@ton-community/func-js": ">=0.10.0",
|
|
46
46
|
"@ton/core": ">=0.61.0",
|
|
47
47
|
"@ton/crypto": ">=3.3.0",
|
|
48
|
-
"@ton/sandbox": "
|
|
48
|
+
"@ton/sandbox": ">=0.40.0",
|
|
49
49
|
"@ton/tolk-js": ">=0.13.0",
|
|
50
50
|
"@ton/ton": ">=15.2.1"
|
|
51
51
|
},
|