UNPKG

@xchainjs/xchain-doge

Version:

Custom Doge client and utilities used by XChain clients

50 lines (49 loc) 1.74 kB
/** * Import statements for required modules and types. */ import { Network } from '@xchainjs/xchain-client'; import { Address } from '@xchainjs/xchain-util'; import * as Dogecoin from 'bitcoinjs-lib'; /** * Constant values representing transaction sizes and lengths. */ export declare const TX_EMPTY_SIZE: number; export declare const TX_INPUT_BASE: number; export declare const TX_INPUT_PUBKEYHASH = 107; export declare const TX_OUTPUT_BASE: number; export declare const TX_OUTPUT_PUBKEYHASH = 25; /** * Calculate the number of bytes required for an input. * * @returns {number} The number of bytes required for an input. */ export declare function inputBytes(): number; /** * Calculate the average value of an array. * * @param {number[]} array - The array of numbers. * @returns {number} The average value of the array. */ export declare function arrayAverage(array: number[]): number; /** * Get the Dogecoin network configuration to be used with bitcoinjs. * * @param {Network} network - The network type. * @returns {Dogecoin.networks.Network} The Dogecoin network configuration. */ export declare const dogeNetwork: (network: Network) => Dogecoin.networks.Network; /** * Validate a Dogecoin address. * * @param {Address} address - The Dogecoin address to validate. * @param {Network} network - The network type. * @returns {boolean} `true` if the address is valid, `false` otherwise. */ export declare const validateAddress: (address: Address, network: Network) => boolean; /** * Get the address prefix based on the network. * * @param {Network} network - The network type. * @returns {string} The address prefix based on the network. */ export declare const getPrefix: (network: Network) => "" | "n";