@ton/blueprint 0.19.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 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.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
+
8
18
  ## [0.19.0] - 2024-03-27
9
19
 
10
20
  ### 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.
@@ -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
- verifierRegistry: core_1.Address.parse('EQDS0AW7NV1w3nFwx-mmryfpH4OGQ3PXnoFGOJA_8PTHuLrw'),
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
- verifierRegistry: core_1.Address.parse('EQB--CRXUbqYbqJKScEWeOrnk0TKJxB071M-WwvMpMEvq6Ed'),
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;
@@ -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 verifierRegistry = networkProvider.open(new VerifierRegistry(backend.verifierRegistry));
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: backend.verifierRegistry,
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.19.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",