crosslightning-evm
Advanced tools
Comparing version 3.3.0 to 3.3.1
@@ -776,5 +776,16 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const tokenContract = new ethers_1.Contract(token, erc20Abi_1.erc20Abi, this.signer); | ||
const transferTx = yield tokenContract.populateTransaction.transfer(dstAddress, ethers_1.BigNumber.from(amount.toString(10))); | ||
transferTx.gasLimit = ethers_1.BigNumber.from(80000); | ||
let transferTx; | ||
if (ZERO_ADDRESS === token) { | ||
transferTx = { | ||
from: this.getAddress(), | ||
to: dstAddress, | ||
value: ethers_1.BigNumber.from(amount.toString(10)), | ||
gasLimit: ethers_1.BigNumber.from(21000) | ||
}; | ||
} | ||
else { | ||
const tokenContract = new ethers_1.Contract(token, erc20Abi_1.erc20Abi, this.signer); | ||
transferTx = yield tokenContract.populateTransaction.transfer(dstAddress, ethers_1.BigNumber.from(amount.toString(10))); | ||
transferTx.gasLimit = ethers_1.BigNumber.from(80000); | ||
} | ||
const [txId] = yield this.sendAndConfirm([transferTx], waitForConfirmation, abortSignal, false); | ||
@@ -781,0 +792,0 @@ return txId; |
{ | ||
"name": "crosslightning-evm", | ||
"version": "3.3.0", | ||
"version": "3.3.1", | ||
"description": "EVM specific base implementation", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -965,7 +965,16 @@ import * as BN from "bn.js"; | ||
async transfer(token: TokenAddress, amount: BN, dstAddress: string, waitForConfirmation?: boolean, abortSignal?: AbortSignal): Promise<string> { | ||
const tokenContract: Contract = new Contract(token, erc20Abi, this.signer); | ||
let transferTx; | ||
if(ZERO_ADDRESS===token) { | ||
transferTx = { | ||
from: this.getAddress(), | ||
to: dstAddress, | ||
value: BigNumber.from(amount.toString(10)), | ||
gasLimit: BigNumber.from(21000) | ||
}; | ||
} else { | ||
const tokenContract: Contract = new Contract(token, erc20Abi, this.signer); | ||
transferTx = await tokenContract.populateTransaction.transfer(dstAddress, BigNumber.from(amount.toString(10))); | ||
transferTx.gasLimit = BigNumber.from(80000); | ||
} | ||
const transferTx = await tokenContract.populateTransaction.transfer(dstAddress, BigNumber.from(amount.toString(10))); | ||
transferTx.gasLimit = BigNumber.from(80000); | ||
const [txId] = await this.sendAndConfirm([transferTx], waitForConfirmation, abortSignal, false); | ||
@@ -972,0 +981,0 @@ return txId; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
345812
8177