@subwallet/extension-inject 1.3.41-0 → 1.3.43-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundle.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AuthRequestOption, CardanoProvider, Injected, InjectOptions } from './types';
1
+ import type { AuthRequestOption, BitcoinProvider, CardanoProvider, Injected, InjectOptions } from './types';
2
2
  import { EIP6963ProviderInfo, EvmProvider } from './types';
3
3
  export { packageInfo } from './packageInfo';
4
4
  export declare function injectExtension(enable: (origin: string, opt?: AuthRequestOption) => Promise<Injected>, { name, version }: InjectOptions): void;
@@ -6,3 +6,4 @@ export declare function injectEvmExtension(evmProvider: EvmProvider): void;
6
6
  export declare const eip6963ProviderInfo: EIP6963ProviderInfo;
7
7
  export declare const inject6963EIP: (provider: EvmProvider) => void;
8
8
  export declare function injectCardanoExtension(cardanoProvider: CardanoProvider): void;
9
+ export declare function injectBitcoinExtension(bitcoinProvider: BitcoinProvider): void;
package/bundle.js CHANGED
@@ -97,4 +97,8 @@ export function injectCardanoExtension(cardanoProvider) {
97
97
  }
98
98
  windowInject.cardano.subwallet = Object.freeze(cardanoProvider);
99
99
  windowInject.dispatchEvent(new Event('subwallet#initialized'));
100
+ }
101
+ export function injectBitcoinExtension(bitcoinProvider) {
102
+ const windowInject = window;
103
+ windowInject.SubWalletBitcoin = bitcoinProvider;
100
104
  }
package/cjs/bundle.js CHANGED
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.inject6963EIP = exports.eip6963ProviderInfo = void 0;
7
+ exports.injectBitcoinExtension = injectBitcoinExtension;
7
8
  exports.injectCardanoExtension = injectCardanoExtension;
8
9
  exports.injectEvmExtension = injectEvmExtension;
9
10
  exports.injectExtension = injectExtension;
@@ -114,4 +115,8 @@ function injectCardanoExtension(cardanoProvider) {
114
115
  }
115
116
  windowInject.cardano.subwallet = Object.freeze(cardanoProvider);
116
117
  windowInject.dispatchEvent(new Event('subwallet#initialized'));
118
+ }
119
+ function injectBitcoinExtension(bitcoinProvider) {
120
+ const windowInject = window;
121
+ windowInject.SubWalletBitcoin = bitcoinProvider;
117
122
  }
@@ -13,6 +13,6 @@ const packageInfo = {
13
13
  name: '@subwallet/extension-inject',
14
14
  path: typeof __dirname === 'string' ? __dirname : 'auto',
15
15
  type: 'cjs',
16
- version: '1.3.41-0'
16
+ version: '1.3.43-0'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "sideEffects": true,
16
16
  "type": "module",
17
- "version": "1.3.41-0",
17
+ "version": "1.3.43-0",
18
18
  "main": "./cjs/index.js",
19
19
  "module": "./index.js",
20
20
  "types": "./index.d.ts",
package/packageInfo.js CHANGED
@@ -7,5 +7,5 @@ export const packageInfo = {
7
7
  name: '@subwallet/extension-inject',
8
8
  path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
9
9
  type: 'esm',
10
- version: '1.3.41-0'
10
+ version: '1.3.43-0'
11
11
  };
package/types.d.ts CHANGED
@@ -92,6 +92,7 @@ export interface InjectedWindow extends This {
92
92
  ethereum: EvmProvider;
93
93
  SubWallet: EvmProvider;
94
94
  cardano: Record<string, CardanoProvider>;
95
+ SubWalletBitcoin: BitcoinProvider;
95
96
  }
96
97
  export declare type InjectedExtension = InjectedExtensionInfo & Injected;
97
98
  export declare type InjectOptions = InjectedExtensionInfo;
@@ -127,4 +128,17 @@ export interface CardanoProvider {
127
128
  supportedExtensions: CardanoExtensionCIP[];
128
129
  isEnable: () => Promise<boolean>;
129
130
  }
131
+ export interface BitcoinProvider {
132
+ isSubWallet: boolean;
133
+ requestAccounts: () => Promise<any[]>;
134
+ getAccounts: () => Promise<any[]>;
135
+ signPsbt(params: any): Promise<any>;
136
+ signMessage(params: any): Promise<any>;
137
+ sendTransfer(params: any): Promise<any>;
138
+ request: <T>(method: string, params?: any) => Promise<T>;
139
+ getProductInfo: () => {
140
+ name: string;
141
+ version: string;
142
+ };
143
+ }
130
144
  export {};