edge-currency-accountbased 0.22.21 → 0.23.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/android/src/main/assets/edge-currency-accountbased/{645.chunk.js → 216.chunk.js} +6 -6
  3. package/android/src/main/assets/edge-currency-accountbased/244.chunk.js +1 -1
  4. package/android/src/main/assets/edge-currency-accountbased/387.chunk.js +9 -0
  5. package/android/src/main/assets/edge-currency-accountbased/491.chunk.js +1 -1
  6. package/android/src/main/assets/edge-currency-accountbased/549.chunk.js +1 -1
  7. package/android/src/main/assets/edge-currency-accountbased/94.chunk.js +8 -9
  8. package/android/src/main/assets/edge-currency-accountbased/bnb.chunk.js +3 -3
  9. package/android/src/main/assets/edge-currency-accountbased/edge-currency-accountbased.js +2 -2
  10. package/android/src/main/assets/edge-currency-accountbased/eos.chunk.js +11 -11
  11. package/android/src/main/assets/edge-currency-accountbased/ethereum.chunk.js +9 -9
  12. package/android/src/main/assets/edge-currency-accountbased/fio.chunk.js +2 -2
  13. package/android/src/main/assets/edge-currency-accountbased/hedera.chunk.js +2 -2
  14. package/android/src/main/assets/edge-currency-accountbased/polkadot.chunk.js +2 -2
  15. package/android/src/main/assets/edge-currency-accountbased/ripple.chunk.js +5 -4
  16. package/android/src/main/assets/edge-currency-accountbased/solana.chunk.js +3 -3
  17. package/android/src/main/assets/edge-currency-accountbased/stellar.chunk.js +6 -6
  18. package/android/src/main/assets/edge-currency-accountbased/tezos.chunk.js +3 -3
  19. package/android/src/main/assets/edge-currency-accountbased/tron.chunk.js +1 -1
  20. package/android/src/main/assets/edge-currency-accountbased/zcash.chunk.js +2 -2
  21. package/lib/binance/bnbEngine.js +28 -16
  22. package/lib/binance/bnbTypes.js +11 -0
  23. package/lib/common/engine.js +47 -3
  24. package/lib/common/types.js +20 -0
  25. package/lib/declare-modules.d.js +0 -22
  26. package/lib/eos/eosEngine.js +32 -21
  27. package/lib/eos/eosTypes.js +16 -0
  28. package/lib/eos/info/eosInfo.js +3 -1
  29. package/lib/ethereum/ethEngine.js +90 -140
  30. package/lib/ethereum/ethTypes.js +64 -0
  31. package/lib/fio/fioConst.js +26 -55
  32. package/lib/fio/fioEngine.js +830 -609
  33. package/lib/fio/fioError.js +15 -22
  34. package/lib/fio/fioInfo.js +13 -23
  35. package/lib/fio/fioPlugin.js +85 -94
  36. package/lib/fio/fioTypes.js +180 -1
  37. package/lib/hedera/hederaEngine.js +24 -12
  38. package/lib/hedera/hederaTypes.js +37 -0
  39. package/lib/polkadot/polkadotEngine.js +30 -10
  40. package/lib/polkadot/polkadotTypes.js +37 -0
  41. package/lib/solana/solanaEngine.js +25 -27
  42. package/lib/solana/solanaTypes.js +37 -0
  43. package/lib/stellar/stellarEngine.js +21 -19
  44. package/lib/stellar/stellarTypes.js +10 -0
  45. package/lib/tezos/tezosEngine.js +23 -18
  46. package/lib/tezos/tezosTypes.js +16 -0
  47. package/lib/tron/tronEngine.js +14 -7
  48. package/lib/tron/tronPlugin.js +1 -1
  49. package/lib/tron/tronTypes.js +15 -11
  50. package/lib/xrp/xrpEngine.js +86 -59
  51. package/lib/xrp/xrpTypes.js +16 -0
  52. package/lib/zcash/zecEngine.js +33 -27
  53. package/lib/zcash/zecInfo.js +4 -1
  54. package/lib/zcash/zecPlugin.js +20 -6
  55. package/lib/zcash/zecTypes.js +57 -1
  56. package/package.json +3 -3
  57. package/android/src/main/assets/edge-currency-accountbased/206.chunk.js +0 -8
@@ -1,20 +1,17 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _fioInfo = require('./fioInfo');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); const fioApiErrorCodes = [400, 403, 404]; exports.fioApiErrorCodes = fioApiErrorCodes
2
2
 
