@instadapp/interop-x 0.0.0-dev.4c169eb → 0.0.0-dev.6ea4ee5

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/.env.example CHANGED
@@ -1 +1,2 @@
1
- PRIVATE_KEY=
1
+ PRIVATE_KEY=
2
+ STAGING=
@@ -7,6 +7,7 @@ class Config {
7
7
  this.events = new types_1.EventBus();
8
8
  this.maxPeers = 10;
9
9
  this.privateKey = process.env.PRIVATE_KEY;
10
+ this.staging = !!process.env.STAGING && process.env.STAGING === 'true';
10
11
  this.wallet = new ethers_1.Wallet(this.privateKey);
11
12
  this.leadNodeAddress = '0x910E413DBF3F6276Fe8213fF656726bDc142E08E';
12
13
  }
package/dist/index.js CHANGED
@@ -3,13 +3,33 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- require("module-alias/register");
6
+ const module_alias_1 = __importDefault(require("module-alias"));
7
+ module_alias_1.default.addAliases({
8
+ "@/": __dirname + "/",
9
+ "@/logger": __dirname + "/logger",
10
+ "@/tasks": __dirname + "/tasks",
11
+ "@/utils": __dirname + "/utils",
12
+ "@/net": __dirname + "/net",
13
+ "@/db": __dirname + "/db",
14
+ "@/config": __dirname + "/config",
15
+ "@/types": __dirname + "/types",
16
+ "@/abi": __dirname + "/abi",
17
+ "@/constants": __dirname + "/constants",
18
+ "@/typechain": __dirname + "/typechain"
19
+ });
20
+ (0, module_alias_1.default)();
7
21
  const assert_1 = __importDefault(require("assert"));
8
22
  const dotenv_1 = __importDefault(require("dotenv"));
9
23
  const ethers_1 = require("ethers");
10
24
  dotenv_1.default.config();
11
25
  const logger_1 = __importDefault(require("@/logger"));
12
26
  const logger = new logger_1.default('Process');
27
+ if (process.argv.at(-1) === 'help') {
28
+ console.log('Usage:');
29
+ console.log(' PRIVATE_KEY=abcd1234 interop-x');
30
+ console.log(' PRIVATE_KEY=abcd1234 STAGING=true interop-x');
31
+ process.exit(0);
32
+ }
13
33
  (0, assert_1.default)(process.env.PRIVATE_KEY, "PRIVATE_KEY is not defined");
14
34
  try {
15
35
  new ethers_1.ethers.Wallet(process.env.PRIVATE_KEY);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instadapp/interop-x",
3
- "version": "0.0.0-dev.4c169eb",
3
+ "version": "0.0.0-dev.6ea4ee5",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -62,18 +62,5 @@
62
62
  "tsconfig-paths": "^3.12.0",
63
63
  "typechain": "^8.0.0",
64
64
  "typescript": "^4.5.5"
65
- },
66
- "_moduleAliases": {
67
- "@/": "./dist",
68
- "@/logger": "./dist/logger",
69
- "@/tasks": "./dist/tasks",
70
- "@/utils": "./dist/utils",
71
- "@/net": "./dist/net",
72
- "@/db": "./dist/db",
73
- "@/config": "./dist/config",
74
- "@/types": "./dist/types",
75
- "@/abi": "./dist/abi",
76
- "@/constants": "./dist/constants",
77
- "@/typechain": "./dist/typechain"
78
65
  }
79
66
  }
@@ -7,11 +7,13 @@ class Config {
7
7
  public readonly leadNodeAddress: string
8
8
  public readonly privateKey: string
9
9
  public readonly wallet: Wallet
10
+ public readonly staging: boolean
10
11
 
11
12
  constructor() {
12
13
  this.events = new EventBus() as EventBusType
13
14
  this.maxPeers = 10
14
15
  this.privateKey = process.env.PRIVATE_KEY as string;
16
+ this.staging = !! process.env.STAGING && process.env.STAGING === 'true';
15
17
  this.wallet = new Wallet(this.privateKey);
16
18
  this.leadNodeAddress = '0x910E413DBF3F6276Fe8213fF656726bDc142E08E'
17
19
  }
package/src/index.ts CHANGED
@@ -1,4 +1,20 @@
1
- import 'module-alias/register';
1
+ import moduleAlias from 'module-alias';
2
+
3
+ moduleAlias.addAliases({
4
+ "@/": __dirname + "/",
5
+ "@/logger": __dirname + "/logger",
6
+ "@/tasks": __dirname + "/tasks",
7
+ "@/utils": __dirname + "/utils",
8
+ "@/net": __dirname + "/net",
9
+ "@/db": __dirname + "/db",
10
+ "@/config": __dirname + "/config",
11
+ "@/types": __dirname + "/types",
12
+ "@/abi": __dirname + "/abi",
13
+ "@/constants": __dirname + "/constants",
14
+ "@/typechain": __dirname + "/typechain"
15
+ })
16
+
17
+ moduleAlias();
2
18
  import assert from "assert";
3
19
  import dotenv from "dotenv";
4
20
  import { ethers } from "ethers";
@@ -7,6 +23,14 @@ dotenv.config();
7
23
  import Logger from "@/logger";
8
24
  const logger = new Logger('Process')
9
25
 
26
+
27
+ if (process.argv.at(-1) === 'help') {
28
+ console.log('Usage:')
29
+ console.log(' PRIVATE_KEY=abcd1234 interop-x')
30
+ console.log(' PRIVATE_KEY=abcd1234 STAGING=true interop-x')
31
+ process.exit(0)
32
+ }
33
+
10
34
  assert(process.env.PRIVATE_KEY, "PRIVATE_KEY is not defined");
11
35
 
12
36
  try {
@@ -19,7 +43,6 @@ try {
19
43
  import { Tasks } from "@/tasks";
20
44
  import { startPeer } from "@/net";
21
45
 
22
-
23
46
  async function main() {
24
47
 
25
48
  startPeer({})