meta-contract
Version:
Meta Contract SDK
46 lines (45 loc) • 1.35 kB
TypeScript
import * as mvc from '../mvc';
import { API_NET, API_TARGET, ApiBase, SA_utxo } from '../api';
type Receiver = {
amount: number;
address: any;
};
type BroadcastOptions = {
noBroadcast: boolean;
dump?: boolean;
};
export declare class Wallet {
privateKey: mvc.PrivateKey;
address: mvc.Address;
feeb: number;
blockChainApi: ApiBase;
network: API_NET;
constructor(wif: string, network?: API_NET, feeb?: number, apiTarget?: API_TARGET, apiUrl?: string);
get api(): ApiBase;
getUnspents(): Promise<SA_utxo[]>;
getUtxos(): Promise<SA_utxo[]>;
getBalance(): Promise<number>;
send(address: string, amount: number, options?: BroadcastOptions): Promise<{
txId: string;
txHex: string;
}>;
sendArray(receivers: Receiver[], utxos?: SA_utxo[], options?: BroadcastOptions): Promise<{
txId: string;
txHex: string;
}>;
merge(options?: BroadcastOptions): Promise<{
txId: string;
txHex: string;
}>;
evenSplit(shares: number, minShareValue?: number, options?: BroadcastOptions): Promise<{
txId: string;
txHex: string;
}>;
private broadcastTxComposer;
sendOpReturn(opreturnData: any, options?: BroadcastOptions): Promise<{
txId: string;
txHex: string;
}>;
private pickUtxo;
}
export {};