@polkadot/extension-base 0.42.9 → 0.42.10-2

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.
@@ -639,6 +639,12 @@ class Extension {
639
639
  return {
640
640
  list: this.#state.toggleAuthorization(url)
641
641
  };
642
+ }
643
+
644
+ removeAuthorization(url) {
645
+ return {
646
+ list: this.#state.removeAuthorization(url)
647
+ };
642
648
  } // Weird thought, the eslint override is not needed in Tabs
643
649
  // eslint-disable-next-line @typescript-eslint/require-await
644
650
 
@@ -657,6 +663,9 @@ class Extension {
657
663
  case 'pri(authorize.toggle)':
658
664
  return this.toggleAuthorization(request);
659
665
 
666
+ case 'pri(authorize.remove)':
667
+ return this.removeAuthorization(request);
668
+
660
669
  case 'pri(authorize.requests)':
661
670
  return this.authorizeSubscribe(id, port);
662
671
 
@@ -41,5 +41,6 @@ export default class Extension {
41
41
  private derivationValidate;
42
42
  private derivationCreate;
43
43
  private toggleAuthorization;
44
+ private removeAuthorization;
44
45
  handle<TMessageType extends MessageTypes>(id: string, type: TMessageType, request: RequestTypes[TMessageType], port: chrome.runtime.Port): Promise<ResponseType<TMessageType>>;
45
46
  }
@@ -557,6 +557,12 @@ export default class Extension {
557
557
  return {
558
558
  list: this.#state.toggleAuthorization(url)
559
559
  };
560
+ }
561
+
562
+ removeAuthorization(url) {
563
+ return {
564
+ list: this.#state.removeAuthorization(url)
565
+ };
560
566
  } // Weird thought, the eslint override is not needed in Tabs
561
567
  // eslint-disable-next-line @typescript-eslint/require-await
562
568
 
@@ -575,6 +581,9 @@ export default class Extension {
575
581
  case 'pri(authorize.toggle)':
576
582
  return this.toggleAuthorization(request);
577
583
 
584
+ case 'pri(authorize.remove)':
585
+ return this.removeAuthorization(request);
586
+
578
587
  case 'pri(authorize.requests)':
579
588
  return this.authorizeSubscribe(id, port);
580
589
 
@@ -306,6 +306,14 @@ class State {
306
306
  return this.#authUrls;
307
307
  }
308
308
 
309
+ removeAuthorization(url) {
310
+ const entry = this.#authUrls[url];
311
+ (0, _util.assert)(entry, `The source ${url} is not known`);
312
+ delete this.#authUrls[url];
313
+ this.saveCurrentAuthList();
314
+ return this.#authUrls;
315
+ }
316
+
309
317
  updateIconAuth(shouldClose) {
310
318
  this.authSubject.next(this.allAuthRequests);
311
319
  this.updateIcon(shouldClose);
@@ -64,6 +64,7 @@ export default class State {
64
64
  private stripUrl;
65
65
  private updateIcon;
66
66
  toggleAuthorization(url: string): AuthUrls;
67
+ removeAuthorization(url: string): AuthUrls;
67
68
  private updateIconAuth;
68
69
  private updateIconMeta;
69
70
  private updateIconSign;
@@ -271,6 +271,14 @@ export default class State {
271
271
  return this.#authUrls;
272
272
  }
273
273
 
274
+ removeAuthorization(url) {
275
+ const entry = this.#authUrls[url];
276
+ assert(entry, `The source ${url} is not known`);
277
+ delete this.#authUrls[url];
278
+ this.saveCurrentAuthList();
279
+ return this.#authUrls;
280
+ }
281
+
274
282
  updateIconAuth(shouldClose) {
275
283
  this.authSubject.next(this.allAuthRequests);
276
284
  this.updateIcon(shouldClose);
@@ -75,6 +75,7 @@ export interface RequestSignatures {
75
75
  'pri(authorize.reject)': [RequestAuthorizeReject, boolean];
76
76
  'pri(authorize.requests)': [RequestAuthorizeSubscribe, boolean, AuthorizeRequest[]];
77
77
  'pri(authorize.toggle)': [string, ResponseAuthorizeList];
78
+ 'pri(authorize.remove)': [string, ResponseAuthorizeList];
78
79
  'pri(derivation.create)': [RequestDeriveCreate, boolean];
79
80
  'pri(derivation.validate)': [RequestDeriveValidate, ResponseDeriveValidate];
80
81
  'pri(json.restore)': [RequestJsonRestore, void];
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "./detectPackage.cjs"
18
18
  ],
19
19
  "type": "module",
20
- "version": "0.42.9",
20
+ "version": "0.42.10-2",
21
21
  "main": "index.cjs",
22
22
  "module": "index.js",
23
23
  "types": "index.d.ts",
@@ -177,20 +177,20 @@
177
177
  }
178
178
  },
179
179
  "dependencies": {
180
- "@babel/runtime": "^7.17.2",
181
- "@polkadot/api": "^7.12.1",
182
- "@polkadot/extension-chains": "^0.42.9",
183
- "@polkadot/extension-dapp": "^0.42.9",
184
- "@polkadot/extension-inject": "^0.42.9",
185
- "@polkadot/keyring": "^8.5.1",
186
- "@polkadot/networks": "^8.5.1",
187
- "@polkadot/phishing": "^0.9.6",
188
- "@polkadot/rpc-provider": "^7.12.1",
189
- "@polkadot/types": "^7.12.1",
190
- "@polkadot/ui-keyring": "^1.2.1",
191
- "@polkadot/ui-settings": "^1.2.1",
192
- "@polkadot/util": "^8.5.1",
193
- "@polkadot/util-crypto": "^8.5.1",
180
+ "@babel/runtime": "^7.17.8",
181
+ "@polkadot/api": "^7.13.1",
182
+ "@polkadot/extension-chains": "^0.42.10-2",
183
+ "@polkadot/extension-dapp": "^0.42.10-2",
184
+ "@polkadot/extension-inject": "^0.42.10-2",
185
+ "@polkadot/keyring": "^8.6.1",
186
+ "@polkadot/networks": "^8.6.1",
187
+ "@polkadot/phishing": "^0.10.3",
188
+ "@polkadot/rpc-provider": "^7.13.1",
189
+ "@polkadot/types": "^7.13.1",
190
+ "@polkadot/ui-keyring": "^1.3.1",
191
+ "@polkadot/ui-settings": "^1.3.1",
192
+ "@polkadot/util": "^8.6.1",
193
+ "@polkadot/util-crypto": "^8.6.1",
194
194
  "eventemitter3": "^4.0.7",
195
195
  "rxjs": "^7.5.5"
196
196
  }
package/packageInfo.cjs CHANGED
@@ -11,6 +11,6 @@ const packageInfo = {
11
11
  name: '@polkadot/extension-base',
12
12
  path: typeof __dirname === 'string' ? __dirname : 'auto',
13
13
  type: 'cjs',
14
- version: '0.42.9'
14
+ version: '0.42.10-2'
15
15
  };
16
16
  exports.packageInfo = packageInfo;
package/packageInfo.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // Do not edit, auto-generated by @polkadot/dev
4
4
  export const packageInfo = {
5
5
  name: '@polkadot/extension-base',
6
- path: (import.meta && import.meta.url) ? new URL('.', import.meta.url).pathname : 'auto',
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.42.9'
8
+ version: '0.42.10-2'
9
9
  };