@polkadot/extension-base 0.44.9 → 0.45.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.
Files changed (79) hide show
  1. package/background/RequestBytesSign.d.ts +1 -1
  2. package/background/RequestBytesSign.js +8 -11
  3. package/background/RequestExtrinsicSign.d.ts +1 -1
  4. package/background/RequestExtrinsicSign.js +8 -11
  5. package/background/handlers/Extension.d.ts +2 -2
  6. package/background/handlers/Extension.js +460 -612
  7. package/background/handlers/State.d.ts +1 -1
  8. package/background/handlers/State.js +380 -424
  9. package/background/handlers/Tabs.d.ts +2 -2
  10. package/background/handlers/Tabs.js +178 -212
  11. package/background/handlers/helpers.js +8 -10
  12. package/background/handlers/index.d.ts +1 -1
  13. package/background/handlers/index.js +29 -39
  14. package/background/handlers/subscriptions.d.ts +1 -1
  15. package/background/handlers/subscriptions.js +13 -22
  16. package/background/types.d.ts +2 -2
  17. package/bundle.d.ts +1 -1
  18. package/bundle.js +1 -4
  19. package/cjs/background/RequestBytesSign.js +11 -18
  20. package/cjs/background/RequestExtrinsicSign.js +9 -16
  21. package/cjs/background/handlers/Extension.js +468 -658
  22. package/cjs/background/handlers/State.js +389 -460
  23. package/cjs/background/handlers/Tabs.js +185 -242
  24. package/cjs/background/handlers/helpers.js +12 -16
  25. package/cjs/background/handlers/index.js +37 -52
  26. package/cjs/background/handlers/subscriptions.js +17 -28
  27. package/cjs/background/types.js +2 -1
  28. package/cjs/bundle.js +4 -11
  29. package/cjs/defaults.js +3 -12
  30. package/cjs/detectOther.js +5 -12
  31. package/cjs/detectPackage.js +6 -11
  32. package/cjs/index.js +3 -15
  33. package/cjs/packageInfo.js +2 -16
  34. package/cjs/page/Accounts.js +19 -28
  35. package/cjs/page/Injected.js +19 -26
  36. package/cjs/page/Metadata.js +10 -18
  37. package/cjs/page/PostMessageProvider.js +127 -160
  38. package/cjs/page/Signer.js +23 -38
  39. package/cjs/page/index.js +44 -61
  40. package/cjs/page/types.js +2 -1
  41. package/cjs/stores/Accounts.js +17 -22
  42. package/cjs/stores/Base.js +56 -63
  43. package/cjs/stores/Metadata.js +10 -15
  44. package/cjs/stores/index.js +9 -19
  45. package/cjs/types.js +2 -1
  46. package/cjs/utils/canDerive.js +5 -10
  47. package/cjs/utils/getId.js +6 -11
  48. package/cjs/utils/index.js +4 -11
  49. package/defaults.js +1 -8
  50. package/detectOther.js +0 -3
  51. package/detectPackage.js +2 -7
  52. package/index.d.ts +1 -1
  53. package/index.js +1 -7
  54. package/package.json +20 -17
  55. package/packageInfo.js +1 -11
  56. package/page/Accounts.d.ts +1 -1
  57. package/page/Accounts.js +18 -23
  58. package/page/Injected.d.ts +5 -5
  59. package/page/Injected.js +15 -18
  60. package/page/Metadata.d.ts +1 -1
  61. package/page/Metadata.js +9 -13
  62. package/page/PostMessageProvider.d.ts +1 -1
  63. package/page/PostMessageProvider.js +124 -152
  64. package/page/Signer.d.ts +1 -1
  65. package/page/Signer.js +22 -33
  66. package/page/index.d.ts +2 -2
  67. package/page/index.js +36 -59
  68. package/page/types.d.ts +1 -1
  69. package/stores/Accounts.d.ts +1 -1
  70. package/stores/Accounts.js +14 -15
  71. package/stores/Base.js +55 -57
  72. package/stores/Metadata.d.ts +1 -1
  73. package/stores/Metadata.js +7 -8
  74. package/stores/index.d.ts +2 -2
  75. package/stores/index.js +2 -5
  76. package/utils/canDerive.js +1 -4
  77. package/utils/getId.js +2 -5
  78. package/utils/index.d.ts +1 -1
  79. package/utils/index.js +1 -4
@@ -1,7 +1,7 @@
1
1
  import type { KeyringPair } from '@polkadot/keyring/types';
2
2
  import type { SignerPayloadRaw } from '@polkadot/types/types';
3
3
  import type { HexString } from '@polkadot/util/types';
4
- import type { RequestSign } from './types';
4
+ import type { RequestSign } from './types.js';
5
5
  import { TypeRegistry } from '@polkadot/types';
6
6
  export default class RequestBytesSign implements RequestSign {
7
7
  readonly payload: SignerPayloadRaw;
@@ -1,15 +1,12 @@
1
- // Copyright 2019-2023 @polkadot/extension authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
1
  import { wrapBytes } from '@polkadot/extension-dapp/wrapBytes';
5
2
  import { u8aToHex } from '@polkadot/util';
6
3
  export default class RequestBytesSign {
7
- constructor(payload) {
8
- this.payload = payload;
9
- }
10
- sign(_registry, pair) {
11
- return {
12
- signature: u8aToHex(pair.sign(wrapBytes(this.payload.data)))
13
- };
14
- }
4
+ constructor(payload) {
5
+ this.payload = payload;
6
+ }
7
+ sign(_registry, pair) {
8
+ return {
9
+ signature: u8aToHex(pair.sign(wrapBytes(this.payload.data)))
10
+ };
11
+ }
15
12
  }
@@ -1,7 +1,7 @@
1
1
  import type { KeyringPair } from '@polkadot/keyring/types';
2
2
  import type { SignerPayloadJSON } from '@polkadot/types/types';
3
3
  import type { HexString } from '@polkadot/util/types';
4
- import type { RequestSign } from './types';
4
+ import type { RequestSign } from './types.js';
5
5
  import { TypeRegistry } from '@polkadot/types';
6
6
  export default class RequestExtrinsicSign implements RequestSign {
7
7
  readonly payload: SignerPayloadJSON;
@@ -1,13 +1,10 @@
1
- // Copyright 2019-2023 @polkadot/extension authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
1
  export default class RequestExtrinsicSign {
5
- constructor(payload) {
6
- this.payload = payload;
7
- }
8
- sign(registry, pair) {
9
- return registry.createType('ExtrinsicPayload', this.payload, {
10
- version: this.payload.version
11
- }).sign(pair);
12
- }
2
+ constructor(payload) {
3
+ this.payload = payload;
4
+ }
5
+ sign(registry, pair) {
6
+ return registry
7
+ .createType('ExtrinsicPayload', this.payload, { version: this.payload.version })
8
+ .sign(pair);
9
+ }
13
10
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="chrome" />
2
- import type { MessageTypes, RequestTypes, ResponseType } from '../types';
3
- import State from './State';
2
+ import type { MessageTypes, RequestTypes, ResponseType } from '../types.js';
3
+ import State from './State.js';
4
4
  export default class Extension {
5
5
  #private;
6
6
  constructor(state: State);