@onekeyfe/onekey-alph-provider 2.1.16 → 2.1.17-alpha.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/dist/OnekeyAlphProvider.js +10 -3
- package/dist/cjs/OnekeyAlphProvider.js +10 -3
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/registerAlephiumProvider.js +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/registerAlephiumProvider.d.ts +2 -0
- package/dist/registerAlephiumProvider.js +9 -0
- package/package.json +6 -6
|
@@ -33,8 +33,8 @@ function isWalletEventMethodMatch({ method, name }) {
|
|
|
33
33
|
export class ProviderAlph extends InteractiveSignerProvider {
|
|
34
34
|
constructor(props) {
|
|
35
35
|
super();
|
|
36
|
-
this.id = '
|
|
37
|
-
this.name = '
|
|
36
|
+
this.id = 'onekey';
|
|
37
|
+
this.name = 'OneKey';
|
|
38
38
|
this.icon = 'https://uni.onekey-asset.com/static/logo/onekey.png';
|
|
39
39
|
this.version = '0.9.4';
|
|
40
40
|
this.onDisconnected = undefined;
|
|
@@ -123,9 +123,16 @@ export class ProviderAlph extends InteractiveSignerProvider {
|
|
|
123
123
|
if (options.onDisconnected) {
|
|
124
124
|
this.onDisconnected = options.onDisconnected;
|
|
125
125
|
}
|
|
126
|
+
const params = {};
|
|
127
|
+
Object.keys(options).forEach((key) => {
|
|
128
|
+
if (options[key] instanceof Function) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
params[key] = options[key];
|
|
132
|
+
});
|
|
126
133
|
return this.bridgeRequest({
|
|
127
134
|
method: 'enableIfConnected',
|
|
128
|
-
params
|
|
135
|
+
params,
|
|
129
136
|
});
|
|
130
137
|
}
|
|
131
138
|
get connectedAccount() {
|
|
@@ -36,8 +36,8 @@ function isWalletEventMethodMatch({ method, name }) {
|
|
|
36
36
|
class ProviderAlph extends web3_1.InteractiveSignerProvider {
|
|
37
37
|
constructor(props) {
|
|
38
38
|
super();
|
|
39
|
-
this.id = '
|
|
40
|
-
this.name = '
|
|
39
|
+
this.id = 'onekey';
|
|
40
|
+
this.name = 'OneKey';
|
|
41
41
|
this.icon = 'https://uni.onekey-asset.com/static/logo/onekey.png';
|
|
42
42
|
this.version = '0.9.4';
|
|
43
43
|
this.onDisconnected = undefined;
|
|
@@ -126,9 +126,16 @@ class ProviderAlph extends web3_1.InteractiveSignerProvider {
|
|
|
126
126
|
if (options.onDisconnected) {
|
|
127
127
|
this.onDisconnected = options.onDisconnected;
|
|
128
128
|
}
|
|
129
|
+
const params = {};
|
|
130
|
+
Object.keys(options).forEach((key) => {
|
|
131
|
+
if (options[key] instanceof Function) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
params[key] = options[key];
|
|
135
|
+
});
|
|
129
136
|
return this.bridgeRequest({
|
|
130
137
|
method: 'enableIfConnected',
|
|
131
|
-
params
|
|
138
|
+
params,
|
|
132
139
|
});
|
|
133
140
|
}
|
|
134
141
|
get connectedAccount() {
|
package/dist/cjs/index.js
CHANGED
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./OnekeyAlphProvider"), exports);
|
|
18
18
|
__exportStar(require("./ProviderAlphBase"), exports);
|
|
19
|
+
__exportStar(require("./registerAlephiumProvider"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerAlephiumProvider = void 0;
|
|
4
|
+
function registerAlephiumProvider(provider) {
|
|
5
|
+
function announceProvider() {
|
|
6
|
+
window.dispatchEvent(new CustomEvent('announceAlephiumProvider', {
|
|
7
|
+
detail: Object.freeze({ provider }),
|
|
8
|
+
}));
|
|
9
|
+
}
|
|
10
|
+
window.addEventListener('requestAlephiumProvider', announceProvider);
|
|
11
|
+
announceProvider();
|
|
12
|
+
}
|
|
13
|
+
exports.registerAlephiumProvider = registerAlephiumProvider;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function registerAlephiumProvider(provider) {
|
|
2
|
+
function announceProvider() {
|
|
3
|
+
window.dispatchEvent(new CustomEvent('announceAlephiumProvider', {
|
|
4
|
+
detail: Object.freeze({ provider }),
|
|
5
|
+
}));
|
|
6
|
+
}
|
|
7
|
+
window.addEventListener('requestAlephiumProvider', announceProvider);
|
|
8
|
+
announceProvider();
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/onekey-alph-provider",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.17-alpha.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cross-inpage-provider"
|
|
6
6
|
],
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"@alephium/get-extension-wallet": "^1.5.2",
|
|
32
32
|
"@alephium/walletconnect-provider": "^1.5.2",
|
|
33
33
|
"@alephium/web3": "^1.5.2",
|
|
34
|
-
"@onekeyfe/cross-inpage-provider-core": "2.1.
|
|
35
|
-
"@onekeyfe/cross-inpage-provider-errors": "2.1.
|
|
36
|
-
"@onekeyfe/cross-inpage-provider-types": "2.1.
|
|
37
|
-
"@onekeyfe/extension-bridge-injected": "2.1.
|
|
34
|
+
"@onekeyfe/cross-inpage-provider-core": "2.1.17-alpha.0",
|
|
35
|
+
"@onekeyfe/cross-inpage-provider-errors": "2.1.17-alpha.0",
|
|
36
|
+
"@onekeyfe/cross-inpage-provider-types": "2.1.17-alpha.0",
|
|
37
|
+
"@onekeyfe/extension-bridge-injected": "2.1.17-alpha.0"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "2f084706f4501f4d8850017cd9586b825db88e5e"
|
|
40
40
|
}
|