@btc-vision/walletconnect 1.9.11 → 1.9.13

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 (106) hide show
  1. package/LICENSE +190 -0
  2. package/browser/context/WalletConnectContext.d.ts +5 -4
  3. package/browser/context/WalletConnectContext.d.ts.map +1 -0
  4. package/browser/hooks/WalletConnectHook.d.ts +2 -1
  5. package/browser/hooks/WalletConnectHook.d.ts.map +1 -0
  6. package/browser/index.d.ts +1 -0
  7. package/browser/index.d.ts.map +1 -0
  8. package/browser/index.js +799 -2
  9. package/browser/noble-curves.js +3353 -0
  10. package/browser/noble-hashes.js +3097 -0
  11. package/browser/provider/WalletConnectProvider.d.ts +2 -3
  12. package/browser/provider/WalletConnectProvider.d.ts.map +1 -0
  13. package/browser/types.d.ts +4 -3
  14. package/browser/types.d.ts.map +1 -0
  15. package/browser/utils/accessibility/definitions.d.ts +1 -0
  16. package/browser/utils/accessibility/definitions.d.ts.map +1 -0
  17. package/browser/utils/accessibility/errorDecoder.d.ts +1 -0
  18. package/browser/utils/accessibility/errorDecoder.d.ts.map +1 -0
  19. package/browser/utils/accessibility/patterns.d.ts +1 -0
  20. package/browser/utils/accessibility/patterns.d.ts.map +1 -0
  21. package/browser/valibot.js +5261 -0
  22. package/browser/vendors.js +63226 -0
  23. package/browser/walletconnect.css +1 -0
  24. package/browser/wallets/controller.d.ts +5 -4
  25. package/browser/wallets/controller.d.ts.map +1 -0
  26. package/browser/wallets/index.d.ts +3 -3
  27. package/browser/wallets/index.d.ts.map +1 -0
  28. package/browser/wallets/opwallet/controller.d.ts +3 -2
  29. package/browser/wallets/opwallet/controller.d.ts.map +1 -0
  30. package/browser/wallets/opwallet/interface.d.ts +2 -1
  31. package/browser/wallets/opwallet/interface.d.ts.map +1 -0
  32. package/browser/wallets/supported-wallets.d.ts +5 -0
  33. package/browser/wallets/supported-wallets.d.ts.map +1 -0
  34. package/browser/wallets/types.d.ts +3 -2
  35. package/browser/wallets/types.d.ts.map +1 -0
  36. package/browser/wallets/unisat/controller.d.ts +3 -2
  37. package/browser/wallets/unisat/controller.d.ts.map +1 -0
  38. package/browser/wallets/unisat/interface.d.ts +2 -1
  39. package/browser/wallets/unisat/interface.d.ts.map +1 -0
  40. package/build/context/WalletConnectContext.d.ts +2 -1
  41. package/build/context/WalletConnectContext.d.ts.map +1 -0
  42. package/build/context/WalletConnectContext.js +0 -3
  43. package/build/hooks/WalletConnectHook.d.ts +1 -0
  44. package/build/hooks/WalletConnectHook.d.ts.map +1 -0
  45. package/build/index.d.ts +1 -0
  46. package/build/index.d.ts.map +1 -0
  47. package/build/provider/WalletConnectProvider.d.ts +1 -0
  48. package/build/provider/WalletConnectProvider.d.ts.map +1 -0
  49. package/build/provider/WalletConnectProvider.js +2 -3
  50. package/build/tsconfig.tsbuildinfo +1 -0
  51. package/build/types.d.ts +2 -1
  52. package/build/types.d.ts.map +1 -0
  53. package/build/types.js +1 -2
  54. package/build/utils/accessibility/definitions.d.ts +1 -0
  55. package/build/utils/accessibility/definitions.d.ts.map +1 -0
  56. package/build/utils/accessibility/errorDecoder.d.ts +1 -0
  57. package/build/utils/accessibility/errorDecoder.d.ts.map +1 -0
  58. package/build/utils/accessibility/patterns.d.ts +1 -0
  59. package/build/utils/accessibility/patterns.d.ts.map +1 -0
  60. package/build/wallets/controller.d.ts +2 -1
  61. package/build/wallets/controller.d.ts.map +1 -0
  62. package/build/wallets/controller.js +10 -15
  63. package/build/wallets/index.d.ts +3 -3
  64. package/build/wallets/index.d.ts.map +1 -0
  65. package/build/wallets/index.js +4 -3
  66. package/build/wallets/opwallet/controller.d.ts +1 -0
  67. package/build/wallets/opwallet/controller.d.ts.map +1 -0
  68. package/build/wallets/opwallet/controller.js +6 -6
  69. package/build/wallets/opwallet/interface.d.ts +1 -0
  70. package/build/wallets/opwallet/interface.d.ts.map +1 -0
  71. package/build/wallets/opwallet/interface.js +0 -1
  72. package/build/wallets/supported-wallets.d.ts +5 -0
  73. package/build/wallets/supported-wallets.d.ts.map +1 -0
  74. package/build/wallets/supported-wallets.js +5 -0
  75. package/build/wallets/types.d.ts +2 -1
  76. package/build/wallets/types.d.ts.map +1 -0
  77. package/build/wallets/types.js +1 -4
  78. package/build/wallets/unisat/controller.d.ts +1 -0
  79. package/build/wallets/unisat/controller.d.ts.map +1 -0
  80. package/build/wallets/unisat/controller.js +6 -6
  81. package/build/wallets/unisat/interface.d.ts +1 -0
  82. package/build/wallets/unisat/interface.d.ts.map +1 -0
  83. package/build/wallets/unisat/interface.js +0 -1
  84. package/package.json +39 -35
  85. package/src/README.md +9 -3
  86. package/src/context/WalletConnectContext.ts +1 -1
  87. package/src/hooks/WalletConnectHook.tsx +1 -4
  88. package/src/provider/WalletConnectProvider.tsx +1 -1
  89. package/src/types.ts +1 -1
  90. package/src/utils/style.css +9 -0
  91. package/src/wallets/controller.ts +2 -7
  92. package/src/wallets/index.ts +4 -6
  93. package/src/wallets/opwallet/controller.ts +1 -0
  94. package/src/wallets/supported-wallets.ts +8 -0
  95. package/src/wallets/types.ts +3 -7
  96. package/tsconfig.base.json +1 -3
  97. package/tsconfig.json +4 -3
  98. package/vite.config.browser.ts +92 -0
  99. package/.babelrc +0 -4
  100. package/LICENSE.md +0 -21
  101. package/browser/index.js.LICENSE.txt +0 -22
  102. package/build/utils/style.css +0 -135
  103. package/build/utils/theme.css +0 -26
  104. package/gulpfile.js +0 -145
  105. package/tsconfig.webpack.json +0 -18
  106. package/webpack.config.js +0 -87
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,WAAW,oBAAqB,SAAQ,OAAO;IACjD,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACrB"}
package/build/types.js CHANGED
@@ -1,2 +1 @@
1
- import {} from '@btc-vision/bitcoin';
2
- import { UnisatChainType } from '@btc-vision/transaction';
1
+ export {};
@@ -1,2 +1,3 @@
1
1
  export declare const genericErrors: Record<string, string>;
