@subwallet/extension-base 0.3.6-3 → 0.4.2-3
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/LICENSE +201 -201
- package/README.md +10 -10
- package/background/KoniTypes.d.ts +596 -462
- package/background/KoniTypes.js +2 -1
- package/background/RequestBytesSign.d.ts +12 -12
- package/background/RequestBytesSign.js +1 -1
- package/background/RequestExtrinsicSign.d.ts +12 -12
- package/background/RequestExtrinsicSign.js +1 -1
- package/background/handlers/Extension.d.ts +49 -49
- package/background/handlers/Extension.js +3 -3
- package/background/handlers/State.d.ts +87 -87
- package/background/handlers/State.js +1 -1
- package/background/handlers/Tabs.d.ts +24 -24
- package/background/handlers/Tabs.js +1 -1
- package/background/handlers/helpers.d.ts +1 -1
- package/background/handlers/helpers.js +1 -1
- package/background/handlers/index.d.ts +3 -3
- package/background/handlers/index.js +1 -1
- package/background/handlers/subscriptions.d.ts +5 -4
- package/background/handlers/subscriptions.js +4 -1
- package/background/types.d.ts +345 -345
- package/bundle.d.ts +1 -1
- package/bundle.js +1 -1
- package/cjs/background/KoniTypes.js +2 -1
- package/cjs/background/RequestBytesSign.js +1 -1
- package/cjs/background/RequestExtrinsicSign.js +1 -1
- package/cjs/background/handlers/Extension.js +5 -5
- package/cjs/background/handlers/State.js +1 -1
- package/cjs/background/handlers/Tabs.js +1 -1
- package/cjs/background/handlers/helpers.js +1 -1
- package/cjs/background/handlers/index.js +1 -1
- package/cjs/background/handlers/subscriptions.js +6 -1
- package/cjs/defaults.js +1 -1
- package/cjs/packageInfo.js +1 -1
- package/cjs/page/Accounts.js +1 -1
- package/cjs/page/Injected.js +1 -1
- package/cjs/page/Metadata.js +1 -1
- package/cjs/page/PostMessageProvider.js +28 -28
- package/cjs/page/Signer.js +1 -1
- package/cjs/page/index.js +1 -1
- package/cjs/stores/Accounts.js +1 -1
- package/cjs/stores/Base.js +1 -1
- package/cjs/stores/Metadata.js +1 -1
- package/cjs/utils/canDerive.js +1 -1
- package/cjs/utils/getId.js +1 -1
- package/defaults.d.ts +10 -10
- package/defaults.js +1 -1
- package/detectOther.d.ts +7 -7
- package/detectPackage.d.ts +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +4 -4
- package/packageInfo.d.ts +6 -6
- package/packageInfo.js +1 -1
- package/page/Accounts.d.ts +7 -7
- package/page/Accounts.js +1 -1
- package/page/Injected.d.ts +13 -13
- package/page/Injected.js +1 -1
- package/page/Metadata.d.ts +7 -7
- package/page/Metadata.js +1 -1
- package/page/PostMessageProvider.d.ts +62 -62
- package/page/PostMessageProvider.js +28 -28
- package/page/Signer.d.ts +8 -8
- package/page/Signer.js +1 -1
- package/page/index.d.ts +16 -16
- package/page/index.js +1 -1
- package/page/types.d.ts +6 -6
- package/stores/Accounts.d.ts +6 -6
- package/stores/Accounts.js +1 -1
- package/stores/Base.d.ts +10 -10
- package/stores/Base.js +1 -1
- package/stores/Metadata.d.ts +5 -5
- package/stores/Metadata.js +1 -1
- package/stores/index.d.ts +2 -2
- package/stores/index.js +1 -1
- package/types.d.ts +9 -9
- package/utils/canDerive.d.ts +2 -2
- package/utils/canDerive.js +1 -1
- package/utils/getId.d.ts +1 -1
- package/utils/getId.js +1 -1
- package/utils/index.d.ts +1 -1
- package/utils/index.js +1 -1
package/bundle.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { packageInfo } from './packageInfo';
|
|
1
|
+
export { packageInfo } from './packageInfo';
|
package/bundle.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TransferStep = exports.TransferErrorCode = exports.RMRK_VER = exports.CrowdloanParaState = exports.ApiInitStatus = exports.APIItemState = void 0;
|
|
7
|
-
// Copyright 2019-2022 @
|
|
7
|
+
// Copyright 2019-2022 @polkadot/extension-koni authors & contributors
|
|
8
8
|
// SPDX-License-Identifier: Apache-2.0
|
|
9
9
|
let ApiInitStatus;
|
|
10
10
|
exports.ApiInitStatus = ApiInitStatus;
|
|
@@ -55,6 +55,7 @@ exports.TransferErrorCode = TransferErrorCode;
|
|
|
55
55
|
TransferErrorCode["KEYRING_ERROR"] = "keyringError";
|
|
56
56
|
TransferErrorCode["TRANSFER_ERROR"] = "transferError";
|
|
57
57
|
TransferErrorCode["TIMEOUT"] = "timeout";
|
|
58
|
+
TransferErrorCode["UNSUPPORTED"] = "unsupported";
|
|
58
59
|
})(TransferErrorCode || (exports.TransferErrorCode = TransferErrorCode = {}));
|
|
59
60
|
|
|
60
61
|
let TransferStep;
|
|
@@ -9,7 +9,7 @@ var _wrapBytes = require("@subwallet/extension-dapp/wrapBytes");
|
|
|
9
9
|
|
|
10
10
|
var _util = require("@polkadot/util");
|
|
11
11
|
|
|
12
|
-
// Copyright 2019-2022 @
|
|
12
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
13
13
|
// SPDX-License-Identifier: Apache-2.0
|
|
14
14
|
class RequestBytesSign {
|
|
15
15
|
constructor(payload) {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
// Copyright 2019-2022 @
|
|
8
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
9
9
|
// SPDX-License-Identifier: Apache-2.0
|
|
10
10
|
class RequestExtrinsicSign {
|
|
11
11
|
constructor(payload) {
|
|
@@ -8,10 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = exports.SEED_LENGTHS = exports.SEED_DEFAULT_LENGTH = exports.ETH_DERIVE_DEFAULT = void 0;
|
|
9
9
|
exports.getSuri = getSuri;
|
|
10
10
|
|
|
11
|
-
var _helpers = require("@subwallet/extension-base/background/handlers/helpers");
|
|
12
|
-
|
|
13
|
-
var _subscriptions = require("@subwallet/extension-base/background/handlers/subscriptions");
|
|
14
|
-
|
|
15
11
|
var _defaults = require("@subwallet/extension-base/defaults");
|
|
16
12
|
|
|
17
13
|
var _types = require("@polkadot/types");
|
|
@@ -24,7 +20,11 @@ var _util = require("@polkadot/util");
|
|
|
24
20
|
|
|
25
21
|
var _utilCrypto = require("@polkadot/util-crypto");
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
var _helpers = require("./helpers");
|
|
24
|
+
|
|
25
|
+
var _subscriptions = require("./subscriptions");
|
|
26
|
+
|
|
27
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
28
28
|
// SPDX-License-Identifier: Apache-2.0
|
|
29
29
|
const SEED_DEFAULT_LENGTH = 12;
|
|
30
30
|
exports.SEED_DEFAULT_LENGTH = SEED_DEFAULT_LENGTH;
|
|
@@ -23,7 +23,7 @@ var _stores = require("../../stores");
|
|
|
23
23
|
|
|
24
24
|
var _helpers = require("./helpers");
|
|
25
25
|
|
|
26
|
-
// Copyright 2019-2022 @
|
|
26
|
+
// Copyright 2019-2022 @polkadot/extension-bg authors & contributors
|
|
27
27
|
// SPDX-License-Identifier: Apache-2.0
|
|
28
28
|
const NOTIFICATION_URL = chrome.extension.getURL('notification.html');
|
|
29
29
|
const POPUP_WINDOW_OPTS = {
|
|
@@ -27,7 +27,7 @@ var _helpers = require("./helpers");
|
|
|
27
27
|
|
|
28
28
|
var _subscriptions = require("./subscriptions");
|
|
29
29
|
|
|
30
|
-
// Copyright 2019-2022 @
|
|
30
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
31
31
|
// SPDX-License-Identifier: Apache-2.0
|
|
32
32
|
function transformAccounts(accounts) {
|
|
33
33
|
let anyType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.withErrorLog = withErrorLog;
|
|
7
7
|
|
|
8
|
-
// Copyright 2019-2022 @
|
|
8
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
9
9
|
// SPDX-License-Identifier: Apache-2.0
|
|
10
10
|
function withErrorLog(fn) {
|
|
11
11
|
try {
|
|
@@ -17,7 +17,7 @@ var _State = _interopRequireDefault(require("./State"));
|
|
|
17
17
|
|
|
18
18
|
var _Tabs = _interopRequireDefault(require("./Tabs"));
|
|
19
19
|
|
|
20
|
-
// Copyright 2019-2022 @
|
|
20
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
21
21
|
// SPDX-License-Identifier: Apache-2.0
|
|
22
22
|
const state = new _State.default();
|
|
23
23
|
const extension = new _Extension.default(state);
|
|
@@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createSubscription = createSubscription;
|
|
7
|
+
exports.isSubscriptionRunning = isSubscriptionRunning;
|
|
7
8
|
exports.unsubscribe = unsubscribe;
|
|
8
|
-
// Copyright 2019-2022 @
|
|
9
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
9
10
|
// SPDX-License-Identifier: Apache-2.0
|
|
10
11
|
const subscriptions = {}; // return a subscription callback, that will send the data to the caller via the port
|
|
11
12
|
|
|
@@ -19,6 +20,10 @@ function createSubscription(id, port) {
|
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function isSubscriptionRunning(id) {
|
|
26
|
+
return !!subscriptions[id];
|
|
22
27
|
} // clear a previous subscriber
|
|
23
28
|
|
|
24
29
|
|
package/cjs/defaults.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.PORT_EXTENSION = exports.PORT_CONTENT = exports.PHISHING_PAGE_REDIRECT = exports.PASSWORD_EXPIRY_MS = exports.PASSWORD_EXPIRY_MIN = exports.MESSAGE_ORIGIN_PAGE = exports.MESSAGE_ORIGIN_CONTENT = exports.EXTENSION_PREFIX = exports.ALLOWED_PATH = void 0;
|
|
7
|
-
// Copyright 2019-2022 @
|
|
7
|
+
// Copyright 2019-2022 @polkadot/extension-base authors & contributors
|
|
8
8
|
// SPDX-License-Identifier: Apache-2.0
|
|
9
9
|
const ALLOWED_PATH = ['/', '/account/import-ledger', '/account/restore-json', '/account/create'];
|
|
10
10
|
exports.ALLOWED_PATH = ALLOWED_PATH;
|
package/cjs/packageInfo.js
CHANGED
package/cjs/page/Accounts.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
// Copyright 2019-2022 @
|
|
7
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
8
8
|
// SPDX-License-Identifier: Apache-2.0
|
|
9
9
|
// External to class, this.# is not private enough (yet)
|
|
10
10
|
let sendRequest;
|
package/cjs/page/Injected.js
CHANGED
|
@@ -15,7 +15,7 @@ var _PostMessageProvider = _interopRequireDefault(require("./PostMessageProvider
|
|
|
15
15
|
|
|
16
16
|
var _Signer = _interopRequireDefault(require("./Signer"));
|
|
17
17
|
|
|
18
|
-
// Copyright 2019-2022 @
|
|
18
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
19
19
|
// SPDX-License-Identifier: Apache-2.0
|
|
20
20
|
class _default {
|
|
21
21
|
constructor(sendRequest) {
|
package/cjs/page/Metadata.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
// Copyright 2019-2022 @
|
|
7
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
8
8
|
// SPDX-License-Identifier: Apache-2.0
|
|
9
9
|
// External to class, this.# is not private enough (yet)
|
|
10
10
|
let sendRequest;
|
|
@@ -11,15 +11,15 @@ var _eventemitter = _interopRequireDefault(require("eventemitter3"));
|
|
|
11
11
|
|
|
12
12
|
var _util = require("@polkadot/util");
|
|
13
13
|
|
|
14
|
-
// Copyright 2019-2022 @
|
|
14
|
+
// Copyright 2019-2022 @polkadot/extension-base authors & contributors
|
|
15
15
|
// SPDX-License-Identifier: Apache-2.0
|
|
16
16
|
const l = (0, _util.logger)('PostMessageProvider');
|
|
17
17
|
// External to class, this.# is not private enough (yet)
|
|
18
18
|
let sendRequest;
|
|
19
|
-
/**
|
|
20
|
-
* @name PostMessageProvider
|
|
21
|
-
*
|
|
22
|
-
* @description Extension provider to be used by dapps
|
|
19
|
+
/**
|
|
20
|
+
* @name PostMessageProvider
|
|
21
|
+
*
|
|
22
|
+
* @description Extension provider to be used by dapps
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
class PostMessageProvider {
|
|
@@ -31,25 +31,25 @@ class PostMessageProvider {
|
|
|
31
31
|
|
|
32
32
|
#subscriptions = {}; // {[(type,subscriptionId)]: callback}
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
* @param {function} sendRequest The function to be called to send requests to the node
|
|
36
|
-
* @param {function} subscriptionNotificationHandler Channel for receiving subscription messages
|
|
34
|
+
/**
|
|
35
|
+
* @param {function} sendRequest The function to be called to send requests to the node
|
|
36
|
+
* @param {function} subscriptionNotificationHandler Channel for receiving subscription messages
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
constructor(_sendRequest) {
|
|
40
40
|
this.#eventemitter = new _eventemitter.default();
|
|
41
41
|
sendRequest = _sendRequest;
|
|
42
42
|
}
|
|
43
|
-
/**
|
|
44
|
-
* @description Returns a clone of the object
|
|
43
|
+
/**
|
|
44
|
+
* @description Returns a clone of the object
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
clone() {
|
|
49
49
|
return new PostMessageProvider(sendRequest);
|
|
50
50
|
}
|
|
51
|
-
/**
|
|
52
|
-
* @description Manually disconnect from the connection, clearing autoconnect logic
|
|
51
|
+
/**
|
|
52
|
+
* @description Manually disconnect from the connection, clearing autoconnect logic
|
|
53
53
|
*/
|
|
54
54
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
55
55
|
|
|
@@ -58,8 +58,8 @@ class PostMessageProvider {
|
|
|
58
58
|
// FIXME This should see if the extension's state's provider can disconnect
|
|
59
59
|
console.error('PostMessageProvider.disconnect() is not implemented.');
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
62
|
-
* @description Manually disconnect from the connection, clearing autoconnect logic
|
|
61
|
+
/**
|
|
62
|
+
* @description Manually disconnect from the connection, clearing autoconnect logic
|
|
63
63
|
*/
|
|
64
64
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
65
65
|
|
|
@@ -68,8 +68,8 @@ class PostMessageProvider {
|
|
|
68
68
|
// FIXME This should see if the extension's state's provider can disconnect
|
|
69
69
|
console.error('PostMessageProvider.disconnect() is not implemented.');
|
|
70
70
|
}
|
|
71
|
-
/**
|
|
72
|
-
* @summary `true` when this provider supports subscriptions
|
|
71
|
+
/**
|
|
72
|
+
* @summary `true` when this provider supports subscriptions
|
|
73
73
|
*/
|
|
74
74
|
|
|
75
75
|
|
|
@@ -77,9 +77,9 @@ class PostMessageProvider {
|
|
|
77
77
|
// FIXME This should see if the extension's state's provider has subscriptions
|
|
78
78
|
return true;
|
|
79
79
|
}
|
|
80
|
-
/**
|
|
81
|
-
* @summary Whether the node is connected or not.
|
|
82
|
-
* @return {boolean} true if connected
|
|
80
|
+
/**
|
|
81
|
+
* @summary Whether the node is connected or not.
|
|
82
|
+
* @return {boolean} true if connected
|
|
83
83
|
*/
|
|
84
84
|
|
|
85
85
|
|
|
@@ -90,11 +90,11 @@ class PostMessageProvider {
|
|
|
90
90
|
listProviders() {
|
|
91
91
|
return sendRequest('pub(rpc.listProviders)', undefined);
|
|
92
92
|
}
|
|
93
|
-
/**
|
|
94
|
-
* @summary Listens on events after having subscribed using the [[subscribe]] function.
|
|
95
|
-
* @param {ProviderInterfaceEmitted} type Event
|
|
96
|
-
* @param {ProviderInterfaceEmitCb} sub Callback
|
|
97
|
-
* @return unsubscribe function
|
|
93
|
+
/**
|
|
94
|
+
* @summary Listens on events after having subscribed using the [[subscribe]] function.
|
|
95
|
+
* @param {ProviderInterfaceEmitted} type Event
|
|
96
|
+
* @param {ProviderInterfaceEmitCb} sub Callback
|
|
97
|
+
* @return unsubscribe function
|
|
98
98
|
*/
|
|
99
99
|
|
|
100
100
|
|
|
@@ -128,8 +128,8 @@ class PostMessageProvider {
|
|
|
128
128
|
params
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
-
/**
|
|
132
|
-
* @summary Spawn a provider on the extension background.
|
|
131
|
+
/**
|
|
132
|
+
* @summary Spawn a provider on the extension background.
|
|
133
133
|
*/
|
|
134
134
|
|
|
135
135
|
|
|
@@ -159,8 +159,8 @@ class PostMessageProvider {
|
|
|
159
159
|
type
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
/**
|
|
163
|
-
* @summary Allows unsubscribing to subscriptions made with [[subscribe]].
|
|
162
|
+
/**
|
|
163
|
+
* @summary Allows unsubscribing to subscriptions made with [[subscribe]].
|
|
164
164
|
*/
|
|
165
165
|
|
|
166
166
|
|
package/cjs/page/Signer.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
// Copyright 2019-2022 @
|
|
7
|
+
// Copyright 2019-2022 @polkadot/extension-base authors & contributors
|
|
8
8
|
// SPDX-License-Identifier: Apache-2.0
|
|
9
9
|
// External to class, this.# is not private enough (yet)
|
|
10
10
|
let sendRequest;
|
package/cjs/page/index.js
CHANGED
|
@@ -16,7 +16,7 @@ var _getId = require("../utils/getId");
|
|
|
16
16
|
|
|
17
17
|
var _Injected = _interopRequireDefault(require("./Injected"));
|
|
18
18
|
|
|
19
|
-
// Copyright 2019-2022 @
|
|
19
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
20
20
|
// SPDX-License-Identifier: Apache-2.0
|
|
21
21
|
const handlers = {}; // a generic message sender that creates an event, returning a promise that will
|
|
22
22
|
// resolve once the event is resolved (by the response listener just below this)
|
package/cjs/stores/Accounts.js
CHANGED
|
@@ -11,7 +11,7 @@ var _defaults = require("../defaults");
|
|
|
11
11
|
|
|
12
12
|
var _Base = _interopRequireDefault(require("./Base"));
|
|
13
13
|
|
|
14
|
-
// Copyright 2019-2022 @
|
|
14
|
+
// Copyright 2019-2022 @polkadot/extension-base authors & contributors
|
|
15
15
|
// SPDX-License-Identifier: Apache-2.0
|
|
16
16
|
class AccountsStore extends _Base.default {
|
|
17
17
|
constructor() {
|
package/cjs/stores/Base.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
// Copyright 2019-2022 @
|
|
8
|
+
// Copyright 2019-2022 @polkadot/extension-base authors & contributors
|
|
9
9
|
// SPDX-License-Identifier: Apache-2.0
|
|
10
10
|
const lastError = type => {
|
|
11
11
|
const error = chrome.runtime.lastError;
|
package/cjs/stores/Metadata.js
CHANGED
|
@@ -11,7 +11,7 @@ var _defaults = require("../defaults");
|
|
|
11
11
|
|
|
12
12
|
var _Base = _interopRequireDefault(require("./Base"));
|
|
13
13
|
|
|
14
|
-
// Copyright 2019-2022 @
|
|
14
|
+
// Copyright 2019-2022 @polkadot/extension-base authors & contributors
|
|
15
15
|
// SPDX-License-Identifier: Apache-2.0
|
|
16
16
|
class MetadataStore extends _Base.default {
|
|
17
17
|
constructor() {
|
package/cjs/utils/canDerive.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.canDerive = canDerive;
|
|
7
7
|
|
|
8
|
-
// Copyright 2019-2022 @
|
|
8
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
9
9
|
// SPDX-License-Identifier: Apache-2.0
|
|
10
10
|
function canDerive(type) {
|
|
11
11
|
return !!type && ['ed25519', 'sr25519', 'ecdsa', 'ethereum'].includes(type);
|
package/cjs/utils/getId.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.getId = getId;
|
|
|
7
7
|
|
|
8
8
|
var _defaults = require("../defaults");
|
|
9
9
|
|
|
10
|
-
// Copyright 2019-2022 @
|
|
10
|
+
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
11
11
|
// SPDX-License-Identifier: Apache-2.0
|
|
12
12
|
let counter = 0;
|
|
13
13
|
|
package/defaults.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
declare const ALLOWED_PATH: readonly ["/", "/account/import-ledger", "/account/restore-json", "/account/create"];
|
|
2
|
-
declare const PHISHING_PAGE_REDIRECT = "/phishing-page-detected";
|
|
3
|
-
declare const EXTENSION_PREFIX: string;
|
|
4
|
-
declare const PORT_CONTENT: string;
|
|
5
|
-
declare const PORT_EXTENSION: string;
|
|
6
|
-
declare const MESSAGE_ORIGIN_PAGE: string;
|
|
7
|
-
declare const MESSAGE_ORIGIN_CONTENT: string;
|
|
8
|
-
declare const PASSWORD_EXPIRY_MIN = 15;
|
|
9
|
-
declare const PASSWORD_EXPIRY_MS: number;
|
|
10
|
-
export { ALLOWED_PATH, PASSWORD_EXPIRY_MIN, PASSWORD_EXPIRY_MS, PHISHING_PAGE_REDIRECT, EXTENSION_PREFIX, PORT_CONTENT, PORT_EXTENSION, MESSAGE_ORIGIN_PAGE, MESSAGE_ORIGIN_CONTENT };
|
|
1
|
+
declare const ALLOWED_PATH: readonly ["/", "/account/import-ledger", "/account/restore-json", "/account/create"];
|
|
2
|
+
declare const PHISHING_PAGE_REDIRECT = "/phishing-page-detected";
|
|
3
|
+
declare const EXTENSION_PREFIX: string;
|
|
4
|
+
declare const PORT_CONTENT: string;
|
|
5
|
+
declare const PORT_EXTENSION: string;
|
|
6
|
+
declare const MESSAGE_ORIGIN_PAGE: string;
|
|
7
|
+
declare const MESSAGE_ORIGIN_CONTENT: string;
|
|
8
|
+
declare const PASSWORD_EXPIRY_MIN = 15;
|
|
9
|
+
declare const PASSWORD_EXPIRY_MS: number;
|
|
10
|
+
export { ALLOWED_PATH, PASSWORD_EXPIRY_MIN, PASSWORD_EXPIRY_MS, PHISHING_PAGE_REDIRECT, EXTENSION_PREFIX, PORT_CONTENT, PORT_EXTENSION, MESSAGE_ORIGIN_PAGE, MESSAGE_ORIGIN_CONTENT };
|
package/defaults.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright 2019-2022 @
|
|
1
|
+
// Copyright 2019-2022 @polkadot/extension-base authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
const ALLOWED_PATH = ['/', '/account/import-ledger', '/account/restore-json', '/account/create'];
|
|
4
4
|
const PHISHING_PAGE_REDIRECT = '/phishing-page-detected';
|
package/detectOther.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
name: string;
|
|
3
|
-
path: string;
|
|
4
|
-
type: string;
|
|
5
|
-
version: string;
|
|
6
|
-
}[];
|
|
7
|
-
export default _default;
|
|
1
|
+
declare const _default: {
|
|
2
|
+
name: string;
|
|
3
|
+
path: string;
|
|
4
|
+
type: string;
|
|
5
|
+
version: string;
|
|
6
|
+
}[];
|
|
7
|
+
export default _default;
|
package/detectPackage.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './bundle';
|
|
1
|
+
export * from './bundle';
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"./cjs/detectPackage.js"
|
|
18
18
|
],
|
|
19
19
|
"type": "module",
|
|
20
|
-
"version": "0.
|
|
20
|
+
"version": "0.4.2-3",
|
|
21
21
|
"main": "./cjs/index.js",
|
|
22
22
|
"module": "./index.js",
|
|
23
23
|
"types": "./index.d.ts",
|
|
@@ -199,9 +199,9 @@
|
|
|
199
199
|
"@polkadot/ui-settings": "^0.89.1",
|
|
200
200
|
"@polkadot/util": "^8.3.1",
|
|
201
201
|
"@polkadot/util-crypto": "^8.3.1",
|
|
202
|
-
"@subwallet/extension-chains": "^0.
|
|
203
|
-
"@subwallet/extension-dapp": "^0.
|
|
204
|
-
"@subwallet/extension-inject": "^0.
|
|
202
|
+
"@subwallet/extension-chains": "^0.4.2-3",
|
|
203
|
+
"@subwallet/extension-dapp": "^0.4.2-3",
|
|
204
|
+
"@subwallet/extension-inject": "^0.4.2-3",
|
|
205
205
|
"ethereumjs-tx": "^2.1.2",
|
|
206
206
|
"eventemitter3": "^4.0.7",
|
|
207
207
|
"rxjs": "^7.5.1",
|
package/packageInfo.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const packageInfo: {
|
|
2
|
-
name: string;
|
|
3
|
-
path: string;
|
|
4
|
-
type: string;
|
|
5
|
-
version: string;
|
|
6
|
-
};
|
|
1
|
+
export declare const packageInfo: {
|
|
2
|
+
name: string;
|
|
3
|
+
path: string;
|
|
4
|
+
type: string;
|
|
5
|
+
version: string;
|
|
6
|
+
};
|
package/packageInfo.js
CHANGED
|
@@ -5,5 +5,5 @@ export const packageInfo = {
|
|
|
5
5
|
name: '@subwallet/extension-base',
|
|
6
6
|
path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
|
|
7
7
|
type: 'esm',
|
|
8
|
-
version: '0.
|
|
8
|
+
version: '0.4.2-3'
|
|
9
9
|
};
|
package/page/Accounts.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { InjectedAccount, InjectedAccounts, Unsubcall } from '@subwallet/extension-inject/types';
|
|
2
|
-
import type { SendRequest } from './types';
|
|
3
|
-
export default class Accounts implements InjectedAccounts {
|
|
4
|
-
constructor(_sendRequest: SendRequest);
|
|
5
|
-
get(anyType?: boolean): Promise<InjectedAccount[]>;
|
|
6
|
-
subscribe(cb: (accounts: InjectedAccount[]) => unknown): Unsubcall;
|
|
7
|
-
}
|
|
1
|
+
import type { InjectedAccount, InjectedAccounts, Unsubcall } from '@subwallet/extension-inject/types';
|
|
2
|
+
import type { SendRequest } from './types';
|
|
3
|
+
export default class Accounts implements InjectedAccounts {
|
|
4
|
+
constructor(_sendRequest: SendRequest);
|
|
5
|
+
get(anyType?: boolean): Promise<InjectedAccount[]>;
|
|
6
|
+
subscribe(cb: (accounts: InjectedAccount[]) => unknown): Unsubcall;
|
|
7
|
+
}
|
package/page/Accounts.js
CHANGED
package/page/Injected.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { Injected } from '@subwallet/extension-inject/types';
|
|
2
|
-
import type { SendRequest } from './types';
|
|
3
|
-
import Accounts from './Accounts';
|
|
4
|
-
import Metadata from './Metadata';
|
|
5
|
-
import PostMessageProvider from './PostMessageProvider';
|
|
6
|
-
import Signer from './Signer';
|
|
7
|
-
export default class implements Injected {
|
|
8
|
-
readonly accounts: Accounts;
|
|
9
|
-
readonly metadata: Metadata;
|
|
10
|
-
readonly provider: PostMessageProvider;
|
|
11
|
-
readonly signer: Signer;
|
|
12
|
-
constructor(sendRequest: SendRequest);
|
|
13
|
-
}
|
|
1
|
+
import type { Injected } from '@subwallet/extension-inject/types';
|
|
2
|
+
import type { SendRequest } from './types';
|
|
3
|
+
import Accounts from './Accounts';
|
|
4
|
+
import Metadata from './Metadata';
|
|
5
|
+
import PostMessageProvider from './PostMessageProvider';
|
|
6
|
+
import Signer from './Signer';
|
|
7
|
+
export default class implements Injected {
|
|
8
|
+
readonly accounts: Accounts;
|
|
9
|
+
readonly metadata: Metadata;
|
|
10
|
+
readonly provider: PostMessageProvider;
|
|
11
|
+
readonly signer: Signer;
|
|
12
|
+
constructor(sendRequest: SendRequest);
|
|
13
|
+
}
|
package/page/Injected.js
CHANGED
package/page/Metadata.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { InjectedMetadata, InjectedMetadataKnown, MetadataDef } from '@subwallet/extension-inject/types';
|
|
2
|
-
import type { SendRequest } from './types';
|
|
3
|
-
export default class Metadata implements InjectedMetadata {
|
|
4
|
-
constructor(_sendRequest: SendRequest);
|
|
5
|
-
get(): Promise<InjectedMetadataKnown[]>;
|
|
6
|
-
provide(definition: MetadataDef): Promise<boolean>;
|
|
7
|
-
}
|
|
1
|
+
import type { InjectedMetadata, InjectedMetadataKnown, MetadataDef } from '@subwallet/extension-inject/types';
|
|
2
|
+
import type { SendRequest } from './types';
|
|
3
|
+
export default class Metadata implements InjectedMetadata {
|
|
4
|
+
constructor(_sendRequest: SendRequest);
|
|
5
|
+
get(): Promise<InjectedMetadataKnown[]>;
|
|
6
|
+
provide(definition: MetadataDef): Promise<boolean>;
|
|
7
|
+
}
|
package/page/Metadata.js
CHANGED