@subwallet/extension-base 0.7.1-wr → 0.7.2-0wr

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.
@@ -0,0 +1,27 @@
1
+ // Copyright 2017-2022 @polkadot/react-signer authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ let id = 1;
5
+ export default class KeyringSigner {
6
+ #pair;
7
+ #registry;
8
+ constructor({
9
+ keyPair,
10
+ registry
11
+ }) {
12
+ this.#pair = keyPair;
13
+ this.#registry = registry;
14
+ }
15
+ async signPayload(payload) {
16
+ return new Promise(resolve => {
17
+ const wrapper = this.#registry.createType('ExtrinsicPayload', payload, {
18
+ version: payload.version
19
+ });
20
+ const signature = wrapper.sign(this.#pair).signature;
21
+ resolve({
22
+ id: id++,
23
+ signature: signature
24
+ });
25
+ });
26
+ }
27
+ }
@@ -24,3 +24,9 @@ export interface LedgerState {
24
24
  export interface ExternalState {
25
25
  externalId: string;
26
26
  }
27
+ export declare enum SignerType {
28
+ PASSWORD = "PASSWORD",
29
+ QR = "QR",
30
+ LEDGER = "LEDGER"
31
+ }
32
+ export declare type SignerExternal = SignerType.LEDGER | SignerType.QR;
package/signers/types.js CHANGED
@@ -1 +1,9 @@
1
- export {};
1
+ // Copyright 2019-2022 @polkadot/extension-koni authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export let SignerType;
5
+ (function (SignerType) {
6
+ SignerType["PASSWORD"] = "PASSWORD";
7
+ SignerType["QR"] = "QR";
8
+ SignerType["LEDGER"] = "LEDGER";
9
+ })(SignerType || (SignerType = {}));