@ton/blueprint 0.28.0 → 0.30.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 +21 -5
- package/README.md +1 -1
- package/dist/build.js +3 -0
- package/dist/cli/constants.js +3 -3
- package/dist/compile/CompilerConfig.d.ts +2 -2
- package/dist/compile/compile.js +1 -1
- package/dist/templates/tact/counter/contracts/contract.tact.template +17 -12
- package/dist/templates/tact/counter/scripts/deploy.ts.template +2 -5
- package/dist/templates/tact/counter/scripts/increment.ts.template +0 -1
- package/dist/templates/tact/counter/tests/spec.ts.template +2 -6
- package/dist/templates/tact/empty/contracts/contract.tact.template +17 -7
- package/dist/templates/tact/empty/scripts/deploy.ts.template +1 -4
- package/dist/templates/tact/empty/tests/spec.ts.template +1 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ 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.30.0] - 2025-04-08
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Fixed Tact compilation
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Updated Tact templates and `@tact-lang/compiler` dependency to v1.6.5
|
|
17
|
+
|
|
18
|
+
## [0.29.0] - 2025-03-02
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Tolk's stderr is now printed on successful builds
|
|
23
|
+
|
|
8
24
|
## [0.28.0] - 2025-01-17
|
|
9
25
|
|
|
10
26
|
### Changed
|
|
@@ -193,18 +209,18 @@ This release contains a breaking change.
|
|
|
193
209
|
|
|
194
210
|
### Fixed
|
|
195
211
|
|
|
196
|
-
- Fixed
|
|
212
|
+
- Fixed Tact imports
|
|
197
213
|
- Fixed missing newlines when printing error messages while building contracts
|
|
198
214
|
|
|
199
215
|
## [0.11.0] - 2023-07-03
|
|
200
216
|
|
|
201
217
|
### Added
|
|
202
218
|
|
|
203
|
-
- Added an `options` field to the `tact` variant of `CompilerConfig`, which is of the same type as the `options` of the
|
|
219
|
+
- 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
|
|
204
220
|
|
|
205
221
|
### Changed
|
|
206
222
|
|
|
207
|
-
- Updated
|
|
223
|
+
- Updated Tact to 1.1.3
|
|
208
224
|
|
|
209
225
|
## [0.10.0] - 2023-06-06
|
|
210
226
|
|
|
@@ -220,7 +236,7 @@ This release contains a breaking change.
|
|
|
220
236
|
|
|
221
237
|
### Changed
|
|
222
238
|
|
|
223
|
-
- Updated dependencies, of note: func-js to use func 0.4.3,
|
|
239
|
+
- Updated dependencies, of note: func-js to use func 0.4.3, Tact to 1.1.1
|
|
224
240
|
|
|
225
241
|
## [0.8.0] - 2023-04-07
|
|
226
242
|
|
|
@@ -249,7 +265,7 @@ This release contains a breaking change.
|
|
|
249
265
|
|
|
250
266
|
### Added
|
|
251
267
|
|
|
252
|
-
- Added support for [
|
|
268
|
+
- Added support for [Tact](https://github.com/tact-lang/tact), including Tact smart contract templates
|
|
253
269
|
- Added `--all` option for `build` command
|
|
254
270
|
|
|
255
271
|
### Changed
|
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ Blueprint is an all-in-one development environment designed to enhance the proce
|
|
|
60
60
|
|
|
61
61
|
* [Node.js](https://nodejs.org) with a recent version like v18. Version can be verified with `node -v`
|
|
62
62
|
* IDE with TON support:
|
|
63
|
-
* [Visual Studio Code](https://code.visualstudio.com/) with the [FunC plugin](https://marketplace.visualstudio.com/items?itemName=tonwhales.func-vscode)
|
|
63
|
+
* [Visual Studio Code](https://code.visualstudio.com/) with the [FunC plugin](https://marketplace.visualstudio.com/items?itemName=tonwhales.func-vscode), [Tolk plugin](https://marketplace.visualstudio.com/items?itemName=ton-core.tolk-vscode) or [Tact plugin](https://marketplace.visualstudio.com/items?itemName=tonstudio.vscode-tact)
|
|
64
64
|
* [IntelliJ IDEA](https://www.jetbrains.com/idea/) with the [TON Development plugin](https://plugins.jetbrains.com/plugin/23382-ton)
|
|
65
65
|
|
|
66
66
|
## Features overview
|
package/dist/build.js
CHANGED
|
@@ -39,6 +39,9 @@ async function buildOne(contract, ui) {
|
|
|
39
39
|
hex: cell.toBoc().toString('hex'),
|
|
40
40
|
};
|
|
41
41
|
ui?.clearActionPrompt();
|
|
42
|
+
if (result.lang === 'tolk') {
|
|
43
|
+
ui?.write(`\n${result.stderr}`);
|
|
44
|
+
}
|
|
42
45
|
ui?.write('\n✅ Compiled successfully! Cell BOC result:\n\n');
|
|
43
46
|
ui?.write(JSON.stringify(res, null, 2));
|
|
44
47
|
await promises_1.default.mkdir(paths_1.BUILD_DIR, { recursive: true });
|
package/dist/cli/constants.js
CHANGED
|
@@ -11,7 +11,7 @@ exports.templateTypes = [
|
|
|
11
11
|
value: 'tolk-empty',
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
name: 'An empty contract (
|
|
14
|
+
name: 'An empty contract (Tact)',
|
|
15
15
|
value: 'tact-empty',
|
|
16
16
|
},
|
|
17
17
|
{
|
|
@@ -23,7 +23,7 @@ exports.templateTypes = [
|
|
|
23
23
|
value: 'tolk-counter',
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
name: 'A simple counter contract (
|
|
26
|
+
name: 'A simple counter contract (Tact)',
|
|
27
27
|
value: 'tact-counter',
|
|
28
28
|
},
|
|
29
29
|
];
|
|
@@ -70,7 +70,7 @@ Flags:
|
|
|
70
70
|
--tonscan, --tonviewer, --toncx, --dton - specifies the network explorer to use when displaying links to the deployed contracts. Default: tonviewer.`,
|
|
71
71
|
build: `Usage: blueprint build [contract name] [flags]
|
|
72
72
|
|
|
73
|
-
Builds the specified contract according to the respective .compile.ts file. If the contract is written in
|
|
73
|
+
Builds the specified contract according to the respective .compile.ts file. If the contract is written in Tact, all Tact-generated files (wrapper class, etc) will be placed in the build/<contract name> folder.
|
|
74
74
|
|
|
75
75
|
If contract name is not specified on the command line, the buildable contracts (that have the respective .compile.ts files under wrappers directory) will be presented interactively, unless --all flag is specified.
|
|
76
76
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SourceResolver, SourcesMap, SourcesArray } from '@ton-community/func-js';
|
|
2
2
|
import { Cell } from '@ton/core';
|
|
3
|
-
import {
|
|
3
|
+
import { Options } from '@tact-lang/compiler';
|
|
4
4
|
export type HookParams = {
|
|
5
5
|
userData?: any;
|
|
6
6
|
};
|
|
@@ -11,7 +11,7 @@ export type CommonCompilerConfig = {
|
|
|
11
11
|
export type TactCompilerConfig = {
|
|
12
12
|
lang: 'tact';
|
|
13
13
|
target: string;
|
|
14
|
-
options?:
|
|
14
|
+
options?: Options;
|
|
15
15
|
};
|
|
16
16
|
export type FuncCompilerConfig = {
|
|
17
17
|
lang?: 'func';
|
package/dist/compile/compile.js
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
{{snakeName}}.tact
|
|
2
|
-
import "@stdlib/deploy";
|
|
3
|
-
|
|
4
2
|
message Add {
|
|
5
|
-
queryId: Int as uint64;
|
|
6
3
|
amount: Int as uint32;
|
|
7
4
|
}
|
|
8
5
|
|
|
9
|
-
contract {{name}}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
contract {{name}}(
|
|
7
|
+
// Persistent state variables declared via the
|
|
8
|
+
// contract parameters syntax, which was introduced in v1.6.0
|
|
9
|
+
//
|
|
10
|
+
// See: https://docs.tact-lang.org/book/contracts/#parameters
|
|
11
|
+
id: Int as uint32,
|
|
12
|
+
counter: Int as uint32,
|
|
13
|
+
) {
|
|
14
|
+
// Empty receiver for the deployment,
|
|
15
|
+
// which expects the `null` message body
|
|
16
|
+
receive() {
|
|
17
|
+
// Forward the remaining value in the
|
|
18
|
+
// incoming message back to the sender
|
|
19
|
+
cashback(sender());
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
receive(msg: Add) {
|
|
19
23
|
self.counter += msg.amount;
|
|
20
24
|
|
|
21
|
-
//
|
|
22
|
-
|
|
25
|
+
// Forward the remaining value in the
|
|
26
|
+
// incoming message back to the sender
|
|
27
|
+
cashback(sender());
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
get fun counter(): Int {
|
|
@@ -4,17 +4,14 @@ import { {{name}} } from '../wrappers/{{name}}';
|
|
|
4
4
|
import { NetworkProvider } from '@ton/blueprint';
|
|
5
5
|
|
|
6
6
|
export async function run(provider: NetworkProvider) {
|
|
7
|
-
const {{loweredName}} = provider.open(await {{name}}.fromInit(BigInt(Math.floor(Math.random() * 10000))));
|
|
7
|
+
const {{loweredName}} = provider.open(await {{name}}.fromInit(BigInt(Math.floor(Math.random() * 10000))), 0n);
|
|
8
8
|
|
|
9
9
|
await {{loweredName}}.send(
|
|
10
10
|
provider.sender(),
|
|
11
11
|
{
|
|
12
12
|
value: toNano('0.05'),
|
|
13
13
|
},
|
|
14
|
-
|
|
15
|
-
$$type: 'Deploy',
|
|
16
|
-
queryId: 0n,
|
|
17
|
-
}
|
|
14
|
+
null,
|
|
18
15
|
);
|
|
19
16
|
|
|
20
17
|
await provider.waitForDeploy({{loweredName}}.address);
|
|
@@ -12,7 +12,7 @@ describe('{{name}}', () => {
|
|
|
12
12
|
beforeEach(async () => {
|
|
13
13
|
blockchain = await Blockchain.create();
|
|
14
14
|
|
|
15
|
-
{{loweredName}} = blockchain.openContract(await {{name}}.fromInit(0n));
|
|
15
|
+
{{loweredName}} = blockchain.openContract(await {{name}}.fromInit(0n, 0n));
|
|
16
16
|
|
|
17
17
|
deployer = await blockchain.treasury('deployer');
|
|
18
18
|
|
|
@@ -21,10 +21,7 @@ describe('{{name}}', () => {
|
|
|
21
21
|
{
|
|
22
22
|
value: toNano('0.05'),
|
|
23
23
|
},
|
|
24
|
-
|
|
25
|
-
$$type: 'Deploy',
|
|
26
|
-
queryId: 0n,
|
|
27
|
-
}
|
|
24
|
+
null,
|
|
28
25
|
);
|
|
29
26
|
|
|
30
27
|
expect(deployResult.transactions).toHaveTransaction({
|
|
@@ -62,7 +59,6 @@ describe('{{name}}', () => {
|
|
|
62
59
|
},
|
|
63
60
|
{
|
|
64
61
|
$$type: 'Add',
|
|
65
|
-
queryId: 0n,
|
|
66
62
|
amount: increaseBy,
|
|
67
63
|
}
|
|
68
64
|
);
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
{{snakeName}}.tact
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
// Since v1.6.0, Tact has a contract parameters syntax that can supersede
|
|
3
|
+
// lazy initialization by init() for all contracts that do not require specific on-chain
|
|
4
|
+
// deployment logic that must be run only once in the `init()` function.
|
|
5
|
+
//
|
|
6
|
+
// Note that the empty parameter list above is still a parameter list,
|
|
7
|
+
// meaning that the contract won't have an implicit or explicit `init(){:tact}` function
|
|
8
|
+
// and will enjoy storage write optimizations and use less gas overall.
|
|
9
|
+
//
|
|
10
|
+
// See: https://docs.tact-lang.org/book/contracts/#parameters
|
|
11
|
+
contract {{name}}() {
|
|
12
|
+
// Empty receiver for the deployment,
|
|
13
|
+
// which expects the `null` message body
|
|
14
|
+
receive() {
|
|
15
|
+
// Forward the remaining value in the
|
|
16
|
+
// incoming message back to the sender
|
|
17
|
+
cashback(sender());
|
|
18
|
+
}
|
|
9
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ton/blueprint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Framework for development of TON smart contracts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": "./dist/cli/cli.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"format": "prettier --write src"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@tact-lang/compiler": "^1.5
|
|
22
|
+
"@tact-lang/compiler": "^1.6.5",
|
|
23
23
|
"@ton-community/func-js": "^0.9.0",
|
|
24
24
|
"@ton/core": "^0.59.0",
|
|
25
25
|
"@ton/crypto": "^3.3.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"typescript": "^4.9.5"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@tact-lang/compiler": ">=1.5
|
|
35
|
+
"@tact-lang/compiler": ">=1.6.5",
|
|
36
36
|
"@ton-community/func-js": ">=0.9.0",
|
|
37
37
|
"@ton/core": ">=0.59.0",
|
|
38
38
|
"@ton/crypto": ">=3.3.0",
|