@bithive/relayer-api
Version:
BitHive Relayer API
51 lines (50 loc) • 2.2 kB
TypeScript
import { Client } from './Client';
import { UserGetAccountInput, UserGetAccountOutput, UserGetDepositInput, UserGetDepositOutput, UserGetDepositsInput, UserGetDepositsOutput, UserGetPointsInput, UserGetPointsOutput } from '../types';
import { TRPCClient } from './common';
export declare class UserClient extends Client {
private constructor();
static new(options: UserClientOptions): UserClient;
/**
* Get user account
* @param input - the input for the query
* - publicKey: The public key of the user
* @returns The output of the query
* - account: The account info of the user, including public key, total deposit amount,
* total unstaking amount, unstaking start timestamp, unstaking end timestamp, nonce for signing unstake message,
* and pending sign psbt, etc.
*/
getAccount(input: UserGetAccountInput): Promise<UserGetAccountOutput>;
/**
* Get deposit info
* @param input - the input for the query
* - publicKey: The public key of the user
* - txHash: The transaction hash of the deposit
* - vout: The vout of the deposit
* @returns The output of the query
* - deposit: The deposit info
*/
getDeposit(input: UserGetDepositInput): Promise<UserGetDepositOutput>;
/**
* Get all deposits info of the user
* @param input - the input for the query
* - publicKey: The public key of the user
* - offset: The index of the first deposit in the query
* - limit: The maximum number of deposits to return
* @returns The output of the query
* - deposits: The deposits info array
*/
getDeposits(input: UserGetDepositsInput): Promise<UserGetDepositsOutput>;
/**
* Get points info of the user
* @param input - the input for the query
* - publicKey: The public key of the user
* - startTimestamp: The start timestamp for counting points
* - endTimestamp: The end timestamp for counting points
* @returns The output of the query
* - points: The points info
*/
getPoints(input: UserGetPointsInput): Promise<UserGetPointsOutput>;
}
export type UserClientOptions = {
client: TRPCClient;
};