Skip to content

Commit

Permalink
Merge branch 'refs/heads/koni/dev/issue-3927' into koni/dev/issue-3862
Browse files Browse the repository at this point in the history
  • Loading branch information
bluezdot committed Dec 17, 2024
2 parents 6c9a0af + ed2b984 commit 9ce45ab
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 27 deletions.
7 changes: 0 additions & 7 deletions packages/extension-base/src/utils/account/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -700,17 +700,10 @@ export const combineAllAccountProxy = (accountProxies: AccountProxy[]): AccountP
const specialChain: string | undefined = accountProxies.length === 1 ? accountProxies[0].specialChain : undefined;

for (const accountProxy of accountProxies) {
// Have 4 network types, but at the moment, we only support 3 network types
if (chainTypes.size === 3) {
break;
}

for (const chainType of accountProxy.chainTypes) {
chainTypes.add(chainType);
}
}

for (const accountProxy of accountProxies) {
for (const tokenType of accountProxy.tokenTypes) {
tokenTypes.add(tokenType);
}
Expand Down
7 changes: 4 additions & 3 deletions packages/extension-base/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { _ChainInfo } from '@subwallet/chain-list/types';
import { CrowdloanParaState, NetworkJson } from '@subwallet/extension-base/background/KoniTypes';
import { AccountAuthType } from '@subwallet/extension-base/background/types';
import { getRandomIpfsGateway, SUBWALLET_IPFS } from '@subwallet/extension-base/koni/api/nft/config';
import { _isChainEvmCompatible, _isChainSubstrateCompatible, _isChainTonCompatible } from '@subwallet/extension-base/services/chain-service/utils';
import { _isChainCardanoCompatible, _isChainEvmCompatible, _isChainSubstrateCompatible, _isChainTonCompatible } from '@subwallet/extension-base/services/chain-service/utils';
import { AccountJson } from '@subwallet/extension-base/types';
import { reformatAddress } from '@subwallet/extension-base/utils/account';
import { decodeAddress, encodeAddress, isTonAddress } from '@subwallet/keyring';
import { decodeAddress, encodeAddress, isCardanoAddress, isTonAddress } from '@subwallet/keyring';
import { t } from 'i18next';

import { assert, BN, hexToU8a, isHex } from '@polkadot/util';
Expand Down Expand Up @@ -304,8 +304,9 @@ export function isAddressAndChainCompatible (address: string, chain: _ChainInfo)
const isEvmCompatible = isEthereumAddress(address) && _isChainEvmCompatible(chain);
const isTonCompatible = isTonAddress(address) && _isChainTonCompatible(chain);
const isSubstrateCompatible = !isEthereumAddress(address) && !isTonAddress(address) && _isChainSubstrateCompatible(chain); // todo: need isSubstrateAddress util function to check exactly
const isCardanoCompatible = isCardanoAddress(address) && _isChainCardanoCompatible(chain);

return isEvmCompatible || isSubstrateCompatible || isTonCompatible;
return isEvmCompatible || isSubstrateCompatible || isTonCompatible || isCardanoCompatible;
}

export function getDomainFromUrl (url: string): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,23 +811,6 @@ const Component = ({ className = '', isAllAccount, targetAccountProxy }: Compone

useRestoreTransaction(form);

useEffect(() => { // alibaba
makeTransfer({
from: 'addr_test1qr3nhq5hu88xjls8kyk790rcz2qt43aee9yuvx2gjn5msgfjwcw036s7adnz3f8ufl85guxkhz3cvv4znrvy7rzmv0qquff93j',
networkKey: 'cardano_preproduction',
to: 'addr_test1qzkjkwkyuvqh4hanewcych985euzqnd24jt2ej4kdyqpphr6hx9nax27yydcv9djgekn4ylvq60f6c830ng77dp5af2qrphdqh',
// tokenSlug: 'cardano_preproduction-NATIVE-tADA',
// value: '150000000',
tokenSlug: 'cardano_preproduction-CIP26-BLUEDOT',
value: '4321000000000',
transferAll: false
})
.then((rs) => {
console.log('[i],', rs);
})
.catch(console.error);
}, []);

return (
<>
<TransactionContent className={CN(`${className} -transaction-content`)}>
Expand Down
1 change: 1 addition & 0 deletions packages/extension-koni-ui/src/assets/logo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const DefaultLogosMap: Record<string, string> = {
polkadot_vault: './images/projects/polkadot-vault.png',
walletconnect: './images/projects/walletconnect.png',
banxa: './images/projects/banxa.png',
cardano: './images/projects/cardano.png',
coinbase: './images/projects/coinbase.png',
stellaswap: './images/projects/stellaswap.png',
xtwitter: './images/projects/xtwitter.png',
Expand Down
4 changes: 4 additions & 0 deletions packages/extension-koni-ui/src/assets/subwallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const SwLogosMap: Record<string, string> = {
avatar_placeholder: require('./avatar_placeholder.png'),
default: DefaultLogosMap.default,
transak: DefaultLogosMap.transak,
cardano: DefaultLogosMap.cardano,
cardano_preproduction: DefaultLogosMap.cardano,
['cardano-NATIVE-ADA'.toLowerCase()]: DefaultLogosMap.cardano,
['cardano_preproduction-NATIVE-tADA'.toLowerCase()]: DefaultLogosMap.cardano,
onramper: DefaultLogosMap.onramper,
moonpay: DefaultLogosMap.moonpay,
banxa: DefaultLogosMap.banxa,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9ce45ab

Please sign in to comment.