@unisat/wallet-state 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.mts +9 -1
- package/lib/index.d.ts +2827 -31
- package/lib/index.js +229 -101
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +231 -104
- package/lib/index.mjs.map +1 -1
- package/lib/types/index.d.ts +34 -3
- package/package.json +3 -3
- package/src/context/NavigationContext.tsx +1 -0
- package/src/hooks/accounts.ts +7 -2
- package/src/hooks/transactions.ts +52 -8
- package/src/hooks/ui.ts +77 -65
- package/src/ui-hooks/useAddressTypeScreenLogic.ts +22 -8
- package/src/ui-hooks/useAlkanesNFTScreenLogic.ts +3 -2
- package/src/ui-hooks/useAlkanesTokenScreenLogic.ts +4 -2
- package/src/ui-hooks/useBRC20TokenScreenLogic.ts +4 -1
- package/src/ui-hooks/useCAT20TokenScreenLogic.ts +11 -2
- package/src/ui-hooks/useCAT721NFTScreenLogic.ts +3 -1
- package/src/ui-hooks/useOrdinalsInscriptionScreenLogic.ts +3 -2
- package/src/ui-hooks/useRunesTokenScreenLogic.ts +4 -2
- package/src/ui-hooks/useSendOrdinalsInscriptionScreenLogic.ts +2 -5
- package/src/ui-hooks/useSettingsTabScreenLogic.ts +18 -3
- package/src/ui-hooks/useSignMessageLogic.ts +37 -16
- package/src/ui-hooks/useSignPsbtLogic.ts +31 -15
- package/lib/actions/global.d.ts +0 -2
- package/lib/actions/global.d.ts.map +0 -1
- package/lib/context/ApprovalContext.d.ts +0 -9
- package/lib/context/ApprovalContext.d.ts.map +0 -1
- package/lib/context/DeviceContext.d.ts +0 -17
- package/lib/context/DeviceContext.d.ts.map +0 -1
- package/lib/context/I18nContext.d.ts +0 -13
- package/lib/context/I18nContext.d.ts.map +0 -1
- package/lib/context/NavigationContext.d.ts +0 -218
- package/lib/context/NavigationContext.d.ts.map +0 -1
- package/lib/context/PriceContext.d.ts +0 -13
- package/lib/context/PriceContext.d.ts.map +0 -1
- package/lib/context/StorageContext.d.ts +0 -60
- package/lib/context/StorageContext.d.ts.map +0 -1
- package/lib/context/ToolsContext.d.ts +0 -17
- package/lib/context/ToolsContext.d.ts.map +0 -1
- package/lib/context/WalletContext.d.ts +0 -493
- package/lib/context/WalletContext.d.ts.map +0 -1
- package/lib/context/index.d.ts +0 -9
- package/lib/context/index.d.ts.map +0 -1
- package/lib/hooks/accounts.d.ts +0 -34
- package/lib/hooks/accounts.d.ts.map +0 -1
- package/lib/hooks/base.d.ts +0 -14
- package/lib/hooks/base.d.ts.map +0 -1
- package/lib/hooks/browser.d.ts +0 -32
- package/lib/hooks/browser.d.ts.map +0 -1
- package/lib/hooks/discovery.d.ts +0 -17
- package/lib/hooks/discovery.d.ts.map +0 -1
- package/lib/hooks/global.d.ts +0 -43
- package/lib/hooks/global.d.ts.map +0 -1
- package/lib/hooks/index.d.ts +0 -10
- package/lib/hooks/index.d.ts.map +0 -1
- package/lib/hooks/keyrings.d.ts +0 -5
- package/lib/hooks/keyrings.d.ts.map +0 -1
- package/lib/hooks/settings.d.ts +0 -43
- package/lib/hooks/settings.d.ts.map +0 -1
- package/lib/hooks/transactions.d.ts +0 -67
- package/lib/hooks/transactions.d.ts.map +0 -1
- package/lib/hooks/ui.d.ts +0 -112
- package/lib/hooks/ui.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/reducers/accounts.d.ts +0 -49
- package/lib/reducers/accounts.d.ts.map +0 -1
- package/lib/reducers/browser.d.ts +0 -49
- package/lib/reducers/browser.d.ts.map +0 -1
- package/lib/reducers/discovery.d.ts +0 -22
- package/lib/reducers/discovery.d.ts.map +0 -1
- package/lib/reducers/global.d.ts +0 -35
- package/lib/reducers/global.d.ts.map +0 -1
- package/lib/reducers/index.d.ts +0 -9
- package/lib/reducers/index.d.ts.map +0 -1
- package/lib/reducers/keyrings.d.ts +0 -10
- package/lib/reducers/keyrings.d.ts.map +0 -1
- package/lib/reducers/settings.d.ts +0 -16
- package/lib/reducers/settings.d.ts.map +0 -1
- package/lib/reducers/transactions.d.ts +0 -61
- package/lib/reducers/transactions.d.ts.map +0 -1
- package/lib/reducers/ui.d.ts +0 -55
- package/lib/reducers/ui.d.ts.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/ui.d.ts +0 -31
- package/lib/types/ui.d.ts.map +0 -1
- package/lib/ui-hooks/index.d.ts +0 -55
- package/lib/ui-hooks/index.d.ts.map +0 -1
- package/lib/ui-hooks/useActionOverviewSectionLogic.d.ts +0 -12
- package/lib/ui-hooks/useActionOverviewSectionLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useAddressTypeScreenLogic.d.ts +0 -19
- package/lib/ui-hooks/useAddressTypeScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useAlkanesBalanceCardLogic.d.ts +0 -19
- package/lib/ui-hooks/useAlkanesBalanceCardLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useAlkanesCollectionListLogic.d.ts +0 -11
- package/lib/ui-hooks/useAlkanesCollectionListLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useAlkanesListLogic.d.ts +0 -14
- package/lib/ui-hooks/useAlkanesListLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useAlkanesNFTListLogic.d.ts +0 -11
- package/lib/ui-hooks/useAlkanesNFTListLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useAlkanesNFTScreenLogic.d.ts +0 -9
- package/lib/ui-hooks/useAlkanesNFTScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useAlkanesTokenScreenLogic.d.ts +0 -22
- package/lib/ui-hooks/useAlkanesTokenScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useAmountInputLogic.d.ts +0 -22
- package/lib/ui-hooks/useAmountInputLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useAnnouncementCardLogic.d.ts +0 -11
- package/lib/ui-hooks/useAnnouncementCardLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useBRC20BalanceCardLogic.d.ts +0 -26
- package/lib/ui-hooks/useBRC20BalanceCardLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useBRC20InscribeTransferLogic.d.ts +0 -103
- package/lib/ui-hooks/useBRC20InscribeTransferLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useBRC20ListLogic.d.ts +0 -14
- package/lib/ui-hooks/useBRC20ListLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useBRC20ProgListLogic.d.ts +0 -14
- package/lib/ui-hooks/useBRC20ProgListLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useBRC20SendScreenLogic.d.ts +0 -67
- package/lib/ui-hooks/useBRC20SendScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useBRC20SingleStepScreenLogic.d.ts +0 -36
- package/lib/ui-hooks/useBRC20SingleStepScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useBRC20TokenScreenLogic.d.ts +0 -75
- package/lib/ui-hooks/useBRC20TokenScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useBalanceCardLogic.d.ts +0 -26
- package/lib/ui-hooks/useBalanceCardLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useBtcDisplayLogic.d.ts +0 -5
- package/lib/ui-hooks/useBtcDisplayLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useCAT20BalanceCardLogic.d.ts +0 -20
- package/lib/ui-hooks/useCAT20BalanceCardLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useCAT20ListLogic.d.ts +0 -14
- package/lib/ui-hooks/useCAT20ListLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useCAT20TokenScreenLogic.d.ts +0 -19
- package/lib/ui-hooks/useCAT20TokenScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useCAT721ListLogic.d.ts +0 -11
- package/lib/ui-hooks/useCAT721ListLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useCAT721NFTScreenLogic.d.ts +0 -9
- package/lib/ui-hooks/useCAT721NFTScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useCreatePasswordScreenLogic.d.ts +0 -27
- package/lib/ui-hooks/useCreatePasswordScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useCreateWalletLogicImportWordsStep.d.ts +0 -78
- package/lib/ui-hooks/useCreateWalletLogicImportWordsStep.d.ts.map +0 -1
- package/lib/ui-hooks/useEditAccountNameScreenLogic.d.ts +0 -18
- package/lib/ui-hooks/useEditAccountNameScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useEditContactScreenLogic.d.ts +0 -24
- package/lib/ui-hooks/useEditContactScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useEditWalletNameScreenLogic.d.ts +0 -15
- package/lib/ui-hooks/useEditWalletNameScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useExportMnemonicsScreenLogic.d.ts +0 -18
- package/lib/ui-hooks/useExportMnemonicsScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useExportPrivateKeyScreenLogic.d.ts +0 -17
- package/lib/ui-hooks/useExportPrivateKeyScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useFeeRateBarLogic.d.ts +0 -34
- package/lib/ui-hooks/useFeeRateBarLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useInfiniteList.d.ts +0 -19
- package/lib/ui-hooks/useInfiniteList.d.ts.map +0 -1
- package/lib/ui-hooks/useInscriptionListLogic.d.ts +0 -11
- package/lib/ui-hooks/useInscriptionListLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useLockTimePageLogic.d.ts +0 -11
- package/lib/ui-hooks/useLockTimePageLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useNotificationsLogic.d.ts +0 -14
- package/lib/ui-hooks/useNotificationsLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useOrdinalsInscriptionScreenLogic.d.ts +0 -27
- package/lib/ui-hooks/useOrdinalsInscriptionScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useRunesBalanceCardLogic.d.ts +0 -19
- package/lib/ui-hooks/useRunesBalanceCardLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useRunesListLogic.d.ts +0 -14
- package/lib/ui-hooks/useRunesListLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useRunesTokenScreenLogic.d.ts +0 -22
- package/lib/ui-hooks/useRunesTokenScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useSecurityCardLogic.d.ts +0 -1
- package/lib/ui-hooks/useSecurityCardLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useSendAlkanesNFTScreenLogic.d.ts +0 -32
- package/lib/ui-hooks/useSendAlkanesNFTScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useSendAlkanesScreenLogic.d.ts +0 -37
- package/lib/ui-hooks/useSendAlkanesScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useSendCAT20ScreenLogic.d.ts +0 -44
- package/lib/ui-hooks/useSendCAT20ScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useSendCAT721ScreenLogic.d.ts +0 -40
- package/lib/ui-hooks/useSendCAT721ScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useSendOrdinalsInscriptionScreenLogic.d.ts +0 -22
- package/lib/ui-hooks/useSendOrdinalsInscriptionScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useSendRunesScreenLogic.d.ts +0 -30
- package/lib/ui-hooks/useSendRunesScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useSettingsTabScreenLogic.d.ts +0 -72
- package/lib/ui-hooks/useSettingsTabScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useSignMessageLogic.d.ts +0 -54
- package/lib/ui-hooks/useSignMessageLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useSignPsbtLogic.d.ts +0 -82
- package/lib/ui-hooks/useSignPsbtLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useSplitOrdinalsInscriptionScreenLogic.d.ts +0 -15
- package/lib/ui-hooks/useSplitOrdinalsInscriptionScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useTxConfirmScreenLogic.d.ts +0 -8
- package/lib/ui-hooks/useTxConfirmScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useTxCreateScreenLogic.d.ts +0 -28
- package/lib/ui-hooks/useTxCreateScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useTxFailScreenLogic.d.ts +0 -7
- package/lib/ui-hooks/useTxFailScreenLogic.d.ts.map +0 -1
- package/lib/ui-hooks/useTxSuccessScreenLogic.d.ts +0 -8
- package/lib/ui-hooks/useTxSuccessScreenLogic.d.ts.map +0 -1
- package/lib/updater/accounts.d.ts +0 -2
- package/lib/updater/accounts.d.ts.map +0 -1
- package/lib/updater/index.d.ts +0 -2
- package/lib/updater/index.d.ts.map +0 -1
- package/lib/utils/bitcoin-utils.d.ts +0 -7
- package/lib/utils/bitcoin-utils.d.ts.map +0 -1
- package/lib/utils/eventBus.d.ts +0 -12
- package/lib/utils/eventBus.d.ts.map +0 -1
- package/lib/utils/password-utils.d.ts +0 -12
- package/lib/utils/password-utils.d.ts.map +0 -1
- package/lib/utils/ui-utils.d.ts +0 -4
- package/lib/utils/ui-utils.d.ts.map +0 -1
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
useCAT20TokenInfoExplorerUrl,
|
|
10
10
|
useChainType,
|
|
11
11
|
useCurrentAccount,
|
|
12
|
+
useCurrentAccountCapabilities,
|
|
12
13
|
useCurrentKeyring,
|
|
13
14
|
useResetTxState,
|
|
14
15
|
} from 'src/hooks'
|
|
@@ -39,6 +40,7 @@ export function useCAT20TokenScreenLogic() {
|
|
|
39
40
|
|
|
40
41
|
const account = useCurrentAccount()
|
|
41
42
|
const keyring = useCurrentKeyring()
|
|
43
|
+
const accountCapabilities = useCurrentAccountCapabilities()
|
|
42
44
|
const [loading, setLoading] = useState(true)
|
|
43
45
|
const tools = useTools()
|
|
44
46
|
useEffect(() => {
|
|
@@ -52,11 +54,13 @@ export function useCAT20TokenScreenLogic() {
|
|
|
52
54
|
|
|
53
55
|
const enableTransfer = useMemo(() => {
|
|
54
56
|
let enable = false
|
|
55
|
-
if (tokenSummary.cat20Balance && tokenSummary.cat20Balance.amount !== '0') {
|
|
57
|
+
if (accountCapabilities.canCreateSigningRequest && tokenSummary.cat20Balance && tokenSummary.cat20Balance.amount !== '0') {
|
|
56
58
|
enable = true
|
|
57
59
|
}
|
|
58
60
|
return enable
|
|
59
|
-
}, [tokenSummary])
|
|
61
|
+
}, [accountCapabilities.canCreateSigningRequest, tokenSummary])
|
|
62
|
+
|
|
63
|
+
const enableMerge = accountCapabilities.canCreateSigningRequest
|
|
60
64
|
|
|
61
65
|
const chainType = useChainType()
|
|
62
66
|
const enableTrade = useMemo(() => {
|
|
@@ -75,6 +79,10 @@ export function useCAT20TokenScreenLogic() {
|
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
const onClickMerge = e => {
|
|
82
|
+
if (!accountCapabilities.canCreateSigningRequest) {
|
|
83
|
+
tools.toastError(t('not_supported'))
|
|
84
|
+
return
|
|
85
|
+
}
|
|
78
86
|
if (keyring.type === KeyringType.KeystoneKeyring) {
|
|
79
87
|
tools.toastError(t('merge_utxos_is_not_supported_for_keystone_yet'))
|
|
80
88
|
return
|
|
@@ -115,6 +123,7 @@ export function useCAT20TokenScreenLogic() {
|
|
|
115
123
|
loading,
|
|
116
124
|
tokenUrl,
|
|
117
125
|
enableTransfer,
|
|
126
|
+
enableMerge,
|
|
118
127
|
enableTrade,
|
|
119
128
|
iconInfo,
|
|
120
129
|
onClickMerge,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useI18n, useNavigation } from 'src/context'
|
|
2
|
-
import { useResetTxState } from 'src/hooks'
|
|
2
|
+
import { useCurrentAccountCapabilities, useResetTxState } from 'src/hooks'
|
|
3
3
|
|
|
4
4
|
export function useCAT721NFTScreenLogic() {
|
|
5
5
|
const nav = useNavigation()
|
|
@@ -8,6 +8,7 @@ export function useCAT721NFTScreenLogic() {
|
|
|
8
8
|
const { t } = useI18n()
|
|
9
9
|
|
|
10
10
|
const resetTxState = useResetTxState()
|
|
11
|
+
const accountCapabilities = useCurrentAccountCapabilities()
|
|
11
12
|
|
|
12
13
|
const onClickBack = () => {
|
|
13
14
|
nav.goBack()
|
|
@@ -33,5 +34,6 @@ export function useCAT721NFTScreenLogic() {
|
|
|
33
34
|
// actions
|
|
34
35
|
onClickBack,
|
|
35
36
|
onClickSend,
|
|
37
|
+
disabledSend: !accountCapabilities.canCreateSigningRequest,
|
|
36
38
|
}
|
|
37
39
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Inscription } from '@unisat/wallet-shared'
|
|
2
2
|
import { useCallback, useEffect, useState } from 'react'
|
|
3
3
|
import { useI18n, useNavigation, useWallet } from 'src/context'
|
|
4
|
-
import { useCurrentAccount, useResetTxState } from 'src/hooks'
|
|
4
|
+
import { useCurrentAccount, useCurrentAccountCapabilities, useResetTxState } from 'src/hooks'
|
|
5
5
|
|
|
6
6
|
const HIGH_BALANCE = 10000
|
|
7
7
|
|
|
@@ -19,6 +19,7 @@ export function useOrdinalsInscriptionScreenLogic() {
|
|
|
19
19
|
const [isInitialLoading, setIsInitialLoading] = useState(!props.inscription)
|
|
20
20
|
|
|
21
21
|
const currentAccount = useCurrentAccount()
|
|
22
|
+
const accountCapabilities = useCurrentAccountCapabilities()
|
|
22
23
|
|
|
23
24
|
const resetTxState = useResetTxState()
|
|
24
25
|
|
|
@@ -100,7 +101,7 @@ export function useOrdinalsInscriptionScreenLogic() {
|
|
|
100
101
|
|
|
101
102
|
const isUnconfirmed = inscription ? inscription.timestamp == 0 : false
|
|
102
103
|
|
|
103
|
-
const withSend = inscription ? currentAccount.address === inscription.address : false
|
|
104
|
+
const withSend = inscription ? accountCapabilities.canCreateSigningRequest && currentAccount.address === inscription.address : false
|
|
104
105
|
|
|
105
106
|
const children = inscription ? inscription.children || [] : []
|
|
106
107
|
const parents = inscription ? inscription.parents || [] : []
|
|
@@ -5,6 +5,7 @@ import { useI18n, useNavigation, useTools, useWallet } from 'src/context'
|
|
|
5
5
|
import {
|
|
6
6
|
useChainType,
|
|
7
7
|
useCurrentAccount,
|
|
8
|
+
useCurrentAccountCapabilities,
|
|
8
9
|
useOrdinalsWebsite,
|
|
9
10
|
useResetTxState,
|
|
10
11
|
useRunesIconInfo,
|
|
@@ -62,6 +63,7 @@ export function useRunesTokenScreenLogic() {
|
|
|
62
63
|
const wallet = useWallet()
|
|
63
64
|
|
|
64
65
|
const account = useCurrentAccount()
|
|
66
|
+
const accountCapabilities = useCurrentAccountCapabilities()
|
|
65
67
|
|
|
66
68
|
const [loading, setLoading] = useState(true)
|
|
67
69
|
|
|
@@ -78,11 +80,11 @@ export function useRunesTokenScreenLogic() {
|
|
|
78
80
|
|
|
79
81
|
const enableTransfer = useMemo(() => {
|
|
80
82
|
let enable = false
|
|
81
|
-
if (tokenSummary.runeBalance.amount !== '0') {
|
|
83
|
+
if (accountCapabilities.canCreateSigningRequest && tokenSummary.runeBalance.amount !== '0') {
|
|
82
84
|
enable = true
|
|
83
85
|
}
|
|
84
86
|
return enable
|
|
85
|
-
}, [tokenSummary])
|
|
87
|
+
}, [accountCapabilities.canCreateSigningRequest, tokenSummary])
|
|
86
88
|
|
|
87
89
|
const tools = useTools()
|
|
88
90
|
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { Inscription } from '@unisat/wallet-shared'
|
|
2
2
|
import { useEffect, useMemo, useState } from 'react'
|
|
3
|
+
import { useI18n, useNavigation, useTools, useWallet } from '../context'
|
|
3
4
|
import {
|
|
4
5
|
useFeeRateBar,
|
|
5
6
|
useFetchUtxosCallback,
|
|
6
|
-
useI18n,
|
|
7
|
-
useNavigation,
|
|
8
7
|
useOrdinalsTx,
|
|
9
8
|
usePrepareSendOrdinalsInscriptionCallback,
|
|
10
|
-
|
|
11
|
-
useWallet,
|
|
12
|
-
} from '..'
|
|
9
|
+
} from '../hooks'
|
|
13
10
|
import { getAddressUtxoDust, isValidAddress } from '../utils/bitcoin-utils'
|
|
14
11
|
|
|
15
12
|
export function useSendOrdinalsInscriptionScreenLogic() {
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { KeyringType } from '@unisat/keyring-service/types'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ADDRESS_TYPES,
|
|
4
|
+
AccountSignMethod,
|
|
5
|
+
FEEDBACK_URL,
|
|
6
|
+
PlatformEnv,
|
|
7
|
+
getAccountCapabilities,
|
|
8
|
+
} from '@unisat/wallet-shared'
|
|
3
9
|
import { useMemo, useState } from 'react'
|
|
4
10
|
import { useDevice, useI18n, useNavigation, useTools, useWallet } from 'src/context'
|
|
5
11
|
import { useChain, useCurrentAccount, useCurrentKeyring, useVersionInfo } from 'src/hooks'
|
|
@@ -36,6 +42,11 @@ export function useSettingsTabScreenLogic() {
|
|
|
36
42
|
return currentKeyring.hdPath !== '' && item.hdPath !== currentKeyring.hdPath
|
|
37
43
|
}, [currentKeyring])
|
|
38
44
|
|
|
45
|
+
const currentKeyringCapabilities = useMemo(
|
|
46
|
+
() => getAccountCapabilities({ type: currentKeyring.type }),
|
|
47
|
+
[currentKeyring.type]
|
|
48
|
+
)
|
|
49
|
+
|
|
39
50
|
const settings_connectedSites: SettingsItemType = useMemo(() => {
|
|
40
51
|
const value = connected ? t('connected') : t('not_connected')
|
|
41
52
|
return {
|
|
@@ -69,7 +80,11 @@ export function useSettingsTabScreenLogic() {
|
|
|
69
80
|
let value = ''
|
|
70
81
|
const item = ADDRESS_TYPES[currentKeyring.addressType]
|
|
71
82
|
const hdPath = currentKeyring.hdPath || item.hdPath
|
|
72
|
-
if (
|
|
83
|
+
if (
|
|
84
|
+
currentKeyring.type === KeyringType.SimpleKeyring ||
|
|
85
|
+
currentKeyringCapabilities.signMethod === AccountSignMethod.External ||
|
|
86
|
+
!currentKeyringCapabilities.canChangeAddressType
|
|
87
|
+
) {
|
|
73
88
|
value = `${item.name}`
|
|
74
89
|
} else {
|
|
75
90
|
value = `${item.name} (${hdPath}/${currentAccount.index})`
|
|
@@ -93,7 +108,7 @@ export function useSettingsTabScreenLogic() {
|
|
|
93
108
|
nav.navigate('AddressTypeScreen')
|
|
94
109
|
},
|
|
95
110
|
}
|
|
96
|
-
}, [t, isCustomHdPath])
|
|
111
|
+
}, [t, isCustomHdPath, currentKeyring, currentAccount.index, currentKeyringCapabilities])
|
|
97
112
|
|
|
98
113
|
const settings_advanced = useMemo(() => {
|
|
99
114
|
return {
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
AccountSignMethod,
|
|
3
|
+
SignedMessage,
|
|
4
|
+
SignState,
|
|
5
|
+
ToSignMessage,
|
|
6
|
+
WebsiteResult,
|
|
7
|
+
} from '@unisat/wallet-shared'
|
|
3
8
|
import logger from 'loglevel'
|
|
4
9
|
import { useEffect, useMemo, useRef, useState } from 'react'
|
|
5
10
|
import { useApproval, useI18n, useTools, useWallet } from 'src/context'
|
|
6
|
-
import {
|
|
11
|
+
import { useCurrentAccountCapabilities } from 'src/hooks'
|
|
7
12
|
import { shortAddress, useAsyncEffect } from 'src/utils/ui-utils'
|
|
8
13
|
export interface SignMessageProps {
|
|
9
14
|
header?: React.ReactNode
|
|
@@ -36,11 +41,11 @@ export function useSignMessageLogic(props: SignMessageProps) {
|
|
|
36
41
|
const [loading, setLoading] = useState(false)
|
|
37
42
|
const [isKeystoneSigning, setIsKeystoneSigning] = useState(false)
|
|
38
43
|
const [isColdWalletSigning, setIsColdWalletSigning] = useState(false)
|
|
44
|
+
const [readonlySignature, setReadonlySignature] = useState('')
|
|
39
45
|
|
|
40
46
|
const wallet = useWallet()
|
|
41
47
|
const tools = useTools()
|
|
42
|
-
const
|
|
43
|
-
const keyringType = currentAccount.type
|
|
48
|
+
const accountCapabilities = useCurrentAccountCapabilities()
|
|
44
49
|
|
|
45
50
|
const { t } = useI18n()
|
|
46
51
|
|
|
@@ -65,15 +70,12 @@ export function useSignMessageLogic(props: SignMessageProps) {
|
|
|
65
70
|
return
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
if (
|
|
69
|
-
keyringType === KeyringType.KeystoneKeyring ||
|
|
70
|
-
keyringType === KeyringType.ColdWalletKeyring
|
|
71
|
-
) {
|
|
73
|
+
if (accountCapabilities.signMethod !== AccountSignMethod.Local) {
|
|
72
74
|
return
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
setAllowQuickMultiSign(websiteResult.allowQuickMultiSign && toSignMessages.length > 1)
|
|
76
|
-
}, [websiteResult,
|
|
78
|
+
}, [websiteResult, accountCapabilities, toSignMessages.length])
|
|
77
79
|
|
|
78
80
|
useAsyncEffect(async () => {
|
|
79
81
|
const website = session?.origin
|
|
@@ -190,12 +192,28 @@ export function useSignMessageLogic(props: SignMessageProps) {
|
|
|
190
192
|
}
|
|
191
193
|
|
|
192
194
|
const onNextStep = () => {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
switch (accountCapabilities.signMethod) {
|
|
196
|
+
case AccountSignMethod.Keystone:
|
|
197
|
+
setIsKeystoneSigning(true)
|
|
198
|
+
return
|
|
199
|
+
case AccountSignMethod.ColdWallet:
|
|
200
|
+
setIsColdWalletSigning(true)
|
|
201
|
+
return
|
|
202
|
+
case AccountSignMethod.External:
|
|
203
|
+
if (!readonlySignature) {
|
|
204
|
+
tools.toastError(t('please_enter_your_signature'))
|
|
205
|
+
return
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
onSignedData({ signature: readonlySignature }, signingTxIndex)
|
|
209
|
+
setReadonlySignature('')
|
|
210
|
+
return
|
|
211
|
+
case AccountSignMethod.Local:
|
|
212
|
+
localSign()
|
|
213
|
+
return
|
|
214
|
+
case AccountSignMethod.None:
|
|
215
|
+
default:
|
|
216
|
+
tools.toastError(t('not_supported'))
|
|
199
217
|
}
|
|
200
218
|
}
|
|
201
219
|
|
|
@@ -297,6 +315,9 @@ export function useSignMessageLogic(props: SignMessageProps) {
|
|
|
297
315
|
onColdWalletSigningSuccess,
|
|
298
316
|
onColdWalletSigningBack,
|
|
299
317
|
|
|
318
|
+
readonlySignature,
|
|
319
|
+
setReadonlySignature,
|
|
320
|
+
|
|
300
321
|
onDisclaimerModalClose,
|
|
301
322
|
}
|
|
302
323
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { numUtils } from '@unisat/base-utils'
|
|
2
|
-
import {
|
|
2
|
+
import { ToSignInput } from '@unisat/keyring-service/types'
|
|
3
3
|
import {
|
|
4
|
+
AccountSignMethod,
|
|
4
5
|
ApprovalSession,
|
|
5
6
|
ContractResult,
|
|
6
7
|
DecodedPsbt,
|
|
@@ -14,7 +15,7 @@ import {
|
|
|
14
15
|
import logger from 'loglevel'
|
|
15
16
|
import { useEffect, useMemo, useRef, useState } from 'react'
|
|
16
17
|
import { useApproval, useI18n, useTools, useWallet } from 'src/context'
|
|
17
|
-
import {
|
|
18
|
+
import { useCurrentAccountCapabilities } from 'src/hooks'
|
|
18
19
|
import { useAsyncEffect } from 'src/utils/ui-utils'
|
|
19
20
|
|
|
20
21
|
interface InscriptionInfo {
|
|
@@ -87,13 +88,13 @@ export function useSignPsbtLogic(props: SignPsbtProps) {
|
|
|
87
88
|
const [isPsbtRiskPopoverVisible, setIsPsbtRiskPopoverVisible] = useState(false)
|
|
88
89
|
const [isKeystoneSigning, setIsKeystoneSigning] = useState(false)
|
|
89
90
|
const [isColdWalletSigning, setIsColdWalletSigning] = useState(false)
|
|
91
|
+
const [readonlySignedPsbtHex, setReadonlySignedPsbtHex] = useState('')
|
|
90
92
|
|
|
91
93
|
const [contractPopoverData, setContractPopoverData] = useState(undefined)
|
|
92
94
|
|
|
93
95
|
const wallet = useWallet()
|
|
94
96
|
const tools = useTools()
|
|
95
|
-
const
|
|
96
|
-
const keyringType = currentAccount.type
|
|
97
|
+
const accountCapabilities = useCurrentAccountCapabilities()
|
|
97
98
|
|
|
98
99
|
const { t } = useI18n()
|
|
99
100
|
|
|
@@ -122,15 +123,12 @@ export function useSignPsbtLogic(props: SignPsbtProps) {
|
|
|
122
123
|
return
|
|
123
124
|
}
|
|
124
125
|
|
|
125
|
-
if (
|
|
126
|
-
keyringType === KeyringType.KeystoneKeyring ||
|
|
127
|
-
keyringType === KeyringType.ColdWalletKeyring
|
|
128
|
-
) {
|
|
126
|
+
if (accountCapabilities.signMethod !== AccountSignMethod.Local) {
|
|
129
127
|
return
|
|
130
128
|
}
|
|
131
129
|
|
|
132
130
|
setAllowQuickMultiSign(websiteResult.allowQuickMultiSign && toSignDatas.length > 1)
|
|
133
|
-
}, [websiteResult,
|
|
131
|
+
}, [websiteResult, accountCapabilities])
|
|
134
132
|
|
|
135
133
|
useAsyncEffect(async () => {
|
|
136
134
|
const website = session?.origin
|
|
@@ -374,12 +372,28 @@ export function useSignPsbtLogic(props: SignPsbtProps) {
|
|
|
374
372
|
}
|
|
375
373
|
|
|
376
374
|
const onNextStep = () => {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
375
|
+
switch (accountCapabilities.signMethod) {
|
|
376
|
+
case AccountSignMethod.Keystone:
|
|
377
|
+
setIsKeystoneSigning(true)
|
|
378
|
+
return
|
|
379
|
+
case AccountSignMethod.ColdWallet:
|
|
380
|
+
setIsColdWalletSigning(true)
|
|
381
|
+
return
|
|
382
|
+
case AccountSignMethod.External:
|
|
383
|
+
if (!readonlySignedPsbtHex) {
|
|
384
|
+
tools.toastError(t('invalid_psbt'))
|
|
385
|
+
return
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
onSignedData({ psbtHex: readonlySignedPsbtHex }, signingTxIndex)
|
|
389
|
+
setReadonlySignedPsbtHex('')
|
|
390
|
+
return
|
|
391
|
+
case AccountSignMethod.Local:
|
|
392
|
+
localSign()
|
|
393
|
+
return
|
|
394
|
+
case AccountSignMethod.None:
|
|
395
|
+
default:
|
|
396
|
+
tools.toastError(t('not_supported'))
|
|
383
397
|
}
|
|
384
398
|
}
|
|
385
399
|
|
|
@@ -481,6 +495,8 @@ export function useSignPsbtLogic(props: SignPsbtProps) {
|
|
|
481
495
|
toSignDatas,
|
|
482
496
|
currentToSignData,
|
|
483
497
|
currentDecodedPsbt,
|
|
498
|
+
readonlySignedPsbtHex,
|
|
499
|
+
setReadonlySignedPsbtHex,
|
|
484
500
|
|
|
485
501
|
// state
|
|
486
502
|
networkFee,
|
package/lib/actions/global.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../src/actions/global.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,gEAA6C,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface ApprovalContextType {
|
|
3
|
-
getApproval: () => Promise<any>;
|
|
4
|
-
resolveApproval: (data?: any, stay?: boolean, forceReject?: boolean) => Promise<void>;
|
|
5
|
-
rejectApproval: (reason?: string, stay?: boolean, isInternal?: boolean) => Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
export declare const ApprovalContext: React.Context<ApprovalContextType>;
|
|
8
|
-
export declare function useApproval(): ApprovalContextType;
|
|
9
|
-
//# sourceMappingURL=ApprovalContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalContext.d.ts","sourceRoot":"","sources":["../../src/context/ApprovalContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAA;IAC/B,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACrF,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACzF;AAcD,eAAO,MAAM,eAAe,oCAAwD,CAAA;AAEpF,wBAAgB,WAAW,wBAG1B"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface DeviceContextType {
|
|
3
|
-
isMobile: boolean;
|
|
4
|
-
isIOS: boolean;
|
|
5
|
-
isAndroid: boolean;
|
|
6
|
-
isExtensionInExpandView: boolean;
|
|
7
|
-
isExtensionInSideBar: boolean;
|
|
8
|
-
isExtension: boolean;
|
|
9
|
-
isMobileScreenSize: boolean;
|
|
10
|
-
isDesktopScreenSize: boolean;
|
|
11
|
-
platform: string;
|
|
12
|
-
hasBottomButton: boolean;
|
|
13
|
-
cardColumnsInList: number;
|
|
14
|
-
}
|
|
15
|
-
export declare const DeviceContext: React.Context<DeviceContextType>;
|
|
16
|
-
export declare function useDevice(): DeviceContextType;
|
|
17
|
-
//# sourceMappingURL=DeviceContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceContext.d.ts","sourceRoot":"","sources":["../../src/context/DeviceContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB,uBAAuB,EAAE,OAAO,CAAA;IAChC,oBAAoB,EAAE,OAAO,CAAA;IAC7B,WAAW,EAAE,OAAO,CAAA;IACpB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,mBAAmB,EAAE,OAAO,CAAA;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,OAAO,CAAA;IACxB,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAgBD,eAAO,MAAM,aAAa,kCAAsD,CAAA;AAEhF,wBAAgB,SAAS,sBAGxB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface I18nContextType {
|
|
3
|
-
t: (key: string, substitutions?: string | string[] | Record<string, string | number>) => string;
|
|
4
|
-
locale: string;
|
|
5
|
-
supportedLocales: string[];
|
|
6
|
-
localeNames: Record<string, string>;
|
|
7
|
-
changeLocale: (locale: string) => Promise<void>;
|
|
8
|
-
addResourceBundle?: (locale: string) => Promise<void>;
|
|
9
|
-
isSpecialLocale: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const I18nContext: React.Context<I18nContextType>;
|
|
12
|
-
export declare function useI18n(): I18nContextType;
|
|
13
|
-
//# sourceMappingURL=I18nContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"I18nContext.d.ts","sourceRoot":"","sources":["../../src/context/I18nContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyD,MAAM,OAAO,CAAA;AAE7E,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAA;IAC/F,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/C,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACrD,eAAe,EAAE,OAAO,CAAA;CACzB;AAGD,eAAO,MAAM,WAAW,gCAQtB,CAAA;AAEF,wBAAgB,OAAO,oBAOtB"}
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { Account, AlkanesBalance, AlkanesInfo, BabylonTxInfo, CAT20Balance, CAT20TokenInfo, CAT721CollectionInfo, CAT_VERSION, Inscription, RuneBalance, RuneInfo, TokenBalance, TokenInfo, ToSignData, WalletKeyring } from '@unisat/wallet-shared';
|
|
2
|
-
import { ChainType } from '@unisat/wallet-types';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
export type RouteParamList = {
|
|
5
|
-
WelcomeScreen: undefined;
|
|
6
|
-
UnlockScreen: {
|
|
7
|
-
autoUnlockByFace: boolean;
|
|
8
|
-
};
|
|
9
|
-
CreatePasswordScreen: {
|
|
10
|
-
isNewAccount?: boolean;
|
|
11
|
-
isKeystone?: boolean;
|
|
12
|
-
fromColdWallet?: boolean;
|
|
13
|
-
};
|
|
14
|
-
MainScreen: undefined;
|
|
15
|
-
WalletTabScreen: undefined;
|
|
16
|
-
AppTabScreen: undefined;
|
|
17
|
-
TabMainScreen: undefined;
|
|
18
|
-
DiscoverTabScreen: undefined;
|
|
19
|
-
SettingsTabScreen: undefined;
|
|
20
|
-
CreateHDWalletScreen: {
|
|
21
|
-
restoreTiTle?: boolean;
|
|
22
|
-
topTitle?: boolean;
|
|
23
|
-
finalButton?: string;
|
|
24
|
-
existingMnemonic?: string;
|
|
25
|
-
isBackupFlow?: boolean;
|
|
26
|
-
isImport?: boolean;
|
|
27
|
-
comeFrom?: string;
|
|
28
|
-
fromUnlock?: boolean;
|
|
29
|
-
goBack?: boolean;
|
|
30
|
-
};
|
|
31
|
-
CreateSimpleWalletScreen: undefined;
|
|
32
|
-
CreateWatchWalletScreen: undefined;
|
|
33
|
-
CreateColdWalletScreen: {
|
|
34
|
-
fromUnlock?: boolean;
|
|
35
|
-
};
|
|
36
|
-
CreateKeystoneWalletScreen: {
|
|
37
|
-
fromUnlock?: boolean;
|
|
38
|
-
};
|
|
39
|
-
EditWalletNameScreen: {
|
|
40
|
-
keyring: WalletKeyring;
|
|
41
|
-
};
|
|
42
|
-
ExportMnemonicsScreen: {
|
|
43
|
-
keyring: WalletKeyring;
|
|
44
|
-
};
|
|
45
|
-
ExportPrivateKeyScreen: {
|
|
46
|
-
account: Account;
|
|
47
|
-
};
|
|
48
|
-
SwitchAccountScreen: undefined;
|
|
49
|
-
ReceiveScreen: undefined;
|
|
50
|
-
HistoryScreen: undefined;
|
|
51
|
-
KeyringOrAccountScreen: undefined;
|
|
52
|
-
AddKeyringScreen: undefined;
|
|
53
|
-
ImportHDWalletScreen: {
|
|
54
|
-
comeFrom?: string;
|
|
55
|
-
};
|
|
56
|
-
CreateAccountScreen: {
|
|
57
|
-
keyringKey?: string;
|
|
58
|
-
};
|
|
59
|
-
CreateKeystoneScreen: {
|
|
60
|
-
comeFrom?: string;
|
|
61
|
-
goBack?: boolean;
|
|
62
|
-
};
|
|
63
|
-
EditAccountNameScreen: {
|
|
64
|
-
account: Account;
|
|
65
|
-
};
|
|
66
|
-
KeyringDetailScreen: {
|
|
67
|
-
keyringKey?: string;
|
|
68
|
-
};
|
|
69
|
-
ConnectedSitesScreen: undefined;
|
|
70
|
-
AddressTypeScreen: undefined;
|
|
71
|
-
AdvancedScreen: undefined;
|
|
72
|
-
ContactsScreen: {
|
|
73
|
-
returnWithNetwork?: ChainType;
|
|
74
|
-
lastEditedContactAddress?: string;
|
|
75
|
-
};
|
|
76
|
-
EditContactScreen: {
|
|
77
|
-
address?: string;
|
|
78
|
-
chain?: string;
|
|
79
|
-
selectedNetworkFilter: string;
|
|
80
|
-
};
|
|
81
|
-
AboutUsScreen: undefined;
|
|
82
|
-
LanguageScreen: undefined;
|
|
83
|
-
ChangePasswordScreen: undefined;
|
|
84
|
-
ModuleAssets: undefined;
|
|
85
|
-
NotificationListScreen: undefined;
|
|
86
|
-
UtxoToolsMainScreen: undefined;
|
|
87
|
-
ScanScreen: {
|
|
88
|
-
from?: string;
|
|
89
|
-
};
|
|
90
|
-
BrowserScreen: {
|
|
91
|
-
info: any;
|
|
92
|
-
};
|
|
93
|
-
TxCreateScreen: undefined;
|
|
94
|
-
OrdinalsInscriptionScreen: {
|
|
95
|
-
inscription: Inscription;
|
|
96
|
-
inscriptionId?: string;
|
|
97
|
-
withSend?: boolean;
|
|
98
|
-
};
|
|
99
|
-
SendOrdinalsInscriptionScreen: {
|
|
100
|
-
inscription: Inscription;
|
|
101
|
-
inscriptionId?: string;
|
|
102
|
-
};
|
|
103
|
-
SplitOrdinalsInscriptionScreen: {
|
|
104
|
-
inscription: Inscription;
|
|
105
|
-
inscriptionId?: string;
|
|
106
|
-
};
|
|
107
|
-
BRC20TokenScreen: {
|
|
108
|
-
ticker: string;
|
|
109
|
-
tokenBalance?: TokenBalance;
|
|
110
|
-
};
|
|
111
|
-
BRC20SendScreen: {
|
|
112
|
-
tokenBalance: TokenBalance;
|
|
113
|
-
tokenInfo: TokenInfo;
|
|
114
|
-
selectedInscriptionIds?: string[];
|
|
115
|
-
selectedAmount?: string;
|
|
116
|
-
};
|
|
117
|
-
BRC20InscribeTransfer: {
|
|
118
|
-
ticker: string;
|
|
119
|
-
};
|
|
120
|
-
BRC20SingleStepScreen: {
|
|
121
|
-
tokenBalance: TokenBalance;
|
|
122
|
-
tokenInfo: TokenInfo;
|
|
123
|
-
};
|
|
124
|
-
InscribeTransferScreen: {
|
|
125
|
-
ticker: string;
|
|
126
|
-
};
|
|
127
|
-
RunesTokenScreen: {
|
|
128
|
-
runeid: string;
|
|
129
|
-
};
|
|
130
|
-
SendRunesScreen: {
|
|
131
|
-
runeBalance: RuneBalance;
|
|
132
|
-
runeInfo: RuneInfo;
|
|
133
|
-
};
|
|
134
|
-
AlkanesTokenScreen: {
|
|
135
|
-
alkaneid: string;
|
|
136
|
-
};
|
|
137
|
-
SendAlkanesScreen: {
|
|
138
|
-
tokenBalance: AlkanesBalance;
|
|
139
|
-
tokenInfo: AlkanesInfo;
|
|
140
|
-
};
|
|
141
|
-
AlkanesCollectionScreen: {
|
|
142
|
-
collectionId: string;
|
|
143
|
-
};
|
|
144
|
-
AlkanesNFTScreen: {
|
|
145
|
-
alkanesInfo: AlkanesInfo;
|
|
146
|
-
};
|
|
147
|
-
SendAlkanesNFTScreen: {
|
|
148
|
-
alkanesInfo: AlkanesInfo;
|
|
149
|
-
};
|
|
150
|
-
CAT20TokenScreen: {
|
|
151
|
-
tokenId: string;
|
|
152
|
-
version: CAT_VERSION;
|
|
153
|
-
};
|
|
154
|
-
SendCAT20Screen: {
|
|
155
|
-
version: CAT_VERSION;
|
|
156
|
-
cat20Balance: CAT20Balance;
|
|
157
|
-
cat20Info: CAT20TokenInfo;
|
|
158
|
-
};
|
|
159
|
-
MergeCAT20Screen: {
|
|
160
|
-
version: CAT_VERSION;
|
|
161
|
-
cat20Balance: CAT20Balance;
|
|
162
|
-
cat20Info: CAT20TokenInfo;
|
|
163
|
-
};
|
|
164
|
-
CAT721CollectionScreen: {
|
|
165
|
-
collectionId: string;
|
|
166
|
-
version: CAT_VERSION;
|
|
167
|
-
};
|
|
168
|
-
CAT721NFTScreen: {
|
|
169
|
-
version: CAT_VERSION;
|
|
170
|
-
collectionInfo: CAT721CollectionInfo;
|
|
171
|
-
localId: string;
|
|
172
|
-
};
|
|
173
|
-
SendCAT721Screen: {
|
|
174
|
-
version: CAT_VERSION;
|
|
175
|
-
collectionInfo: CAT721CollectionInfo;
|
|
176
|
-
localId: string;
|
|
177
|
-
};
|
|
178
|
-
BabylonTxConfirmScreen: {
|
|
179
|
-
txInfo: BabylonTxInfo;
|
|
180
|
-
};
|
|
181
|
-
BabylonStakingScreen: undefined;
|
|
182
|
-
SendBabyScreen: undefined;
|
|
183
|
-
TxConfirmScreen: {
|
|
184
|
-
toSignData: ToSignData;
|
|
185
|
-
};
|
|
186
|
-
TxSuccessScreen: {
|
|
187
|
-
txid: string;
|
|
188
|
-
};
|
|
189
|
-
TxFailScreen: {
|
|
190
|
-
error: string;
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
export type RouteTypes = keyof RouteParamList;
|
|
194
|
-
type NavigateArgs<T extends RouteTypes> = RouteParamList[T] extends undefined ? [screenName: T] : [screenName: T, params: RouteParamList[T]];
|
|
195
|
-
export interface NavigationContextType {
|
|
196
|
-
navigate<T extends RouteTypes>(...args: NavigateArgs<T>): void;
|
|
197
|
-
replace<T extends RouteTypes>(...args: NavigateArgs<T>): void;
|
|
198
|
-
poptotop: () => void;
|
|
199
|
-
goBack: () => void;
|
|
200
|
-
navToTab: () => void;
|
|
201
|
-
navToTest: () => void;
|
|
202
|
-
navToLock: (params?: any) => void;
|
|
203
|
-
navToWelcome: () => void;
|
|
204
|
-
getRouteState<T extends RouteTypes>(): RouteParamList[T];
|
|
205
|
-
navToUtxoTools: () => void;
|
|
206
|
-
navToUrl: (url: string, externalBrowser?: boolean) => void;
|
|
207
|
-
navToExplorerTx: (txid: string) => void;
|
|
208
|
-
navToExplorerAddress: (address: string) => void;
|
|
209
|
-
navToMarketPlace: () => void;
|
|
210
|
-
navToMarketPlaceBrc20: (ticker: string) => void;
|
|
211
|
-
navToInscribeBrc20: (ticker: string) => void;
|
|
212
|
-
openExtensionInTab?: () => void;
|
|
213
|
-
navToRootHome: () => void;
|
|
214
|
-
}
|
|
215
|
-
export declare const NavigationContext: React.Context<NavigationContextType>;
|
|
216
|
-
export declare function useNavigation(): NavigationContextType;
|
|
217
|
-
export {};
|
|
218
|
-
//# sourceMappingURL=NavigationContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationContext.d.ts","sourceRoot":"","sources":["../../src/context/NavigationContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,cAAc,EACd,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,UAAU,EACV,aAAa,EACd,MAAM,uBAAuB,CAA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