@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.
- package/dist/BSEthereum.js +8 -8
- package/package.json +1 -1
package/dist/BSEthereum.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|