lotus-sdk
Version:
Central repository for several classes of tools for integrating with, and building for, the Lotusia ecosystem
66 lines • 2.86 kB
TypeScript
import { Network } from './networks.js';
import { PublicKey } from './publickey.js';
import { Script } from './script.js';
export interface AddressData {
hashBuffer?: Buffer;
network?: Network;
type?: string;
}
export interface AddressObject {
hash: string;
type: string;
network: string;
}
export interface CashAddressDecoding {
readonly network: Network;
readonly type: string;
readonly hashBuffer: Buffer;
}
export type AddressInput = string | Buffer | AddressData | PublicKey | PublicKey[] | Script;
export declare class Address {
static readonly PayToPublicKeyHash = "pubkeyhash";
static readonly PayToScriptHash = "scripthash";
static readonly PayToTaproot = "taproot";
readonly hashBuffer: Buffer;
readonly network: Network;
readonly type: string;
constructor(data?: AddressInput, network?: Network | string, type?: string);
private _classifyArguments;
private static _classifyFromVersion;
private static _transformString;
private static _transformLegacyString;
private static _isXAddress;
private static _transformXAddressString;
private static _transformHash;
private static _transformBuffer;
private static _transformPublicKey;
private static _transformScript;
private static _transformObject;
static createMultisig(publicKeys: PublicKey[], threshold: number, network?: Network | string): Address;
static fromPublicKey(data: PublicKey, network?: Network | string): Address;
static fromPublicKeyHash(hash: Buffer, network?: Network | string): Address;
static fromScriptHash(hash: Buffer, network?: Network | string): Address;
static fromTaprootCommitment(commitment: PublicKey | Buffer, network?: Network | string): Address;
static fromBuffer(buffer: Buffer, network?: Network | string, type?: string): Address;
static fromString(str: string, network?: Network | string): Address;
static fromObject(obj: AddressObject): Address;
static fromScript(script: Script, network?: Network | string): Address;
static payingTo(script: Script, network?: Network | string): Address;
static getValidationError(data: AddressInput, network?: Network | string, type?: string): Error | null;
static isValid(data: AddressInput, network?: Network | string, type?: string): boolean;
isPayToPublicKeyHash(): boolean;
isPayToScriptHash(): boolean;
isPayToTaproot(): boolean;
toBuffer(): Buffer;
toFullBuffer(): Buffer;
toCashBuffer(): Buffer;
toObject(): AddressObject;
toJSON(): AddressObject;
toString(network?: Network | string): string;
toLegacyAddress(): string;
toCashAddress(): string;
toXAddress(network?: Network | string): string;
static decodeCashAddress(address: string): CashAddressDecoding;
inspect(): string;
}
//# sourceMappingURL=address.d.ts.map