Skip to content

Commit

Permalink
Merge branch 'x' into ext-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
huhuanming authored Oct 9, 2024
2 parents d16c573 + a96c4fa commit 121208c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/kit-bg/src/vaults/impls/ada/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const settings: IVaultSettings = {
editFeeEnabled: false,
replaceTxEnabled: false,
estimatedFeePollingInterval: 600,
maxSendCanNotSentFullAmount: true,

accountDeriveInfo,
networkInfo: {
Expand Down
2 changes: 1 addition & 1 deletion packages/kit-bg/src/vaults/impls/btc/KeyringHardware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export class KeyringHardware extends KeyringHardwareBase {
const signedPsbt = response.psbt;

let rawTx = '';
const finalizedPsbt = BitcoinJS.Psbt.fromHex(psbt.toHex(), {
const finalizedPsbt = BitcoinJS.Psbt.fromHex(signedPsbt, {
network: btcNetwork,
});
inputsToSign.forEach((v) => {
Expand Down
2 changes: 2 additions & 0 deletions packages/kit-bg/src/vaults/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ export type IVaultSettings = {
[networkId: string]: number;
};

maxSendCanNotSentFullAmount?: boolean;

preCheckDappTxFeeInfoRequired?: boolean;

activateTokenRequired?: boolean;
Expand Down
5 changes: 2 additions & 3 deletions packages/kit/src/components/TxAction/TxActionTransfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { useAccountData } from '@onekeyhq/kit/src/hooks/useAccountData';
import { useSettingsPersistAtom } from '@onekeyhq/kit-bg/src/states/jotai/atoms';
import { ETranslations } from '@onekeyhq/shared/src/locale';
import accountUtils from '@onekeyhq/shared/src/utils/accountUtils';
import networkUtils from '@onekeyhq/shared/src/utils/networkUtils';
import { EOnChainHistoryTxType } from '@onekeyhq/shared/types/history';
import {
EDecodedTxDirection,
Expand Down Expand Up @@ -569,8 +570,7 @@ function TxActionTransferDetailView(props: ITxActionProps) {
isSendNativeToken &&
!isNil(nativeTokenTransferAmountToUpdate) &&
transfer.isNative &&
block.direction === EDecodedTxDirection.OUT &&
!isUTXO
block.direction === EDecodedTxDirection.OUT
? nativeTokenTransferAmountToUpdate
: transfer.amount
} ${
Expand Down Expand Up @@ -809,7 +809,6 @@ function TxActionTransferDetailView(props: ITxActionProps) {
intl,
isInternalStaking,
isSendNativeToken,
isUTXO,
nativeTokenTransferAmountToUpdate,
network?.id,
network?.logoURI,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ function TxActionsContainer(props: IProps) {
isSendNativeTokenOnly = true;
}

if (isSendNativeTokenOnly && !vaultSettings?.isUtxo) {
if (
isSendNativeTokenOnly &&
!vaultSettings?.maxSendCanNotSentFullAmount
) {
nativeTokenTransferBN = new BigNumber(
transferPayload?.amountToSend ?? nativeTokenTransferBN,
);
Expand Down Expand Up @@ -145,7 +148,7 @@ function TxActionsContainer(props: IProps) {
updateNativeTokenTransferAmount,
updateNativeTokenTransferAmountToUpdate,
vaultSettings?.ignoreUpdateNativeAmount,
vaultSettings?.isUtxo,
vaultSettings?.maxSendCanNotSentFullAmount,
vaultSettings?.maxSendFeeUpRatio,
]);

Expand Down

0 comments on commit 121208c

Please sign in to comment.