@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.
Files changed (222) hide show
  1. package/lib/actions/global.d.ts +2 -0
  2. package/lib/actions/global.d.ts.map +1 -0
  3. package/lib/context/ApprovalContext.d.ts +9 -0
  4. package/lib/context/ApprovalContext.d.ts.map +1 -0
  5. package/lib/context/DeviceContext.d.ts +17 -0
  6. package/lib/context/DeviceContext.d.ts.map +1 -0
  7. package/lib/context/I18nContext.d.ts +13 -0
  8. package/lib/context/I18nContext.d.ts.map +1 -0
  9. package/lib/context/NavigationContext.d.ts +218 -0
  10. package/lib/context/NavigationContext.d.ts.map +1 -0
  11. package/lib/context/PriceContext.d.ts +13 -0
  12. package/lib/context/PriceContext.d.ts.map +1 -0
  13. package/lib/context/StorageContext.d.ts +60 -0
  14. package/lib/context/StorageContext.d.ts.map +1 -0
  15. package/lib/context/ToolsContext.d.ts +17 -0
  16. package/lib/context/ToolsContext.d.ts.map +1 -0
  17. package/lib/context/WalletContext.d.ts +493 -0
  18. package/lib/context/WalletContext.d.ts.map +1 -0
  19. package/lib/context/index.d.ts +9 -0
  20. package/lib/context/index.d.ts.map +1 -0
  21. package/lib/hooks/accounts.d.ts +34 -0
  22. package/lib/hooks/accounts.d.ts.map +1 -0
  23. package/lib/hooks/base.d.ts +14 -0
  24. package/lib/hooks/base.d.ts.map +1 -0
  25. package/lib/hooks/browser.d.ts +32 -0
  26. package/lib/hooks/browser.d.ts.map +1 -0
  27. package/lib/hooks/discovery.d.ts +17 -0
  28. package/lib/hooks/discovery.d.ts.map +1 -0
  29. package/lib/hooks/global.d.ts +43 -0
  30. package/lib/hooks/global.d.ts.map +1 -0
  31. package/lib/hooks/index.d.ts +10 -0
  32. package/lib/hooks/index.d.ts.map +1 -0
  33. package/lib/hooks/keyrings.d.ts +5 -0
  34. package/lib/hooks/keyrings.d.ts.map +1 -0
  35. package/lib/hooks/settings.d.ts +43 -0
  36. package/lib/hooks/settings.d.ts.map +1 -0
  37. package/lib/hooks/transactions.d.ts +67 -0
  38. package/lib/hooks/transactions.d.ts.map +1 -0
  39. package/lib/hooks/ui.d.ts +112 -0
  40. package/lib/hooks/ui.d.ts.map +1 -0
  41. package/lib/index.d.mts +79 -18
  42. package/lib/index.d.ts +31 -2758
  43. package/lib/index.d.ts.map +1 -0
  44. package/lib/index.js +291 -78
  45. package/lib/index.js.map +1 -1
  46. package/lib/index.mjs +289 -80
  47. package/lib/index.mjs.map +1 -1
  48. package/lib/reducers/accounts.d.ts +49 -0
  49. package/lib/reducers/accounts.d.ts.map +1 -0
  50. package/lib/reducers/browser.d.ts +49 -0
  51. package/lib/reducers/browser.d.ts.map +1 -0
  52. package/lib/reducers/discovery.d.ts +22 -0
  53. package/lib/reducers/discovery.d.ts.map +1 -0
  54. package/lib/reducers/global.d.ts +35 -0
  55. package/lib/reducers/global.d.ts.map +1 -0
  56. package/lib/reducers/index.d.ts +9 -0
  57. package/lib/reducers/index.d.ts.map +1 -0
  58. package/lib/reducers/keyrings.d.ts +10 -0
  59. package/lib/reducers/keyrings.d.ts.map +1 -0
  60. package/lib/reducers/settings.d.ts +16 -0
  61. package/lib/reducers/settings.d.ts.map +1 -0
  62. package/lib/reducers/transactions.d.ts +61 -0
  63. package/lib/reducers/transactions.d.ts.map +1 -0
  64. package/lib/reducers/ui.d.ts +55 -0
  65. package/lib/reducers/ui.d.ts.map +1 -0
  66. package/lib/types/index.d.mts +6 -2
  67. package/lib/types/index.d.ts +3 -30
  68. package/lib/types/index.d.ts.map +1 -0
  69. package/lib/types/index.js +7 -1
  70. package/lib/types/index.js.map +1 -1
  71. package/lib/types/index.mjs +7 -2
  72. package/lib/types/index.mjs.map +1 -1
  73. package/lib/types/ui.d.ts +31 -0
  74. package/lib/types/ui.d.ts.map +1 -0
  75. package/lib/ui-hooks/index.d.ts +55 -0
  76. package/lib/ui-hooks/index.d.ts.map +1 -0
  77. package/lib/ui-hooks/useActionOverviewSectionLogic.d.ts +12 -0
  78. package/lib/ui-hooks/useActionOverviewSectionLogic.d.ts.map +1 -0
  79. package/lib/ui-hooks/useAddressTypeScreenLogic.d.ts +19 -0
  80. package/lib/ui-hooks/useAddressTypeScreenLogic.d.ts.map +1 -0
  81. package/lib/ui-hooks/useAlkanesBalanceCardLogic.d.ts +19 -0
  82. package/lib/ui-hooks/useAlkanesBalanceCardLogic.d.ts.map +1 -0
  83. package/lib/ui-hooks/useAlkanesCollectionListLogic.d.ts +11 -0
  84. package/lib/ui-hooks/useAlkanesCollectionListLogic.d.ts.map +1 -0
  85. package/lib/ui-hooks/useAlkanesListLogic.d.ts +14 -0
  86. package/lib/ui-hooks/useAlkanesListLogic.d.ts.map +1 -0
  87. package/lib/ui-hooks/useAlkanesNFTListLogic.d.ts +11 -0
  88. package/lib/ui-hooks/useAlkanesNFTListLogic.d.ts.map +1 -0
  89. package/lib/ui-hooks/useAlkanesNFTScreenLogic.d.ts +9 -0
  90. package/lib/ui-hooks/useAlkanesNFTScreenLogic.d.ts.map +1 -0
  91. package/lib/ui-hooks/useAlkanesTokenScreenLogic.d.ts +22 -0
  92. package/lib/ui-hooks/useAlkanesTokenScreenLogic.d.ts.map +1 -0
  93. package/lib/ui-hooks/useAmountInputLogic.d.ts +22 -0
  94. package/lib/ui-hooks/useAmountInputLogic.d.ts.map +1 -0
  95. package/lib/ui-hooks/useAnnouncementCardLogic.d.ts +11 -0
  96. package/lib/ui-hooks/useAnnouncementCardLogic.d.ts.map +1 -0
  97. package/lib/ui-hooks/useBRC20BalanceCardLogic.d.ts +26 -0
  98. package/lib/ui-hooks/useBRC20BalanceCardLogic.d.ts.map +1 -0
  99. package/lib/ui-hooks/useBRC20InscribeTransferLogic.d.ts +103 -0
  100. package/lib/ui-hooks/useBRC20InscribeTransferLogic.d.ts.map +1 -0
  101. package/lib/ui-hooks/useBRC20ListLogic.d.ts +14 -0
  102. package/lib/ui-hooks/useBRC20ListLogic.d.ts.map +1 -0
  103. package/lib/ui-hooks/useBRC20ProgListLogic.d.ts +14 -0
  104. package/lib/ui-hooks/useBRC20ProgListLogic.d.ts.map +1 -0
  105. package/lib/ui-hooks/useBRC20SendScreenLogic.d.ts +67 -0
  106. package/lib/ui-hooks/useBRC20SendScreenLogic.d.ts.map +1 -0
  107. package/lib/ui-hooks/useBRC20SingleStepScreenLogic.d.ts +36 -0
  108. package/lib/ui-hooks/useBRC20SingleStepScreenLogic.d.ts.map +1 -0
  109. package/lib/ui-hooks/useBRC20TokenScreenLogic.d.ts +75 -0
  110. package/lib/ui-hooks/useBRC20TokenScreenLogic.d.ts.map +1 -0
  111. package/lib/ui-hooks/useBalanceCardLogic.d.ts +26 -0
  112. package/lib/ui-hooks/useBalanceCardLogic.d.ts.map +1 -0
  113. package/lib/ui-hooks/useBtcDisplayLogic.d.ts +5 -0
  114. package/lib/ui-hooks/useBtcDisplayLogic.d.ts.map +1 -0
  115. package/lib/ui-hooks/useCAT20BalanceCardLogic.d.ts +20 -0
  116. package/lib/ui-hooks/useCAT20BalanceCardLogic.d.ts.map +1 -0
  117. package/lib/ui-hooks/useCAT20ListLogic.d.ts +14 -0
  118. package/lib/ui-hooks/useCAT20ListLogic.d.ts.map +1 -0
  119. package/lib/ui-hooks/useCAT20TokenScreenLogic.d.ts +19 -0
  120. package/lib/ui-hooks/useCAT20TokenScreenLogic.d.ts.map +1 -0
  121. package/lib/ui-hooks/useCAT721ListLogic.d.ts +11 -0
  122. package/lib/ui-hooks/useCAT721ListLogic.d.ts.map +1 -0
  123. package/lib/ui-hooks/useCAT721NFTScreenLogic.d.ts +9 -0
  124. package/lib/ui-hooks/useCAT721NFTScreenLogic.d.ts.map +1 -0
  125. package/lib/ui-hooks/useCreatePasswordScreenLogic.d.ts +27 -0
  126. package/lib/ui-hooks/useCreatePasswordScreenLogic.d.ts.map +1 -0
  127. package/lib/ui-hooks/useCreateWalletLogicImportWordsStep.d.ts +78 -0
  128. package/lib/ui-hooks/useCreateWalletLogicImportWordsStep.d.ts.map +1 -0
  129. package/lib/ui-hooks/useEditAccountNameScreenLogic.d.ts +18 -0
  130. package/lib/ui-hooks/useEditAccountNameScreenLogic.d.ts.map +1 -0
  131. package/lib/ui-hooks/useEditContactScreenLogic.d.ts +24 -0
  132. package/lib/ui-hooks/useEditContactScreenLogic.d.ts.map +1 -0
  133. package/lib/ui-hooks/useEditWalletNameScreenLogic.d.ts +15 -0
  134. package/lib/ui-hooks/useEditWalletNameScreenLogic.d.ts.map +1 -0
  135. package/lib/ui-hooks/useExportMnemonicsScreenLogic.d.ts +18 -0
  136. package/lib/ui-hooks/useExportMnemonicsScreenLogic.d.ts.map +1 -0
  137. package/lib/ui-hooks/useExportPrivateKeyScreenLogic.d.ts +17 -0
  138. package/lib/ui-hooks/useExportPrivateKeyScreenLogic.d.ts.map +1 -0
  139. package/lib/ui-hooks/useFeeRateBarLogic.d.ts +34 -0
  140. package/lib/ui-hooks/useFeeRateBarLogic.d.ts.map +1 -0
  141. package/lib/ui-hooks/useInfiniteList.d.ts +19 -0
  142. package/lib/ui-hooks/useInfiniteList.d.ts.map +1 -0
  143. package/lib/ui-hooks/useInscriptionListLogic.d.ts +11 -0
  144. package/lib/ui-hooks/useInscriptionListLogic.d.ts.map +1 -0
  145. package/lib/ui-hooks/useLockTimePageLogic.d.ts +11 -0
  146. package/lib/ui-hooks/useLockTimePageLogic.d.ts.map +1 -0
  147. package/lib/ui-hooks/useNotificationsLogic.d.ts +14 -0
  148. package/lib/ui-hooks/useNotificationsLogic.d.ts.map +1 -0
  149. package/lib/ui-hooks/useOrdinalsInscriptionScreenLogic.d.ts +27 -0
  150. package/lib/ui-hooks/useOrdinalsInscriptionScreenLogic.d.ts.map +1 -0
  151. package/lib/ui-hooks/useRunesBalanceCardLogic.d.ts +19 -0
  152. package/lib/ui-hooks/useRunesBalanceCardLogic.d.ts.map +1 -0
  153. package/lib/ui-hooks/useRunesListLogic.d.ts +14 -0
  154. package/lib/ui-hooks/useRunesListLogic.d.ts.map +1 -0
  155. package/lib/ui-hooks/useRunesTokenScreenLogic.d.ts +22 -0
  156. package/lib/ui-hooks/useRunesTokenScreenLogic.d.ts.map +1 -0
  157. package/lib/ui-hooks/useSecurityCardLogic.d.ts +1 -0
  158. package/lib/ui-hooks/useSecurityCardLogic.d.ts.map +1 -0
  159. package/lib/ui-hooks/useSendAlkanesNFTScreenLogic.d.ts +32 -0
  160. package/lib/ui-hooks/useSendAlkanesNFTScreenLogic.d.ts.map +1 -0
  161. package/lib/ui-hooks/useSendAlkanesScreenLogic.d.ts +37 -0
  162. package/lib/ui-hooks/useSendAlkanesScreenLogic.d.ts.map +1 -0
  163. package/lib/ui-hooks/useSendCAT20ScreenLogic.d.ts +44 -0
  164. package/lib/ui-hooks/useSendCAT20ScreenLogic.d.ts.map +1 -0
  165. package/lib/ui-hooks/useSendCAT721ScreenLogic.d.ts +40 -0
  166. package/lib/ui-hooks/useSendCAT721ScreenLogic.d.ts.map +1 -0
  167. package/lib/ui-hooks/useSendOrdinalsInscriptionScreenLogic.d.ts +22 -0
  168. package/lib/ui-hooks/useSendOrdinalsInscriptionScreenLogic.d.ts.map +1 -0
  169. package/lib/ui-hooks/useSendRunesScreenLogic.d.ts +30 -0
  170. package/lib/ui-hooks/useSendRunesScreenLogic.d.ts.map +1 -0
  171. package/lib/ui-hooks/useSettingsTabScreenLogic.d.ts +72 -0
  172. package/lib/ui-hooks/useSettingsTabScreenLogic.d.ts.map +1 -0
  173. package/lib/ui-hooks/useSignMessageLogic.d.ts +54 -0
  174. package/lib/ui-hooks/useSignMessageLogic.d.ts.map +1 -0
  175. package/lib/ui-hooks/useSignPsbtLogic.d.ts +82 -0
  176. package/lib/ui-hooks/useSignPsbtLogic.d.ts.map +1 -0
  177. package/lib/ui-hooks/useSplitOrdinalsInscriptionScreenLogic.d.ts +15 -0
  178. package/lib/ui-hooks/useSplitOrdinalsInscriptionScreenLogic.d.ts.map +1 -0
  179. package/lib/ui-hooks/useTxConfirmScreenLogic.d.ts +8 -0
  180. package/lib/ui-hooks/useTxConfirmScreenLogic.d.ts.map +1 -0
  181. package/lib/ui-hooks/useTxCreateScreenLogic.d.ts +28 -0
  182. package/lib/ui-hooks/useTxCreateScreenLogic.d.ts.map +1 -0
  183. package/lib/ui-hooks/useTxFailScreenLogic.d.ts +7 -0
  184. package/lib/ui-hooks/useTxFailScreenLogic.d.ts.map +1 -0
  185. package/lib/ui-hooks/useTxSuccessScreenLogic.d.ts +8 -0
  186. package/lib/ui-hooks/useTxSuccessScreenLogic.d.ts.map +1 -0
  187. package/lib/updater/accounts.d.ts +2 -0
  188. package/lib/updater/accounts.d.ts.map +1 -0
  189. package/lib/updater/index.d.ts +2 -0
  190. package/lib/updater/index.d.ts.map +1 -0
  191. package/lib/utils/bitcoin-utils.d.ts +7 -0
  192. package/lib/utils/bitcoin-utils.d.ts.map +1 -0
  193. package/lib/utils/eventBus.d.ts +12 -0
  194. package/lib/utils/eventBus.d.ts.map +1 -0
  195. package/lib/utils/password-utils.d.ts +12 -0
  196. package/lib/utils/password-utils.d.ts.map +1 -0
  197. package/lib/utils/ui-utils.d.ts +4 -0
  198. package/lib/utils/ui-utils.d.ts.map +1 -0
  199. package/package.json +3 -3
  200. package/src/context/WalletContext.tsx +56 -23
  201. package/src/hooks/settings.ts +10 -0
  202. package/src/hooks/transactions.ts +23 -2
  203. package/src/hooks/ui.ts +9 -1
  204. package/src/reducers/accounts.ts +3 -0
  205. package/src/reducers/ui.ts +21 -0
  206. package/src/types/ui.ts +6 -1
  207. package/src/ui-hooks/useAlkanesTokenScreenLogic.ts +8 -0
  208. package/src/ui-hooks/useBRC20InscribeTransferLogic.ts +30 -10
  209. package/src/ui-hooks/useBRC20ListLogic.ts +6 -2
  210. package/src/ui-hooks/useBRC20ProgListLogic.ts +7 -3
  211. package/src/ui-hooks/useBRC20SendScreenLogic.ts +19 -6
  212. package/src/ui-hooks/useBRC20TokenScreenLogic.ts +44 -24
  213. package/src/ui-hooks/useCAT20TokenScreenLogic.ts +5 -0
  214. package/src/ui-hooks/useEditAccountNameScreenLogic.ts +4 -4
  215. package/src/ui-hooks/useEditWalletNameScreenLogic.ts +5 -3
  216. package/src/ui-hooks/useRunesTokenScreenLogic.ts +7 -0
  217. package/src/ui-hooks/useSendAlkanesNFTScreenLogic.ts +24 -2
  218. package/src/ui-hooks/useSendAlkanesScreenLogic.ts +17 -1
  219. package/src/ui-hooks/useSendOrdinalsInscriptionScreenLogic.ts +15 -0
  220. package/src/ui-hooks/useSendRunesScreenLogic.ts +18 -1
  221. package/src/ui-hooks/useSplitOrdinalsInscriptionScreenLogic.ts +15 -1
  222. package/src/ui-hooks/useTxCreateScreenLogic.ts +17 -1
