@ton/blueprint 0.44.0-dev.20260220152830.3fec080 → 0.44.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/README.md CHANGED
@@ -136,6 +136,7 @@ Start by adding the following environment variables to your `.env` file:
136
136
  **Optional variables:**
137
137
  * **`WALLET_ID`**: The wallet ID (can be used with versions below `v5r1`).
138
138
  * **`SUBWALLET_NUMBER`**: The subwallet number used to build the wallet ID (can be used with `v5r1` wallets).
139
+ * **`WALLET_NETWORK_ID`**: Network ID used to build the wallet ID (v5 wallets). Defaults: `-3` testnet, `-239` mainnet and other networks (tetra, custom).
139
140
 
140
141
  Once your environment is set up, you can use the mnemonic wallet for deployment with the appropriate configuration.
141
142
 
@@ -108,8 +108,7 @@ ${chalk_1.default.cyan('--custom')} [api-endpoint] - use a custom API
108
108
  ${chalk_1.default.cyan('--custom-version')} - API version (v2, v4)
109
109
  ${chalk_1.default.cyan('--custom-key')} - API key (v2 only)
110
110
  ${chalk_1.default.cyan('--custom-type')} - network type (custom, mainnet, testnet)
111
- ${chalk_1.default.cyan('--custom-domain')} - network domain (for custom l2 domain)
112
- ${chalk_1.default.cyan('--custom-network-id')} - network global ID (for custom network)
111
+ ${chalk_1.default.cyan('--custom-global-id')} - network global ID (for custom l2 domain)
113
112
  ${chalk_1.default.cyan('--tonconnect')}, ${chalk_1.default.cyan('--deeplink')}, ${chalk_1.default.cyan('--mnemonic')} - deployer options
114
113
  ${chalk_1.default.cyan('--tonscan')}, ${chalk_1.default.cyan('--tonviewer')}, ${chalk_1.default.cyan('--toncx')}, ${chalk_1.default.cyan('--dton')} - explorer (default: tonviewer)
115
114
  ${chalk_1.default.gray('[...args]')} (array of strings, optional) - Arguments passed directly to the script.
@@ -143,7 +142,7 @@ ${chalk_1.default.bold('SEE ALSO')}
143
142
  Verifies a deployed contract on ${chalk_1.default.underline('https://verifier.ton.org')}.
144
143
 
145
144
  ${chalk_1.default.bold('Flags:')}
146
- ${chalk_1.default.cyan('--mainnet')}, ${chalk_1.default.cyan('--testnet')} - selects network
145
+ ${chalk_1.default.cyan('--mainnet')}, ${chalk_1.default.cyan('--testnet')}, ${chalk_1.default.cyan('--tetra')} - selects network
147
146
  ${chalk_1.default.cyan('--verifier')} - specifies the verifier ID to use (default: ${chalk_1.default.cyan('verifier.ton.org')})
148
147
  ${chalk_1.default.cyan('--list-verifiers')} - lists all available verifiers for the selected network (or both networks if none selected)
149
148
  ${chalk_1.default.cyan('--compiler-version')} - specifies the exact compiler version to use (e.g. ${chalk_1.default.cyan('0.4.4-newops.1')}). Note: this does not change the underlying compiler itself.
@@ -30,8 +30,6 @@ export interface Config {
30
30
  * };
31
31
  */
32
32
  network?: 'mainnet' | 'testnet' | 'tetra' | CustomNetwork;
