@bigmi/client
Version:
Reactive primitives for Bitcoin apps.
58 lines (57 loc) • 1.62 kB
TypeScript
import { CreateConnectorFn } from "../types/connector.js";
import { UTXOConnectorParameters, UTXOWalletProvider } from "./types.js";
import { Account, Address } from "@bigmi/core";
//#region src/connectors/reown.d.ts
type ReownConnectorProperties = {
getAccounts(): Promise<readonly Account[]>;
onAccountsChanged(accounts: Address[]): void;
getInternalProvider(): Promise<InternalReownProvider | undefined>;
} & UTXOWalletProvider;
type InternalReownProvider = {
id: string;
name: string;
imageUrl?: string;
connector: BitcoinConnector;
address: Address | undefined;
};
declare enum AddressPurpose {
Ordinal = "ordinal",
Payment = "payment",
Stacks = "stx"
}
type BitcoinConnector = {
connect(): Promise<string>;
getAccountAddresses(): Promise<Array<{
address: string;
publicKey?: string;
purpose: AddressPurpose;
}>>;
signPSBT(params: {
psbt: string;
signInputs: Array<{
address: string;
index: number;
sighashTypes: number[];
}>;
broadcast?: boolean;
}): Promise<{
psbt: string;
txid?: string;
}>;
};
type ReownWalletInfo = {
name?: string;
icon?: string;
};
type ReownConnectorParameters = {
connector: BitcoinConnector;
address?: Address;
walletInfo?: ReownWalletInfo;
} & UTXOConnectorParameters;
declare function reown(parameters: ReownConnectorParameters): CreateConnectorFn<UTXOWalletProvider | undefined, ReownConnectorProperties>;
declare namespace reown {
export var type: "UTXO";
}
//#endregion
export { AddressPurpose, ReownConnectorParameters, ReownWalletInfo, reown };
//# sourceMappingURL=reown.d.ts.map