3
- const fioApiErrorCodes = [400, 403, 404]; exports.fioApiErrorCodes = fioApiErrorCodes
4
- // @ts-expect-error
5
3
  const fioRegApiErrorCodes = {
6
- INVALID_FIO_NAME: _fioInfo.currencyInfo.defaultSettings.errorCodes.INVALID_FIO_ADDRESS,
7
- ALREADY_REGISTERED:
8
- _fioInfo.currencyInfo.defaultSettings.errorCodes.ALREADY_REGISTERED,
9
- DOMAIN_IS_NOT_REGISTERED:
10
- _fioInfo.currencyInfo.defaultSettings.errorCodes.FIO_DOMAIN_IS_NOT_EXIST,
11
- DOMAIN_IS_NOT_PUBLIC:
12
- _fioInfo.currencyInfo.defaultSettings.errorCodes.FIO_DOMAIN_IS_NOT_PUBLIC,
13
- SERVER_ERROR: _fioInfo.currencyInfo.defaultSettings.errorCodes.SERVER_ERROR,
4
+ INVALID_FIO_ADDRESS: 'INVALID_FIO_ADDRESS',
5
+ ALREADY_REGISTERED: 'ALREADY_REGISTERED',
6
+ FIO_ADDRESS_IS_NOT_EXIST: 'FIO_ADDRESS_IS_NOT_EXIST',
7
+ FIO_DOMAIN_IS_NOT_EXIST: 'FIO_DOMAIN_IS_NOT_EXIST',
8
+ FIO_DOMAIN_IS_NOT_PUBLIC: 'FIO_DOMAIN_IS_NOT_PUBLIC',
9
+ IS_DOMAIN_PUBLIC_ERROR: 'IS_DOMAIN_PUBLIC_ERROR',
10
+ FIO_ADDRESS_IS_NOT_LINKED: 'FIO_ADDRESS_IS_NOT_LINKED',
11
+ SERVER_ERROR: 'SERVER_ERROR',
14
12
  ALREADY_SENT_REGISTRATION_REQ_FOR_DOMAIN:
15
- _fioInfo.currencyInfo.defaultSettings.errorCodes
16
- .ALREADY_SENT_REGISTRATION_REQ_FOR_DOMAIN
17
- }; exports.fioRegApiErrorCodes = fioRegApiErrorCodes
13
+ 'ALREADY_SENT_REGISTRATION_REQ_FOR_DOMAIN'
14
+ } ; exports.fioRegApiErrorCodes = fioRegApiErrorCodes
18
15
 