@@ -17,11 +17,12 @@ import {
17
17
  AlkanesInfo,
18
18
  Announcement,
19
19
  AppInfo,
20
+ AppExtra,
20
21
  AppSummary,
22
+ BRC20HistoryItem,
21
23
  BabylonAddressSummary,
22
24
  BitcoinBalance,
23
25
  BitcoinBalanceV2,
24
- BRC20HistoryItem,
25
26
  BtcChannelItem,
26
27
  CAT20Balance,
27
28
  CAT20MergeOrder,
@@ -32,27 +33,27 @@ import {
32
33
  CosmosSignDataType,
33
34
  DecodedPsbt,
34
35
  DummyTxType,
35
- LocalPsbtSummary,
36
36
  FeeSummary,
37
37
  InscribeOrder,
38
38
  Inscription,
39
39
  InscriptionSummary,
40
+ LocalPsbtSummary,
40
41
  RateUsStatus,
41
42
  RuneBalance,
43
+ SignPsbtOptions,
42
44
  SignedData,
43
45
  SignedMessage,
44
- SignPsbtOptions,
45
46
  StoredNotification,
46
47
  TickPriceItem,
47
- TokenBalance,
48
- TokenTransfer,
49
48
  ToSignData,
50
49
  ToSignInput,
51
50
  ToSignMessage,
51
+ TokenBalance,
52
+ TokenTransfer,
52
53
  TxHistoryItem,
53
- UnspentOutput,
54
54
  UTXO,
55
55
  UTXO_Detail,
56
+ UnspentOutput,
56
57
  VersionDetail,
57
58
  WalletConfig,
58
59
  WalletKeyring,
@@ -243,6 +244,7 @@ export interface WalletController {
243
244
  amount: number
244
245
  btcUtxos: UnspentOutput[]
245
246
  feeRate: number
247
+ enableRBF?: boolean
246
248
  memo?: string
247
249
  memos?: string[]
248
250
  }): Promise<ToSignData>
@@ -251,6 +253,7 @@ export interface WalletController {
251
253
  to: string
252
254
  btcUtxos: UnspentOutput[]
253
255
  feeRate: number
256
+ enableRBF?: boolean
254
257
  }): Promise<ToSignData>
