export declare enum API_NET { MAIN = "mainnet", TEST = "testnet" } export declare enum API_TARGET { MVC = "mvc" } export declare type NonFungibleTokenUnspent = { txId: string; outputIndex: number; tokenAddress: string; tokenIndex: string; metaTxId: string; metaOutputIndex: number; }; export declare type FungibleTokenUnspent = { txId: string; outputIndex: number; tokenAddress: string; tokenAmount: string; }; export declare type SA_utxo = { txId: string; outputIndex: number; satoshis: number; address: string; height: number; }; export declare type FungibleTokenSummary = { codehash: string; genesis: string; sensibleId: string; pendingBalance: string; balance: string; symbol: string; decimal: number; }; export declare type NonFungibleTokenSummary = { codehash: string; genesis: string; sensibleId: string; count: string; pendingCount: string; metaTxId: string; metaOutputIndex: number; supply: string; }; export declare type FungibleTokenBalance = { balance: string; pendingBalance: string; utxoCount: number; decimal: number; }; export declare type NftSellUtxo = { codehash: string; genesis: string; tokenIndex: string; txId: string; outputIndex: number; sellerAddress: string; contractAddress?: string; satoshisPrice: number; price: number; }; export declare type AuthorizationOption = { /** * should be provided in MetaSV */ authorization?: string; /** * should be provided in MetaSV */ privateKey?: any; }; export declare type OutpointSpent = { spentTxId: string; spentInputIndex: number; }; export interface ApiBase { authorize: (options: AuthorizationOption) => void; getUnspents: (address: string) => Promise; getRawTxData: (txid: string) => Promise; checkTxSeen: (txid: string) => Promise; broadcast: (hex: string) => Promise; getFungibleTokenUnspents: (codehash: string, genesis: string, address: string, size?: number) => Promise; getFungibleTokenBalance: (codehash: string, genesis: string, address: string) => Promise; getFungibleTokenSummary(address: string): Promise; getNonFungibleTokenUnspents(codehash: string, genesis: string, address: string, cursor?: number, size?: number): Promise; getNonFungibleTokenUnspentDetail(codehash: string, genesis: string, tokenIndex: string): Promise; getNonFungibleTokenSummary(address: string): Promise; getBalance(address: string): Promise<{ balance: number; pendingBalance: number; }>; getNftSellUtxo(codehash: string, genesis: string, tokenIndex: string, includesNotReady?: boolean): Promise; getNftSellList(codehash: string, genesis: string, cursor?: number, size?: number): Promise; getNftSellListByAddress(address: string, cursor?: number, size?: number): Promise; getOutpointSpent(txId: string, index: number): Promise; getXpubLiteUtxo(xpub: string): Promise; getXpubLiteBalance(xpub: string): Promise; } export declare class Api implements ApiBase { private apiTarget; private apiHandler; constructor(apiNet: API_NET, apiTarget?: API_TARGET, serverBase?: string); /** * Authorization to use MetaSV * @param options * @returns */ authorize(options: AuthorizationOption): void; getUnspents(address: string): Promise; getBalance(address: string): Promise<{ balance: number; pendingBalance: number; }>; getRawTxData(txid: string): Promise; checkTxSeen(txid: string): Promise; broadcast(hex: string): Promise; getFungibleTokenUnspents(codehash: string, genesis: string, address: string, size?: number): Promise; getFungibleTokenBalance(codehash: string, genesis: string, address: string): Promise; getFungibleTokenSummary(address: string): Promise; getNonFungibleTokenUnspents(codehash: string, genesis: string, address: string, cursor?: number, size?: number): Promise; getNonFungibleTokenUnspentDetail(codehash: string, genesis: string, tokenIndex: string): Promise; getNonFungibleTokenSummary(address: string): Promise; getNftSellUtxo(codehash: string, genesis: string, tokenIndex: string, includesNotReady?: boolean): Promise; getNftSellList(codehash: string, genesis: string, cursor?: number, size?: number): Promise; getNftSellListByAddress(address: string, cursor?: number, size?: number): Promise; getOutpointSpent(txId: string, index: number): Promise; getXpubLiteUtxo(xpub: string): Promise; getXpubLiteBalance(xpub: string): Promise; }