1 |
|
2 | import { CheckpointTrie } from './checkpointTrie';
|
3 | import { Proof } from './baseTrie';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | export declare class SecureTrie extends CheckpointTrie {
|
13 | constructor(...args: any);
|
14 | /**
|
15 | * Gets a value given a `key`
|
16 | * @param key - the key to search for
|
17 | * @returns A Promise that resolves to `Buffer` if a value was found or `null` if no value was found.
|
18 | */
|
19 | get(key: Buffer): Promise<Buffer | null>;
|
20 | /**
|
21 | * Stores a given `value` at the given `key`.
|
22 | * For a falsey value, use the original key to avoid double hashing the key.
|
23 | * @param key
|
24 | * @param value
|
25 | */
|
26 | put(key: Buffer, val: Buffer): Promise<void>;
|
27 | /**
|
28 | * Deletes a value given a `key`.
|
29 | * @param key
|
30 | */
|
31 | del(key: Buffer): Promise<void>;
|
32 | /**
|
33 | * prove has been renamed to {@link SecureTrie.createProof}.
|
34 | * @deprecated
|
35 | * @param trie
|
36 | * @param key
|
37 | */
|
38 | static prove(trie: SecureTrie, key: Buffer): Promise<Proof>;
|
39 | |
40 |
|
41 |
|
42 |
|
43 |
|
44 | static createProof(trie: SecureTrie, key: Buffer): Promise<Proof>;
|
45 | |
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 | static verifyProof(rootHash: Buffer, key: Buffer, proof: Proof): Promise<Buffer | null>;
|
54 | |
55 |
|
56 |
|
57 | static verifyRangeProof(rootHash: Buffer, firstKey: Buffer | null, lastKey: Buffer | null, keys: Buffer[], values: Buffer[], proof: Buffer[] | null): Promise<boolean>;
|
58 | |
59 |
|
60 |
|
61 |
|
62 | copy(includeCheckpoints?: boolean): SecureTrie;
|
63 | }
|