2
2
  export declare const errorDefinitions: Record<string, string>;
3
+ //# sourceMappingURL=definitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility/definitions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIhD,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAEnD,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export declare const _e: (err: string | Error, locales?: string[]) => string;
2
2
  export declare const _match_e: (err: string, locales?: string[]) => string[];
3
+ //# sourceMappingURL=errorDecoder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorDecoder.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility/errorDecoder.ts"],"names":[],"mappings":"AA0DA,eAAO,MAAM,EAAE,GAAI,KAAK,MAAM,GAAG,KAAK,EAAE,UAAS,MAAM,EAAW,KAAG,MAGpE,CAAC;AAMF,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,EAAE,UAAS,MAAM,EAAW,KAAG,MAAM,EAqCxE,CAAC"}
@@ -11,3 +11,4 @@ export declare const patternMap: Array<[string, string, ErrorMessages]>;
11
11
  export declare const escapeKey: (key: string) => string;
12
12
  export declare const patternRegExp: Array<[string, RegExp, ErrorMessages]>;
13
13
  export {};
14
+ //# sourceMappingURL=patterns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility/patterns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG;IAC5B,EAAE,EAAE,YAAY,CAAC;IACjB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,OAAO,CAAC,EAAE,YAAY,CAAC;CAC1B,CAAC;AAEF,KAAK,YAAY,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAC7E,KAAK,aAAa,GAAG,YAAY,GAAG,iBAAiB,CAAC;AA4DtD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,CAGH,CAAC;AAE5D,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,KAAG,MAMvC,CAAC;AACF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,CAGQ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { type MLDSASignature, type Unisat, UnisatChainType, UnisatSigner } from '@btc-vision/transaction';
2
2
  import { AbstractRpcProvider } from 'opnet';
3
3
  import { type WalletConnectNetwork } from '../types';
4
- import { type SupportedWallets } from './index';
4
+ import { SupportedWallets } from './supported-wallets';
5
5
  import type { ControllerConnectAccounts, ControllerErrorResponse, ControllerResponse, WalletConnectWallet } from './types.ts';
