import Long from "long"; import _m0 from "protobufjs/minimal"; import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; import { FunToken, Log, Params, TraceConfig } from "./evm"; import { MsgEthereumTx, MsgEthereumTxResponse } from "./tx"; /** Copyright (c) 2023-2024 Nibi, Inc. */ /** QueryEthAccountRequest: Request type for "/eth.evm.v1.Query/EthAccount" */ export interface QueryEthAccountRequest { /** * address is the Ethereum hex address or nibi Bech32 address to query the * account for. */ address: string; } /** QueryEthAccountResponse: Response type for "/eth.evm.v1.Query/EthAccount" */ export interface QueryEthAccountResponse { /** balance_wei is the balance of wei (attoNIBI, since NIBI is ether). */ balanceWei: string; /** * code_hash is the hex-encoded hash of the contract bytecode for the * account. Ethereum defines a code hash as the keccack 256 hash of the bytes. * Note that externally owned accounts (EOAs) have the empty/nil code hash * (`crypto.Keccak256(nil)`). */ codeHash: string; /** nonce is the account's sequence number. */ nonce: Long; /** * eth_address: The hexadecimal-encoded string representing the 20 byte * address of a Nibiru EVM account. Note that this field may be empty if the * account queried is a Wasm contract (32 byte address). */ ethAddress: string; /** * bech32_address is the nibi-prefixed address of the account that can receive * bank transfers ("cosmos.bank.v1beta1.MsgSend"). */ bech32Address: string; } /** * QueryValidatorAccountRequest is the request type for the * Query/ValidatorAccount RPC method. */ export interface QueryValidatorAccountRequest { /** cons_address is the validator cons address to query the account for. */ consAddress: string; } /** * QueryValidatorAccountResponse is the response type for the * Query/ValidatorAccount RPC method. */ export interface QueryValidatorAccountResponse { /** account_address is the Nibiru address of the account in bech32 format. */ accountAddress: string; /** sequence is the account's sequence number. */ sequence: Long; /** account_number is the account number */ accountNumber: Long; } /** QueryBalanceRequest: Response type for "/eth.evm.v1.Query/Balance" */ export interface QueryBalanceRequest { /** address is the ethereum hex address to query the balance for. */ address: string; /** * token is an ERC20 address or bank denom to query alongside the native EVM * balance. Leave empty to query only the native EVM balance. */ token: string; } /** QueryBalanceResponse: Response type for "/eth.evm.v1.Query/Balance" */ export interface QueryBalanceResponse { /** * balance is the balance of the EVM denomination in units of wei. 1 wei is 1 * attoNIBI. */ balanceWei: string; /** * bank is the Bank module token balance details when a bank representation is * available for the requested token. */ bank?: BalanceBank; /** * erc20 is the ERC20 token balance details when an ERC20 representation is * available for the requested token. */ erc20?: BalanceERC20; } /** BalanceBank is the Bank module balance view for a token. */ export interface BalanceBank { symbol: string; balanceHuman: string; decimals: number; coinDenom: string; balanceBase: string; } /** BalanceERC20 is the ERC20 balance view for a token. */ export interface BalanceERC20 { address: string; symbol: string; balanceHuman: string; decimals: number; name: string; balanceBase: string; } /** QueryStorageRequest is the request type for the Query/Storage RPC method. */ export interface QueryStorageRequest { /** address is the ethereum hex address to query the storage state for. */ address: string; /** key defines the key of the storage state */ key: string; } /** * QueryStorageResponse is the response type for the Query/Storage RPC * method. */ export interface QueryStorageResponse { /** value defines the storage state value hash associated with the given key. */ value: string; } /** QueryCodeRequest is the request type for the Query/Code RPC method. */ export interface QueryCodeRequest { /** address is the ethereum hex address to query the code for. */ address: string; } /** * QueryCodeResponse is the response type for the Query/Code RPC * method. */ export interface QueryCodeResponse { /** code represents the code bytes from an ethereum address. */ code: Uint8Array; } /** QueryTxLogsRequest is the request type for the Query/TxLogs RPC method. */ export interface QueryTxLogsRequest { /** hash is the ethereum transaction hex hash to query the logs for. */ hash: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } /** QueryTxLogsResponse is the response type for the Query/TxLogs RPC method. */ export interface QueryTxLogsResponse { /** logs represents the ethereum logs generated from the given transaction. */ logs: Log[]; /** pagination defines the pagination in the response. */ pagination?: PageResponse; } /** QueryParamsRequest defines the request type for querying x/evm parameters. */ export interface QueryParamsRequest { } /** QueryParamsResponse defines the response type for querying x/evm parameters. */ export interface QueryParamsResponse { /** params define the evm module parameters. */ params?: Params; } /** EthCallRequest defines EthCall request */ export interface EthCallRequest { /** args uses the same json format as the json rpc api. */ args: Uint8Array; /** gas_cap defines the default gas cap to be used */ gasCap: Long; /** proposer_address of the requested block in hex format */ proposerAddress: Uint8Array; /** chain_id is the eip155 chain id parsed from the requested block header */ chainId: Long; } /** EstimateGasResponse defines EstimateGas response */ export interface EstimateGasResponse { /** gas returns the estimated gas */ gas: Long; } /** QueryTraceTxRequest defines TraceTx request */ export interface QueryTraceTxRequest { /** msg is the MsgEthereumTx for the requested transaction */ msg?: MsgEthereumTx; /** trace_config holds extra parameters to trace functions. */ traceConfig?: TraceConfig; /** * predecessors is an array of transactions included in the same block * need to be replayed first to get correct context for tracing. */ predecessors: MsgEthereumTx[]; /** block_number of requested transaction */ blockNumber: Long; /** block_hash of requested transaction */ blockHash: string; /** block_time of requested transaction */ blockTime?: Date; /** proposer_address is the proposer of the requested block */ proposerAddress: Uint8Array; /** chain_id is the the eip155 chain id parsed from the requested block header */ chainId: Long; /** block_max_gas of the block of the requested transaction */ blockMaxGas: Long; } /** QueryTraceTxResponse defines TraceTx response */ export interface QueryTraceTxResponse { /** data is the response serialized in bytes */ data: Uint8Array; } /** QueryTraceBlockRequest defines TraceTx request */ export interface QueryTraceBlockRequest { /** txs is an array of messages in the block */ txs: MsgEthereumTx[]; /** trace_config holds extra parameters to trace functions. */ traceConfig?: TraceConfig; /** block_number of the traced block */ blockNumber: Long; /** block_hash (hex) of the traced block */ blockHash: string; /** block_time of the traced block */ blockTime?: Date; /** proposer_address is the address of the requested block */ proposerAddress: Uint8Array; /** chain_id is the eip155 chain id parsed from the requested block header */ chainId: Long; /** block_max_gas of the traced block */ blockMaxGas: Long; } /** QueryTraceBlockResponse defines TraceBlock response */ export interface QueryTraceBlockResponse { /** data is the response serialized in bytes */ data: Uint8Array; } /** * QueryBaseFeeRequest defines the request type for querying the EIP1559 base * fee. */ export interface QueryBaseFeeRequest { } /** * QueryBaseFeeResponse returns the EIP1559 base fee. * See * https://github.com/ethereum/EIPs/blob/ba6c342c23164072adb500c3136e3ae6eabff306/EIPS/eip-1559.md. */ export interface QueryBaseFeeResponse { /** base_fee is the EIP1559 base fee in units of wei. */ baseFee: string; /** base_fee is the EIP1559 base fee in units of micronibi ("unibi"). */ baseFeeUnibi: string; } export interface QueryFunTokenMappingRequest { /** * Either the hexadecimal-encoded ERC20 contract address or denomination of * the Bank Coin. */ token: string; } export interface QueryFunTokenMappingResponse { /** fun_token is a mapping between the Bank Coin and the ERC20 contract address */ funToken?: FunToken; } export declare const QueryEthAccountRequest: { encode(message: QueryEthAccountRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryEthAccountRequest; fromJSON(object: any): QueryEthAccountRequest; toJSON(message: QueryEthAccountRequest): unknown; create, I>>(base?: I): QueryEthAccountRequest; fromPartial, I>>(object: I): QueryEthAccountRequest; }; export declare const QueryEthAccountResponse: { encode(message: QueryEthAccountResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryEthAccountResponse; fromJSON(object: any): QueryEthAccountResponse; toJSON(message: QueryEthAccountResponse): unknown; create, I>>(base?: I): QueryEthAccountResponse; fromPartial, I>>(object: I): QueryEthAccountResponse; }; export declare const QueryValidatorAccountRequest: { encode(message: QueryValidatorAccountRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorAccountRequest; fromJSON(object: any): QueryValidatorAccountRequest; toJSON(message: QueryValidatorAccountRequest): unknown; create, I>>(base?: I): QueryValidatorAccountRequest; fromPartial, I>>(object: I): QueryValidatorAccountRequest; }; export declare const QueryValidatorAccountResponse: { encode(message: QueryValidatorAccountResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorAccountResponse; fromJSON(object: any): QueryValidatorAccountResponse; toJSON(message: QueryValidatorAccountResponse): unknown; create, I>>(base?: I): QueryValidatorAccountResponse; fromPartial, I>>(object: I): QueryValidatorAccountResponse; }; export declare const QueryBalanceRequest: { encode(message: QueryBalanceRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceRequest; fromJSON(object: any): QueryBalanceRequest; toJSON(message: QueryBalanceRequest): unknown; create, I>>(base?: I): QueryBalanceRequest; fromPartial, I>>(object: I): QueryBalanceRequest; }; export declare const QueryBalanceResponse: { encode(message: QueryBalanceResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceResponse; fromJSON(object: any): QueryBalanceResponse; toJSON(message: QueryBalanceResponse): unknown; create, I>>(base?: I): QueryBalanceResponse; fromPartial, I>>(object: I): QueryBalanceResponse; }; export declare const BalanceBank: { encode(message: BalanceBank, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): BalanceBank; fromJSON(object: any): BalanceBank; toJSON(message: BalanceBank): unknown; create, I>>(base?: I): BalanceBank; fromPartial, I>>(object: I): BalanceBank; }; export declare const BalanceERC20: { encode(message: BalanceERC20, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): BalanceERC20; fromJSON(object: any): BalanceERC20; toJSON(message: BalanceERC20): unknown; create, I>>(base?: I): BalanceERC20; fromPartial, I>>(object: I): BalanceERC20; }; export declare const QueryStorageRequest: { encode(message: QueryStorageRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryStorageRequest; fromJSON(object: any): QueryStorageRequest; toJSON(message: QueryStorageRequest): unknown; create, I>>(base?: I): QueryStorageRequest; fromPartial, I>>(object: I): QueryStorageRequest; }; export declare const QueryStorageResponse: { encode(message: QueryStorageResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryStorageResponse; fromJSON(object: any): QueryStorageResponse; toJSON(message: QueryStorageResponse): unknown; create, I>>(base?: I): QueryStorageResponse; fromPartial, I>>(object: I): QueryStorageResponse; }; export declare const QueryCodeRequest: { encode(message: QueryCodeRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodeRequest; fromJSON(object: any): QueryCodeRequest; toJSON(message: QueryCodeRequest): unknown; create, I>>(base?: I): QueryCodeRequest; fromPartial, I>>(object: I): QueryCodeRequest; }; export declare const QueryCodeResponse: { encode(message: QueryCodeResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodeResponse; fromJSON(object: any): QueryCodeResponse; toJSON(message: QueryCodeResponse): unknown; create, I>>(base?: I): QueryCodeResponse; fromPartial, I>>(object: I): QueryCodeResponse; }; export declare const QueryTxLogsRequest: { encode(message: QueryTxLogsRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryTxLogsRequest; fromJSON(object: any): QueryTxLogsRequest; toJSON(message: QueryTxLogsRequest): unknown; create, I>>(base?: I): QueryTxLogsRequest; fromPartial, I>>(object: I): QueryTxLogsRequest; }; export declare const QueryTxLogsResponse: { encode(message: QueryTxLogsResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryTxLogsResponse; fromJSON(object: any): QueryTxLogsResponse; toJSON(message: QueryTxLogsResponse): unknown; create, I>>(base?: I): QueryTxLogsResponse; fromPartial, I>>(object: I): QueryTxLogsResponse; }; export declare const QueryParamsRequest: { encode(_: QueryParamsRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest; fromJSON(_: any): QueryParamsRequest; toJSON(_: QueryParamsRequest): unknown; create, I>>(base?: I): QueryParamsRequest; fromPartial, I>>(_: I): QueryParamsRequest; }; export declare const QueryParamsResponse: { encode(message: QueryParamsResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse; fromJSON(object: any): QueryParamsResponse; toJSON(message: QueryParamsResponse): unknown; create, I>>(base?: I): QueryParamsResponse; fromPartial, I>>(object: I): QueryParamsResponse; }; export declare const EthCallRequest: { encode(message: EthCallRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): EthCallRequest; fromJSON(object: any): EthCallRequest; toJSON(message: EthCallRequest): unknown; create, I>>(base?: I): EthCallRequest; fromPartial, I>>(object: I): EthCallRequest; }; export declare const EstimateGasResponse: { encode(message: EstimateGasResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): EstimateGasResponse; fromJSON(object: any): EstimateGasResponse; toJSON(message: EstimateGasResponse): unknown; create, I>>(base?: I): EstimateGasResponse; fromPartial, I>>(object: I): EstimateGasResponse; }; export declare const QueryTraceTxRequest: { encode(message: QueryTraceTxRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryTraceTxRequest; fromJSON(object: any): QueryTraceTxRequest; toJSON(message: QueryTraceTxRequest): unknown; create, I>>(base?: I): QueryTraceTxRequest; fromPartial, I>>(object: I): QueryTraceTxRequest; }; export declare const QueryTraceTxResponse: { encode(message: QueryTraceTxResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryTraceTxResponse; fromJSON(object: any): QueryTraceTxResponse; toJSON(message: QueryTraceTxResponse): unknown; create, I>>(base?: I): QueryTraceTxResponse; fromPartial, I>>(object: I): QueryTraceTxResponse; }; export declare const QueryTraceBlockRequest: { encode(message: QueryTraceBlockRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryTraceBlockRequest; fromJSON(object: any): QueryTraceBlockRequest; toJSON(message: QueryTraceBlockRequest): unknown; create, I>>(base?: I): QueryTraceBlockRequest; fromPartial, I>>(object: I): QueryTraceBlockRequest; }; export declare const QueryTraceBlockResponse: { encode(message: QueryTraceBlockResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryTraceBlockResponse; fromJSON(object: any): QueryTraceBlockResponse; toJSON(message: QueryTraceBlockResponse): unknown; create, I>>(base?: I): QueryTraceBlockResponse; fromPartial, I>>(object: I): QueryTraceBlockResponse; }; export declare const QueryBaseFeeRequest: { encode(_: QueryBaseFeeRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryBaseFeeRequest; fromJSON(_: any): QueryBaseFeeRequest; toJSON(_: QueryBaseFeeRequest): unknown; create, I>>(base?: I): QueryBaseFeeRequest; fromPartial, I>>(_: I): QueryBaseFeeRequest; }; export declare const QueryBaseFeeResponse: { encode(message: QueryBaseFeeResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryBaseFeeResponse; fromJSON(object: any): QueryBaseFeeResponse; toJSON(message: QueryBaseFeeResponse): unknown; create, I>>(base?: I): QueryBaseFeeResponse; fromPartial, I>>(object: I): QueryBaseFeeResponse; }; export declare const QueryFunTokenMappingRequest: { encode(message: QueryFunTokenMappingRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryFunTokenMappingRequest; fromJSON(object: any): QueryFunTokenMappingRequest; toJSON(message: QueryFunTokenMappingRequest): unknown; create, I>>(base?: I): QueryFunTokenMappingRequest; fromPartial, I>>(object: I): QueryFunTokenMappingRequest; }; export declare const QueryFunTokenMappingResponse: { encode(message: QueryFunTokenMappingResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): QueryFunTokenMappingResponse; fromJSON(object: any): QueryFunTokenMappingResponse; toJSON(message: QueryFunTokenMappingResponse): unknown; create, I>>(base?: I): QueryFunTokenMappingResponse; fromPartial, I>>(object: I): QueryFunTokenMappingResponse; }; /** Query defines the gRPC querier service. */ export interface Query { /** * EthAccount queries a Nibiru account using its EVM address or Bech32 Nibiru * address. */ EthAccount(request: QueryEthAccountRequest): Promise; /** * ValidatorAccount queries an Ethereum account's from a validator consensus * Address. */ ValidatorAccount(request: QueryValidatorAccountRequest): Promise; /** * Balance queries the balance of the NIBI (ether for the EVM) in units of wei * for a single EthAccount. 1 wei == 1 attoNIBI == 10^{-18} NIBI. */ Balance(request: QueryBalanceRequest): Promise; /** Storage queries the balance of all coins for a single account. */ Storage(request: QueryStorageRequest): Promise; /** Code queries the balance of all coins for a single account. */ Code(request: QueryCodeRequest): Promise; /** Params queries the parameters of x/evm module. */ Params(request: QueryParamsRequest): Promise; /** EthCall implements the `eth_call` rpc api */ EthCall(request: EthCallRequest): Promise; /** EstimateGas implements the `eth_estimateGas` rpc api */ EstimateGas(request: EthCallRequest): Promise; /** TraceTx implements the `debug_traceTransaction` rpc api */ TraceTx(request: QueryTraceTxRequest): Promise; /** * TraceBlock implements the `debug_traceBlockByNumber` and * `debug_traceBlockByHash` rpc api */ TraceBlock(request: QueryTraceBlockRequest): Promise; /** TraceCall implements the `debug_traceCall` rpc api */ TraceCall(request: QueryTraceTxRequest): Promise; /** * BaseFee queries the base fee of the parent block of the current block, * Similar to feemarket module's method */ BaseFee(request: QueryBaseFeeRequest): Promise; FunTokenMapping(request: QueryFunTokenMappingRequest): Promise; } export declare const QueryServiceName = "eth.evm.v1.Query"; export declare class QueryClientImpl implements Query { private readonly rpc; private readonly service; constructor(rpc: Rpc, opts?: { service?: string; }); EthAccount(request: QueryEthAccountRequest): Promise; ValidatorAccount(request: QueryValidatorAccountRequest): Promise; Balance(request: QueryBalanceRequest): Promise; Storage(request: QueryStorageRequest): Promise; Code(request: QueryCodeRequest): Promise; Params(request: QueryParamsRequest): Promise; EthCall(request: EthCallRequest): Promise; EstimateGas(request: EthCallRequest): Promise; TraceTx(request: QueryTraceTxRequest): Promise; TraceBlock(request: QueryTraceBlockRequest): Promise; TraceCall(request: QueryTraceTxRequest): Promise; BaseFee(request: QueryBaseFeeRequest): Promise; FunTokenMapping(request: QueryFunTokenMappingRequest): Promise; } interface Rpc { request(service: string, method: string, data: Uint8Array): Promise; } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; type DeepPartial = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial; } : Partial; type KeysOfUnion = T extends T ? keyof T : never; type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact; } & { [K in Exclude>]: never; }; export {}; //# sourceMappingURL=query.d.ts.map