@subwallet/extension-base 0.6.9-0wr → 0.6.10-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.
@@ -68,38 +68,56 @@ export interface RejectResolver {
68
68
  export interface RequestForgetSite {
69
69
  url: string;
70
70
  }
71
+ export declare enum StakingType {
72
+ NOMINATED = "nominated",
73
+ POOLED = "pooled"
74
+ }
71
75
  export interface StakingRewardItem {
72
76
  state: APIItemState;
73
77
  name: string;
74
- chainId: string;
78
+ chain: string;
79
+ address: string;
80
+ type: StakingType;
75
81
  latestReward?: string;
76
82
  totalReward?: string;
77
83
  totalSlash?: string;
78
- smartContract?: string;
79
84
  }
80
- export interface StakingRewardJson {
81
- ready: boolean;
82
- details: Array<StakingRewardItem>;
85
+ export interface UnlockingStakeInfo {
86
+ chain: string;
87
+ address: string;
88
+ type: StakingType;
89
+ nextWithdrawal: number;
90
+ redeemable: number;
91
+ nextWithdrawalAmount: number;
92
+ nextWithdrawalAction?: string;
93
+ validatorAddress?: string;
83
94
  }
84
95
  export interface StakingItem {
85
96
  name: string;
86
- chainId: string;
97
+ chain: string;
98
+ address: string;
87
99
  balance?: string;
88
100
  activeBalance?: string;
89
101
  unlockingBalance?: string;
90
102
  nativeToken: string;
91
103
  unit?: string;
104
+ type: StakingType;
92
105
  state: APIItemState;
93
106
  unlockingInfo?: UnlockingStakeInfo;
107
+ rewardInfo?: StakingRewardItem;
94
108
  }
95
109
  export interface StakingJson {
96
110
  reset?: boolean;
97
111
  ready?: boolean;
98
- details: Record<string, StakingItem>;
112
+ details: StakingItem[];
99
113
  }
100
- export interface StakingStoreJson {
101
- bonded: Record<string, StakingItem>;
102
- reward: Array<StakingRewardItem>;
114
+ export interface StakingRewardJson {
115
+ ready: boolean;
116
+ details: Array<StakingRewardItem>;
117
+ }
118
+ export interface StakeUnlockingJson {
119
+ timestamp: number;
120
+ details: UnlockingStakeInfo[];
103
121
  }
104
122
  export interface PriceJson {
105
123
  ready?: boolean;
@@ -773,7 +791,6 @@ export interface RequestAccountCreateExternalV2 {
773
791
  name: string;
774
792
  isEthereum: boolean;
775
793
  isAllowed: boolean;
776
- isReadOnly: boolean;
777
794
  }
778
795
  export interface RequestAccountCreateHardwareV2 {
779
796
  accountIndex: number;
@@ -1011,17 +1028,6 @@ export interface DelegationItem {
1011
1028
  hasScheduledRequest: boolean;
1012
1029
  icon?: string;
1013
1030
  }
1014
- export interface UnlockingStakeInfo {
1015
- nextWithdrawal: number;
1016
- redeemable: number;
1017
- nextWithdrawalAmount: number;
1018
- nextWithdrawalAction?: string;
1019
- validatorAddress?: string;
1020
- }
1021
- export interface StakeUnlockingJson {
1022
- timestamp: number;
1023
- details: Record<string, UnlockingStakeInfo>;
1024
- }
1025
1031
  export interface StakeWithdrawalParams {
1026
1032
  address: string;
1027
1033
  networkKey: string;
@@ -1152,26 +1158,6 @@ export interface TuringCancelStakeCompoundParams {
1152
1158
  address: string;
1153
1159
  password?: string;
1154
1160
  }
1155
- export declare type SubscriptionServiceType = 'chainRegistry' | 'balance' | 'crowdloan' | 'staking';
1156
- export declare type CronServiceType = 'price' | 'nft' | 'staking' | 'history' | 'recoverApi' | 'checkApiStatus';
1157
- export declare type CronType = 'recoverApiMap' | 'checkApiMapStatus' | 'refreshHistory' | 'refreshNft' | 'refreshPrice' | 'refreshStakeUnlockingInfo' | 'refreshStakingReward';
1158
- export interface RequestInitCronAndSubscription {
1159
- subscription: {
1160
- activeServices: SubscriptionServiceType[];
1161
- };
1162
- cron: {
1163
- intervalMap: Partial<Record<CronType, number>>;
1164
- activeServices: CronServiceType[];
1165
- };
1166
- }
1167
- export interface RequestCronAndSubscriptionAction {
1168
- subscriptionServices: SubscriptionServiceType[];
1169
- cronServices: CronServiceType[];
1170
- }
1171
- export interface ActiveCronAndSubscriptionMap {
1172
- subscription: Record<SubscriptionServiceType, boolean>;
1173
- cron: Record<CronServiceType, boolean>;
1174
- }
1175
1161
  export interface KoniRequestSignatures {
1176
1162
  'pri(staking.submitTuringCancelCompound)': [TuringCancelStakeCompoundParams, BasicTxResponse, BasicTxResponse];
1177
1163
  'pri(staking.turingCancelCompound)': [TuringCancelStakeCompoundParams, BasicTxInfo];
@@ -1264,7 +1250,6 @@ export interface KoniRequestSignatures {
1264
1250
  'pri(accounts.saveRecent)': [RequestSaveRecentAccount, SingleAddress];
1265
1251
  'pri(accounts.triggerSubscription)': [null, boolean];
1266
1252
  'pri(accounts.get.meta)': [RequestAccountMeta, ResponseAccountMeta];
1267
- 'pri(accounts.updateCurrentAddress)': [string, boolean];
1268
1253
  'pri(currentAccount.saveAddress)': [RequestCurrentAccountAddress, boolean, CurrentAccountInfo];
1269
1254
  'pri(settings.changeBalancesVisibility)': [null, boolean, ResponseSettingsType];
1270
1255
  'pri(settings.subscribe)': [null, ResponseSettingsType, ResponseSettingsType];
@@ -1308,18 +1293,6 @@ export interface KoniRequestSignatures {
1308
1293
  'pri(unStake.ledger.create)': [RequestUnStakeExternal, Array<BaseTxError>, ResponseUnStakeLedger];
1309
1294
  'pri(withdrawStake.ledger.create)': [RequestWithdrawStakeExternal, Array<BaseTxError>, ResponseWithdrawStakeLedger];
1310
1295
  'pri(authorize.subscribe)': [null, AuthUrls, AuthUrls];
1311
- 'mobile(ping)': [null, string];
1312
- 'mobile(cronAndSubscription.init)': [RequestInitCronAndSubscription, ActiveCronAndSubscriptionMap];
1313
- 'mobile(cronAndSubscription.activeService.subscribe)': [null, ActiveCronAndSubscriptionMap, ActiveCronAndSubscriptionMap];
1314
- 'mobile(cronAndSubscription.start)': [RequestCronAndSubscriptionAction, void];
1315
- 'mobile(cronAndSubscription.stop)': [RequestCronAndSubscriptionAction, void];
1316
- 'mobile(cronAndSubscription.restart)': [RequestCronAndSubscriptionAction, void];
1317
- 'mobile(cron.start)': [CronServiceType[], void];
1318
- 'mobile(cron.stop)': [CronServiceType[], void];
1319
- 'mobile(cron.restart)': [CronServiceType[], void];
1320
- 'mobile(subscription.start)': [SubscriptionServiceType[], void];
1321
- 'mobile(subscription.stop)': [SubscriptionServiceType[], void];
1322
- 'mobile(subscription.restart)': [SubscriptionServiceType[], void];
1323
1296
  }
1324
1297
  export interface ApplicationMetadataType {
1325
1298
  version: string;
@@ -8,6 +8,11 @@ export let ApiInitStatus;
8
8
  ApiInitStatus[ApiInitStatus["NOT_SUPPORT"] = 2] = "NOT_SUPPORT";
9
9
  ApiInitStatus[ApiInitStatus["NOT_EXIST"] = 3] = "NOT_EXIST";
10
10
  })(ApiInitStatus || (ApiInitStatus = {}));
11
+ export let StakingType;
12
+ (function (StakingType) {
13
+ StakingType["NOMINATED"] = "nominated";
14
+ StakingType["POOLED"] = "pooled";
15
+ })(StakingType || (StakingType = {}));
11
16
  export let APIItemState;
12
17
  (function (APIItemState) {
13
18
  APIItemState["PENDING"] = "pending";
@@ -28,7 +28,6 @@ export interface AccountJson extends KeyringPair$Meta {
28
28
  originGenesisHash?: string | null;
29
29
  isExternal?: boolean;
30
30
  isHardware?: boolean;
31
- isReadOnly?: boolean;
32
31
  isHidden?: boolean;
33
32
  name?: string;
34
33
  parentAddress?: string;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TransferStep = exports.TransferErrorCode = exports.RMRK_VER = exports.NETWORK_STATUS = exports.NETWORK_ERROR = exports.ExternalRequestPromiseStatus = exports.CustomTokenType = exports.CrowdloanParaState = exports.ContractType = exports.BasicTxErrorCode = exports.BasicTxError = exports.ApiInitStatus = exports.AccountExternalErrorCode = exports.APIItemState = void 0;
6
+ exports.TransferStep = exports.TransferErrorCode = exports.StakingType = exports.RMRK_VER = exports.NETWORK_STATUS = exports.NETWORK_ERROR = exports.ExternalRequestPromiseStatus = exports.CustomTokenType = exports.CrowdloanParaState = exports.ContractType = exports.BasicTxErrorCode = exports.BasicTxError = exports.ApiInitStatus = exports.AccountExternalErrorCode = exports.APIItemState = void 0;
7
7
  // Copyright 2019-2022 @polkadot/extension-koni authors & contributors
8
8
  // SPDX-License-Identifier: Apache-2.0
9
9
  let ApiInitStatus;
@@ -14,6 +14,12 @@ exports.ApiInitStatus = ApiInitStatus;
14
14
  ApiInitStatus[ApiInitStatus["NOT_SUPPORT"] = 2] = "NOT_SUPPORT";
15
15
  ApiInitStatus[ApiInitStatus["NOT_EXIST"] = 3] = "NOT_EXIST";
16
16
  })(ApiInitStatus || (exports.ApiInitStatus = ApiInitStatus = {}));
17
+ let StakingType;
18
+ exports.StakingType = StakingType;
19
+ (function (StakingType) {
20
+ StakingType["NOMINATED"] = "nominated";
21
+ StakingType["POOLED"] = "pooled";
22
+ })(StakingType || (exports.StakingType = StakingType = {}));
17
23
  let APIItemState;
18
24
  exports.APIItemState = APIItemState;
19
25
  (function (APIItemState) {
package/cjs/defaults.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
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;
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
7
  // Copyright 2019-2022 @polkadot/extension-base authors & contributors
8
8
  // SPDX-License-Identifier: Apache-2.0
9
9
 
@@ -13,8 +13,6 @@ 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;
18
16
  const PORT_CONTENT = `${EXTENSION_PREFIX}koni-content`;
19
17
  exports.PORT_CONTENT = PORT_CONTENT;
20
18
  const PORT_EXTENSION = `${EXTENSION_PREFIX}koni-extension`;
@@ -13,6 +13,6 @@ const packageInfo = {
13
13
  name: '@subwallet/extension-base',
14
14
  path: typeof __dirname === 'string' ? __dirname : 'auto',
15
15
  type: 'cjs',
16
- version: '0.6.9-0'
16
+ version: '0.6.10-0'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
package/defaults.d.ts CHANGED
@@ -1,11 +1,10 @@
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;
5
4
  declare const PORT_CONTENT: string;
6
5
  declare const PORT_EXTENSION: string;
7
6
  declare const MESSAGE_ORIGIN_PAGE: string;
8
7
  declare const MESSAGE_ORIGIN_CONTENT: string;
9
8
  declare const PASSWORD_EXPIRY_MIN = 15;
10
9
  declare const PASSWORD_EXPIRY_MS: number;
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 };
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
@@ -4,11 +4,10 @@
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`;
8
7
  const PORT_CONTENT = `${EXTENSION_PREFIX}koni-content`;
9
8
  const PORT_EXTENSION = `${EXTENSION_PREFIX}koni-extension`;
10
9
  const MESSAGE_ORIGIN_PAGE = `${EXTENSION_PREFIX}koni-page`;
11
10
  const MESSAGE_ORIGIN_CONTENT = `${EXTENSION_PREFIX}koni-content`;
12
11
  const PASSWORD_EXPIRY_MIN = 15;
13
12
  const PASSWORD_EXPIRY_MS = PASSWORD_EXPIRY_MIN * 60 * 1000;
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 };
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 };
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "./cjs/detectPackage.js"
18
18
  ],
19
19
  "type": "module",
20
- "version": "0.6.9-0wr",
20
+ "version": "0.6.10-0",
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.6.9-0",
228
- "@subwallet/extension-dapp": "^0.6.9-0",
229
- "@subwallet/extension-inject": "^0.6.9-0",
227
+ "@subwallet/extension-chains": "^0.6.10-0",
228
+ "@subwallet/extension-dapp": "^0.6.10-0",
229
+ "@subwallet/extension-inject": "^0.6.10-0",
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.6.9-0'
10
+ version: '0.6.10-0'
11
11
  };