@ton/blueprint 0.35.0 → 0.36.0-dev.20250609174628.e67475d
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 +6 -0
- package/dist/build.js +3 -5
- package/dist/cli/cli.js +1 -0
- package/dist/cli/constants.js +1 -1
- package/dist/cli/convert.js +3 -3
- package/dist/cli/create.js +1 -1
- package/dist/cli/pack.js +6 -3
- package/dist/cli/rename.js +6 -3
- package/dist/cli/run.js +2 -2
- package/dist/cli/set.js +2 -2
- package/dist/cli/verify.js +3 -3
- package/dist/compile/compile.js +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/network/NetworkProvider.d.ts +34 -3
- package/dist/network/createNetworkProvider.js +28 -8
- package/dist/network/send/DeeplinkProvider.js +1 -1
- package/dist/network/send/MnemonicProvider.d.ts +1 -1
- package/dist/network/send/MnemonicProvider.js +4 -1
- package/dist/network/storage/FSStorage.js +1 -1
- package/dist/ui/InquirerUIProvider.d.ts +1 -1
- package/dist/ui/InquirerUIProvider.js +1 -1
- package/dist/utils/selection.utils.js +8 -2
- package/package.json +8 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ 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
|
+
## Unreleased
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Added `getConfig` and `getContractState` methods to network provider
|
|
13
|
+
|
|
8
14
|
## [0.35.0] - 2025-06-02
|
|
9
15
|
|
|
10
16
|
### Added
|
package/dist/build.js
CHANGED
|
@@ -17,8 +17,9 @@ async function buildOne(contract, ui) {
|
|
|
17
17
|
const buildArtifactPath = path_1.default.join(paths_1.BUILD_DIR, `${contract}.compiled.json`);
|
|
18
18
|
try {
|
|
19
19
|
await promises_1.default.unlink(buildArtifactPath);
|
|
20
|
+
// eslint-disable-next-line no-empty
|
|
20
21
|
}
|
|
21
|
-
catch (
|
|
22
|
+
catch (_) { }
|
|
22
23
|
ui?.setActionPrompt('⏳ Compiling...');
|
|
23
24
|
try {
|
|
24
25
|
const config = await (0, compile_1.getCompilerConfigForContract)(contract);
|
|
@@ -83,9 +84,6 @@ async function buildAllTact(ui) {
|
|
|
83
84
|
.filter((file) => (0, compile_1.extractCompilableConfig)(file.path).lang === 'tact')
|
|
84
85
|
.map((file) => file.name);
|
|
85
86
|
const tactConfig = (0, tact_config_1.getRootTactConfig)();
|
|
86
|
-
const tactContracts = [
|
|
87
|
-
...legacyTactContract,
|
|
88
|
-
...tactConfig.projects.map((project) => project.name),
|
|
89
|
-
];
|
|
87
|
+
const tactContracts = [...legacyTactContract, ...tactConfig.projects.map((project) => project.name)];
|
|
90
88
|
await buildContracts(tactContracts, ui);
|
|
91
89
|
}
|
package/dist/cli/cli.js
CHANGED
package/dist/cli/constants.js
CHANGED
|
@@ -54,7 +54,7 @@ Blueprint is generally invoked as follows:
|
|
|
54
54
|
${chalk_1.default.cyan('blueprint')} ${chalk_1.default.yellow('[command]')} ${chalk_1.default.gray('[command-args]')} ${chalk_1.default.gray('[flags]')}
|
|
55
55
|
|
|
56
56
|
${chalk_1.default.bold('List of available commands:')}
|
|
57
|
-
${availableCommands.map(c => `- ${chalk_1.default.green(c)}`).join('\n')}`,
|
|
57
|
+
${availableCommands.map((c) => `- ${chalk_1.default.green(c)}`).join('\n')}`,
|
|
58
58
|
create: `${chalk_1.default.bold('Usage:')} blueprint ${chalk_1.default.cyan('create')} ${chalk_1.default.yellow('[contract name]')} ${chalk_1.default.gray('[flags]')}
|
|
59
59
|
|
|
60
60
|
Creates a new contract together with supporting files according to a template.
|
package/dist/cli/convert.js
CHANGED
|
@@ -44,7 +44,7 @@ function findFile(dir, filename) {
|
|
|
44
44
|
}
|
|
45
45
|
return foundPath;
|
|
46
46
|
}
|
|
47
|
-
function parseCompileString(str, src_dir,
|
|
47
|
+
function parseCompileString(str, src_dir, _ui) {
|
|
48
48
|
// Naive but does the job
|
|
49
49
|
const tokens = str.split(/\\?\s+/).filter((t) => t != '\\');
|
|
50
50
|
const outputIdx = tokens.indexOf('-o');
|
|
@@ -52,7 +52,7 @@ function parseCompileString(str, src_dir, ui) {
|
|
|
52
52
|
throw new Error('No output flag (-o) found in command:' + str);
|
|
53
53
|
}
|
|
54
54
|
const outFile = tokens[outputIdx + 1];
|
|
55
|
-
const outputName = outFile.match(/([A-Za-z0-9\-_
|
|
55
|
+
const outputName = outFile.match(/([A-Za-z0-9\-_\\/]*)/);
|
|
56
56
|
if (outputName === null) {
|
|
57
57
|
throw new Error(`Something went wrong when parsing output from ${outFile}`);
|
|
58
58
|
}
|
|
@@ -80,7 +80,7 @@ function parseCompileString(str, src_dir, ui) {
|
|
|
80
80
|
targets: sourceFiles.join(','),
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
const convert = async (
|
|
83
|
+
const convert = async (_args, ui) => {
|
|
84
84
|
const localArgs = (0, arg_1.default)({ ...createNetworkProvider_1.argSpec, ...constants_1.helpArgs });
|
|
85
85
|
if (localArgs['--help']) {
|
|
86
86
|
ui.write(constants_1.helpMessages['convert']);
|
package/dist/cli/create.js
CHANGED
|
@@ -70,7 +70,7 @@ function addToTactConfig(contractName, contractPath) {
|
|
|
70
70
|
};
|
|
71
71
|
(0, tact_config_1.updateRootTactConfig)(newConfig);
|
|
72
72
|
}
|
|
73
|
-
const create = async (
|
|
73
|
+
const create = async (_args, ui) => {
|
|
74
74
|
const localArgs = (0, arg_1.default)({
|
|
75
75
|
'--type': String,
|
|
76
76
|
...constants_1.helpArgs,
|
package/dist/cli/pack.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.pack = void 0;
|
|
7
7
|
const child_process_1 = require("child_process");
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const arg_1 = __importDefault(require("arg"));
|
|
10
9
|
const fs_1 = require("fs");
|
|
10
|
+
const arg_1 = __importDefault(require("arg"));
|
|
11
11
|
const constants_1 = require("./constants");
|
|
12
12
|
const build_1 = require("../build");
|
|
13
13
|
const paths_1 = require("../paths");
|
|
@@ -64,7 +64,7 @@ async function correctPackageJson() {
|
|
|
64
64
|
};
|
|
65
65
|
await fs_1.promises.writeFile(paths_1.PACKAGE_JSON, JSON.stringify(newPackageJson, null, 2));
|
|
66
66
|
}
|
|
67
|
-
const pack = async (
|
|
67
|
+
const pack = async (_args, ui, _context) => {
|
|
68
68
|
const localArgs = (0, arg_1.default)({
|
|
69
69
|
'--no-warn': Boolean,
|
|
70
70
|
'-n': '--no-warn',
|
|
@@ -89,7 +89,10 @@ const pack = async (args, ui, context) => {
|
|
|
89
89
|
ui.write('🛠️ Updating tsconfig.json...');
|
|
90
90
|
await correctTsConfig();
|
|
91
91
|
ui.write('🏗️ Building package...');
|
|
92
|
-
await fs_1.promises.rm(path_1.default.join(process.cwd(), 'dist'), {
|
|
92
|
+
await fs_1.promises.rm(path_1.default.join(process.cwd(), 'dist'), {
|
|
93
|
+
recursive: true,
|
|
94
|
+
force: true,
|
|
95
|
+
});
|
|
93
96
|
(0, child_process_1.execSync)(`tsc`, { stdio: 'inherit' });
|
|
94
97
|
ui.write('📝 Updating package.json...');
|
|
95
98
|
await correctPackageJson();
|
package/dist/cli/rename.js
CHANGED
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.rename = void 0;
|
|
7
7
|
exports.renameExactIfRequired = renameExactIfRequired;
|
|
8
|
-
const arg_1 = __importDefault(require("arg"));
|
|
9
8
|
const fs_1 = require("fs");
|
|
10
9
|
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const arg_1 = __importDefault(require("arg"));
|
|
11
11
|
const paths_1 = require("../paths");
|
|
12
12
|
const Runner_1 = require("./Runner");
|
|
13
13
|
const utils_1 = require("../utils");
|
|
@@ -35,7 +35,10 @@ class RenameContext {
|
|
|
35
35
|
if (!(0, fs_1.existsSync)(directory)) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
const dir = await fs_1.promises.readdir(directory, {
|
|
38
|
+
const dir = await fs_1.promises.readdir(directory, {
|
|
39
|
+
recursive: true,
|
|
40
|
+
withFileTypes: true,
|
|
41
|
+
});
|
|
39
42
|
await Promise.all(dir.map(async (dir) => {
|
|
40
43
|
if (!dir.isFile()) {
|
|
41
44
|
return;
|
|
@@ -61,7 +64,7 @@ class RenameContext {
|
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
|
-
const rename = async (
|
|
67
|
+
const rename = async (_args, ui, _context) => {
|
|
65
68
|
const localArgs = (0, arg_1.default)(constants_1.helpArgs);
|
|
66
69
|
if (localArgs['--help']) {
|
|
67
70
|
ui.write(constants_1.helpMessages['rename']);
|
package/dist/cli/run.js
CHANGED
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.run = void 0;
|
|
7
|
+
const arg_1 = __importDefault(require("arg"));
|
|
7
8
|
const Runner_1 = require("./Runner");
|
|
8
9
|
const createNetworkProvider_1 = require("../network/createNetworkProvider");
|
|
9
10
|
const utils_1 = require("../utils");
|
|
10
|
-
const arg_1 = __importDefault(require("arg"));
|
|
11
11
|
const constants_1 = require("./constants");
|
|
12
|
-
const run = async (
|
|
12
|
+
const run = async (_args, ui, context) => {
|
|
13
13
|
const localArgs = (0, arg_1.default)({ ...createNetworkProvider_1.argSpec, ...constants_1.helpArgs });
|
|
14
14
|
if (localArgs['--help']) {
|
|
15
15
|
ui.write(constants_1.helpMessages['run']);
|
package/dist/cli/set.js
CHANGED
|
@@ -23,7 +23,7 @@ const getVersions = (pkg, ui) => {
|
|
|
23
23
|
resolve(resJson);
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
|
-
reject(new TypeError(
|
|
26
|
+
reject(new TypeError('Expect json array on stdout, but got:\n' + stdout));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
catch (e) {
|
|
@@ -36,7 +36,7 @@ const getVersions = (pkg, ui) => {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
if (error) {
|
|
39
|
-
ui.write(
|
|
39
|
+
ui.write('Failed to get func-js-bin package versions!');
|
|
40
40
|
reject(error);
|
|
41
41
|
}
|
|
42
42
|
});
|
package/dist/cli/verify.js
CHANGED
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.verify = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
7
8
|
const core_1 = require("@ton/core");
|
|
9
|
+
const arg_1 = __importDefault(require("arg"));
|
|
8
10
|
const compile_1 = require("../compile/compile");
|
|
9
11
|
const Runner_1 = require("./Runner");
|
|
10
|
-
const path_1 = __importDefault(require("path"));
|
|
11
12
|
const createNetworkProvider_1 = require("../network/createNetworkProvider");
|
|
12
13
|
const build_1 = require("./build");
|
|
13
14
|
const utils_1 = require("../utils");
|
|
14
|
-
const arg_1 = __importDefault(require("arg"));
|
|
15
15
|
const constants_1 = require("./constants");
|
|
16
16
|
const backends = {
|
|
17
17
|
mainnet: {
|
|
@@ -121,7 +121,7 @@ async function lookupCodeHash(hash, ui, retryCount = 5) {
|
|
|
121
121
|
} while (!done && retryCount > 0);
|
|
122
122
|
return foundAddr;
|
|
123
123
|
}
|
|
124
|
-
const verify = async (
|
|
124
|
+
const verify = async (_args, ui, context) => {
|
|
125
125
|
const localArgs = (0, arg_1.default)({ ...createNetworkProvider_1.argSpec, ...constants_1.helpArgs });
|
|
126
126
|
if (localArgs['--help']) {
|
|
127
127
|
ui.write(constants_1.helpMessages['verify']);
|
package/dist/compile/compile.js
CHANGED
|
@@ -23,6 +23,7 @@ async function getCompilablesDirectory() {
|
|
|
23
23
|
return paths_1.WRAPPERS_DIR;
|
|
24
24
|
}
|
|
25
25
|
function extractCompilableConfig(path) {
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
26
27
|
const mod = require(path);
|
|
27
28
|
if (typeof mod.compile !== 'object') {
|
|
28
29
|
throw new Error(`Object 'compile' is missing`);
|
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, TolkCompileResult, FuncCompileResult, TactCompileResult, CompileResult } from './compile/compile';
|
|
4
|
+
export { compile, CompileOpts, TolkCompileResult, FuncCompileResult, TactCompileResult, CompileResult, } 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';
|
|
@@ -9,5 +9,5 @@ export { Args, Runner, RunnerContext } from './cli/Runner';
|
|
|
9
9
|
export { PluginRunner, Plugin } from './config/Plugin';
|
|
10
10
|
export { CustomNetwork } from './config/CustomNetwork';
|
|
11
11
|
export { buildOne, buildAll, buildAllTact } from './build';
|
|
12
|
-
export { SourceSnapshot } from
|
|
12
|
+
export { SourceSnapshot } from './compile/SourceSnapshot';
|
|
13
13
|
export { getCompilerConfigForContract } from './compile/compile';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { TonClient, TonClient4 } from '@ton/ton';
|
|
2
|
-
import { Address, Cell, Contract, ContractProvider, OpenedContract, Sender } from '@ton/core';
|
|
1
|
+
import { parseFullConfig, TonClient, TonClient4 } from '@ton/ton';
|
|
2
|
+
import { Address, Cell, Contract, ContractProvider, ContractState, OpenedContract, Sender } from '@ton/core';
|
|
3
3
|
import { ContractAdapter } from '@ton-api/ton-adapter';
|
|
4
|
+
import { LiteClient } from 'ton-lite-client';
|
|
4
5
|
import { UIProvider } from '../ui/UIProvider';
|
|
5
|
-
import { LiteClient } from "ton-lite-client";
|
|
6
6
|
export type BlueprintTonClient = TonClient4 | TonClient | ContractAdapter | LiteClient;
|
|
7
|
+
type BlockchainConfig = ReturnType<typeof parseFullConfig>;
|
|
7
8
|
/**
|
|
8
9
|
* Interface representing a network provider for interacting with TON blockchain.
|
|
9
10
|
*/
|
|
@@ -70,6 +71,35 @@ export interface NetworkProvider {
|
|
|
70
71
|
* @returns {Promise<void>} A promise that resolves when the contract is deployed or the attempts are exhausted.
|
|
71
72
|
*/
|
|
72
73
|
waitForDeploy(address: Address, attempts?: number, sleepDuration?: number): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Retrieves the state of a contract at the specified address.
|
|
76
|
+
*
|
|
77
|
+
* @param {Address} address - The address of the contract.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* const address = Address.parse('YOUR_CONTRACT_ADDRESS');
|
|
81
|
+
* const state = await provider.getContractState(address);
|
|
82
|
+
* console.log(`Contract balance: ${fromNano(state.balance)} TON`);
|
|
83
|
+
*
|
|
84
|
+
* @returns {Promise<ContractState>} A promise that resolves to the contract's state.
|
|
85
|
+
*/
|
|
86
|
+
getContractState(address: Address): Promise<ContractState>;
|
|
87
|
+
/**
|
|
88
|
+
* Fetches the current blockchain configuration.
|
|
89
|
+
*
|
|
90
|
+
* This method retrieves the configuration from the masterchain. If no address is provided,
|
|
91
|
+
* it defaults to the standard config address:
|
|
92
|
+
* `-1:5555555555555555555555555555555555555555555555555555555555555555`.
|
|
93
|
+
*
|
|
94
|
+
* @param {Address} [configAddress] - Optional configuration address.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* const config = await provider.getConfig();
|
|
98
|
+
* console.log('Global config version:', config.globalVersion.version);
|
|
99
|
+
*
|
|
100
|
+
@returns {Promise<BlockchainConfig>} A promise that resolves to the blockchain configuration.
|
|
101
|
+
*/
|
|
102
|
+
getConfig(configAddress?: Address): Promise<BlockchainConfig>;
|
|
73
103
|
/**
|
|
74
104
|
* @deprecated
|
|
75
105
|
*
|
|
@@ -95,3 +125,4 @@ export interface NetworkProvider {
|
|
|
95
125
|
*/
|
|
96
126
|
ui(): UIProvider;
|
|
97
127
|
}
|
|
128
|
+
export {};
|
|
@@ -17,22 +17,23 @@ var _SendProviderSender_provider, _WrappedContractProvider_address, _WrappedCont
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.argSpec = void 0;
|
|
19
19
|
exports.createNetworkProvider = createNetworkProvider;
|
|
20
|
-
const
|
|
21
|
-
const DeeplinkProvider_1 = require("./send/DeeplinkProvider");
|
|
22
|
-
const TonConnectProvider_1 = require("./send/TonConnectProvider");
|
|
20
|
+
const path_1 = __importDefault(require("path"));
|
|
23
21
|
const core_1 = require("@ton/core");
|
|
24
22
|
const ton_1 = require("@ton/ton");
|
|
25
23
|
const ton_adapter_1 = require("@ton-api/ton-adapter");
|
|
26
24
|
const client_1 = require("@ton-api/client");
|
|
27
|
-
const FSStorage_1 = require("./storage/FSStorage");
|
|
28
|
-
const path_1 = __importDefault(require("path"));
|
|
29
|
-
const paths_1 = require("../paths");
|
|
30
25
|
const crypto_1 = require("@ton/crypto");
|
|
31
|
-
const MnemonicProvider_1 = require("./send/MnemonicProvider");
|
|
32
26
|
const axios_1 = __importDefault(require("axios"));
|
|
33
27
|
const ton_lite_client_1 = require("ton-lite-client");
|
|
28
|
+
const utils_1 = require("../utils");
|
|
29
|
+
const DeeplinkProvider_1 = require("./send/DeeplinkProvider");
|
|
30
|
+
const TonConnectProvider_1 = require("./send/TonConnectProvider");
|
|
31
|
+
const FSStorage_1 = require("./storage/FSStorage");
|
|
32
|
+
const paths_1 = require("../paths");
|
|
33
|
+
const MnemonicProvider_1 = require("./send/MnemonicProvider");
|
|
34
34
|
const INITIAL_DELAY = 400;
|
|
35
35
|
const MAX_ATTEMPTS = 4;
|
|
36
|
+
const CONFIG_ADDRESS = core_1.Address.parse('-1:5555555555555555555555555555555555555555555555555555555555555555');
|
|
36
37
|
exports.argSpec = {
|
|
37
38
|
'--mainnet': Boolean,
|
|
38
39
|
'--testnet': Boolean,
|
|
@@ -141,6 +142,25 @@ class NetworkProviderImpl {
|
|
|
141
142
|
async isContractDeployed(address) {
|
|
142
143
|
return (await __classPrivateFieldGet(this, _NetworkProviderImpl_tc, "f").provider(address).getState()).state.type === 'active';
|
|
143
144
|
}
|
|
145
|
+
async getConfig(address = CONFIG_ADDRESS) {
|
|
146
|
+
const state = await this.getContractState(address);
|
|
147
|
+
if (state.state.type !== 'active' || !state.state.data) {
|
|
148
|
+
throw new Error('Configuration contract not active');
|
|
149
|
+
}
|
|
150
|
+
const paramsDict = core_1.Cell.fromBoc(state.state.data)[0]
|
|
151
|
+
.beginParse()
|
|
152
|
+
.loadRef()
|
|
153
|
+
.beginParse()
|
|
154
|
+
.loadDictDirect(core_1.Dictionary.Keys.Int(32), core_1.Dictionary.Values.Cell());
|
|
155
|
+
const params = new Map();
|
|
156
|
+
for (const [key, value] of paramsDict) {
|
|
157
|
+
params.set(key, value.beginParse());
|
|
158
|
+
}
|
|
159
|
+
return (0, ton_1.parseFullConfig)(params);
|
|
160
|
+
}
|
|
161
|
+
async getContractState(address) {
|
|
162
|
+
return await __classPrivateFieldGet(this, _NetworkProviderImpl_tc, "f").provider(address).getState();
|
|
163
|
+
}
|
|
144
164
|
async waitForDeploy(address, attempts = 20, sleepDuration = 2000) {
|
|
145
165
|
if (attempts <= 0) {
|
|
146
166
|
throw new Error('Attempt number must be positive');
|
|
@@ -428,7 +448,7 @@ class NetworkProviderBuilder {
|
|
|
428
448
|
try {
|
|
429
449
|
await sendProvider.connect();
|
|
430
450
|
}
|
|
431
|
-
catch (
|
|
451
|
+
catch (_) {
|
|
432
452
|
console.error('Unable to connect to wallet.');
|
|
433
453
|
process.exit(1);
|
|
434
454
|
}
|
|
@@ -17,8 +17,8 @@ var _DeeplinkProvider_network, _DeeplinkProvider_ui;
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.DeeplinkProvider = void 0;
|
|
19
19
|
const core_1 = require("@ton/core");
|
|
20
|
-
const utils_1 = require("../../utils");
|
|
21
20
|
const qrcode_terminal_1 = __importDefault(require("qrcode-terminal"));
|
|
21
|
+
const utils_1 = require("../../utils");
|
|
22
22
|
class DeeplinkProvider {
|
|
23
23
|
constructor(network, ui) {
|
|
24
24
|
_DeeplinkProvider_network.set(this, void 0);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { Buffer } from 'buffer';
|
|
1
2
|
import { Address, Cell, StateInit } from '@ton/core';
|
|
2
3
|
import { SendProvider } from './SendProvider';
|
|
3
4
|
import { UIProvider } from '../../ui/UIProvider';
|
|
4
5
|
import { BlueprintTonClient } from '../NetworkProvider';
|
|
5
6
|
import { Network } from '../Network';
|
|
6
|
-
import { Buffer } from 'buffer';
|
|
7
7
|
import { WalletVersion } from './wallets';
|
|
8
8
|
type MnemonicProviderParams = {
|
|
9
9
|
version: WalletVersion;
|
|
@@ -58,7 +58,10 @@ class MnemonicProvider {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
async connect() {
|
|
61
|
-
const formattedAddress = this.address().toString({
|
|
61
|
+
const formattedAddress = this.address().toString({
|
|
62
|
+
testOnly: __classPrivateFieldGet(this, _MnemonicProvider_network, "f") === 'testnet',
|
|
63
|
+
bounceable: false,
|
|
64
|
+
});
|
|
62
65
|
__classPrivateFieldGet(this, _MnemonicProvider_ui, "f").write(`Connected to wallet at address: ${formattedAddress}\n`);
|
|
63
66
|
}
|
|
64
67
|
async sendTransaction(address, amount, payload, stateInit) {
|
|
@@ -44,7 +44,7 @@ _FSStorage_path = new WeakMap(), _FSStorage_instances = new WeakSet(), _FSStorag
|
|
|
44
44
|
try {
|
|
45
45
|
return JSON.parse((await promises_1.default.readFile(__classPrivateFieldGet(this, _FSStorage_path, "f"))).toString('utf-8'));
|
|
46
46
|
}
|
|
47
|
-
catch (
|
|
47
|
+
catch (_) {
|
|
48
48
|
return {};
|
|
49
49
|
}
|
|
50
50
|
}, _FSStorage_writeObject = async function _FSStorage_writeObject(obj) {
|
|
@@ -52,7 +52,10 @@ const findCompiles = async (directory) => {
|
|
|
52
52
|
if (!(0, fs_1.existsSync)(dir)) {
|
|
53
53
|
return [];
|
|
54
54
|
}
|
|
55
|
-
const files = await promises_1.default.readdir(dir, {
|
|
55
|
+
const files = await promises_1.default.readdir(dir, {
|
|
56
|
+
recursive: (await (0, utils_1.getConfig)())?.recursiveWrappers ?? false,
|
|
57
|
+
withFileTypes: true,
|
|
58
|
+
});
|
|
56
59
|
const compilables = files.filter((file) => file.isFile() && file.name.endsWith(compile_1.COMPILE_END));
|
|
57
60
|
return compilables.map((file) => ({
|
|
58
61
|
path: path_1.default.join(file.path, file.name),
|
|
@@ -70,7 +73,10 @@ const findContracts = async () => {
|
|
|
70
73
|
};
|
|
71
74
|
exports.findContracts = findContracts;
|
|
72
75
|
const findScripts = async () => {
|
|
73
|
-
const dirents = await promises_1.default.readdir(paths_1.SCRIPTS_DIR, {
|
|
76
|
+
const dirents = await promises_1.default.readdir(paths_1.SCRIPTS_DIR, {
|
|
77
|
+
recursive: true,
|
|
78
|
+
withFileTypes: true,
|
|
79
|
+
});
|
|
74
80
|
const scripts = dirents.filter((dirent) => dirent.isFile() && dirent.name.endsWith('.ts'));
|
|
75
81
|
return scripts
|
|
76
82
|
.map((script) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ton/blueprint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0-dev.20250609174628.e67475d",
|
|
4
4
|
"description": "Framework for development of TON smart contracts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": "./dist/cli/cli.js",
|
|
@@ -15,9 +15,12 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "rm -rf dist && tsc && cp -r src/templates dist/",
|
|
18
|
+
"test": "echo \"Error: no test specified\" && exit 0",
|
|
18
19
|
"release": "yarn build && yarn publish --access public",
|
|
19
|
-
"
|
|
20
|
+
"lint": "eslint . --max-warnings 0",
|
|
21
|
+
"lint:fix": "eslint . --max-warnings 0 --fix"
|
|
20
22
|
},
|
|
23
|
+
"prettier": "@ton/toolchain/prettier",
|
|
21
24
|
"devDependencies": {
|
|
22
25
|
"@tact-lang/compiler": "^1.6.5",
|
|
23
26
|
"@ton-community/func-js": "^0.9.0",
|
|
@@ -25,10 +28,11 @@
|
|
|
25
28
|
"@ton/crypto": "^3.3.0",
|
|
26
29
|
"@ton/tolk-js": "^0.12.0",
|
|
27
30
|
"@ton/ton": "^15.2.1",
|
|
31
|
+
"@ton/toolchain": "the-ton-tech/toolchain#v1.4.0",
|
|
28
32
|
"@types/inquirer": "^8.2.6",
|
|
29
33
|
"@types/node": "^20.2.5",
|
|
30
34
|
"@types/qrcode-terminal": "^0.12.0",
|
|
31
|
-
"
|
|
35
|
+
"eslint": "^9.28.0",
|
|
32
36
|
"typescript": "^5.8.3"
|
|
33
37
|
},
|
|
34
38
|
"peerDependencies": {
|
|
@@ -52,5 +56,5 @@
|
|
|
52
56
|
"ton-lite-client": "^3.1.0",
|
|
53
57
|
"ts-node": "^10.9.1"
|
|
54
58
|
},
|
|
55
|
-
"packageManager": "yarn@4.
|
|
59
|
+
"packageManager": "yarn@4.9.2"
|
|
56
60
|
}
|