/// import { BaseUtils } from '@bitgo/sdk-core'; import { Buffer as BufferAvax } from 'avalanche'; import { NodeIDStringToBuffer } from 'avalanche/dist/utils'; import { BaseTx, Tx } from 'avalanche/dist/apis/platformvm'; import { Credential } from 'avalanche/dist/common/credentials'; import { AvalancheNetwork } from '@bitgo/statics'; export declare class Utils implements BaseUtils { private binTools; cb58Decode: (bytes: string | BufferAvax) => BufferAvax; cb58Encode: (bytes: BufferAvax) => string; stringToBuffer: (str: string) => BufferAvax; bufferToString: (buff: BufferAvax) => string; NodeIDStringToBuffer: typeof NodeIDStringToBuffer; addressToString: (hrp: string, chainid: string, bytes: BufferAvax) => string; includeIn(walletAddresses: string[], otxoOutputAddresses: string[]): boolean; /** * Checks if it is a valid address no illegal characters * * @param {string} address - address to be validated * @returns {boolean} - the validation result */ /** @inheritdoc */ isValidAddress(address: string): boolean; /** * Checks if it is a valid blockId with length 66 including 0x * * @param {string} hash - blockId to be validated * @returns {boolean} - the validation result */ /** @inheritdoc */ isValidBlockId(hash: string): boolean; /** * Checks if the string is a valid protocol public key or * extended public key. * * @param {string} pub - the public key to be validated * @returns {boolean} - the validation result */ isValidPublicKey(pub: string): boolean; parseAddress: (pub: string) => BufferAvax; /** * Returns whether or not the string is a valid protocol private key, or extended * private key. * * The protocol key format is described in the @stacks/transactions npm package, in the * createStacksPrivateKey function: * https://github.com/blockstack/stacks.js/blob/master/packages/transactions/src/keys.ts#L125 * * @param {string} prv - the private key (or extended private key) to be validated * @returns {boolean} - the validation result */ isValidPrivateKey(prv: string): boolean; /** * Returns whether or not the string is a composed of hex chars only * * @param {string} maybe - the string to be validated * @returns {boolean} - the validation result */ allHexChars(maybe: string): boolean; /** @inheritdoc */ isValidSignature(signature: string): boolean; /** @inheritdoc */ isValidTransactionId(txId: string): boolean; getCredentials(tx: BaseTx): Credential[]; from(raw: string): Tx; /** * Avaxp wrapper to create signature and return it for credentials using Avalanche's buffer * @param network * @param message * @param prv * @return signature */ createSignatureAvaxBuffer(network: AvalancheNetwork, message: BufferAvax, prv: BufferAvax): BufferAvax; /** * Avaxp wrapper to create signature and return it for credentials * @param network * @param message * @param prv * @return signature */ createSignature(network: AvalancheNetwork, message: Buffer, prv: Buffer): Buffer; /** * Avaxp wrapper to verify signature using Avalanche's buffer * @param network * @param message * @param signature * @param prv * @return true if it's verify successful */ verifySignatureAvaxBuffer(network: AvalancheNetwork, message: BufferAvax, signature: BufferAvax, prv: BufferAvax): boolean; /** * Avaxp wrapper to verify signature * @param network * @param message * @param signature * @param prv * @return true if it's verify successful */ verifySignature(network: AvalancheNetwork, message: Buffer, signature: Buffer, prv: Buffer): boolean; } declare const utils: Utils; export default utils; //# sourceMappingURL=utils.d.ts.map