@ton/blueprint 0.18.0 → 0.19.1
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 +16 -0
- package/README.md +8 -2
- package/dist/cli/verify.js +15 -5
- 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.19.1] - 2024-04-12
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Fixed `verify` command
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Updated readme to reflect the fact that blueprint no longer automatically adds `jsonRPC` to custom v2 endpoints
|
|
17
|
+
|
|
18
|
+
## [0.19.0] - 2024-03-27
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Updated dependencies: func-js to 0.7.0, tonconnect sdk to 2.2.0
|
|
23
|
+
|
|
8
24
|
## [0.18.0] - 2024-03-13
|
|
9
25
|
|
|
10
26
|
### Changed
|
package/README.md
CHANGED
|
@@ -143,7 +143,7 @@ import { Config } from '@ton/blueprint';
|
|
|
143
143
|
|
|
144
144
|
export const config: Config = {
|
|
145
145
|
network: {
|
|
146
|
-
endpoint: 'https://toncenter.com/api/v2/',
|
|
146
|
+
endpoint: 'https://toncenter.com/api/v2/jsonRPC',
|
|
147
147
|
type: 'mainnet',
|
|
148
148
|
version: 'v2',
|
|
149
149
|
key: 'YOUR_API_KEY',
|
|
@@ -153,11 +153,17 @@ export const config: Config = {
|
|
|
153
153
|
|
|
154
154
|
The above config parameters are equivalent to the arguments in the following command:
|
|
155
155
|
```bash
|
|
156
|
-
npx blueprint run --custom https://toncenter.com/api/v2/ --custom-version v2 --custom-type mainnet --custom-key YOUR_API_KEY
|
|
156
|
+
npx blueprint run --custom https://toncenter.com/api/v2/jsonRPC --custom-version v2 --custom-type mainnet --custom-key YOUR_API_KEY
|
|
157
157
|
```
|
|
158
158
|
|
|
159
159
|
Properties of the `network` object have the same semantics as the `--custom` flags with respective names (see `blueprint help run`).
|
|
160
160
|
|
|
161
|
+
You can also use custom network to verify contracts, like so:
|
|
162
|
+
```bash
|
|
163
|
+
npx blueprint verify --custom https://toncenter.com/api/v2/jsonRPC --custom-version v2 --custom-type mainnet --custom-key YOUR_API_KEY
|
|
164
|
+
```
|
|
165
|
+
(or similarly using the config), however custom type MUST be specified as either `mainnet` or `testnet` when verifying.
|
|
166
|
+
|
|
161
167
|
## Contributors
|
|
162
168
|
|
|
163
169
|
Special thanks to [@qdevstudio](https://t.me/qdevstudio) for their logo for blueprint.
|
package/dist/cli/verify.js
CHANGED
|
@@ -13,7 +13,7 @@ const utils_1 = require("../utils");
|
|
|
13
13
|
const arg_1 = __importDefault(require("arg"));
|
|
14
14
|
const backends = {
|
|
15
15
|
mainnet: {
|
|
16
|
-
|
|
16
|
+
sourceRegistry: core_1.Address.parse('EQD-BJSVUJviud_Qv7Ymfd3qzXdrmV525e3YDzWQoHIAiInL'),
|
|
17
17
|
backends: [
|
|
18
18
|
'https://ton-source-prod-1.herokuapp.com',
|
|
19
19
|
'https://ton-source-prod-2.herokuapp.com',
|
|
@@ -22,7 +22,7 @@ const backends = {
|
|
|
22
22
|
id: 'orbs.com',
|
|
23
23
|
},
|
|
24
24
|
testnet: {
|
|
25
|
-
|
|
25
|
+
sourceRegistry: core_1.Address.parse('EQCsdKYwUaXkgJkz2l0ol6qT_WxeRbE_wBCwnEybmR0u5TO8'),
|
|
26
26
|
backends: ['https://ton-source-prod-testnet-1.herokuapp.com'],
|
|
27
27
|
id: 'orbs-testnet',
|
|
28
28
|
},
|
|
@@ -58,6 +58,15 @@ class VerifierRegistry {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
class SourceRegistry {
|
|
62
|
+
constructor(address) {
|
|
63
|
+
this.address = address;
|
|
64
|
+
}
|
|
65
|
+
async getVerifierRegistry(provider) {
|
|
66
|
+
const { stack } = await provider.get('get_verifier_registry_address', []);
|
|
67
|
+
return stack.readAddress();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
61
70
|
async function lookupCodeHash(hash, ui, retryCount = 5) {
|
|
62
71
|
let queryResponse;
|
|
63
72
|
let foundAddr;
|
|
@@ -125,7 +134,7 @@ const verify = async (args, ui, context) => {
|
|
|
125
134
|
}
|
|
126
135
|
const result = await (0, compile_1.doCompile)(sel.name);
|
|
127
136
|
const resHash = result.code.hash();
|
|
128
|
-
ui.write(`Compiled code hash hex
|
|
137
|
+
ui.write(`Compiled code hash hex: ${resHash.toString('hex')}`);
|
|
129
138
|
ui.write('We can look up the address with such code hash in the blockchain automatically');
|
|
130
139
|
const passManually = await ui.prompt('Do you want to specify the address manually?');
|
|
131
140
|
let addr;
|
|
@@ -210,7 +219,8 @@ const verify = async (args, ui, context) => {
|
|
|
210
219
|
type: 'application/json',
|
|
211
220
|
}), 'blob');
|
|
212
221
|
const backend = backends[network];
|
|
213
|
-
const
|
|
222
|
+
const sourceRegistry = networkProvider.open(new SourceRegistry(backend.sourceRegistry));
|
|
223
|
+
const verifierRegistry = networkProvider.open(new VerifierRegistry(await sourceRegistry.getVerifierRegistry()));
|
|
214
224
|
const verifier = (await verifierRegistry.getVerifiers()).find((v) => v.name === backend.id);
|
|
215
225
|
if (verifier === undefined) {
|
|
216
226
|
throw new Error('Could not find verifier');
|
|
@@ -248,7 +258,7 @@ const verify = async (args, ui, context) => {
|
|
|
248
258
|
}
|
|
249
259
|
const c = core_1.Cell.fromBoc(Buffer.from(msgCell.data))[0];
|
|
250
260
|
await networkProvider.sender().send({
|
|
251
|
-
to:
|
|
261
|
+
to: verifierRegistry.address,
|
|
252
262
|
value: (0, core_1.toNano)('0.5'),
|
|
253
263
|
body: c,
|
|
254
264
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ton/blueprint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"description": "Framework for development of TON smart contracts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": "./dist/cli/cli.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@orbs-network/ton-access": "^2.3.3",
|
|
38
38
|
"@tact-lang/compiler": "^1.2.0",
|
|
39
|
-
"@ton-community/func-js": "^0.
|
|
40
|
-
"@tonconnect/sdk": "^2.
|
|
39
|
+
"@ton-community/func-js": "^0.7.0",
|
|
40
|
+
"@tonconnect/sdk": "^2.2.0",
|
|
41
41
|
"arg": "^5.0.2",
|
|
42
42
|
"chalk": "^4.1.0",
|
|
43
43
|
"dotenv": "^16.1.4",
|