UNPKG

multichain-controller

Version:

A Multichain crypto wallet library that supports Ethereum, Bitcoin, Solana, Waves and other EVM compatible blockchains E.g. Binance Smart Chain, Polygon, Avalanche etc.

40 lines (39 loc) 1.5 kB
import { IResponse } from './types'; export declare const successResponse: (args: IResponse) => IResponse; /** * Remove 0x prefix from a hex string. If the input doesn't have a 0x prefix, * it's returned unchanged. * * @param hex The hex value to be prefixed. */ export declare const strip0x: (hex: string) => string; /** * Convert a Uint8Array to a hex string (with no "0x"-prefix). */ export declare const toHex: (array: Uint8Array) => string; /** * Add a 0x prefix to a hex value, converting to a string first. If the input * is already prefixed, it's returned unchanged. * * @param hexInput The hex value to be prefixed. */ export declare const Ox: (hexInput: Uint8Array | string | number, { prefix }?: { prefix: string; }) => string; /** * Convert a hex string to a Uint8Array. */ export declare const fromHex: (hexString: string) => Uint8Array; /** * https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array/12646864#12646864 * Randomize array element order in-place. * Using Durstenfeld shuffle algorithm. */ export declare const shuffleArray: <T>(...arrayIn: T[] | T[][]) => T[]; export declare const toUTF8String: (input: Uint8Array) => string; export declare const fromUTF8String: (input: string) => Uint8Array; /** * Convert a base64 string to a Uint8Array. */ export declare const fromBase64: (base64String: string) => Uint8Array; export declare const toBase64: (input: Uint8Array) => string;