19
16
  class FioError extends Error {
20
17
  // @ts-expect-error
@@ -28,17 +25,13 @@
28
25
  constructor(message, code, labelCode, json) {
29
26
  super(message)
30
27
 
31
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
32
- if (Error.captureStackTrace) {
28
+ if (Error.captureStackTrace != null) {
33
29
  Error.captureStackTrace(this, FioError)
34
30
  }
35
31
 
36
32
  this.name = 'FioError'
37
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
38
- if (code) this.errorCode = code
39
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
40
- if (labelCode) this.labelCode = labelCode
41
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
42
- if (json) this.json = json
33
+ if (code != null) this.errorCode = code
34
+ if (labelCode != null) this.labelCode = labelCode
35
+ if (json != null) this.json = json
43
36
  }
44
37
  } exports.FioError = FioError;
@@ -1,16 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
  var _innerPlugin = require('../common/innerPlugin');
4
- var _fioConst = require('./fioConst');
5
-
4
+ var _fioError = require('./fioError');
6
5
 
7
6
  var _fioTypes = require('./fioTypes');
8
7
 
9
8
  const networkInfo = {
10
- fio: true
11
- }
12
-
13
- const defaultSettings = {
14
9
  apiUrls: [
15
10
  'https://fio.eu.eosamsterdam.net/v1/',
16
11
  'https://fio.eosdac.io/v1/',
@@ -26,12 +21,16 @@ const defaultSettings = {
26
21
  'https://fio.eostribe.io/v1/',
27
22
  'https://api.fio.greeneosio.com/v1/',
28
23
  'https://api.fio.services/v1/',
29
- 'https://fio.eosusa.news/v1/'
24
+ 'https://fio.eosusa.news/v1/',
25
+ 'https://api-fio.nodeone.network:8344/v1/',
26
+ 'https://api.fio.detroitledger.tech/v1/',
27
+ 'https://fio-api.eosiomadrid.io/v1/',
28
+ 'https://fio.eosphere.io/v1/',
29
+ 'https://fioapi.ledgerwise.io/v1/'
30
30
  ],
31
31
  historyNodeUrls: [
32
- 'https://fio.greymass.com/v1/',
33
- 'https://fio.greymass.com/v1/',
34
- 'https://fio.eosphere.io/v1/'
32
+ 'https://fio.eosphere.io/v1/',
33
+ 'https://fio.greymass.com/v1/'
35
34
  ],
36
35
  fioRegApiUrl: 'https://reg.fioprotocol.io/public-api/',
37
36
  fioDomainRegUrl: 'https://reg.fioprotocol.io/domain/',
@@ -40,22 +39,13 @@ const defaultSettings = {
40
39
  defaultRef: 'edge',
41
40
  fallbackRef: 'edge',
42
41
  freeAddressRef: 'edgefree',
43
- errorCodes: {
44
- INVALID_FIO_ADDRESS: 'INVALID_FIO_ADDRESS',
45
- ALREADY_REGISTERED: 'ALREADY_REGISTERED',
46
- FIO_ADDRESS_IS_NOT_EXIST: 'FIO_ADDRESS_IS_NOT_EXIST',
47
- FIO_DOMAIN_IS_NOT_EXIST: 'FIO_DOMAIN_IS_NOT_EXIST',
48
- FIO_DOMAIN_IS_NOT_PUBLIC: 'FIO_DOMAIN_IS_NOT_PUBLIC',
49
- IS_DOMAIN_PUBLIC_ERROR: 'IS_DOMAIN_PUBLIC_ERROR',
50
- FIO_ADDRESS_IS_NOT_LINKED: 'FIO_ADDRESS_IS_NOT_LINKED',
51
- SERVER_ERROR: 'SERVER_ERROR'
52
- },
53
- fioRequestsTypes: _fioConst.FIO_REQUESTS_TYPES,
42
+ errorCodes: _fioError.fioRegApiErrorCodes,
54
43
  balanceCurrencyCodes: {
55
44
  // TODO: Remove these currencyCodes in favor of adding a dedicated locked balances field to the API
56
45
  staked: 'FIO:STAKED',
57
46
  locked: 'FIO:LOCKED'
58
- }
47
+ },
48
+ chainId: '21dcae42c0182200e93f954a074011f9048a7624c6fe81d3c9541a614a88bd1c'
59
49
  }
60
50
 
61
51
  const currencyInfo = {
@@ -65,7 +55,7 @@ const defaultSettings = {
65
55
  pluginId: 'fio',
66
56
  walletType: 'wallet:fio',
67
57
 
68
- defaultSettings,
58
+ defaultSettings: { ...networkInfo },
69
59
 
70
60
  addressExplorer: 'https://fio.bloks.io/key/%s',
71
61
  transactionExplorer: 'https://fio.bloks.io/transaction/%s',
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createNamedExportFrom(obj, localName, importedName) { Object.defineProperty(exports, localName, {enumerable: true, get: () => obj[importedName]}); }var _fiosdk = require('@fioprotocol/fiosdk');
2
- var _Transactions = require('@fioprotocol/fiosdk/lib/transactions/Transactions');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createNamedExportFrom(obj, localName, importedName) { Object.defineProperty(exports, localName, {enumerable: true, get: () => obj[importedName]}); } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _fiosdk = require('@fioprotocol/fiosdk');
2
+
3
3
  var _eosio = require('@greymass/eosio');
4
4
  var _biggystring = require('biggystring');
5
5
  var _bip39 = require('bip39');
@@ -22,7 +22,6 @@ var _uriHelpers = require('../common/uriHelpers');
22
22
 
23
23
 
24
24
 
25
-
26
25
  var _utils = require('../common/utils');
27
26
  var _fioConst = require('./fioConst');
28
27
  var _fioError = require('./fioError');
@@ -66,16 +65,13 @@ const FIO_REG_SITE_API_KEY = ''
66
65
 
67
66
  this.fetchCors = _utils.getFetchCors.call(void 0, env)
68
67
  this.fioRegApiToken = fioRegApiToken
68
+ this.tpid = tpid
69
69
 
70
- const [baseUrl] = _utils.pickRandom.call(void 0, currencyInfo.defaultSettings.apiUrls, 1)
71
- this.connection = new (0, _fiosdk.FIOSDK)(
72
- '',
73
- '',
74
- baseUrl,
75
- this.fetchCors,
76
- undefined,
77
- tpid
78
- )
70
+ // The sdk constructor will fetch and store abi definitions for future instances
71
+ for (const baseUrl of this.networkInfo.apiUrls) {
72
+ // eslint-disable-next-line
73
+ new (0, _fiosdk.FIOSDK)('', '', baseUrl, this.fetchCors, undefined, tpid)
74
+ }
79
75
  }
80
76
 
81
77
  async importPrivateKey(userInput) {
@@ -112,11 +108,15 @@ const FIO_REG_SITE_API_KEY = ''
112
108
  return keys
113
109
  }
114
110
 
115
- async createPrivateKey(walletType) {
111
+ async createPrivateKey(
112
+ walletType
113
+ ) {
116
114
  const type = walletType.replace('wallet:', '')
117
115
  if (type === FIO_TYPE) {
118
116
  const buffer = Buffer.from(this.io.random(32))
119
- return _fiosdk.FIOSDK.createPrivateKey(buffer)
117
+ const out =
118
+ await _fiosdk.FIOSDK.createPrivateKey(buffer)
119
+ return out
120
120
  } else {
121
121
  throw new Error('InvalidWalletType')
122
122
  }
@@ -140,8 +140,7 @@ const FIO_REG_SITE_API_KEY = ''
140
140
  },
141
141
  FIO_CURRENCY_CODE
142
142
  )
143
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions, @typescript-eslint/prefer-nullish-coalescing
144
- const valid = checkAddress(edgeParsedUri.publicAddress || '')
143
+ const valid = checkAddress(_nullishCoalesce(edgeParsedUri.publicAddress, () => ( '')))
145
144
  if (!valid) {
146
145
  throw new Error('InvalidPublicAddressError')
147
146
  }
@@ -183,32 +182,30 @@ const FIO_REG_SITE_API_KEY = ''
183
182
  throw new (0, _fioError.FioError)(
184
183
  '',
185
184
  400,
186
- _fioInfo.currencyInfo.defaultSettings.errorCodes.INVALID_FIO_ADDRESS
185
+ this.networkInfo.errorCodes.INVALID_FIO_ADDRESS
187
186
  )
188
187
  }
189
188
  try {
190
- const isAvailableRes = await this.multicastServers('isAvailable', {
191
- fioName: fioAddress
192
- })
193
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
194
- if (!isAvailableRes.is_registered) {
189
+ const isAvailableRes = await this.multicastServers(
190
+ 'isAvailable',
191
+ {
192
+ fioName: fioAddress
193
+ }
194
+ )
195
+ if (isAvailableRes.is_registered === 0) {
195
196
  throw new (0, _fioError.FioError)(
196
197
  '',
197
198
  404,
198
- _fioInfo.currencyInfo.defaultSettings.errorCodes.FIO_ADDRESS_IS_NOT_EXIST
199
+ this.networkInfo.errorCodes.FIO_ADDRESS_IS_NOT_EXIST
199
200
  )
200
201
  }
201
202
  } catch (e) {
202
203
  if (
203
204
  e.name === 'FioError' &&
204
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
205
- e.json &&
206
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
207
- e.json.fields &&
205
+ _optionalChain([e, 'access', _ => _.json, 'optionalAccess', _2 => _2.fields]) != null &&
208
206
  e.errorCode === 400
209
207
  ) {
210
- e.labelCode =
211
- _fioInfo.currencyInfo.defaultSettings.errorCodes.INVALID_FIO_ADDRESS
208
+ e.labelCode = this.networkInfo.errorCodes.INVALID_FIO_ADDRESS
212
209
  }
213
210
 
214
211
  throw e
@@ -219,12 +216,11 @@ const FIO_REG_SITE_API_KEY = ''
219
216
  chainCode,
220
217
  tokenCode
221
218
  })
222
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
223
- if (!result.public_address || result.public_address === '0') {
219
+ if (result.public_address == null || result.public_address === '0') {
224
220
  throw new (0, _fioError.FioError)(
225
221
  '',
226
222
  404,
227
- _fioInfo.currencyInfo.defaultSettings.errorCodes.FIO_ADDRESS_IS_NOT_LINKED
223
+ this.networkInfo.errorCodes.FIO_ADDRESS_IS_NOT_LINKED
228
224
  )
229
225
  }
230
226
  return result
@@ -232,14 +228,13 @@ const FIO_REG_SITE_API_KEY = ''
232
228
  if (
233
229
  (e.name === 'FioError' &&
234
230
  e.labelCode ===
235
- _fioInfo.currencyInfo.defaultSettings.errorCodes
236
- .FIO_ADDRESS_IS_NOT_LINKED) ||
231
+ this.networkInfo.errorCodes.FIO_ADDRESS_IS_NOT_LINKED) ||
237
232
  e.errorCode === 404
238
233
  ) {
239
234
  throw new (0, _fioError.FioError)(
240
235
  '',
241
236
  404,
242
- _fioInfo.currencyInfo.defaultSettings.errorCodes.FIO_ADDRESS_IS_NOT_LINKED
237
+ this.networkInfo.errorCodes.FIO_ADDRESS_IS_NOT_LINKED
243
238
  )
244
239
  }
245
240
  throw e
@@ -260,37 +255,33 @@ const FIO_REG_SITE_API_KEY = ''
260
255
  ) {
261
256
  try {
262
257
  if (isDomain) {
263
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
264
258
  if (!_fiosdk.FIOSDK.isFioDomainValid(fioName)) return false
265
259
  } else {
266
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
267
260
  if (!_fiosdk.FIOSDK.isFioAddressValid(fioName)) return false
268
261
  }
269
262
  } catch (e) {
270
263
  throw new (0, _fioError.FioError)(
271
264
  '',
272
265
  400,
273
- _fioInfo.currencyInfo.defaultSettings.errorCodes.INVALID_FIO_ADDRESS
266
+ this.networkInfo.errorCodes.INVALID_FIO_ADDRESS
274
267
  )
275
268
  }
276
269
  try {
277
- const isAvailableRes = await this.multicastServers('isAvailable', {
278
- fioName
279
- })
270
+ const isAvailableRes = await this.multicastServers(
271
+ 'isAvailable',
272
+ {
273
+ fioName
274
+ }
275
+ )
280
276
 
281
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
282
- return !isAvailableRes.is_registered
277
+ return isAvailableRes.is_registered === 0
283
278
  } catch (e) {
284
279
  if (
285
280
  e.name === 'FioError' &&
286
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
287
- e.json &&
288
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
289
- e.json.fields &&
281
+ _optionalChain([e, 'access', _3 => _3.json, 'optionalAccess', _4 => _4.fields]) != null &&
290
282
  e.errorCode === 400
291
283
  ) {
292
- e.labelCode =
293
- _fioInfo.currencyInfo.defaultSettings.errorCodes.INVALID_FIO_ADDRESS
284
+ e.labelCode = this.networkInfo.errorCodes.INVALID_FIO_ADDRESS
294
285
  }
295
286
 
296
287
  throw e
@@ -298,18 +289,20 @@ const FIO_REG_SITE_API_KEY = ''
298
289
  }
299
290
 
300
291
  async isDomainPublic(domain) {
301
- const isAvailableRes = await this.multicastServers('isAvailable', {
302
- fioName: domain
303
- })
304
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
305
- if (!isAvailableRes.is_registered)
292
+ const isAvailableRes = await this.multicastServers(
293
+ 'isAvailable',
294
+ {
295
+ fioName: domain
296
+ }
297
+ )
298
+ if (isAvailableRes.is_registered === 0)
306
299
  throw new (0, _fioError.FioError)(
307
300
  '',
308
301
  400,
309
- _fioInfo.currencyInfo.defaultSettings.errorCodes.FIO_DOMAIN_IS_NOT_EXIST
302
+ this.networkInfo.errorCodes.FIO_DOMAIN_IS_NOT_EXIST
310
303
  )
311
304
  const result = await this.fetchCors(
312
- `${_fioInfo.currencyInfo.defaultSettings.fioRegApiUrl}${_fioConst.FIO_REG_API_ENDPOINTS.isDomainPublic}/${domain}`,
305
+ `${this.networkInfo.fioRegApiUrl}${_fioConst.FIO_REG_API_ENDPOINTS.isDomainPublic}/${domain}`,
313
306
  {
314
307
  method: 'GET'
315
308
  }
@@ -319,7 +312,7 @@ const FIO_REG_SITE_API_KEY = ''
319
312
  throw new (0, _fioError.FioError)(
320
313
  '',
321
314
  result.status,
322
- _fioInfo.currencyInfo.defaultSettings.errorCodes.IS_DOMAIN_PUBLIC_ERROR,
315
+ this.networkInfo.errorCodes.IS_DOMAIN_PUBLIC_ERROR,
323
316
  data
324
317
  )
325
318
  }
@@ -329,17 +322,19 @@ const FIO_REG_SITE_API_KEY = ''
329
322
 
330
323
  async doesAccountExist(fioName) {
331
324
  try {
332
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
333
325
  if (!_fiosdk.FIOSDK.isFioAddressValid(fioName)) return false
334
326
  } catch (e) {
335
327
  return false
336
328
  }
337
329
  try {
338
- const isAvailableRes = await this.multicastServers('isAvailable', {
339
- fioName
340
- })
330
+ const isAvailableRes = await this.multicastServers(
331
+ 'isAvailable',
332
+ {
333
+ fioName
334
+ }
335
+ )
341
336
 
342
- return isAvailableRes.is_registered
337
+ return isAvailableRes.is_registered === 1
343
338
  } catch (e) {
344
339
  // @ts-expect-error
345
340
  this.error('doesAccountExist error: ', e)
@@ -365,7 +360,7 @@ const FIO_REG_SITE_API_KEY = ''
365
360
  }
366
361
  try {
367
362
  const result = await this.fetchCors(
368
- `${_fioInfo.currencyInfo.defaultSettings.fioRegApiUrl}${_fioConst.FIO_REG_API_ENDPOINTS.buyAddress}`,
363
+ `${this.networkInfo.fioRegApiUrl}${_fioConst.FIO_REG_API_ENDPOINTS.buyAddress}`,
369
364
  {
370
365
  method: 'POST',
371
366
  headers,
@@ -374,15 +369,13 @@ const FIO_REG_SITE_API_KEY = ''
374
369
  )
375
370
  if (!result.ok) {
376
371
  const data = await result.json()
377
-
378
372
  // @ts-expect-error
379
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
380
- if (_fioError.fioRegApiErrorCodes[data.errorCode]) {
373
+ if (this.networkInfo.errorCodes[data.errorCode] != null) {
381
374
  throw new (0, _fioError.FioError)(
382
375
  data.error,
383
376
  result.status,
384
377
  // @ts-expect-error
385
- _fioError.fioRegApiErrorCodes[data.errorCode],
378
+ this.networkInfo.errorCodes[data.errorCode],
386
379
  data
387
380
  )
388
381
  }
@@ -391,8 +384,7 @@ const FIO_REG_SITE_API_KEY = ''
391
384
  throw new (0, _fioError.FioError)(
392
385
  data.error,
393
386
  result.status,
394
- // @ts-expect-error
395
- _fioError.fioRegApiErrorCodes.ALREADY_REGISTERED,
387
+ this.networkInfo.errorCodes.ALREADY_REGISTERED,
396
388
  data
397
389
  )
398
390
  }
@@ -401,22 +393,20 @@ const FIO_REG_SITE_API_KEY = ''
401
393
  }
402
394
  return await result.json()
403
395
  } catch (e) {
404
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
405
- if (e.labelCode) throw e
396
+ if (e.labelCode != null) throw e
406
397
  throw new (0, _fioError.FioError)(
407
398
  _utils.safeErrorMessage.call(void 0, e),
408
399
  500,
409
- _fioInfo.currencyInfo.defaultSettings.errorCodes.SERVER_ERROR
400
+ this.networkInfo.errorCodes.SERVER_ERROR
410
401
  )
411
402
  }
412
403
  }
413
404
 
414
405
  async getDomains(ref = '') {
415
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
416
- if (!ref) ref = _fioInfo.currencyInfo.defaultSettings.defaultRef
406
+ if (ref == null) ref = this.networkInfo.defaultRef
417
407
  try {
418
408
  const result = await this.fetchCors(
419
- `${_fioInfo.currencyInfo.defaultSettings.fioRegApiUrl}${_fioConst.FIO_REG_API_ENDPOINTS.getDomains}/${ref}`,
409
+ `${this.networkInfo.fioRegApiUrl}${_fioConst.FIO_REG_API_ENDPOINTS.getDomains}/${ref}`,
420
410
  {
421
411
  method: 'GET'
422
412
  }
@@ -424,13 +414,12 @@ const FIO_REG_SITE_API_KEY = ''
424
414
  const json = await result.json()
425
415
  if (!result.ok) {
426
416
  // @ts-expect-error
427
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
428
- if (_fioError.fioRegApiErrorCodes[json.errorCode]) {
417
+ if (this.networkInfo.errorCodes[json.errorCode] != null) {
429
418
  throw new (0, _fioError.FioError)(
430
419
  json.error,
431
420
  result.status,
432
421
  // @ts-expect-error
433
- _fioError.fioRegApiErrorCodes[json.errorCode],
422
+ this.networkInfo.errorCodes[json.errorCode],
434
423
  json
435
424
  )
436
425
  }
@@ -439,12 +428,11 @@ const FIO_REG_SITE_API_KEY = ''
439
428
  }
440
429
  return json.domains
441
430
  } catch (e) {
442
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
443
- if (e.labelCode) throw e
431
+ if (e.labelCode != null) throw e
444
432
  throw new (0, _fioError.FioError)(
445
433
  _utils.safeErrorMessage.call(void 0, e),
446
434
  500,
447
- _fioInfo.currencyInfo.defaultSettings.errorCodes.SERVER_ERROR
435
+ this.networkInfo.errorCodes.SERVER_ERROR
448
436
  )
449
437
  }
450
438
  }
@@ -452,7 +440,7 @@ const FIO_REG_SITE_API_KEY = ''
452
440
  async getStakeEstReturn() {
453
441
  try {
454
442
  const result = await this.fetchCors(
455
- `${_fioInfo.currencyInfo.defaultSettings.fioStakingApyUrl}`,
443
+ `${this.networkInfo.fioStakingApyUrl}`,
456
444
  {
457
445
  method: 'GET'
458
446
  }
@@ -472,19 +460,18 @@ const FIO_REG_SITE_API_KEY = ''
472
460
 
473
461
  = await result.json()
474
462
  if (!result.ok) {
475
- throw new Error(_fioInfo.currencyInfo.defaultSettings.errorCodes.SERVER_ERROR)
463
+ throw new Error(this.networkInfo.errorCodes.SERVER_ERROR)
476
464
  }
477
465
  const apr = json.historical_apr['7day']
478
466
  return (apr != null && apr > _fioConst.DEFAULT_APR) || apr == null
479
467
  ? _fioConst.DEFAULT_APR
480
468
  : apr
481
469
  } catch (e) {
482
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
483
- if (e.labelCode) throw e
470
+ if (e.labelCode != null) throw e
484
471
  throw new (0, _fioError.FioError)(
485
472
  e.message,
486
473
  500,
487
- _fioInfo.currencyInfo.defaultSettings.errorCodes.SERVER_ERROR
474
+ this.networkInfo.errorCodes.SERVER_ERROR
488
475
  )
489
476
  }
490
477
  }
@@ -499,18 +486,23 @@ const FIO_REG_SITE_API_KEY = ''
499
486
  ) {
500
487
  const res = await _utils.asyncWaterfall.call(void 0,
501
488
  _utils.shuffleArray.call(void 0,
502
- // @ts-expect-error
503
- _fioInfo.currencyInfo.defaultSettings.apiUrls.map(apiUrl => async () => {
489
+ this.networkInfo.apiUrls.map(apiUrl => async () => {
504
490
  let out
505
491
 
506
- _Transactions.Transactions.baseUrl = apiUrl
492
+ const connection = new (0, _fiosdk.FIOSDK)(
493
+ '',
494
+ '',
495
+ apiUrl,
496
+ this.fetchCors,
497
+ undefined,
498
+ this.tpid
499
+ )
507
500
 
508
501
  try {
509
- out = await this.connection.genericAction(actionName, params)
502
+ out = await connection.genericAction(actionName, params)
510
503
  } catch (e) {
511
504
  // handle FIO API error
512
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
513
- if (e.errorCode && _fioError.fioApiErrorCodes.includes(e.errorCode)) {
505
+ if (e.errorCode != null && _fioError.fioApiErrorCodes.includes(e.errorCode)) {
514
506
  out = {
515
507
  isError: true,
516
508
  data: {
@@ -530,8 +522,7 @@ const FIO_REG_SITE_API_KEY = ''
530
522
  )
531
523
  )
532
524
 
533
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
534
- if (res.isError) {
525
+ if (res.isError != null) {
535
526
  const error = new (0, _fioError.FioError)(res.errorMessage)
536
527
  error.json = res.data.json
537
528
  error.list = res.data.list