@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.
- package/background/RequestBytesSign.d.ts +1 -1
- package/background/RequestBytesSign.js +8 -11
- package/background/RequestExtrinsicSign.d.ts +1 -1
- package/background/RequestExtrinsicSign.js +8 -11
- package/background/handlers/Extension.d.ts +2 -2
- package/background/handlers/Extension.js +460 -612
- package/background/handlers/State.d.ts +1 -1
- package/background/handlers/State.js +380 -424
- package/background/handlers/Tabs.d.ts +2 -2
- package/background/handlers/Tabs.js +178 -212
- package/background/handlers/helpers.js +8 -10
- package/background/handlers/index.d.ts +1 -1
- package/background/handlers/index.js +29 -39
- package/background/handlers/subscriptions.d.ts +1 -1
- package/background/handlers/subscriptions.js +13 -22
- package/background/types.d.ts +2 -2
- package/bundle.d.ts +1 -1
- package/bundle.js +1 -4
- package/cjs/background/RequestBytesSign.js +11 -18
- package/cjs/background/RequestExtrinsicSign.js +9 -16
- package/cjs/background/handlers/Extension.js +468 -658
- package/cjs/background/handlers/State.js +389 -460
- package/cjs/background/handlers/Tabs.js +185 -242
- package/cjs/background/handlers/helpers.js +12 -16
- package/cjs/background/handlers/index.js +37 -52
- package/cjs/background/handlers/subscriptions.js +17 -28
- package/cjs/background/types.js +2 -1
- package/cjs/bundle.js +4 -11
- package/cjs/defaults.js +3 -12
- package/cjs/detectOther.js +5 -12
- package/cjs/detectPackage.js +6 -11
- package/cjs/index.js +3 -15
- package/cjs/packageInfo.js +2 -16
- package/cjs/page/Accounts.js +19 -28
- package/cjs/page/Injected.js +19 -26
- package/cjs/page/Metadata.js +10 -18
- package/cjs/page/PostMessageProvider.js +127 -160
- package/cjs/page/Signer.js +23 -38
- package/cjs/page/index.js +44 -61
- package/cjs/page/types.js +2 -1
- package/cjs/stores/Accounts.js +17 -22
- package/cjs/stores/Base.js +56 -63
- package/cjs/stores/Metadata.js +10 -15
- package/cjs/stores/index.js +9 -19
- package/cjs/types.js +2 -1
- package/cjs/utils/canDerive.js +5 -10
- package/cjs/utils/getId.js +6 -11
- package/cjs/utils/index.js +4 -11
- package/defaults.js +1 -8
- package/detectOther.js +0 -3
- package/detectPackage.js +2 -7
- package/index.d.ts +1 -1
- package/index.js +1 -7
- package/package.json +20 -17
- package/packageInfo.js +1 -11
- package/page/Accounts.d.ts +1 -1
- package/page/Accounts.js +18 -23
- package/page/Injected.d.ts +5 -5
- package/page/Injected.js +15 -18
- package/page/Metadata.d.ts +1 -1
- package/page/Metadata.js +9 -13
- package/page/PostMessageProvider.d.ts +1 -1
- package/page/PostMessageProvider.js +124 -152
- package/page/Signer.d.ts +1 -1
- package/page/Signer.js +22 -33
- package/page/index.d.ts +2 -2
- package/page/index.js +36 -59
- package/page/types.d.ts +1 -1
- package/stores/Accounts.d.ts +1 -1
- package/stores/Accounts.js +14 -15
- package/stores/Base.js +55 -57
- package/stores/Metadata.d.ts +1 -1
- package/stores/Metadata.js +7 -8
- package/stores/index.d.ts +2 -2
- package/stores/index.js +2 -5
- package/utils/canDerive.js +1 -4
- package/utils/getId.js +2 -5
- package/utils/index.d.ts +1 -1
- 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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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);
|