@roochnetwork/rooch-sdk
Version:
22 lines (21 loc) • 1.19 kB
TypeScript
import { address } from '../types/rooch.js';
import { Bytes } from '../types/bytes.js';
export declare function decodeToRoochAddressStr(input: address): string;
export declare function decodeToPackageAddressStr(input: address): string;
export declare function convertToRoochAddressBytes(input: address): Bytes;
export declare function isValidBitcoinAddress(input: string): boolean;
export declare function isValidRoochAddress(input: address): input is string;
export declare function isValidAddress(input: address): input is string;
/**
* Perform the following operations:
* 1. Make the address lower case
* 2. Prepend `0x` if the string does not start with `0x`.
* 3. Add more zeros if the length of the address(excluding `0x`) is less than `ROOCH_ADDRESS_LENGTH`
*
* WARNING: if the address value itself starts with `0x`, e.g., `0x0x`, the default behavior
* is to treat the first `0x` not as part of the address. The default behavior can be overridden by
* setting `forceAdd0x` to true
*
*/
export declare function normalizeRoochAddress(input: string, forceAdd0x?: boolean): string;
export declare function canonicalRoochAddress(input: string, forceAdd0x?: boolean): string;