diff --git a/package-lock.json b/package-lock.json index 2ae83297..09cdd57f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,7 +57,7 @@ "web3-eth-contract": "^1.10.0" }, "devDependencies": { - "@ledgerhq/hw-transport-mocker": "^6.28.1", + "@ledgerhq/hw-transport-mocker": "^6.28.5", "@mdi/font": "^7.2.96", "@types/big.js": "^6.2.0", "@types/chai": "^4.2.11", @@ -3395,9 +3395,9 @@ } }, "node_modules/@ledgerhq/errors": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.16.1.tgz", - "integrity": "sha512-4D4wKecGzQpIu7sx03Sg4uE1e8g1oZUndWgw9gw776H8h9ov9c5TxPaldTn2j6orPECAERViLf7LTO4L5pE2Cw==" + "version": "6.16.3", + "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.16.3.tgz", + "integrity": "sha512-3w7/SJVXOPa9mpzyll7VKoKnGwDD3BzWgN1Nom8byR40DiQvOKjHX+kKQausCedTHVNBn9euzPCNsftZ9+mxfw==" }, "node_modules/@ledgerhq/evm-tools": { "version": "1.0.10", @@ -3537,33 +3537,33 @@ } }, "node_modules/@ledgerhq/hw-transport-mocker": { - "version": "6.28.1", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.28.1.tgz", - "integrity": "sha512-o2psew3qYp1O7Bh3qCdktGxm5HqVl3RHFl1zzxUOSr4i3nxvLhGvm0Ku/5tFLRjaxVwmSo6f7pBN9o+rOpcrNg==", + "version": "6.28.5", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.28.5.tgz", + "integrity": "sha512-NrOoonR5pIQgzCC9HhKaomUtMCDoz42wWP4bjB2v8vh9KKYXQG9T4R5A+I+KGUqYVSCgyI1YW0RM7V2ZhuWdCA==", "dependencies": { - "@ledgerhq/hw-transport": "^6.30.1", + "@ledgerhq/hw-transport": "^6.30.5", "@ledgerhq/logs": "^6.12.0", "rxjs": "^7.8.1" } }, "node_modules/@ledgerhq/hw-transport-mocker/node_modules/@ledgerhq/devices": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.2.0.tgz", - "integrity": "sha512-XROTW2gTmmuy+YPPDjdtKKTQ3mfxrPtKtV+a9QFbj8f5MnjVMV0Zpy1BIB4CyIMsVVi4z6+nI67auT7IlsM3SQ==", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.2.2.tgz", + "integrity": "sha512-SKahGA4p0mZ3ovypOJ2wa5mUvUkArE3HBrwWKYf+cRs+t/Licp3OJfhj+DHIxP3AfyH2xR6CFFWECYHeKwGsDQ==", "dependencies": { - "@ledgerhq/errors": "^6.16.1", + "@ledgerhq/errors": "^6.16.3", "@ledgerhq/logs": "^6.12.0", "rxjs": "^7.8.1", "semver": "^7.3.5" } }, "node_modules/@ledgerhq/hw-transport-mocker/node_modules/@ledgerhq/hw-transport": { - "version": "6.30.1", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.1.tgz", - "integrity": "sha512-Xeeo4nt33g5Fsp3CdsPvcc2Uk7dwYeKRSlSFLWcYAAKprf/PmxgNekhke1eaNU/wLoeLOWhY2Cki8F8w9nLMdQ==", + "version": "6.30.5", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.5.tgz", + "integrity": "sha512-JMl//7BgPBvWxrWyMu82jj6JEYtsQyOyhYtonWNgtxn6KUZWht3gU4gxmLpeIRr+DiS7e50mW7m3GA+EudZmmA==", "dependencies": { - "@ledgerhq/devices": "^8.2.0", - "@ledgerhq/errors": "^6.16.1", + "@ledgerhq/devices": "^8.2.2", + "@ledgerhq/errors": "^6.16.3", "@ledgerhq/logs": "^6.12.0", "events": "^3.3.0" } @@ -3588,9 +3588,9 @@ } }, "node_modules/@ledgerhq/hw-transport-mocker/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, diff --git a/package.json b/package.json index 68770a8c..59a30232 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "web3-eth-contract": "^1.10.0" }, "devDependencies": { - "@ledgerhq/hw-transport-mocker": "^6.28.1", + "@ledgerhq/hw-transport-mocker": "^6.28.5", "@mdi/font": "^7.2.96", "@types/big.js": "^6.2.0", "@types/chai": "^4.2.11", diff --git a/src/common/services/LeatherService.ts b/src/common/services/LeatherService.ts index 4d44d0c9..92022eaf 100644 --- a/src/common/services/LeatherService.ts +++ b/src/common/services/LeatherService.ts @@ -55,6 +55,7 @@ export default class LeatherService extends WalletService { }, }, fee: true, + fullAmount: false, }, ]; } diff --git a/src/common/services/LedgerService.ts b/src/common/services/LedgerService.ts index 842e59f8..e227f601 100644 --- a/src/common/services/LedgerService.ts +++ b/src/common/services/LedgerService.ts @@ -38,7 +38,7 @@ export default class LedgerService extends WalletService { return [ { title: 'Confirm your transaction', - subtitle: 'Please check your Trezor device', + subtitle: 'Please check your Ledger device', outputsToshow: { opReturn: { value: true, @@ -54,6 +54,7 @@ export default class LedgerService extends WalletService { }, }, fee: false, + fullAmount: false, }, { title: 'Confirm funds transfer', @@ -73,6 +74,7 @@ export default class LedgerService extends WalletService { }, }, fee: false, + fullAmount: false, }, { title: 'Confirm change address', @@ -92,10 +94,11 @@ export default class LedgerService extends WalletService { }, }, fee: false, + fullAmount: false, }, { title: 'Confirm transaction fee', - subtitle: 'Really send', + subtitle: 'Confirm transaction', outputsToshow: { opReturn: { value: false, @@ -107,10 +110,11 @@ export default class LedgerService extends WalletService { }, federation: { address: false, - amount: true, + amount: false, }, }, fee: true, + fullAmount: false, }, ]; } diff --git a/src/common/services/LiqualityService.ts b/src/common/services/LiqualityService.ts index 6ba2d7b6..161da4cb 100644 --- a/src/common/services/LiqualityService.ts +++ b/src/common/services/LiqualityService.ts @@ -57,6 +57,7 @@ export default class LiqualityService extends WalletService { }, }, fee: true, + fullAmount: false, }, ]; } diff --git a/src/common/services/TrezorService.ts b/src/common/services/TrezorService.ts index b2630da4..ef636e63 100644 --- a/src/common/services/TrezorService.ts +++ b/src/common/services/TrezorService.ts @@ -85,6 +85,7 @@ export default class TrezorService extends WalletService { }, }, fee: false, + fullAmount: false, }, { title: 'Confirm funds transfer', @@ -104,6 +105,7 @@ export default class TrezorService extends WalletService { }, }, fee: false, + fullAmount: false, }, { title: 'Confirm change address', @@ -123,6 +125,7 @@ export default class TrezorService extends WalletService { }, }, fee: false, + fullAmount: false, }, { title: 'Confirm transaction fee', @@ -138,10 +141,11 @@ export default class TrezorService extends WalletService { }, federation: { address: false, - amount: true, + amount: false, }, }, fee: true, + fullAmount: true, }, ]; } diff --git a/src/common/types/Wallets.ts b/src/common/types/Wallets.ts index 46106027..f173d4bf 100644 --- a/src/common/types/Wallets.ts +++ b/src/common/types/Wallets.ts @@ -31,6 +31,7 @@ export interface Step { amount: boolean, }, }, + fullAmount: boolean; fee: boolean; comment?: string; } diff --git a/src/pegin/components/create/ConfirmTx.vue b/src/pegin/components/create/ConfirmTx.vue index e8c90849..6ec87fb1 100644 --- a/src/pegin/components/create/ConfirmTx.vue +++ b/src/pegin/components/create/ConfirmTx.vue @@ -35,7 +35,7 @@
@@ -242,6 +252,11 @@ export default defineComponent({ }); const computedFullAmount = computed((): string => pegInTxState.value.amountToTransfer + .plus(new SatoshiBig(pegInTxState.value.normalizedTx.outputs[2]?.amount ?? 0, 'satoshi')) + .plus(safeFee.value) + .toBTCTrimmedString()); + + const computedAmountToTransfer = computed((): string => pegInTxState.value.amountToTransfer .toBTCTrimmedString()); const computedPlusFeeFullAmount = computed((): string => pegInTxState.value.amountToTransfer @@ -281,7 +296,10 @@ export default defineComponent({ let txError = ''; props.confirmTxState.send('loading'); await walletService.value.stopAskingForBalance() - .then(() => props.txBuilder.buildTx(pegInTxState.value.normalizedTx)) + .then(() => props.txBuilder.buildTx( + pegInTxState.value.normalizedTx, + pegInTxState.value.selectedAccount, + )) .then((tx) => walletService.value.sign(tx)) .then(({ signedTx }) => ApiService .broadcast(signedTx)) @@ -327,6 +345,7 @@ export default defineComponent({ environmentContext, changeAmountComputed, computedFullAmount, + computedAmountToTransfer, computedPlusFeeFullAmount, toPegInForm, cropAddress,