@subwallet/extension-base 0.6.7-1 → 0.6.7-2wr

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.
@@ -226,6 +226,7 @@ export interface ApiProps extends ApiState {
226
226
  isApiReadyOnce: boolean;
227
227
  isApiConnected: boolean;
228
228
  isEthereum: boolean;
229
+ isEthereumOnly: boolean;
229
230
  isApiInitialized: boolean;
230
231
  isReady: Promise<ApiProps>;
231
232
  apiRetry?: number;
@@ -393,6 +394,15 @@ export interface RequestAccountExportPrivateKey {
393
394
  }
394
395
  export interface ResponseAccountExportPrivateKey {
395
396
  privateKey: string;
397
+ publicKey: string;
398
+ }
399
+ export interface RequestCheckPublicAndSecretKey {
400
+ secretKey: string;
401
+ publicKey: string;
402
+ }
403
+ export interface ResponseCheckPublicAndSecretKey {
404
+ address: string;
405
+ isValid: boolean;
396
406
  }
397
407
  export interface RequestSeedCreateV2 {
398
408
  length?: SeedLengths;
@@ -769,6 +779,17 @@ export interface AccountExternalError {
769
779
  code: AccountExternalErrorCode;
770
780
  message: string;
771
781
  }
782
+ export interface RequestAccountCreateWithSecretKey {
783
+ publicKey: string;
784
+ secretKey: string;
785
+ password: string;
786
+ name: string;
787
+ isAllow: boolean;
788
+ }
789
+ export interface ResponseAccountCreateWithSecretKey {
790
+ errors: AccountExternalError[];
791
+ success: boolean;
792
+ }
772
793
  export declare type RequestEvmEvents = null;
773
794
  export declare type EvmEventType = 'connect' | 'disconnect' | 'accountsChanged' | 'chainChanged' | 'message' | 'data' | 'reconnect' | 'error';
774
795
  export declare type EvmAccountsChangedPayload = string[];
@@ -1116,6 +1137,26 @@ export interface TuringCancelStakeCompoundParams {
1116
1137
  address: string;
1117
1138
  password?: string;
1118
1139
  }
1140
+ export declare type SubscriptionServiceType = 'chainRegistry' | 'balance' | 'crowdloan' | 'staking';
1141
+ export declare type CronServiceType = 'price' | 'nft' | 'staking' | 'history' | 'recoverApi' | 'checkApiStatus';
1142
+ export declare type CronType = 'recoverApiMap' | 'checkApiMapStatus' | 'refreshHistory' | 'refreshNft' | 'refreshPrice' | 'refreshStakeUnlockingInfo' | 'refreshStakingReward';
1143
+ export interface RequestInitCronAndSubscription {
1144
+ subscription: {
1145
+ activeServices: SubscriptionServiceType[];
1146
+ };
1147
+ cron: {
1148
+ intervalMap: Partial<Record<CronType, number>>;
1149
+ activeServices: CronServiceType[];
1150
+ };
1151
+ }
1152
+ export interface RequestCronAndSubscriptionAction {
1153
+ subscriptionServices: SubscriptionServiceType[];
1154
+ cronServices: CronServiceType[];
1155
+ }
1156
+ export interface ActiveCronAndSubscriptionMap {
1157
+ subscription: Record<SubscriptionServiceType, boolean>;
1158
+ cron: Record<CronServiceType, boolean>;
1159
+ }
1119
1160
  export interface KoniRequestSignatures {
1120
1161
  'pri(staking.submitTuringCancelCompound)': [TuringCancelStakeCompoundParams, BasicTxResponse, BasicTxResponse];
1121
1162
  'pri(staking.turingCancelCompound)': [TuringCancelStakeCompoundParams, BasicTxInfo];
@@ -1192,6 +1233,7 @@ export interface KoniRequestSignatures {
1192
1233
  'pri(accounts.create.suriV2)': [RequestAccountCreateSuriV2, ResponseAccountCreateSuriV2];
1193
1234
  'pri(accounts.create.externalV2)': [RequestAccountCreateExternalV2, AccountExternalError[]];
1194
1235
  'pri(accounts.create.hardwareV2)': [RequestAccountCreateHardwareV2, boolean];
1236
+ 'pri(accounts.create.withSecret)': [RequestAccountCreateWithSecretKey, ResponseAccountCreateWithSecretKey];
1195
1237
  'pri(accounts.checkTransfer)': [RequestCheckTransfer, ResponseCheckTransfer];
1196
1238
  'pri(accounts.checkCrossChainTransfer)': [RequestCheckCrossChainTransfer, ResponseCheckCrossChainTransfer];
1197
1239
  'pri(accounts.transfer)': [RequestTransfer, Array<TransferError>, ResponseTransfer];
@@ -1200,6 +1242,7 @@ export interface KoniRequestSignatures {
1200
1242
  'pri(json.restoreV2)': [RequestJsonRestoreV2, void];
1201
1243
  'pri(json.batchRestoreV2)': [RequestBatchRestoreV2, void];
1202
1244
  'pri(accounts.exportPrivateKey)': [RequestAccountExportPrivateKey, ResponseAccountExportPrivateKey];
1245
+ 'pri(accounts.checkPublicAndSecretKey)': [RequestCheckPublicAndSecretKey, ResponseCheckPublicAndSecretKey];
1203
1246
  'pri(accounts.subscribeWithCurrentAddress)': [RequestAccountSubscribe, boolean, AccountsWithCurrentAddress];
1204
1247
  'pri(accounts.subscribeAccountsInputAddress)': [RequestAccountSubscribe, string, OptionInputAddress];
1205
1248
  'pri(accounts.saveRecent)': [RequestSaveRecentAccount, SingleAddress];
@@ -1248,6 +1291,17 @@ export interface KoniRequestSignatures {
1248
1291
  'pri(unStake.ledger.create)': [RequestUnStakeExternal, Array<BaseTxError>, ResponseUnStakeLedger];
1249
1292
  'pri(withdrawStake.ledger.create)': [RequestWithdrawStakeExternal, Array<BaseTxError>, ResponseWithdrawStakeLedger];
1250
1293
  'pri(authorize.subscribe)': [null, AuthUrls, AuthUrls];
1294
+ 'mobile(cronAndSubscription.init)': [RequestInitCronAndSubscription, ActiveCronAndSubscriptionMap];
1295
+ 'mobile(cronAndSubscription.activeService.subscribe)': [null, ActiveCronAndSubscriptionMap, ActiveCronAndSubscriptionMap];
1296
+ 'mobile(cronAndSubscription.start)': [RequestCronAndSubscriptionAction[], void];
1297
+ 'mobile(cronAndSubscription.stop)': [RequestCronAndSubscriptionAction[], void];
1298
+ 'mobile(cronAndSubscription.restart)': [RequestCronAndSubscriptionAction[], void];
1299
+ 'mobile(cron.start)': [CronServiceType[], void];
1300
+ 'mobile(cron.stop)': [CronServiceType[], void];
1301
+ 'mobile(cron.restart)': [CronServiceType[], void];
1302
+ 'mobile(subscription.start)': [SubscriptionServiceType[], void];
1303
+ 'mobile(subscription.stop)': [SubscriptionServiceType[], void];
1304
+ 'mobile(subscription.restart)': [SubscriptionServiceType[], void];
1251
1305
  }
1252
1306
  export interface ApplicationMetadataType {
1253
1307
  version: string;
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
  const ALLOWED_PATH = ['/', '/account/import-ledger', '/account/restore-json', '/account/create', '/account/settings'];
@@ -12,6 +12,8 @@ const PHISHING_PAGE_REDIRECT = '/phishing-page-detected';
12
12
  exports.PHISHING_PAGE_REDIRECT = PHISHING_PAGE_REDIRECT;
13
13
  const EXTENSION_PREFIX = process.env.EXTENSION_PREFIX || '';
14
14
  exports.EXTENSION_PREFIX = EXTENSION_PREFIX;
15
+ const PORT_MOBILE = `${EXTENSION_PREFIX}mobile`;
16
+ exports.PORT_MOBILE = PORT_MOBILE;
15
17
  const PORT_CONTENT = `${EXTENSION_PREFIX}koni-content`;
16
18
  exports.PORT_CONTENT = PORT_CONTENT;
17
19
  const PORT_EXTENSION = `${EXTENSION_PREFIX}koni-extension`;
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
@@ -3,10 +3,11 @@
3
3
  const ALLOWED_PATH = ['/', '/account/import-ledger', '/account/restore-json', '/account/create', '/account/settings'];
4
4
  const PHISHING_PAGE_REDIRECT = '/phishing-page-detected';
5
5
  const EXTENSION_PREFIX = process.env.EXTENSION_PREFIX || '';
6
+ const PORT_MOBILE = `${EXTENSION_PREFIX}mobile`;
6
7
  const PORT_CONTENT = `${EXTENSION_PREFIX}koni-content`;
7
8
  const PORT_EXTENSION = `${EXTENSION_PREFIX}koni-extension`;
8
9
  const MESSAGE_ORIGIN_PAGE = `${EXTENSION_PREFIX}koni-page`;
9
10
  const MESSAGE_ORIGIN_CONTENT = `${EXTENSION_PREFIX}koni-content`;
10
11
  const PASSWORD_EXPIRY_MIN = 15;
11
12
  const PASSWORD_EXPIRY_MS = PASSWORD_EXPIRY_MIN * 60 * 1000;
12
- export { ALLOWED_PATH, PASSWORD_EXPIRY_MIN, PASSWORD_EXPIRY_MS, PHISHING_PAGE_REDIRECT, EXTENSION_PREFIX, PORT_CONTENT, PORT_EXTENSION, MESSAGE_ORIGIN_PAGE, MESSAGE_ORIGIN_CONTENT };
13
+ 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.6.7-1",
20
+ "version": "0.6.7-2wr",
21
21
  "main": "./cjs/index.js",
22
22
  "module": "./index.js",
23
23
  "types": "./index.d.ts",
@@ -235,4 +235,4 @@
235
235
  "web3-core": "^1.8.0",
236
236
  "web3-core-helpers": "^1.8.0"
237
237
  }
238
- }
238
+ }