diff --git a/src/filecoin/FilecoinEngine.ts b/src/filecoin/FilecoinEngine.ts index 6d228335e..636ddccc9 100644 --- a/src/filecoin/FilecoinEngine.ts +++ b/src/filecoin/FilecoinEngine.ts @@ -189,15 +189,15 @@ export class FilecoinEngine extends CurrencyEngine< } const networkFee = mul(txJson.GasLimit.toString(), txJson.GasPremium) // TODO: Include base fee and burn fee somehow? - const totalTxAmount = add(nativeAmount, networkFee) + const txNativeAmount = mul(add(nativeAmount, networkFee), '-1') const edgeTransaction: EdgeTransaction = { txid: '', date: 0, currencyCode, blockHeight: 0, - nativeAmount: `-${totalTxAmount}`, - isSend: nativeAmount.startsWith('-'), + nativeAmount: txNativeAmount, + isSend: true, networkFee, ourReceiveAddresses: [], otherParams, @@ -230,6 +230,8 @@ export class FilecoinEngine extends CurrencyEngine< sigJson: signature.toJSON() } + edgeTransaction.date = Date.now() / 1000 + return edgeTransaction } diff --git a/src/zcash/ZcashEngine.ts b/src/zcash/ZcashEngine.ts index 6c36f6986..ecbae2469 100644 --- a/src/zcash/ZcashEngine.ts +++ b/src/zcash/ZcashEngine.ts @@ -1,4 +1,4 @@ -import { abs, add, eq, gt, lte, sub } from 'biggystring' +import { abs, add, eq, gt, lte, mul, sub } from 'biggystring' import { EdgeCurrencyEngine, EdgeCurrencyEngineOptions, @@ -338,16 +338,18 @@ export class ZcashEngine extends CurrencyEngine< publicAddress })) + const txNativeAmount = mul(totalTxAmount, '-1') + const edgeTransaction: EdgeTransaction = { - txid: '', // txid - date: 0, // date - currencyCode, // currencyCode - blockHeight: 0, // blockHeight - nativeAmount: `-${totalTxAmount}`, // nativeAmount - isSend: nativeAmount.startsWith('-'), - networkFee: this.networkInfo.defaultNetworkFee, // networkFee - ourReceiveAddresses: [], // ourReceiveAddresses - signedTx: '', // signedTx + txid: '', + date: 0, + currencyCode, + blockHeight: 0, + nativeAmount: txNativeAmount, + isSend: true, + networkFee: this.networkInfo.defaultNetworkFee, + ourReceiveAddresses: [], + signedTx: '', spendTargets, walletId: this.walletId }