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 c5c827c + 7089f48 commit c8ba027
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 37 deletions.
3 changes: 2 additions & 1 deletion packages/kit-bg/src/vaults/impls/btc/Vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default class VaultBtc extends VaultBase {
const { swapInfo, stakingInfo } = unsignedTx;
const { inputs, outputs, inputsToSign, psbtHex } = encodedTx;

if (psbtHex && Array.isArray(inputsToSign)) {
if (!swapInfo && !stakingInfo && psbtHex && Array.isArray(inputsToSign)) {
return this.buildDecodedPsbtTx(params);
}

Expand Down Expand Up @@ -264,6 +264,7 @@ export default class VaultBtc extends VaultBase {
action.assetTransfer.utxoFrom = utxoFrom;
action.assetTransfer.utxoTo = originalUtxoTo;
}
actions = [action];
} else if (nativeToken) {
actions = [
{
Expand Down
76 changes: 40 additions & 36 deletions packages/kit/src/views/Swap/pages/modal/SwapTokenSelectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
Alert,
Divider,
Empty,
IconButton,
ListView,
Page,
SizableText,
Expand Down Expand Up @@ -302,43 +301,48 @@ const SwapTokenSelectPage = () => {
<TokenListItem
{...tokenItem}
moreComponent={
<ActionList
title={tokenItem.tokenSymbol ?? ''}
disabled={rawItem.isNative}
renderTrigger={
<IconButton variant="tertiary" icon="DotVerSolid" />
}
items={[
{
icon: 'Copy3Outline',
label: intl.formatMessage({
id: ETranslations.global_copy_token_contract,
}),
onPress: () => {
copyText(rawItem.contractAddress);
<Stack alignSelf="center">
<ActionList
title={tokenItem.tokenSymbol ?? ''}
disabled={rawItem.isNative}
renderTrigger={
<ListItem.IconButton
icon="DotVerSolid"
variant="tertiary"
/>
}
items={[
{
icon: 'Copy3Outline',
label: intl.formatMessage({
id: ETranslations.global_copy_token_contract,
}),
onPress: () => {
copyText(rawItem.contractAddress);
},
disabled: rawItem.isNative,
},
disabled: rawItem.isNative,
},
{
icon: 'OpenOutline',
label: intl.formatMessage({
id: ETranslations.swap_token_selector_contract_info,
}),
onPress: async () => {
const url =
await backgroundApiProxy.serviceExplorer.buildExplorerUrl(
{
networkId: rawItem.networkId,
type: 'token',
param: rawItem.contractAddress,
},
);
openUrlExternal(url);
{
icon: 'OpenOutline',
label: intl.formatMessage({
id: ETranslations.swap_token_selector_contract_info,
}),
onPress: async () => {
const url =
await backgroundApiProxy.serviceExplorer.buildExplorerUrl(
{
networkId: rawItem.networkId,
type: 'token',
param: rawItem.contractAddress,
},
);
openUrlExternal(url);
},
disabled: rawItem.isNative,
},
disabled: rawItem.isNative,
},
]}
/>
]}
/>
</Stack>
}
/>
</>
Expand Down

0 comments on commit c8ba027

Please sign in to comment.