@subwallet/extension-base 0.6.10-0 → 0.7.1-wr
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/background/KoniTypes.d.ts +34 -0
- package/background/types.d.ts +1 -0
- package/cjs/defaults.js +3 -1
- package/cjs/packageInfo.js +1 -1
- package/cjs/page/PostMessageProvider.js +1 -0
- package/defaults.d.ts +2 -1
- package/defaults.js +2 -1
- package/package.json +5 -5
- package/packageInfo.js +1 -1
- package/page/PostMessageProvider.d.ts +1 -0
- package/page/PostMessageProvider.js +1 -0
|
@@ -791,6 +791,7 @@ export interface RequestAccountCreateExternalV2 {
|
|
|
791
791
|
name: string;
|
|
792
792
|
isEthereum: boolean;
|
|
793
793
|
isAllowed: boolean;
|
|
794
|
+
isReadOnly: boolean;
|
|
794
795
|
}
|
|
795
796
|
export interface RequestAccountCreateHardwareV2 {
|
|
796
797
|
accountIndex: number;
|
|
@@ -1158,6 +1159,26 @@ export interface TuringCancelStakeCompoundParams {
|
|
|
1158
1159
|
address: string;
|
|
1159
1160
|
password?: string;
|
|
1160
1161
|
}
|
|
1162
|
+
export declare type SubscriptionServiceType = 'chainRegistry' | 'balance' | 'crowdloan' | 'staking';
|
|
1163
|
+
export declare type CronServiceType = 'price' | 'nft' | 'staking' | 'history' | 'recoverApi' | 'checkApiStatus';
|
|
1164
|
+
export declare type CronType = 'recoverApiMap' | 'checkApiMapStatus' | 'refreshHistory' | 'refreshNft' | 'refreshPrice' | 'refreshStakeUnlockingInfo' | 'refreshStakingReward';
|
|
1165
|
+
export interface RequestInitCronAndSubscription {
|
|
1166
|
+
subscription: {
|
|
1167
|
+
activeServices: SubscriptionServiceType[];
|
|
1168
|
+
};
|
|
1169
|
+
cron: {
|
|
1170
|
+
intervalMap: Partial<Record<CronType, number>>;
|
|
1171
|
+
activeServices: CronServiceType[];
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
export interface RequestCronAndSubscriptionAction {
|
|
1175
|
+
subscriptionServices: SubscriptionServiceType[];
|
|
1176
|
+
cronServices: CronServiceType[];
|
|
1177
|
+
}
|
|
1178
|
+
export interface ActiveCronAndSubscriptionMap {
|
|
1179
|
+
subscription: Record<SubscriptionServiceType, boolean>;
|
|
1180
|
+
cron: Record<CronServiceType, boolean>;
|
|
1181
|
+
}
|
|
1161
1182
|
export interface KoniRequestSignatures {
|
|
1162
1183
|
'pri(staking.submitTuringCancelCompound)': [TuringCancelStakeCompoundParams, BasicTxResponse, BasicTxResponse];
|
|
1163
1184
|
'pri(staking.turingCancelCompound)': [TuringCancelStakeCompoundParams, BasicTxInfo];
|
|
@@ -1250,6 +1271,7 @@ export interface KoniRequestSignatures {
|
|
|
1250
1271
|
'pri(accounts.saveRecent)': [RequestSaveRecentAccount, SingleAddress];
|
|
1251
1272
|
'pri(accounts.triggerSubscription)': [null, boolean];
|
|
1252
1273
|
'pri(accounts.get.meta)': [RequestAccountMeta, ResponseAccountMeta];
|
|
1274
|
+
'pri(accounts.updateCurrentAddress)': [string, boolean];
|
|
1253
1275
|
'pri(currentAccount.saveAddress)': [RequestCurrentAccountAddress, boolean, CurrentAccountInfo];
|
|
1254
1276
|
'pri(settings.changeBalancesVisibility)': [null, boolean, ResponseSettingsType];
|
|
1255
1277
|
'pri(settings.subscribe)': [null, ResponseSettingsType, ResponseSettingsType];
|
|
@@ -1293,6 +1315,18 @@ export interface KoniRequestSignatures {
|
|
|
1293
1315
|
'pri(unStake.ledger.create)': [RequestUnStakeExternal, Array<BaseTxError>, ResponseUnStakeLedger];
|
|
1294
1316
|
'pri(withdrawStake.ledger.create)': [RequestWithdrawStakeExternal, Array<BaseTxError>, ResponseWithdrawStakeLedger];
|
|
1295
1317
|
'pri(authorize.subscribe)': [null, AuthUrls, AuthUrls];
|
|
1318
|
+
'mobile(ping)': [null, string];
|
|
1319
|
+
'mobile(cronAndSubscription.init)': [RequestInitCronAndSubscription, ActiveCronAndSubscriptionMap];
|
|
1320
|
+
'mobile(cronAndSubscription.activeService.subscribe)': [null, ActiveCronAndSubscriptionMap, ActiveCronAndSubscriptionMap];
|
|
1321
|
+
'mobile(cronAndSubscription.start)': [RequestCronAndSubscriptionAction, void];
|
|
1322
|
+
'mobile(cronAndSubscription.stop)': [RequestCronAndSubscriptionAction, void];
|
|
1323
|
+
'mobile(cronAndSubscription.restart)': [RequestCronAndSubscriptionAction, void];
|
|
1324
|
+
'mobile(cron.start)': [CronServiceType[], void];
|
|
1325
|
+
'mobile(cron.stop)': [CronServiceType[], void];
|
|
1326
|
+
'mobile(cron.restart)': [CronServiceType[], void];
|
|
1327
|
+
'mobile(subscription.start)': [SubscriptionServiceType[], void];
|
|
1328
|
+
'mobile(subscription.stop)': [SubscriptionServiceType[], void];
|
|
1329
|
+
'mobile(subscription.restart)': [SubscriptionServiceType[], void];
|
|
1296
1330
|
}
|
|
1297
1331
|
export interface ApplicationMetadataType {
|
|
1298
1332
|
version: string;
|
package/background/types.d.ts
CHANGED
package/cjs/defaults.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
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;
|
|
6
|
+
exports.PORT_MOBILE = 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
7
|
// Copyright 2019-2022 @polkadot/extension-base authors & contributors
|
|
8
8
|
// SPDX-License-Identifier: Apache-2.0
|
|
9
9
|
|
|
@@ -13,6 +13,8 @@ const PHISHING_PAGE_REDIRECT = '/phishing-page-detected';
|
|
|
13
13
|
exports.PHISHING_PAGE_REDIRECT = PHISHING_PAGE_REDIRECT;
|
|
14
14
|
const EXTENSION_PREFIX = process.env.EXTENSION_PREFIX || '';
|
|
15
15
|
exports.EXTENSION_PREFIX = EXTENSION_PREFIX;
|
|
16
|
+
const PORT_MOBILE = `${EXTENSION_PREFIX}mobile`;
|
|
17
|
+
exports.PORT_MOBILE = PORT_MOBILE;
|
|
16
18
|
const PORT_CONTENT = `${EXTENSION_PREFIX}koni-content`;
|
|
17
19
|
exports.PORT_CONTENT = PORT_CONTENT;
|
|
18
20
|
const PORT_EXTENSION = `${EXTENSION_PREFIX}koni-extension`;
|
package/cjs/packageInfo.js
CHANGED
package/defaults.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
declare const ALLOWED_PATH: readonly ["/", "/account/import-ledger", "/account/restore-json", "/account/create", "/account/settings"];
|
|
2
2
|
declare const PHISHING_PAGE_REDIRECT = "/phishing-page-detected";
|
|
3
3
|
declare const EXTENSION_PREFIX: string;
|
|
4
|
+
declare const PORT_MOBILE: string;
|
|
4
5
|
declare const PORT_CONTENT: string;
|
|
5
6
|
declare const PORT_EXTENSION: string;
|
|
6
7
|
declare const MESSAGE_ORIGIN_PAGE: string;
|
|
7
8
|
declare const MESSAGE_ORIGIN_CONTENT: string;
|
|
8
9
|
declare const PASSWORD_EXPIRY_MIN = 15;
|
|
9
10
|
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 };
|
|
11
|
+
export { ALLOWED_PATH, PASSWORD_EXPIRY_MIN, PASSWORD_EXPIRY_MS, PHISHING_PAGE_REDIRECT, EXTENSION_PREFIX, PORT_MOBILE, PORT_CONTENT, PORT_EXTENSION, MESSAGE_ORIGIN_PAGE, MESSAGE_ORIGIN_CONTENT };
|
package/defaults.js
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
const ALLOWED_PATH = ['/', '/account/import-ledger', '/account/restore-json', '/account/create', '/account/settings'];
|
|
5
5
|
const PHISHING_PAGE_REDIRECT = '/phishing-page-detected';
|
|
6
6
|
const EXTENSION_PREFIX = process.env.EXTENSION_PREFIX || '';
|
|
7
|
+
const PORT_MOBILE = `${EXTENSION_PREFIX}mobile`;
|
|
7
8
|
const PORT_CONTENT = `${EXTENSION_PREFIX}koni-content`;
|
|
8
9
|
const PORT_EXTENSION = `${EXTENSION_PREFIX}koni-extension`;
|
|
9
10
|
const MESSAGE_ORIGIN_PAGE = `${EXTENSION_PREFIX}koni-page`;
|
|
10
11
|
const MESSAGE_ORIGIN_CONTENT = `${EXTENSION_PREFIX}koni-content`;
|
|
11
12
|
const PASSWORD_EXPIRY_MIN = 15;
|
|
12
13
|
const PASSWORD_EXPIRY_MS = PASSWORD_EXPIRY_MIN * 60 * 1000;
|
|
13
|
-
export { ALLOWED_PATH, PASSWORD_EXPIRY_MIN, PASSWORD_EXPIRY_MS, PHISHING_PAGE_REDIRECT, EXTENSION_PREFIX, PORT_CONTENT, PORT_EXTENSION, MESSAGE_ORIGIN_PAGE, MESSAGE_ORIGIN_CONTENT };
|
|
14
|
+
export { ALLOWED_PATH, PASSWORD_EXPIRY_MIN, PASSWORD_EXPIRY_MS, PHISHING_PAGE_REDIRECT, EXTENSION_PREFIX, PORT_MOBILE, PORT_CONTENT, PORT_EXTENSION, MESSAGE_ORIGIN_PAGE, MESSAGE_ORIGIN_CONTENT };
|
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.7.1wr",
|
|
21
21
|
"main": "./cjs/index.js",
|
|
22
22
|
"module": "./index.js",
|
|
23
23
|
"types": "./index.d.ts",
|
|
@@ -224,9 +224,9 @@
|
|
|
224
224
|
"@polkadot/ui-settings": "^2.9.10",
|
|
225
225
|
"@polkadot/util": "^10.1.9",
|
|
226
226
|
"@polkadot/util-crypto": "^10.1.9",
|
|
227
|
-
"@subwallet/extension-chains": "^0.
|
|
228
|
-
"@subwallet/extension-dapp": "^0.
|
|
229
|
-
"@subwallet/extension-inject": "^0.
|
|
227
|
+
"@subwallet/extension-chains": "^0.7.1",
|
|
228
|
+
"@subwallet/extension-dapp": "^0.7.1",
|
|
229
|
+
"@subwallet/extension-inject": "^0.7.1",
|
|
230
230
|
"ethereumjs-tx": "^2.1.2",
|
|
231
231
|
"eventemitter3": "^4.0.7",
|
|
232
232
|
"rlp": "^3.0.0",
|
|
@@ -235,4 +235,4 @@
|
|
|
235
235
|
"web3-core": "^1.8.0",
|
|
236
236
|
"web3-core-helpers": "^1.8.0"
|
|
237
237
|
}
|
|
238
|
-
}
|
|
238
|
+
}
|
package/packageInfo.js
CHANGED
|
@@ -7,5 +7,5 @@ export const packageInfo = {
|
|
|
7
7
|
name: '@subwallet/extension-base',
|
|
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: '0.
|
|
10
|
+
version: '0.7.1'
|
|
11
11
|
};
|
|
@@ -14,6 +14,7 @@ interface SubscriptionHandler {
|
|
|
14
14
|
*/
|
|
15
15
|
export default class PostMessageProvider implements InjectedProvider {
|
|
16
16
|
#private;
|
|
17
|
+
isClonable: boolean;
|
|
17
18
|
/**
|
|
18
19
|
* @param {function} sendRequest The function to be called to send requests to the node
|
|
19
20
|
* @param {function} subscriptionNotificationHandler Channel for receiving subscription messages
|