UNPKG

1.04 kBJavaScriptView Raw
1const publicKey = new Uint8Array(32);
2const address = '5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM';
3const meta = {
4 isTesting: true,
5 name: 'nobody'
6};
7const json = {
8 address,
9 encoded: '',
10 encoding: {
11 content: ['pkcs8', 'ed25519'],
12 type: 'none',
13 version: '0'
14 },
15 meta
16};
17const pair = {
18 address,
19 addressRaw: publicKey,
20 decodePkcs8: (_passphrase, _encoded) => undefined,
21 derive: (_suri, _meta) => pair,
22 encodePkcs8: (_passphrase) => new Uint8Array(0),
23 isLocked: true,
24 lock: () => {
25 // no locking, it is always locked
26 },
27 meta,
28 publicKey,
29 setMeta: (_meta) => undefined,
30 sign: (_message) => new Uint8Array(64),
31 toJson: (_passphrase) => json,
32 type: 'ed25519',
33 unlock: (_passphrase) => undefined,
34 verify: (_message, _signature) => false,
35 vrfSign: (_message, _context, _extra) => new Uint8Array(96),
36 vrfVerify: (_message, _vrfResult, _context, _extra) => false
37};
38export function nobody() {
39 return pair;
40}