@pezkuwi/keyring 14.0.10 → 14.0.12
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/build/bundle-pezkuwi-keyring.js +1 -1
- package/build/cjs/packageInfo.js +1 -1
- package/build/cjs/pair/defaults.d.ts +2 -2
- package/build/package.json +8 -8
- package/build/packageInfo.js +1 -1
- package/build/pair/defaults.d.ts +2 -2
- package/build-deno/packageInfo.ts +1 -1
- package/build-tsc/pair/defaults.d.ts +2 -2
- package/build-tsc-cjs/packageInfo.js +1 -1
- package/build-tsc-esm/packageInfo.js +1 -1
- package/bundle-pezkuwi-keyring.js +553 -0
- package/bundle.d.ts +7 -0
- package/bundle.js +7 -0
- package/cjs/bundle.d.ts +7 -0
- package/cjs/bundle.js +19 -0
- package/cjs/defaults.d.ts +2 -0
- package/cjs/defaults.js +5 -0
- package/cjs/index.d.ts +4 -0
- package/cjs/index.js +7 -0
- package/cjs/keyring.d.ts +145 -0
- package/cjs/keyring.js +261 -0
- package/cjs/package.json +3 -0
- package/cjs/packageDetect.d.ts +1 -0
- package/cjs/packageDetect.js +7 -0
- package/cjs/packageInfo.d.ts +6 -0
- package/cjs/packageInfo.js +4 -0
- package/cjs/pair/decode.d.ts +12 -0
- package/cjs/pair/decode.js +45 -0
- package/cjs/pair/defaults.d.ts +12 -0
- package/cjs/pair/defaults.js +15 -0
- package/cjs/pair/encode.d.ts +5 -0
- package/cjs/pair/encode.js +22 -0
- package/cjs/pair/index.d.ts +40 -0
- package/cjs/pair/index.js +183 -0
- package/cjs/pair/nobody.d.ts +2 -0
- package/cjs/pair/nobody.js +43 -0
- package/cjs/pair/toJson.d.ts +8 -0
- package/cjs/pair/toJson.js +11 -0
- package/cjs/pair/types.d.ts +5 -0
- package/cjs/pair/types.js +2 -0
- package/cjs/pairs.d.ts +8 -0
- package/cjs/pairs.js +28 -0
- package/cjs/testing.d.ts +20 -0
- package/cjs/testing.js +126 -0
- package/cjs/testingPairs.d.ts +25 -0
- package/cjs/testingPairs.js +16 -0
- package/cjs/types.d.ts +111 -0
- package/cjs/types.js +2 -0
- package/defaults.d.ts +2 -0
- package/defaults.js +2 -0
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/keyring.d.ts +145 -0
- package/keyring.js +257 -0
- package/package.json +271 -9
- package/packageDetect.d.ts +1 -0
- package/packageDetect.js +5 -0
- package/packageInfo.d.ts +6 -0
- package/packageInfo.js +1 -0
- package/pair/decode.d.ts +12 -0
- package/pair/decode.js +42 -0
- package/pair/defaults.d.ts +12 -0
- package/pair/defaults.js +12 -0
- package/pair/encode.d.ts +5 -0
- package/pair/encode.js +19 -0
- package/pair/index.d.ts +40 -0
- package/pair/index.js +180 -0
- package/pair/nobody.d.ts +2 -0
- package/pair/nobody.js +40 -0
- package/pair/toJson.d.ts +8 -0
- package/pair/toJson.js +8 -0
- package/pair/types.d.ts +5 -0
- package/pair/types.js +1 -0
- package/pairs.d.ts +8 -0
- package/pairs.js +24 -0
- package/src/packageInfo.ts +1 -1
- package/testing.d.ts +20 -0
- package/testing.js +122 -0
- package/testingPairs.d.ts +25 -0
- package/testingPairs.js +13 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.spec.tsbuildinfo +1 -1
- package/types.d.ts +111 -0
- package/types.js +1 -0
package/types.d.ts
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { HexString } from '@pezkuwi/util/types';
|
|
2
|
+
import type { EncryptedJson, Keypair, KeypairType, Prefix } from '@pezkuwi/util-crypto/types';
|
|
3
|
+
export interface KeyringOptions {
|
|
4
|
+
/** The ss58Format to use for address encoding (defaults to 42) */
|
|
5
|
+
ss58Format?: Prefix;
|
|
6
|
+
/** The type of keyring to create (defaults to ed25519) */
|
|
7
|
+
type?: KeypairType;
|
|
8
|
+
}
|
|
9
|
+
export interface KeyringPair$MetaHardware {
|
|
10
|
+
accountIndex?: number;
|
|
11
|
+
accountOffset?: number;
|
|
12
|
+
addressOffset?: number;
|
|
13
|
+
hardwareType?: 'ledger';
|
|
14
|
+
}
|
|
15
|
+
export interface KeyringPair$MetaFlags {
|
|
16
|
+
isDefaultAuthSelected?: boolean;
|
|
17
|
+
isExternal?: boolean;
|
|
18
|
+
isHardware?: boolean;
|
|
19
|
+
isHidden?: boolean;
|
|
20
|
+
isInjected?: boolean;
|
|
21
|
+
isMultisig?: boolean;
|
|
22
|
+
isProxied?: boolean;
|
|
23
|
+
isRecent?: boolean;
|
|
24
|
+
isTesting?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface KeyringPair$MetaContract {
|
|
27
|
+
abi: string;
|
|
28
|
+
genesisHash?: HexString | null;
|
|
29
|
+
}
|
|
30
|
+
export interface KeyringPair$MetaExtension {
|
|
31
|
+
source?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface KeyringPair$MetaMultisig {
|
|
34
|
+
threshold?: number;
|
|
35
|
+
who?: string[];
|
|
36
|
+
}
|
|
37
|
+
export interface KeyringPair$MetaParent {
|
|
38
|
+
parentAddress?: string;
|
|
39
|
+
parentName?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface KeyringPair$Meta extends KeyringPair$MetaExtension, KeyringPair$MetaFlags, KeyringPair$MetaHardware, KeyringPair$MetaMultisig, KeyringPair$MetaParent {
|
|
42
|
+
address?: string;
|
|
43
|
+
contract?: KeyringPair$MetaContract;
|
|
44
|
+
genesisHash?: HexString | null;
|
|
45
|
+
name?: string;
|
|
46
|
+
suri?: string;
|
|
47
|
+
tags?: string[];
|
|
48
|
+
type?: KeypairType;
|
|
49
|
+
whenCreated?: number;
|
|
50
|
+
whenEdited?: number;
|
|
51
|
+
whenUsed?: number;
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
}
|
|
54
|
+
export interface KeyringPair$Json extends EncryptedJson {
|
|
55
|
+
/** The ss58 encoded address or the hex-encoded version (the latter is for ETH-compat chains) */
|
|
56
|
+
address: string;
|
|
57
|
+
/** The underlying metadata associated with the keypair */
|
|
58
|
+
meta: KeyringPair$Meta;
|
|
59
|
+
}
|
|
60
|
+
export interface SignOptions {
|
|
61
|
+
/** Create a MultiSignature-compatible output with an indicator type */
|
|
62
|
+
withType?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface KeyringPair {
|
|
65
|
+
readonly address: string;
|
|
66
|
+
readonly addressRaw: Uint8Array;
|
|
67
|
+
readonly meta: KeyringPair$Meta;
|
|
68
|
+
readonly isLocked: boolean;
|
|
69
|
+
readonly publicKey: Uint8Array;
|
|
70
|
+
readonly type: KeypairType;
|
|
71
|
+
decodePkcs8(passphrase?: string, encoded?: Uint8Array): void;
|
|
72
|
+
derive(suri: string, meta?: KeyringPair$Meta): KeyringPair;
|
|
73
|
+
encodePkcs8(passphrase?: string): Uint8Array;
|
|
74
|
+
lock(): void;
|
|
75
|
+
setMeta(meta: KeyringPair$Meta): void;
|
|
76
|
+
sign(message: string | Uint8Array, options?: SignOptions): Uint8Array;
|
|
77
|
+
toJson(passphrase?: string): KeyringPair$Json;
|
|
78
|
+
unlock(passphrase?: string): void;
|
|
79
|
+
verify(message: string | Uint8Array, signature: Uint8Array, signerPublic: string | Uint8Array): boolean;
|
|
80
|
+
vrfSign(message: string | Uint8Array, context?: string | Uint8Array, extra?: string | Uint8Array): Uint8Array;
|
|
81
|
+
vrfVerify(message: string | Uint8Array, vrfResult: Uint8Array, signerPublic: string | Uint8Array, context?: string | Uint8Array, extra?: string | Uint8Array): boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface KeyringPairs {
|
|
84
|
+
add: (pair: KeyringPair) => KeyringPair;
|
|
85
|
+
all: () => KeyringPair[];
|
|
86
|
+
get: (address: string | Uint8Array) => KeyringPair;
|
|
87
|
+
remove: (address: string | Uint8Array) => void;
|
|
88
|
+
}
|
|
89
|
+
export interface KeyringInstance {
|
|
90
|
+
readonly pairs: KeyringPair[];
|
|
91
|
+
readonly publicKeys: Uint8Array[];
|
|
92
|
+
readonly type: KeypairType;
|
|
93
|
+
decodeAddress(encoded: string | Uint8Array, ignoreChecksum?: boolean, ss58Format?: Prefix): Uint8Array;
|
|
94
|
+
encodeAddress(key: Uint8Array | string, ss58Format?: Prefix): string;
|
|
95
|
+
setSS58Format(ss58Format: Prefix): void;
|
|
96
|
+
addPair(pair: KeyringPair): KeyringPair;
|
|
97
|
+
addFromAddress(address: string | Uint8Array, meta?: KeyringPair$Meta, encoded?: Uint8Array | null, type?: KeypairType, ignoreChecksum?: boolean): KeyringPair;
|
|
98
|
+
addFromJson(pair: KeyringPair$Json, ignoreChecksum?: boolean): KeyringPair;
|
|
99
|
+
addFromMnemonic(mnemonic: string, meta?: KeyringPair$Meta, type?: KeypairType, wordlist?: string[]): KeyringPair;
|
|
100
|
+
addFromPair(pair: Keypair, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
|
101
|
+
addFromSeed(seed: Uint8Array, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
|
102
|
+
addFromUri(suri: string, meta?: KeyringPair$Meta, type?: KeypairType, wordlist?: string[]): KeyringPair;
|
|
103
|
+
createFromJson(json: KeyringPair$Json, ignoreChecksum?: boolean): KeyringPair;
|
|
104
|
+
createFromPair(pair: Keypair, meta: KeyringPair$Meta, type: KeypairType): KeyringPair;
|
|
105
|
+
createFromUri(suri: string, meta?: KeyringPair$Meta, type?: KeypairType, wordlist?: string[]): KeyringPair;
|
|
106
|
+
getPair(address: string | Uint8Array): KeyringPair;
|
|
107
|
+
getPairs(): KeyringPair[];
|
|
108
|
+
getPublicKeys(): Uint8Array[];
|
|
109
|
+
removePair(address: string | Uint8Array): void;
|
|
110
|
+
toJson(address: string | Uint8Array, passphrase?: string): KeyringPair$Json;
|
|
111
|
+
}
|
package/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|