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