33
- domain?: number;
34
- networkId?: number;
35
33
  /**
36
34
  * If true, keeps compilable files (`*.compile.ts`) in a separate directory `compilables`.
37
35
  * When false or unset, compilables are stored in `wrappers` directory.
@@ -5,4 +5,5 @@ export type CustomNetwork = {
5
5
  version?: NetworkVersion;
6
6
  key?: string;
7
7
  type?: Network;
8
+ globalId?: number;
8
9
  };
@@ -1 +1,2 @@
1
- export type Network = 'mainnet' | 'testnet' | 'tetra' | 'custom';
1
+ import { AVAILABLE_NETWORKS } from './constants';
2
+ export type Network = (typeof AVAILABLE_NETWORKS)[number];
@@ -0,0 +1,7 @@
1
+ export declare const AVAILABLE_NETWORKS: ["mainnet", "testnet", "tetra", "custom"];
2
+ export declare const MAINNET_NETWORK_GLOBAL_ID = -239;
3
+ export declare const TESTNET_NETWORK_GLOBAL_ID = -3;
4
+ export declare const TETRA_DOMAIN: {
5
+ readonly type: "l2";
6
+ readonly globalId: 662387;
7
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TETRA_DOMAIN = exports.TESTNET_NETWORK_GLOBAL_ID = exports.MAINNET_NETWORK_GLOBAL_ID = exports.AVAILABLE_NETWORKS = void 0;
4
+ exports.AVAILABLE_NETWORKS = ['mainnet', 'testnet', 'tetra', 'custom'];
5
+ exports.MAINNET_NETWORK_GLOBAL_ID = -239;
6
+ exports.TESTNET_NETWORK_GLOBAL_ID = -3;
7
+ const TETRA_NETWORK_GLOBAL_ID = 662387;
8
+ exports.TETRA_DOMAIN = {
9
+ type: 'l2',
10
+ globalId: TETRA_NETWORK_GLOBAL_ID,
11
+ };
@@ -10,8 +10,7 @@ export declare const argSpec: {
10
10
  '--custom-type': StringConstructor;
11
11
  '--custom-version': StringConstructor;
12
12
  '--custom-key': StringConstructor;
13
- '--custom-domain': NumberConstructor;
14
- '--custom-network-id': NumberConstructor;
13
+ '--custom-global-id': NumberConstructor;
15
14
  '--compiler-version': StringConstructor;
16
15
  '--tonconnect': BooleanConstructor;
17
16
  '--deeplink': BooleanConstructor;
@@ -19,6 +19,7 @@ const TonConnectProvider_1 = require("./send/TonConnectProvider");
19
19
  const FSStorage_1 = require("./storage/FSStorage");
20
20
  const paths_1 = require("../paths");
21
21
  const MnemonicProvider_1 = require("./send/MnemonicProvider");
22
+ const constants_1 = require("./constants");
22
23
  const INITIAL_DELAY = 400;
23
24
  const MAX_ATTEMPTS = 4;
24
25
  const CONFIG_ADDRESS = core_1.Address.parse('-1:5555555555555555555555555555555555555555555555555555555555555555');
@@ -30,8 +31,7 @@ exports.argSpec = {
30
31
  '--custom-type': String,
31
32
  '--custom-version': String,
32
33
  '--custom-key': String,
33
- '--custom-domain': Number,
34
- '--custom-network-id': Number,
34
+ '--custom-global-id': Number,
35
35
  '--compiler-version': String,
36
36
  '--tonconnect': Boolean,
37
37
  '--deeplink': Boolean,
@@ -279,7 +279,7 @@ function getOptionalNumberEnv(envName) {
279
279
  }
280
280
  return value;
281
281
  }
282
- async function createMnemonicProvider(client, network, ui, domain, networkId) {
282
+ async function createMnemonicProvider(client, network, ui, globalId) {
283
283
  const mnemonic = process.env.WALLET_MNEMONIC ?? '';
284
284
  const walletVersion = process.env.WALLET_VERSION ?? '';
285
285
  if (mnemonic.length === 0 || walletVersion.length === 0) {
@@ -287,6 +287,7 @@ async function createMnemonicProvider(client, network, ui, domain, networkId) {
287
287
  }
288
288
  const walletId = getOptionalNumberEnv('WALLET_ID');
289
289
  const subwalletNumber = getOptionalNumberEnv('SUBWALLET_NUMBER');
290
+ const walletNetworkId = getOptionalNumberEnv('WALLET_NETWORK_ID');
290
291
  const keyPair = await (0, crypto_1.mnemonicToPrivateKey)(mnemonic.split(' '));
291
292
  return new MnemonicProvider_1.MnemonicProvider({
292
293
  version: walletVersion.toLowerCase(),
@@ -296,8 +297,8 @@ async function createMnemonicProvider(client, network, ui, domain, networkId) {
296
297
  walletId,
297
298
  subwalletNumber,
298
299
  network,
299
- domain,
300
- networkId,
300
+ globalId,
301
+ networkId: walletNetworkId,
301
302
  });
302
303
  }
303
304
  function intToIP(int) {
@@ -347,7 +348,7 @@ class NetworkProviderBuilder {
347
348
  if (this.config?.network !== undefined) {
348
349
  return typeof this.config.network === 'string' ? this.config.network : 'custom';
349
350
  }
350
- network = await this.ui.choose('Which network do you want to use?', ['mainnet', 'testnet', 'tetra', 'custom'], (c) => c);
351
+ network = await this.ui.choose('Which network do you want to use?', constants_1.AVAILABLE_NETWORKS, (c) => c);
351
352
  if (network === 'custom') {
352
353
  const defaultCustomEndpoint = 'http://localhost:8081/';
353
354
  this.args['--custom'] = (await this.ui.input(`Provide a custom API v2 endpoint (default is ${defaultCustomEndpoint})`)).trim();
@@ -397,9 +398,14 @@ class NetworkProviderBuilder {
397
398
  throw new Error('Tonkeeper cannot work with custom network.');
398
399
  provider = new TonConnectProvider_1.TonConnectProvider(new FSStorage_1.FSStorage(storagePath), this.ui, network, this.config?.manifestUrl);
399
400
  break;
400
- case 'mnemonic':
401
- provider = await createMnemonicProvider(client, network, this.ui, this.config?.domain, this.config?.networkId);
401
+ case 'mnemonic': {
402
+ let globalId = undefined;
403
+ if (typeof this.config?.network === 'object') {
404
+ globalId = this.config.network.globalId;
405
+ }
406
+ provider = await createMnemonicProvider(client, network, this.ui, globalId);
402
407
  break;
408
+ }
403
409
  default:
404
410
  throw new Error('Unknown deploy option');
405
411
  }
@@ -407,7 +413,6 @@ class NetworkProviderBuilder {
407
413
  }
408
414
  async build() {
409
415
  let network = await this.chooseNetwork();
410
- const explorer = this.chooseExplorer();
411
416
  if (network !== 'custom' &&
412
417
  (this.args['--custom-key'] !== undefined ||
413
418
  this.args['--custom-type'] !== undefined ||
@@ -431,19 +436,14 @@ class NetworkProviderBuilder {
431
436
  if (inputType !== undefined) {
432
437
  type = inputType; // checks come later
433
438
  }
439
+ const globalId = this.args['--custom-global-id'];
434
440
  configNetwork = {
435
441
  endpoint: this.args['--custom'],
436
442
  version,
437
443
  key: this.args['--custom-key'],
444
+ globalId,
438
445
  type,
439
446
  };
440
- if (this.config && this.args['--custom-domain']) {
441
- const customDomain = this.args['--custom-domain'];
442
- this.config.domain = customDomain;
443
- }
444
- if (this.config && this.args['--custom-network-id']) {
445
- this.config.networkId = this.args['--custom-network-id'];
446
- }
447
447
  }
448
448
  if (configNetwork === undefined) {
449
449
  throw new Error('Custom network is (somehow) undefined');
@@ -476,7 +476,7 @@ class NetworkProviderBuilder {
476
476
  }
477
477
  if (configNetwork.type !== undefined) {
478
478
  const ct = configNetwork.type.toLowerCase();
479
- if (!['mainnet', 'testnet', 'custom', 'tetra'].includes(ct)) {
479
+ if (!constants_1.AVAILABLE_NETWORKS.includes(ct)) {
480
480
  throw new Error('Unknown network type: ' + ct);
481
481
  }
482
482
  network = ct;
@@ -534,6 +534,7 @@ class NetworkProviderBuilder {
534
534
  this.ui.setActionPrompt('');
535
535
  }
536
536
  const sender = new SendProviderSender(sendProvider);
537
+ const explorer = network === 'tetra' ? 'tonviewer' : this.chooseExplorer();
537
538
  return new NetworkProviderImpl(tc, sender, network, explorer, this.ui);
538
539
  }
539
540
  }
@@ -14,7 +14,7 @@ type MnemonicProviderParams = {
14
14
  client: BlueprintTonClient;
15
15
  ui: UIProvider;
16
16
  network: Network;
17
- domain?: number;
17
+ globalId?: number;
18
18
  networkId?: number;
19
19
  };
20
20
  export declare class MnemonicProvider implements SendProvider {
@@ -24,6 +24,7 @@ export declare class MnemonicProvider implements SendProvider {
24
24
  private readonly ui;
25
25
  private readonly network;
26
26
  constructor(params: MnemonicProviderParams);
27
+ private getDomain;
27
28
  private createWallet;
28
29
  connect(): Promise<void>;
29
30
  sendTransaction(address: Address, amount: bigint, payload?: Cell | undefined, stateInit?: StateInit | undefined): Promise<void>;
@@ -4,7 +4,8 @@ exports.MnemonicProvider = void 0;
4
4
  const core_1 = require("@ton/core");
5
5
  const crypto_1 = require("@ton/crypto");
6
6
  const wallets_1 = require("./wallets");
7
- const network_utils_1 = require("../../utils/network.utils");
7
+ const utils_1 = require("../utils");
8
+ const constants_1 = require("../constants");
8
9
  class MnemonicProvider {
9
10
  constructor(params) {
10
11
  if (!(params.version in wallets_1.wallets)) {
@@ -21,11 +22,19 @@ class MnemonicProvider {
21
22
  this.secretKey = kp.secretKey;
22
23
  this.ui = params.ui;
23
24
  }
25
+ getDomain(params) {
26
+ if (params.globalId !== undefined) {
27
+ return { type: 'l2', globalId: params.globalId };
28
+ }
29
+ if (params.network === 'tetra') {
30
+ return constants_1.TETRA_DOMAIN;
31
+ }
32
+ return undefined;
33
+ }
24
34
  createWallet(params, kp) {
25
- const networkDomain = params.network === 'tetra' ? network_utils_1.TETRA_DOMAIN : undefined;
26
- const domain = params.domain ? { type: 'l2', globalId: params.domain } : networkDomain;
27
- const networkGlobalId = params.networkId ?? (0, network_utils_1.getW5NetworkGlobalId)(params.network);
35
+ const domain = this.getDomain(params);
28
36
  if (params.version === 'v5r1') {
37
+ const networkGlobalId = params.networkId ?? (0, utils_1.getW5NetworkGlobalId)(params.network);
29
38
  return wallets_1.wallets[params.version].create({
30
39
  publicKey: kp.publicKey,
31
40
  walletId: {
@@ -0,0 +1,2 @@
1
+ import { Network } from './Network';
2
+ export declare function getW5NetworkGlobalId(network: Network): number;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getW5NetworkGlobalId = getW5NetworkGlobalId;
4
+ const constants_1 = require("./constants");
5
+ function getW5NetworkGlobalId(network) {
6
+ switch (network) {
7
+ case 'testnet':
8
+ return constants_1.TESTNET_NETWORK_GLOBAL_ID;
9
+ case 'mainnet':
10
+ return constants_1.MAINNET_NETWORK_GLOBAL_ID;
11
+ case 'tetra':
12
+ return constants_1.MAINNET_NETWORK_GLOBAL_ID;
13
+ }
14
+ return constants_1.MAINNET_NETWORK_GLOBAL_ID;
15
+ }
@@ -22,7 +22,7 @@ export declare const tonDeepLink: (address: Address, amount: bigint, body?: Cell
22
22
  * dynamically adds the testnet prefix when needed.
23
23
  *
24
24
  * @param {string} address - The TON address to view in explorer.
25
- * @param {string} network - The target network, either 'mainnet' or 'testnet'.
25
+ * @param {string} network - The target network.
26
26
  * @param {string} explorer - The desired explorer. Supported values: 'tonscan', 'tonviewer', 'toncx', 'dton'.
27
27
  * @returns {string} A full URL pointing to the address in the selected explorer.
28
28
  *
@@ -25,6 +25,12 @@ const tonDeepLink = (address, amount, body, stateInit, testOnly) => `ton://trans
25
25
  bounceable: true,
26
26
  })}?amount=${amount.toString()}${body ? '&bin=' + body.toBoc().toString('base64url') : ''}${stateInit ? '&init=' + stateInit.toBoc().toString('base64url') : ''}`;
27
27
  exports.tonDeepLink = tonDeepLink;
28
+ function getNetworkPrefix(network) {
29
+ if (network === 'testnet' || network === 'tetra') {
30
+ return `${network}.`;
31
+ }
32
+ return '';
33
+ }
28
34
  /**
29
35
  * Generates a link to view a TON address in a selected blockchain explorer.
30
36
  *
@@ -32,7 +38,7 @@ exports.tonDeepLink = tonDeepLink;
32
38
  * dynamically adds the testnet prefix when needed.
33
39
  *
34
40
  * @param {string} address - The TON address to view in explorer.
35
- * @param {string} network - The target network, either 'mainnet' or 'testnet'.
41
+ * @param {string} network - The target network.
36
42
  * @param {string} explorer - The desired explorer. Supported values: 'tonscan', 'tonviewer', 'toncx', 'dton'.
37
43
  * @returns {string} A full URL pointing to the address in the selected explorer.
38
44
  *
@@ -41,7 +47,7 @@ exports.tonDeepLink = tonDeepLink;
41
47
  * // "https://testnet.tonscan.org/address/EQC..."
42
48
  */
