@cityofzion/bs-ethereum 2.2.5 → 2.2.6

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.
@@ -157,21 +157,21 @@ class BSEthereum {
157
157
  }
158
158
  const decimals = (_a = param.intent.tokenDecimals) !== null && _a !== void 0 ? _a : 18;
159
159
  const amount = ethersBigNumber.parseFixed(param.intent.amount, decimals);
160
- let transactionParams;
160
+ const gasPrice = yield provider.getGasPrice();
161
+ let transactionParams = {
162
+ gasPrice,
163
+ };
161
164
  const isNative = BSEthereumHelper_1.BSEthereumHelper.normalizeHash(this.feeToken.hash) === BSEthereumHelper_1.BSEthereumHelper.normalizeHash(param.intent.tokenHash);
162
165
  if (isNative) {
163
- const gasPrice = yield provider.getGasPrice();
164
- transactionParams = {
165
- to: param.intent.receiverAddress,
166
- value: amount,
167
- gasPrice,
168
- };
166
+ transactionParams.to = param.intent.receiverAddress;
167
+ transactionParams.value = amount;
169
168
  }
170
169
  else {
171
170
  const contract = new ethers_1.ethers.Contract(param.intent.tokenHash, [
172
171
  'function transfer(address to, uint amount) returns (bool)',
173
172
  ]);
174
- transactionParams = yield contract.populateTransaction.transfer(param.intent.receiverAddress, amount);
173
+ const populatedTransaction = yield contract.populateTransaction.transfer(param.intent.receiverAddress, amount);
174
+ transactionParams = Object.assign(Object.assign({}, populatedTransaction), transactionParams);
175
175
  }
176
176
  const transaction = yield signer.sendTransaction(transactionParams);
177
177
  return transaction.hash;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-ethereum",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",