UNPKG

@glitterprotocol/glitter-sdk

Version:

The JavaScript SDK for Glitter

51 lines (50 loc) 1.99 kB
import { PublicKey } from '../PublicKey'; import { JSONSerializable } from '../../util/json'; import { BaseAccount } from './BaseAccount'; import { EthAccount as EthAccount_pb } from '@glitterprotocol/glitter.proto/ethermint/types/v1/account'; import { Any } from '@glitterprotocol/glitter.proto/google/protobuf/any'; /** * Stores information about an account fetched from the blockchain. */ export declare class EthAccount extends JSONSerializable<EthAccount.Amino, EthAccount.Data, EthAccount.Proto> { base_account: BaseAccount; code_hash: string; /** * Creates a new Account object, holding information about a basic account. * * @param address account address * @param public_key account's public key information * @param account_number account number on the blockchain * @param sequence sequence number, or number of transactions that have been posted */ constructor(base_account: BaseAccount, code_hash: string); getAccountNumber(): number; getSequenceNumber(): number; getPublicKey(): PublicKey | null; toAmino(_?: boolean): EthAccount.Amino; static fromAmino(data: EthAccount.Amino, _?: boolean): EthAccount; static fromData(data: EthAccount.Data, _?: boolean): EthAccount; toData(_?: boolean): EthAccount.Data; toProto(_?: boolean): EthAccount.Proto; static fromProto(EthAccountProto: EthAccount.Proto, _?: boolean): EthAccount; packAny(isClassic?: boolean): Any; static unpackAny(pubkeyAny: Any, isClassic?: boolean): EthAccount; } export declare namespace EthAccount { interface AminoValue { base_account: BaseAccount; code_hash: string; } interface Amino { type: 'cosmos-sdk/BaseAccount'; value: AminoValue; } interface DataValue { base_account: BaseAccount; code_hash: string; } interface Data extends DataValue { '@type': '/ethermint.types.v1.EthAccount'; } type Proto = EthAccount_pb; }