@unisat/wallet-state 1.1.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.
Files changed (45) hide show
  1. package/lib/index.d.mts +87 -18
  2. package/lib/index.d.ts +87 -18
  3. package/lib/index.js +516 -175
  4. package/lib/index.js.map +1 -1
  5. package/lib/index.mjs +514 -178
  6. package/lib/index.mjs.map +1 -1
  7. package/lib/types/index.d.mts +6 -2
  8. package/lib/types/index.d.ts +6 -2
  9. package/lib/types/index.js +7 -1
  10. package/lib/types/index.js.map +1 -1
  11. package/lib/types/index.mjs +7 -2
  12. package/lib/types/index.mjs.map +1 -1
  13. package/package.json +4 -4
  14. package/src/context/NavigationContext.tsx +1 -0
  15. package/src/context/WalletContext.tsx +56 -23
  16. package/src/hooks/accounts.ts +7 -2
  17. package/src/hooks/settings.ts +10 -0
  18. package/src/hooks/transactions.ts +75 -10
  19. package/src/hooks/ui.ts +83 -63
  20. package/src/reducers/accounts.ts +3 -0
  21. package/src/reducers/ui.ts +21 -0
  22. package/src/types/ui.ts +6 -1
  23. package/src/ui-hooks/useAddressTypeScreenLogic.ts +22 -8
  24. package/src/ui-hooks/useAlkanesNFTScreenLogic.ts +3 -2
  25. package/src/ui-hooks/useAlkanesTokenScreenLogic.ts +12 -2
  26. package/src/ui-hooks/useBRC20InscribeTransferLogic.ts +30 -10
  27. package/src/ui-hooks/useBRC20ListLogic.ts +6 -2
  28. package/src/ui-hooks/useBRC20ProgListLogic.ts +7 -3
  29. package/src/ui-hooks/useBRC20SendScreenLogic.ts +19 -6
  30. package/src/ui-hooks/useBRC20TokenScreenLogic.ts +48 -25
  31. package/src/ui-hooks/useCAT20TokenScreenLogic.ts +16 -2
  32. package/src/ui-hooks/useCAT721NFTScreenLogic.ts +3 -1
  33. package/src/ui-hooks/useEditAccountNameScreenLogic.ts +4 -4
  34. package/src/ui-hooks/useEditWalletNameScreenLogic.ts +5 -3
  35. package/src/ui-hooks/useOrdinalsInscriptionScreenLogic.ts +3 -2
  36. package/src/ui-hooks/useRunesTokenScreenLogic.ts +11 -2
  37. package/src/ui-hooks/useSendAlkanesNFTScreenLogic.ts +24 -2
  38. package/src/ui-hooks/useSendAlkanesScreenLogic.ts +17 -1
  39. package/src/ui-hooks/useSendOrdinalsInscriptionScreenLogic.ts +17 -5
  40. package/src/ui-hooks/useSendRunesScreenLogic.ts +18 -1
  41. package/src/ui-hooks/useSettingsTabScreenLogic.ts +18 -3
  42. package/src/ui-hooks/useSignMessageLogic.ts +37 -16
  43. package/src/ui-hooks/useSignPsbtLogic.ts +31 -15
  44. package/src/ui-hooks/useSplitOrdinalsInscriptionScreenLogic.ts +15 -1
  45. package/src/ui-hooks/useTxCreateScreenLogic.ts +17 -1
@@ -3,7 +3,7 @@ declare enum AssetTabKey {
3
3
  ATOMICALS = 1,
4
4
  RUNES = 2,
5
5
  CAT = 3,
6
- ALKANES = 4
6
+ MORE = 4
7
7
  }
