UNPKG

@rarible/types

Version:

`@rarible/types` is a TypeScript library that provides type definitions and interfaces for the Rarible ecosystem. This package is designed to facilitate seamless integration with Rarible's APIs and services, ensuring type safety and improved developer exp

34 lines (33 loc) 1.42 kB
import { CustomError } from "@rarible/utils"; import type { Layer1ful } from "../../common/common.js"; import type { BlockchainLayer1Enum } from "../../union/enum/domain.js"; import type { AptosAddress } from "../address/index.js"; /** * Represents module address in Aptos * * @example 0x1234::coin * @see https://aptos.dev/concepts/resources */ export type AptosModuleAddress = Layer1ful<BlockchainLayer1Enum.APTOS> & { __IS_APTOS_MODULE_ADDRESS__: true; }; export declare const aptosModuleAddressRegexp: RegExp; export declare function isAptosModuleAddress(raw: string): raw is AptosModuleAddress; export declare function toAptosModuleAddress(raw: string): AptosModuleAddress; export declare function toAptosModuleAddressSafe(raw: string): AptosModuleAddress | undefined; export type AptosModuleAddressData = { resource: AptosAddress; moduleName: string; }; export declare function parseAptosModuleAddress(str: string): AptosModuleAddressData; export declare function parseAptosModuleAddressSafe(str: string): AptosModuleAddressData | undefined; export declare class InvalidAptosModuleAddressError extends CustomError { constructor(str: string); } /** * Generates random Aptos address * * @example 0xeeff357ea5c1a4e7bc11b2b17ff2dc2dcca69750bfef1e1ebcaccf8c8018175b::coin */ export declare function randomAptosModuleAddress(): string; export declare function randomAptosModuleName(): string;