@pioneer-platform/eth-network 8.1.49 → 8.1.58

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/lib/index.js CHANGED
@@ -11,7 +11,11 @@
11
11
  */
12
12
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13
13
  if (k2 === undefined) k2 = k;
14
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
14
+ var desc = Object.getOwnPropertyDescriptor(m, k);
15
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
16
+ desc = { enumerable: true, get: function() { return m[k]; } };
17
+ }
18
+ Object.defineProperty(o, k2, desc);
15
19
  }) : (function(o, m, k, k2) {
16
20
  if (k2 === undefined) k2 = k;
17
21
  o[k2] = m[k];
@@ -24,7 +28,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
24
28
  var __importStar = (this && this.__importStar) || function (mod) {
25
29
  if (mod && mod.__esModule) return mod;
26
30
  var result = {};
27
- if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
32
  __setModuleDefault(result, mod);
29
33
  return result;
30
34
  };
@@ -43,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
43
47
  function verb(n) { return function (v) { return step([n, v]); }; }
44
48
  function step(op) {
45
49
  if (f) throw new TypeError("Generator is already executing.");
46
- while (_) try {
50
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
47
51
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
48
52
  if (y = 0, t) op = [op[0] & 2, t.value];
49
53
  switch (op[0]) {
@@ -96,495 +100,7 @@ var NODE_URL;
96
100
  //TODO precision module
97
101
  var BASE = 1000000000000000000;
98
102
  var abi_1 = require("@ethersproject/abi");
99
- var UNISWAP_V2_WETH_FOX_POOL_ADDRESS = '0x470e8de2ebaef52014a47cb5e6af86884947f08c';
100
- var UNISWAP_V2_USDC_ETH_POOL_ADDRESS = '0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc';
101
- var UNISWAP_V2_ROUTER = '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D';
102
- var FOX_TOKEN_CONTRACT_ADDRESS = '0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d';
103
- var WETH_TOKEN_CONTRACT_ADDRESS = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2';
104
- var PROXY_CONTRACT_SABLIER = '0xbd6a40bb904aea5a49c59050b5395f7484a4203d';
105
- var FOX_ETH_TEST_FARMING_ADDRESS = '0x1F2BBC14BCEc7f06b996B6Ee920AB5cA5A56b77F';
106
- var FOX_ETH_FARMING_ADDRESS = '0x1F2BBC14BCEc7f06b996B6Ee920AB5cA5A56b77F';
107
- var FOX_AIRDROP_ADDRESS = '0x1F2BBC14BCEc7f06b996B6Ee920AB5cA5A56b77F';
108
- //TODO move thorchain/eth stuff to its own module?
109
- var THORCHAIN_ROUTER_TESTNET = process.env['THORCHAIN_ROUTER_TESTNET'] || "0x9d496De78837f5a2bA64Cb40E62c19FBcB67f55a";
110
- //const THORCHAIN_ROUTER_MAINNET = process.env['THORCHAIN_ROUTER_MAINNET'] || ''
111
- //TODO move to coins.js
112
- var SABLIER_ABI = [{ "constant": true, "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "name": "relayers", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "sablier", "outputs": [{ "internalType": "contract Sablier", "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "relayer", "type": "address" }, { "internalType": "uint256", "name": "salaryId", "type": "uint256" }], "name": "whitelistRelayer", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "relayer", "type": "address" }, { "internalType": "uint256", "name": "salaryId", "type": "uint256" }], "name": "discardRelayer", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "employee", "type": "address" }, { "internalType": "uint256", "name": "salary", "type": "uint256" }, { "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "uint256", "name": "startTime", "type": "uint256" }, { "internalType": "uint256", "name": "stopTime", "type": "uint256" }, { "internalType": "uint256", "name": "senderSharePercentage", "type": "uint256" }, { "internalType": "uint256", "name": "recipientSharePercentage", "type": "uint256" }], "name": "createCompoundingSalary", "outputs": [{ "internalType": "uint256", "name": "salaryId", "type": "uint256" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "getHubAddr", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "bytes", "name": "context", "type": "bytes" }], "name": "preRelayedCall", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [{ "internalType": "uint256", "name": "salaryId", "type": "uint256" }], "name": "getSalary", "outputs": [{ "internalType": "address", "name": "company", "type": "address" }, { "internalType": "address", "name": "employee", "type": "address" }, { "internalType": "uint256", "name": "salary", "type": "uint256" }, { "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "uint256", "name": "startTime", "type": "uint256" }, { "internalType": "uint256", "name": "stopTime", "type": "uint256" }, { "internalType": "uint256", "name": "remainingBalance", "type": "uint256" }, { "internalType": "uint256", "name": "rate", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "initialize", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [{ "internalType": "address", "name": "relay", "type": "address" }, { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "bytes", "name": "encodedFunction", "type": "bytes" }, { "internalType": "uint256", "name": "transactionFee", "type": "uint256" }, { "internalType": "uint256", "name": "gasPrice", "type": "uint256" }, { "internalType": "uint256", "name": "gasLimit", "type": "uint256" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "bytes", "name": "approvalData", "type": "bytes" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "name": "acceptRelayedCall", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "bytes", "name": "", "type": "bytes" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "isOwner", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "relayHubVersion", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "ownerAddress", "type": "address" }, { "internalType": "address", "name": "signerAddress", "type": "address" }, { "internalType": "address", "name": "sablierAddress", "type": "address" }], "name": "initialize", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "trustedSigner", "type": "address" }], "name": "initialize", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "uint256", "name": "salaryId", "type": "uint256" }], "name": "cancelSalary", "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "employee", "type": "address" }, { "internalType": "uint256", "name": "salary", "type": "uint256" }, { "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "uint256", "name": "startTime", "type": "uint256" }, { "internalType": "uint256", "name": "stopTime", "type": "uint256" }], "name": "createSalary", "outputs": [{ "internalType": "uint256", "name": "salaryId", "type": "uint256" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "nextSalaryId", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "bytes", "name": "context", "type": "bytes" }, { "internalType": "bool", "name": "success", "type": "bool" }, { "internalType": "uint256", "name": "actualCharge", "type": "uint256" }, { "internalType": "bytes32", "name": "preRetVal", "type": "bytes32" }], "name": "postRelayedCall", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "uint256", "name": "salaryId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "withdrawFromSalary", "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "salaryId", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "streamId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "company", "type": "address" }], "name": "CreateSalary", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "salaryId", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "streamId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "company", "type": "address" }], "name": "WithdrawFromSalary", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "salaryId", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "streamId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "company", "type": "address" }], "name": "CancelSalary", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "oldRelayHub", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newRelayHub", "type": "address" }], "name": "RelayHubChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }];
113
- var TCRopstenAbi = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "memo", "type": "string" }], "name": "Deposit", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "oldVault", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newVault", "type": "address" }, { "indexed": false, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "memo", "type": "string" }], "name": "TransferAllowance", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "vault", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "memo", "type": "string" }], "name": "TransferOut", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "oldVault", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newVault", "type": "address" }, { "components": [{ "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "indexed": false, "internalType": "struct Router.Coin[]", "name": "coins", "type": "tuple[]" }, { "indexed": false, "internalType": "string", "name": "memo", "type": "string" }], "name": "VaultTransfer", "type": "event" }, { "inputs": [], "name": "RUNE", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "recipients", "type": "address[]" }, { "components": [{ "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "internalType": "struct Router.Coin[]", "name": "coins", "type": "tuple[]" }, { "internalType": "string[]", "name": "memos", "type": "string[]" }], "name": "batchTransferOut", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address payable", "name": "vault", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "string", "name": "memo", "type": "string" }], "name": "deposit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "router", "type": "address" }, { "internalType": "address payable", "name": "asgard", "type": "address" }, { "components": [{ "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "internalType": "struct Router.Coin[]", "name": "coins", "type": "tuple[]" }, { "internalType": "string", "name": "memo", "type": "string" }], "name": "returnVaultAssets", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "router", "type": "address" }, { "internalType": "address", "name": "newVault", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "string", "name": "memo", "type": "string" }], "name": "transferAllowance", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address payable", "name": "to", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "string", "name": "memo", "type": "string" }], "name": "transferOut", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" }], "name": "vaultAllowance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }];
114
- var ERC20ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" }], "name": "allowance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "approve", "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "balanceOf", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transfer", "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }];
115
- var AIRDROP_ABI = [
116
- {
117
- "anonymous": false,
118
- "inputs": [
119
- {
120
- "indexed": false,
121
- "internalType": "uint256",
122
- "name": "index",
123
- "type": "uint256"
124
- },
125
- {
126
- "indexed": true,
127
- "internalType": "address",
128
- "name": "account",
129
- "type": "address"
130
- },
131
- {
132
- "indexed": false,
133
- "internalType": "uint256",
134
- "name": "amount",
135
- "type": "uint256"
136
- },
137
- {
138
- "indexed": false,
139
- "internalType": "uint256",
140
- "name": "userClaim",
141
- "type": "uint256"
142
- },
143
- {
144
- "indexed": false,
145
- "internalType": "uint256",
146
- "name": "rewardsEscrowClaim",
147
- "type": "uint256"
148
- }
149
- ],
150
- "name": "Claimed",
151
- "type": "event"
152
- },
153
- {
154
- "anonymous": false,
155
- "inputs": [
156
- {
157
- "indexed": false,
158
- "internalType": "uint256",
159
- "name": "index",
160
- "type": "uint256"
161
- },
162
- {
163
- "indexed": false,
164
- "internalType": "address",
165
- "name": "account",
166
- "type": "address"
167
- },
168
- {
169
- "indexed": false,
170
- "internalType": "uint256",
171
- "name": "amount",
172
- "type": "uint256"
173
- }
174
- ],
175
- "name": "Claimed",
176
- "type": "event"
177
- },
178
- {
179
- "anonymous": false,
180
- "inputs": [
181
- {
182
- "indexed": true,
183
- "internalType": "address",
184
- "name": "previousOwner",
185
- "type": "address"
186
- },
187
- {
188
- "indexed": true,
189
- "internalType": "address",
190
- "name": "newOwner",
191
- "type": "address"
192
- }
193
- ],
194
- "name": "OwnershipTransferred",
195
- "type": "event"
196
- },
197
- {
198
- "inputs": [],
199
- "name": "MAX_BPS",
200
- "outputs": [
201
- {
202
- "internalType": "uint256",
203
- "name": "",
204
- "type": "uint256"
205
- }
206
- ],
207
- "stateMutability": "view",
208
- "type": "function"
209
- },
210
- {
211
- "inputs": [
212
- {
213
- "internalType": "address",
214
- "name": "token_",
215
- "type": "address"
216
- },
217
- {
218
- "internalType": "bytes32",
219
- "name": "merkleRoot_",
220
- "type": "bytes32"
221
- }
222
- ],
223
- "name": "__MerkleDistributor_init",
224
- "outputs": [],
225
- "stateMutability": "nonpayable",
226
- "type": "function"
227
- },
228
- {
229
- "inputs": [],
230
- "name": "claimsStart",
231
- "outputs": [
232
- {
233
- "internalType": "uint256",
234
- "name": "",
235
- "type": "uint256"
236
- }
237
- ],
238
- "stateMutability": "view",
239
- "type": "function"
240
- },
241
- {
242
- "inputs": [],
243
- "name": "currentRewardRate",
244
- "outputs": [
245
- {
246
- "internalType": "uint256",
247
- "name": "",
248
- "type": "uint256"
249
- }
250
- ],
251
- "stateMutability": "view",
252
- "type": "function"
253
- },
254
- {
255
- "inputs": [],
256
- "name": "epochDuration",
257
- "outputs": [
258
- {
259
- "internalType": "uint256",
260
- "name": "",
261
- "type": "uint256"
262
- }
263
- ],
264
- "stateMutability": "view",
265
- "type": "function"
266
- },
267
- {
268
- "inputs": [],
269
- "name": "finalEpoch",
270
- "outputs": [
271
- {
272
- "internalType": "uint256",
273
- "name": "",
274
- "type": "uint256"
275
- }
276
- ],
277
- "stateMutability": "view",
278
- "type": "function"
279
- },
280
- {
281
- "inputs": [],
282
- "name": "gracePeriod",
283
- "outputs": [
284
- {
285
- "internalType": "uint256",
286
- "name": "",
287
- "type": "uint256"
288
- }
289
- ],
290
- "stateMutability": "view",
291
- "type": "function"
292
- },
293
- {
294
- "inputs": [
295
- {
296
- "internalType": "uint256",
297
- "name": "index",
298
- "type": "uint256"
299
- }
300
- ],
301
- "name": "isClaimed",
302
- "outputs": [
303
- {
304
- "internalType": "bool",
305
- "name": "",
306
- "type": "bool"
307
- }
308
- ],
309
- "stateMutability": "view",
310
- "type": "function"
311
- },
312
- {
313
- "inputs": [],
314
- "name": "merkleRoot",
315
- "outputs": [
316
- {
317
- "internalType": "bytes32",
318
- "name": "",
319
- "type": "bytes32"
320
- }
321
- ],
322
- "stateMutability": "view",
323
- "type": "function"
324
- },
325
- {
326
- "inputs": [],
327
- "name": "owner",
328
- "outputs": [
329
- {
330
- "internalType": "address",
331
- "name": "",
332
- "type": "address"
333
- }
334
- ],
335
- "stateMutability": "view",
336
- "type": "function"
337
- },
338
- {
339
- "inputs": [],
340
- "name": "renounceOwnership",
341
- "outputs": [],
342
- "stateMutability": "nonpayable",
343
- "type": "function"
344
- },
345
- {
346
- "inputs": [],
347
- "name": "rewardReductionPerEpoch",
348
- "outputs": [
349
- {
350
- "internalType": "uint256",
351
- "name": "",
352
- "type": "uint256"
353
- }
354
- ],
355
- "stateMutability": "view",
356
- "type": "function"
357
- },
358
- {
359
- "inputs": [],
360
- "name": "rewardsEscrow",
361
- "outputs": [
362
- {
363
- "internalType": "address",
364
- "name": "",
365
- "type": "address"
366
- }
367
- ],
368
- "stateMutability": "view",
369
- "type": "function"
370
- },
371
- {
372
- "inputs": [],
373
- "name": "token",
374
- "outputs": [
375
- {
376
- "internalType": "address",
377
- "name": "",
378
- "type": "address"
379
- }
380
- ],
381
- "stateMutability": "view",
382
- "type": "function"
383
- },
384
- {
385
- "inputs": [
386
- {
387
- "internalType": "address",
388
- "name": "newOwner",
389
- "type": "address"
390
- }
391
- ],
392
- "name": "transferOwnership",
393
- "outputs": [],
394
- "stateMutability": "nonpayable",
395
- "type": "function"
396
- },
397
- {
398
- "inputs": [
399
- {
400
- "internalType": "address",
401
- "name": "token_",
402
- "type": "address"
403
- },
404
- {
405
- "internalType": "bytes32",
406
- "name": "merkleRoot_",
407
- "type": "bytes32"
408
- },
409
- {
410
- "internalType": "uint256",
411
- "name": "epochDuration_",
412
- "type": "uint256"
413
- },
414
- {
415
- "internalType": "uint256",
416
- "name": "rewardReductionPerEpoch_",
417
- "type": "uint256"
418
- },
419
- {
420
- "internalType": "uint256",
421
- "name": "claimsStart_",
422
- "type": "uint256"
423
- },
424
- {
425
- "internalType": "uint256",
426
- "name": "gracePeriod_",
427
- "type": "uint256"
428
- },
429
- {
430
- "internalType": "address",
431
- "name": "rewardsEscrow_",
432
- "type": "address"
433
- },
434
- {
435
- "internalType": "address",
436
- "name": "owner_",
437
- "type": "address"
438
- }
439
- ],
440
- "name": "initialize",
441
- "outputs": [],
442
- "stateMutability": "nonpayable",
443
- "type": "function"
444
- },
445
- {
446
- "inputs": [],
447
- "name": "getGracePeriodEnd",
448
- "outputs": [
449
- {
450
- "internalType": "uint256",
451
- "name": "",
452
- "type": "uint256"
453
- }
454
- ],
455
- "stateMutability": "view",
456
- "type": "function"
457
- },
458
- {
459
- "inputs": [],
460
- "name": "getClaimsStartTime",
461
- "outputs": [
462
- {
463
- "internalType": "uint256",
464
- "name": "",
465
- "type": "uint256"
466
- }
467
- ],
468
- "stateMutability": "view",
469
- "type": "function"
470
- },
471
- {
472
- "inputs": [],
473
- "name": "getNextEpochStart",
474
- "outputs": [
475
- {
476
- "internalType": "uint256",
477
- "name": "",
478
- "type": "uint256"
479
- }
480
- ],
481
- "stateMutability": "view",
482
- "type": "function"
483
- },
484
- {
485
- "inputs": [],
486
- "name": "getTimeUntilNextEpoch",
487
- "outputs": [
488
- {
489
- "internalType": "uint256",
490
- "name": "",
491
- "type": "uint256"
492
- }
493
- ],
494
- "stateMutability": "view",
495
- "type": "function"
496
- },
497
- {
498
- "inputs": [],
499
- "name": "getCurrentEpoch",
500
- "outputs": [
501
- {
502
- "internalType": "uint256",
503
- "name": "",
504
- "type": "uint256"
505
- }
506
- ],
507
- "stateMutability": "view",
508
- "type": "function"
509
- },
510
- {
511
- "inputs": [],
512
- "name": "getCurrentRewardsRate",
513
- "outputs": [
514
- {
515
- "internalType": "uint256",
516
- "name": "",
517
- "type": "uint256"
518
- }
519
- ],
520
- "stateMutability": "view",
521
- "type": "function"
522
- },
523
- {
524
- "inputs": [],
525
- "name": "getNextEpochRewardsRate",
526
- "outputs": [
527
- {
528
- "internalType": "uint256",
529
- "name": "",
530
- "type": "uint256"
531
- }
532
- ],
533
- "stateMutability": "view",
534
- "type": "function"
535
- },
536
- {
537
- "inputs": [
538
- {
539
- "internalType": "uint256",
540
- "name": "index",
541
- "type": "uint256"
542
- },
543
- {
544
- "internalType": "address",
545
- "name": "account",
546
- "type": "address"
547
- },
548
- {
549
- "internalType": "uint256",
550
- "name": "amount",
551
- "type": "uint256"
552
- },
553
- {
554
- "internalType": "bytes32[]",
555
- "name": "merkleProof",
556
- "type": "bytes32[]"
557
- }
558
- ],
559
- "name": "claim",
560
- "outputs": [],
561
- "stateMutability": "nonpayable",
562
- "type": "function"
563
- },
564
- {
565
- "inputs": [],
566
- "name": "recycleExcess",
567
- "outputs": [],
568
- "stateMutability": "nonpayable",
569
- "type": "function"
570
- },
571
- {
572
- "inputs": [
573
- {
574
- "internalType": "uint256",
575
- "name": "duration",
576
- "type": "uint256"
577
- }
578
- ],
579
- "name": "setGracePeriod",
580
- "outputs": [],
581
- "stateMutability": "nonpayable",
582
- "type": "function"
583
- }
584
- ];
585
- //
586
- var AIRDROP_CONTRACT = "0x4C20CDAdBcaE364Edc03E2B90F09eB97d08ce3C8";
587
- var CLAIM_URL = "https://fox-api.shapeshift.com/claims";
103
+ var constant_1 = require("./constant"); // Replace with your actual module file path
588
104
  module.exports = {
589
105
  init: function (settings) {
590
106
  //blockbook.init()
@@ -649,6 +165,9 @@ module.exports = {
649
165
  getPoolPositions: function (address) {
650
166
  return get_pool_positions(address);
651
167
  },
168
+ getAllPioneers: function () {
169
+ return get_all_pioneers();
170
+ },
652
171
  getAllTokensEth: function (address) {
653
172
  return get_all_tokens_blockbook(address);
654
173
  },
@@ -698,6 +217,45 @@ module.exports = {
698
217
  return broadcast_transaction(tx);
699
218
  }
700
219
  };
220
+ var get_all_pioneers = function () {
221
+ return __awaiter(this, void 0, void 0, function () {
222
+ var tag, output, nftContract, totalSupply, i, owner, e_1;
223
+ return __generator(this, function (_a) {
224
+ switch (_a.label) {
225
+ case 0:
226
+ tag = TAG + " | get_all_pioneers | ";
227
+ _a.label = 1;
228
+ case 1:
229
+ _a.trys.push([1, 7, , 8]);
230
+ output = {};
231
+ nftContract = new web3.eth.Contract(constant_1.ERC721_ABI, constant_1.PIONEER_CONTRACT_ADDRESS);
232
+ return [4 /*yield*/, nftContract.methods.totalSupply().call()];
233
+ case 2:
234
+ totalSupply = _a.sent();
235
+ output['totalSupply'] = totalSupply;
236
+ output['owners'] = [];
237
+ i = 0;
238
+ _a.label = 3;
239
+ case 3:
240
+ if (!(i < totalSupply)) return [3 /*break*/, 6];
241
+ return [4 /*yield*/, nftContract.methods.ownerOf(i).call()];
242
+ case 4:
243
+ owner = _a.sent();
244
+ output['owners'].push(owner.toLowerCase());
245
+ _a.label = 5;
246
+ case 5:
247
+ i++;
248
+ return [3 /*break*/, 3];
249
+ case 6: return [2 /*return*/, output];
250
+ case 7:
251
+ e_1 = _a.sent();
252
+ console.error(tag, e_1);
253
+ return [3 /*break*/, 8];
254
+ case 8: return [2 /*return*/];
255
+ }
256
+ });
257
+ });
258
+ };
701
259
  var decode_tx = function (tx) {
702
260
  return __awaiter(this, void 0, void 0, function () {
703
261
  var tag, data;
@@ -716,7 +274,7 @@ var decode_tx = function (tx) {
716
274
  };
717
275
  var build_airdrop_claim = function (address) {
718
276
  return __awaiter(this, void 0, void 0, function () {
719
- var tag, airdropContract, accountInfo, AirDropInterface, data, e_1;
277
+ var tag, airdropContract, accountInfo, AirDropInterface, data, e_2;
720
278
  return __generator(this, function (_a) {
721
279
  switch (_a.label) {
722
280
  case 0:
@@ -724,8 +282,8 @@ var build_airdrop_claim = function (address) {
724
282
  _a.label = 1;
725
283
  case 1:
726
284
  _a.trys.push([1, 3, , 4]);
727
- airdropContract = new web3.eth.Contract(AIRDROP_ABI, AIRDROP_CONTRACT);
728
- return [4 /*yield*/, axios({ method: 'GET', url: CLAIM_URL + '/' + address })
285
+ airdropContract = new web3.eth.Contract(constant_1.AIRDROP_ABI, constant_1.AIRDROP_CONTRACT);
286
+ return [4 /*yield*/, axios({ method: 'GET', url: constant_1.CLAIM_URL + '/' + address })
729
287
  //console.log("accountInfo: ",accountInfo)
730
288
  ];
731
289
  case 2:
@@ -733,7 +291,7 @@ var build_airdrop_claim = function (address) {
733
291
  //console.log("accountInfo: ",accountInfo)
734
292
  if (!accountInfo.data.index)
735
293
  throw Error("Not found in db! ");
736
- AirDropInterface = new abi_1.Interface(AIRDROP_ABI);
294
+ AirDropInterface = new abi_1.Interface(constant_1.AIRDROP_ABI);
737
295
  data = AirDropInterface.encodeFunctionData('claim', [
738
296
  accountInfo.data.index,
739
297
  address,
@@ -742,8 +300,8 @@ var build_airdrop_claim = function (address) {
742
300
  ]);
743
301
  return [2 /*return*/, data];
744
302
  case 3:
745
- e_1 = _a.sent();
746
- console.error(tag, e_1);
303
+ e_2 = _a.sent();
304
+ console.error(tag, e_2);
747
305
  return [3 /*break*/, 4];
748
306
  case 4: return [2 /*return*/];
749
307
  }
@@ -752,7 +310,7 @@ var build_airdrop_claim = function (address) {
752
310
  };
753
311
  var check_airdrop_claim = function (address) {
754
312
  return __awaiter(this, void 0, void 0, function () {
755
- var tag, accountInfo, output, airdropContract, isClaimed, e_2;
313
+ var tag, accountInfo, output, airdropContract, isClaimed, e_3;
756
314
  return __generator(this, function (_a) {
757
315
  switch (_a.label) {
758
316
  case 0:
@@ -760,7 +318,7 @@ var check_airdrop_claim = function (address) {
760
318
  _a.label = 1;
761
319
  case 1:
762
320
  _a.trys.push([1, 6, , 7]);
763
- return [4 /*yield*/, axios({ method: 'GET', url: CLAIM_URL + '/' + address })
321
+ return [4 /*yield*/, axios({ method: 'GET', url: constant_1.CLAIM_URL + '/' + address })
764
322
  //console.log("accountInfo: ",accountInfo)
765
323
  ];
766
324
  case 2:
@@ -769,7 +327,7 @@ var check_airdrop_claim = function (address) {
769
327
  if (!accountInfo.data.index) return [3 /*break*/, 4];
770
328
  output.isElgible = true;
771
329
  output.contract = accountInfo.data.contractAddress;
772
- airdropContract = new web3.eth.Contract(AIRDROP_ABI, accountInfo.data.contractAddress);
330
+ airdropContract = new web3.eth.Contract(constant_1.AIRDROP_ABI, accountInfo.data.contractAddress);
773
331
  return [4 /*yield*/, airdropContract.methods.isClaimed(accountInfo.data.index).call()];
774
332
  case 3:
775
333
  isClaimed = _a.sent();
@@ -780,8 +338,8 @@ var check_airdrop_claim = function (address) {
780
338
  _a.label = 5;
781
339
  case 5: return [2 /*return*/, output];
782
340
  case 6:
783
- e_2 = _a.sent();
784
- console.error(tag, e_2);
341
+ e_3 = _a.sent();
342
+ console.error(tag, e_3);
785
343
  return [3 /*break*/, 7];
786
344
  case 7: return [2 /*return*/];
787
345
  }
@@ -790,7 +348,7 @@ var check_airdrop_claim = function (address) {
790
348
  };
791
349
  var get_symbol_from_contract = function (address) {
792
350
  return __awaiter(this, void 0, void 0, function () {
793
- var tag, contract, tokenName, e_3;
351
+ var tag, contract, tokenName, e_4;
794
352
  return __generator(this, function (_a) {
795
353
  switch (_a.label) {
796
354
  case 0:
@@ -798,7 +356,7 @@ var get_symbol_from_contract = function (address) {
798
356
  _a.label = 1;
799
357
  case 1:
800
358
  _a.trys.push([1, 3, , 4]);
801
- contract = new web3.eth.Contract(ERC20ABI, address);
359
+ contract = new web3.eth.Contract(constant_1.ERC20ABI, address);
802
360
  return [4 /*yield*/, contract.methods.name().call()
803
361
  //log.debug(tag,"tokenName: ",tokenName)
804
362
  ];
@@ -807,8 +365,8 @@ var get_symbol_from_contract = function (address) {
807
365
  //log.debug(tag,"tokenName: ",tokenName)
808
366
  return [2 /*return*/, tokenName];
809
367
  case 3:
810
- e_3 = _a.sent();
811
- console.error(tag, e_3);
368
+ e_4 = _a.sent();
369
+ console.error(tag, e_4);
812
370
  return [3 /*break*/, 4];
813
371
  case 4: return [2 /*return*/];
814
372
  }
@@ -817,7 +375,7 @@ var get_symbol_from_contract = function (address) {
817
375
  };
818
376
  var get_stream = function (streamId) {
819
377
  return __awaiter(this, void 0, void 0, function () {
820
- var tag, sablierContract, totalFox, e_4;
378
+ var tag, sablierContract, totalFox, e_5;
821
379
  return __generator(this, function (_a) {
822
380
  switch (_a.label) {
823
381
  case 0:
@@ -825,7 +383,7 @@ var get_stream = function (streamId) {
825
383
  _a.label = 1;
826
384
  case 1:
827
385
  _a.trys.push([1, 3, , 4]);
828
- sablierContract = new web3.eth.Contract(SABLIER_ABI, PROXY_CONTRACT_SABLIER);
386
+ sablierContract = new web3.eth.Contract(constant_1.SABLIER_ABI, constant_1.PROXY_CONTRACT_SABLIER);
829
387
  //log.debug(tag,"sablierContract: ",sablierContract)
830
388
  //log.debug(tag,"streamId: ",streamId)
831
389
  streamId = parseInt(streamId);
@@ -837,8 +395,8 @@ var get_stream = function (streamId) {
837
395
  //log.debug(tag,"totalFox: ",totalFox)
838
396
  return [2 /*return*/, totalFox];
839
397
  case 3:
840
- e_4 = _a.sent();
841
- console.error(tag, e_4);
398
+ e_5 = _a.sent();
399
+ console.error(tag, e_5);
842
400
  return [3 /*break*/, 4];
843
401
  case 4: return [2 /*return*/];
844
402
  }
@@ -847,7 +405,7 @@ var get_stream = function (streamId) {
847
405
  };
848
406
  var get_tx_count = function (address, options) {
849
407
  return __awaiter(this, void 0, void 0, function () {
850
- var tag, txsConfirmed, txsWithPending, pending, e_5;
408
+ var tag, txsConfirmed, txsWithPending, pending, e_6;
851
409
  return __generator(this, function (_a) {
852
410
  switch (_a.label) {
853
411
  case 0:
@@ -875,8 +433,8 @@ var get_tx_count = function (address, options) {
875
433
  pending: pending
876
434
  }];
877
435
  case 4:
878
- e_5 = _a.sent();
879
- console.error(tag, e_5);
436
+ e_6 = _a.sent();
437
+ console.error(tag, e_6);
880
438
  return [3 /*break*/, 5];
881
439
  case 5: return [2 /*return*/];
882
440
  }
@@ -885,7 +443,7 @@ var get_tx_count = function (address, options) {
885
443
  };
886
444
  var get_pool_percent = function (amountFox, amountEth, poolAddress) {
887
445
  return __awaiter(this, void 0, void 0, function () {
888
- var tag, lpContract, foxContract, wethContract, totalSupply, totalFox, totalEth, result, lpTokens, percent, e_6;
446
+ var tag, lpContract, foxContract, wethContract, totalSupply, totalFox, totalEth, result, lpTokens, percent, e_7;
889
447
  return __generator(this, function (_a) {
890
448
  switch (_a.label) {
891
449
  case 0:
@@ -893,20 +451,20 @@ var get_pool_percent = function (amountFox, amountEth, poolAddress) {
893
451
  _a.label = 1;
894
452
  case 1:
895
453
  _a.trys.push([1, 5, , 6]);
896
- lpContract = new web3.eth.Contract(ERC20ABI, UNISWAP_V2_WETH_FOX_POOL_ADDRESS);
897
- foxContract = new web3.eth.Contract(ERC20ABI, FOX_TOKEN_CONTRACT_ADDRESS);
898
- wethContract = new web3.eth.Contract(ERC20ABI, WETH_TOKEN_CONTRACT_ADDRESS);
454
+ lpContract = new web3.eth.Contract(constant_1.ERC20ABI, constant_1.UNISWAP_V2_WETH_FOX_POOL_ADDRESS);
455
+ foxContract = new web3.eth.Contract(constant_1.ERC20ABI, constant_1.FOX_TOKEN_CONTRACT_ADDRESS);
456
+ wethContract = new web3.eth.Contract(constant_1.ERC20ABI, constant_1.WETH_TOKEN_CONTRACT_ADDRESS);
899
457
  return [4 /*yield*/, lpContract.methods.totalSupply().call()];
900
458
  case 2:
901
459
  totalSupply = _a.sent();
902
460
  totalSupply = totalSupply / BASE;
903
461
  log.debug("LP totalSupply: ", totalSupply);
904
- return [4 /*yield*/, foxContract.methods.balanceOf(UNISWAP_V2_WETH_FOX_POOL_ADDRESS).call()];
462
+ return [4 /*yield*/, foxContract.methods.balanceOf(constant_1.UNISWAP_V2_WETH_FOX_POOL_ADDRESS).call()];
905
463
  case 3:
906
464
  totalFox = _a.sent();
907
465
  totalFox = totalFox / BASE;
908
466
  log.debug("totalFox: ", totalFox / BASE);
909
- return [4 /*yield*/, wethContract.methods.balanceOf(UNISWAP_V2_WETH_FOX_POOL_ADDRESS).call()];
467
+ return [4 /*yield*/, wethContract.methods.balanceOf(constant_1.UNISWAP_V2_WETH_FOX_POOL_ADDRESS).call()];
910
468
  case 4:
911
469
  totalEth = _a.sent();
912
470
  totalEth = totalEth / BASE;
@@ -919,8 +477,8 @@ var get_pool_percent = function (amountFox, amountEth, poolAddress) {
919
477
  log.debug("percent: ", percent);
920
478
  return [2 /*return*/, percent];
921
479
  case 5:
922
- e_6 = _a.sent();
923
- console.error(tag, e_6);
480
+ e_7 = _a.sent();
481
+ console.error(tag, e_7);
924
482
  return [3 /*break*/, 6];
925
483
  case 6: return [2 /*return*/];
926
484
  }
@@ -929,7 +487,7 @@ var get_pool_percent = function (amountFox, amountEth, poolAddress) {
929
487
  };
930
488
  var get_balances = function (addresses) {
931
489
  return __awaiter(this, void 0, void 0, function () {
932
- var tag, actions, i, address, action, result, output, i, entry, balance, e_7;
490
+ var tag, actions, i, address, action, result, output, i, entry, balance, e_8;
933
491
  return __generator(this, function (_a) {
934
492
  switch (_a.label) {
935
493
  case 0:
@@ -961,8 +519,8 @@ var get_balances = function (addresses) {
961
519
  }
962
520
  return [2 /*return*/, output];
963
521
  case 3:
964
- e_7 = _a.sent();
965
- console.error(tag, e_7);
522
+ e_8 = _a.sent();
523
+ console.error(tag, e_8);
966
524
  return [3 /*break*/, 4];
967
525
  case 4: return [2 /*return*/];
968
526
  }
@@ -1013,7 +571,7 @@ var rpcCallBatch = function (actions) { return __awaiter(void 0, void 0, void 0,
1013
571
  //get_approval_status
1014
572
  var get_allowance = function (tokenAddress, spender, sender) {
1015
573
  return __awaiter(this, void 0, void 0, function () {
1016
- var tag, contract, allowance, e_8;
574
+ var tag, contract, allowance, e_9;
1017
575
  return __generator(this, function (_a) {
1018
576
  switch (_a.label) {
1019
577
  case 0:
@@ -1021,14 +579,14 @@ var get_allowance = function (tokenAddress, spender, sender) {
1021
579
  _a.label = 1;
1022
580
  case 1:
1023
581
  _a.trys.push([1, 3, , 4]);
1024
- contract = new web3.eth.Contract(ERC20ABI, tokenAddress);
582
+ contract = new web3.eth.Contract(constant_1.ERC20ABI, tokenAddress);
1025
583
  return [4 /*yield*/, contract.methods.allowance(spender, sender).call()];
1026
584
  case 2:
1027
585
  allowance = _a.sent();
1028
586
  return [2 /*return*/, allowance];
1029
587
  case 3:
1030
- e_8 = _a.sent();
1031
- console.error(tag, e_8);
588
+ e_9 = _a.sent();
589
+ console.error(tag, e_9);
1032
590
  return [3 /*break*/, 4];
1033
591
  case 4: return [2 /*return*/];
1034
592
  }
@@ -1037,7 +595,7 @@ var get_allowance = function (tokenAddress, spender, sender) {
1037
595
  };
1038
596
  var get_all_tokens_blockbook = function (address) {
1039
597
  return __awaiter(this, void 0, void 0, function () {
1040
- var tag, ethInto, e_9;
598
+ var tag, ethInto, e_10;
1041
599
  return __generator(this, function (_a) {
1042
600
  switch (_a.label) {
1043
601
  case 0:
@@ -1051,8 +609,8 @@ var get_all_tokens_blockbook = function (address) {
1051
609
  log.debug(tag, "ethInto: ", ethInto);
1052
610
  return [2 /*return*/, true];
1053
611
  case 3:
1054
- e_9 = _a.sent();
1055
- console.error(tag, e_9);
612
+ e_10 = _a.sent();
613
+ console.error(tag, e_10);
1056
614
  return [3 /*break*/, 4];
1057
615
  case 4: return [2 /*return*/];
1058
616
  }
@@ -1061,7 +619,7 @@ var get_all_tokens_blockbook = function (address) {
1061
619
  };
1062
620
  var get_nfts = function (address) {
1063
621
  return __awaiter(this, void 0, void 0, function () {
1064
- var tag, ethInfo, e_10;
622
+ var tag, ethInfo, e_11;
1065
623
  return __generator(this, function (_a) {
1066
624
  switch (_a.label) {
1067
625
  case 0:
@@ -1078,8 +636,8 @@ var get_nfts = function (address) {
1078
636
  log.debug(tag, "ethInfo: ", ethInfo);
1079
637
  return [2 /*return*/, ethInfo];
1080
638
  case 3:
1081
- e_10 = _a.sent();
1082
- console.error(tag, e_10);
639
+ e_11 = _a.sent();
640
+ console.error(tag, e_11);
1083
641
  return [3 /*break*/, 4];
1084
642
  case 4: return [2 /*return*/];
1085
643
  }
@@ -1088,7 +646,7 @@ var get_nfts = function (address) {
1088
646
  };
1089
647
  var get_pool_positions = function (address) {
1090
648
  return __awaiter(this, void 0, void 0, function () {
1091
- var tag, ethInfo, e_11;
649
+ var tag, ethInfo, e_12;
1092
650
  return __generator(this, function (_a) {
1093
651
  switch (_a.label) {
1094
652
  case 0:
@@ -1105,8 +663,8 @@ var get_pool_positions = function (address) {
1105
663
  log.debug(tag, "ethInfo: ", ethInfo);
1106
664
  return [2 /*return*/, ethInfo];
1107
665
  case 3:
1108
- e_11 = _a.sent();
1109
- console.error(tag, e_11);
666
+ e_12 = _a.sent();
667
+ console.error(tag, e_12);
1110
668
  return [3 /*break*/, 4];
1111
669
  case 4: return [2 /*return*/];
1112
670
  }
@@ -1141,7 +699,7 @@ var get_memo_data = function (swap) {
1141
699
  web3_1 = new Web3();
1142
700
  if (!swap.inboundAddress.router)
1143
701
  throw Error("Router required!");
1144
- routerContract = new web3_1.eth.Contract(TCRopstenAbi, swap.inboundAddress.router);
702
+ routerContract = new web3_1.eth.Contract(constant_1.TCRopstenAbi, swap.inboundAddress.router);
1145
703
  memo = swap.memo;
1146
704
  data = routerContract.methods
1147
705
  .deposit(swap.inboundAddress.address, '0x0000000000000000000000000000000000000000', // 0 = ETH
@@ -1162,7 +720,7 @@ var get_memo_data = function (swap) {
1162
720
  */
1163
721
  var estimate_fee = function (sourceAsset, params) {
1164
722
  return __awaiter(this, void 0, void 0, function () {
1165
- var tag, checkSummedAddress, decimal, provider, contract, estimateGas, entry, fees, minimumWeiCost, e_12;
723
+ var tag, checkSummedAddress, decimal, provider, contract, estimateGas, entry, fees, minimumWeiCost, e_13;
1166
724
  var _a;
1167
725
  return __generator(this, function (_b) {
1168
726
  switch (_b.label) {
@@ -1188,7 +746,7 @@ var estimate_fee = function (sourceAsset, params) {
1188
746
  // decimal = tokenDecimals.toNumber();
1189
747
  }
1190
748
  provider = PROVIDER;
1191
- contract = new ethers_1.ethers.Contract(THORCHAIN_ROUTER_TESTNET, TCRopstenAbi, provider);
749
+ contract = new ethers_1.ethers.Contract(constant_1.THORCHAIN_ROUTER_TESTNET, constant_1.TCRopstenAbi, provider);
1192
750
  console.log('checkppint estimateFee: params', params);
1193
751
  return [4 /*yield*/, (_a = contract.estimateGas).deposit.apply(_a, params)];
1194
752
  case 2:
@@ -1211,9 +769,9 @@ var estimate_fee = function (sourceAsset, params) {
1211
769
  minimumWeiCost = minimumWeiCost.mul(estimateGas.toNumber());
1212
770
  return [2 /*return*/, minimumWeiCost];
1213
771
  case 4:
1214
- e_12 = _b.sent();
1215
- log.error(tag, e_12);
1216
- throw e_12;
772
+ e_13 = _b.sent();
773
+ log.error(tag, e_13);
774
+ throw e_13;
1217
775
  case 5: return [2 /*return*/];
1218
776
  }
1219
777
  });
@@ -1222,7 +780,7 @@ var estimate_fee = function (sourceAsset, params) {
1222
780
  var get_gas_limit = function (_a) {
1223
781
  var asset = _a.asset, recipient = _a.recipient, amount = _a.amount, memo = _a.memo;
1224
782
  return __awaiter(this, void 0, void 0, function () {
1225
- var tag, txAmount, assetAddress, estimate, contract, transactionRequest, e_13;
783
+ var tag, txAmount, assetAddress, estimate, contract, transactionRequest, e_14;
1226
784
  return __generator(this, function (_b) {
1227
785
  switch (_b.label) {
1228
786
  case 0:
@@ -1233,8 +791,8 @@ var get_gas_limit = function (_a) {
1233
791
  log.debug(tag, "input: ", { asset: asset, recipient: recipient, amount: amount, memo: memo });
1234
792
  txAmount = ethers_1.BigNumber.from(amount === null || amount === void 0 ? void 0 : amount.amount().toFixed());
1235
793
  assetAddress = void 0;
1236
- if (asset && xchain_util_1.assetToString(asset) !== xchain_util_1.assetToString(xchain_util_1.AssetETH)) {
1237
- assetAddress = utils_1.getTokenAddress(asset);
794
+ if (asset && (0, xchain_util_1.assetToString)(asset) !== (0, xchain_util_1.assetToString)(xchain_util_1.AssetETH)) {
795
+ assetAddress = (0, utils_1.getTokenAddress)(asset);
1238
796
  }
1239
797
  estimate = void 0;
1240
798
  if (!(assetAddress && assetAddress !== utils_1.ETHAddress)) return [3 /*break*/, 3];
@@ -1250,7 +808,7 @@ var get_gas_limit = function (_a) {
1250
808
  from: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
1251
809
  to: recipient,
1252
810
  value: txAmount,
1253
- data: memo ? utils_2.toUtf8Bytes(memo) : undefined,
811
+ data: memo ? (0, utils_2.toUtf8Bytes)(memo) : undefined,
1254
812
  };
1255
813
  return [4 /*yield*/, PROVIDER.estimateGas(transactionRequest)];
1256
814
  case 4:
@@ -1258,9 +816,9 @@ var get_gas_limit = function (_a) {
1258
816
  _b.label = 5;
1259
817
  case 5: return [2 /*return*/, estimate];
1260
818
  case 6:
1261
- e_13 = _b.sent();
1262
- log.error(tag, e_13);
1263
- throw e_13;
819
+ e_14 = _b.sent();
820
+ log.error(tag, e_14);
821
+ throw e_14;
1264
822
  case 7: return [2 /*return*/];
1265
823
  }
1266
824
  });
@@ -1269,7 +827,7 @@ var get_gas_limit = function (_a) {
1269
827
  var get_fees = function (params) {
1270
828
  var _a;
1271
829
  return __awaiter(this, void 0, void 0, function () {
1272
- var tag, response, averageWei, fastWei, fastestWei, gasPrices, fastGP, fastestGP, averageGP, gasLimit, output, e_14;
830
+ var tag, response, averageWei, fastWei, fastestWei, gasPrices, fastGP, fastestGP, averageGP, gasLimit, output, e_15;
1273
831
  return __generator(this, function (_b) {
1274
832
  switch (_b.label) {
1275
833
  case 0:
@@ -1282,13 +840,13 @@ var get_fees = function (params) {
1282
840
  ];
1283
841
  case 2:
1284
842
  response = _b.sent();
1285
- averageWei = utils_2.parseUnits(response.SafeGasPrice, 'gwei');
1286
- fastWei = utils_2.parseUnits(response.ProposeGasPrice, 'gwei');
1287
- fastestWei = utils_2.parseUnits(response.FastGasPrice, 'gwei');
843
+ averageWei = (0, utils_2.parseUnits)(response.SafeGasPrice, 'gwei');
844
+ fastWei = (0, utils_2.parseUnits)(response.ProposeGasPrice, 'gwei');
845
+ fastestWei = (0, utils_2.parseUnits)(response.FastGasPrice, 'gwei');
1288
846
  gasPrices = {
1289
- average: xchain_util_1.baseAmount(averageWei.toString(), utils_1.ETH_DECIMAL),
1290
- fast: xchain_util_1.baseAmount(fastWei.toString(), utils_1.ETH_DECIMAL),
1291
- fastest: xchain_util_1.baseAmount(fastestWei.toString(), utils_1.ETH_DECIMAL),
847
+ average: (0, xchain_util_1.baseAmount)(averageWei.toString(), utils_1.ETH_DECIMAL),
848
+ fast: (0, xchain_util_1.baseAmount)(fastWei.toString(), utils_1.ETH_DECIMAL),
849
+ fastest: (0, xchain_util_1.baseAmount)(fastestWei.toString(), utils_1.ETH_DECIMAL),
1292
850
  };
1293
851
  fastGP = gasPrices.fast, fastestGP = gasPrices.fastest, averageGP = gasPrices.average;
1294
852
  if (!params.amount || !((_a = params === null || params === void 0 ? void 0 : params.amount) === null || _a === void 0 ? void 0 : _a.amount)) {
@@ -1316,17 +874,17 @@ var get_fees = function (params) {
1316
874
  gasPrices: gasPrices,
1317
875
  fees: {
1318
876
  type: 'byte',
1319
- average: utils_1.getFee({ gasPrice: averageGP, gasLimit: gasLimit }).amount().toString(),
1320
- fast: utils_1.getFee({ gasPrice: fastGP, gasLimit: gasLimit }).amount().toString(),
1321
- fastest: utils_1.getFee({ gasPrice: fastestGP, gasLimit: gasLimit }).amount().toString(),
877
+ average: (0, utils_1.getFee)({ gasPrice: averageGP, gasLimit: gasLimit }).amount().toString(),
878
+ fast: (0, utils_1.getFee)({ gasPrice: fastGP, gasLimit: gasLimit }).amount().toString(),
879
+ fastest: (0, utils_1.getFee)({ gasPrice: fastestGP, gasLimit: gasLimit }).amount().toString(),
1322
880
  },
1323
881
  gasLimit: gasLimit,
1324
882
  };
1325
883
  return [2 /*return*/, output];
1326
884
  case 4:
1327
- e_14 = _b.sent();
1328
- log.error(tag, e_14);
1329
- throw e_14;
885
+ e_15 = _b.sent();
886
+ log.error(tag, e_15);
887
+ throw e_15;
1330
888
  case 5: return [2 /*return*/];
1331
889
  }
1332
890
  });
@@ -1334,7 +892,7 @@ var get_fees = function (params) {
1334
892
  };
1335
893
  var broadcast_transaction = function (tx) {
1336
894
  return __awaiter(this, void 0, void 0, function () {
1337
- var tag, output, resp, e_15;
895
+ var tag, output, resp, e_16;
1338
896
  return __generator(this, function (_a) {
1339
897
  switch (_a.label) {
1340
898
  case 0:
@@ -1377,9 +935,9 @@ var broadcast_transaction = function (tx) {
1377
935
  output.txid = resp.result;
1378
936
  return [2 /*return*/, output];
1379
937
  case 3:
1380
- e_15 = _a.sent();
1381
- log.error(tag, e_15);
1382
- throw e_15;
938
+ e_16 = _a.sent();
939
+ log.error(tag, e_16);
940
+ throw e_16;
1383
941
  case 4: return [2 /*return*/];
1384
942
  }
1385
943
  });
@@ -1387,7 +945,7 @@ var broadcast_transaction = function (tx) {
1387
945
  };
1388
946
  var get_balance_tokens = function (address) {
1389
947
  return __awaiter(this, void 0, void 0, function () {
1390
- var tag, balances, valueUsds, coinInfo, resp, tokenInfo, i, info, symbol, rate, balance, e_16;
948
+ var tag, balances, valueUsds, coinInfo, resp, tokenInfo, i, info, symbol, rate, balance, e_17;
1391
949
  return __generator(this, function (_a) {
1392
950
  switch (_a.label) {
1393
951
  case 0:
@@ -1432,8 +990,8 @@ var get_balance_tokens = function (address) {
1432
990
  }
1433
991
  return [2 /*return*/, { balances: balances, valueUsds: valueUsds, coinInfo: coinInfo }];
1434
992
  case 3:
1435
- e_16 = _a.sent();
1436
- console.error(tag, e_16);
993
+ e_17 = _a.sent();
994
+ console.error(tag, e_17);
1437
995
  return [3 /*break*/, 4];
1438
996
  case 4: return [2 /*return*/];
1439
997
  }
@@ -1442,7 +1000,7 @@ var get_balance_tokens = function (address) {
1442
1000
  };
1443
1001
  var get_balance_token = function (address, token) {
1444
1002
  return __awaiter(this, void 0, void 0, function () {
1445
- var tag, contract, decimals, balance, e_17;
1003
+ var tag, contract, decimals, balance, e_18;
1446
1004
  return __generator(this, function (_a) {
1447
1005
  switch (_a.label) {
1448
1006
  case 0:
@@ -1450,7 +1008,7 @@ var get_balance_token = function (address, token) {
1450
1008
  _a.label = 1;
1451
1009
  case 1:
1452
1010
  _a.trys.push([1, 4, , 5]);
1453
- contract = new web3.eth.Contract(ERC20ABI, token);
1011
+ contract = new web3.eth.Contract(constant_1.ERC20ABI, token);
1454
1012
  return [4 /*yield*/, contract.methods.decimals().call()
1455
1013
  //log.debug(tag,"decimals: ",decimals)
1456
1014
  ];
@@ -1464,8 +1022,8 @@ var get_balance_token = function (address, token) {
1464
1022
  //log.debug(tag,"balance: ",balance)
1465
1023
  return [2 /*return*/, balance / Math.pow(10, decimals)];
1466
1024
  case 4:
1467
- e_17 = _a.sent();
1468
- console.error(tag, e_17);
1025
+ e_18 = _a.sent();
1026
+ console.error(tag, e_18);
1469
1027
  return [3 /*break*/, 5];
1470
1028
  case 5: return [2 /*return*/];
1471
1029
  }
@@ -1474,7 +1032,7 @@ var get_balance_token = function (address, token) {
1474
1032
  };
1475
1033
  var get_balance = function (address) {
1476
1034
  return __awaiter(this, void 0, void 0, function () {
1477
- var tag, output, e_18;
1035
+ var tag, output, e_19;
1478
1036
  return __generator(this, function (_a) {
1479
1037
  switch (_a.label) {
1480
1038
  case 0:
@@ -1489,8 +1047,8 @@ var get_balance = function (address) {
1489
1047
  output = (_a.sent()) / BASE;
1490
1048
  return [2 /*return*/, output];
1491
1049
  case 3:
1492
- e_18 = _a.sent();
1493
- console.error(tag, e_18);
1050
+ e_19 = _a.sent();
1051
+ console.error(tag, e_19);
1494
1052
  return [3 /*break*/, 4];
1495
1053
  case 4: return [2 /*return*/];
1496
1054
  }
@@ -1499,7 +1057,7 @@ var get_balance = function (address) {
1499
1057
  };
1500
1058
  var get_transactions = function (address, options) {
1501
1059
  return __awaiter(this, void 0, void 0, function () {
1502
- var tag, output, ethInfo, e_19;
1060
+ var tag, output, ethInfo, e_20;
1503
1061
  return __generator(this, function (_a) {
1504
1062
  switch (_a.label) {
1505
1063
  case 0:
@@ -1513,8 +1071,8 @@ var get_transactions = function (address, options) {
1513
1071
  ethInfo = _a.sent();
1514
1072
  return [2 /*return*/, ethInfo];
1515
1073
  case 3:
1516
- e_19 = _a.sent();
1517
- console.error(tag, e_19);
1074
+ e_20 = _a.sent();
1075
+ console.error(tag, e_20);
1518
1076
  return [3 /*break*/, 4];
1519
1077
  case 4: return [2 /*return*/];
1520
1078
  }
@@ -1523,7 +1081,7 @@ var get_transactions = function (address, options) {
1523
1081
  };
1524
1082
  var get_transaction = function (txid) {
1525
1083
  return __awaiter(this, void 0, void 0, function () {
1526
- var tag, output, _a, _b, e_20;
1084
+ var tag, output, _a, _b, e_21;
1527
1085
  return __generator(this, function (_c) {
1528
1086
  switch (_c.label) {
1529
1087
  case 0:
@@ -1548,8 +1106,8 @@ var get_transaction = function (txid) {
1548
1106
  _b.receipt = _c.sent();
1549
1107
  return [2 /*return*/, output];
1550
1108
  case 4:
1551
- e_20 = _c.sent();
1552
- console.error(tag, e_20);
1109
+ e_21 = _c.sent();
1110
+ console.error(tag, e_21);
1553
1111
  return [3 /*break*/, 5];
1554
1112
  case 5: return [2 /*return*/];
1555
1113
  }
@@ -1558,7 +1116,7 @@ var get_transaction = function (txid) {
1558
1116
  };
1559
1117
  var check_online_status = function () {
1560
1118
  return __awaiter(this, void 0, void 0, function () {
1561
- var tag, output, _a, _b, _c, _d, networkName, _e, _f, e_21;
1119
+ var tag, output, _a, _b, _c, _d, networkName, _e, _f, e_22;
1562
1120
  return __generator(this, function (_g) {
1563
1121
  switch (_g.label) {
1564
1122
  case 0:
@@ -1626,8 +1184,8 @@ var check_online_status = function () {
1626
1184
  _f.syncing = _g.sent();
1627
1185
  return [2 /*return*/, output];
1628
1186
  case 8:
1629
- e_21 = _g.sent();
1630
- console.error(tag, e_21);
1187
+ e_22 = _g.sent();
1188
+ console.error(tag, e_22);
1631
1189
  return [3 /*break*/, 9];
1632
1190
  case 9: return [2 /*return*/];
1633
1191
  }