UNPKG

stellar-plus

Version:

beta version of stellar-plus, an all-in-one sdk for the Stellar blockchain

98 lines (97 loc) 4.62 kB
import { rpc as SorobanRpc, Transaction, xdr } from '@stellar/stellar-sdk'; import { RpcHandler } from '../../../stellar-plus/rpc/types'; import { NetworkConfig } from '../../../stellar-plus/types'; export declare class ValidationCloudRpcHandler implements RpcHandler { readonly type = "RpcHandler"; private apiKey; private networkConfig; private baseUrl; private id; /** * * @param {NetworkConfig} networkConfig - The network to use. * @param {string} apiKey - The API key to authenticate with Validation Cloud's API. * * @description - This rpc handler integrates directly with Validation Cloud's API. And uses their RPC infrastructure to carry out the RPC functions. * */ constructor(networkConfig: NetworkConfig, apiKey: string); private generateId; private fetch; /** * * @param {string} txHash - The transaction hash to get. * * @returns {Promise<SorobanRpc.GetTransactionResponse | SorobanRpc.GetFailedTransactionResponse | SorobanRpc.GetMissingTransactionResponse | SorobanRpc.GetSuccessfulTransactionResponse>} The transaction response from the Soroban server. * * @description - Gets the transaction from the Soroban server. */ getTransaction(txHash: string): Promise<SorobanRpc.Api.GetTransactionResponse | SorobanRpc.Api.GetFailedTransactionResponse | SorobanRpc.Api.GetMissingTransactionResponse | SorobanRpc.Api.GetSuccessfulTransactionResponse>; /** * @returns {Promise<SorobanRpc.GetLatestLedgerResponse>} The latest ledger response from the Soroban server. * @description - Gets the latest ledger from the Soroban RPC server. * */ getLatestLedger(): Promise<SorobanRpc.Api.GetLatestLedgerResponse>; /** * @returns {Promise<SorobanRpc.GetHealthResponse>} The health response from the Soroban server. * @description - Gets the health of the Soroban RPC server. * */ getHealth(): Promise<SorobanRpc.Api.GetHealthResponse>; /** * @returns {Promise<SorobanRpc.GetNetworkResponse>} The network response from the Soroban server. * @description - Gets the network of the Soroban RPC server. * */ getNetwork(): Promise<SorobanRpc.Api.GetNetworkResponse>; /** * * @description - Important: This integration might fail due to the RPC server build on VC. startLedger recently has been changed to a 'number'. Refer to https://github.com/stellar/js-stellar-sdk/issues/893 * * @args {SorobanRpc.GetEventsRequest} request - The events request to get. * @args {Api.EventFilter[]} request.filters - The filters to apply to the events. * @args {number} request.startLedger - The start ledger to get the events from. * @args {string} request.cursor - The cursor to get the events from. * @args {number} request.limit - The limit of events to get. * * * @returns {SorobanRpc.GetEventsResponse} The events response from the Soroban server. * * @description - Gets the events from the Soroban server. */ getEvents(request: SorobanRpc.Server.GetEventsRequest): Promise<SorobanRpc.Api.GetEventsResponse>; /** * * @param {xdr.LedgerKey[]} keys - The keys to get the ledger entries for. * * @returns {SorobanRpc.GetLedgerEntriesResponse} The ledger entries response from the Soroban server. * * @description - Gets the ledger entries from the Soroban server. */ getLedgerEntries(...keys: xdr.LedgerKey[]): Promise<SorobanRpc.Api.GetLedgerEntriesResponse>; /** * * @param {Transaction} tx - The transaction to simulate. * * @returns {Promise<SorobanRpc.SimulateTransactionResponse>} The transaction simulation response from the Soroban server. * * @description - Simulates the transaction on the Soroban server. */ simulateTransaction(tx: Transaction): Promise<SorobanRpc.Api.SimulateTransactionResponse>; /** * * @param {Transaction} tx - The transaction to prepare. * * @returns {Promise<Transaction>} The prepared transaction. * * @description - Prepares the transaction on the Soroban server. */ prepareTransaction(tx: Transaction): Promise<Transaction>; /** * * @param {Transaction} tx - The transaction to submit. * * @returns {Promise<SorobanRpc.SendTransactionResponse>} The transaction submission response from the Soroban server. * * @description - Submits the transaction on the Soroban server. */ submitTransaction(tx: Transaction): Promise<SorobanRpc.Api.SendTransactionResponse>; }