255
258
 
256
259
  createSendInscriptionPsbt(data: {
@@ -259,6 +262,7 @@ export interface WalletController {
259
262
  feeRate: number
260
263
  outputValue?: number
261
264
  btcUtxos: UnspentOutput[]
265
+ enableRBF?: boolean
262
266
  }): Promise<ToSignData>
263
267
 
264
268
  createSendMultipleInscriptionsPsbt(data: {
@@ -266,6 +270,7 @@ export interface WalletController {
266
270
  inscriptionIds: string[]
267
271
  feeRate: number
268
272
  btcUtxos: UnspentOutput[]
273
+ enableRBF?: boolean
269
274
  }): Promise<ToSignData>
270
275
 
271
276
  createSplitInscriptionPsbt(data: {
@@ -273,6 +278,7 @@ export interface WalletController {
273
278
  feeRate: number
274
279
  outputValue: number
275
280
  btcUtxos: UnspentOutput[]
281
+ enableRBF?: boolean
276
282
  }): Promise<ToSignData>
277
283
 
278
284
  pushTx(rawtx: string): Promise<string>
@@ -339,24 +345,39 @@ export interface WalletController {
339
345
  pageSize: number
340
346
  ): Promise<{ currentPage: number; pageSize: number; total: number; list: Inscription[] }>
341
347
 
342
- getBRC20List(
343
- address: string,
344
- currentPage: number,
348
+ getBRC20List({
349
+ address,
350
+ currentPage,
351
+ pageSize,
352
+ }: {
353
+ address: string
354
+ currentPage: number
345
355
  pageSize: number
346
- ): Promise<{ currentPage: number; pageSize: number; total: number; list: TokenBalance[] }>
356
+ }): Promise<{ currentPage: number; pageSize: number; total: number; list: TokenBalance[] }>
347
357
 
348
- getBRC20ProgList(
349
- address: string,
350
- currentPage: number,
358
+ getBRC20ProgList({
359
+ address,
360
+ currentPage,
361
+ pageSize,
362
+ }: {
363
+ address: string
364
+ currentPage: number
351
365
  pageSize: number
352
- ): Promise<{ currentPage: number; pageSize: number; total: number; list: TokenBalance[] }>
353
-
354
- getBRC20TransferableList(
355
- address: string,
356
- ticker: string,
357
- currentPage: number,
366
+ }): Promise<{ currentPage: number; pageSize: number; total: number; list: TokenBalance[] }>
367
+
368
+ getBRC20TransferableList({
369
+ address,
370
+ ticker,
371
+ tickerHex,
372
+ currentPage,
373
+ pageSize,
374
+ }: {
375
+ address: string
376
+ ticker: string
377
+ tickerHex: string
378
+ currentPage: number
358
379
  pageSize: number
359
- ): Promise<{ currentPage: number; pageSize: number; total: number; list: TokenTransfer[] }>
380
+ }): Promise<{ currentPage: number; pageSize: number; total: number; list: TokenTransfer[] }>
360
381
 
361
382
  getOrdinalsInscriptions(
362
383
  address: string,
@@ -364,7 +385,13 @@ export interface WalletController {
364
385
  pageSize: number
365
386
  ): Promise<{ currentPage: number; pageSize: number; total: number; list: Inscription[] }>
366
387
 
367
- getBRC20Summary(address: string, ticker: string): Promise<AddressTokenSummary>
388
+ getBRC20Summary({
389
+ address,
390
+ ticker,
391
+ }: {
392
+ address: string
393
+ ticker: string
394
+ }): Promise<AddressTokenSummary>
368
395
 
369
396
  expireUICachedData(address: string): Promise<void>
370
397
 
@@ -447,6 +474,7 @@ export interface WalletController {
447
474
  btcUtxos?: UnspentOutput[]
448
475
  assetUtxos?: UnspentOutput[]
449
476
  outputValue?: number
477
+ enableRBF?: boolean
450
478
  }): Promise<ToSignData>
451
479
 
452
480
  setAutoLockTimeId(timeId: number): Promise<void>
@@ -505,6 +533,7 @@ export interface WalletController {
505
533
  getMergeCAT20Status(version: 'v1' | 'v2', mergeId: string): Promise<any>
506
534
 
507
535
  getAppList(): Promise<{ tab: string; items: AppInfo[] }[]>
536
+ getAppExtra(id: string | number, locale?: string): Promise<AppExtra>
508
537
  getBannerList(): Promise<{ id: string; img: string; link: string }[]>
509
538
  getBlockActiveInfo(): Promise<{ allTransactions: number; allAddrs: number }>
510
539
 
@@ -613,7 +642,8 @@ export interface WalletController {
613
642
 
614
643
  createSendBTCOffsetPsbt(
615
644
  tos: { address: string; satoshis: number }[],
616
- feeRate: number
645
+ feeRate: number,
646
+ enableRBF?: boolean
617
647
  ): Promise<ToSignData>
618
648
 
619
649
  getAlkanesList(
@@ -636,6 +666,7 @@ export interface WalletController {
636
666
  amount: string
637
667
  feeRate: number
638
668
  type: 'ft' | 'nft'
669
+ enableRBF?: boolean
639
670
  }): Promise<ToSignData>
640
671
 
641
672
  getAlkanesCollectionList(
@@ -679,6 +710,8 @@ export interface WalletController {
679
710
 
680
711
  getAcceptLowFeeMode(): Promise<boolean>
681
712
  setAcceptLowFeeMode(accept: boolean): Promise<void>
713
+ getEnableRBF(): Promise<boolean>
714
+ setEnableRBF(enableRBF: boolean): Promise<void>
682
715
 
683
716
  createTmpKeyringWithPublicKey(publicKey: string, addressType: AddressType): Promise<WalletKeyring>
684
717
 
@@ -711,4 +744,4 @@ const useWallet = () => {
711
744
  return wallet
712
745
  }
713
746
 
714
- export { useWallet, WalletProvider }
747
+ export { WalletProvider, useWallet }
@@ -162,6 +162,16 @@ export function useBRC20TokenInfoExplorerUrl(ticker: string) {
162
162
  return `${chain.unisatExplorerUrl}/brc20/${encodeURIComponent(ticker)}`
163
163
  }
164
164
 
165
+ export function useRunesTokenInfoExplorerUrl(runeId: string) {
166
+ const chain = useChain()!
167
+ return `${chain.unisatExplorerUrl}/runes/detail/${encodeURIComponent(runeId)}`
168
+ }
169
+
170
+ export function useAlkanesTokenInfoExplorerUrl(alkaneId: string) {
171
+ const chain = useChain()!
172
+ return `${chain.unisatExplorerUrl}/alkanes/detail/${encodeURIComponent(alkaneId)}`
173
+ }
174
+
165
175
  export function useUnisatWebsite() {
166
176
  const chainType = useChainType()
167
177
  return CHAINS_MAP[chainType]!.unisatUrl
@@ -35,6 +35,7 @@ export function usePrepareSendBTCCallback() {
35
35
  memo,
36
36
  memos,
37
37
  disableAutoAdjust,
38
+ enableRBF,
38
39
  }: {
39
40
  toAddressInfo: ToAddressInfo
40
41
  toAmount: number
@@ -42,6 +43,7 @@ export function usePrepareSendBTCCallback() {
42
43
  memo?: string
43
44
  memos?: string[]
44
45
  disableAutoAdjust?: boolean
46
+ enableRBF?: boolean
45
47
  }) => {
46
48
  let _utxos: UnspentOutput[] = utxos
47
49
  if (_utxos.length === 0) {
@@ -65,6 +67,7 @@ export function usePrepareSendBTCCallback() {
65
67
  to: toAddressInfo.address,
66
68
  btcUtxos: _utxos,
67
69
  feeRate,
70
+ enableRBF,
68
71
  })
69
72
  } else {
70
73
  res = await wallet.createSendBTCPsbt({
@@ -72,6 +75,7 @@ export function usePrepareSendBTCCallback() {
72
75
  amount: toAmount,
73
76
  btcUtxos: _utxos,
74
77
  feeRate,
78
+ enableRBF,
75
79
  memo: memo!,
76
80
  memos: memos!,
77
81
  })
@@ -91,10 +95,12 @@ export function usePrepareSendBypassHeadOffsetsCallback() {
91
95
  toAddressInfo,
92
96
  toAmount,
93
97
  feeRate,
98
+ enableRBF,
94
99
  }: {
95
100
  toAddressInfo: ToAddressInfo
96
101
  toAmount: number
97
102
  feeRate: number
103
+ enableRBF?: boolean
98
104
  }) => {
99
105
  const res = await wallet.createSendBTCOffsetPsbt(
100
106
  [
@@ -103,7 +109,8 @@ export function usePrepareSendBypassHeadOffsetsCallback() {
103
109
  satoshis: toAmount,
104
110
  },
105
111
  ],
106
- feeRate
112
+ feeRate,
113
+ enableRBF
107
114
  )
108
115
  return res
109
116
  },
@@ -166,11 +173,13 @@ export function usePrepareSendOrdinalsInscriptionCallback() {
166
173
  inscriptionId,
167
174
  feeRate,
168
175
  outputValue,
176
+ enableRBF,
169
177
  }: {
170
178
  toAddressInfo: ToAddressInfo
171
179
  inscriptionId: string
172
180
  feeRate?: number
173
181
  outputValue?: number
182
+ enableRBF?: boolean
174
183
  }) => {
175
184
  if (!feeRate) {
176
185
  const summary = await wallet.getFeeSummary()
@@ -188,6 +197,7 @@ export function usePrepareSendOrdinalsInscriptionCallback() {
188
197
  feeRate,
189
198
  outputValue: outputValue!,
190
199
  btcUtxos,
200
+ enableRBF,
191
201
  })
192
202
 
193
203
  return toSignData
@@ -207,10 +217,12 @@ export function usePrepareSendOrdinalsInscriptionsCallback() {
207
217
  toAddressInfo,
208
218
  inscriptionIds,
209
219
  feeRate,
220
+ enableRBF,
210
221
  }: {
211
222
  toAddressInfo: ToAddressInfo
212
223
  inscriptionIds: string[]
213
224
  feeRate?: number
225
+ enableRBF?: boolean
214
226
  }) => {
215
227
  if (!feeRate) {
216
228
  const summary = await wallet.getFeeSummary()
@@ -226,6 +238,7 @@ export function usePrepareSendOrdinalsInscriptionsCallback() {
226
238
  inscriptionIds,
227
239
  feeRate,
228
240
  btcUtxos,
241
+ enableRBF,
229
242
  })
230
243
 
231
244
  return res
@@ -246,10 +259,12 @@ export function useCreateSplitTxCallback() {
246
259
  inscriptionId,
247
260
  feeRate,
248
261
  outputValue,
262
+ enableRBF,
249
263
  }: {
250
264
  inscriptionId: string
251
265
  feeRate: number
252
266
  outputValue: number
267
+ enableRBF?: boolean
253
268
  }) => {
254
269
  let btcUtxos = utxos
255
270
  if (btcUtxos.length === 0) {
@@ -261,6 +276,7 @@ export function useCreateSplitTxCallback() {
261
276
  feeRate,
262
277
  outputValue,
263
278
  btcUtxos,
279
+ enableRBF,
264
280
  })
265
281
 
266
282
  return res
@@ -385,12 +401,14 @@ export function usePrepareSendRunesCallback() {
385
401
  runeAmount,
386
402
  outputValue,
387
403
  feeRate,
404
+ enableRBF,
388
405
  }: {
389
406
  toAddressInfo: ToAddressInfo
390
407
  runeid: string
391
408
  runeAmount: string
392
409
  outputValue?: number
393
410
  feeRate: number
411
+ enableRBF?: boolean
394
412
  }) => {
395
413
  if (!feeRate) {
396
414
  const summary = await wallet.getFeeSummary()
@@ -415,6 +433,7 @@ export function usePrepareSendRunesCallback() {
415
433
  feeRate,
416
434
  btcUtxos,
417
435
  assetUtxos,
436
+ enableRBF,
418
437
  })
419
438
 
420
439
  return toSignData
@@ -437,7 +456,8 @@ export function usePrepareSendAlkanesCallback() {
437
456
  alkaneid: string,
438
457
  amount: string,
439
458
  feeRate: number,
440
- type: 'ft' | 'nft'
459
+ type: 'ft' | 'nft',
460
+ enableRBF?: boolean
441
461
  ) => {
442
462
  return await wallet.createSendAlkanesPsbt({
443
463
  to: toAddressInfo.address,
@@ -445,6 +465,7 @@ export function usePrepareSendAlkanesCallback() {
445
465
  amount,
446
466
  feeRate,
447
467
  type,
468
+ enableRBF,
448
469
  })
449
470
  },
450
471
  [wallet, account]
package/src/hooks/ui.ts CHANGED
@@ -33,6 +33,11 @@ export function useAlkanesAssetTabKey() {
33
33
  return uiState.alkanesAssetTabKey
34
34
  }
35
35
 
36
+ export function useMoreAssetTabKey() {
37
+ const uiState = useUIState()
38
+ return uiState.moreAssetTabKey
39
+ }
40
+
36
41
  export function useUiTxCreateScreen() {
37
42
  const uiState = useUIState()
38
43
  return uiState.uiTxCreateScreen
@@ -43,14 +48,17 @@ export function useUpdateUiTxCreateScreen() {
43
48
  return ({
44
49
  toInfo,
45
50
  inputAmount,
51
+ enableRBF,
46
52
  }: {
47
53
  toInfo?: { address: string; domain: string; inscription?: Inscription }
48
54
  inputAmount?: string
55
+ enableRBF?: boolean
49
56
  }) => {
50
57
  dispatch(
51
58
  (uiActions as any).updateTxCreateScreen({
52
59
  toInfo,
53
60
  inputAmount,
61
+ enableRBF,
54
62
  })
55
63
  )
56
64
  }
@@ -202,7 +210,7 @@ export function getSupportedAssets(chainType: ChainType, address: string) {
202
210
 
203
211
  if (chainType === ChainType.BITCOIN_MAINNET || chainType === ChainType.BITCOIN_SIGNET) {
204
212
  assets.alkanes = true
205
- assetTabKeys.push(AssetTabKey.ALKANES)
213
+ assetTabKeys.push(AssetTabKey.MORE)
206
214
  }
207
215
 
208
216
  if (chainType === ChainType.BITCOIN_MAINNET || chainType === ChainType.BITCOIN_SIGNET) {
@@ -183,6 +183,9 @@ const slice: Slice<AccountsState> = createSlice({
183
183
  setAddressSummary(state, action: { payload: any }) {
184
184
  state.addressSummary = action.payload
185
185
  },
186
+ setModelPopover(state, action: { payload: MolelsPopover }) {
187
+ state.molelsPopover = action.payload
188
+ },
186
189
  expireBalance(state) {
187
190
  const balance = state.balanceMap[state.current.address]
188
191
  if (balance) {
@@ -6,6 +6,7 @@ import {
6
6
  AlkanesAssetTabKey,
7
7
  AssetTabKey,
8
8
  CATAssetTabKey,
9
+ MoreAssetTabKey,
9
10
  NavigationSource,
10
11
  OrdinalsAssetTabKey,
11
12
  } from '../types'
@@ -23,6 +24,7 @@ export interface UIState {
23
24
  ordinalsAssetTabKey: OrdinalsAssetTabKey
24
25
  catAssetTabKey: CATAssetTabKey
25
26
  alkanesAssetTabKey: AlkanesAssetTabKey
27
+ moreAssetTabKey: MoreAssetTabKey
26
28
  uiTxCreateScreen: {
27
29
  toInfo: {
28
30
  address: string
@@ -30,6 +32,7 @@ export interface UIState {
30
32
  inscription?: Inscription
31
33
  }
32
34
  inputAmount: string
35
+ enableRBF: boolean
33
36
  }
34
37
  addressInput: {
35
38
  address: string
@@ -64,12 +67,14 @@ export const initialState: UIState = {
64
67
  ordinalsAssetTabKey: OrdinalsAssetTabKey.ALL,
65
68
  catAssetTabKey: CATAssetTabKey.CAT20,
66
69
  alkanesAssetTabKey: AlkanesAssetTabKey.TOKEN,
70
+ moreAssetTabKey: MoreAssetTabKey.ALKANES_TOKEN,
67
71
  uiTxCreateScreen: {
68
72
  toInfo: {
69
73
  address: '',
70
74
  domain: '',
71
75
  },
72
76
  inputAmount: '',
77
+ enableRBF: true,
73
78
  },
74
79
  addressInput: {
75
80
  address: '',
@@ -113,6 +118,7 @@ const slice: Slice<UIState> = createSlice({
113
118
  ordinalsAssetTabKey?: OrdinalsAssetTabKey
114
119
  catAssetTabKey?: CATAssetTabKey
115
120
  alkanesAssetTabKey?: AlkanesAssetTabKey
121
+ moreAssetTabKey?: MoreAssetTabKey
116
122
  }
117
123
  }
118
124
  ) {
@@ -130,6 +136,9 @@ const slice: Slice<UIState> = createSlice({
130
136
  if (payload.alkanesAssetTabKey !== undefined) {
131
137
  state.alkanesAssetTabKey = payload.alkanesAssetTabKey
132
138
  }
139
+ if (payload.moreAssetTabKey !== undefined) {
140
+ state.moreAssetTabKey = payload.moreAssetTabKey
141
+ }
133
142
  return state
134
143
  },
135
144
  updateTxCreateScreen(
@@ -142,6 +151,7 @@ const slice: Slice<UIState> = createSlice({
142
151
  inscription?: Inscription
143
152
  }
144
153
  inputAmount?: string
154
+ enableRBF?: boolean
145
155
  }
146
156
  }
147
157
  ) {
@@ -151,6 +161,9 @@ const slice: Slice<UIState> = createSlice({
151
161
  if (action.payload.inputAmount !== undefined) {
152
162
  state.uiTxCreateScreen.inputAmount = action.payload.inputAmount
153
163
  }
164
+ if (action.payload.enableRBF !== undefined) {
165
+ state.uiTxCreateScreen.enableRBF = action.payload.enableRBF
166
+ }
154
167
 
155
168
  state.uiTxCreateScreen = { ...state.uiTxCreateScreen }
156
169
  },
@@ -274,8 +287,16 @@ const slice: Slice<UIState> = createSlice({
274
287
  if (!state.alkanesAssetTabKey) {
275
288
  state.alkanesAssetTabKey = AlkanesAssetTabKey.TOKEN
276
289
  }
290
+ if (state.moreAssetTabKey === undefined) {
291
+ state.moreAssetTabKey = MoreAssetTabKey.ALKANES_TOKEN
292
+ }
293
+ if (state.assetTabKey === (4 as AssetTabKey)) {
294
+ state.assetTabKey = AssetTabKey.MORE
295
+ }
277
296
  if (!state.uiTxCreateScreen) {
278
297
  state.uiTxCreateScreen = initialState.uiTxCreateScreen
298
+ } else if (state.uiTxCreateScreen.enableRBF === undefined) {
299
+ state.uiTxCreateScreen.enableRBF = true
279
300
  }
280
301
  if (!state.feeRateBar) {
281
302
  state.feeRateBar = initialState.feeRateBar
package/src/types/ui.ts CHANGED
@@ -3,7 +3,7 @@ export enum AssetTabKey {
3
3
  ATOMICALS = 1, // IGNORED
4
4
  RUNES = 2,
5
5
  CAT = 3,
6
- ALKANES = 4,
6
+ MORE = 4,
7
7
  }
8
8
 
9
9
  export enum OrdinalsAssetTabKey {
@@ -24,6 +24,11 @@ export enum AlkanesAssetTabKey {
24
24
  COLLECTION,
25
25
  }
26
26
 
27
+ export enum MoreAssetTabKey {
28
+ ALKANES_TOKEN,
29
+ ALKANES_COLLECTION,
30
+ }
31
+
27
32
  export enum NavigationSource {
28
33
  BACK,
29
34
  NORMAL,
@@ -3,6 +3,7 @@ import { useEffect, useMemo, useState } from 'react'
3
3
  import { AddressAlkanesTokenSummary } from '@unisat/wallet-shared'
4
4
  import {
5
5
  useAlkanesIconInfo,
6
+ useAlkanesTokenInfoExplorerUrl,
6
7
  useCurrentAccount,
7
8
  useI18n,
8
9
  useNavigation,
@@ -112,6 +113,12 @@ export function useAlkanesTokenScreenLogic() {
112
113
  tokenSummary.tokenBalance.alkaneid
113
114
  )
114
115
 
116
+ const alkanesExplorerUrl = useAlkanesTokenInfoExplorerUrl(tokenSummary.tokenInfo.alkaneid)
117
+
118
+ const onClickViewOnExplorer = () => {
119
+ nav.navToUrl(alkanesExplorerUrl)
120
+ }
121
+
115
122
  return {
116
123
  tokenSummary,
117
124
  loading,
@@ -125,6 +132,7 @@ export function useAlkanesTokenScreenLogic() {
125
132
  onClickMint,
126
133
  onClickSend,
127
134
  onClickTrade,
135
+ onClickViewOnExplorer,
128
136
  iconInfo,
129
137
  }
130
138
  }
@@ -39,6 +39,7 @@ interface ContextData {
39
39
  isApproval: boolean
40
40
  tokenInfo?: TokenInfo
41
41
  amountEditable?: boolean
42
+ enableRBF: boolean
42
43
  }
43
44
 
44
45
  interface UpdateContextDataParams {
@@ -51,6 +52,7 @@ interface UpdateContextDataParams {
51
52
  amount?: string
52
53
  tokenInfo?: TokenInfo
53
54
  amountEditable?: boolean
55
+ enableRBF?: boolean
54
56
  }
55
57
 
56
58
  export interface BRC20InscribeTransferParams {
@@ -66,13 +68,11 @@ export function useBRC20InscribeTransferLogic() {
66
68
  step: Step.STEP1,
67
69
  ticker: ticker,
68
70
  isApproval: false,
71
+ enableRBF: true,
69
72
  })
70
- const updateContextData = useCallback(
71
- (params: UpdateContextDataParams) => {
72
- setContextData(Object.assign({}, contextData, params))
73
- },
74
- [contextData, setContextData]
75
- )
73
+ const updateContextData = useCallback((params: UpdateContextDataParams) => {
74
+ setContextData(prev => Object.assign({}, prev, params))
75
+ }, [])
76
76
  return {
77
77
  contextData,
78
78
  updateContextData,
@@ -122,6 +122,12 @@ export function useBRC20InscribeTransferLogicStep1(params: BRC20InscribeTransfer
122
122
  }
123
123
  }, [])
124
124
 
125
+ useEffect(() => {
126
+ wallet.getEnableRBF().then(enableRBF => {
127
+ updateContextData({ enableRBF })
128
+ })
129
+ }, [])
130
+
125
131
  useEffect(() => {
126
132
  setInputError('')
127
133
  setInputErrorAvailable('')
@@ -180,7 +186,10 @@ export function useBRC20InscribeTransferLogicStep1(params: BRC20InscribeTransfer
180
186
  fetchUtxos()
181
187
 
182
188
  wallet
183
- .getBRC20Summary(account.address, contextData.ticker)
189
+ .getBRC20Summary({
190
+ address: account.address,
191
+ ticker: contextData.ticker,
192
+ })
184
193
  .then(v => {
185
194
  updateContextData({ tokenBalance: v.tokenBalance, tokenInfo: v.tokenInfo })
186
195
  setTimeout(() => {
@@ -208,6 +217,7 @@ export function useBRC20InscribeTransferLogicStep1(params: BRC20InscribeTransfer
208
217
  toAddressInfo: { address: order.payAddress, domain: '' },
209
218
  toAmount: order.totalFee,
210
219
  feeRate: feeRateBarState.feeRate,
220
+ enableRBF: contextData.enableRBF,
211
221
  })
212
222
  updateContextData({ order, amount, toSignData, step: Step.STEP2 })
213
223
  } catch (e) {
@@ -230,6 +240,11 @@ export function useBRC20InscribeTransferLogicStep1(params: BRC20InscribeTransfer
230
240
  defaultOutputValue,
231
241
  setOutputValue,
232
242
  disabled,
243
+ enableRBF: contextData.enableRBF,
244
+ setEnableRBF: (value: boolean) => {
245
+ updateContextData({ enableRBF: value })
246
+ wallet.setEnableRBF(value)
247
+ },
233
248
  loadingOnly,
234
249
  handleCancel,
235
250
  }
@@ -316,9 +331,11 @@ export function useBRC20InscribeTransferLogicStep3(params: BRC20InscribeTransfer
316
331
  const onSignPsbtHandleConfirm = async (signedDatas: SignedData[]) => {
317
332
  tools.showLoading(true)
318
333
  try {
319
- const { success, txid, error } = await pushBitcoinTx(signedDatas[0].psbtHex)
334
+ const { success, error } = await pushBitcoinTx(signedDatas[0].psbtHex)
320
335
  if (success) {
321
- nav.navigate('TxSuccessScreen', { txid })
336
+ updateContextData({
337
+ step: Step.STEP4,
338
+ })
322
339
  } else {
323
340
  throw new Error(error)
324
341
  }
@@ -367,7 +384,10 @@ export function useBRC20InscribeTransferLogicStep4(params: BRC20InscribeTransfer
367
384
  const onClickConfirm = () => {
368
385
  tools.showLoading(true)
369
386
  wallet
370
- .getBRC20Summary(currentAccount.address, tokenBalance.ticker)
387
+ .getBRC20Summary({
388
+ address: currentAccount.address,
389
+ ticker: tokenBalance.ticker,
390
+ })
371
391
  .then(v => {
372
392
  if (contextData.isApproval) {
373
393
  resolveApproval({
@@ -6,8 +6,8 @@ import {
6
6
  useCurrentAccount,
7
7
  useNavigation,
8
8
  useOrdinalsAssetTabKey,
9
- useWallet,
10
9
  useWallTabFocusRefresh,
10
+ useWallet,
11
11
  } from '..'
12
12
  import { useInfiniteList } from './useInfiniteList'
13
13
 
@@ -41,7 +41,11 @@ export function useBRC20ListLogic() {
41
41
  if (currentAccount.address === '') {
42
42
  return { list: [], total: 0 }
43
43
  }
44
- const { list, total } = await wallet.getBRC20List(currentAccount.address, page, pageSize)
44
+ const { list, total } = await wallet.getBRC20List({
45
+ address: currentAccount.address,
46
+ currentPage: page,
47
+ pageSize,
48
+ })
45
49
  if (list.length > 0) {
46
50
  wallet.getBrc20sPrice(list.map(item => item.ticker)).then(updatePrices)
47
51
  }