6
6
  declare class WalletController {
7
7
  private static wallets;
@@ -33,3 +33,4 @@ declare class WalletController {
33
33
  static verifyMLDSASignature(message: string, signature: MLDSASignature): Promise<boolean>;
34
34
  }
35
35
  export { WalletController };
36
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/wallets/controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,eAAe,EAAE,YAAY,EAAG,MAAM,yBAAyB,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EACR,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACtB,MAAM,YAAY,CAAC;AAEpB,cAAM,gBAAgB;IAClB,OAAO,CAAC,MAAM,CAAC,OAAO,CAA+C;IACrE,OAAO,CAAC,MAAM,CAAC,aAAa,CAAoC;IAEhE,MAAM,CAAC,UAAU,8BAEf;IACF,MAAM,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAGjD,MAAM,CAAC,aAAa,IAAI,gBAAgB,GAAG,IAAI;IAI/C,MAAM,CAAC,iBAAiB,IAAI,MAAM,GAAG,IAAI;WAU5B,WAAW,IAAI,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;WAUlD,SAAS,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAUtD,MAAM,CAAC,yBAAyB,CAAC,SAAS,EAAE,eAAe,GAAG,oBAAoB,GAAG,IAAI;WAqB5E,UAAU,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;WAUlD,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;WAQtC,cAAc,CAAC,UAAU,EAAE,MAAM;WAKjC,OAAO,CAChB,UAAU,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,yBAAyB,GAAG,uBAAuB,CAAC,CAAC;WA4BtE,yBAAyB,CAAC,SAAS,EAAE,mBAAmB;WAQxD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IASxC,MAAM,CAAC,sBAAsB,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,GAAG,IAAI;IASrE,MAAM,CAAC,iBAAiB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI;IAS9C,MAAM,CAAC,mBAAmB,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,GAAG,IAAI;IAe7E,MAAM,CAAC,yBAAyB,IAAI,IAAI;IAaxC,MAAM,CAAC,oBAAoB,IAAI,IAAI;IAanC,MAAM,CAAC,sBAAsB,IAAI,IAAI;IAarC,MAAM,CAAC,cAAc,GAAI,QAAQ,mBAAmB,KAAG,IAAI,CAEzD;IAEF,MAAM,CAAC,WAAW,IAAI,IAAI;WAMb,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;WAO3C,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;WAO3C,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;WAOjE,oBAAoB,CAC7B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,cAAc,GAC1B,OAAO,CAAC,OAAO,CAAC;CAMtB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,16 +1,17 @@
1
- var _a;
2
1
  import { networks } from '@btc-vision/bitcoin';
3
- import { UnisatChainType, UnisatSigner, } from '@btc-vision/transaction';
4
- import { AbstractRpcProvider } from 'opnet';
5
- import {} from '../types';
2
+ import { UnisatChainType, } from '@btc-vision/transaction';
6
3
  import { _e } from '../utils/accessibility/errorDecoder';
7
- import {} from './index';
8
4
  class WalletController {
5
+ static wallets = new Map();
6
+ static currentWallet = null;
7
+ static getWallets = () => {
8
+ return [...WalletController.wallets.values()];
9
+ };
9
10
  static isWalletInstalled(wallet) {
10
11
  return this.wallets.get(wallet)?.controller?.isInstalled() || false;
11
12
  }
12
13
  static getWalletType() {
13
- return _a.currentWallet?.name || null;
14
+ return WalletController.currentWallet?.name || null;
14
15
  }
15
16
  static getWalletInstance() {
16
17
  const wallet = this.currentWallet;
@@ -185,6 +186,9 @@ class WalletController {
185
186
  console.error('Error removing network change hook:', error);
186
187
  }
187
188
  }
189
+ static registerWallet = (wallet) => {
190
+ this.wallets.set(wallet.name, wallet);
191
+ };
188
192
  static unbindHooks() {
189
193
  this.removeDisconnectHook();
190
194
  this.removeChainChangedHook();
@@ -215,13 +219,4 @@ class WalletController {
215
219
  return wallet.controller.verifyMLDSASignature(message, signature);
216
220
  }
217
221
  }
218
- _a = WalletController;
219
- WalletController.wallets = new Map();
220
- WalletController.currentWallet = null;
221
- WalletController.getWallets = () => {
222
- return [..._a.wallets.values()];
223
- };
224
- WalletController.registerWallet = (wallet) => {
225
- _a.wallets.set(wallet.name, wallet);
226
- };
227
222
  export { WalletController };
@@ -1,4 +1,4 @@
1
1
  import { WalletController } from './controller';
2
- type SupportedWallets = 'OP_WALLET' | 'UNISAT';
3
- export { WalletController };
4
- export type { SupportedWallets };
2
+ import { SupportedWallets } from './supported-wallets';
3
+ export { WalletController, SupportedWallets };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wallets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAgBvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,16 +1,17 @@
1
1
  import { WalletController } from './controller';
2
2
  import OPWallet from './opwallet/controller';
3
3
  import { logo as OPWalletLogo } from './opwallet/interface';
4
+ import { SupportedWallets } from './supported-wallets';
4
5
  import UniSatWallet from './unisat/controller';
5
6
  import { logo as UnisatLogo } from './unisat/interface';
6
7
  WalletController.registerWallet({
7
- name: 'OP_WALLET',
8
+ name: SupportedWallets.OP_WALLET,
8
9
  icon: OPWalletLogo,
9
10
  controller: new OPWallet(),
10
11
  });
11
12
  WalletController.registerWallet({
12
- name: 'UNISAT',
13
+ name: SupportedWallets.UNISAT,
13
14
  icon: UnisatLogo,
14
15
  controller: new UniSatWallet(),
15
16
  });
16
- export { WalletController };
17
+ export { WalletController, SupportedWallets };
@@ -30,3 +30,4 @@ declare class OPWallet implements WalletBase {
30
30
  verifyMLDSASignature(message: string, signature: MLDSASignature): Promise<boolean>;
31
31
  }
32
32
  export default OPWallet;
33
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/wallets/opwallet/controller.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,cAAc,EACnB,KAAK,MAAM,EAEX,eAAe,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAmB,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAU3C,cAAM,QAAS,YAAW,UAAU;IAChC,OAAO,CAAC,UAAU,CAA0B;IAC5C,OAAO,CAAC,0BAA0B,CAAC,CAAoC;IACvE,OAAO,CAAC,uBAAuB,CAAC,CAAqC;IACrE,OAAO,CAAC,qBAAqB,CAAC,CAAa;IAC3C,OAAO,CAAC,YAAY,CAAkB;IAEtC,WAAW;IAOX,WAAW;IAGL,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAOxC,UAAU,IAAI,IAAI;IAIZ,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAU5B,UAAU;IAWhB,iBAAiB,IAAI,MAAM,GAAG,IAAI;IAIrB,WAAW,IAAI,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAiBzD,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IAOzB,UAAU,IAAI,OAAO,CAAC,eAAe,CAAC;IAa5C,sBAAsB,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,GAAG,IAAI;IA0B9D,yBAAyB,IAAI,IAAI;IAYjC,iBAAiB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI;IAevC,oBAAoB,IAAI,IAAI;IAY5B,mBAAmB,CAAC,EAAE,EAAE,CAAC,SAAS,EAAE,eAAe,KAAK,IAAI,GAAG,IAAI;IAcnE,sBAAsB,IAAI,IAAI;IAYxB,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAM3C,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAS3C,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAMjE,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;CAK3F;AAED,eAAe,QAAQ,CAAC"}
@@ -1,13 +1,13 @@
1
1
  import { networks } from '@btc-vision/bitcoin';
2
2
  import { MessageSigner, UnisatChainType, } from '@btc-vision/transaction';
3
- import { AbstractRpcProvider, JSONRpcProvider } from 'opnet';
4
- import {} from '../types';
5
- import {} from './interface';
3
+ import { JSONRpcProvider } from 'opnet';
6
4
  const notInstalledError = 'OP_WALLET is not installed';
7
5
  class OPWallet {
8
- constructor() {
9
- this._isConnected = false;
10
- }
6
+ walletBase;
7
+ accountsChangedHookWrapper;
8
+ chainChangedHookWrapper;
9
+ disconnectHookWrapper;
10
+ _isConnected = false;
11
11
  isInstalled() {
12
12
  if (typeof window === 'undefined') {
13
13
  return false;
@@ -3,3 +3,4 @@ export interface OPWalletInterface extends Unisat {
3
3
  disconnect: () => Promise<void>;
4
4
  }
5
5
  export declare const logo: string;
6
+ //# sourceMappingURL=interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/wallets/opwallet/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,WAAW,iBAAkB,SAAQ,MAAM;IAC7C,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED,eAAO,MAAM,IAAI,QAmCiC,CAAC"}
@@ -1,4 +1,3 @@
1
- import {} from '@btc-vision/transaction';
2
1
  export const logo = 'data:image/svg+xml;base64,' +
3
2
  'PHN2ZyB3aWR0aD0iNDgxIiBoZWlnaHQ9IjExMiIgdmlld0JveD0iMCAwIDQ4MSAxMTIiIGZpbGw9' +
4
3
  'Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0i' +
@@ -0,0 +1,5 @@
1
+ export declare enum SupportedWallets {
2
+ OP_WALLET = "OP_WALLET",
3
+ UNISAT = "UNISAT"
4
+ }
5
+ //# sourceMappingURL=supported-wallets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supported-wallets.d.ts","sourceRoot":"","sources":["../../src/wallets/supported-wallets.ts"],"names":[],"mappings":"AAIA,oBAAY,gBAAgB;IACxB,SAAS,cAAc;IACvB,MAAM,WAAW;CACpB"}
@@ -0,0 +1,5 @@
1
+ export var SupportedWallets;
2
+ (function (SupportedWallets) {
3
+ SupportedWallets["OP_WALLET"] = "OP_WALLET";
4
+ SupportedWallets["UNISAT"] = "UNISAT";
5
+ })(SupportedWallets || (SupportedWallets = {}));
@@ -1,6 +1,6 @@
1
1
  import { type MLDSASignature, type Unisat, UnisatChainType, UnisatSigner } from '@btc-vision/transaction';
2
2
  import { AbstractRpcProvider } from 'opnet';
3
- import { type SupportedWallets } from './index';
3
+ import { SupportedWallets } from './supported-wallets';
4
4
  export { type AbstractRpcProvider } from 'opnet';
5
5
  export interface WalletBase {
6
6
  isInstalled(): boolean;
@@ -38,3 +38,4 @@ export interface ControllerErrorResponse {
38
38
  message: string;
39
39
  }
40
40
  export type ControllerConnectAccounts = string[];
41
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/wallets/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,eAAe,EAAE,YAAY,EAAG,MAAM,yBAAyB,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,UAAU;IACvB,WAAW,IAAI,OAAO,CAAC;IACvB,WAAW,IAAI,OAAO,CAAC;IACvB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAAC;IACnC,WAAW,IAAI,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,SAAS,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAC1C,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IACzC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACvC,UAAU,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IACvC,sBAAsB,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IAC/D,yBAAyB,IAAI,IAAI,CAAC;IAClC,iBAAiB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACxC,oBAAoB,IAAI,IAAI,CAAC;IAC7B,mBAAmB,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,GAAG,IAAI,CAAC;IAClE,sBAAsB,IAAI,IAAI,CAAC;IAC/B,UAAU,IAAI,IAAI,CAAC;IACnB,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5C,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5C,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAClE,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtF;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,UAAU,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,CAAC,CAAC;CACZ;AAED,MAAM,WAAW,uBAAuB;IACpC,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,yBAAyB,GAAG,MAAM,EAAE,CAAC"}
@@ -1,4 +1 @@
1
- import { UnisatChainType, UnisatSigner, } from '@btc-vision/transaction';
2
- import { AbstractRpcProvider } from 'opnet';
3
- import {} from './index';
4
- export {} from 'opnet';
1
+ export {};
@@ -30,3 +30,4 @@ declare class UnisatWallet implements WalletBase {
30
30
  verifyMLDSASignature(_message: string, _signature: MLDSASignature): Promise<boolean>;
31
31
  }
32
32
  export default UnisatWallet;
33
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/wallets/unisat/controller.ts"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,MAAM,EAEX,eAAe,EACf,YAAY,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAmB,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAS3C,cAAM,YAAa,YAAW,UAAU;IACpC,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,0BAA0B,CAAC,CAAoC;IACvE,OAAO,CAAC,uBAAuB,CAAC,CAAqC;IACrE,OAAO,CAAC,qBAAqB,CAAC,CAAa;IAC3C,OAAO,CAAC,YAAY,CAAkB;IAEtC,WAAW;IAOX,WAAW;IAGL,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAOxC,iBAAiB,IAAI,MAAM,GAAG,IAAI;IAIrB,WAAW,IAAI,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAiBzD,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC;IAMxC,UAAU,IAAI,IAAI;IAIZ,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAU5B,UAAU;IAWhB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IAOzB,UAAU,IAAI,OAAO,CAAC,eAAe,CAAC;IAa5C,sBAAsB,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,GAAG,IAAI;IA0B9D,yBAAyB,IAAI,IAAI;IAYjC,iBAAiB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI;IAevC,oBAAoB,IAAI,IAAI;IAY5B,mBAAmB,CAAC,EAAE,EAAE,CAAC,SAAS,EAAE,eAAe,KAAK,IAAI,GAAG,IAAI;IAcnE,sBAAsB,IAAI,IAAI;IAa9B,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAG3C,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAG3C,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAGlE,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;CAGvF;AAED,eAAe,YAAY,CAAC"}
@@ -1,13 +1,13 @@
1
1
  import { networks } from '@btc-vision/bitcoin';
2
2
  import { UnisatChainType, UnisatSigner, } from '@btc-vision/transaction';
3
- import { AbstractRpcProvider, JSONRpcProvider } from 'opnet';
4
- import {} from '../types';
5
- import {} from './interface';
3
+ import { JSONRpcProvider } from 'opnet';
6
4
  const notInstalledError = 'UNISAT is not installed';
7
5
  class UnisatWallet {
8
- constructor() {
9
- this._isConnected = false;
10
- }
6
+ walletBase;
7
+ accountsChangedHookWrapper;
8
+ chainChangedHookWrapper;
9
+ disconnectHookWrapper;
10
+ _isConnected = false;
11
11
  isInstalled() {
12
12
  if (typeof window === 'undefined') {
13
13
  return false;
@@ -3,3 +3,4 @@ export interface UnisatWalletInterface extends Unisat {
3
3
  disconnect: () => Promise<void>;
4
4
  }
5
5
  export declare const logo: string;
6
+ //# sourceMappingURL=interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/wallets/unisat/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,WAAW,qBAAsB,SAAQ,MAAM;IACjD,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED,eAAO,MAAM,IAAI,QA6RqD,CAAC"}
@@ -1,4 +1,3 @@
1
- import {} from '@btc-vision/transaction';
2
1
  export const logo = 'data:image/png;base64,' +
3
2
  'iVBORw0KGgoAAAANSUhEUgAAAV4AAABjCAYAAADTuGjdAAAAAXNSR0IB2cksfwAAAARnQU1BAACx' +
4
3
  'jwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dE' +
package/package.json CHANGED
@@ -1,31 +1,43 @@
1
1
  {
2
2
  "name": "@btc-vision/walletconnect",
3
3
  "type": "module",
4
- "version": "1.9.11",
4
+ "version": "1.9.13",
5
5
  "author": "impredmet",
6
6
  "description": "The OP_NET Wallet Connect library helps your dApp connect to any compatible wallet.",
7
7
  "engines": {
8
- "node": ">=20.0.0"
8
+ "node": ">=24.0.0"
9
9
  },
10
10
  "exports": {
11
11
  ".": {
12
+ "browser": {
13
+ "types": "./browser/index.d.ts",
14
+ "import": "./browser/index.js",
15
+ "require": "./browser/index.js",
16
+ "default": "./browser/index.js"
17
+ },
18
+ "node": {
19
+ "types": "./build/index.d.ts",
20
+ "import": "./build/index.js",
21
+ "require": "./build/index.js",
22
+ "default": "./build/index.js"
23
+ },
24
+ "types": "./build/index.d.ts",
12
25
  "import": "./build/index.js",
13
26
  "require": "./build/index.js",
14
- "types": "./build/index.d.ts"
27
+ "default": "./build/index.js"
15
28
  },
16
29
  "./browser": {
30
+ "types": "./browser/index.d.ts",
17
31
  "import": "./browser/index.js",
18
32
  "require": "./browser/index.js",
19
- "types": "./browser/index.d.ts"
33
+ "default": "./browser/index.js"
20
34
  }
21
35
  },
22
36
  "browser": {
23
37
  "./build/index.d.ts": "./browser/index.d.ts",
24
38
  "./build/index.js": "./browser/index.js",
25
39
  "Buffer": "buffer",
26
- "crypto": "./src/crypto/crypto-browser.js",
27
- "stream": "stream-browserify",
28
- "zlib": "browserify-zlib"
40
+ "stream": "stream-browserify"
29
41
  },
30
42
  "homepage": "https://opnet.org",
31
43
  "keywords": [
@@ -42,7 +54,7 @@
42
54
  "smart inscriptions",
43
55
  "ordinals"
44
56
  ],
45
- "license": "MIT",
57
+ "license": "Apache-2.0",
46
58
  "main": "build/index.js",
47
59
  "types": "build/index.d.ts",
48
60
  "typings": "build/index.d.ts",
@@ -56,47 +68,39 @@
56
68
  "url": "git://github.com/btc-vision/walletconnect.git"
57
69
  },
58
70
  "scripts": {
59
- "watch": "gulp watch",
60
- "build": "gulp build",
61
- "setup": "npm i && npm run build",
62
- "lint": "eslint .",
63
- "browserBuild": "webpack --mode production"
71
+ "build": "eslint src && tsc",
72
+ "build:browser": "vite build -c vite.config.browser.ts",
73
+ "build:all": "npm run build && npm run build:browser",
74
+ "watch": "tsc --watch",
75
+ "setup": "npm i && npm run build:all",
76
+ "lint": "eslint src",
77
+ "check:circular": "madge --circular --extensions ts,tsx src/",
78
+ "prebuild": "npm run check:circular"
64
79
  },
65
80
  "peerDependencies": {
66
81
  "react": "^19",
67
82
  "react-dom": "^19"
68
83
  },
69
84
  "devDependencies": {
70
- "@babel/preset-env": "^7.28.5",
71
- "@babel/preset-react": "^7.28.5",
72
- "@babel/preset-typescript": "^7.28.5",
85
+ "@eslint/js": "^9.39.1",
73
86
  "@types/react": "^19.2.7",
74
- "baseline-browser-mapping": "^2.9.7",
87
+ "browserify-zlib": "^0.2.0",
88
+ "crypto-browserify": "^3.12.1",
75
89
  "eslint-plugin-react-hooks": "^7.0.1",
76
90
  "eslint-plugin-react-refresh": "^0.4.24",
77
- "gulp": "^5.0.1",
78
- "gulp-cached": "^1.1.1",
79
- "gulp-typescript": "^6.0.0-alpha.1",
80
- "https-browserify": "^1.0.0",
81
- "os-browserify": "^0.3.0",
91
+ "madge": "^8.0.0",
82
92
  "react": "^19.2.3",
83
93
  "react-dom": "^19.2.3",
84
94
  "stream-browserify": "^3.0.0",
85
- "stream-http": "^3.2.0",
95
+ "typescript": "^5.8.3",
86
96
  "typescript-eslint": "^8.49.0",
87
- "webpack-cli": "^6.0.1"
97
+ "vite": "^6.3.5",
98
+ "vite-plugin-dts": "^4.5.4",
99
+ "vite-plugin-node-polyfills": "^0.23.0"
88
100
  },
89
101
  "dependencies": {
90
- "@btc-vision/bitcoin": "^6.4.11",
91
- "@btc-vision/transaction": "^1.7.19",
92
- "@eslint/js": "^9.39.1",
93
- "css-loader": "^7.1.2",
94
- "eslint-plugin-react-hooks": "^7.0.1",
95
- "gulp-clean": "^0.4.0",
96
- "gulp-eslint-new": "^2.5.0",
97
- "gulp-logger-new": "^1.0.1",
98
- "opnet": "^1.7.16",
99
- "style-loader": "^4.0.0",
100
- "webpack": "^5.103.0"
102
+ "@btc-vision/bitcoin": "^6.5.4",
103
+ "@btc-vision/transaction": "^1.7.31",
104
+ "opnet": "^1.7.34"
101
105
  }
102
106
  }
package/src/README.md CHANGED
@@ -1,14 +1,20 @@
1
1
  # WalletConnect
2
2
 
3
- WalletConnect is a library that allows you to connect to various wallets and manage your accounts and transactions. It provides a unified interface for interacting with different wallets, making it easier to build applications that require wallet integration.
3
+ WalletConnect is a library that allows you to connect to various wallets and manage your accounts and transactions. It
4
+ provides a unified interface for interacting with different wallets, making it easier to build applications that require
5
+ wallet integration.
4
6
 
5
7
  ## Adding a wallet
6
8
 
7
9
  To add a wallet, you must start by creating a new directory in the `/WalletConnect/src/wallets` directory.
8
10
 
9
- Inside this directory, you will need a controller class for the wallet, which should implement the `WalletBase` interface. This class will handle the wallet's specific logic, such as connecting to the wallet, signing transactions, and retrieving account information.
11
+ Inside this directory, you will need a controller class for the wallet, which should implement the `WalletBase`
12
+ interface. This class will handle the wallet's specific logic, such as connecting to the wallet, signing transactions,
13
+ and retrieving account information.
10
14
 
11
- Once you have created the controller class, you will need to add its name to the SupportedWallets type and register it in the `/wallets/index.ts` module. The latest is done by calling the `registerWallet` method in the `WalletConnect` module's `init` method. You will need to pass the controller class as an argument to this method.
15
+ Once you have created the controller class, you will need to add its name to the SupportedWallets type and register it
16
+ in the `/wallets/index.ts` module. The latest is done by calling the `registerWallet` method in the `WalletConnect`
17
+ module's `init` method. You will need to pass the controller class as an argument to this method.
12
18
 
13
19
  ```ts
14
20
  import { WalletController } from './controller.ts';
@@ -2,7 +2,7 @@ import { Address, type MLDSASignature, type Unisat, UnisatSigner } from '@btc-vi
2
2
  import { AbstractRpcProvider } from 'opnet';
3
3
  import { createContext } from 'react';
4
4
  import type { WalletBalance, WalletConnectNetwork, WalletInformation } from '../types.ts';
5
- import { type SupportedWallets } from '../wallets';
5
+ import { SupportedWallets } from '../wallets';
6
6
 
7
7
  export type WalletConnectContextType = {
8
8
  allWallets: WalletInformation[];
@@ -1,8 +1,5 @@
1
1
  import { useContext } from 'react';
2
- import {
3
- WalletConnectContext,
4
- type WalletConnectContextType,
5
- } from '../context/WalletConnectContext';
2
+ import { WalletConnectContext, type WalletConnectContextType, } from '../context/WalletConnectContext';
6
3
 
7
4
  export const useWalletConnect = (): WalletConnectContextType => {
8
5
  const context = useContext(WalletConnectContext);
@@ -5,7 +5,7 @@ import { WalletConnectContext } from '../context/WalletConnectContext';
5
5
  import type { WalletBalance, WalletConnectNetwork, WalletInformation } from '../types.ts';
6
6
  import '../utils/style.css';
7
7
  import '../utils/theme.css';
8
- import { type SupportedWallets, WalletController } from '../wallets';
8
+ import { SupportedWallets, WalletController } from '../wallets';
9
9
  import type {
10
10
  ControllerConnectAccounts,
11
11
  ControllerErrorResponse,
package/src/types.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type Network } from '@btc-vision/bitcoin';
2
2
  import { UnisatChainType } from '@btc-vision/transaction';
3
- import type { SupportedWallets } from './wallets';
3
+ import { SupportedWallets } from './wallets/supported-wallets';
4
4
 
5
5
  export interface WalletConnectNetwork extends Network {
6
6
  chainType: UnisatChainType;
@@ -45,10 +45,12 @@
45
45
  background-color: var(--background-color);
46
46
  cursor: pointer;
47
47
  }
48
+
48
49
  .wallet-connect-header > button.close:hover {
49
50
  border: 1px solid rgba(254, 121, 1, 0.3);
50
51
  background-color: rgba(254, 121, 1, 0.1);
51
52
  }
53
+
52
54
  .wallet-connect-header > button.close svg {
53
55
  display: flex;
54
56
  }
@@ -85,6 +87,7 @@
85
87
  border: 1px solid var(--border-color);
86
88
  background-color: var(--button-background-color);
87
89
  }
90
+
88
91
  .wallet-list > button:disabled {
89
92
  opacity: 0.3;
90
93
  cursor: not-allowed;
@@ -94,26 +97,32 @@
94
97
  border: 1px solid rgba(254, 121, 1, 0.3);
95
98
  background-color: rgba(254, 121, 1, 0.1);
96
99
  }
100
+
97
101
  .wallet-icon {
98
102
  display: flex;
99
103
  }
104
+
100
105
  .wallet-icon img {
101
106
  max-height: 32px;
102
107
  filter: var(--icon-filter);
103
108
  }
109
+
104
110
  .wallet-name {
105
111
  font-size: x-large;
106
112
  text-align: left;
107
113
  }
114
+
108
115
  .wallet-connected {
109
116
  padding: 10px;
110
117
  font-size: medium;
111
118
  color: green;
112
119
  }
120
+
113
121
  div.wallet-not-installed {
114
122
  padding: 10px;
115
123
  font-size: medium;
116
124
  }
125
+
117
126
  div.wallet-waiting-plugin {
118
127
  padding: 10px;
119
128
  font-size: medium;
@@ -1,14 +1,9 @@
1
1
  import { type Network, networks } from '@btc-vision/bitcoin';
2
- import {
3
- type MLDSASignature,
4
- type Unisat,
5
- UnisatChainType,
6
- UnisatSigner,
7
- } from '@btc-vision/transaction';
2
+ import { type MLDSASignature, type Unisat, UnisatChainType, UnisatSigner, } from '@btc-vision/transaction';
8
3
  import { AbstractRpcProvider } from 'opnet';
9
4
  import { type WalletConnectNetwork } from '../types';
10
5
  import { _e } from '../utils/accessibility/errorDecoder';
11
- import { type SupportedWallets } from './index';
6
+ import { SupportedWallets } from './supported-wallets';
12
7
  import type {
13
8
  ControllerConnectAccounts,
14
9
  ControllerErrorResponse,
@@ -1,22 +1,20 @@
1
1
  import { WalletController } from './controller';
2
2
  import OPWallet from './opwallet/controller';
3
3
  import { logo as OPWalletLogo } from './opwallet/interface';
4
+ import { SupportedWallets } from './supported-wallets';
4
5
  import UniSatWallet from './unisat/controller';
5
6
  import { logo as UnisatLogo } from './unisat/interface';
6
7
 
7
- type SupportedWallets = 'OP_WALLET' | 'UNISAT';
8
-
9
8
  WalletController.registerWallet({
10
- name: 'OP_WALLET',
9
+ name: SupportedWallets.OP_WALLET,
11
10
  icon: OPWalletLogo,
12
11
  controller: new OPWallet(),
13
12
  });
14
13
 
15
14
  WalletController.registerWallet({
16
- name: 'UNISAT',
15
+ name: SupportedWallets.UNISAT,
17
16
  icon: UnisatLogo,
18
17
  controller: new UniSatWallet(),
19
18
  });
20
19
 
21
- export { WalletController };
22
- export type { SupportedWallets };
20
+ export { WalletController, SupportedWallets };
@@ -10,6 +10,7 @@ import { AbstractRpcProvider, JSONRpcProvider } from 'opnet';
10
10
  import { type WalletBase } from '../types';
11
11
  import { type OPWalletInterface } from './interface';
12
12
 
13
+ // @ts-expect-error This is correct.
13
14
  interface OPWalletWindow extends Window {
14
15
  opnet?: OPWalletInterface;
15
16
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Supported wallet types.
3
+ * This file exists separately to avoid circular dependencies.
4
+ */
5
+ export enum SupportedWallets {
6
+ OP_WALLET = 'OP_WALLET',
7
+ UNISAT = 'UNISAT',
8
+ }
@@ -1,11 +1,7 @@
1
- import {
2
- type MLDSASignature,
3
- type Unisat,
4
- UnisatChainType,
5
- UnisatSigner,
6
- } from '@btc-vision/transaction';
1
+ import { type MLDSASignature, type Unisat, UnisatChainType, UnisatSigner, } from '@btc-vision/transaction';
7
2
  import { AbstractRpcProvider } from 'opnet';
8
- import { type SupportedWallets } from './index';
3
+ import { SupportedWallets } from './supported-wallets';
4
+
9
5
  export { type AbstractRpcProvider } from 'opnet';
10
6
 
11
7
  export interface WalletBase {
@@ -17,12 +17,10 @@
17
17
  "strictBindCallApply": true,
18
18
  "strictPropertyInitialization": true,
19
19
  "alwaysStrict": true,
20
- "moduleResolution": "node",
21
20
  "allowJs": true,
22
21
  "incremental": true,
23
22
  "allowSyntheticDefaultImports": true,
24
- "verbatimModuleSyntax": true,
25
23
  "esModuleInterop": true
26
24
  },
27
- "include": ["src/**/*.ts", "src/*", "src/**/*.js", "src/*.ts", "src/*.js", "src/*.cjs"]
25
+ "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js"]
28
26
  }