@swapkit/wallet-keystore 1.0.0-rc.0
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/LICENSE +201 -0
- package/dist/index.cjs +2051 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.es.js +2987 -0
- package/package.json +68 -0
- package/src/helpers.ts +156 -0
- package/src/index.ts +2 -0
- package/src/keystore.ts +249 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Chain } from '@swapkit/types';
|
|
2
|
+
import type { ConnectWalletParams } from '@swapkit/types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Gets data's 256 bit blake hash.
|
|
6
|
+
* @param data buffer or hexadecimal string
|
|
7
|
+
* @returns 32 byte hexadecimal string
|
|
8
|
+
*/
|
|
9
|
+
export declare const blake256: (data: Buffer | string) => string;
|
|
10
|
+
|
|
11
|
+
export declare const decryptFromKeystore: (keystore: Keystore, password: string) => Promise<string>;
|
|
12
|
+
|
|
13
|
+
export declare const encryptToKeyStore: (phrase: string, password: string) => Promise<{
|
|
14
|
+
crypto: {
|
|
15
|
+
cipher: string;
|
|
16
|
+
ciphertext: string;
|
|
17
|
+
cipherparams: {
|
|
18
|
+
iv: string;
|
|
19
|
+
};
|
|
20
|
+
kdf: string;
|
|
21
|
+
kdfparams: {
|
|
22
|
+
prf: string;
|
|
23
|
+
dklen: number;
|
|
24
|
+
salt: string;
|
|
25
|
+
c: number;
|
|
26
|
+
};
|
|
27
|
+
mac: string;
|
|
28
|
+
};
|
|
29
|
+
id: any;
|
|
30
|
+
version: number;
|
|
31
|
+
meta: string;
|
|
32
|
+
}>;
|
|
33
|
+
|
|
34
|
+
export declare const generatePhrase: (size?: number) => string;
|
|
35
|
+
|
|
36
|
+
export declare type Keystore = {
|
|
37
|
+
crypto: {
|
|
38
|
+
cipher: string;
|
|
39
|
+
ciphertext: string;
|
|
40
|
+
cipherparams: {
|
|
41
|
+
iv: string;
|
|
42
|
+
};
|
|
43
|
+
kdf: string;
|
|
44
|
+
kdfparams: {
|
|
45
|
+
prf: string;
|
|
46
|
+
dklen: number;
|
|
47
|
+
salt: string;
|
|
48
|
+
c: number;
|
|
49
|
+
};
|
|
50
|
+
mac: string;
|
|
51
|
+
};
|
|
52
|
+
id: string;
|
|
53
|
+
version: number;
|
|
54
|
+
meta: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export declare const keystoreWallet: {
|
|
58
|
+
connectMethodName: "connectKeystore";
|
|
59
|
+
connect: ({ addChain, apis, rpcUrls, config: { covalentApiKey, ethplorerApiKey, utxoApiKey, stagenet }, }: ConnectWalletParams) => (chains: Chain[], phrase: string, index?: number) => Promise<boolean>;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export { }
|