UNPKG

kuber-client

Version:

Javascript client library for kuber server

39 lines (38 loc) 2.17 kB
import { AxiosInstance } from "axios"; import { CommonProtocolParameters } from "libcardano-wallet/utils/types"; import { RetryConfig } from "../utils/type"; import { UTxO } from "libcardano/cardano/serialization/txinout"; import { HexString } from "libcardano/cardano/serialization"; import { KuberProvider } from "./KuberProvider"; export declare class KuberApiProvider extends KuberProvider { axios: AxiosInstance; retry?: RetryConfig; constructor(kuberApiUrl: string, apiKey?: string, retry?: RetryConfig); queryUTxOByAddress(address: string): Promise<UTxO[]>; queryUTxOByTxIn(txIn: string): Promise<UTxO[]>; queryProtocolParameters(): Promise<CommonProtocolParameters>; querySystemStart(): Promise<any>; queryChainTip(): Promise<any>; /** * Build a transaction with kuber. * The built transaction will already have exact min-fee, exact execution-units and extra change output if necessary. * The transaction will be ready to be signed and submitted. * **Note** It important to remember that the transaction returned by kuber api * and the transaction returned by kuber-client might be different due to reason mentioned here * <a href="https://github.com/Emurgo/cardano-serialization-lib/issues/429">cardano-serialization-lib/issues</a> * @param cip30Instance Browser cip30 provider instance obtained with enable() * @param buildRequest Object following Kuber's transaction builder JSON spec * @param autoAddCollateral Add collateral from provider. Kuber automatically picks collateral. * set this to true if you want to specify exact collateral utxo. * @returns A new rejected Promise. */ buildTx(txBuilder: any, submit?: boolean): Promise<any>; /** * Submit a transaction with kuber's submit API. Note that kuber's submit api is limted to current era transaction only * @param tx Browser Transaction to be submitted * @param buildRequest Object following Kuber's transaction builder JSON spec * @returns A new rejected Promise. */ submitTx(cborString: HexString): Promise<any>; calculateMinFee(tx: string): Promise<BigInt>; }