8
8
  declare enum OrdinalsAssetTabKey {
9
9
  ALL = 0,
@@ -20,6 +20,10 @@ declare enum AlkanesAssetTabKey {
20
20
  TOKEN = 0,
21
21
  COLLECTION = 1
22
22
  }
23
+ declare enum MoreAssetTabKey {
24
+ ALKANES_TOKEN = 0,
25
+ ALKANES_COLLECTION = 1
26
+ }
23
27
  declare enum NavigationSource {
24
28
  BACK = 0,
25
29
  NORMAL = 1
@@ -27,4 +31,4 @@ declare enum NavigationSource {
27
31
 
28
32
  type TabOption = 'home' | 'discover' | 'settings' | 'app';
29
33
 
30
- export { AlkanesAssetTabKey, AssetTabKey, CATAssetTabKey, NavigationSource, OrdinalsAssetTabKey, TabOption };
34
+ export { AlkanesAssetTabKey, AssetTabKey, CATAssetTabKey, MoreAssetTabKey, NavigationSource, OrdinalsAssetTabKey, TabOption };
@@ -3,7 +3,7 @@ declare enum AssetTabKey {
3
3
  ATOMICALS = 1,
4
4
  RUNES = 2,
5
5
  CAT = 3,
6
- ALKANES = 4
6
+ MORE = 4
7
7
  }
8
8
  declare enum OrdinalsAssetTabKey {
9
9
  ALL = 0,
@@ -20,6 +20,10 @@ declare enum AlkanesAssetTabKey {
20
20
  TOKEN = 0,
21
21
  COLLECTION = 1
22
22
  }
23
+ declare enum MoreAssetTabKey {
24
+ ALKANES_TOKEN = 0,
25
+ ALKANES_COLLECTION = 1
26
+ }
23
27
  declare enum NavigationSource {
24
28
  BACK = 0,
25
29
  NORMAL = 1
@@ -27,4 +31,4 @@ declare enum NavigationSource {
27
31
 
28
32
  type TabOption = 'home' | 'discover' | 'settings' | 'app';
29
33
 
30
- export { AlkanesAssetTabKey, AssetTabKey, CATAssetTabKey, NavigationSource, OrdinalsAssetTabKey, TabOption };
34
+ export { AlkanesAssetTabKey, AssetTabKey, CATAssetTabKey, MoreAssetTabKey, NavigationSource, OrdinalsAssetTabKey, TabOption };
@@ -6,7 +6,7 @@ var AssetTabKey = /* @__PURE__ */ ((AssetTabKey2) => {
6
6
  AssetTabKey2[AssetTabKey2["ATOMICALS"] = 1] = "ATOMICALS";
7
7
  AssetTabKey2[AssetTabKey2["RUNES"] = 2] = "RUNES";
8
8
  AssetTabKey2[AssetTabKey2["CAT"] = 3] = "CAT";
9
- AssetTabKey2[AssetTabKey2["ALKANES"] = 4] = "ALKANES";
9
+ AssetTabKey2[AssetTabKey2["MORE"] = 4] = "MORE";
10
10
  return AssetTabKey2;
11
11
  })(AssetTabKey || {});
12
12
  var OrdinalsAssetTabKey = /* @__PURE__ */ ((OrdinalsAssetTabKey2) => {
@@ -27,6 +27,11 @@ var AlkanesAssetTabKey = /* @__PURE__ */ ((AlkanesAssetTabKey2) => {
27
27
  AlkanesAssetTabKey2[AlkanesAssetTabKey2["COLLECTION"] = 1] = "COLLECTION";
28
28
  return AlkanesAssetTabKey2;
29
29
  })(AlkanesAssetTabKey || {});
30
+ var MoreAssetTabKey = /* @__PURE__ */ ((MoreAssetTabKey2) => {
31
+ MoreAssetTabKey2[MoreAssetTabKey2["ALKANES_TOKEN"] = 0] = "ALKANES_TOKEN";
32
+ MoreAssetTabKey2[MoreAssetTabKey2["ALKANES_COLLECTION"] = 1] = "ALKANES_COLLECTION";
33
+ return MoreAssetTabKey2;
34
+ })(MoreAssetTabKey || {});
30
35
  var NavigationSource = /* @__PURE__ */ ((NavigationSource2) => {
31
36
  NavigationSource2[NavigationSource2["BACK"] = 0] = "BACK";
32
37
  NavigationSource2[NavigationSource2["NORMAL"] = 1] = "NORMAL";
@@ -36,6 +41,7 @@ var NavigationSource = /* @__PURE__ */ ((NavigationSource2) => {
36
41
  exports.AlkanesAssetTabKey = AlkanesAssetTabKey;
37
42
  exports.AssetTabKey = AssetTabKey;
38
43
  exports.CATAssetTabKey = CATAssetTabKey;
44
+ exports.MoreAssetTabKey = MoreAssetTabKey;
39
45
  exports.NavigationSource = NavigationSource;
40
46
  exports.OrdinalsAssetTabKey = OrdinalsAssetTabKey;
41
47
  //# sourceMappingURL=out.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/ui.ts"],"names":["AssetTabKey","OrdinalsAssetTabKey","CATAssetTabKey","AlkanesAssetTabKey","NavigationSource"],"mappings":";AAAO,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,0BAAA,cAAW,KAAX;AACA,EAAAA,0BAAA,eAAY,KAAZ;AACA,EAAAA,0BAAA,WAAQ,KAAR;AACA,EAAAA,0BAAA,SAAM,KAAN;AACA,EAAAA,0BAAA,aAAU,KAAV;AALU,SAAAA;AAAA,GAAA;AAQL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,0CAAA,SAAM,KAAN;AACA,EAAAA,0CAAA,WAAQ,KAAR;AACA,EAAAA,0CAAA,iBAAc,KAAd;AAHU,SAAAA;AAAA,GAAA;AAML,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AAJU,SAAAA;AAAA,GAAA;AAOL,IAAK,qBAAL,kBAAKC,wBAAL;AACL,EAAAA,wCAAA;AACA,EAAAA,wCAAA;AAFU,SAAAA;AAAA,GAAA;AAKL,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,oCAAA;AACA,EAAAA,oCAAA;AAFU,SAAAA;AAAA,GAAA","sourcesContent":["export enum AssetTabKey {\n ORDINALS = 0,\n ATOMICALS = 1, // IGNORED\n RUNES = 2,\n CAT = 3,\n ALKANES = 4,\n}\n\nexport enum OrdinalsAssetTabKey {\n ALL = 0,\n BRC20 = 1,\n BRC20_6BYTE = 2,\n}\n\nexport enum CATAssetTabKey {\n CAT20,\n CAT721,\n CAT20_V2,\n CAT721_V2,\n}\n\nexport enum AlkanesAssetTabKey {\n TOKEN,\n COLLECTION,\n}\n\nexport enum NavigationSource {\n BACK,\n NORMAL,\n}\n"]}
1
+ {"version":3,"sources":["../../src/types/ui.ts"],"names":["AssetTabKey","OrdinalsAssetTabKey","CATAssetTabKey","AlkanesAssetTabKey","MoreAssetTabKey","NavigationSource"],"mappings":";AAAO,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,0BAAA,cAAW,KAAX;AACA,EAAAA,0BAAA,eAAY,KAAZ;AACA,EAAAA,0BAAA,WAAQ,KAAR;AACA,EAAAA,0BAAA,SAAM,KAAN;AACA,EAAAA,0BAAA,UAAO,KAAP;AALU,SAAAA;AAAA,GAAA;AAQL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,0CAAA,SAAM,KAAN;AACA,EAAAA,0CAAA,WAAQ,KAAR;AACA,EAAAA,0CAAA,iBAAc,KAAd;AAHU,SAAAA;AAAA,GAAA;AAML,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AAJU,SAAAA;AAAA,GAAA;AAOL,IAAK,qBAAL,kBAAKC,wBAAL;AACL,EAAAA,wCAAA;AACA,EAAAA,wCAAA;AAFU,SAAAA;AAAA,GAAA;AAKL,IAAK,kBAAL,kBAAKC,qBAAL;AACL,EAAAA,kCAAA;AACA,EAAAA,kCAAA;AAFU,SAAAA;AAAA,GAAA;AAKL,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,oCAAA;AACA,EAAAA,oCAAA;AAFU,SAAAA;AAAA,GAAA","sourcesContent":["export enum AssetTabKey {\n ORDINALS = 0,\n ATOMICALS = 1, // IGNORED\n RUNES = 2,\n CAT = 3,\n MORE = 4,\n}\n\nexport enum OrdinalsAssetTabKey {\n ALL = 0,\n BRC20 = 1,\n BRC20_6BYTE = 2,\n}\n\nexport enum CATAssetTabKey {\n CAT20,\n CAT721,\n CAT20_V2,\n CAT721_V2,\n}\n\nexport enum AlkanesAssetTabKey {\n TOKEN,\n COLLECTION,\n}\n\nexport enum MoreAssetTabKey {\n ALKANES_TOKEN,\n ALKANES_COLLECTION,\n}\n\nexport enum NavigationSource {\n BACK,\n NORMAL,\n}\n"]}
@@ -4,7 +4,7 @@ var AssetTabKey = /* @__PURE__ */ ((AssetTabKey2) => {
4
4
  AssetTabKey2[AssetTabKey2["ATOMICALS"] = 1] = "ATOMICALS";
5
5
  AssetTabKey2[AssetTabKey2["RUNES"] = 2] = "RUNES";
6
6
  AssetTabKey2[AssetTabKey2["CAT"] = 3] = "CAT";
7
- AssetTabKey2[AssetTabKey2["ALKANES"] = 4] = "ALKANES";
7
+ AssetTabKey2[AssetTabKey2["MORE"] = 4] = "MORE";
8
8
  return AssetTabKey2;
9
9
  })(AssetTabKey || {});
10
10
  var OrdinalsAssetTabKey = /* @__PURE__ */ ((OrdinalsAssetTabKey2) => {
@@ -25,12 +25,17 @@ var AlkanesAssetTabKey = /* @__PURE__ */ ((AlkanesAssetTabKey2) => {
25
25
  AlkanesAssetTabKey2[AlkanesAssetTabKey2["COLLECTION"] = 1] = "COLLECTION";
26
26
  return AlkanesAssetTabKey2;
27
27
  })(AlkanesAssetTabKey || {});
28
+ var MoreAssetTabKey = /* @__PURE__ */ ((MoreAssetTabKey2) => {
29
+ MoreAssetTabKey2[MoreAssetTabKey2["ALKANES_TOKEN"] = 0] = "ALKANES_TOKEN";
30
+ MoreAssetTabKey2[MoreAssetTabKey2["ALKANES_COLLECTION"] = 1] = "ALKANES_COLLECTION";
31
+ return MoreAssetTabKey2;
32
+ })(MoreAssetTabKey || {});
28
33
  var NavigationSource = /* @__PURE__ */ ((NavigationSource2) => {
29
34
  NavigationSource2[NavigationSource2["BACK"] = 0] = "BACK";
30
35
  NavigationSource2[NavigationSource2["NORMAL"] = 1] = "NORMAL";
31
36
  return NavigationSource2;
32
37
  })(NavigationSource || {});
33
38
 
34
- export { AlkanesAssetTabKey, AssetTabKey, CATAssetTabKey, NavigationSource, OrdinalsAssetTabKey };
39
+ export { AlkanesAssetTabKey, AssetTabKey, CATAssetTabKey, MoreAssetTabKey, NavigationSource, OrdinalsAssetTabKey };
35
40
  //# sourceMappingURL=out.js.map
36
41
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/ui.ts"],"names":["AssetTabKey","OrdinalsAssetTabKey","CATAssetTabKey","AlkanesAssetTabKey","NavigationSource"],"mappings":";AAAO,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,0BAAA,cAAW,KAAX;AACA,EAAAA,0BAAA,eAAY,KAAZ;AACA,EAAAA,0BAAA,WAAQ,KAAR;AACA,EAAAA,0BAAA,SAAM,KAAN;AACA,EAAAA,0BAAA,aAAU,KAAV;AALU,SAAAA;AAAA,GAAA;AAQL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,0CAAA,SAAM,KAAN;AACA,EAAAA,0CAAA,WAAQ,KAAR;AACA,EAAAA,0CAAA,iBAAc,KAAd;AAHU,SAAAA;AAAA,GAAA;AAML,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AAJU,SAAAA;AAAA,GAAA;AAOL,IAAK,qBAAL,kBAAKC,wBAAL;AACL,EAAAA,wCAAA;AACA,EAAAA,wCAAA;AAFU,SAAAA;AAAA,GAAA;AAKL,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,oCAAA;AACA,EAAAA,oCAAA;AAFU,SAAAA;AAAA,GAAA","sourcesContent":["export enum AssetTabKey {\n ORDINALS = 0,\n ATOMICALS = 1, // IGNORED\n RUNES = 2,\n CAT = 3,\n ALKANES = 4,\n}\n\nexport enum OrdinalsAssetTabKey {\n ALL = 0,\n BRC20 = 1,\n BRC20_6BYTE = 2,\n}\n\nexport enum CATAssetTabKey {\n CAT20,\n CAT721,\n CAT20_V2,\n CAT721_V2,\n}\n\nexport enum AlkanesAssetTabKey {\n TOKEN,\n COLLECTION,\n}\n\nexport enum NavigationSource {\n BACK,\n NORMAL,\n}\n"]}
1
+ {"version":3,"sources":["../../src/types/ui.ts"],"names":["AssetTabKey","OrdinalsAssetTabKey","CATAssetTabKey","AlkanesAssetTabKey","MoreAssetTabKey","NavigationSource"],"mappings":";AAAO,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,0BAAA,cAAW,KAAX;AACA,EAAAA,0BAAA,eAAY,KAAZ;AACA,EAAAA,0BAAA,WAAQ,KAAR;AACA,EAAAA,0BAAA,SAAM,KAAN;AACA,EAAAA,0BAAA,UAAO,KAAP;AALU,SAAAA;AAAA,GAAA;AAQL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,0CAAA,SAAM,KAAN;AACA,EAAAA,0CAAA,WAAQ,KAAR;AACA,EAAAA,0CAAA,iBAAc,KAAd;AAHU,SAAAA;AAAA,GAAA;AAML,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AAJU,SAAAA;AAAA,GAAA;AAOL,IAAK,qBAAL,kBAAKC,wBAAL;AACL,EAAAA,wCAAA;AACA,EAAAA,wCAAA;AAFU,SAAAA;AAAA,GAAA;AAKL,IAAK,kBAAL,kBAAKC,qBAAL;AACL,EAAAA,kCAAA;AACA,EAAAA,kCAAA;AAFU,SAAAA;AAAA,GAAA;AAKL,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,oCAAA;AACA,EAAAA,oCAAA;AAFU,SAAAA;AAAA,GAAA","sourcesContent":["export enum AssetTabKey {\n ORDINALS = 0,\n ATOMICALS = 1, // IGNORED\n RUNES = 2,\n CAT = 3,\n MORE = 4,\n}\n\nexport enum OrdinalsAssetTabKey {\n ALL = 0,\n BRC20 = 1,\n BRC20_6BYTE = 2,\n}\n\nexport enum CATAssetTabKey {\n CAT20,\n CAT721,\n CAT20_V2,\n CAT721_V2,\n}\n\nexport enum AlkanesAssetTabKey {\n TOKEN,\n COLLECTION,\n}\n\nexport enum MoreAssetTabKey {\n ALKANES_TOKEN,\n ALKANES_COLLECTION,\n}\n\nexport enum NavigationSource {\n BACK,\n NORMAL,\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisat/wallet-state",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "Redux state management for UniSat wallet, shared between platforms",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",
@@ -28,10 +28,10 @@
28
28
  "loglevel": "^1.8.0",
29
29
  "react-redux": "8.0.1",
30
30
  "@unisat/babylon-service": "1.1.0",
31
- "@unisat/keyring-service": "1.1.0",
32
31
  "@unisat/base-utils": "0.2.0",
33
- "@unisat/wallet-shared": "0.2.0",
34
- "@unisat/wallet-types": "1.1.0"
32
+ "@unisat/wallet-types": "1.1.0",
33
+ "@unisat/keyring-service": "1.2.0",
34
+ "@unisat/wallet-shared": "0.3.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@reduxjs/toolkit": "^1.9.2",
@@ -53,6 +53,7 @@ export type RouteParamList = {
53
53
  }
54
54
  CreateSimpleWalletScreen: undefined
55
55
  CreateWatchWalletScreen: undefined
56
+ CreateReadonlyWalletScreen: undefined
56
57
  CreateColdWalletScreen: {
57
58
  fromUnlock?: boolean
58
59
  }
@@ -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 }
@@ -1,6 +1,6 @@
1
- import { useCallback } from 'react'
1
+ import { useCallback, useMemo } from 'react'
2
2
 
3
- import { Account } from '@unisat/wallet-shared'
3
+ import { Account, getAccountCapabilities } from '@unisat/wallet-shared'
4
4
 
5
5
  import { KeyringType } from '@unisat/keyring-service/types'
6
6
  import { AddressType, ChainType } from '@unisat/wallet-types'
@@ -27,6 +27,11 @@ export function useCurrentAddress() {
27
27
  return accountsState.current.address
28
28
  }
29
29
 
30
+ export function useCurrentAccountCapabilities() {
31
+ const currentAccount = useCurrentAccount()
32
+ return useMemo(() => getAccountCapabilities(currentAccount), [currentAccount])
33
+ }
34
+
30
35
  export function useAccounts() {
31
36
  const accountsState = useAccountsState()
32
37
  return accountsState.accounts
@@ -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