diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/cip30/cip30.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/cip30/cip30.ts index 19732455eb..133edaa5fe 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/cip30/cip30.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/cip30/cip30.ts @@ -203,10 +203,10 @@ class CIP30Extension { const tx = await csl.Transaction.fromHex(cbor) const txBody = await tx.body() const signedTx = await csl.Transaction.new(txBody, witnesses, undefined) + const signedTxBytes = await signedTx.toBytes() - const txId = await (await hashTransaction(csl, signedTx)).toHex() + const txId = await (await hashTransaction(csl, signedTxBytes)).toHex() - const signedTxBytes = await signedTx.toBytes() await this.wallet.submitTransaction(Buffer.from(signedTxBytes).toString('base64')) return getTransactionUnspentOutput({ txId, diff --git a/packages/common/src/numbers/to-bigint.ts b/packages/common/src/numbers/to-bigint.ts index a1564a8424..7a631f51cc 100644 --- a/packages/common/src/numbers/to-bigint.ts +++ b/packages/common/src/numbers/to-bigint.ts @@ -26,7 +26,7 @@ export function toBigInt( typeof quantity === 'string' ? quantity.replace(/(?!^-)[^\d.-]/g, '') : quantity - const bigNumber = BigNumber(sanitized || 0) + const bigNumber = new BigNumber(sanitized || 0) const scaledNumber = bigNumber.shiftedBy(decimalPlaces) diff --git a/packages/dapp-connector/src/resolver.ts b/packages/dapp-connector/src/resolver.ts index 75ceed8a95..eb308a7b12 100644 --- a/packages/dapp-connector/src/resolver.ts +++ b/packages/dapp-connector/src/resolver.ts @@ -119,8 +119,8 @@ export const resolver: Resolver = { if (result === null || result.length === 0) { const balance = await context.wallet.getBalance('*') - const coin = BigNumber(await (await balance.coin()).toStr()) - if (coin.isGreaterThan(BigNumber(value))) { + const coin = new BigNumber(await (await balance.coin()).toStr()) + if (coin.isGreaterThan(new BigNumber(value))) { try { const utxo = await context.wallet.sendReorganisationTx(value) return [await utxo.toHex()]