@okxweb3/coin-ethereum
Version:
An Ethereum SDK for building Web3 wallets and applications.
26 lines (25 loc) • 1.63 kB
TypeScript
/// <reference types="node" />
/// <reference types="bn.js" />
import { BN } from '@okxweb3/coin-base';
import { PrefixedHexString, TransformableToArray, TransformableToBuffer } from './types';
import { bytesToHex as _bytesToUnprefixedHex } from 'ethereum-cryptography/utils.js';
export declare const bytesToUnprefixedHex: typeof _bytesToUnprefixedHex;
export declare const zeros: (bytes: number) => Buffer;
export declare const setLengthLeft: (msg: Buffer, length: number) => Buffer;
export declare const stripZeros: (a: any) => Buffer | Uint8Array | number[] | string;
export declare const unpadBuffer: (a: Buffer) => Buffer;
export declare const unpadArray: (a: number[]) => number[];
export type ToBufferInputTypes = PrefixedHexString | number | BN | Buffer | Uint8Array | number[] | TransformableToArray | TransformableToBuffer | null | undefined;
export declare const toBuffer: (v: ToBufferInputTypes) => Buffer;
export declare const bufferToHex: (buf: Buffer) => string;
export declare const fromSigned: (num: Buffer) => BN;
export declare const toUnsigned: (num: BN) => Buffer;
export declare const addHexPrefix: (str: string) => string;
export declare const hexToBytes: (hex: string) => Uint8Array;
export declare const bytesToHex: (bytes: Uint8Array) => PrefixedHexString;
export declare const unpadBytes: (a: Uint8Array) => Uint8Array;
export declare const concatBytes: (...arrays: Uint8Array[]) => Uint8Array;
export declare const validateNoLeadingZeroes: (values: {
[key: string]: Uint8Array | Buffer | undefined;
}) => void;
export declare const bytesToBigInt: (bytes: Uint8Array, littleEndian?: boolean) => bigint;