@yubing744/rooch-sdk
Version:
25 lines (24 loc) • 1.27 kB
TypeScript
import { FunctionId, AccountAddress, Identifier, TypeTag, StructTag } from '../types';
export declare function functionIdToStirng(functionId: FunctionId): string;
export declare function parseFunctionId(functionId: FunctionId): {
address: AccountAddress;
module: Identifier;
functionName: Identifier;
};
/**
* 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(value: string, forceAdd0x?: boolean): string;
export declare function canonicalRoochAddress(value: string, forceAdd0x?: boolean): string;
export declare function typeTagToString(type_tag: TypeTag): string;
export declare function structTagToCanonicalString(structTag: StructTag): string;
export declare function typeTagToCanonicalString(typeTag: TypeTag): string;
export declare function structTagToObjectID(structTag: StructTag): string;