43
49
  function getExplorerLink(address, network, explorer) {
44
- const networkPrefix = network === 'testnet' ? 'testnet.' : '';
50
+ const networkPrefix = getNetworkPrefix(network);
45
51
  switch (explorer) {
46
52
  case 'tonscan':
47
53
  return `https://${networkPrefix}tonscan.org/address/${address}`;
package/package.json CHANGED
@@ -1,71 +1,71 @@
1
1
  {
2
- "name": "@ton/blueprint",
3
- "version": "0.44.0-dev.20260220152830.3fec080",
4
- "description": "Framework for development of TON smart contracts",
5
- "main": "dist/index.js",
6
- "bin": "./dist/cli/cli.js",
7
- "author": "TonTech",
8
- "license": "MIT",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/ton-org/blueprint.git"
12
- },
13
- "files": [
14
- "dist/**/*"
15
- ],
16
- "scripts": {
17
- "build": "rm -rf dist && tsc && cp -r src/templates dist/",
18
- "test": "jest src",
19
- "release": "yarn build && yarn publish --access public",
20
- "lint": "eslint . --max-warnings 0",
21
- "lint:fix": "eslint . --max-warnings 0 --fix"
22
- },
23
- "prettier": "@ton/toolchain/prettier",
24
- "devDependencies": {
25
- "@tact-lang/compiler": "^1.6.13",
26
- "@ton-community/func-js": "^0.10.0",
27
- "@ton/core": "^0.63.1",
28
- "@ton/crypto": "^3.3.0",
29
- "@ton/sandbox": "^0.40.0",
30
- "@ton/tolk-js": "^1.0.0",
31
- "@ton/ton": "^16.2.2",
32
- "@ton/toolchain": "the-ton-tech/toolchain#v1.6.0",
33
- "@types/inquirer": "^8.2.6",
34
- "@types/jest": "^30.0.0",
35
- "@types/node": "^20.2.5",
36
- "@types/qrcode-terminal": "^0.12.0",
37
- "eslint": "^9.28.0",
38
- "globals": "^16.4.0",
39
- "jest": "^30.0.5",
40
- "ts-jest": "^29.4.1",
41
- "typescript": "^5.8.3"
42
- },
43
- "peerDependencies": {
44
- "@tact-lang/compiler": ">=1.6.5",
45
- "@ton-community/func-js": ">=0.10.0",
46
- "@ton/core": ">=0.63.1",
47
- "@ton/crypto": ">=3.3.0",
48
- "@ton/sandbox": ">=0.40.0",
49
- "@ton/tolk-js": ">=0.13.0",
50
- "@ton/ton": ">=16.2.2"
51
- },
52
- "peerDependenciesMeta": {
53
- "@ton/sandbox": {
54
- "optional": true
55
- }
56
- },
57
- "dependencies": {
58
- "@ton-api/client": "^0.2.0",
59
- "@ton-api/ton-adapter": "^0.2.0",
60
- "@tonconnect/sdk": "^2.2.0",
61
- "arg": "^5.0.2",
62
- "axios": "^1.7.7",
63
- "chalk": "^4.1.0",
64
- "dotenv": "^16.1.4",
65
- "inquirer": "^8.2.5",
66
- "qrcode-terminal": "^0.12.0",
67
- "ton-lite-client": "^3.1.1",
68
- "ts-node": "^10.9.1"
69
- },
70
- "packageManager": "yarn@4.9.2"
2
+ "name": "@ton/blueprint",
3
+ "version": "0.44.0",
4
+ "description": "Framework for development of TON smart contracts",
5
+ "main": "dist/index.js",
6
+ "bin": "./dist/cli/cli.js",
7
+ "author": "TonTech",
8
+ "license": "MIT",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/ton-org/blueprint.git"
12
+ },
13
+ "files": [
14
+ "dist/**/*"
15
+ ],
16
+ "scripts": {
17
+ "build": "rm -rf dist && tsc && cp -r src/templates dist/",
18
+ "test": "jest src",
19
+ "release": "yarn build && yarn publish --access public",
20
+ "lint": "eslint . --max-warnings 0",
21
+ "lint:fix": "eslint . --max-warnings 0 --fix"
22
+ },
23
+ "prettier": "@ton/toolchain/prettier",
24
+ "devDependencies": {
25
+ "@tact-lang/compiler": "^1.6.13",
26
+ "@ton-community/func-js": "^0.10.0",
27
+ "@ton/core": "^0.63.1",
28
+ "@ton/crypto": "^3.3.0",
29
+ "@ton/sandbox": "^0.40.0",
30
+ "@ton/tolk-js": "^1.0.0",
31
+ "@ton/ton": "^16.2.2",
32
+ "@ton/toolchain": "the-ton-tech/toolchain#v1.6.0",
33
+ "@types/inquirer": "^8.2.6",
34
+ "@types/jest": "^30.0.0",
35
+ "@types/node": "^20.2.5",
36
+ "@types/qrcode-terminal": "^0.12.0",
37
+ "eslint": "^9.28.0",
38
+ "globals": "^16.4.0",
39
+ "jest": "^30.0.5",
40
+ "ts-jest": "^29.4.1",
41
+ "typescript": "^5.8.3"
42
+ },
43
+ "peerDependencies": {
44
+ "@tact-lang/compiler": ">=1.6.5",
45
+ "@ton-community/func-js": ">=0.10.0",
46
+ "@ton/core": ">=0.63.1",
47
+ "@ton/crypto": ">=3.3.0",
48
+ "@ton/sandbox": ">=0.40.0",
49
+ "@ton/tolk-js": ">=0.13.0",
50
+ "@ton/ton": ">=16.2.2"
51
+ },
52
+ "peerDependenciesMeta": {
53
+ "@ton/sandbox": {
54
+ "optional": true
55
+ }
56
+ },
57
+ "dependencies": {
58
+ "@ton-api/client": "^0.2.0",
59
+ "@ton-api/ton-adapter": "^0.2.0",
60
+ "@tonconnect/sdk": "^2.2.0",
61
+ "arg": "^5.0.2",
62
+ "axios": "^1.7.7",
63
+ "chalk": "^4.1.0",
64
+ "dotenv": "^16.1.4",
65
+ "inquirer": "^8.2.5",
66
+ "qrcode-terminal": "^0.12.0",
67
+ "ton-lite-client": "^3.1.1",
68
+ "ts-node": "^10.9.1"
69
+ },
70
+ "packageManager": "yarn@4.9.2"
71
71
  }
@@ -1,6 +0,0 @@
1
- import { Network } from '../network/Network';
2
- export declare const TETRA_DOMAIN: {
3
- readonly type: "l2";
4
- readonly globalId: 662387;
5
- };
6
- export declare function getW5NetworkGlobalId(network: Network): number;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TETRA_DOMAIN = void 0;
4
- exports.getW5NetworkGlobalId = getW5NetworkGlobalId;
5
- const MAINNET_NETWORK_GLOBAL_ID = -239;
6
- const TESTNET_NETWORK_GLOBAL_ID = -3;
7
- const TETRA_NETWORK_GLOBAL_ID = 662387;
8
- exports.TETRA_DOMAIN = {
9
- type: 'l2',
10
- globalId: TETRA_NETWORK_GLOBAL_ID,
11
- };
12
- function getW5NetworkGlobalId(network) {
13
- switch (network) {
14
- case 'testnet':
15
- return TESTNET_NETWORK_GLOBAL_ID;
16
- case 'mainnet':
17
- return MAINNET_NETWORK_GLOBAL_ID;
18
- case 'tetra':
19
- return MAINNET_NETWORK_GLOBAL_ID;
20
- }
21
- return TESTNET_NETWORK_GLOBAL_ID;
22
- }