UNPKG

@libra-opensource/client-sdk-typescript

Version:
43 lines (42 loc) 1.5 kB
import { JsonRpcMethod } from '../jsonRpc/types'; import { CurrencyInfo, Metadata, Transaction, Account, Event } from './diem-jsonrpc-types'; export interface DiemJsonRPCMethod<R> extends JsonRpcMethod { response: { result: R; diem_chain_id: number; diem_ledger_timestampusec: BigInt; diem_ledger_version: BigInt; }; } export interface GetTransactionsMethod extends DiemJsonRPCMethod<Transaction[]> { method: 'get_transactions'; params: [BigInt, number, boolean]; } export interface GetAccountStateMethod extends DiemJsonRPCMethod<Account | null> { method: 'get_account'; params: [string]; } export interface GetAccountTransactionMethod extends DiemJsonRPCMethod<Transaction> { method: 'get_account_transaction'; params: [string, BigInt, boolean]; } export interface GetAccountTransactionsMethod extends DiemJsonRPCMethod<Transaction[]> { method: 'get_account_transactions'; params: [string, BigInt, number, boolean]; } export interface GetMetadataMethod extends DiemJsonRPCMethod<Metadata> { method: 'get_metadata'; params: [BigInt | undefined]; } export interface GetCurrenciesMethod extends DiemJsonRPCMethod<CurrencyInfo[]> { method: 'get_currencies'; params: []; } export interface GetEventsMethod extends DiemJsonRPCMethod<Event[]> { method: 'get_events'; params: [string, BigInt, number]; } export interface SubmitMethod extends DiemJsonRPCMethod<void> { method: 'submit'; params: [string]; }