@cityofzion/bs-ethereum 2.8.2 → 2.8.4

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.
@@ -104,10 +104,10 @@ class BSEthereum {
104
104
  }
105
105
  generateAccountFromMnemonic(mnemonic, index) {
106
106
  const bip44Path = this.bip44DerivationPath.replace('?', index.toString());
107
- const wallet = ethers_1.ethers.Wallet.fromMnemonic(Array.isArray(mnemonic) ? mnemonic.join(' ') : mnemonic, bip44Path);
107
+ const hd = ethers_1.ethers.utils.HDNode.fromMnemonic(Array.isArray(mnemonic) ? mnemonic.join(' ') : mnemonic).derivePath(bip44Path);
108
108
  return {
109
- address: wallet.address,
110
- key: wallet.privateKey,
109
+ address: hd.address,
110
+ key: hd.privateKey,
111
111
  type: 'privateKey',
112
112
  bip44Path,
113
113
  blockchain: this.name,
@@ -152,6 +152,7 @@ class BSEthereum {
152
152
  return __awaiter(this, void 0, void 0, function* () {
153
153
  const signer = yield __classPrivateFieldGet(this, _BSEthereum_instances, "m", _BSEthereum_generateSigner).call(this, param.senderAccount);
154
154
  const sentTransactionHashes = [];
155
+ let error;
155
156
  for (const intent of param.intents) {
156
157
  let transactionHash = '';
157
158
  try {
@@ -166,11 +167,14 @@ class BSEthereum {
166
167
  const transaction = yield signer.sendTransaction(Object.assign(Object.assign({}, transactionParams), { gasLimit, maxPriorityFeePerGas: gasPrice, maxFeePerGas: gasPrice }));
167
168
  transactionHash = transaction.hash;
168
169
  }
169
- catch (_b) {
170
- /* empty */
170
+ catch (err) {
171
+ error = err;
171
172
  }
172
173
  sentTransactionHashes.push(transactionHash);
173
174
  }
175
+ if (error && sentTransactionHashes.every(hash => !hash)) {
176
+ throw error;
177
+ }
174
178
  return sentTransactionHashes;
175
179
  });
176
180
  }
@@ -100,5 +100,9 @@ _GhostMarketNDSEthereum_network = new WeakMap();
100
100
  GhostMarketNDSEthereum.BASE_URL = 'https://api.ghostmarket.io/api/v2';
101
101
  GhostMarketNDSEthereum.CONFIG_BY_NETWORK_ID = {
102
102
  '1': 'eth',
103
+ '56': 'bsc',
104
+ '137': 'polygon',
105
+ '43114': 'avalanche',
106
+ '8453': 'base',
103
107
  [BSEthereumConstants_1.BSEthereumConstants.NEOX_MAINNET_NETWORK_ID]: 'neox',
104
108
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-ethereum",
3
- "version": "2.8.2",
3
+ "version": "2.8.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",