@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 +2 -1
- package/bundle.js +4 -0
- package/cjs/bundle.js +5 -0
- package/cjs/packageInfo.js +1 -1
- package/package.json +1 -1
- package/packageInfo.js +1 -1
- package/types.d.ts +14 -0
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
|
}
|
package/cjs/packageInfo.js
CHANGED
package/package.json
CHANGED
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.
|
|
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 {};
|