@ton/blueprint 0.29.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 +15 -5
- package/README.md +1 -1
- 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,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.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
|
+
|
|
8
18
|
## [0.29.0] - 2025-03-02
|
|
9
19
|
|
|
10
20
|
### Changed
|
|
@@ -199,18 +209,18 @@ This release contains a breaking change.
|
|
|
199
209
|
|
|
200
210
|
### Fixed
|
|
201
211
|
|
|
202
|
-
- Fixed
|
|
212
|
+
- Fixed Tact imports
|
|
203
213
|
- Fixed missing newlines when printing error messages while building contracts
|
|
204
214
|
|
|
205
215
|
## [0.11.0] - 2023-07-03
|
|
206
216
|
|
|
207
217
|
### Added
|
|
208
218
|
|
|
209
|
-
- 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
|
|
210
220
|
|
|
211
221
|
### Changed
|
|
212
222
|
|
|
213
|
-
- Updated
|
|
223
|
+
- Updated Tact to 1.1.3
|
|
214
224
|
|
|
215
225
|
## [0.10.0] - 2023-06-06
|
|
216
226
|
|
|
@@ -226,7 +236,7 @@ This release contains a breaking change.
|
|
|
226
236
|
|
|
227
237
|
### Changed
|
|
228
238
|
|
|
229
|
-
- 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
|
|
230
240
|
|
|
231
241
|
## [0.8.0] - 2023-04-07
|
|
232
242
|
|
|
@@ -255,7 +265,7 @@ This release contains a breaking change.
|
|
|
255
265
|
|
|
256
266
|
### Added
|
|
257
267
|
|
|
258
|
-
- Added support for [
|
|
268
|
+
- Added support for [Tact](https://github.com/tact-lang/tact), including Tact smart contract templates
|
|
259
269
|
- Added `--all` option for `build` command
|
|
260
270
|
|
|
261
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/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",
|