Interface Unisat

interface Unisat {
    web3?: Web3Provider;
    getAccounts(): Promise<string[]>;
    getBalance(): Promise<Balance>;
    getChain(): Promise<UnisatChainType>;
    getNetwork(): Promise<UnisatNetwork>;
    getPublicKey(): Promise<string>;
    on(event: "accountsChanged", listener: ((accounts: string[]) => void)): void;
    on(event: "chainChanged" | "networkChanged", listener: ((network: UnisatNetwork) => void)): void;
    pushPsbt(psbtHex: string): Promise<string>;
    pushTx(options: {
        rawtx: string;
    }): Promise<string>;
    removeListener(event: "accountsChanged", listener: ((accounts: string[]) => void)): void;
    removeListener(event: "networkChanged", listener: ((network: UnisatNetwork) => void)): void;
    requestAccounts(): Promise<string[]>;
    sendBitcoin(toAddress: string, satoshis: number, options: {
        feeRate: number;
        memo?: string;
        memos?: string[];
    }): Promise<string>;
    signMessage(message: string, type?: MessageType): Promise<string>;
    signPsbt(psbtHex: string, psbtOptions: PsbtSignatureOptions): Promise<string>;
    signPsbts(psbtHex: string[], psbtOptions: PsbtSignatureOptions): Promise<string[]>;
    switchNetwork(network: UnisatNetwork): Promise<void>;
}

Properties

Methods

  • Parameters

    • toAddress: string
    • satoshis: number
    • options: {
          feeRate: number;
          memo?: string;
          memos?: string[];
      }
      • feeRate: number
      • Optionalmemo?: string
      • Optionalmemos?: string[]

    Returns Promise<string>