beeline-cli
Version:
A terminal wallet for the Hive blockchain - type, sign, rule the chain
175 lines • 5.41 kB
TypeScript
import { KeyManager } from './crypto.js';
export interface HiveBalance {
hive: string;
hbd: string;
hp: string;
savings_hive: string;
savings_hbd: string;
}
export interface HiveTransaction {
trx_id: string;
block: number;
trx_in_block: number;
op_in_trx: number;
virtual_op: number;
timestamp: string;
op: [
string,
any
];
}
export interface TransferOperation {
from: string;
to: string;
amount: string;
memo: string;
}
export interface PowerUpOperation {
from: string;
to: string;
amount: string;
}
export interface PowerDownOperation {
account: string;
vesting_shares: string;
}
export interface RewardOperation {
author: string;
curator?: string;
reward: string;
vesting_payout: string;
hbd_payout: string;
hive_payout: string;
}
export interface SavingsOperation {
from: string;
to: string;
amount: string;
memo: string;
request_id?: number;
}
export interface TransactionFilter {
types?: string[];
startDate?: Date;
endDate?: Date;
minAmount?: number;
maxAmount?: number;
currency?: 'HIVE' | 'HBD' | 'VESTS';
direction?: 'incoming' | 'outgoing' | 'all';
}
export interface TransactionAnalytics {
totalTransactions: number;
totalVolume: {
hive: number;
hbd: number;
vests: number;
};
totalFees: number;
averageAmount: {
hive: number;
hbd: number;
};
transactionsByType: Record<string, number>;
transactionsByMonth: Record<string, number>;
topRecipients: Array<{
account: string;
count: number;
total: number;
}>;
topSenders: Array<{
account: string;
count: number;
total: number;
}>;
rewardsSummary: {
author: number;
curator: number;
vesting: number;
};
}
export interface WitnessInfo {
owner: string;
created: string;
url: string;
votes: string;
virtual_last_update: string;
virtual_position: string;
virtual_scheduled_time: string;
total_missed: number;
last_aslot: number;
last_confirmed_block_num: number;
pow_worker: number;
signing_key: string;
props: {
account_creation_fee: string;
maximum_block_size: number;
hbd_interest_rate: number;
};
hbd_exchange_rate: {
base: string;
quote: string;
};
last_hbd_exchange_update: string;
}
export interface GovernanceStatus {
proxy: string | null;
witnessVotes: string[];
votingPower: string;
}
export interface HiveAccount {
name: string;
balance: string;
hbd_balance: string;
vesting_shares: string;
savings_balance: string;
savings_hbd_balance: string;
delegated_vesting_shares: string;
received_vesting_shares: string;
reward_hive_balance: string;
reward_hbd_balance: string;
reward_vesting_balance: string;
vesting_withdraw_rate: string;
next_vesting_withdrawal: string;
withdrawn: number;
to_withdraw: number;
}
export declare class HiveClient {
private client;
private keyManager;
constructor(keyManager: KeyManager, nodeUrl?: string);
getAccount(username: string): Promise<HiveAccount | null>;
getBalance(username: string): Promise<HiveBalance>;
transfer(from: string, to: string, amount: string, currency: 'HIVE' | 'HBD', memo?: string, pin?: string): Promise<string>;
powerUp(from: string, to: string, amount: string, pin?: string): Promise<string>;
powerDown(account: string, amount: string, pin?: string): Promise<string>;
getNodeInfo(): Promise<{
url: string;
version: string;
lastBlockNum: number;
}>;
convertHPToVests(hp: number): Promise<number>;
transferToSavings(from: string, to: string, amount: string, currency: 'HIVE' | 'HBD', memo?: string, pin?: string): Promise<string>;
transferFromSavings(from: string, requestId: number, to: string, amount: string, currency: 'HIVE' | 'HBD', memo?: string, pin?: string): Promise<string>;
claimRewards(account: string, rewardHive: string, rewardHbd: string, rewardVests: string, pin?: string): Promise<string>;
getResourceCredits(username: string): Promise<{
current: number;
max: number;
percentage: number;
}>;
broadcastCustomJson(account: string, id: string, json: any, requiredAuths?: string[], requiredPostingAuths?: string[], pin?: string): Promise<any>;
getAccountHistory(username: string, limit?: number, start?: number, filter?: TransactionFilter): Promise<HiveTransaction[]>;
private getOperationBits;
private filterTransactions;
getTransactionAnalytics(username: string, filter?: TransactionFilter): Promise<TransactionAnalytics>;
witnessVote(voter: string, witness: string, approve: boolean, pin?: string): Promise<string>;
witnessProxy(account: string, proxy: string, pin?: string): Promise<string>;
getWitnesses(limit?: number, activeOnly?: boolean): Promise<WitnessInfo[]>;
getGovernanceStatus(account: string): Promise<GovernanceStatus>;
}
export declare function formatTransactionAmount(amount: string): {
value: number;
currency: string;
formatted: string;
};
export declare function getTransactionDescription(tx: HiveTransaction, currentUser: string): string;
//# sourceMappingURL=hive.d.ts.map