From 1f270c97dc3d543ca01910564eea4bbd53a29cad Mon Sep 17 00:00:00 2001 From: S2kael Date: Mon, 29 Jul 2024 11:37:43 +0700 Subject: [PATCH 1/3] [Issue-2982] Integrate with Avail Ledger App --- packages/extension-koni-ui/src/constants/ledger.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/extension-koni-ui/src/constants/ledger.ts b/packages/extension-koni-ui/src/constants/ledger.ts index 3f16a59703..7766c7c630 100644 --- a/packages/extension-koni-ui/src/constants/ledger.ts +++ b/packages/extension-koni-ui/src/constants/ledger.ts @@ -87,6 +87,19 @@ export const PredefinedLedgerNetwork: LedgerNetwork[] = [ isEthereum: false, slip44: 434 }, + { + accountName: 'Avail', + appName: 'Avail', + networkName: 'Avail network', + genesisHash: ChainInfoMap.avail_mainnet.substrateInfo?.genesisHash || '0xb91746b45e0346cc2f815a520b9c6cb4d5c0902af848db0a80f85932d2e8276a', + icon: 'substrate', + network: 'avail', + slug: ChainInfoMap.avail_mainnet.slug, + isDevMode: false, + isGeneric: false, + isEthereum: false, + slip44: 709 + }, { accountName: 'Acala', appName: 'Acala', From f545b6d62759a480abb4c11002f23d9536613654 Mon Sep 17 00:00:00 2001 From: S2kael Date: Mon, 29 Jul 2024 11:54:26 +0700 Subject: [PATCH 2/3] [Issue-2982] Block send NFT --- packages/extension-koni-ui/src/constants/ledger.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/extension-koni-ui/src/constants/ledger.ts b/packages/extension-koni-ui/src/constants/ledger.ts index 7766c7c630..166223ed41 100644 --- a/packages/extension-koni-ui/src/constants/ledger.ts +++ b/packages/extension-koni-ui/src/constants/ledger.ts @@ -273,7 +273,7 @@ export const BLOCK_DEFAULT_LEDGER_NETWORKS: string[] = ['*']; export const BLOCK_TRANSFER_NATIVE_LEDGER_NETWORKS: string[] = []; export const BLOCK_TRANSFER_TOKEN_LEDGER_NETWORKS: string[] = []; export const BLOCK_TRANSFER_XCM_LEDGER_NETWORKS: string[] = ['*']; -export const BLOCK_TRANSFER_NFT_LEDGER_NETWORKS: string[] = ['astar']; +export const BLOCK_TRANSFER_NFT_LEDGER_NETWORKS: string[] = ['astar', 'avail_mainnet']; /* TRANSFER */ /* STAKING */ From 57fda94d7d924496d5e07a270ab2634d21935df6 Mon Sep 17 00:00:00 2001 From: S2kael Date: Mon, 29 Jul 2024 19:16:58 +0700 Subject: [PATCH 3/3] [Issue-2982] Handle case sign message --- .../src/Popup/Confirmations/parts/Sign/Substrate.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/extension-koni-ui/src/Popup/Confirmations/parts/Sign/Substrate.tsx b/packages/extension-koni-ui/src/Popup/Confirmations/parts/Sign/Substrate.tsx index 85dfdf9d2e..934268362f 100644 --- a/packages/extension-koni-ui/src/Popup/Confirmations/parts/Sign/Substrate.tsx +++ b/packages/extension-koni-ui/src/Popup/Confirmations/parts/Sign/Substrate.tsx @@ -246,6 +246,7 @@ const Component: React.FC = (props: Props) => { }, [addExtraData, chain, isMessage, isMetadataOutdated, isMissingData, isRuntimeUpdated, loadingChain, networkName, signMode, t]); const activeLedger = useMemo(() => isLedger && !loadingChain && alertData?.type !== 'error', [isLedger, loadingChain, alertData?.type]); + const forceUseMigrationApp = useMemo(() => isRuntimeUpdated || (isMessage && chainSlug !== 'avail_mainnet'), [isRuntimeUpdated, isMessage, chainSlug]); const { error: ledgerError, isLoading: isLedgerLoading, @@ -254,7 +255,7 @@ const Component: React.FC = (props: Props) => { refresh: refreshLedger, signMessage: ledgerSignMessage, signTransaction: ledgerSignTransaction, - warning: ledgerWarning } = useLedger(chainSlug, activeLedger, true, isRuntimeUpdated || isMessage); + warning: ledgerWarning } = useLedger(chainSlug, activeLedger, true, forceUseMigrationApp); const isLedgerConnected = useMemo(() => !isLocked && !isLedgerLoading && !!ledger, [isLedgerLoading, isLocked, ledger]);