1 |
|
2 |
|
3 | import { BN } from './externals';
|
4 | import { Address } from './address';
|
5 | import { ToBufferInputTypes } from './bytes';
|
6 | export declare type BNLike = BN | PrefixedHexString | number | Buffer;
|
7 | export declare type BufferLike = Buffer | Uint8Array | number[] | number | BN | TransformableToBuffer | PrefixedHexString;
|
8 | export declare type PrefixedHexString = string;
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export declare type AddressLike = Address | Buffer | PrefixedHexString;
|
14 | export interface TransformableToArray {
|
15 | toArray(): Uint8Array;
|
16 | toBuffer?(): Buffer;
|
17 | }
|
18 | export interface TransformableToBuffer {
|
19 | toBuffer(): Buffer;
|
20 | toArray?(): Uint8Array;
|
21 | }
|
22 | export declare type NestedUint8Array = Array<Uint8Array | NestedUint8Array>;
|
23 | export declare type NestedBufferArray = Array<Buffer | NestedBufferArray>;
|
24 |
|
25 |
|
26 |
|
27 | export declare function bnToHex(value: BN): PrefixedHexString;
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export declare function bnToUnpaddedBuffer(value: BN): Buffer;
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | export declare function bnToRlp(value: BN): Buffer;
|
39 |
|
40 |
|
41 |
|
42 | export declare enum TypeOutput {
|
43 | Number = 0,
|
44 | BN = 1,
|
45 | Buffer = 2,
|
46 | PrefixedHexString = 3
|
47 | }
|
48 | export declare type TypeOutputReturnType = {
|
49 | [TypeOutput.Number]: number;
|
50 | [TypeOutput.BN]: BN;
|
51 | [TypeOutput.Buffer]: Buffer;
|
52 | [TypeOutput.PrefixedHexString]: PrefixedHexString;
|
53 | };
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | export declare function toType<T extends TypeOutput>(input: null, outputType: T): null;
|
61 | export declare function toType<T extends TypeOutput>(input: undefined, outputType: T): undefined;
|
62 | export declare function toType<T extends TypeOutput>(input: ToBufferInputTypes, outputType: T): TypeOutputReturnType[T];
|