send-crypto
Version:
A minimal JavaScript library / wallet for sending crypto assets
47 lines (46 loc) • 1.26 kB
TypeScript
import { UTXO } from "../../lib/utxo";
export interface SoChainUTXO {
txid: string;
value: number;
script_asm: string;
script_hex: string;
output_no: number;
confirmations: number;
time: number;
}
export interface SoChainTX {
network: string;
txid: string;
blockhash: string | null;
confirmations: number;
time: number;
inputs: Array<{
input_no: number;
value: string;
address: string;
type: "pubkeyhash";
script: string;
witness: null;
from_output: {
txid: string;
output_no: number;
};
}>;
outputs: Array<{
output_no: 0;
value: string;
address: string;
type: "pubkeyhash";
script: string;
}>;
tx_hex: string;
size: number;
version: 1;
locktime: 0;
}
export declare const Sochain: {
fetchUTXOs: (network: string) => (address: string, confirmations: number) => Promise<UTXO[]>;
broadcastTransaction: (network: string) => (txHex: string) => Promise<string>;
fetchUTXO: (network: string) => (txHash: string, vOut: number) => Promise<UTXO>;
fetchTXs: (network: string) => (address: string, confirmations?: number) => Promise<UTXO[]>;
};