@unisat/wallet-state 1.1.0 → 1.2.0
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/actions/global.d.ts +2 -0
- package/lib/actions/global.d.ts.map +1 -0
- package/lib/context/ApprovalContext.d.ts +9 -0
- package/lib/context/ApprovalContext.d.ts.map +1 -0
- package/lib/context/DeviceContext.d.ts +17 -0
- package/lib/context/DeviceContext.d.ts.map +1 -0
- package/lib/context/I18nContext.d.ts +13 -0
- package/lib/context/I18nContext.d.ts.map +1 -0
- package/lib/context/NavigationContext.d.ts +218 -0
- package/lib/context/NavigationContext.d.ts.map +1 -0
- package/lib/context/PriceContext.d.ts +13 -0
- package/lib/context/PriceContext.d.ts.map +1 -0
- package/lib/context/StorageContext.d.ts +60 -0
- package/lib/context/StorageContext.d.ts.map +1 -0
- package/lib/context/ToolsContext.d.ts +17 -0
- package/lib/context/ToolsContext.d.ts.map +1 -0
- package/lib/context/WalletContext.d.ts +493 -0
- package/lib/context/WalletContext.d.ts.map +1 -0
- package/lib/context/index.d.ts +9 -0
- package/lib/context/index.d.ts.map +1 -0
- package/lib/hooks/accounts.d.ts +34 -0
- package/lib/hooks/accounts.d.ts.map +1 -0
- package/lib/hooks/base.d.ts +14 -0
- package/lib/hooks/base.d.ts.map +1 -0
- package/lib/hooks/browser.d.ts +32 -0
- package/lib/hooks/browser.d.ts.map +1 -0
- package/lib/hooks/discovery.d.ts +17 -0
- package/lib/hooks/discovery.d.ts.map +1 -0
- package/lib/hooks/global.d.ts +43 -0
- package/lib/hooks/global.d.ts.map +1 -0
- package/lib/hooks/index.d.ts +10 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/keyrings.d.ts +5 -0
- package/lib/hooks/keyrings.d.ts.map +1 -0
- package/lib/hooks/settings.d.ts +43 -0
- package/lib/hooks/settings.d.ts.map +1 -0
- package/lib/hooks/transactions.d.ts +67 -0
- package/lib/hooks/transactions.d.ts.map +1 -0
- package/lib/hooks/ui.d.ts +112 -0
- package/lib/hooks/ui.d.ts.map +1 -0
- package/lib/index.d.mts +79 -18
- package/lib/index.d.ts +31 -2758
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +291 -78
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +289 -80
- package/lib/index.mjs.map +1 -1
- package/lib/reducers/accounts.d.ts +49 -0
- package/lib/reducers/accounts.d.ts.map +1 -0
- package/lib/reducers/browser.d.ts +49 -0
- package/lib/reducers/browser.d.ts.map +1 -0
- package/lib/reducers/discovery.d.ts +22 -0
- package/lib/reducers/discovery.d.ts.map +1 -0
- package/lib/reducers/global.d.ts +35 -0
- package/lib/reducers/global.d.ts.map +1 -0
- package/lib/reducers/index.d.ts +9 -0
- package/lib/reducers/index.d.ts.map +1 -0
- package/lib/reducers/keyrings.d.ts +10 -0
- package/lib/reducers/keyrings.d.ts.map +1 -0
- package/lib/reducers/settings.d.ts +16 -0
- package/lib/reducers/settings.d.ts.map +1 -0
- package/lib/reducers/transactions.d.ts +61 -0
- package/lib/reducers/transactions.d.ts.map +1 -0
- package/lib/reducers/ui.d.ts +55 -0
- package/lib/reducers/ui.d.ts.map +1 -0
- package/lib/types/index.d.mts +6 -2
- package/lib/types/index.d.ts +3 -30
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +7 -1
- package/lib/types/index.js.map +1 -1
- package/lib/types/index.mjs +7 -2
- package/lib/types/index.mjs.map +1 -1
- package/lib/types/ui.d.ts +31 -0
- package/lib/types/ui.d.ts.map +1 -0
- package/lib/ui-hooks/index.d.ts +55 -0
- package/lib/ui-hooks/index.d.ts.map +1 -0
- package/lib/ui-hooks/useActionOverviewSectionLogic.d.ts +12 -0
- package/lib/ui-hooks/useActionOverviewSectionLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useAddressTypeScreenLogic.d.ts +19 -0
- package/lib/ui-hooks/useAddressTypeScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useAlkanesBalanceCardLogic.d.ts +19 -0
- package/lib/ui-hooks/useAlkanesBalanceCardLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useAlkanesCollectionListLogic.d.ts +11 -0
- package/lib/ui-hooks/useAlkanesCollectionListLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useAlkanesListLogic.d.ts +14 -0
- package/lib/ui-hooks/useAlkanesListLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useAlkanesNFTListLogic.d.ts +11 -0
- package/lib/ui-hooks/useAlkanesNFTListLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useAlkanesNFTScreenLogic.d.ts +9 -0
- package/lib/ui-hooks/useAlkanesNFTScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useAlkanesTokenScreenLogic.d.ts +22 -0
- package/lib/ui-hooks/useAlkanesTokenScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useAmountInputLogic.d.ts +22 -0
- package/lib/ui-hooks/useAmountInputLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useAnnouncementCardLogic.d.ts +11 -0
- package/lib/ui-hooks/useAnnouncementCardLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useBRC20BalanceCardLogic.d.ts +26 -0
- package/lib/ui-hooks/useBRC20BalanceCardLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useBRC20InscribeTransferLogic.d.ts +103 -0
- package/lib/ui-hooks/useBRC20InscribeTransferLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useBRC20ListLogic.d.ts +14 -0
- package/lib/ui-hooks/useBRC20ListLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useBRC20ProgListLogic.d.ts +14 -0
- package/lib/ui-hooks/useBRC20ProgListLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useBRC20SendScreenLogic.d.ts +67 -0
- package/lib/ui-hooks/useBRC20SendScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useBRC20SingleStepScreenLogic.d.ts +36 -0
- package/lib/ui-hooks/useBRC20SingleStepScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useBRC20TokenScreenLogic.d.ts +75 -0
- package/lib/ui-hooks/useBRC20TokenScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useBalanceCardLogic.d.ts +26 -0
- package/lib/ui-hooks/useBalanceCardLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useBtcDisplayLogic.d.ts +5 -0
- package/lib/ui-hooks/useBtcDisplayLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useCAT20BalanceCardLogic.d.ts +20 -0
- package/lib/ui-hooks/useCAT20BalanceCardLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useCAT20ListLogic.d.ts +14 -0
- package/lib/ui-hooks/useCAT20ListLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useCAT20TokenScreenLogic.d.ts +19 -0
- package/lib/ui-hooks/useCAT20TokenScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useCAT721ListLogic.d.ts +11 -0
- package/lib/ui-hooks/useCAT721ListLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useCAT721NFTScreenLogic.d.ts +9 -0
- package/lib/ui-hooks/useCAT721NFTScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useCreatePasswordScreenLogic.d.ts +27 -0
- package/lib/ui-hooks/useCreatePasswordScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useCreateWalletLogicImportWordsStep.d.ts +78 -0
- package/lib/ui-hooks/useCreateWalletLogicImportWordsStep.d.ts.map +1 -0
- package/lib/ui-hooks/useEditAccountNameScreenLogic.d.ts +18 -0
- package/lib/ui-hooks/useEditAccountNameScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useEditContactScreenLogic.d.ts +24 -0
- package/lib/ui-hooks/useEditContactScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useEditWalletNameScreenLogic.d.ts +15 -0
- package/lib/ui-hooks/useEditWalletNameScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useExportMnemonicsScreenLogic.d.ts +18 -0
- package/lib/ui-hooks/useExportMnemonicsScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useExportPrivateKeyScreenLogic.d.ts +17 -0
- package/lib/ui-hooks/useExportPrivateKeyScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useFeeRateBarLogic.d.ts +34 -0
- package/lib/ui-hooks/useFeeRateBarLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useInfiniteList.d.ts +19 -0
- package/lib/ui-hooks/useInfiniteList.d.ts.map +1 -0
- package/lib/ui-hooks/useInscriptionListLogic.d.ts +11 -0
- package/lib/ui-hooks/useInscriptionListLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useLockTimePageLogic.d.ts +11 -0
- package/lib/ui-hooks/useLockTimePageLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useNotificationsLogic.d.ts +14 -0
- package/lib/ui-hooks/useNotificationsLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useOrdinalsInscriptionScreenLogic.d.ts +27 -0
- package/lib/ui-hooks/useOrdinalsInscriptionScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useRunesBalanceCardLogic.d.ts +19 -0
- package/lib/ui-hooks/useRunesBalanceCardLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useRunesListLogic.d.ts +14 -0
- package/lib/ui-hooks/useRunesListLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useRunesTokenScreenLogic.d.ts +22 -0
- package/lib/ui-hooks/useRunesTokenScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useSecurityCardLogic.d.ts +1 -0
- package/lib/ui-hooks/useSecurityCardLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useSendAlkanesNFTScreenLogic.d.ts +32 -0
- package/lib/ui-hooks/useSendAlkanesNFTScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useSendAlkanesScreenLogic.d.ts +37 -0
- package/lib/ui-hooks/useSendAlkanesScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useSendCAT20ScreenLogic.d.ts +44 -0
- package/lib/ui-hooks/useSendCAT20ScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useSendCAT721ScreenLogic.d.ts +40 -0
- package/lib/ui-hooks/useSendCAT721ScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useSendOrdinalsInscriptionScreenLogic.d.ts +22 -0
- package/lib/ui-hooks/useSendOrdinalsInscriptionScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useSendRunesScreenLogic.d.ts +30 -0
- package/lib/ui-hooks/useSendRunesScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useSettingsTabScreenLogic.d.ts +72 -0
- package/lib/ui-hooks/useSettingsTabScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useSignMessageLogic.d.ts +54 -0
- package/lib/ui-hooks/useSignMessageLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useSignPsbtLogic.d.ts +82 -0
- package/lib/ui-hooks/useSignPsbtLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useSplitOrdinalsInscriptionScreenLogic.d.ts +15 -0
- package/lib/ui-hooks/useSplitOrdinalsInscriptionScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useTxConfirmScreenLogic.d.ts +8 -0
- package/lib/ui-hooks/useTxConfirmScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useTxCreateScreenLogic.d.ts +28 -0
- package/lib/ui-hooks/useTxCreateScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useTxFailScreenLogic.d.ts +7 -0
- package/lib/ui-hooks/useTxFailScreenLogic.d.ts.map +1 -0
- package/lib/ui-hooks/useTxSuccessScreenLogic.d.ts +8 -0
- package/lib/ui-hooks/useTxSuccessScreenLogic.d.ts.map +1 -0
- package/lib/updater/accounts.d.ts +2 -0
- package/lib/updater/accounts.d.ts.map +1 -0
- package/lib/updater/index.d.ts +2 -0
- package/lib/updater/index.d.ts.map +1 -0
- package/lib/utils/bitcoin-utils.d.ts +7 -0
- package/lib/utils/bitcoin-utils.d.ts.map +1 -0
- package/lib/utils/eventBus.d.ts +12 -0
- package/lib/utils/eventBus.d.ts.map +1 -0
- package/lib/utils/password-utils.d.ts +12 -0
- package/lib/utils/password-utils.d.ts.map +1 -0
- package/lib/utils/ui-utils.d.ts +4 -0
- package/lib/utils/ui-utils.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/context/WalletContext.tsx +56 -23
- package/src/hooks/settings.ts +10 -0
- package/src/hooks/transactions.ts +23 -2
- package/src/hooks/ui.ts +9 -1
- package/src/reducers/accounts.ts +3 -0
- package/src/reducers/ui.ts +21 -0
- package/src/types/ui.ts +6 -1
- package/src/ui-hooks/useAlkanesTokenScreenLogic.ts +8 -0
- package/src/ui-hooks/useBRC20InscribeTransferLogic.ts +30 -10
- package/src/ui-hooks/useBRC20ListLogic.ts +6 -2
- package/src/ui-hooks/useBRC20ProgListLogic.ts +7 -3
- package/src/ui-hooks/useBRC20SendScreenLogic.ts +19 -6
- package/src/ui-hooks/useBRC20TokenScreenLogic.ts +44 -24
- package/src/ui-hooks/useCAT20TokenScreenLogic.ts +5 -0
- package/src/ui-hooks/useEditAccountNameScreenLogic.ts +4 -4
- package/src/ui-hooks/useEditWalletNameScreenLogic.ts +5 -3
- package/src/ui-hooks/useRunesTokenScreenLogic.ts +7 -0
- package/src/ui-hooks/useSendAlkanesNFTScreenLogic.ts +24 -2
- package/src/ui-hooks/useSendAlkanesScreenLogic.ts +17 -1
- package/src/ui-hooks/useSendOrdinalsInscriptionScreenLogic.ts +15 -0
- package/src/ui-hooks/useSendRunesScreenLogic.ts +18 -1
- package/src/ui-hooks/useSplitOrdinalsInscriptionScreenLogic.ts +15 -1
- package/src/ui-hooks/useTxCreateScreenLogic.ts +17 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { TickPriceItem, TokenBalance } from '@unisat/wallet-shared'
|
|
2
2
|
import { useEffect, useRef, useState } from 'react'
|
|
3
3
|
import {
|
|
4
|
-
getSupportedAssets,
|
|
5
4
|
OrdinalsAssetTabKey,
|
|
5
|
+
getSupportedAssets,
|
|
6
6
|
useChainType,
|
|
7
7
|
useCurrentAccount,
|
|
8
8
|
useNavigation,
|
|
9
9
|
useOrdinalsAssetTabKey,
|
|
10
|
-
useWallet,
|
|
11
10
|
useWallTabFocusRefresh,
|
|
11
|
+
useWallet,
|
|
12
12
|
} from '..'
|
|
13
13
|
import { useInfiniteList } from './useInfiniteList'
|
|
14
14
|
|
|
@@ -43,7 +43,11 @@ export function useBRC20ProgListLogic() {
|
|
|
43
43
|
return { list: [], total: 0 }
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
const { list, total } = await wallet.getBRC20ProgList(
|
|
46
|
+
const { list, total } = await wallet.getBRC20ProgList({
|
|
47
|
+
address: currentAccount.address,
|
|
48
|
+
currentPage: page,
|
|
49
|
+
pageSize,
|
|
50
|
+
})
|
|
47
51
|
if (list.length > 0) {
|
|
48
52
|
wallet.getBrc20sPrice(list.map(item => item.ticker)).then(updatePrices)
|
|
49
53
|
}
|
|
@@ -31,6 +31,7 @@ export interface ContextData {
|
|
|
31
31
|
transferableList: TokenTransfer[]
|
|
32
32
|
inscriptionIdSet: Set<string>
|
|
33
33
|
receiver: string
|
|
34
|
+
enableRBF: boolean
|
|
34
35
|
rawTxInfo: RawTxInfo
|
|
35
36
|
tokenInfo: TokenInfo
|
|
36
37
|
}
|
|
@@ -42,6 +43,7 @@ export interface UpdateContextDataParams {
|
|
|
42
43
|
transferableList?: TokenTransfer[]
|
|
43
44
|
inscriptionIdSet?: Set<string>
|
|
44
45
|
receiver?: string
|
|
46
|
+
enableRBF?: boolean
|
|
45
47
|
rawTxInfo?: RawTxInfo
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -52,6 +54,7 @@ export interface BRC20SendStepParams {
|
|
|
52
54
|
|
|
53
55
|
export function useBRC20SendScreenLogic() {
|
|
54
56
|
const nav = useNavigation()
|
|
57
|
+
const wallet = useWallet()
|
|
55
58
|
|
|
56
59
|
const props = nav.getRouteState<'BRC20SendScreen'>()
|
|
57
60
|
|
|
@@ -66,6 +69,7 @@ export function useBRC20SendScreenLogic() {
|
|
|
66
69
|
transferableList: [],
|
|
67
70
|
inscriptionIdSet: new Set(selectedInscriptionIds),
|
|
68
71
|
receiver: '',
|
|
72
|
+
enableRBF: true,
|
|
69
73
|
rawTxInfo: {
|
|
70
74
|
psbtHex: '',
|
|
71
75
|
rawtx: '',
|
|
@@ -111,6 +115,12 @@ export function useBRC20SendScreenLogic() {
|
|
|
111
115
|
|
|
112
116
|
const { t } = useI18n()
|
|
113
117
|
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
wallet.getEnableRBF().then(enableRBF => {
|
|
120
|
+
updateContextData({ enableRBF })
|
|
121
|
+
})
|
|
122
|
+
}, [wallet, updateContextData])
|
|
123
|
+
|
|
114
124
|
return {
|
|
115
125
|
t,
|
|
116
126
|
contextData,
|
|
@@ -195,6 +205,7 @@ export function useBRC20SendScreenLogicStep2({
|
|
|
195
205
|
inscriptionId: inscriptionIds[0],
|
|
196
206
|
feeRate: feeRateBar.feeRate,
|
|
197
207
|
outputValue: getAddressUtxoDust(contextData.receiver),
|
|
208
|
+
enableRBF: contextData.enableRBF,
|
|
198
209
|
})
|
|
199
210
|
nav.navigate('TxConfirmScreen', { toSignData })
|
|
200
211
|
} else {
|
|
@@ -202,6 +213,7 @@ export function useBRC20SendScreenLogicStep2({
|
|
|
202
213
|
toAddressInfo: { address: contextData.receiver, domain: '' },
|
|
203
214
|
inscriptionIds,
|
|
204
215
|
feeRate: feeRateBar.feeRate,
|
|
216
|
+
enableRBF: contextData.enableRBF,
|
|
205
217
|
})
|
|
206
218
|
nav.navigate('TxConfirmScreen', { toSignData })
|
|
207
219
|
}
|
|
@@ -296,12 +308,13 @@ export function useTransferableListLogic({ contextData, updateContextData }: BRC
|
|
|
296
308
|
const fetchData = async () => {
|
|
297
309
|
try {
|
|
298
310
|
setLoading(true)
|
|
299
|
-
const { list, total } = await wallet.getBRC20TransferableList(
|
|
300
|
-
currentAccount.address,
|
|
301
|
-
contextData.tokenBalance.ticker,
|
|
302
|
-
|
|
303
|
-
pagination.
|
|
304
|
-
|
|
311
|
+
const { list, total } = await wallet.getBRC20TransferableList({
|
|
312
|
+
address: currentAccount.address,
|
|
313
|
+
ticker: contextData.tokenBalance.ticker,
|
|
314
|
+
tickerHex: contextData.tokenBalance.tickerHex,
|
|
315
|
+
currentPage: pagination.currentPage,
|
|
316
|
+
pageSize: pagination.pageSize,
|
|
317
|
+
})
|
|
305
318
|
setItems(list)
|
|
306
319
|
setTotal(total)
|
|
307
320
|
} catch (e) {
|
|
@@ -29,6 +29,8 @@ export interface BRC20OutWalletBalanceItem {
|
|
|
29
29
|
amount: string
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
const INSWAP_SWAP_ANCHOR = '#swap'
|
|
33
|
+
|
|
32
34
|
export function useBRC20TokenHistoryLogic(props: { ticker: string; displayName?: string }) {
|
|
33
35
|
const wallet = useWallet()
|
|
34
36
|
const { t } = useI18n()
|
|
@@ -178,6 +180,7 @@ export function useBRC20TokenScreenLogic() {
|
|
|
178
180
|
const [tokenSummary, setTokenSummary] = useState<AddressTokenSummary>({
|
|
179
181
|
tokenBalance: {
|
|
180
182
|
ticker,
|
|
183
|
+
tickerHex: Buffer.from(ticker).toString('hex'),
|
|
181
184
|
overallBalance: '',
|
|
182
185
|
availableBalance: '',
|
|
183
186
|
transferableBalance: '',
|
|
@@ -210,7 +213,10 @@ export function useBRC20TokenScreenLogic() {
|
|
|
210
213
|
const resetTxState = useResetTxState()
|
|
211
214
|
useEffect(() => {
|
|
212
215
|
wallet
|
|
213
|
-
.getBRC20Summary(
|
|
216
|
+
.getBRC20Summary({
|
|
217
|
+
address: account.address,
|
|
218
|
+
ticker,
|
|
219
|
+
})
|
|
214
220
|
.then(tokenSummary => {
|
|
215
221
|
if (tokenSummary.tokenInfo.holder == account.address) {
|
|
216
222
|
wallet
|
|
@@ -308,8 +314,14 @@ export function useBRC20TokenScreenLogic() {
|
|
|
308
314
|
}
|
|
309
315
|
}, [t, enableHistory])
|
|
310
316
|
|
|
317
|
+
const showSwapBalance = chain.isFractal
|
|
318
|
+
const showProgBalance = chain.enableBrc20Prog
|
|
319
|
+
const swapSiteEnabled = chain.enum === ChainType.FRACTAL_BITCOIN_MAINNET
|
|
320
|
+
const progSiteEnabled = chain.enum === ChainType.BITCOIN_MAINNET
|
|
321
|
+
|
|
311
322
|
const onSwapBalance = tokenSummary?.tokenBalance?.swapBalance
|
|
312
323
|
const onProgBalance = tokenSummary?.tokenBalance?.progBalance
|
|
324
|
+
|
|
313
325
|
const inWalletBalance = tokenSummary?.tokenBalance?.overallBalance
|
|
314
326
|
const outWalletBalanceItems = useMemo<BRC20OutWalletBalanceItem[]>(() => {
|
|
315
327
|
const items: BRC20OutWalletBalanceItem[] = [
|
|
@@ -320,7 +332,7 @@ export function useBRC20TokenScreenLogic() {
|
|
|
320
332
|
},
|
|
321
333
|
]
|
|
322
334
|
|
|
323
|
-
if (
|
|
335
|
+
if (showSwapBalance) {
|
|
324
336
|
items.push({
|
|
325
337
|
key: 'swap',
|
|
326
338
|
label: t('brc20_on_swap'),
|
|
@@ -328,7 +340,7 @@ export function useBRC20TokenScreenLogic() {
|
|
|
328
340
|
})
|
|
329
341
|
}
|
|
330
342
|
|
|
331
|
-
if (
|
|
343
|
+
if (showProgBalance) {
|
|
332
344
|
items.push({
|
|
333
345
|
key: 'prog',
|
|
334
346
|
label: t('brc20_on_prog'),
|
|
@@ -348,56 +360,64 @@ export function useBRC20TokenScreenLogic() {
|
|
|
348
360
|
.toString()
|
|
349
361
|
}, [onSwapBalance, onProgBalance, inWalletBalance])
|
|
350
362
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
363
|
+
const brc20prog_ticker = encodeURIComponent(ticker)
|
|
364
|
+
const ensureSiteEnabled = (enabled: boolean) => {
|
|
365
|
+
if (!enabled) {
|
|
366
|
+
tools.toastError(t('not_supported'))
|
|
367
|
+
return false
|
|
368
|
+
}
|
|
369
|
+
return true
|
|
357
370
|
}
|
|
358
371
|
|
|
372
|
+
// brc20prog
|
|
359
373
|
const onClickWrapBrc20Prog = () => {
|
|
360
|
-
|
|
374
|
+
if (!ensureSiteEnabled(progSiteEnabled)) return
|
|
375
|
+
const url = `https://link.unisat.space/btc/wrap?tick=${brc20prog_ticker}`
|
|
361
376
|
nav.navToUrl(url)
|
|
362
377
|
}
|
|
363
378
|
|
|
364
379
|
const onClickUnwrapBrc20Prog = () => {
|
|
365
|
-
|
|
380
|
+
if (!ensureSiteEnabled(progSiteEnabled)) return
|
|
381
|
+
const url = `https://link.unisat.space/btc/wrap?action=unwrap&tick=${brc20prog_ticker}`
|
|
366
382
|
nav.navToUrl(url)
|
|
367
383
|
}
|
|
368
384
|
|
|
369
385
|
const onClickSendBrc20Prog = () => {
|
|
370
|
-
|
|
386
|
+
if (!ensureSiteEnabled(progSiteEnabled)) return
|
|
387
|
+
const url = `https://bestinslot.xyz/brc2.0/${brc20prog_ticker}/transfer`
|
|
371
388
|
nav.navToUrl(url)
|
|
372
389
|
}
|
|
373
390
|
|
|
391
|
+
const inswap_ticker = encodeURIComponent(ticker)
|
|
392
|
+
|
|
393
|
+
// inswap
|
|
374
394
|
const onClickSwapInSwap = () => {
|
|
375
|
-
|
|
395
|
+
if (!ensureSiteEnabled(swapSiteEnabled)) return
|
|
396
|
+
const url = `https://inswap.cc/swap/pools?q=${inswap_ticker}`
|
|
376
397
|
nav.navToUrl(url)
|
|
377
398
|
}
|
|
378
399
|
|
|
379
400
|
const onClickAddLiquidityInSwap = () => {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
const onClickRemoveLiquidityInSwap = () => {
|
|
385
|
-
const url = `https://inswap.cc/swap/pools?t0=${encodeURIComponent(ticker)}&t1=sFB___000&action=remove`
|
|
401
|
+
if (!ensureSiteEnabled(swapSiteEnabled)) return
|
|
402
|
+
const url = `https://inswap.cc/swap/pools?q=${inswap_ticker}`
|
|
386
403
|
nav.navToUrl(url)
|
|
387
404
|
}
|
|
388
405
|
|
|
389
406
|
const onClickWrapInSwap = () => {
|
|
390
|
-
|
|
407
|
+
if (!ensureSiteEnabled(swapSiteEnabled)) return
|
|
408
|
+
const url = `https://inswap.cc/swap?tab=deposit&t=${inswap_ticker}${INSWAP_SWAP_ANCHOR}`
|
|
391
409
|
nav.navToUrl(url)
|
|
392
410
|
}
|
|
393
411
|
|
|
394
412
|
const onClickUnwrapInSwap = () => {
|
|
395
|
-
|
|
413
|
+
if (!ensureSiteEnabled(swapSiteEnabled)) return
|
|
414
|
+
const url = `https://inswap.cc/swap?tab=withdraw&t=${inswap_ticker}${INSWAP_SWAP_ANCHOR}`
|
|
396
415
|
nav.navToUrl(url)
|
|
397
416
|
}
|
|
398
417
|
|
|
399
418
|
const onClickSendInSwap = () => {
|
|
400
|
-
|
|
419
|
+
if (!ensureSiteEnabled(swapSiteEnabled)) return
|
|
420
|
+
const url = `https://inswap.cc/swap/assets/account?tab=assets&t=${inswap_ticker}&action=send`
|
|
401
421
|
nav.navToUrl(url)
|
|
402
422
|
}
|
|
403
423
|
|
|
@@ -433,7 +453,6 @@ export function useBRC20TokenScreenLogic() {
|
|
|
433
453
|
onProgBalance,
|
|
434
454
|
inWalletBalance,
|
|
435
455
|
outWalletBalanceItems,
|
|
436
|
-
hasOutWalletBalance,
|
|
437
456
|
enableHistory,
|
|
438
457
|
enableTrade,
|
|
439
458
|
enableMint,
|
|
@@ -450,13 +469,14 @@ export function useBRC20TokenScreenLogic() {
|
|
|
450
469
|
tools,
|
|
451
470
|
isBrc20Prog,
|
|
452
471
|
iconInfo,
|
|
472
|
+
showProgBalance,
|
|
473
|
+
showSwapBalance,
|
|
453
474
|
onClickWrapBrc20Prog,
|
|
454
475
|
onClickUnwrapBrc20Prog,
|
|
455
476
|
onClickSendBrc20Prog,
|
|
456
477
|
|
|
457
478
|
onClickSwapInSwap,
|
|
458
479
|
onClickAddLiquidityInSwap,
|
|
459
|
-
onClickRemoveLiquidityInSwap,
|
|
460
480
|
onClickWrapInSwap,
|
|
461
481
|
onClickUnwrapInSwap,
|
|
462
482
|
onClickSendInSwap,
|
|
@@ -104,6 +104,10 @@ export function useCAT20TokenScreenLogic() {
|
|
|
104
104
|
nav.navToUrl(marketPlaceUrl)
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
const onClickViewOnExplorer = e => {
|
|
108
|
+
nav.navToUrl(tokenUrl)
|
|
109
|
+
}
|
|
110
|
+
|
|
107
111
|
const iconInfo = useCAT20IconInfo(tokenSummary.cat20Info.name, tokenSummary.cat20Info.tokenId)
|
|
108
112
|
|
|
109
113
|
return {
|
|
@@ -117,6 +121,7 @@ export function useCAT20TokenScreenLogic() {
|
|
|
117
121
|
onClickSend,
|
|
118
122
|
onClickTrade,
|
|
119
123
|
onClickBack,
|
|
124
|
+
onClickViewOnExplorer,
|
|
120
125
|
t,
|
|
121
126
|
}
|
|
122
127
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account } from '@unisat/wallet-shared'
|
|
1
|
+
import { Account, MAX_ALIAS_NAME_LENGTH } from '@unisat/wallet-shared'
|
|
2
2
|
import { useMemo, useState } from 'react'
|
|
3
3
|
import { useLocation } from 'react-router-dom'
|
|
4
4
|
import { useI18n, useNavigation, useWallet } from 'src/context'
|
|
@@ -41,15 +41,15 @@ export function useEditAccountNameScreenLogic() {
|
|
|
41
41
|
|
|
42
42
|
const truncatedTitle = useMemo(() => {
|
|
43
43
|
const name = account.alianName || ''
|
|
44
|
-
if (name.length >
|
|
45
|
-
return name.slice(0,
|
|
44
|
+
if (name.length > MAX_ALIAS_NAME_LENGTH) {
|
|
45
|
+
return name.slice(0, MAX_ALIAS_NAME_LENGTH) + '...'
|
|
46
46
|
}
|
|
47
47
|
return name
|
|
48
48
|
}, [account.alianName])
|
|
49
49
|
|
|
50
50
|
const onInputChange = (e: { target: { value: string } } | string) => {
|
|
51
51
|
const value = typeof e === 'string' ? e : e.target.value
|
|
52
|
-
if (value.length <=
|
|
52
|
+
if (value.length <= MAX_ALIAS_NAME_LENGTH) {
|
|
53
53
|
setAlianName(value)
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useMemo, useState } from 'react'
|
|
2
2
|
|
|
3
|
+
import { MAX_ALIAS_NAME_LENGTH } from '@unisat/wallet-shared'
|
|
4
|
+
|
|
3
5
|
import { keyringsActions, useAppDispatch, useI18n, useNavigation, useWallet } from '..'
|
|
4
6
|
export function useEditWalletNameScreenLogic() {
|
|
5
7
|
const nav = useNavigation()
|
|
@@ -33,15 +35,15 @@ export function useEditWalletNameScreenLogic() {
|
|
|
33
35
|
}, [alianName])
|
|
34
36
|
|
|
35
37
|
const truncatedTitle = useMemo(() => {
|
|
36
|
-
if (keyring.alianName && keyring.alianName.length >
|
|
37
|
-
return keyring.alianName.slice(0,
|
|
38
|
+
if (keyring.alianName && keyring.alianName.length > MAX_ALIAS_NAME_LENGTH) {
|
|
39
|
+
return keyring.alianName.slice(0, MAX_ALIAS_NAME_LENGTH) + '...'
|
|
38
40
|
}
|
|
39
41
|
return keyring.alianName || ''
|
|
40
42
|
}, [keyring.alianName])
|
|
41
43
|
|
|
42
44
|
const onInputChange = (e: { target: { value: string } } | string) => {
|
|
43
45
|
const value = typeof e === 'string' ? e : e.target.value
|
|
44
|
-
if (value.length <=
|
|
46
|
+
if (value.length <= MAX_ALIAS_NAME_LENGTH) {
|
|
45
47
|
setAlianName(value)
|
|
46
48
|
}
|
|
47
49
|
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
useRunesIconInfo,
|
|
11
11
|
useRunesInscribeUrl,
|
|
12
12
|
useRunesMarketUrl,
|
|
13
|
+
useRunesTokenInfoExplorerUrl,
|
|
13
14
|
useTxExplorerUrl,
|
|
14
15
|
} from 'src/hooks'
|
|
15
16
|
|
|
@@ -106,6 +107,7 @@ export function useRunesTokenScreenLogic() {
|
|
|
106
107
|
const iconInfo = useRunesIconInfo(tokenSummary.runeInfo.spacedRune)
|
|
107
108
|
const inscribeUrl = useRunesInscribeUrl(tokenSummary.runeInfo.rune)
|
|
108
109
|
const marketPlaceUrl = useRunesMarketUrl(tokenSummary.runeInfo.spacedRune)
|
|
110
|
+
const runesExplorerUrl = useRunesTokenInfoExplorerUrl(tokenSummary.runeInfo.runeid)
|
|
109
111
|
|
|
110
112
|
const onClickMint = () => {
|
|
111
113
|
nav.navToUrl(inscribeUrl)
|
|
@@ -125,6 +127,10 @@ export function useRunesTokenScreenLogic() {
|
|
|
125
127
|
}
|
|
126
128
|
}
|
|
127
129
|
|
|
130
|
+
const onClickViewOnExplorer = () => {
|
|
131
|
+
nav.navToUrl(runesExplorerUrl)
|
|
132
|
+
}
|
|
133
|
+
|
|
128
134
|
return {
|
|
129
135
|
runeid,
|
|
130
136
|
tokenSummary,
|
|
@@ -145,5 +151,6 @@ export function useRunesTokenScreenLogic() {
|
|
|
145
151
|
|
|
146
152
|
enableTrade,
|
|
147
153
|
onClickTrade,
|
|
154
|
+
onClickViewOnExplorer,
|
|
148
155
|
}
|
|
149
156
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Inscription, SignedData, SignPsbtParams, ToSignData } from '@unisat/wallet-shared'
|
|
2
2
|
import { useEffect, useRef, useState } from 'react'
|
|
3
|
-
import { useI18n, useNavigation, useTools } from 'src/context'
|
|
3
|
+
import { useI18n, useNavigation, useTools, useWallet } from 'src/context'
|
|
4
4
|
import {
|
|
5
5
|
useCurrentAccount,
|
|
6
6
|
useFeeRateBar,
|
|
@@ -33,13 +33,21 @@ export function useSendAlkanesNFTScreenLogic() {
|
|
|
33
33
|
})
|
|
34
34
|
|
|
35
35
|
const [error, setError] = useState('')
|
|
36
|
+
const [enableRBF, setEnableRBF] = useState(true)
|
|
36
37
|
|
|
37
38
|
const currentAccount = useCurrentAccount()
|
|
38
39
|
|
|
39
40
|
const tools = useTools()
|
|
41
|
+
const wallet = useWallet()
|
|
40
42
|
|
|
41
43
|
const { feeRate } = useFeeRateBar()
|
|
42
44
|
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
wallet.getEnableRBF().then(enableRBF => {
|
|
47
|
+
setEnableRBF(enableRBF)
|
|
48
|
+
})
|
|
49
|
+
}, [wallet])
|
|
50
|
+
|
|
43
51
|
useEffect(() => {
|
|
44
52
|
setError('')
|
|
45
53
|
setDisabled(true)
|
|
@@ -71,7 +79,14 @@ export function useSendAlkanesNFTScreenLogic() {
|
|
|
71
79
|
const onCreateTxHandleConfirm = async () => {
|
|
72
80
|
tools.showLoading(true)
|
|
73
81
|
try {
|
|
74
|
-
const toSignData = await prepareSendAlkanes(
|
|
82
|
+
const toSignData = await prepareSendAlkanes(
|
|
83
|
+
toInfo,
|
|
84
|
+
alkanesInfo.alkaneid,
|
|
85
|
+
'1',
|
|
86
|
+
feeRate,
|
|
87
|
+
'nft',
|
|
88
|
+
enableRBF
|
|
89
|
+
)
|
|
75
90
|
if (toSignData) {
|
|
76
91
|
transferData.current.toSignData = toSignData
|
|
77
92
|
setStep(1)
|
|
@@ -118,14 +133,21 @@ export function useSendAlkanesNFTScreenLogic() {
|
|
|
118
133
|
},
|
|
119
134
|
}
|
|
120
135
|
|
|
136
|
+
const onEnableRBFChange = (value: boolean) => {
|
|
137
|
+
setEnableRBF(value)
|
|
138
|
+
wallet.setEnableRBF(value)
|
|
139
|
+
}
|
|
140
|
+
|
|
121
141
|
return {
|
|
122
142
|
step,
|
|
123
143
|
t,
|
|
124
144
|
alkanesInfo,
|
|
125
145
|
toInfo,
|
|
146
|
+
enableRBF,
|
|
126
147
|
disabled,
|
|
127
148
|
error,
|
|
128
149
|
setToInfo,
|
|
150
|
+
setEnableRBF: onEnableRBFChange,
|
|
129
151
|
|
|
130
152
|
onCreateTxHandleConfirm,
|
|
131
153
|
onCreateTxHandleBack,
|
|
@@ -39,6 +39,7 @@ export function useSendAlkanesScreenLogic() {
|
|
|
39
39
|
|
|
40
40
|
const [availableBalance, setAvailableBalance] = useState(tokenBalance.amount)
|
|
41
41
|
const [error, setError] = useState('')
|
|
42
|
+
const [enableRBF, setEnableRBF] = useState(true)
|
|
42
43
|
|
|
43
44
|
const totalBalanceStr = useMemo(() => {
|
|
44
45
|
return bnUtils.toDecimalAmount(tokenBalance.amount, tokenBalance.divisibility)
|
|
@@ -107,6 +108,12 @@ export function useSendAlkanesScreenLogic() {
|
|
|
107
108
|
|
|
108
109
|
const wallet = useWallet()
|
|
109
110
|
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
wallet.getEnableRBF().then(enableRBF => {
|
|
113
|
+
setEnableRBF(enableRBF)
|
|
114
|
+
})
|
|
115
|
+
}, [wallet])
|
|
116
|
+
|
|
110
117
|
const prepareSendAlkanes = usePrepareSendAlkanesCallback()
|
|
111
118
|
const pushBitcoinTx = usePushBitcoinTxCallback()
|
|
112
119
|
|
|
@@ -122,7 +129,8 @@ export function useSendAlkanesScreenLogic() {
|
|
|
122
129
|
tokenBalance.alkaneid,
|
|
123
130
|
bnUtils.fromDecimalAmount(inputAmount, tokenBalance.divisibility),
|
|
124
131
|
feeRate,
|
|
125
|
-
'ft'
|
|
132
|
+
'ft',
|
|
133
|
+
enableRBF
|
|
126
134
|
)
|
|
127
135
|
if (toSignData) {
|
|
128
136
|
transferData.current.toSignData = toSignData
|
|
@@ -164,6 +172,12 @@ export function useSendAlkanesScreenLogic() {
|
|
|
164
172
|
const onSignPsbtHandleBack = () => {
|
|
165
173
|
setStep(SendAlkanesScreenStep.CREATE_TX)
|
|
166
174
|
}
|
|
175
|
+
|
|
176
|
+
const onEnableRBFChange = (value: boolean) => {
|
|
177
|
+
setEnableRBF(value)
|
|
178
|
+
wallet.setEnableRBF(value)
|
|
179
|
+
}
|
|
180
|
+
|
|
167
181
|
return {
|
|
168
182
|
step,
|
|
169
183
|
t,
|
|
@@ -174,12 +188,14 @@ export function useSendAlkanesScreenLogic() {
|
|
|
174
188
|
availableBalanceStr,
|
|
175
189
|
|
|
176
190
|
inputAmount,
|
|
191
|
+
enableRBF,
|
|
177
192
|
disabled,
|
|
178
193
|
error,
|
|
179
194
|
|
|
180
195
|
// actions
|
|
181
196
|
setToInfo,
|
|
182
197
|
setInputAmount,
|
|
198
|
+
setEnableRBF: onEnableRBFChange,
|
|
183
199
|
onClickBack,
|
|
184
200
|
onClickNext,
|
|
185
201
|
|
|
@@ -39,15 +39,27 @@ export function useSendOrdinalsInscriptionScreenLogic() {
|
|
|
39
39
|
const defaultOutputValue = inscription ? inscription.outputValue : 10000
|
|
40
40
|
|
|
41
41
|
const [outputValue, setOutputValue] = useState(defaultOutputValue)
|
|
42
|
+
const [enableRBF, setEnableRBF] = useState(true)
|
|
42
43
|
const [inscriptions, setInscriptions] = useState<Inscription[]>([])
|
|
43
44
|
|
|
44
45
|
const wallet = useWallet()
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
wallet.getEnableRBF().then(enableRBF => {
|
|
48
|
+
setEnableRBF(enableRBF)
|
|
49
|
+
})
|
|
50
|
+
}, [wallet])
|
|
51
|
+
|
|
45
52
|
useEffect(() => {
|
|
46
53
|
wallet.getInscriptionUtxoDetail(inscription.inscriptionId).then(v => {
|
|
47
54
|
setInscriptions(v.inscriptions)
|
|
48
55
|
})
|
|
49
56
|
}, [])
|
|
50
57
|
|
|
58
|
+
const onEnableRBFChange = (value: boolean) => {
|
|
59
|
+
setEnableRBF(value)
|
|
60
|
+
wallet.setEnableRBF(value)
|
|
61
|
+
}
|
|
62
|
+
|
|
51
63
|
const minOutputValue = useMemo(() => {
|
|
52
64
|
if (toInfo.address) {
|
|
53
65
|
return getAddressUtxoDust(toInfo.address)
|
|
@@ -110,6 +122,7 @@ export function useSendOrdinalsInscriptionScreenLogic() {
|
|
|
110
122
|
inscriptionId: inscription.inscriptionId,
|
|
111
123
|
feeRate,
|
|
112
124
|
outputValue,
|
|
125
|
+
enableRBF,
|
|
113
126
|
})
|
|
114
127
|
.then(toSignData => {
|
|
115
128
|
nav.navigate('TxConfirmScreen', { toSignData })
|
|
@@ -125,6 +138,8 @@ export function useSendOrdinalsInscriptionScreenLogic() {
|
|
|
125
138
|
onAddressInputChange,
|
|
126
139
|
toInfo,
|
|
127
140
|
outputValue,
|
|
141
|
+
enableRBF,
|
|
142
|
+
setEnableRBF: onEnableRBFChange,
|
|
128
143
|
minOutputValue,
|
|
129
144
|
defaultOutputValue,
|
|
130
145
|
setOutputValue,
|
|
@@ -2,7 +2,7 @@ import { bnUtils } from '@unisat/base-utils'
|
|
|
2
2
|
import { Inscription } from '@unisat/wallet-shared'
|
|
3
3
|
import BigNumber from 'bignumber.js'
|
|
4
4
|
import { useEffect, useMemo, useState } from 'react'
|
|
5
|
-
import { useI18n, useNavigation, useTools } from 'src/context'
|
|
5
|
+
import { useI18n, useNavigation, useTools, useWallet } from 'src/context'
|
|
6
6
|
import {
|
|
7
7
|
useCurrentAccount,
|
|
8
8
|
useFeeRateBar,
|
|
@@ -42,6 +42,7 @@ export function useSendRunesScreenLogic() {
|
|
|
42
42
|
|
|
43
43
|
const currentAccount = useCurrentAccount()
|
|
44
44
|
const [outputValue, setOutputValue] = useState(defaultOutputValue)
|
|
45
|
+
const [enableRBF, setEnableRBF] = useState(true)
|
|
45
46
|
const minOutputValue = useMemo(() => {
|
|
46
47
|
if (toInfo.address) {
|
|
47
48
|
const dust1 = getAddressUtxoDust(currentAccount.address)
|
|
@@ -53,6 +54,7 @@ export function useSendRunesScreenLogic() {
|
|
|
53
54
|
}, [toInfo.address, currentAccount.address])
|
|
54
55
|
|
|
55
56
|
const fetchUtxos = useFetchUtxosCallback()
|
|
57
|
+
const wallet = useWallet()
|
|
56
58
|
|
|
57
59
|
const fetchAssetUtxosRunes = useFetchAssetUtxosRunesCallback()
|
|
58
60
|
const tools = useTools()
|
|
@@ -83,6 +85,12 @@ export function useSendRunesScreenLogic() {
|
|
|
83
85
|
|
|
84
86
|
const { feeRate } = useFeeRateBar()
|
|
85
87
|
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
wallet.getEnableRBF().then(enableRBF => {
|
|
90
|
+
setEnableRBF(enableRBF)
|
|
91
|
+
})
|
|
92
|
+
}, [wallet])
|
|
93
|
+
|
|
86
94
|
useEffect(() => {
|
|
87
95
|
setError('')
|
|
88
96
|
setDisabled(true)
|
|
@@ -130,6 +138,12 @@ export function useSendRunesScreenLogic() {
|
|
|
130
138
|
const onClickBack = () => {
|
|
131
139
|
nav.goBack()
|
|
132
140
|
}
|
|
141
|
+
|
|
142
|
+
const onEnableRBFChange = (value: boolean) => {
|
|
143
|
+
setEnableRBF(value)
|
|
144
|
+
wallet.setEnableRBF(value)
|
|
145
|
+
}
|
|
146
|
+
|
|
133
147
|
const onClickNext = () => {
|
|
134
148
|
const runeAmount = bnUtils.fromDecimalAmount(inputAmount, runeInfo.divisibility)
|
|
135
149
|
prepareSendRunes({
|
|
@@ -138,6 +152,7 @@ export function useSendRunesScreenLogic() {
|
|
|
138
152
|
runeAmount: runeAmount,
|
|
139
153
|
outputValue: outputValue,
|
|
140
154
|
feeRate,
|
|
155
|
+
enableRBF,
|
|
141
156
|
})
|
|
142
157
|
.then(toSignData => {
|
|
143
158
|
nav.navigate('TxConfirmScreen', { toSignData })
|
|
@@ -163,6 +178,8 @@ export function useSendRunesScreenLogic() {
|
|
|
163
178
|
defaultOutputValue,
|
|
164
179
|
minOutputValue,
|
|
165
180
|
setOutputValue,
|
|
181
|
+
enableRBF,
|
|
182
|
+
setEnableRBF: onEnableRBFChange,
|
|
166
183
|
t,
|
|
167
184
|
|
|
168
185
|
// actions
|
|
@@ -27,6 +27,7 @@ export function useSplitOrdinalsInscriptionScreenLogic() {
|
|
|
27
27
|
const account = useCurrentAccount()
|
|
28
28
|
const minOutputValue = getAddressUtxoDust(account.address)
|
|
29
29
|
const [outputValue, setOutputValue] = useState(defaultOutputValue)
|
|
30
|
+
const [enableRBF, setEnableRBF] = useState(true)
|
|
30
31
|
|
|
31
32
|
const { feeRate } = useFeeRateBar()
|
|
32
33
|
|
|
@@ -34,12 +35,23 @@ export function useSplitOrdinalsInscriptionScreenLogic() {
|
|
|
34
35
|
|
|
35
36
|
const [splitedCount, setSplitedCount] = useState(0)
|
|
36
37
|
const wallet = useWallet()
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
wallet.getEnableRBF().then(enableRBF => {
|
|
40
|
+
setEnableRBF(enableRBF)
|
|
41
|
+
})
|
|
42
|
+
}, [wallet])
|
|
43
|
+
|
|
37
44
|
useEffect(() => {
|
|
38
45
|
wallet.getInscriptionUtxoDetail(props.inscription.inscriptionId).then(v => {
|
|
39
46
|
setInscriptions(v.inscriptions)
|
|
40
47
|
})
|
|
41
48
|
}, [])
|
|
42
49
|
|
|
50
|
+
const onEnableRBFChange = (value: boolean) => {
|
|
51
|
+
setEnableRBF(value)
|
|
52
|
+
wallet.setEnableRBF(value)
|
|
53
|
+
}
|
|
54
|
+
|
|
43
55
|
useEffect(() => {
|
|
44
56
|
setDisabled(true)
|
|
45
57
|
setError('')
|
|
@@ -71,7 +83,7 @@ export function useSplitOrdinalsInscriptionScreenLogic() {
|
|
|
71
83
|
}
|
|
72
84
|
|
|
73
85
|
const onClickNext = () => {
|
|
74
|
-
createSplitTx({ inscriptionId: inscription.inscriptionId, feeRate, outputValue })
|
|
86
|
+
createSplitTx({ inscriptionId: inscription.inscriptionId, feeRate, outputValue, enableRBF })
|
|
75
87
|
.then(toSignData => {
|
|
76
88
|
nav.navigate('TxConfirmScreen', { toSignData })
|
|
77
89
|
})
|
|
@@ -86,6 +98,8 @@ export function useSplitOrdinalsInscriptionScreenLogic() {
|
|
|
86
98
|
inscriptions,
|
|
87
99
|
minOutputValue,
|
|
88
100
|
splitedCount,
|
|
101
|
+
enableRBF,
|
|
102
|
+
setEnableRBF: onEnableRBFChange,
|
|
89
103
|
error,
|
|
90
104
|
disabled,
|
|
91
105
|
onOutputValueChange,
|