diff --git a/proto/cosmos_proto/cosmos.proto b/proto/cosmos_proto/cosmos.proto new file mode 100644 index 0000000..5c63b86 --- /dev/null +++ b/proto/cosmos_proto/cosmos.proto @@ -0,0 +1,97 @@ +syntax = "proto3"; +package cosmos_proto; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto"; + +extend google.protobuf.MessageOptions { + + // implements_interface is used to indicate the type name of the interface + // that a message implements so that it can be used in google.protobuf.Any + // fields that accept that interface. A message can implement multiple + // interfaces. Interfaces should be declared using a declare_interface + // file option. + repeated string implements_interface = 93001; +} + +extend google.protobuf.FieldOptions { + + // accepts_interface is used to annotate that a google.protobuf.Any + // field accepts messages that implement the specified interface. + // Interfaces should be declared using a declare_interface file option. + string accepts_interface = 93001; + + // scalar is used to indicate that this field follows the formatting defined + // by the named scalar which should be declared with declare_scalar. Code + // generators may choose to use this information to map this field to a + // language-specific type representing the scalar. + string scalar = 93002; +} + +extend google.protobuf.FileOptions { + + // declare_interface declares an interface type to be used with + // accepts_interface and implements_interface. Interface names are + // expected to follow the following convention such that their declaration + // can be discovered by tools: for a given interface type a.b.C, it is + // expected that the declaration will be found in a protobuf file named + // a/b/interfaces.proto in the file descriptor set. + repeated InterfaceDescriptor declare_interface = 793021; + + // declare_scalar declares a scalar type to be used with + // the scalar field option. Scalar names are + // expected to follow the following convention such that their declaration + // can be discovered by tools: for a given scalar type a.b.C, it is + // expected that the declaration will be found in a protobuf file named + // a/b/scalars.proto in the file descriptor set. + repeated ScalarDescriptor declare_scalar = 793022; +} + +// InterfaceDescriptor describes an interface type to be used with +// accepts_interface and implements_interface and declared by declare_interface. +message InterfaceDescriptor { + + // name is the name of the interface. It should be a short-name (without + // a period) such that the fully qualified name of the interface will be + // package.name, ex. for the package a.b and interface named C, the + // fully-qualified name will be a.b.C. + string name = 1; + + // description is a human-readable description of the interface and its + // purpose. + string description = 2; +} + +// ScalarDescriptor describes an scalar type to be used with +// the scalar field option and declared by declare_scalar. +// Scalars extend simple protobuf built-in types with additional +// syntax and semantics, for instance to represent big integers. +// Scalars should ideally define an encoding such that there is only one +// valid syntactical representation for a given semantic meaning, +// i.e. the encoding should be deterministic. +message ScalarDescriptor { + + // name is the name of the scalar. It should be a short-name (without + // a period) such that the fully qualified name of the scalar will be + // package.name, ex. for the package a.b and scalar named C, the + // fully-qualified name will be a.b.C. + string name = 1; + + // description is a human-readable description of the scalar and its + // encoding format. For instance a big integer or decimal scalar should + // specify precisely the expected encoding format. + string description = 2; + + // field_type is the type of field with which this scalar can be used. + // Scalars can be used with one and only one type of field so that + // encoding standards and simple and clear. Currently only string and + // bytes fields are supported for scalars. + repeated ScalarType field_type = 3; +} + +enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0; + SCALAR_TYPE_STRING = 1; + SCALAR_TYPE_BYTES = 2; +} diff --git a/proto/ethermint/evm/v1/evm.proto b/proto/ethermint/evm/v1/evm.proto new file mode 100644 index 0000000..ff1bcac --- /dev/null +++ b/proto/ethermint/evm/v1/evm.proto @@ -0,0 +1,243 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cerc-io/laconicd/x/evm/types"; + +// Params defines the EVM module parameters +message Params { + // evm_denom represents the token denomination used to run the EVM state + // transitions. + string evm_denom = 1 [(gogoproto.moretags) = "yaml:\"evm_denom\""]; + // enable_create toggles state transitions that use the vm.Create function + bool enable_create = 2 [(gogoproto.moretags) = "yaml:\"enable_create\""]; + // enable_call toggles state transitions that use the vm.Call function + bool enable_call = 3 [(gogoproto.moretags) = "yaml:\"enable_call\""]; + // extra_eips defines the additional EIPs for the vm.Config + repeated int64 extra_eips = 4 [(gogoproto.customname) = "ExtraEIPs", (gogoproto.moretags) = "yaml:\"extra_eips\""]; + // chain_config defines the EVM chain configuration parameters + ChainConfig chain_config = 5 [(gogoproto.moretags) = "yaml:\"chain_config\"", (gogoproto.nullable) = false]; + // allow_unprotected_txs defines if replay-protected (i.e non EIP155 + // signed) transactions can be executed on the state machine. + bool allow_unprotected_txs = 6; +} + +// ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values +// instead of *big.Int. +message ChainConfig { + // homestead_block switch (nil no fork, 0 = already homestead) + string homestead_block = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"homestead_block\"" + ]; + // dao_fork_block corresponds to TheDAO hard-fork switch block (nil no fork) + string dao_fork_block = 2 [ + (gogoproto.customname) = "DAOForkBlock", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"dao_fork_block\"" + ]; + // dao_fork_support defines whether the nodes supports or opposes the DAO hard-fork + bool dao_fork_support = 3 + [(gogoproto.customname) = "DAOForkSupport", (gogoproto.moretags) = "yaml:\"dao_fork_support\""]; + // eip150_block: EIP150 implements the Gas price changes + // (https://github.com/ethereum/EIPs/issues/150) EIP150 HF block (nil no fork) + string eip150_block = 4 [ + (gogoproto.customname) = "EIP150Block", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"eip150_block\"" + ]; + // eip150_hash: EIP150 HF hash (needed for header only clients as only gas pricing changed) + string eip150_hash = 5 [(gogoproto.customname) = "EIP150Hash", (gogoproto.moretags) = "yaml:\"byzantium_block\""]; + // eip155_block: EIP155Block HF block + string eip155_block = 6 [ + (gogoproto.customname) = "EIP155Block", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"eip155_block\"" + ]; + // eip158_block: EIP158 HF block + string eip158_block = 7 [ + (gogoproto.customname) = "EIP158Block", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"eip158_block\"" + ]; + // byzantium_block: Byzantium switch block (nil no fork, 0 = already on byzantium) + string byzantium_block = 8 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"byzantium_block\"" + ]; + // constantinople_block: Constantinople switch block (nil no fork, 0 = already activated) + string constantinople_block = 9 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"constantinople_block\"" + ]; + // petersburg_block: Petersburg switch block (nil same as Constantinople) + string petersburg_block = 10 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"petersburg_block\"" + ]; + // istanbul_block: Istanbul switch block (nil no fork, 0 = already on istanbul) + string istanbul_block = 11 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"istanbul_block\"" + ]; + // muir_glacier_block: Eip-2384 (bomb delay) switch block (nil no fork, 0 = already activated) + string muir_glacier_block = 12 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"muir_glacier_block\"" + ]; + // berlin_block: Berlin switch block (nil = no fork, 0 = already on berlin) + string berlin_block = 13 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"berlin_block\"" + ]; + // DEPRECATED: EWASM, YOLOV3 and Catalyst block have been deprecated + reserved 14, 15, 16; + reserved "yolo_v3_block", "ewasm_block", "catalyst_block"; + // london_block: London switch block (nil = no fork, 0 = already on london) + string london_block = 17 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"london_block\"" + ]; + // arrow_glacier_block: Eip-4345 (bomb delay) switch block (nil = no fork, 0 = already activated) + string arrow_glacier_block = 18 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"arrow_glacier_block\"" + ]; + // DEPRECATED: merge fork block was deprecated: https://github.com/ethereum/go-ethereum/pull/24904 + reserved 19; + reserved "merge_fork_block"; + // gray_glacier_block: EIP-5133 (bomb delay) switch block (nil = no fork, 0 = already activated) + string gray_glacier_block = 20 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"gray_glacier_block\"" + ]; + // merge_netsplit_block: Virtual fork after The Merge to use as a network splitter + string merge_netsplit_block = 21 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"merge_netsplit_block\"" + ]; + // shanghai_block switch block (nil = no fork, 0 = already on shanghai) + string shanghai_block = 22 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"shanghai_block\"" + ]; + // cancun_block switch block (nil = no fork, 0 = already on cancun) + string cancun_block = 23 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"cancun_block\"" + ]; + +} + +// State represents a single Storage key value pair item. +message State { + // key is the stored key + string key = 1; + // value is the stored value for the given key + string value = 2; +} + +// TransactionLogs define the logs generated from a transaction execution +// with a given hash. It it used for import/export data as transactions are not +// persisted on blockchain state after an upgrade. +message TransactionLogs { + // hash of the transaction + string hash = 1; + // logs is an array of Logs for the given transaction hash + repeated Log logs = 2; +} + +// Log represents an protobuf compatible Ethereum Log that defines a contract +// log event. These events are generated by the LOG opcode and stored/indexed by +// the node. +// +// NOTE: address, topics and data are consensus fields. The rest of the fields +// are derived, i.e. filled in by the nodes, but not secured by consensus. +message Log { + // address of the contract that generated the event + string address = 1; + // topics is a list of topics provided by the contract. + repeated string topics = 2; + // data which is supplied by the contract, usually ABI-encoded + bytes data = 3; + + // block_number of the block in which the transaction was included + uint64 block_number = 4 [(gogoproto.jsontag) = "blockNumber"]; + // tx_hash is the transaction hash + string tx_hash = 5 [(gogoproto.jsontag) = "transactionHash"]; + // tx_index of the transaction in the block + uint64 tx_index = 6 [(gogoproto.jsontag) = "transactionIndex"]; + // block_hash of the block in which the transaction was included + string block_hash = 7 [(gogoproto.jsontag) = "blockHash"]; + // index of the log in the block + uint64 index = 8 [(gogoproto.jsontag) = "logIndex"]; + + // removed is true if this log was reverted due to a chain + // reorganisation. You must pay attention to this field if you receive logs + // through a filter query. + bool removed = 9; +} + +// TxResult stores results of Tx execution. +message TxResult { + option (gogoproto.goproto_getters) = false; + + // contract_address contains the ethereum address of the created contract (if + // any). If the state transition is an evm.Call, the contract address will be + // empty. + string contract_address = 1 [(gogoproto.moretags) = "yaml:\"contract_address\""]; + // bloom represents the bloom filter bytes + bytes bloom = 2; + // tx_logs contains the transaction hash and the proto-compatible ethereum + // logs. + TransactionLogs tx_logs = 3 [(gogoproto.moretags) = "yaml:\"tx_logs\"", (gogoproto.nullable) = false]; + // ret defines the bytes from the execution. + bytes ret = 4; + // reverted flag is set to true when the call has been reverted + bool reverted = 5; + // gas_used notes the amount of gas consumed while execution + uint64 gas_used = 6; +} + +// AccessTuple is the element type of an access list. +message AccessTuple { + option (gogoproto.goproto_getters) = false; + + // address is a hex formatted ethereum address + string address = 1; + // storage_keys are hex formatted hashes of the storage keys + repeated string storage_keys = 2 [(gogoproto.jsontag) = "storageKeys"]; +} + +// TraceConfig holds extra parameters to trace functions. +message TraceConfig { + // DEPRECATED: DisableMemory and DisableReturnData have been renamed to + // Enable*. + reserved 4, 7; + reserved "disable_memory", "disable_return_data"; + + // tracer is a custom javascript tracer + string tracer = 1; + // timeout overrides the default timeout of 5 seconds for JavaScript-based tracing + // calls + string timeout = 2; + // reexec defines the number of blocks the tracer is willing to go back + uint64 reexec = 3; + // disable_stack switches stack capture + bool disable_stack = 5 [(gogoproto.jsontag) = "disableStack"]; + // disable_storage switches storage capture + bool disable_storage = 6 [(gogoproto.jsontag) = "disableStorage"]; + // debug can be used to print output during capture end + bool debug = 8; + // limit defines the maximum length of output, but zero means unlimited + int32 limit = 9; + // overrides can be used to execute a trace using future fork rules + ChainConfig overrides = 10; + // enable_memory switches memory capture + bool enable_memory = 11 [(gogoproto.jsontag) = "enableMemory"]; + // enable_return_data switches the capture of return data + bool enable_return_data = 12 [(gogoproto.jsontag) = "enableReturnData"]; + // tracer_json_config configures the tracer using a JSON string + string tracer_json_config = 13 [(gogoproto.jsontag) = "tracerConfig"]; +} diff --git a/proto/ethermint/evm/v1/genesis.proto b/proto/ethermint/evm/v1/genesis.proto new file mode 100644 index 0000000..a0c0511 --- /dev/null +++ b/proto/ethermint/evm/v1/genesis.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "ethermint/evm/v1/evm.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cerc-io/laconicd/x/evm/types"; + +// GenesisState defines the evm module's genesis state. +message GenesisState { + // accounts is an array containing the ethereum genesis accounts. + repeated GenesisAccount accounts = 1 [(gogoproto.nullable) = false]; + // params defines all the parameters of the module. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// GenesisAccount defines an account to be initialized in the genesis state. +// Its main difference between with Geth's GenesisAccount is that it uses a +// custom storage type and that it doesn't contain the private key field. +message GenesisAccount { + // address defines an ethereum hex formated address of an account + string address = 1; + // code defines the hex bytes of the account code. + string code = 2; + // storage defines the set of state key values for the account. + repeated State storage = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "Storage"]; +} diff --git a/proto/ethermint/evm/v1/query.proto b/proto/ethermint/evm/v1/query.proto new file mode 100644 index 0000000..d301ada --- /dev/null +++ b/proto/ethermint/evm/v1/query.proto @@ -0,0 +1,298 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "ethermint/evm/v1/evm.proto"; +import "ethermint/evm/v1/tx.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/cerc-io/laconicd/x/evm/types"; + +// Query defines the gRPC querier service. +service Query { + // Account queries an Ethereum account. + rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { + option (google.api.http).get = "/ethermint/evm/v1/account/{address}"; + } + + // CosmosAccount queries an Ethereum account's Cosmos Address. + rpc CosmosAccount(QueryCosmosAccountRequest) returns (QueryCosmosAccountResponse) { + option (google.api.http).get = "/ethermint/evm/v1/cosmos_account/{address}"; + } + + // ValidatorAccount queries an Ethereum account's from a validator consensus + // Address. + rpc ValidatorAccount(QueryValidatorAccountRequest) returns (QueryValidatorAccountResponse) { + option (google.api.http).get = "/ethermint/evm/v1/validator_account/{cons_address}"; + } + + // Balance queries the balance of a the EVM denomination for a single + // EthAccount. + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { + option (google.api.http).get = "/ethermint/evm/v1/balances/{address}"; + } + + // Storage queries the balance of all coins for a single account. + rpc Storage(QueryStorageRequest) returns (QueryStorageResponse) { + option (google.api.http).get = "/ethermint/evm/v1/storage/{address}/{key}"; + } + + // Code queries the balance of all coins for a single account. + rpc Code(QueryCodeRequest) returns (QueryCodeResponse) { + option (google.api.http).get = "/ethermint/evm/v1/codes/{address}"; + } + + // Params queries the parameters of x/evm module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/ethermint/evm/v1/params"; + } + + // EthCall implements the `eth_call` rpc api + rpc EthCall(EthCallRequest) returns (MsgEthereumTxResponse) { + option (google.api.http).get = "/ethermint/evm/v1/eth_call"; + } + + // EstimateGas implements the `eth_estimateGas` rpc api + rpc EstimateGas(EthCallRequest) returns (EstimateGasResponse) { + option (google.api.http).get = "/ethermint/evm/v1/estimate_gas"; + } + + // TraceTx implements the `debug_traceTransaction` rpc api + rpc TraceTx(QueryTraceTxRequest) returns (QueryTraceTxResponse) { + option (google.api.http).get = "/ethermint/evm/v1/trace_tx"; + } + + // TraceBlock implements the `debug_traceBlockByNumber` and `debug_traceBlockByHash` rpc api + rpc TraceBlock(QueryTraceBlockRequest) returns (QueryTraceBlockResponse) { + option (google.api.http).get = "/ethermint/evm/v1/trace_block"; + } + + // BaseFee queries the base fee of the parent block of the current block, + // it's similar to feemarket module's method, but also checks london hardfork status. + rpc BaseFee(QueryBaseFeeRequest) returns (QueryBaseFeeResponse) { + option (google.api.http).get = "/ethermint/evm/v1/base_fee"; + } +} + +// QueryAccountRequest is the request type for the Query/Account RPC method. +message QueryAccountRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the ethereum hex address to query the account for. + string address = 1; +} + +// QueryAccountResponse is the response type for the Query/Account RPC method. +message QueryAccountResponse { + // balance is the balance of the EVM denomination. + string balance = 1; + // code_hash is the hex-formatted code bytes from the EOA. + string code_hash = 2; + // nonce is the account's sequence number. + uint64 nonce = 3; +} + +// QueryCosmosAccountRequest is the request type for the Query/CosmosAccount RPC +// method. +message QueryCosmosAccountRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the ethereum hex address to query the account for. + string address = 1; +} + +// QueryCosmosAccountResponse is the response type for the Query/CosmosAccount +// RPC method. +message QueryCosmosAccountResponse { + // cosmos_address is the cosmos address of the account. + string cosmos_address = 1; + // sequence is the account's sequence number. + uint64 sequence = 2; + // account_number is the account number + uint64 account_number = 3; +} + +// QueryValidatorAccountRequest is the request type for the +// Query/ValidatorAccount RPC method. +message QueryValidatorAccountRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // cons_address is the validator cons address to query the account for. + string cons_address = 1; +} + +// QueryValidatorAccountResponse is the response type for the +// Query/ValidatorAccount RPC method. +message QueryValidatorAccountResponse { + // account_address is the cosmos address of the account in bech32 format. + string account_address = 1; + // sequence is the account's sequence number. + uint64 sequence = 2; + // account_number is the account number + uint64 account_number = 3; +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method. +message QueryBalanceRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the ethereum hex address to query the balance for. + string address = 1; +} + +// QueryBalanceResponse is the response type for the Query/Balance RPC method. +message QueryBalanceResponse { + // balance is the balance of the EVM denomination. + string balance = 1; +} + +// QueryStorageRequest is the request type for the Query/Storage RPC method. +message QueryStorageRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the ethereum hex address to query the storage state for. + string address = 1; + + // key defines the key of the storage state + string key = 2; +} + +// QueryStorageResponse is the response type for the Query/Storage RPC +// method. +message QueryStorageResponse { + // value defines the storage state value hash associated with the given key. + string value = 1; +} + +// QueryCodeRequest is the request type for the Query/Code RPC method. +message QueryCodeRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the ethereum hex address to query the code for. + string address = 1; +} + +// QueryCodeResponse is the response type for the Query/Code RPC +// method. +message QueryCodeResponse { + // code represents the code bytes from an ethereum address. + bytes code = 1; +} + +// QueryTxLogsRequest is the request type for the Query/TxLogs RPC method. +message QueryTxLogsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // hash is the ethereum transaction hex hash to query the logs for. + string hash = 1; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryTxLogsResponse is the response type for the Query/TxLogs RPC method. +message QueryTxLogsResponse { + // logs represents the ethereum logs generated from the given transaction. + repeated Log logs = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest defines the request type for querying x/evm parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/evm parameters. +message QueryParamsResponse { + // params define the evm module parameters. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// EthCallRequest defines EthCall request +message EthCallRequest { + // args uses the same json format as the json rpc api. + bytes args = 1; + // gas_cap defines the default gas cap to be used + uint64 gas_cap = 2; + // proposer_address of the requested block in hex format + bytes proposer_address = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"]; + // chain_id is the eip155 chain id parsed from the requested block header + int64 chain_id = 4; +} + +// EstimateGasResponse defines EstimateGas response +message EstimateGasResponse { + // gas returns the estimated gas + uint64 gas = 1; +} + +// QueryTraceTxRequest defines TraceTx request +message QueryTraceTxRequest { + // msg is the MsgEthereumTx for the requested transaction + MsgEthereumTx msg = 1; + // tx_index is not necessary anymore + reserved 2; + reserved "tx_index"; + // trace_config holds extra parameters to trace functions. + TraceConfig trace_config = 3; + // predecessors is an array of transactions included in the same block + // need to be replayed first to get correct context for tracing. + repeated MsgEthereumTx predecessors = 4; + // block_number of requested transaction + int64 block_number = 5; + // block_hash of requested transaction + string block_hash = 6; + // block_time of requested transaction + google.protobuf.Timestamp block_time = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // proposer_address is the proposer of the requested block + bytes proposer_address = 8 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"]; + // chain_id is the the eip155 chain id parsed from the requested block header + int64 chain_id = 9; +} + +// QueryTraceTxResponse defines TraceTx response +message QueryTraceTxResponse { + // data is the response serialized in bytes + bytes data = 1; +} + +// QueryTraceBlockRequest defines TraceTx request +message QueryTraceBlockRequest { + // txs is an array of messages in the block + repeated MsgEthereumTx txs = 1; + // trace_config holds extra parameters to trace functions. + TraceConfig trace_config = 3; + // block_number of the traced block + int64 block_number = 5; + // block_hash (hex) of the traced block + string block_hash = 6; + // block_time of the traced block + google.protobuf.Timestamp block_time = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // proposer_address is the address of the requested block + bytes proposer_address = 8 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"]; + // chain_id is the eip155 chain id parsed from the requested block header + int64 chain_id = 9; +} + +// QueryTraceBlockResponse defines TraceBlock response +message QueryTraceBlockResponse { + // data is the response serialized in bytes + bytes data = 1; +} + +// QueryBaseFeeRequest defines the request type for querying the EIP1559 base +// fee. +message QueryBaseFeeRequest {} + +// QueryBaseFeeResponse returns the EIP1559 base fee. +message QueryBaseFeeResponse { + // base_fee is the EIP1559 base fee + string base_fee = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; +} diff --git a/proto/ethermint/evm/v1/tx.proto b/proto/ethermint/evm/v1/tx.proto new file mode 100644 index 0000000..60a9619 --- /dev/null +++ b/proto/ethermint/evm/v1/tx.proto @@ -0,0 +1,160 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "cosmos_proto/cosmos.proto"; +import "ethermint/evm/v1/evm.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cerc-io/laconicd/x/evm/types"; + +// Msg defines the evm Msg service. +service Msg { + // EthereumTx defines a method submitting Ethereum transactions. + rpc EthereumTx(MsgEthereumTx) returns (MsgEthereumTxResponse) { + option (google.api.http).post = "/ethermint/evm/v1/ethereum_tx"; + }; +} + +// MsgEthereumTx encapsulates an Ethereum transaction as an SDK message. +message MsgEthereumTx { + option (gogoproto.goproto_getters) = false; + + // data is inner transaction data of the Ethereum transaction + google.protobuf.Any data = 1; + + // size is the encoded storage size of the transaction (DEPRECATED) + double size = 2 [(gogoproto.jsontag) = "-"]; + // hash of the transaction in hex format + string hash = 3 [(gogoproto.moretags) = "rlp:\"-\""]; + // from is the ethereum signer address in hex format. This address value is checked + // against the address derived from the signature (V, R, S) using the + // secp256k1 elliptic curve + string from = 4; +} + +// LegacyTx is the transaction data of regular Ethereum transactions. +// NOTE: All non-protected transactions (i.e non EIP155 signed) will fail if the +// AllowUnprotectedTxs parameter is disabled. +message LegacyTx { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "TxData"; + + // nonce corresponds to the account nonce (transaction sequence). + uint64 nonce = 1; + // gas_price defines the value for each gas unit + string gas_price = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; + // gas defines the gas limit defined for the transaction. + uint64 gas = 3 [(gogoproto.customname) = "GasLimit"]; + // to is the hex formatted address of the recipient + string to = 4; + // value defines the unsigned integer value of the transaction amount. + string value = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.customname) = "Amount"]; + // data is the data payload bytes of the transaction. + bytes data = 6; + // v defines the signature value + bytes v = 7; + // r defines the signature value + bytes r = 8; + // s define the signature value + bytes s = 9; +} + +// AccessListTx is the data of EIP-2930 access list transactions. +message AccessListTx { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "TxData"; + + // chain_id of the destination EVM chain + string chain_id = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customname) = "ChainID", + (gogoproto.jsontag) = "chainID" + ]; + // nonce corresponds to the account nonce (transaction sequence). + uint64 nonce = 2; + // gas_price defines the value for each gas unit + string gas_price = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; + // gas defines the gas limit defined for the transaction. + uint64 gas = 4 [(gogoproto.customname) = "GasLimit"]; + // to is the recipient address in hex format + string to = 5; + // value defines the unsigned integer value of the transaction amount. + string value = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.customname) = "Amount"]; + // data is the data payload bytes of the transaction. + bytes data = 7; + // accesses is an array of access tuples + repeated AccessTuple accesses = 8 + [(gogoproto.castrepeated) = "AccessList", (gogoproto.jsontag) = "accessList", (gogoproto.nullable) = false]; + // v defines the signature value + bytes v = 9; + // r defines the signature value + bytes r = 10; + // s define the signature value + bytes s = 11; +} + +// DynamicFeeTx is the data of EIP-1559 dinamic fee transactions. +message DynamicFeeTx { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "TxData"; + + // chain_id of the destination EVM chain + string chain_id = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customname) = "ChainID", + (gogoproto.jsontag) = "chainID" + ]; + // nonce corresponds to the account nonce (transaction sequence). + uint64 nonce = 2; + // gas_tip_cap defines the max value for the gas tip + string gas_tip_cap = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; + // gas_fee_cap defines the max value for the gas fee + string gas_fee_cap = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; + // gas defines the gas limit defined for the transaction. + uint64 gas = 5 [(gogoproto.customname) = "GasLimit"]; + // to is the hex formatted address of the recipient + string to = 6; + // value defines the the transaction amount. + string value = 7 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.customname) = "Amount"]; + // data is the data payload bytes of the transaction. + bytes data = 8; + // accesses is an array of access tuples + repeated AccessTuple accesses = 9 + [(gogoproto.castrepeated) = "AccessList", (gogoproto.jsontag) = "accessList", (gogoproto.nullable) = false]; + // v defines the signature value + bytes v = 10; + // r defines the signature value + bytes r = 11; + // s define the signature value + bytes s = 12; +} + +// ExtensionOptionsEthereumTx is an extension option for ethereum transactions +message ExtensionOptionsEthereumTx { + option (gogoproto.goproto_getters) = false; +} + +// MsgEthereumTxResponse defines the Msg/EthereumTx response type. +message MsgEthereumTxResponse { + option (gogoproto.goproto_getters) = false; + + // hash of the ethereum transaction in hex format. This hash differs from the + // Tendermint sha256 hash of the transaction bytes. See + // https://github.com/tendermint/tendermint/issues/6539 for reference + string hash = 1; + // logs contains the transaction hash and the proto-compatible ethereum + // logs. + repeated Log logs = 2; + // ret is the returned data from evm function (result or data supplied with revert + // opcode) + bytes ret = 3; + // vm_error is the error returned by vm execution + string vm_error = 4; + // gas_used specifies how much gas was consumed by the transaction + uint64 gas_used = 5; +} diff --git a/scripts/create-proto-files.sh b/scripts/create-proto-files.sh index 962a851..0c54aa5 100755 --- a/scripts/create-proto-files.sh +++ b/scripts/create-proto-files.sh @@ -9,4 +9,4 @@ protoc \ --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \ --ts_out=$DEST_TS \ --proto_path=$I \ -$(find $(pwd)/proto/vulcanize -iname "*.proto") +$(find $(pwd)/proto/vulcanize $(pwd)/proto/ethermint -iname "*.proto") diff --git a/src/artifacts/PhisherRegistry.json b/src/artifacts/PhisherRegistry.json new file mode 100644 index 0000000..0af99e2 --- /dev/null +++ b/src/artifacts/PhisherRegistry.json @@ -0,0 +1,1842 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "PhisherRegistry", + "sourceName": "contracts/PhisherRegistry.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "principal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "agent", + "type": "address" + } + ], + "name": "DelegationTriggered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "string", + "name": "entity", + "type": "string" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isMember", + "type": "bool" + } + ], + "name": "MemberStatusUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "string", + "name": "entity", + "type": "string" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isPhisher", + "type": "bool" + } + ], + "name": "PhisherStatusUpdated", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "_input", + "type": "tuple[]" + } + ], + "name": "GET_CAVEAT_ARRAY_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat", + "name": "_input", + "type": "tuple" + } + ], + "name": "GET_CAVEAT_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "_input", + "type": "tuple" + } + ], + "name": "GET_DELEGATION_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + } + ], + "internalType": "struct EIP712Domain", + "name": "_input", + "type": "tuple" + } + ], + "name": "GET_EIP712DOMAIN_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "delegationHash", + "type": "bytes32" + } + ], + "internalType": "struct IntentionToRevoke", + "name": "_input", + "type": "tuple" + } + ], + "name": "GET_INTENTIONTOREVOKE_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedDelegation[]", + "name": "authority", + "type": "tuple[]" + } + ], + "internalType": "struct Invocation[]", + "name": "batch", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "queue", + "type": "uint256" + } + ], + "internalType": "struct ReplayProtection", + "name": "replayProtection", + "type": "tuple" + } + ], + "internalType": "struct Invocations", + "name": "_input", + "type": "tuple" + } + ], + "name": "GET_INVOCATIONS_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedDelegation[]", + "name": "authority", + "type": "tuple[]" + } + ], + "internalType": "struct Invocation[]", + "name": "_input", + "type": "tuple[]" + } + ], + "name": "GET_INVOCATION_ARRAY_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedDelegation[]", + "name": "authority", + "type": "tuple[]" + } + ], + "internalType": "struct Invocation", + "name": "_input", + "type": "tuple" + } + ], + "name": "GET_INVOCATION_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "queue", + "type": "uint256" + } + ], + "internalType": "struct ReplayProtection", + "name": "_input", + "type": "tuple" + } + ], + "name": "GET_REPLAYPROTECTION_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedDelegation[]", + "name": "_input", + "type": "tuple[]" + } + ], + "name": "GET_SIGNEDDELEGATION_ARRAY_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedDelegation", + "name": "_input", + "type": "tuple" + } + ], + "name": "GET_SIGNEDDELEGATION_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "delegationHash", + "type": "bytes32" + } + ], + "internalType": "struct IntentionToRevoke", + "name": "intentionToRevoke", + "type": "tuple" + } + ], + "internalType": "struct SignedIntentionToRevoke", + "name": "_input", + "type": "tuple" + } + ], + "name": "GET_SIGNEDINTENTIONTOREVOKE_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedDelegation[]", + "name": "authority", + "type": "tuple[]" + } + ], + "internalType": "struct Invocation[]", + "name": "batch", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "queue", + "type": "uint256" + } + ], + "internalType": "struct ReplayProtection", + "name": "replayProtection", + "type": "tuple" + } + ], + "internalType": "struct Invocations", + "name": "invocations", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedInvocation", + "name": "_input", + "type": "tuple" + } + ], + "name": "GET_SIGNEDINVOCATION_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct Transaction", + "name": "_input", + "type": "tuple" + } + ], + "name": "GET_TRANSACTION_PACKETHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "internalType": "bool", + "name": "isNominated", + "type": "bool" + } + ], + "name": "claimIfMember", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "internalType": "bool", + "name": "isAccused", + "type": "bool" + } + ], + "name": "claimIfPhisher", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedDelegation[]", + "name": "authority", + "type": "tuple[]" + } + ], + "internalType": "struct Invocation[]", + "name": "batch", + "type": "tuple[]" + } + ], + "name": "contractInvoke", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "domainHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "delegationHash", + "type": "bytes32" + } + ], + "name": "enforceCaveat", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + } + ], + "name": "getDelegationTypedDataHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "contractName", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + } + ], + "name": "getEIP712DomainHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "delegationHash", + "type": "bytes32" + } + ], + "internalType": "struct IntentionToRevoke", + "name": "intentionToRevoke", + "type": "tuple" + } + ], + "name": "getIntentionToRevokeTypedDataHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedDelegation[]", + "name": "authority", + "type": "tuple[]" + } + ], + "internalType": "struct Invocation[]", + "name": "batch", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "queue", + "type": "uint256" + } + ], + "internalType": "struct ReplayProtection", + "name": "replayProtection", + "type": "tuple" + } + ], + "internalType": "struct Invocations", + "name": "invocations", + "type": "tuple" + } + ], + "name": "getInvocationsTypedDataHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedDelegation[]", + "name": "authority", + "type": "tuple[]" + } + ], + "internalType": "struct Invocation[]", + "name": "batch", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "queue", + "type": "uint256" + } + ], + "internalType": "struct ReplayProtection", + "name": "replayProtection", + "type": "tuple" + } + ], + "internalType": "struct Invocations", + "name": "invocations", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedInvocation[]", + "name": "signedInvocations", + "type": "tuple[]" + } + ], + "name": "invoke", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "isMember", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "isPhisher", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "multiNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedDelegation", + "name": "signedDelegation", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "delegationHash", + "type": "bytes32" + } + ], + "internalType": "struct IntentionToRevoke", + "name": "intentionToRevoke", + "type": "tuple" + } + ], + "internalType": "struct SignedIntentionToRevoke", + "name": "signedIntentionToRevoke", + "type": "tuple" + } + ], + "name": "revokeDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedDelegation", + "name": "signedDelegation", + "type": "tuple" + } + ], + "name": "verifyDelegationSignature", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "delegationHash", + "type": "bytes32" + } + ], + "internalType": "struct IntentionToRevoke", + "name": "intentionToRevoke", + "type": "tuple" + } + ], + "internalType": "struct SignedIntentionToRevoke", + "name": "signedIntentionToRevoke", + "type": "tuple" + } + ], + "name": "verifyIntentionToRevokeSignature", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "authority", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address", + "name": "enforcer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "terms", + "type": "bytes" + } + ], + "internalType": "struct Caveat[]", + "name": "caveats", + "type": "tuple[]" + } + ], + "internalType": "struct Delegation", + "name": "delegation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedDelegation[]", + "name": "authority", + "type": "tuple[]" + } + ], + "internalType": "struct Invocation[]", + "name": "batch", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "queue", + "type": "uint256" + } + ], + "internalType": "struct ReplayProtection", + "name": "replayProtection", + "type": "tuple" + } + ], + "internalType": "struct Invocations", + "name": "invocations", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SignedInvocation", + "name": "signedInvocation", + "type": "tuple" + } + ], + "name": "verifyInvocationSignature", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x60a06040523480156200001157600080fd5b5060405162002e4b38038062002e4b833981016040819052620000349162000335565b8080604051806040016040528060018152602001603160f81b8152506200006a62000064620000e760201b60201c565b620001dc565b8151602080840191909120825182840120604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818601528082019390935260608301919091524660808301523060a0808401919091528151808403909101815260c090920190528051910120608052506200046392505050565b60003033036200013f57600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506200018d9050565b6200018a6040518060400160405280601d81526020017f5573696e67206e6f726d616c206d73672e73656e646572206c6f6769630000008152506200022c60201b6200114d1760201c565b50335b620001d96040518060400160405280601381526020017f52657475726e696e672073656e64657220257300000000000000000000000000815250826200027a60201b620011901760201c565b90565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b62000277816040516024016200024391906200041b565b60408051601f198184030181529190526020810180516001600160e01b0390811663104c13eb60e21b17909152620002cb16565b50565b620002c782826040516024016200029392919062000437565b60408051601f198184030181529190526020810180516001600160e01b0390811663319af33360e01b17909152620002cb16565b5050565b80516a636f6e736f6c652e6c6f67602083016000808483855afa5050505050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200031f57818101518382015260200162000305565b838111156200032f576000848401525b50505050565b6000602082840312156200034857600080fd5b81516001600160401b03808211156200036057600080fd5b818401915084601f8301126200037557600080fd5b8151818111156200038a576200038a620002ec565b604051601f8201601f19908116603f01168101908382118183101715620003b557620003b5620002ec565b81604052828152876020848701011115620003cf57600080fd5b620003e283602083016020880162000302565b979650505050505050565b600081518084526200040781602086016020860162000302565b601f01601f19169290920160200192915050565b602081526000620004306020830184620003ed565b9392505050565b6040815260006200044c6040830185620003ed565b905060018060a01b03831660208301529392505050565b6080516129b7620004946000396000818161056501528181610a7c01528181610ddd0152610ef301526129b76000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c8063736f7ce71161011a57806398bc186a116100ad578063caced6c51161007c578063caced6c5146104b0578063d327c1eb146104c3578063d6d75cbf1461054d578063dfe86ac514610560578063f2fde38b1461058757600080fd5b806398bc186a14610464578063a2e01f7514610477578063a8444b3a1461048a578063bb5af5bd1461049d57600080fd5b80638a04499e116100e95780638a04499e146104025780638da5cb5b1461042d5780638dc34c4d1461043e57806397182ed61461045157600080fd5b8063736f7ce71461039b57806374e9d189146103ae5780637b577b58146103dc578063870eea55146103ef57600080fd5b80635cf1b24a1161019d5780636c2b12531161016c5780636c2b1253146103475780636f9658031461035a578063715018a61461036d5780637234eefe14610375578063732c36e81461038857600080fd5b80635cf1b24a146102e05780635d44b585146102f357806360b6d768146103215780636b6dc9de1461033457600080fd5b80633a481821116101d95780633a48182114610292578063463a3ce4146102a55780635068de4c146102ba5780635c6d9f0c146102cd57600080fd5b80630162f7221461020b57806308aaf6b0146102495780632f52a2fd1461025c5780632fad7efc1461026f575b600080fd5b610236610219366004611958565b600160209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b610236610257366004611afb565b61059a565b61023661026a366004611c43565b61061a565b61028261027d366004611cc2565b610685565b6040519015158152602001610240565b6102366102a0366004611f1b565b61074c565b6102b86102b3366004611f9e565b6107c3565b005b6102826102c8366004611ff4565b610898565b6102826102db366004611cc2565b610a04565b6102366102ee366004612069565b610a1a565b61028261030136600461209d565b805160208183018101805160038252928201919093012091525460ff1681565b61023661032f36600461215a565b610a77565b6102b8610342366004611f9e565b610ac7565b61023661035536600461218e565b610b8a565b6102366103683660046121c2565b610be7565b6102b8610c38565b61023661038336600461215a565b610c8d565b61023661039636600461226d565b610ccb565b6102366103a93660046122a1565b610d08565b6102826103bc36600461209d565b805160208183018101805160048252928201919093012091525460ff1681565b6102366103ea3660046122d5565b610d70565b6102366103fd366004612309565b610dd8565b61041561041036600461218e565b610e05565b6040516001600160a01b039091168152602001610240565b6000546001600160a01b0316610415565b6102b861044c36600461233d565b610e2f565b61023661045f366004611c43565b610eee565b6102366104723660046123a0565b610f1b565b61023661048536600461244b565b610f67565b61041561049836600461226d565b610fd3565b6102366104ab3660046124be565b610ff7565b6104156104be3660046124be565b611028565b6102366104d13660046124f2565b8351602094850120835193850193909320604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8188015280820195909552606085019190915260808401929092526001600160a01b031660a0808401919091528151808403909101815260c09092019052805191012090565b61023661055b366004612309565b611052565b6102367f000000000000000000000000000000000000000000000000000000000000000081565b6102b861059536600461256f565b611093565b6000807f80ad7e1b04ee6d994a125f4714ca0720908bd80ed16063ec8aee4b88e9253e2d83600001518460200151805190602001206040516020016105fb939291909283526001600160a01b03919091166020830152604082015260600190565b60408051601f1981840301815291905280516020909101209392505050565b6000807f409f5114779a253e700d775d7845e6efc1e83685ac59868d2df3d4de51c7d621836000015184602001516106558660400151610d70565b6040805160208101959095526001600160a01b03909316928401929092526060830152608082015260a0016105fb565b6000805b8281101561074557368484838181106106a4576106a461258a565b90506020028101906106b691906125a0565b905060006106c66104be836125c0565b9050610712818787868181106106de576106de61258a565b90506020028101906106f091906125a0565b6106fa90806125cc565b60200180360381019061070d91906121c2565b6111d9565b61072f61071f83806125cc565b61072990806125e2565b836112a3565b505050808061073d90612641565b915050610689565b5092915050565b6000606060005b83518110156107b4578161077f8583815181106107725761077261258a565b6020026020010151610a1a565b60405160200161079092919061268a565b604051602081830303815290604052915080806107ac90612641565b915050610753565b50805160209091012092915050565b6107cb6116e6565b6001600160a01b03166107e66000546001600160a01b031690565b6001600160a01b0316146108155760405162461bcd60e51b815260040161080c906126ac565b60405180910390fd5b80600484846040516108289291906126e1565b908152604051908190036020018120805492151560ff199093169290921790915561085690849084906126e1565b6040519081900381208215158252907f88e1b1a43f3edcb9afe941dfea296f5bc32fab715b5fc9aa101ec26d87d2e8a2906020015b60405180910390a2505050565b60008181526002602052604081205460ff16156108f75760405162461bcd60e51b815260206004820152601b60248201527f44656c65676174696f6e20686173206265656e207265766f6b65640000000000604482015260640161080c565b600061090660408501856126f1565b61091591600491600091612737565b61091e91612761565b90506001600160e01b0319811663f2fde38b60e01b0361098c5760405162461bcd60e51b8152602060048201526024808201527f7472616e736665724f776e657273686970206973206e6f742064656c6567617460448201526361626c6560e01b606482015260840161080c565b6001600160e01b03198116630f374f3b60e31b036109f85760405162461bcd60e51b8152602060048201526024808201527f72656e6f756e63654f776e657273686970206973206e6f742064656c6567617460448201526361626c6560e01b606482015260840161080c565b50600195945050505050565b6000610a118383336112a3565b90505b92915050565b6000807fd97dd99b404d177890f06a8f0fc8e5ed0333fb2ebb6684360709066e8984f594610a4b8460000151610f67565b610a588560200151610d08565b60408051602081019490945283019190915260608201526080016105fb565b6000807f0000000000000000000000000000000000000000000000000000000000000000610aa484610c8d565b60405161190160f01b6020820152602281019290925260428201526062016105fb565b610acf6116e6565b6001600160a01b0316610aea6000546001600160a01b031690565b6001600160a01b031614610b105760405162461bcd60e51b815260040161080c906126ac565b8060038484604051610b239291906126e1565b908152604051908190036020018120805492151560ff1990931692909217909155610b5190849084906126e1565b6040519081900381208215158252907f9d3712f4978fc20b17a1dfbcd563f9aded75d05b6019427a9eca23245220138b9060200161088b565b6000807f3c36a06e1d288b0f94f565588317a46ad11bc3c96992109f9a2365a2737259a7610bbb846000015161061a565b6020808601518051908201206040516105fb949392019283526020830191909152604082015260600190565b6000807fe8d3d963b33868fb116316bc3fd55e8f49123f30e4418f71e140d54b7cd3b2b9836000015184602001516040516020016105fb939291909283526020830191909152604082015260600190565b610c406116e6565b6001600160a01b0316610c5b6000546001600160a01b031690565b6001600160a01b031614610c815760405162461bcd60e51b815260040161080c906126ac565b610c8b60006117b5565b565b6000807f08c69a206c06f5334b35ceb1186181a713b21aff02cf66285f375084fbef2eb8610cbe846000015161074c565b610a588560200151610be7565b6000807f1b0091a1d050ac3fa97e15af326cf512d740529b43d5750169acacda23de2788836000015180519060200120610a588560200151611052565b6000606060005b83518110156107b45781610d3b858381518110610d2e57610d2e61258a565b6020026020010151610b8a565b604051602001610d4c92919061268a565b60405160208183030381529060405291508080610d6890612641565b915050610d0f565b6000606060005b83518110156107b45781610da3858381518110610d9657610d9661258a565b602002602001015161059a565b604051602001610db492919061268a565b60405160208183030381529060405291508080610dd090612641565b915050610d77565b6000807f0000000000000000000000000000000000000000000000000000000000000000610aa484611052565b805160009081610e1482610eee565b90506000610e26828660200151611805565b95945050505050565b6000610e3d61041084612791565b90506000610e4d6104988461279d565b9050806001600160a01b0316826001600160a01b031614610ec05760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920746865207369676e65722063616e207265766f6b6520612064656c60448201526632b3b0ba34b7b760c91b606482015260840161080c565b6000610ece61035586612791565b6000908152600260205260409020805460ff191660011790555050505050565b6000807f0000000000000000000000000000000000000000000000000000000000000000610aa48461061a565b6000807f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f83600001518460200151856040015186606001516040516020016105fb9594939291906127d5565b6000807fb16dfdb3b8fa033fe30ac976cd4a50ad256b6811c80d90fcd0b323eec190047d836000015184602001518560400151805190602001206040516020016105fb94939291909384526001600160a01b039290921660208401526040830152606082015260800190565b602081015160009081610fe582610dd8565b90506000610e26828660000151611805565b6000807fc32b6dfe0f988d1f2b13248cddd88e320ff0ae86e3ccfe38bab77a80f4477d44610bbb8460000151610c8d565b6000806110388360000151610a77565b9050600061104a828560200151611805565b949350505050565b805160405160009182916105fb917f7148a5140265154d6c5200f68c3b86caca80512f179c3903dffd45aeaefc8ea891602001918252602082015260400190565b61109b6116e6565b6001600160a01b03166110b66000546001600160a01b031690565b6001600160a01b0316146110dc5760405162461bcd60e51b815260040161080c906126ac565b6001600160a01b0381166111415760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161080c565b61114a816117b5565b50565b61114a816040516024016111619190612823565b60408051601f198184030181529190526020810180516001600160e01b031663104c13eb60e21b1790526118dc565b6111d582826040516024016111a6929190612836565b60408051601f198184030181529190526020810180516001600160e01b031663319af33360e01b1790526118dc565b5050565b60208082015182516001600160a01b038516600090815260018085526040808320858452909552939020549192909161121191612860565b81146112795760405162461bcd60e51b815260206004820152603160248201527f4f6e652d61742d612d74696d65206f7264657220656e666f726365642e204e6f6044820152701b98d94c881a5cc81d1bdbc81cdb585b1b607a1b606482015260840161080c565b6001600160a01b039093166000908152600160209081526040808320938352929052209190915550565b6000805b838110156116de5760008585838181106112c3576112c361258a565b90506020028101906112d591906125a0565b6112de90612878565b90506000808260200151516000036112f65750849050805b6000805b8460200151518110156115965760008560200151828151811061131f5761131f61258a565b60200260200101519050600061133482610e05565b905082600003611345578095508594505b846001600160a01b0316816001600160a01b0316146113bf5760405162461bcd60e51b815260206004820152603060248201527f44656c65676174696f6e207369676e657220646f6573206e6f74206d6174636860448201526f103932b8bab4b932b21039b4b3b732b960811b606482015260840161080c565b81516020810151851461143a5760405162461bcd60e51b815260206004820152603760248201527f44656c65676174696f6e20617574686f7269747920646f6573206e6f74206d6160448201527f7463682070726576696f75732064656c65676174696f6e000000000000000000606482015260840161080c565b600061144584610b8a565b905060005b8260400151518161ffff16101561157957600083604001518261ffff16815181106114775761147761258a565b60200260200101516000015190506000816001600160a01b0316635068de4c86604001518561ffff16815181106114b0576114b061258a565b6020026020010151602001518e60000151876040518463ffffffff1660e01b81526004016114e093929190612884565b6020604051808303816000875af11580156114ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152391906128e0565b9050806115645760405162461bcd60e51b815260206004820152600f60248201526e10d85d99585d081c995a9958dd1959608a1b604482015260640161080c565b5050808061157190612904565b91505061144a565b5090519550935082915061158e905081612641565b9150506112fa565b50835180516001600160a01b031630146115f25760405162461bcd60e51b815260206004820181905260248201527f496e766f636174696f6e2074617267657420646f6573206e6f74206d61746368604482015260640161080c565b6040516001600160a01b0385811682528916907f185d11175440fcb6458fbc1889b02953452539ed80ad1da781a5449500f6d9609060200160405180910390a261164a816000015182604001518360200151876118fd565b96506116796040518060400160405280600c81526020016b54657374696e67206c6f677360a01b81525061114d565b866116c65760405162461bcd60e51b815260206004820152601c60248201527f44656c656761746f7220657865637574696f6e206661696c6564212100000000604482015260640161080c565b505050505080806116d690612641565b9150506112a7565b509392505050565b600030330361173c57600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b0316915061177d9050565b61177a6040518060400160405280601d81526020017f5573696e67206e6f726d616c206d73672e73656e646572206c6f67696300000081525061114d565b50335b6117b26040518060400160405280601381526020017252657475726e696e672073656e64657220257360681b81525082611190565b90565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060008084516041146118205760009350505050610a14565b50505060208201516040830151606084015160001a601b81101561184c57611849601b82612925565b90505b8060ff16601b1415801561186457508060ff16601c14155b156118755760009350505050610a14565b60408051600081526020810180835288905260ff831691810191909152606081018490526080810183905260019060a0016020604051602081039080840390855afa1580156118c8573d6000803e3d6000fd5b505050602060405103519350505050610a14565b80516a636f6e736f6c652e6c6f67602083016000808483855afa5050505050565b600080848360405160200161191392919061294a565b604051602081830303815290604052905060008082516020840160008a89f19695505050505050565b80356001600160a01b038116811461195357600080fd5b919050565b6000806040838503121561196b57600080fd5b6119748361193c565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156119ba576119ba611982565b60405290565b604051606081016001600160401b03811182821017156119ba576119ba611982565b604051608081016001600160401b03811182821017156119ba576119ba611982565b604051601f8201601f191681016001600160401b0381118282101715611a2c57611a2c611982565b604052919050565b600082601f830112611a4557600080fd5b81356001600160401b03811115611a5e57611a5e611982565b611a71601f8201601f1916602001611a04565b818152846020838601011115611a8657600080fd5b816020850160208301376000918101602001919091529392505050565b600060408284031215611ab557600080fd5b611abd611998565b9050611ac88261193c565b815260208201356001600160401b03811115611ae357600080fd5b611aef84828501611a34565b60208301525092915050565b600060208284031215611b0d57600080fd5b81356001600160401b03811115611b2357600080fd5b61104a84828501611aa3565b60006001600160401b03821115611b4857611b48611982565b5060051b60200190565b600082601f830112611b6357600080fd5b81356020611b78611b7383611b2f565b611a04565b82815260059290921b84018101918181019086841115611b9757600080fd5b8286015b84811015611bd65780356001600160401b03811115611bba5760008081fd5b611bc88986838b0101611aa3565b845250918301918301611b9b565b509695505050505050565b600060608284031215611bf357600080fd5b611bfb6119c0565b9050611c068261193c565b81526020820135602082015260408201356001600160401b03811115611c2b57600080fd5b611c3784828501611b52565b60408301525092915050565b600060208284031215611c5557600080fd5b81356001600160401b03811115611c6b57600080fd5b61104a84828501611be1565b60008083601f840112611c8957600080fd5b5081356001600160401b03811115611ca057600080fd5b6020830191508360208260051b8501011115611cbb57600080fd5b9250929050565b60008060208385031215611cd557600080fd5b82356001600160401b03811115611ceb57600080fd5b611cf785828601611c77565b90969095509350505050565b600060608284031215611d1557600080fd5b611d1d6119c0565b9050611d288261193c565b81526020820135602082015260408201356001600160401b03811115611d4d57600080fd5b611c3784828501611a34565b600060408284031215611d6b57600080fd5b611d73611998565b905081356001600160401b0380821115611d8c57600080fd5b611d9885838601611be1565b83526020840135915080821115611dae57600080fd5b50611aef84828501611a34565b600082601f830112611dcc57600080fd5b81356020611ddc611b7383611b2f565b82815260059290921b84018101918181019086841115611dfb57600080fd5b8286015b84811015611bd65780356001600160401b03811115611e1e5760008081fd5b611e2c8986838b0101611d59565b845250918301918301611dff565b600060408284031215611e4c57600080fd5b611e54611998565b905081356001600160401b0380821115611e6d57600080fd5b611e7985838601611d03565b83526020840135915080821115611e8f57600080fd5b50611aef84828501611dbb565b600082601f830112611ead57600080fd5b81356020611ebd611b7383611b2f565b82815260059290921b84018101918181019086841115611edc57600080fd5b8286015b84811015611bd65780356001600160401b03811115611eff5760008081fd5b611f0d8986838b0101611e3a565b845250918301918301611ee0565b600060208284031215611f2d57600080fd5b81356001600160401b03811115611f4357600080fd5b61104a84828501611e9c565b60008083601f840112611f6157600080fd5b5081356001600160401b03811115611f7857600080fd5b602083019150836020828501011115611cbb57600080fd5b801515811461114a57600080fd5b600080600060408486031215611fb357600080fd5b83356001600160401b03811115611fc957600080fd5b611fd586828701611f4f565b9094509250506020840135611fe981611f90565b809150509250925092565b6000806000806060858703121561200a57600080fd5b84356001600160401b038082111561202157600080fd5b61202d88838901611f4f565b9096509450602087013591508082111561204657600080fd5b5085016060818803121561205957600080fd5b9396929550929360400135925050565b60006020828403121561207b57600080fd5b81356001600160401b0381111561209157600080fd5b61104a84828501611e3a565b6000602082840312156120af57600080fd5b81356001600160401b038111156120c557600080fd5b61104a84828501611a34565b6000604082840312156120e357600080fd5b6120eb611998565b9050813581526020820135602082015292915050565b60006060828403121561211357600080fd5b61211b611998565b905081356001600160401b0381111561213357600080fd5b61213f84828501611e9c565b82525061214f83602084016120d1565b602082015292915050565b60006020828403121561216c57600080fd5b81356001600160401b0381111561218257600080fd5b61104a84828501612101565b6000602082840312156121a057600080fd5b81356001600160401b038111156121b657600080fd5b61104a84828501611d59565b6000604082840312156121d457600080fd5b610a1183836120d1565b6000602082840312156121f057600080fd5b604051602081018181106001600160401b038211171561221257612212611982565b6040529135825250919050565b60006040828403121561223157600080fd5b612239611998565b905081356001600160401b0381111561225157600080fd5b61225d84828501611a34565b82525061214f83602084016121de565b60006020828403121561227f57600080fd5b81356001600160401b0381111561229557600080fd5b61104a8482850161221f565b6000602082840312156122b357600080fd5b81356001600160401b038111156122c957600080fd5b61104a84828501611dbb565b6000602082840312156122e757600080fd5b81356001600160401b038111156122fd57600080fd5b61104a84828501611b52565b60006020828403121561231b57600080fd5b610a1183836121de565b60006040828403121561233757600080fd5b50919050565b6000806040838503121561235057600080fd5b82356001600160401b038082111561236757600080fd5b61237386838701612325565b9350602085013591508082111561238957600080fd5b5061239685828601612325565b9150509250929050565b6000602082840312156123b257600080fd5b81356001600160401b03808211156123c957600080fd5b90830190608082860312156123dd57600080fd5b6123e56119e2565b8235828111156123f457600080fd5b61240087828601611a34565b82525060208301358281111561241557600080fd5b61242187828601611a34565b6020830152506040830135604082015261243d6060840161193c565b606082015295945050505050565b60006020828403121561245d57600080fd5b81356001600160401b0381111561247357600080fd5b61104a84828501611d03565b60006040828403121561249157600080fd5b612499611998565b905081356001600160401b03808211156124b257600080fd5b611d9885838601612101565b6000602082840312156124d057600080fd5b81356001600160401b038111156124e657600080fd5b61104a8482850161247f565b6000806000806080858703121561250857600080fd5b84356001600160401b038082111561251f57600080fd5b61252b88838901611a34565b9550602087013591508082111561254157600080fd5b5061254e87828801611a34565b935050604085013591506125646060860161193c565b905092959194509250565b60006020828403121561258157600080fd5b610a118261193c565b634e487b7160e01b600052603260045260246000fd5b60008235603e198336030181126125b657600080fd5b9190910192915050565b6000610a14368361247f565b60008235605e198336030181126125b657600080fd5b6000808335601e198436030181126125f957600080fd5b8301803591506001600160401b0382111561261357600080fd5b6020019150600581901b3603821315611cbb57600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016126535761265361262b565b5060010190565b60005b8381101561267557818101518382015260200161265d565b83811115612684576000848401525b50505050565b6000835161269c81846020880161265a565b9190910191825250602001919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b8183823760009101908152919050565b6000808335601e1984360301811261270857600080fd5b8301803591506001600160401b0382111561272257600080fd5b602001915036819003821315611cbb57600080fd5b6000808585111561274757600080fd5b8386111561275457600080fd5b5050820193919092039150565b6001600160e01b031981358181169160048510156127895780818660040360031b1b83161692505b505092915050565b6000610a143683611d59565b6000610a14368361221f565b600081518084526127c181602086016020860161265a565b601f01601f19169290920160200192915050565b85815260a0602082015260006127ee60a08301876127a9565b828103604084015261280081876127a9565b606084019590955250506001600160a01b03919091166080909101529392505050565b602081526000610a1160208301846127a9565b60408152600061284960408301856127a9565b905060018060a01b03831660208301529392505050565b600082198211156128735761287361262b565b500190565b6000610a143683611e3a565b60608152600061289760608301866127a9565b828103602084015260018060a01b038551168152602085015160208201526040850151606060408301526128ce60608301826127a9565b92505050826040830152949350505050565b6000602082840312156128f257600080fd5b81516128fd81611f90565b9392505050565b600061ffff80831681810361291b5761291b61262b565b6001019392505050565b600060ff821660ff84168060ff038211156129425761294261262b565b019392505050565b6000835161295c81846020880161265a565b60609390931b6bffffffffffffffffffffffff1916919092019081526014019291505056fea26469706673582212200b94c19c34b6b185860ebcbb490f6d9d899a46a8e5e2bb7a178a2c5ff44973c564736f6c634300080d0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102065760003560e01c8063736f7ce71161011a57806398bc186a116100ad578063caced6c51161007c578063caced6c5146104b0578063d327c1eb146104c3578063d6d75cbf1461054d578063dfe86ac514610560578063f2fde38b1461058757600080fd5b806398bc186a14610464578063a2e01f7514610477578063a8444b3a1461048a578063bb5af5bd1461049d57600080fd5b80638a04499e116100e95780638a04499e146104025780638da5cb5b1461042d5780638dc34c4d1461043e57806397182ed61461045157600080fd5b8063736f7ce71461039b57806374e9d189146103ae5780637b577b58146103dc578063870eea55146103ef57600080fd5b80635cf1b24a1161019d5780636c2b12531161016c5780636c2b1253146103475780636f9658031461035a578063715018a61461036d5780637234eefe14610375578063732c36e81461038857600080fd5b80635cf1b24a146102e05780635d44b585146102f357806360b6d768146103215780636b6dc9de1461033457600080fd5b80633a481821116101d95780633a48182114610292578063463a3ce4146102a55780635068de4c146102ba5780635c6d9f0c146102cd57600080fd5b80630162f7221461020b57806308aaf6b0146102495780632f52a2fd1461025c5780632fad7efc1461026f575b600080fd5b610236610219366004611958565b600160209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b610236610257366004611afb565b61059a565b61023661026a366004611c43565b61061a565b61028261027d366004611cc2565b610685565b6040519015158152602001610240565b6102366102a0366004611f1b565b61074c565b6102b86102b3366004611f9e565b6107c3565b005b6102826102c8366004611ff4565b610898565b6102826102db366004611cc2565b610a04565b6102366102ee366004612069565b610a1a565b61028261030136600461209d565b805160208183018101805160038252928201919093012091525460ff1681565b61023661032f36600461215a565b610a77565b6102b8610342366004611f9e565b610ac7565b61023661035536600461218e565b610b8a565b6102366103683660046121c2565b610be7565b6102b8610c38565b61023661038336600461215a565b610c8d565b61023661039636600461226d565b610ccb565b6102366103a93660046122a1565b610d08565b6102826103bc36600461209d565b805160208183018101805160048252928201919093012091525460ff1681565b6102366103ea3660046122d5565b610d70565b6102366103fd366004612309565b610dd8565b61041561041036600461218e565b610e05565b6040516001600160a01b039091168152602001610240565b6000546001600160a01b0316610415565b6102b861044c36600461233d565b610e2f565b61023661045f366004611c43565b610eee565b6102366104723660046123a0565b610f1b565b61023661048536600461244b565b610f67565b61041561049836600461226d565b610fd3565b6102366104ab3660046124be565b610ff7565b6104156104be3660046124be565b611028565b6102366104d13660046124f2565b8351602094850120835193850193909320604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8188015280820195909552606085019190915260808401929092526001600160a01b031660a0808401919091528151808403909101815260c09092019052805191012090565b61023661055b366004612309565b611052565b6102367f000000000000000000000000000000000000000000000000000000000000000081565b6102b861059536600461256f565b611093565b6000807f80ad7e1b04ee6d994a125f4714ca0720908bd80ed16063ec8aee4b88e9253e2d83600001518460200151805190602001206040516020016105fb939291909283526001600160a01b03919091166020830152604082015260600190565b60408051601f1981840301815291905280516020909101209392505050565b6000807f409f5114779a253e700d775d7845e6efc1e83685ac59868d2df3d4de51c7d621836000015184602001516106558660400151610d70565b6040805160208101959095526001600160a01b03909316928401929092526060830152608082015260a0016105fb565b6000805b8281101561074557368484838181106106a4576106a461258a565b90506020028101906106b691906125a0565b905060006106c66104be836125c0565b9050610712818787868181106106de576106de61258a565b90506020028101906106f091906125a0565b6106fa90806125cc565b60200180360381019061070d91906121c2565b6111d9565b61072f61071f83806125cc565b61072990806125e2565b836112a3565b505050808061073d90612641565b915050610689565b5092915050565b6000606060005b83518110156107b4578161077f8583815181106107725761077261258a565b6020026020010151610a1a565b60405160200161079092919061268a565b604051602081830303815290604052915080806107ac90612641565b915050610753565b50805160209091012092915050565b6107cb6116e6565b6001600160a01b03166107e66000546001600160a01b031690565b6001600160a01b0316146108155760405162461bcd60e51b815260040161080c906126ac565b60405180910390fd5b80600484846040516108289291906126e1565b908152604051908190036020018120805492151560ff199093169290921790915561085690849084906126e1565b6040519081900381208215158252907f88e1b1a43f3edcb9afe941dfea296f5bc32fab715b5fc9aa101ec26d87d2e8a2906020015b60405180910390a2505050565b60008181526002602052604081205460ff16156108f75760405162461bcd60e51b815260206004820152601b60248201527f44656c65676174696f6e20686173206265656e207265766f6b65640000000000604482015260640161080c565b600061090660408501856126f1565b61091591600491600091612737565b61091e91612761565b90506001600160e01b0319811663f2fde38b60e01b0361098c5760405162461bcd60e51b8152602060048201526024808201527f7472616e736665724f776e657273686970206973206e6f742064656c6567617460448201526361626c6560e01b606482015260840161080c565b6001600160e01b03198116630f374f3b60e31b036109f85760405162461bcd60e51b8152602060048201526024808201527f72656e6f756e63654f776e657273686970206973206e6f742064656c6567617460448201526361626c6560e01b606482015260840161080c565b50600195945050505050565b6000610a118383336112a3565b90505b92915050565b6000807fd97dd99b404d177890f06a8f0fc8e5ed0333fb2ebb6684360709066e8984f594610a4b8460000151610f67565b610a588560200151610d08565b60408051602081019490945283019190915260608201526080016105fb565b6000807f0000000000000000000000000000000000000000000000000000000000000000610aa484610c8d565b60405161190160f01b6020820152602281019290925260428201526062016105fb565b610acf6116e6565b6001600160a01b0316610aea6000546001600160a01b031690565b6001600160a01b031614610b105760405162461bcd60e51b815260040161080c906126ac565b8060038484604051610b239291906126e1565b908152604051908190036020018120805492151560ff1990931692909217909155610b5190849084906126e1565b6040519081900381208215158252907f9d3712f4978fc20b17a1dfbcd563f9aded75d05b6019427a9eca23245220138b9060200161088b565b6000807f3c36a06e1d288b0f94f565588317a46ad11bc3c96992109f9a2365a2737259a7610bbb846000015161061a565b6020808601518051908201206040516105fb949392019283526020830191909152604082015260600190565b6000807fe8d3d963b33868fb116316bc3fd55e8f49123f30e4418f71e140d54b7cd3b2b9836000015184602001516040516020016105fb939291909283526020830191909152604082015260600190565b610c406116e6565b6001600160a01b0316610c5b6000546001600160a01b031690565b6001600160a01b031614610c815760405162461bcd60e51b815260040161080c906126ac565b610c8b60006117b5565b565b6000807f08c69a206c06f5334b35ceb1186181a713b21aff02cf66285f375084fbef2eb8610cbe846000015161074c565b610a588560200151610be7565b6000807f1b0091a1d050ac3fa97e15af326cf512d740529b43d5750169acacda23de2788836000015180519060200120610a588560200151611052565b6000606060005b83518110156107b45781610d3b858381518110610d2e57610d2e61258a565b6020026020010151610b8a565b604051602001610d4c92919061268a565b60405160208183030381529060405291508080610d6890612641565b915050610d0f565b6000606060005b83518110156107b45781610da3858381518110610d9657610d9661258a565b602002602001015161059a565b604051602001610db492919061268a565b60405160208183030381529060405291508080610dd090612641565b915050610d77565b6000807f0000000000000000000000000000000000000000000000000000000000000000610aa484611052565b805160009081610e1482610eee565b90506000610e26828660200151611805565b95945050505050565b6000610e3d61041084612791565b90506000610e4d6104988461279d565b9050806001600160a01b0316826001600160a01b031614610ec05760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920746865207369676e65722063616e207265766f6b6520612064656c60448201526632b3b0ba34b7b760c91b606482015260840161080c565b6000610ece61035586612791565b6000908152600260205260409020805460ff191660011790555050505050565b6000807f0000000000000000000000000000000000000000000000000000000000000000610aa48461061a565b6000807f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f83600001518460200151856040015186606001516040516020016105fb9594939291906127d5565b6000807fb16dfdb3b8fa033fe30ac976cd4a50ad256b6811c80d90fcd0b323eec190047d836000015184602001518560400151805190602001206040516020016105fb94939291909384526001600160a01b039290921660208401526040830152606082015260800190565b602081015160009081610fe582610dd8565b90506000610e26828660000151611805565b6000807fc32b6dfe0f988d1f2b13248cddd88e320ff0ae86e3ccfe38bab77a80f4477d44610bbb8460000151610c8d565b6000806110388360000151610a77565b9050600061104a828560200151611805565b949350505050565b805160405160009182916105fb917f7148a5140265154d6c5200f68c3b86caca80512f179c3903dffd45aeaefc8ea891602001918252602082015260400190565b61109b6116e6565b6001600160a01b03166110b66000546001600160a01b031690565b6001600160a01b0316146110dc5760405162461bcd60e51b815260040161080c906126ac565b6001600160a01b0381166111415760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161080c565b61114a816117b5565b50565b61114a816040516024016111619190612823565b60408051601f198184030181529190526020810180516001600160e01b031663104c13eb60e21b1790526118dc565b6111d582826040516024016111a6929190612836565b60408051601f198184030181529190526020810180516001600160e01b031663319af33360e01b1790526118dc565b5050565b60208082015182516001600160a01b038516600090815260018085526040808320858452909552939020549192909161121191612860565b81146112795760405162461bcd60e51b815260206004820152603160248201527f4f6e652d61742d612d74696d65206f7264657220656e666f726365642e204e6f6044820152701b98d94c881a5cc81d1bdbc81cdb585b1b607a1b606482015260840161080c565b6001600160a01b039093166000908152600160209081526040808320938352929052209190915550565b6000805b838110156116de5760008585838181106112c3576112c361258a565b90506020028101906112d591906125a0565b6112de90612878565b90506000808260200151516000036112f65750849050805b6000805b8460200151518110156115965760008560200151828151811061131f5761131f61258a565b60200260200101519050600061133482610e05565b905082600003611345578095508594505b846001600160a01b0316816001600160a01b0316146113bf5760405162461bcd60e51b815260206004820152603060248201527f44656c65676174696f6e207369676e657220646f6573206e6f74206d6174636860448201526f103932b8bab4b932b21039b4b3b732b960811b606482015260840161080c565b81516020810151851461143a5760405162461bcd60e51b815260206004820152603760248201527f44656c65676174696f6e20617574686f7269747920646f6573206e6f74206d6160448201527f7463682070726576696f75732064656c65676174696f6e000000000000000000606482015260840161080c565b600061144584610b8a565b905060005b8260400151518161ffff16101561157957600083604001518261ffff16815181106114775761147761258a565b60200260200101516000015190506000816001600160a01b0316635068de4c86604001518561ffff16815181106114b0576114b061258a565b6020026020010151602001518e60000151876040518463ffffffff1660e01b81526004016114e093929190612884565b6020604051808303816000875af11580156114ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152391906128e0565b9050806115645760405162461bcd60e51b815260206004820152600f60248201526e10d85d99585d081c995a9958dd1959608a1b604482015260640161080c565b5050808061157190612904565b91505061144a565b5090519550935082915061158e905081612641565b9150506112fa565b50835180516001600160a01b031630146115f25760405162461bcd60e51b815260206004820181905260248201527f496e766f636174696f6e2074617267657420646f6573206e6f74206d61746368604482015260640161080c565b6040516001600160a01b0385811682528916907f185d11175440fcb6458fbc1889b02953452539ed80ad1da781a5449500f6d9609060200160405180910390a261164a816000015182604001518360200151876118fd565b96506116796040518060400160405280600c81526020016b54657374696e67206c6f677360a01b81525061114d565b866116c65760405162461bcd60e51b815260206004820152601c60248201527f44656c656761746f7220657865637574696f6e206661696c6564212100000000604482015260640161080c565b505050505080806116d690612641565b9150506112a7565b509392505050565b600030330361173c57600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b0316915061177d9050565b61177a6040518060400160405280601d81526020017f5573696e67206e6f726d616c206d73672e73656e646572206c6f67696300000081525061114d565b50335b6117b26040518060400160405280601381526020017252657475726e696e672073656e64657220257360681b81525082611190565b90565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060008084516041146118205760009350505050610a14565b50505060208201516040830151606084015160001a601b81101561184c57611849601b82612925565b90505b8060ff16601b1415801561186457508060ff16601c14155b156118755760009350505050610a14565b60408051600081526020810180835288905260ff831691810191909152606081018490526080810183905260019060a0016020604051602081039080840390855afa1580156118c8573d6000803e3d6000fd5b505050602060405103519350505050610a14565b80516a636f6e736f6c652e6c6f67602083016000808483855afa5050505050565b600080848360405160200161191392919061294a565b604051602081830303815290604052905060008082516020840160008a89f19695505050505050565b80356001600160a01b038116811461195357600080fd5b919050565b6000806040838503121561196b57600080fd5b6119748361193c565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156119ba576119ba611982565b60405290565b604051606081016001600160401b03811182821017156119ba576119ba611982565b604051608081016001600160401b03811182821017156119ba576119ba611982565b604051601f8201601f191681016001600160401b0381118282101715611a2c57611a2c611982565b604052919050565b600082601f830112611a4557600080fd5b81356001600160401b03811115611a5e57611a5e611982565b611a71601f8201601f1916602001611a04565b818152846020838601011115611a8657600080fd5b816020850160208301376000918101602001919091529392505050565b600060408284031215611ab557600080fd5b611abd611998565b9050611ac88261193c565b815260208201356001600160401b03811115611ae357600080fd5b611aef84828501611a34565b60208301525092915050565b600060208284031215611b0d57600080fd5b81356001600160401b03811115611b2357600080fd5b61104a84828501611aa3565b60006001600160401b03821115611b4857611b48611982565b5060051b60200190565b600082601f830112611b6357600080fd5b81356020611b78611b7383611b2f565b611a04565b82815260059290921b84018101918181019086841115611b9757600080fd5b8286015b84811015611bd65780356001600160401b03811115611bba5760008081fd5b611bc88986838b0101611aa3565b845250918301918301611b9b565b509695505050505050565b600060608284031215611bf357600080fd5b611bfb6119c0565b9050611c068261193c565b81526020820135602082015260408201356001600160401b03811115611c2b57600080fd5b611c3784828501611b52565b60408301525092915050565b600060208284031215611c5557600080fd5b81356001600160401b03811115611c6b57600080fd5b61104a84828501611be1565b60008083601f840112611c8957600080fd5b5081356001600160401b03811115611ca057600080fd5b6020830191508360208260051b8501011115611cbb57600080fd5b9250929050565b60008060208385031215611cd557600080fd5b82356001600160401b03811115611ceb57600080fd5b611cf785828601611c77565b90969095509350505050565b600060608284031215611d1557600080fd5b611d1d6119c0565b9050611d288261193c565b81526020820135602082015260408201356001600160401b03811115611d4d57600080fd5b611c3784828501611a34565b600060408284031215611d6b57600080fd5b611d73611998565b905081356001600160401b0380821115611d8c57600080fd5b611d9885838601611be1565b83526020840135915080821115611dae57600080fd5b50611aef84828501611a34565b600082601f830112611dcc57600080fd5b81356020611ddc611b7383611b2f565b82815260059290921b84018101918181019086841115611dfb57600080fd5b8286015b84811015611bd65780356001600160401b03811115611e1e5760008081fd5b611e2c8986838b0101611d59565b845250918301918301611dff565b600060408284031215611e4c57600080fd5b611e54611998565b905081356001600160401b0380821115611e6d57600080fd5b611e7985838601611d03565b83526020840135915080821115611e8f57600080fd5b50611aef84828501611dbb565b600082601f830112611ead57600080fd5b81356020611ebd611b7383611b2f565b82815260059290921b84018101918181019086841115611edc57600080fd5b8286015b84811015611bd65780356001600160401b03811115611eff5760008081fd5b611f0d8986838b0101611e3a565b845250918301918301611ee0565b600060208284031215611f2d57600080fd5b81356001600160401b03811115611f4357600080fd5b61104a84828501611e9c565b60008083601f840112611f6157600080fd5b5081356001600160401b03811115611f7857600080fd5b602083019150836020828501011115611cbb57600080fd5b801515811461114a57600080fd5b600080600060408486031215611fb357600080fd5b83356001600160401b03811115611fc957600080fd5b611fd586828701611f4f565b9094509250506020840135611fe981611f90565b809150509250925092565b6000806000806060858703121561200a57600080fd5b84356001600160401b038082111561202157600080fd5b61202d88838901611f4f565b9096509450602087013591508082111561204657600080fd5b5085016060818803121561205957600080fd5b9396929550929360400135925050565b60006020828403121561207b57600080fd5b81356001600160401b0381111561209157600080fd5b61104a84828501611e3a565b6000602082840312156120af57600080fd5b81356001600160401b038111156120c557600080fd5b61104a84828501611a34565b6000604082840312156120e357600080fd5b6120eb611998565b9050813581526020820135602082015292915050565b60006060828403121561211357600080fd5b61211b611998565b905081356001600160401b0381111561213357600080fd5b61213f84828501611e9c565b82525061214f83602084016120d1565b602082015292915050565b60006020828403121561216c57600080fd5b81356001600160401b0381111561218257600080fd5b61104a84828501612101565b6000602082840312156121a057600080fd5b81356001600160401b038111156121b657600080fd5b61104a84828501611d59565b6000604082840312156121d457600080fd5b610a1183836120d1565b6000602082840312156121f057600080fd5b604051602081018181106001600160401b038211171561221257612212611982565b6040529135825250919050565b60006040828403121561223157600080fd5b612239611998565b905081356001600160401b0381111561225157600080fd5b61225d84828501611a34565b82525061214f83602084016121de565b60006020828403121561227f57600080fd5b81356001600160401b0381111561229557600080fd5b61104a8482850161221f565b6000602082840312156122b357600080fd5b81356001600160401b038111156122c957600080fd5b61104a84828501611dbb565b6000602082840312156122e757600080fd5b81356001600160401b038111156122fd57600080fd5b61104a84828501611b52565b60006020828403121561231b57600080fd5b610a1183836121de565b60006040828403121561233757600080fd5b50919050565b6000806040838503121561235057600080fd5b82356001600160401b038082111561236757600080fd5b61237386838701612325565b9350602085013591508082111561238957600080fd5b5061239685828601612325565b9150509250929050565b6000602082840312156123b257600080fd5b81356001600160401b03808211156123c957600080fd5b90830190608082860312156123dd57600080fd5b6123e56119e2565b8235828111156123f457600080fd5b61240087828601611a34565b82525060208301358281111561241557600080fd5b61242187828601611a34565b6020830152506040830135604082015261243d6060840161193c565b606082015295945050505050565b60006020828403121561245d57600080fd5b81356001600160401b0381111561247357600080fd5b61104a84828501611d03565b60006040828403121561249157600080fd5b612499611998565b905081356001600160401b03808211156124b257600080fd5b611d9885838601612101565b6000602082840312156124d057600080fd5b81356001600160401b038111156124e657600080fd5b61104a8482850161247f565b6000806000806080858703121561250857600080fd5b84356001600160401b038082111561251f57600080fd5b61252b88838901611a34565b9550602087013591508082111561254157600080fd5b5061254e87828801611a34565b935050604085013591506125646060860161193c565b905092959194509250565b60006020828403121561258157600080fd5b610a118261193c565b634e487b7160e01b600052603260045260246000fd5b60008235603e198336030181126125b657600080fd5b9190910192915050565b6000610a14368361247f565b60008235605e198336030181126125b657600080fd5b6000808335601e198436030181126125f957600080fd5b8301803591506001600160401b0382111561261357600080fd5b6020019150600581901b3603821315611cbb57600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016126535761265361262b565b5060010190565b60005b8381101561267557818101518382015260200161265d565b83811115612684576000848401525b50505050565b6000835161269c81846020880161265a565b9190910191825250602001919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b8183823760009101908152919050565b6000808335601e1984360301811261270857600080fd5b8301803591506001600160401b0382111561272257600080fd5b602001915036819003821315611cbb57600080fd5b6000808585111561274757600080fd5b8386111561275457600080fd5b5050820193919092039150565b6001600160e01b031981358181169160048510156127895780818660040360031b1b83161692505b505092915050565b6000610a143683611d59565b6000610a14368361221f565b600081518084526127c181602086016020860161265a565b601f01601f19169290920160200192915050565b85815260a0602082015260006127ee60a08301876127a9565b828103604084015261280081876127a9565b606084019590955250506001600160a01b03919091166080909101529392505050565b602081526000610a1160208301846127a9565b60408152600061284960408301856127a9565b905060018060a01b03831660208301529392505050565b600082198211156128735761287361262b565b500190565b6000610a143683611e3a565b60608152600061289760608301866127a9565b828103602084015260018060a01b038551168152602085015160208201526040850151606060408301526128ce60608301826127a9565b92505050826040830152949350505050565b6000602082840312156128f257600080fd5b81516128fd81611f90565b9392505050565b600061ffff80831681810361291b5761291b61262b565b6001019392505050565b600060ff821660ff84168060ff038211156129425761294261262b565b019392505050565b6000835161295c81846020880161265a565b60609390931b6bffffffffffffffffffffffff1916919092019081526014019291505056fea26469706673582212200b94c19c34b6b185860ebcbb490f6d9d899a46a8e5e2bb7a178a2c5ff44973c564736f6c634300080d0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/evm.test.ts b/src/evm.test.ts new file mode 100644 index 0000000..dbce912 --- /dev/null +++ b/src/evm.test.ts @@ -0,0 +1,51 @@ +import { ethers } from 'ethers'; + +import { Account } from './account'; +import { Registry } from './index'; +import { getConfig } from './testing/helper'; +import { abi } from './artifacts/PhisherRegistry.json' + +const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig(); + +jest.setTimeout(90 * 1000); + +const CONTRACT_ADDRESS = "0xD035Adc6d41f9136C9C19434E0500F7706664e66" +const ETH_RPC_ENDPOINT = "http://localhost:8545" + +const evmTests = () => { + let registry: Registry; + + beforeAll(async () => { + registry = new Registry(gqlEndpoint, restEndpoint, chainId); + + }); + + test.only('Send eth tx for contract method.', async() => { + // TODO: Refactor inside sendEthTx? + const provider = new ethers.providers.JsonRpcProvider(ETH_RPC_ENDPOINT) + const signer = new ethers.Wallet(privateKey, provider) + const contract = new ethers.Contract(CONTRACT_ADDRESS, abi, signer); + + const populatedTx = await contract.populateTransaction + .claimIfPhisher('phisher1', true); + + const signerPopulatedTx = await signer.populateTransaction(populatedTx); + const signedTxString = await signer.signTransaction(signerPopulatedTx); + const tx = ethers.utils.parseTransaction(signedTxString); + + // TODO: Use laconicd queries in evm module + tx.gasLimit = await provider.estimateGas(signerPopulatedTx); + console.log('tx', tx) + + await registry.sendEthTx( + { + tx, + from: signer.address + }, + privateKey, + fee + ); + }) +} + +describe('evm', evmTests); diff --git a/src/index.ts b/src/index.ts index c24adfb..593c70e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,11 +7,12 @@ import { createMessageSend, MessageSendParams } from '@tharsis/transactions' +import { ethers } from 'ethers'; import { RegistryClient } from "./registry-client"; import { Account } from "./account"; import { createTransaction } from "./txbuilder"; -import { Payload, Record } from './types'; +import { EthereumTxData, Payload, Record } from './types'; import { Util } from './util'; import { createTxMsgAssociateBond, @@ -51,6 +52,7 @@ import { MessageMsgCommitBid, MessageMsgRevealBid } from './messages/auction'; +import { createTxMsgEthereumTx, MessageMsgEthereumTx } from './messages/evm'; export const DEFAULT_CHAIN_ID = 'laconic_9000-1'; @@ -462,6 +464,31 @@ export class Registry { return parseTxResponse(result); } + /** + * Send ethereum transaction. + */ + async sendEthTx( + { tx, from }: { tx: ethers.Transaction, from: string }, + privateKey: string, + fee: Fee + ) { + let result; + const account = new Account(Buffer.from(privateKey, 'hex')); + console.log('account.registryAddress', account.registryAddress); + const sender = await this._getSender(account); + + const msgParams = { + data: new EthereumTxData(tx), + hash: tx.hash!, + from + } + + const msg = createTxMsgEthereumTx(this._chain, sender, fee, '', msgParams) + result = await this._submitTx(msg, privateKey, sender); + + return parseTxResponse(result); + } + /** * Submit record transaction. * @param privateKey - private key in HEX to sign message. diff --git a/src/messages/evm.ts b/src/messages/evm.ts new file mode 100644 index 0000000..b9c7b1a --- /dev/null +++ b/src/messages/evm.ts @@ -0,0 +1,87 @@ +import { + generateTypes, +} from '@tharsis/eip712' +import { + Chain, + Sender, + Fee, +} from '@tharsis/transactions' + +import * as evmTx from '../proto/ethermint/evm/v1/tx' +import * as registry from '../proto/vulcanize/registry/v1beta1/registry' +import { EthereumTxData } from '../types' +import { createTx } from './util' + +const MSG_ETHEREUM_TX_TYPES = { + MsgValue: [ + { name: 'data', type: 'TypeData' }, + { name: 'hash', type: 'string' }, + { name: 'from', type: 'string' } + ], + TypeData: [ + { name: 'type_url', type: 'string' }, + { name: 'value', type: 'uint8[]' }, + ], +} + +export interface MessageMsgEthereumTx { + data: EthereumTxData, + hash: string, + from: string +} + +export function createTxMsgEthereumTx( + chain: Chain, + sender: Sender, + fee: Fee, + memo: string, + params: MessageMsgEthereumTx, +) { + const types = generateTypes(MSG_ETHEREUM_TX_TYPES) + + const msg = createMsgEthereumTx( + params.data, + params.hash, + params.from + ) + + const msgCosmos = protoCreateMsgEthereumTx( + params.data, + params.hash, + params.from + ) + + return createTx(chain, sender, fee, memo, types, msg, msgCosmos) +} + +function createMsgEthereumTx( + data: EthereumTxData, + hash: string, + from: string +) { + return { + type: 'evm/EthereumTx', + value: { + data: data.serialize(), + hash, + from + }, + } +} + +const protoCreateMsgEthereumTx = ( + data: EthereumTxData, + hash: string, + from: string +) => { + const ethereumTxMessage = new evmTx.ethermint.evm.v1.MsgEthereumTx({ + data: data.serialize(), + hash, + from, + }) + + return { + message: ethereumTxMessage, + path: 'ethermint.evm.v1.MsgEthereumTx', + } +} diff --git a/src/proto/cosmos_proto/cosmos.ts b/src/proto/cosmos_proto/cosmos.ts new file mode 100644 index 0000000..be2b247 --- /dev/null +++ b/src/proto/cosmos_proto/cosmos.ts @@ -0,0 +1,219 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.12.4 + * source: cosmos_proto/cosmos.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/descriptor"; +import * as pb_1 from "google-protobuf"; +export namespace cosmos_proto { + export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2 + } + export class InterfaceDescriptor extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + name?: string; + description?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + if ("description" in data && data.description != undefined) { + this.description = data.description; + } + } + } + get name() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get description() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set description(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + name?: string; + description?: string; + }): InterfaceDescriptor { + const message = new InterfaceDescriptor({}); + if (data.name != null) { + message.name = data.name; + } + if (data.description != null) { + message.description = data.description; + } + return message; + } + toObject() { + const data: { + name?: string; + description?: string; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.description != null) { + data.description = this.description; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.name.length) + writer.writeString(1, this.name); + if (this.description.length) + writer.writeString(2, this.description); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): InterfaceDescriptor { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new InterfaceDescriptor(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + message.description = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): InterfaceDescriptor { + return InterfaceDescriptor.deserialize(bytes); + } + } + export class ScalarDescriptor extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + name?: string; + description?: string; + field_type?: ScalarType[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + if ("description" in data && data.description != undefined) { + this.description = data.description; + } + if ("field_type" in data && data.field_type != undefined) { + this.field_type = data.field_type; + } + } + } + get name() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get description() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set description(value: string) { + pb_1.Message.setField(this, 2, value); + } + get field_type() { + return pb_1.Message.getFieldWithDefault(this, 3, []) as ScalarType[]; + } + set field_type(value: ScalarType[]) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + name?: string; + description?: string; + field_type?: ScalarType[]; + }): ScalarDescriptor { + const message = new ScalarDescriptor({}); + if (data.name != null) { + message.name = data.name; + } + if (data.description != null) { + message.description = data.description; + } + if (data.field_type != null) { + message.field_type = data.field_type; + } + return message; + } + toObject() { + const data: { + name?: string; + description?: string; + field_type?: ScalarType[]; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.description != null) { + data.description = this.description; + } + if (this.field_type != null) { + data.field_type = this.field_type; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.name.length) + writer.writeString(1, this.name); + if (this.description.length) + writer.writeString(2, this.description); + if (this.field_type.length) + writer.writePackedEnum(3, this.field_type); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ScalarDescriptor { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ScalarDescriptor(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + message.description = reader.readString(); + break; + case 3: + message.field_type = reader.readPackedEnum(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ScalarDescriptor { + return ScalarDescriptor.deserialize(bytes); + } + } +} diff --git a/src/proto/ethermint/evm/v1/evm.ts b/src/proto/ethermint/evm/v1/evm.ts new file mode 100644 index 0000000..fc25045 --- /dev/null +++ b/src/proto/ethermint/evm/v1/evm.ts @@ -0,0 +1,1683 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.12.4 + * source: ethermint/evm/v1/evm.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as pb_1 from "google-protobuf"; +export namespace ethermint.evm.v1 { + export class Params extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + evm_denom?: string; + enable_create?: boolean; + enable_call?: boolean; + extra_eips?: number[]; + chain_config?: ChainConfig; + allow_unprotected_txs?: boolean; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("evm_denom" in data && data.evm_denom != undefined) { + this.evm_denom = data.evm_denom; + } + if ("enable_create" in data && data.enable_create != undefined) { + this.enable_create = data.enable_create; + } + if ("enable_call" in data && data.enable_call != undefined) { + this.enable_call = data.enable_call; + } + if ("extra_eips" in data && data.extra_eips != undefined) { + this.extra_eips = data.extra_eips; + } + if ("chain_config" in data && data.chain_config != undefined) { + this.chain_config = data.chain_config; + } + if ("allow_unprotected_txs" in data && data.allow_unprotected_txs != undefined) { + this.allow_unprotected_txs = data.allow_unprotected_txs; + } + } + } + get evm_denom() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set evm_denom(value: string) { + pb_1.Message.setField(this, 1, value); + } + get enable_create() { + return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean; + } + set enable_create(value: boolean) { + pb_1.Message.setField(this, 2, value); + } + get enable_call() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set enable_call(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get extra_eips() { + return pb_1.Message.getFieldWithDefault(this, 4, []) as number[]; + } + set extra_eips(value: number[]) { + pb_1.Message.setField(this, 4, value); + } + get chain_config() { + return pb_1.Message.getWrapperField(this, ChainConfig, 5) as ChainConfig; + } + set chain_config(value: ChainConfig) { + pb_1.Message.setWrapperField(this, 5, value); + } + get has_chain_config() { + return pb_1.Message.getField(this, 5) != null; + } + get allow_unprotected_txs() { + return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean; + } + set allow_unprotected_txs(value: boolean) { + pb_1.Message.setField(this, 6, value); + } + static fromObject(data: { + evm_denom?: string; + enable_create?: boolean; + enable_call?: boolean; + extra_eips?: number[]; + chain_config?: ReturnType; + allow_unprotected_txs?: boolean; + }): Params { + const message = new Params({}); + if (data.evm_denom != null) { + message.evm_denom = data.evm_denom; + } + if (data.enable_create != null) { + message.enable_create = data.enable_create; + } + if (data.enable_call != null) { + message.enable_call = data.enable_call; + } + if (data.extra_eips != null) { + message.extra_eips = data.extra_eips; + } + if (data.chain_config != null) { + message.chain_config = ChainConfig.fromObject(data.chain_config); + } + if (data.allow_unprotected_txs != null) { + message.allow_unprotected_txs = data.allow_unprotected_txs; + } + return message; + } + toObject() { + const data: { + evm_denom?: string; + enable_create?: boolean; + enable_call?: boolean; + extra_eips?: number[]; + chain_config?: ReturnType; + allow_unprotected_txs?: boolean; + } = {}; + if (this.evm_denom != null) { + data.evm_denom = this.evm_denom; + } + if (this.enable_create != null) { + data.enable_create = this.enable_create; + } + if (this.enable_call != null) { + data.enable_call = this.enable_call; + } + if (this.extra_eips != null) { + data.extra_eips = this.extra_eips; + } + if (this.chain_config != null) { + data.chain_config = this.chain_config.toObject(); + } + if (this.allow_unprotected_txs != null) { + data.allow_unprotected_txs = this.allow_unprotected_txs; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.evm_denom.length) + writer.writeString(1, this.evm_denom); + if (this.enable_create != false) + writer.writeBool(2, this.enable_create); + if (this.enable_call != false) + writer.writeBool(3, this.enable_call); + if (this.extra_eips.length) + writer.writePackedInt64(4, this.extra_eips); + if (this.has_chain_config) + writer.writeMessage(5, this.chain_config, () => this.chain_config.serialize(writer)); + if (this.allow_unprotected_txs != false) + writer.writeBool(6, this.allow_unprotected_txs); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Params { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Params(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.evm_denom = reader.readString(); + break; + case 2: + message.enable_create = reader.readBool(); + break; + case 3: + message.enable_call = reader.readBool(); + break; + case 4: + message.extra_eips = reader.readPackedInt64(); + break; + case 5: + reader.readMessage(message.chain_config, () => message.chain_config = ChainConfig.deserialize(reader)); + break; + case 6: + message.allow_unprotected_txs = reader.readBool(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Params { + return Params.deserialize(bytes); + } + } + export class ChainConfig extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + homestead_block?: string; + dao_fork_block?: string; + dao_fork_support?: boolean; + eip150_block?: string; + eip150_hash?: string; + eip155_block?: string; + eip158_block?: string; + byzantium_block?: string; + constantinople_block?: string; + petersburg_block?: string; + istanbul_block?: string; + muir_glacier_block?: string; + berlin_block?: string; + london_block?: string; + arrow_glacier_block?: string; + gray_glacier_block?: string; + merge_netsplit_block?: string; + shanghai_block?: string; + cancun_block?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("homestead_block" in data && data.homestead_block != undefined) { + this.homestead_block = data.homestead_block; + } + if ("dao_fork_block" in data && data.dao_fork_block != undefined) { + this.dao_fork_block = data.dao_fork_block; + } + if ("dao_fork_support" in data && data.dao_fork_support != undefined) { + this.dao_fork_support = data.dao_fork_support; + } + if ("eip150_block" in data && data.eip150_block != undefined) { + this.eip150_block = data.eip150_block; + } + if ("eip150_hash" in data && data.eip150_hash != undefined) { + this.eip150_hash = data.eip150_hash; + } + if ("eip155_block" in data && data.eip155_block != undefined) { + this.eip155_block = data.eip155_block; + } + if ("eip158_block" in data && data.eip158_block != undefined) { + this.eip158_block = data.eip158_block; + } + if ("byzantium_block" in data && data.byzantium_block != undefined) { + this.byzantium_block = data.byzantium_block; + } + if ("constantinople_block" in data && data.constantinople_block != undefined) { + this.constantinople_block = data.constantinople_block; + } + if ("petersburg_block" in data && data.petersburg_block != undefined) { + this.petersburg_block = data.petersburg_block; + } + if ("istanbul_block" in data && data.istanbul_block != undefined) { + this.istanbul_block = data.istanbul_block; + } + if ("muir_glacier_block" in data && data.muir_glacier_block != undefined) { + this.muir_glacier_block = data.muir_glacier_block; + } + if ("berlin_block" in data && data.berlin_block != undefined) { + this.berlin_block = data.berlin_block; + } + if ("london_block" in data && data.london_block != undefined) { + this.london_block = data.london_block; + } + if ("arrow_glacier_block" in data && data.arrow_glacier_block != undefined) { + this.arrow_glacier_block = data.arrow_glacier_block; + } + if ("gray_glacier_block" in data && data.gray_glacier_block != undefined) { + this.gray_glacier_block = data.gray_glacier_block; + } + if ("merge_netsplit_block" in data && data.merge_netsplit_block != undefined) { + this.merge_netsplit_block = data.merge_netsplit_block; + } + if ("shanghai_block" in data && data.shanghai_block != undefined) { + this.shanghai_block = data.shanghai_block; + } + if ("cancun_block" in data && data.cancun_block != undefined) { + this.cancun_block = data.cancun_block; + } + } + } + get homestead_block() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set homestead_block(value: string) { + pb_1.Message.setField(this, 1, value); + } + get dao_fork_block() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set dao_fork_block(value: string) { + pb_1.Message.setField(this, 2, value); + } + get dao_fork_support() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set dao_fork_support(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get eip150_block() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set eip150_block(value: string) { + pb_1.Message.setField(this, 4, value); + } + get eip150_hash() { + return pb_1.Message.getFieldWithDefault(this, 5, "") as string; + } + set eip150_hash(value: string) { + pb_1.Message.setField(this, 5, value); + } + get eip155_block() { + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; + } + set eip155_block(value: string) { + pb_1.Message.setField(this, 6, value); + } + get eip158_block() { + return pb_1.Message.getFieldWithDefault(this, 7, "") as string; + } + set eip158_block(value: string) { + pb_1.Message.setField(this, 7, value); + } + get byzantium_block() { + return pb_1.Message.getFieldWithDefault(this, 8, "") as string; + } + set byzantium_block(value: string) { + pb_1.Message.setField(this, 8, value); + } + get constantinople_block() { + return pb_1.Message.getFieldWithDefault(this, 9, "") as string; + } + set constantinople_block(value: string) { + pb_1.Message.setField(this, 9, value); + } + get petersburg_block() { + return pb_1.Message.getFieldWithDefault(this, 10, "") as string; + } + set petersburg_block(value: string) { + pb_1.Message.setField(this, 10, value); + } + get istanbul_block() { + return pb_1.Message.getFieldWithDefault(this, 11, "") as string; + } + set istanbul_block(value: string) { + pb_1.Message.setField(this, 11, value); + } + get muir_glacier_block() { + return pb_1.Message.getFieldWithDefault(this, 12, "") as string; + } + set muir_glacier_block(value: string) { + pb_1.Message.setField(this, 12, value); + } + get berlin_block() { + return pb_1.Message.getFieldWithDefault(this, 13, "") as string; + } + set berlin_block(value: string) { + pb_1.Message.setField(this, 13, value); + } + get london_block() { + return pb_1.Message.getFieldWithDefault(this, 17, "") as string; + } + set london_block(value: string) { + pb_1.Message.setField(this, 17, value); + } + get arrow_glacier_block() { + return pb_1.Message.getFieldWithDefault(this, 18, "") as string; + } + set arrow_glacier_block(value: string) { + pb_1.Message.setField(this, 18, value); + } + get gray_glacier_block() { + return pb_1.Message.getFieldWithDefault(this, 20, "") as string; + } + set gray_glacier_block(value: string) { + pb_1.Message.setField(this, 20, value); + } + get merge_netsplit_block() { + return pb_1.Message.getFieldWithDefault(this, 21, "") as string; + } + set merge_netsplit_block(value: string) { + pb_1.Message.setField(this, 21, value); + } + get shanghai_block() { + return pb_1.Message.getFieldWithDefault(this, 22, "") as string; + } + set shanghai_block(value: string) { + pb_1.Message.setField(this, 22, value); + } + get cancun_block() { + return pb_1.Message.getFieldWithDefault(this, 23, "") as string; + } + set cancun_block(value: string) { + pb_1.Message.setField(this, 23, value); + } + static fromObject(data: { + homestead_block?: string; + dao_fork_block?: string; + dao_fork_support?: boolean; + eip150_block?: string; + eip150_hash?: string; + eip155_block?: string; + eip158_block?: string; + byzantium_block?: string; + constantinople_block?: string; + petersburg_block?: string; + istanbul_block?: string; + muir_glacier_block?: string; + berlin_block?: string; + london_block?: string; + arrow_glacier_block?: string; + gray_glacier_block?: string; + merge_netsplit_block?: string; + shanghai_block?: string; + cancun_block?: string; + }): ChainConfig { + const message = new ChainConfig({}); + if (data.homestead_block != null) { + message.homestead_block = data.homestead_block; + } + if (data.dao_fork_block != null) { + message.dao_fork_block = data.dao_fork_block; + } + if (data.dao_fork_support != null) { + message.dao_fork_support = data.dao_fork_support; + } + if (data.eip150_block != null) { + message.eip150_block = data.eip150_block; + } + if (data.eip150_hash != null) { + message.eip150_hash = data.eip150_hash; + } + if (data.eip155_block != null) { + message.eip155_block = data.eip155_block; + } + if (data.eip158_block != null) { + message.eip158_block = data.eip158_block; + } + if (data.byzantium_block != null) { + message.byzantium_block = data.byzantium_block; + } + if (data.constantinople_block != null) { + message.constantinople_block = data.constantinople_block; + } + if (data.petersburg_block != null) { + message.petersburg_block = data.petersburg_block; + } + if (data.istanbul_block != null) { + message.istanbul_block = data.istanbul_block; + } + if (data.muir_glacier_block != null) { + message.muir_glacier_block = data.muir_glacier_block; + } + if (data.berlin_block != null) { + message.berlin_block = data.berlin_block; + } + if (data.london_block != null) { + message.london_block = data.london_block; + } + if (data.arrow_glacier_block != null) { + message.arrow_glacier_block = data.arrow_glacier_block; + } + if (data.gray_glacier_block != null) { + message.gray_glacier_block = data.gray_glacier_block; + } + if (data.merge_netsplit_block != null) { + message.merge_netsplit_block = data.merge_netsplit_block; + } + if (data.shanghai_block != null) { + message.shanghai_block = data.shanghai_block; + } + if (data.cancun_block != null) { + message.cancun_block = data.cancun_block; + } + return message; + } + toObject() { + const data: { + homestead_block?: string; + dao_fork_block?: string; + dao_fork_support?: boolean; + eip150_block?: string; + eip150_hash?: string; + eip155_block?: string; + eip158_block?: string; + byzantium_block?: string; + constantinople_block?: string; + petersburg_block?: string; + istanbul_block?: string; + muir_glacier_block?: string; + berlin_block?: string; + london_block?: string; + arrow_glacier_block?: string; + gray_glacier_block?: string; + merge_netsplit_block?: string; + shanghai_block?: string; + cancun_block?: string; + } = {}; + if (this.homestead_block != null) { + data.homestead_block = this.homestead_block; + } + if (this.dao_fork_block != null) { + data.dao_fork_block = this.dao_fork_block; + } + if (this.dao_fork_support != null) { + data.dao_fork_support = this.dao_fork_support; + } + if (this.eip150_block != null) { + data.eip150_block = this.eip150_block; + } + if (this.eip150_hash != null) { + data.eip150_hash = this.eip150_hash; + } + if (this.eip155_block != null) { + data.eip155_block = this.eip155_block; + } + if (this.eip158_block != null) { + data.eip158_block = this.eip158_block; + } + if (this.byzantium_block != null) { + data.byzantium_block = this.byzantium_block; + } + if (this.constantinople_block != null) { + data.constantinople_block = this.constantinople_block; + } + if (this.petersburg_block != null) { + data.petersburg_block = this.petersburg_block; + } + if (this.istanbul_block != null) { + data.istanbul_block = this.istanbul_block; + } + if (this.muir_glacier_block != null) { + data.muir_glacier_block = this.muir_glacier_block; + } + if (this.berlin_block != null) { + data.berlin_block = this.berlin_block; + } + if (this.london_block != null) { + data.london_block = this.london_block; + } + if (this.arrow_glacier_block != null) { + data.arrow_glacier_block = this.arrow_glacier_block; + } + if (this.gray_glacier_block != null) { + data.gray_glacier_block = this.gray_glacier_block; + } + if (this.merge_netsplit_block != null) { + data.merge_netsplit_block = this.merge_netsplit_block; + } + if (this.shanghai_block != null) { + data.shanghai_block = this.shanghai_block; + } + if (this.cancun_block != null) { + data.cancun_block = this.cancun_block; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.homestead_block.length) + writer.writeString(1, this.homestead_block); + if (this.dao_fork_block.length) + writer.writeString(2, this.dao_fork_block); + if (this.dao_fork_support != false) + writer.writeBool(3, this.dao_fork_support); + if (this.eip150_block.length) + writer.writeString(4, this.eip150_block); + if (this.eip150_hash.length) + writer.writeString(5, this.eip150_hash); + if (this.eip155_block.length) + writer.writeString(6, this.eip155_block); + if (this.eip158_block.length) + writer.writeString(7, this.eip158_block); + if (this.byzantium_block.length) + writer.writeString(8, this.byzantium_block); + if (this.constantinople_block.length) + writer.writeString(9, this.constantinople_block); + if (this.petersburg_block.length) + writer.writeString(10, this.petersburg_block); + if (this.istanbul_block.length) + writer.writeString(11, this.istanbul_block); + if (this.muir_glacier_block.length) + writer.writeString(12, this.muir_glacier_block); + if (this.berlin_block.length) + writer.writeString(13, this.berlin_block); + if (this.london_block.length) + writer.writeString(17, this.london_block); + if (this.arrow_glacier_block.length) + writer.writeString(18, this.arrow_glacier_block); + if (this.gray_glacier_block.length) + writer.writeString(20, this.gray_glacier_block); + if (this.merge_netsplit_block.length) + writer.writeString(21, this.merge_netsplit_block); + if (this.shanghai_block.length) + writer.writeString(22, this.shanghai_block); + if (this.cancun_block.length) + writer.writeString(23, this.cancun_block); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ChainConfig { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ChainConfig(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.homestead_block = reader.readString(); + break; + case 2: + message.dao_fork_block = reader.readString(); + break; + case 3: + message.dao_fork_support = reader.readBool(); + break; + case 4: + message.eip150_block = reader.readString(); + break; + case 5: + message.eip150_hash = reader.readString(); + break; + case 6: + message.eip155_block = reader.readString(); + break; + case 7: + message.eip158_block = reader.readString(); + break; + case 8: + message.byzantium_block = reader.readString(); + break; + case 9: + message.constantinople_block = reader.readString(); + break; + case 10: + message.petersburg_block = reader.readString(); + break; + case 11: + message.istanbul_block = reader.readString(); + break; + case 12: + message.muir_glacier_block = reader.readString(); + break; + case 13: + message.berlin_block = reader.readString(); + break; + case 17: + message.london_block = reader.readString(); + break; + case 18: + message.arrow_glacier_block = reader.readString(); + break; + case 20: + message.gray_glacier_block = reader.readString(); + break; + case 21: + message.merge_netsplit_block = reader.readString(); + break; + case 22: + message.shanghai_block = reader.readString(); + break; + case 23: + message.cancun_block = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ChainConfig { + return ChainConfig.deserialize(bytes); + } + } + export class State extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + key?: string; + value?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("key" in data && data.key != undefined) { + this.key = data.key; + } + if ("value" in data && data.value != undefined) { + this.value = data.value; + } + } + } + get key() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set key(value: string) { + pb_1.Message.setField(this, 1, value); + } + get value() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set value(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + key?: string; + value?: string; + }): State { + const message = new State({}); + if (data.key != null) { + message.key = data.key; + } + if (data.value != null) { + message.value = data.value; + } + return message; + } + toObject() { + const data: { + key?: string; + value?: string; + } = {}; + if (this.key != null) { + data.key = this.key; + } + if (this.value != null) { + data.value = this.value; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.key.length) + writer.writeString(1, this.key); + if (this.value.length) + writer.writeString(2, this.value); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): State { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new State(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.key = reader.readString(); + break; + case 2: + message.value = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): State { + return State.deserialize(bytes); + } + } + export class TransactionLogs extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + hash?: string; + logs?: Log[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("hash" in data && data.hash != undefined) { + this.hash = data.hash; + } + if ("logs" in data && data.logs != undefined) { + this.logs = data.logs; + } + } + } + get hash() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set hash(value: string) { + pb_1.Message.setField(this, 1, value); + } + get logs() { + return pb_1.Message.getRepeatedWrapperField(this, Log, 2) as Log[]; + } + set logs(value: Log[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + static fromObject(data: { + hash?: string; + logs?: ReturnType[]; + }): TransactionLogs { + const message = new TransactionLogs({}); + if (data.hash != null) { + message.hash = data.hash; + } + if (data.logs != null) { + message.logs = data.logs.map(item => Log.fromObject(item)); + } + return message; + } + toObject() { + const data: { + hash?: string; + logs?: ReturnType[]; + } = {}; + if (this.hash != null) { + data.hash = this.hash; + } + if (this.logs != null) { + data.logs = this.logs.map((item: Log) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.hash.length) + writer.writeString(1, this.hash); + if (this.logs.length) + writer.writeRepeatedMessage(2, this.logs, (item: Log) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TransactionLogs { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TransactionLogs(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.hash = reader.readString(); + break; + case 2: + reader.readMessage(message.logs, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Log.deserialize(reader), Log)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): TransactionLogs { + return TransactionLogs.deserialize(bytes); + } + } + export class Log extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + address?: string; + topics?: string[]; + data?: Uint8Array; + block_number?: number; + tx_hash?: string; + tx_index?: number; + block_hash?: string; + index?: number; + removed?: boolean; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + if ("topics" in data && data.topics != undefined) { + this.topics = data.topics; + } + if ("data" in data && data.data != undefined) { + this.data = data.data; + } + if ("block_number" in data && data.block_number != undefined) { + this.block_number = data.block_number; + } + if ("tx_hash" in data && data.tx_hash != undefined) { + this.tx_hash = data.tx_hash; + } + if ("tx_index" in data && data.tx_index != undefined) { + this.tx_index = data.tx_index; + } + if ("block_hash" in data && data.block_hash != undefined) { + this.block_hash = data.block_hash; + } + if ("index" in data && data.index != undefined) { + this.index = data.index; + } + if ("removed" in data && data.removed != undefined) { + this.removed = data.removed; + } + } + } + get address() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set address(value: string) { + pb_1.Message.setField(this, 1, value); + } + get topics() { + return pb_1.Message.getFieldWithDefault(this, 2, []) as string[]; + } + set topics(value: string[]) { + pb_1.Message.setField(this, 2, value); + } + get data() { + return pb_1.Message.getFieldWithDefault(this, 3, new Uint8Array(0)) as Uint8Array; + } + set data(value: Uint8Array) { + pb_1.Message.setField(this, 3, value); + } + get block_number() { + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; + } + set block_number(value: number) { + pb_1.Message.setField(this, 4, value); + } + get tx_hash() { + return pb_1.Message.getFieldWithDefault(this, 5, "") as string; + } + set tx_hash(value: string) { + pb_1.Message.setField(this, 5, value); + } + get tx_index() { + return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; + } + set tx_index(value: number) { + pb_1.Message.setField(this, 6, value); + } + get block_hash() { + return pb_1.Message.getFieldWithDefault(this, 7, "") as string; + } + set block_hash(value: string) { + pb_1.Message.setField(this, 7, value); + } + get index() { + return pb_1.Message.getFieldWithDefault(this, 8, 0) as number; + } + set index(value: number) { + pb_1.Message.setField(this, 8, value); + } + get removed() { + return pb_1.Message.getFieldWithDefault(this, 9, false) as boolean; + } + set removed(value: boolean) { + pb_1.Message.setField(this, 9, value); + } + static fromObject(data: { + address?: string; + topics?: string[]; + data?: Uint8Array; + block_number?: number; + tx_hash?: string; + tx_index?: number; + block_hash?: string; + index?: number; + removed?: boolean; + }): Log { + const message = new Log({}); + if (data.address != null) { + message.address = data.address; + } + if (data.topics != null) { + message.topics = data.topics; + } + if (data.data != null) { + message.data = data.data; + } + if (data.block_number != null) { + message.block_number = data.block_number; + } + if (data.tx_hash != null) { + message.tx_hash = data.tx_hash; + } + if (data.tx_index != null) { + message.tx_index = data.tx_index; + } + if (data.block_hash != null) { + message.block_hash = data.block_hash; + } + if (data.index != null) { + message.index = data.index; + } + if (data.removed != null) { + message.removed = data.removed; + } + return message; + } + toObject() { + const data: { + address?: string; + topics?: string[]; + data?: Uint8Array; + block_number?: number; + tx_hash?: string; + tx_index?: number; + block_hash?: string; + index?: number; + removed?: boolean; + } = {}; + if (this.address != null) { + data.address = this.address; + } + if (this.topics != null) { + data.topics = this.topics; + } + if (this.data != null) { + data.data = this.data; + } + if (this.block_number != null) { + data.block_number = this.block_number; + } + if (this.tx_hash != null) { + data.tx_hash = this.tx_hash; + } + if (this.tx_index != null) { + data.tx_index = this.tx_index; + } + if (this.block_hash != null) { + data.block_hash = this.block_hash; + } + if (this.index != null) { + data.index = this.index; + } + if (this.removed != null) { + data.removed = this.removed; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.address.length) + writer.writeString(1, this.address); + if (this.topics.length) + writer.writeRepeatedString(2, this.topics); + if (this.data.length) + writer.writeBytes(3, this.data); + if (this.block_number != 0) + writer.writeUint64(4, this.block_number); + if (this.tx_hash.length) + writer.writeString(5, this.tx_hash); + if (this.tx_index != 0) + writer.writeUint64(6, this.tx_index); + if (this.block_hash.length) + writer.writeString(7, this.block_hash); + if (this.index != 0) + writer.writeUint64(8, this.index); + if (this.removed != false) + writer.writeBool(9, this.removed); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Log { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Log(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.address = reader.readString(); + break; + case 2: + pb_1.Message.addToRepeatedField(message, 2, reader.readString()); + break; + case 3: + message.data = reader.readBytes(); + break; + case 4: + message.block_number = reader.readUint64(); + break; + case 5: + message.tx_hash = reader.readString(); + break; + case 6: + message.tx_index = reader.readUint64(); + break; + case 7: + message.block_hash = reader.readString(); + break; + case 8: + message.index = reader.readUint64(); + break; + case 9: + message.removed = reader.readBool(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Log { + return Log.deserialize(bytes); + } + } + export class TxResult extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + contract_address?: string; + bloom?: Uint8Array; + tx_logs?: TransactionLogs; + ret?: Uint8Array; + reverted?: boolean; + gas_used?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("contract_address" in data && data.contract_address != undefined) { + this.contract_address = data.contract_address; + } + if ("bloom" in data && data.bloom != undefined) { + this.bloom = data.bloom; + } + if ("tx_logs" in data && data.tx_logs != undefined) { + this.tx_logs = data.tx_logs; + } + if ("ret" in data && data.ret != undefined) { + this.ret = data.ret; + } + if ("reverted" in data && data.reverted != undefined) { + this.reverted = data.reverted; + } + if ("gas_used" in data && data.gas_used != undefined) { + this.gas_used = data.gas_used; + } + } + } + get contract_address() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set contract_address(value: string) { + pb_1.Message.setField(this, 1, value); + } + get bloom() { + return pb_1.Message.getFieldWithDefault(this, 2, new Uint8Array(0)) as Uint8Array; + } + set bloom(value: Uint8Array) { + pb_1.Message.setField(this, 2, value); + } + get tx_logs() { + return pb_1.Message.getWrapperField(this, TransactionLogs, 3) as TransactionLogs; + } + set tx_logs(value: TransactionLogs) { + pb_1.Message.setWrapperField(this, 3, value); + } + get has_tx_logs() { + return pb_1.Message.getField(this, 3) != null; + } + get ret() { + return pb_1.Message.getFieldWithDefault(this, 4, new Uint8Array(0)) as Uint8Array; + } + set ret(value: Uint8Array) { + pb_1.Message.setField(this, 4, value); + } + get reverted() { + return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; + } + set reverted(value: boolean) { + pb_1.Message.setField(this, 5, value); + } + get gas_used() { + return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; + } + set gas_used(value: number) { + pb_1.Message.setField(this, 6, value); + } + static fromObject(data: { + contract_address?: string; + bloom?: Uint8Array; + tx_logs?: ReturnType; + ret?: Uint8Array; + reverted?: boolean; + gas_used?: number; + }): TxResult { + const message = new TxResult({}); + if (data.contract_address != null) { + message.contract_address = data.contract_address; + } + if (data.bloom != null) { + message.bloom = data.bloom; + } + if (data.tx_logs != null) { + message.tx_logs = TransactionLogs.fromObject(data.tx_logs); + } + if (data.ret != null) { + message.ret = data.ret; + } + if (data.reverted != null) { + message.reverted = data.reverted; + } + if (data.gas_used != null) { + message.gas_used = data.gas_used; + } + return message; + } + toObject() { + const data: { + contract_address?: string; + bloom?: Uint8Array; + tx_logs?: ReturnType; + ret?: Uint8Array; + reverted?: boolean; + gas_used?: number; + } = {}; + if (this.contract_address != null) { + data.contract_address = this.contract_address; + } + if (this.bloom != null) { + data.bloom = this.bloom; + } + if (this.tx_logs != null) { + data.tx_logs = this.tx_logs.toObject(); + } + if (this.ret != null) { + data.ret = this.ret; + } + if (this.reverted != null) { + data.reverted = this.reverted; + } + if (this.gas_used != null) { + data.gas_used = this.gas_used; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.contract_address.length) + writer.writeString(1, this.contract_address); + if (this.bloom.length) + writer.writeBytes(2, this.bloom); + if (this.has_tx_logs) + writer.writeMessage(3, this.tx_logs, () => this.tx_logs.serialize(writer)); + if (this.ret.length) + writer.writeBytes(4, this.ret); + if (this.reverted != false) + writer.writeBool(5, this.reverted); + if (this.gas_used != 0) + writer.writeUint64(6, this.gas_used); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TxResult { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TxResult(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.contract_address = reader.readString(); + break; + case 2: + message.bloom = reader.readBytes(); + break; + case 3: + reader.readMessage(message.tx_logs, () => message.tx_logs = TransactionLogs.deserialize(reader)); + break; + case 4: + message.ret = reader.readBytes(); + break; + case 5: + message.reverted = reader.readBool(); + break; + case 6: + message.gas_used = reader.readUint64(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): TxResult { + return TxResult.deserialize(bytes); + } + } + export class AccessTuple extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + address?: string; + storage_keys?: string[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + if ("storage_keys" in data && data.storage_keys != undefined) { + this.storage_keys = data.storage_keys; + } + } + } + get address() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set address(value: string) { + pb_1.Message.setField(this, 1, value); + } + get storage_keys() { + return pb_1.Message.getFieldWithDefault(this, 2, []) as string[]; + } + set storage_keys(value: string[]) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + address?: string; + storage_keys?: string[]; + }): AccessTuple { + const message = new AccessTuple({}); + if (data.address != null) { + message.address = data.address; + } + if (data.storage_keys != null) { + message.storage_keys = data.storage_keys; + } + return message; + } + toObject() { + const data: { + address?: string; + storage_keys?: string[]; + } = {}; + if (this.address != null) { + data.address = this.address; + } + if (this.storage_keys != null) { + data.storage_keys = this.storage_keys; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.address.length) + writer.writeString(1, this.address); + if (this.storage_keys.length) + writer.writeRepeatedString(2, this.storage_keys); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AccessTuple { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AccessTuple(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.address = reader.readString(); + break; + case 2: + pb_1.Message.addToRepeatedField(message, 2, reader.readString()); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AccessTuple { + return AccessTuple.deserialize(bytes); + } + } + export class TraceConfig extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + tracer?: string; + timeout?: string; + reexec?: number; + disable_stack?: boolean; + disable_storage?: boolean; + debug?: boolean; + limit?: number; + overrides?: ChainConfig; + enable_memory?: boolean; + enable_return_data?: boolean; + tracer_json_config?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("tracer" in data && data.tracer != undefined) { + this.tracer = data.tracer; + } + if ("timeout" in data && data.timeout != undefined) { + this.timeout = data.timeout; + } + if ("reexec" in data && data.reexec != undefined) { + this.reexec = data.reexec; + } + if ("disable_stack" in data && data.disable_stack != undefined) { + this.disable_stack = data.disable_stack; + } + if ("disable_storage" in data && data.disable_storage != undefined) { + this.disable_storage = data.disable_storage; + } + if ("debug" in data && data.debug != undefined) { + this.debug = data.debug; + } + if ("limit" in data && data.limit != undefined) { + this.limit = data.limit; + } + if ("overrides" in data && data.overrides != undefined) { + this.overrides = data.overrides; + } + if ("enable_memory" in data && data.enable_memory != undefined) { + this.enable_memory = data.enable_memory; + } + if ("enable_return_data" in data && data.enable_return_data != undefined) { + this.enable_return_data = data.enable_return_data; + } + if ("tracer_json_config" in data && data.tracer_json_config != undefined) { + this.tracer_json_config = data.tracer_json_config; + } + } + } + get tracer() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set tracer(value: string) { + pb_1.Message.setField(this, 1, value); + } + get timeout() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set timeout(value: string) { + pb_1.Message.setField(this, 2, value); + } + get reexec() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set reexec(value: number) { + pb_1.Message.setField(this, 3, value); + } + get disable_stack() { + return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; + } + set disable_stack(value: boolean) { + pb_1.Message.setField(this, 5, value); + } + get disable_storage() { + return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean; + } + set disable_storage(value: boolean) { + pb_1.Message.setField(this, 6, value); + } + get debug() { + return pb_1.Message.getFieldWithDefault(this, 8, false) as boolean; + } + set debug(value: boolean) { + pb_1.Message.setField(this, 8, value); + } + get limit() { + return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; + } + set limit(value: number) { + pb_1.Message.setField(this, 9, value); + } + get overrides() { + return pb_1.Message.getWrapperField(this, ChainConfig, 10) as ChainConfig; + } + set overrides(value: ChainConfig) { + pb_1.Message.setWrapperField(this, 10, value); + } + get has_overrides() { + return pb_1.Message.getField(this, 10) != null; + } + get enable_memory() { + return pb_1.Message.getFieldWithDefault(this, 11, false) as boolean; + } + set enable_memory(value: boolean) { + pb_1.Message.setField(this, 11, value); + } + get enable_return_data() { + return pb_1.Message.getFieldWithDefault(this, 12, false) as boolean; + } + set enable_return_data(value: boolean) { + pb_1.Message.setField(this, 12, value); + } + get tracer_json_config() { + return pb_1.Message.getFieldWithDefault(this, 13, "") as string; + } + set tracer_json_config(value: string) { + pb_1.Message.setField(this, 13, value); + } + static fromObject(data: { + tracer?: string; + timeout?: string; + reexec?: number; + disable_stack?: boolean; + disable_storage?: boolean; + debug?: boolean; + limit?: number; + overrides?: ReturnType; + enable_memory?: boolean; + enable_return_data?: boolean; + tracer_json_config?: string; + }): TraceConfig { + const message = new TraceConfig({}); + if (data.tracer != null) { + message.tracer = data.tracer; + } + if (data.timeout != null) { + message.timeout = data.timeout; + } + if (data.reexec != null) { + message.reexec = data.reexec; + } + if (data.disable_stack != null) { + message.disable_stack = data.disable_stack; + } + if (data.disable_storage != null) { + message.disable_storage = data.disable_storage; + } + if (data.debug != null) { + message.debug = data.debug; + } + if (data.limit != null) { + message.limit = data.limit; + } + if (data.overrides != null) { + message.overrides = ChainConfig.fromObject(data.overrides); + } + if (data.enable_memory != null) { + message.enable_memory = data.enable_memory; + } + if (data.enable_return_data != null) { + message.enable_return_data = data.enable_return_data; + } + if (data.tracer_json_config != null) { + message.tracer_json_config = data.tracer_json_config; + } + return message; + } + toObject() { + const data: { + tracer?: string; + timeout?: string; + reexec?: number; + disable_stack?: boolean; + disable_storage?: boolean; + debug?: boolean; + limit?: number; + overrides?: ReturnType; + enable_memory?: boolean; + enable_return_data?: boolean; + tracer_json_config?: string; + } = {}; + if (this.tracer != null) { + data.tracer = this.tracer; + } + if (this.timeout != null) { + data.timeout = this.timeout; + } + if (this.reexec != null) { + data.reexec = this.reexec; + } + if (this.disable_stack != null) { + data.disable_stack = this.disable_stack; + } + if (this.disable_storage != null) { + data.disable_storage = this.disable_storage; + } + if (this.debug != null) { + data.debug = this.debug; + } + if (this.limit != null) { + data.limit = this.limit; + } + if (this.overrides != null) { + data.overrides = this.overrides.toObject(); + } + if (this.enable_memory != null) { + data.enable_memory = this.enable_memory; + } + if (this.enable_return_data != null) { + data.enable_return_data = this.enable_return_data; + } + if (this.tracer_json_config != null) { + data.tracer_json_config = this.tracer_json_config; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.tracer.length) + writer.writeString(1, this.tracer); + if (this.timeout.length) + writer.writeString(2, this.timeout); + if (this.reexec != 0) + writer.writeUint64(3, this.reexec); + if (this.disable_stack != false) + writer.writeBool(5, this.disable_stack); + if (this.disable_storage != false) + writer.writeBool(6, this.disable_storage); + if (this.debug != false) + writer.writeBool(8, this.debug); + if (this.limit != 0) + writer.writeInt32(9, this.limit); + if (this.has_overrides) + writer.writeMessage(10, this.overrides, () => this.overrides.serialize(writer)); + if (this.enable_memory != false) + writer.writeBool(11, this.enable_memory); + if (this.enable_return_data != false) + writer.writeBool(12, this.enable_return_data); + if (this.tracer_json_config.length) + writer.writeString(13, this.tracer_json_config); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TraceConfig { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TraceConfig(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.tracer = reader.readString(); + break; + case 2: + message.timeout = reader.readString(); + break; + case 3: + message.reexec = reader.readUint64(); + break; + case 5: + message.disable_stack = reader.readBool(); + break; + case 6: + message.disable_storage = reader.readBool(); + break; + case 8: + message.debug = reader.readBool(); + break; + case 9: + message.limit = reader.readInt32(); + break; + case 10: + reader.readMessage(message.overrides, () => message.overrides = ChainConfig.deserialize(reader)); + break; + case 11: + message.enable_memory = reader.readBool(); + break; + case 12: + message.enable_return_data = reader.readBool(); + break; + case 13: + message.tracer_json_config = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): TraceConfig { + return TraceConfig.deserialize(bytes); + } + } +} diff --git a/src/proto/ethermint/evm/v1/genesis.ts b/src/proto/ethermint/evm/v1/genesis.ts new file mode 100644 index 0000000..a855c27 --- /dev/null +++ b/src/proto/ethermint/evm/v1/genesis.ts @@ -0,0 +1,218 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.12.4 + * source: ethermint/evm/v1/genesis.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./evm"; +import * as dependency_2 from "./../../../gogoproto/gogo"; +import * as pb_1 from "google-protobuf"; +export namespace ethermint.evm.v1 { + export class GenesisState extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + accounts?: GenesisAccount[]; + params?: dependency_1.ethermint.evm.v1.Params; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("accounts" in data && data.accounts != undefined) { + this.accounts = data.accounts; + } + if ("params" in data && data.params != undefined) { + this.params = data.params; + } + } + } + get accounts() { + return pb_1.Message.getRepeatedWrapperField(this, GenesisAccount, 1) as GenesisAccount[]; + } + set accounts(value: GenesisAccount[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get params() { + return pb_1.Message.getWrapperField(this, dependency_1.ethermint.evm.v1.Params, 2) as dependency_1.ethermint.evm.v1.Params; + } + set params(value: dependency_1.ethermint.evm.v1.Params) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_params() { + return pb_1.Message.getField(this, 2) != null; + } + static fromObject(data: { + accounts?: ReturnType[]; + params?: ReturnType; + }): GenesisState { + const message = new GenesisState({}); + if (data.accounts != null) { + message.accounts = data.accounts.map(item => GenesisAccount.fromObject(item)); + } + if (data.params != null) { + message.params = dependency_1.ethermint.evm.v1.Params.fromObject(data.params); + } + return message; + } + toObject() { + const data: { + accounts?: ReturnType[]; + params?: ReturnType; + } = {}; + if (this.accounts != null) { + data.accounts = this.accounts.map((item: GenesisAccount) => item.toObject()); + } + if (this.params != null) { + data.params = this.params.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.accounts.length) + writer.writeRepeatedMessage(1, this.accounts, (item: GenesisAccount) => item.serialize(writer)); + if (this.has_params) + writer.writeMessage(2, this.params, () => this.params.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenesisState { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenesisState(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.accounts, () => pb_1.Message.addToRepeatedWrapperField(message, 1, GenesisAccount.deserialize(reader), GenesisAccount)); + break; + case 2: + reader.readMessage(message.params, () => message.params = dependency_1.ethermint.evm.v1.Params.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GenesisState { + return GenesisState.deserialize(bytes); + } + } + export class GenesisAccount extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + address?: string; + code?: string; + storage?: dependency_1.ethermint.evm.v1.State[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + if ("storage" in data && data.storage != undefined) { + this.storage = data.storage; + } + } + } + get address() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set address(value: string) { + pb_1.Message.setField(this, 1, value); + } + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + get storage() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.ethermint.evm.v1.State, 3) as dependency_1.ethermint.evm.v1.State[]; + } + set storage(value: dependency_1.ethermint.evm.v1.State[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + static fromObject(data: { + address?: string; + code?: string; + storage?: ReturnType[]; + }): GenesisAccount { + const message = new GenesisAccount({}); + if (data.address != null) { + message.address = data.address; + } + if (data.code != null) { + message.code = data.code; + } + if (data.storage != null) { + message.storage = data.storage.map(item => dependency_1.ethermint.evm.v1.State.fromObject(item)); + } + return message; + } + toObject() { + const data: { + address?: string; + code?: string; + storage?: ReturnType[]; + } = {}; + if (this.address != null) { + data.address = this.address; + } + if (this.code != null) { + data.code = this.code; + } + if (this.storage != null) { + data.storage = this.storage.map((item: dependency_1.ethermint.evm.v1.State) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.address.length) + writer.writeString(1, this.address); + if (this.code.length) + writer.writeString(2, this.code); + if (this.storage.length) + writer.writeRepeatedMessage(3, this.storage, (item: dependency_1.ethermint.evm.v1.State) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenesisAccount { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenesisAccount(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.address = reader.readString(); + break; + case 2: + message.code = reader.readString(); + break; + case 3: + reader.readMessage(message.storage, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_1.ethermint.evm.v1.State.deserialize(reader), dependency_1.ethermint.evm.v1.State)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GenesisAccount { + return GenesisAccount.deserialize(bytes); + } + } +} diff --git a/src/proto/ethermint/evm/v1/query.ts b/src/proto/ethermint/evm/v1/query.ts new file mode 100644 index 0000000..df49ea5 --- /dev/null +++ b/src/proto/ethermint/evm/v1/query.ts @@ -0,0 +1,2169 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.12.4 + * source: ethermint/evm/v1/query.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../cosmos/base/query/v1beta1/pagination"; +import * as dependency_2 from "./evm"; +import * as dependency_3 from "./tx"; +import * as dependency_4 from "./../../../gogoproto/gogo"; +import * as dependency_5 from "./../../../google/api/annotations"; +import * as dependency_6 from "./../../../google/protobuf/timestamp"; +import * as pb_1 from "google-protobuf"; +export namespace ethermint.evm.v1 { + export class QueryAccountRequest extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + address?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + } + } + get address() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set address(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + address?: string; + }): QueryAccountRequest { + const message = new QueryAccountRequest({}); + if (data.address != null) { + message.address = data.address; + } + return message; + } + toObject() { + const data: { + address?: string; + } = {}; + if (this.address != null) { + data.address = this.address; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.address.length) + writer.writeString(1, this.address); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryAccountRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryAccountRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.address = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryAccountRequest { + return QueryAccountRequest.deserialize(bytes); + } + } + export class QueryAccountResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + balance?: string; + code_hash?: string; + nonce?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("balance" in data && data.balance != undefined) { + this.balance = data.balance; + } + if ("code_hash" in data && data.code_hash != undefined) { + this.code_hash = data.code_hash; + } + if ("nonce" in data && data.nonce != undefined) { + this.nonce = data.nonce; + } + } + } + get balance() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set balance(value: string) { + pb_1.Message.setField(this, 1, value); + } + get code_hash() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set code_hash(value: string) { + pb_1.Message.setField(this, 2, value); + } + get nonce() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set nonce(value: number) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + balance?: string; + code_hash?: string; + nonce?: number; + }): QueryAccountResponse { + const message = new QueryAccountResponse({}); + if (data.balance != null) { + message.balance = data.balance; + } + if (data.code_hash != null) { + message.code_hash = data.code_hash; + } + if (data.nonce != null) { + message.nonce = data.nonce; + } + return message; + } + toObject() { + const data: { + balance?: string; + code_hash?: string; + nonce?: number; + } = {}; + if (this.balance != null) { + data.balance = this.balance; + } + if (this.code_hash != null) { + data.code_hash = this.code_hash; + } + if (this.nonce != null) { + data.nonce = this.nonce; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.balance.length) + writer.writeString(1, this.balance); + if (this.code_hash.length) + writer.writeString(2, this.code_hash); + if (this.nonce != 0) + writer.writeUint64(3, this.nonce); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryAccountResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryAccountResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.balance = reader.readString(); + break; + case 2: + message.code_hash = reader.readString(); + break; + case 3: + message.nonce = reader.readUint64(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryAccountResponse { + return QueryAccountResponse.deserialize(bytes); + } + } + export class QueryCosmosAccountRequest extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + address?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + } + } + get address() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set address(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + address?: string; + }): QueryCosmosAccountRequest { + const message = new QueryCosmosAccountRequest({}); + if (data.address != null) { + message.address = data.address; + } + return message; + } + toObject() { + const data: { + address?: string; + } = {}; + if (this.address != null) { + data.address = this.address; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.address.length) + writer.writeString(1, this.address); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryCosmosAccountRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryCosmosAccountRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.address = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryCosmosAccountRequest { + return QueryCosmosAccountRequest.deserialize(bytes); + } + } + export class QueryCosmosAccountResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + cosmos_address?: string; + sequence?: number; + account_number?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("cosmos_address" in data && data.cosmos_address != undefined) { + this.cosmos_address = data.cosmos_address; + } + if ("sequence" in data && data.sequence != undefined) { + this.sequence = data.sequence; + } + if ("account_number" in data && data.account_number != undefined) { + this.account_number = data.account_number; + } + } + } + get cosmos_address() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set cosmos_address(value: string) { + pb_1.Message.setField(this, 1, value); + } + get sequence() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set sequence(value: number) { + pb_1.Message.setField(this, 2, value); + } + get account_number() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set account_number(value: number) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + cosmos_address?: string; + sequence?: number; + account_number?: number; + }): QueryCosmosAccountResponse { + const message = new QueryCosmosAccountResponse({}); + if (data.cosmos_address != null) { + message.cosmos_address = data.cosmos_address; + } + if (data.sequence != null) { + message.sequence = data.sequence; + } + if (data.account_number != null) { + message.account_number = data.account_number; + } + return message; + } + toObject() { + const data: { + cosmos_address?: string; + sequence?: number; + account_number?: number; + } = {}; + if (this.cosmos_address != null) { + data.cosmos_address = this.cosmos_address; + } + if (this.sequence != null) { + data.sequence = this.sequence; + } + if (this.account_number != null) { + data.account_number = this.account_number; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.cosmos_address.length) + writer.writeString(1, this.cosmos_address); + if (this.sequence != 0) + writer.writeUint64(2, this.sequence); + if (this.account_number != 0) + writer.writeUint64(3, this.account_number); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryCosmosAccountResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryCosmosAccountResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.cosmos_address = reader.readString(); + break; + case 2: + message.sequence = reader.readUint64(); + break; + case 3: + message.account_number = reader.readUint64(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryCosmosAccountResponse { + return QueryCosmosAccountResponse.deserialize(bytes); + } + } + export class QueryValidatorAccountRequest extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + cons_address?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("cons_address" in data && data.cons_address != undefined) { + this.cons_address = data.cons_address; + } + } + } + get cons_address() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set cons_address(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + cons_address?: string; + }): QueryValidatorAccountRequest { + const message = new QueryValidatorAccountRequest({}); + if (data.cons_address != null) { + message.cons_address = data.cons_address; + } + return message; + } + toObject() { + const data: { + cons_address?: string; + } = {}; + if (this.cons_address != null) { + data.cons_address = this.cons_address; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.cons_address.length) + writer.writeString(1, this.cons_address); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryValidatorAccountRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryValidatorAccountRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.cons_address = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryValidatorAccountRequest { + return QueryValidatorAccountRequest.deserialize(bytes); + } + } + export class QueryValidatorAccountResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + account_address?: string; + sequence?: number; + account_number?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("account_address" in data && data.account_address != undefined) { + this.account_address = data.account_address; + } + if ("sequence" in data && data.sequence != undefined) { + this.sequence = data.sequence; + } + if ("account_number" in data && data.account_number != undefined) { + this.account_number = data.account_number; + } + } + } + get account_address() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set account_address(value: string) { + pb_1.Message.setField(this, 1, value); + } + get sequence() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set sequence(value: number) { + pb_1.Message.setField(this, 2, value); + } + get account_number() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set account_number(value: number) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + account_address?: string; + sequence?: number; + account_number?: number; + }): QueryValidatorAccountResponse { + const message = new QueryValidatorAccountResponse({}); + if (data.account_address != null) { + message.account_address = data.account_address; + } + if (data.sequence != null) { + message.sequence = data.sequence; + } + if (data.account_number != null) { + message.account_number = data.account_number; + } + return message; + } + toObject() { + const data: { + account_address?: string; + sequence?: number; + account_number?: number; + } = {}; + if (this.account_address != null) { + data.account_address = this.account_address; + } + if (this.sequence != null) { + data.sequence = this.sequence; + } + if (this.account_number != null) { + data.account_number = this.account_number; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.account_address.length) + writer.writeString(1, this.account_address); + if (this.sequence != 0) + writer.writeUint64(2, this.sequence); + if (this.account_number != 0) + writer.writeUint64(3, this.account_number); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryValidatorAccountResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryValidatorAccountResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.account_address = reader.readString(); + break; + case 2: + message.sequence = reader.readUint64(); + break; + case 3: + message.account_number = reader.readUint64(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryValidatorAccountResponse { + return QueryValidatorAccountResponse.deserialize(bytes); + } + } + export class QueryBalanceRequest extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + address?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + } + } + get address() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set address(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + address?: string; + }): QueryBalanceRequest { + const message = new QueryBalanceRequest({}); + if (data.address != null) { + message.address = data.address; + } + return message; + } + toObject() { + const data: { + address?: string; + } = {}; + if (this.address != null) { + data.address = this.address; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.address.length) + writer.writeString(1, this.address); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryBalanceRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryBalanceRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.address = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryBalanceRequest { + return QueryBalanceRequest.deserialize(bytes); + } + } + export class QueryBalanceResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + balance?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("balance" in data && data.balance != undefined) { + this.balance = data.balance; + } + } + } + get balance() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set balance(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + balance?: string; + }): QueryBalanceResponse { + const message = new QueryBalanceResponse({}); + if (data.balance != null) { + message.balance = data.balance; + } + return message; + } + toObject() { + const data: { + balance?: string; + } = {}; + if (this.balance != null) { + data.balance = this.balance; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.balance.length) + writer.writeString(1, this.balance); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryBalanceResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryBalanceResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.balance = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryBalanceResponse { + return QueryBalanceResponse.deserialize(bytes); + } + } + export class QueryStorageRequest extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + address?: string; + key?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + if ("key" in data && data.key != undefined) { + this.key = data.key; + } + } + } + get address() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set address(value: string) { + pb_1.Message.setField(this, 1, value); + } + get key() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set key(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + address?: string; + key?: string; + }): QueryStorageRequest { + const message = new QueryStorageRequest({}); + if (data.address != null) { + message.address = data.address; + } + if (data.key != null) { + message.key = data.key; + } + return message; + } + toObject() { + const data: { + address?: string; + key?: string; + } = {}; + if (this.address != null) { + data.address = this.address; + } + if (this.key != null) { + data.key = this.key; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.address.length) + writer.writeString(1, this.address); + if (this.key.length) + writer.writeString(2, this.key); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryStorageRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryStorageRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.address = reader.readString(); + break; + case 2: + message.key = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryStorageRequest { + return QueryStorageRequest.deserialize(bytes); + } + } + export class QueryStorageResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + value?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("value" in data && data.value != undefined) { + this.value = data.value; + } + } + } + get value() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set value(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + value?: string; + }): QueryStorageResponse { + const message = new QueryStorageResponse({}); + if (data.value != null) { + message.value = data.value; + } + return message; + } + toObject() { + const data: { + value?: string; + } = {}; + if (this.value != null) { + data.value = this.value; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.value.length) + writer.writeString(1, this.value); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryStorageResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryStorageResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.value = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryStorageResponse { + return QueryStorageResponse.deserialize(bytes); + } + } + export class QueryCodeRequest extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + address?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + } + } + get address() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set address(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + address?: string; + }): QueryCodeRequest { + const message = new QueryCodeRequest({}); + if (data.address != null) { + message.address = data.address; + } + return message; + } + toObject() { + const data: { + address?: string; + } = {}; + if (this.address != null) { + data.address = this.address; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.address.length) + writer.writeString(1, this.address); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryCodeRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryCodeRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.address = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryCodeRequest { + return QueryCodeRequest.deserialize(bytes); + } + } + export class QueryCodeResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + code?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + } + } + get code() { + return pb_1.Message.getFieldWithDefault(this, 1, new Uint8Array(0)) as Uint8Array; + } + set code(value: Uint8Array) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + code?: Uint8Array; + }): QueryCodeResponse { + const message = new QueryCodeResponse({}); + if (data.code != null) { + message.code = data.code; + } + return message; + } + toObject() { + const data: { + code?: Uint8Array; + } = {}; + if (this.code != null) { + data.code = this.code; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.code.length) + writer.writeBytes(1, this.code); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryCodeResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryCodeResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.code = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryCodeResponse { + return QueryCodeResponse.deserialize(bytes); + } + } + export class QueryTxLogsRequest extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + hash?: string; + pagination?: dependency_1.cosmos.base.query.v1beta1.PageRequest; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("hash" in data && data.hash != undefined) { + this.hash = data.hash; + } + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get hash() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set hash(value: string) { + pb_1.Message.setField(this, 1, value); + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_1.cosmos.base.query.v1beta1.PageRequest, 2) as dependency_1.cosmos.base.query.v1beta1.PageRequest; + } + set pagination(value: dependency_1.cosmos.base.query.v1beta1.PageRequest) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_pagination() { + return pb_1.Message.getField(this, 2) != null; + } + static fromObject(data: { + hash?: string; + pagination?: ReturnType; + }): QueryTxLogsRequest { + const message = new QueryTxLogsRequest({}); + if (data.hash != null) { + message.hash = data.hash; + } + if (data.pagination != null) { + message.pagination = dependency_1.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + hash?: string; + pagination?: ReturnType; + } = {}; + if (this.hash != null) { + data.hash = this.hash; + } + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.hash.length) + writer.writeString(1, this.hash); + if (this.has_pagination) + writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryTxLogsRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryTxLogsRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.hash = reader.readString(); + break; + case 2: + reader.readMessage(message.pagination, () => message.pagination = dependency_1.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryTxLogsRequest { + return QueryTxLogsRequest.deserialize(bytes); + } + } + export class QueryTxLogsResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + logs?: dependency_2.ethermint.evm.v1.Log[]; + pagination?: dependency_1.cosmos.base.query.v1beta1.PageResponse; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("logs" in data && data.logs != undefined) { + this.logs = data.logs; + } + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get logs() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.ethermint.evm.v1.Log, 1) as dependency_2.ethermint.evm.v1.Log[]; + } + set logs(value: dependency_2.ethermint.evm.v1.Log[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_1.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_1.cosmos.base.query.v1beta1.PageResponse; + } + set pagination(value: dependency_1.cosmos.base.query.v1beta1.PageResponse) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_pagination() { + return pb_1.Message.getField(this, 2) != null; + } + static fromObject(data: { + logs?: ReturnType[]; + pagination?: ReturnType; + }): QueryTxLogsResponse { + const message = new QueryTxLogsResponse({}); + if (data.logs != null) { + message.logs = data.logs.map(item => dependency_2.ethermint.evm.v1.Log.fromObject(item)); + } + if (data.pagination != null) { + message.pagination = dependency_1.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + logs?: ReturnType[]; + pagination?: ReturnType; + } = {}; + if (this.logs != null) { + data.logs = this.logs.map((item: dependency_2.ethermint.evm.v1.Log) => item.toObject()); + } + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.logs.length) + writer.writeRepeatedMessage(1, this.logs, (item: dependency_2.ethermint.evm.v1.Log) => item.serialize(writer)); + if (this.has_pagination) + writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryTxLogsResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryTxLogsResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.logs, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_2.ethermint.evm.v1.Log.deserialize(reader), dependency_2.ethermint.evm.v1.Log)); + break; + case 2: + reader.readMessage(message.pagination, () => message.pagination = dependency_1.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryTxLogsResponse { + return QueryTxLogsResponse.deserialize(bytes); + } + } + export class QueryParamsRequest extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}): QueryParamsRequest { + const message = new QueryParamsRequest({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryParamsRequest { + return QueryParamsRequest.deserialize(bytes); + } + } + export class QueryParamsResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + params?: dependency_2.ethermint.evm.v1.Params; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("params" in data && data.params != undefined) { + this.params = data.params; + } + } + } + get params() { + return pb_1.Message.getWrapperField(this, dependency_2.ethermint.evm.v1.Params, 1) as dependency_2.ethermint.evm.v1.Params; + } + set params(value: dependency_2.ethermint.evm.v1.Params) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_params() { + return pb_1.Message.getField(this, 1) != null; + } + static fromObject(data: { + params?: ReturnType; + }): QueryParamsResponse { + const message = new QueryParamsResponse({}); + if (data.params != null) { + message.params = dependency_2.ethermint.evm.v1.Params.fromObject(data.params); + } + return message; + } + toObject() { + const data: { + params?: ReturnType; + } = {}; + if (this.params != null) { + data.params = this.params.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_params) + writer.writeMessage(1, this.params, () => this.params.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.params, () => message.params = dependency_2.ethermint.evm.v1.Params.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryParamsResponse { + return QueryParamsResponse.deserialize(bytes); + } + } + export class EthCallRequest extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + args?: Uint8Array; + gas_cap?: number; + proposer_address?: Uint8Array; + chain_id?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("args" in data && data.args != undefined) { + this.args = data.args; + } + if ("gas_cap" in data && data.gas_cap != undefined) { + this.gas_cap = data.gas_cap; + } + if ("proposer_address" in data && data.proposer_address != undefined) { + this.proposer_address = data.proposer_address; + } + if ("chain_id" in data && data.chain_id != undefined) { + this.chain_id = data.chain_id; + } + } + } + get args() { + return pb_1.Message.getFieldWithDefault(this, 1, new Uint8Array(0)) as Uint8Array; + } + set args(value: Uint8Array) { + pb_1.Message.setField(this, 1, value); + } + get gas_cap() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set gas_cap(value: number) { + pb_1.Message.setField(this, 2, value); + } + get proposer_address() { + return pb_1.Message.getFieldWithDefault(this, 3, new Uint8Array(0)) as Uint8Array; + } + set proposer_address(value: Uint8Array) { + pb_1.Message.setField(this, 3, value); + } + get chain_id() { + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; + } + set chain_id(value: number) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + args?: Uint8Array; + gas_cap?: number; + proposer_address?: Uint8Array; + chain_id?: number; + }): EthCallRequest { + const message = new EthCallRequest({}); + if (data.args != null) { + message.args = data.args; + } + if (data.gas_cap != null) { + message.gas_cap = data.gas_cap; + } + if (data.proposer_address != null) { + message.proposer_address = data.proposer_address; + } + if (data.chain_id != null) { + message.chain_id = data.chain_id; + } + return message; + } + toObject() { + const data: { + args?: Uint8Array; + gas_cap?: number; + proposer_address?: Uint8Array; + chain_id?: number; + } = {}; + if (this.args != null) { + data.args = this.args; + } + if (this.gas_cap != null) { + data.gas_cap = this.gas_cap; + } + if (this.proposer_address != null) { + data.proposer_address = this.proposer_address; + } + if (this.chain_id != null) { + data.chain_id = this.chain_id; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.args.length) + writer.writeBytes(1, this.args); + if (this.gas_cap != 0) + writer.writeUint64(2, this.gas_cap); + if (this.proposer_address.length) + writer.writeBytes(3, this.proposer_address); + if (this.chain_id != 0) + writer.writeInt64(4, this.chain_id); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EthCallRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EthCallRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.args = reader.readBytes(); + break; + case 2: + message.gas_cap = reader.readUint64(); + break; + case 3: + message.proposer_address = reader.readBytes(); + break; + case 4: + message.chain_id = reader.readInt64(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): EthCallRequest { + return EthCallRequest.deserialize(bytes); + } + } + export class EstimateGasResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + gas?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("gas" in data && data.gas != undefined) { + this.gas = data.gas; + } + } + } + get gas() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + } + set gas(value: number) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + gas?: number; + }): EstimateGasResponse { + const message = new EstimateGasResponse({}); + if (data.gas != null) { + message.gas = data.gas; + } + return message; + } + toObject() { + const data: { + gas?: number; + } = {}; + if (this.gas != null) { + data.gas = this.gas; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.gas != 0) + writer.writeUint64(1, this.gas); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EstimateGasResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EstimateGasResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.gas = reader.readUint64(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): EstimateGasResponse { + return EstimateGasResponse.deserialize(bytes); + } + } + export class QueryTraceTxRequest extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + msg?: dependency_3.ethermint.evm.v1.MsgEthereumTx; + trace_config?: dependency_2.ethermint.evm.v1.TraceConfig; + predecessors?: dependency_3.ethermint.evm.v1.MsgEthereumTx[]; + block_number?: number; + block_hash?: string; + block_time?: dependency_6.google.protobuf.Timestamp; + proposer_address?: Uint8Array; + chain_id?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("msg" in data && data.msg != undefined) { + this.msg = data.msg; + } + if ("trace_config" in data && data.trace_config != undefined) { + this.trace_config = data.trace_config; + } + if ("predecessors" in data && data.predecessors != undefined) { + this.predecessors = data.predecessors; + } + if ("block_number" in data && data.block_number != undefined) { + this.block_number = data.block_number; + } + if ("block_hash" in data && data.block_hash != undefined) { + this.block_hash = data.block_hash; + } + if ("block_time" in data && data.block_time != undefined) { + this.block_time = data.block_time; + } + if ("proposer_address" in data && data.proposer_address != undefined) { + this.proposer_address = data.proposer_address; + } + if ("chain_id" in data && data.chain_id != undefined) { + this.chain_id = data.chain_id; + } + } + } + get msg() { + return pb_1.Message.getWrapperField(this, dependency_3.ethermint.evm.v1.MsgEthereumTx, 1) as dependency_3.ethermint.evm.v1.MsgEthereumTx; + } + set msg(value: dependency_3.ethermint.evm.v1.MsgEthereumTx) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_msg() { + return pb_1.Message.getField(this, 1) != null; + } + get trace_config() { + return pb_1.Message.getWrapperField(this, dependency_2.ethermint.evm.v1.TraceConfig, 3) as dependency_2.ethermint.evm.v1.TraceConfig; + } + set trace_config(value: dependency_2.ethermint.evm.v1.TraceConfig) { + pb_1.Message.setWrapperField(this, 3, value); + } + get has_trace_config() { + return pb_1.Message.getField(this, 3) != null; + } + get predecessors() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_3.ethermint.evm.v1.MsgEthereumTx, 4) as dependency_3.ethermint.evm.v1.MsgEthereumTx[]; + } + set predecessors(value: dependency_3.ethermint.evm.v1.MsgEthereumTx[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + get block_number() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set block_number(value: number) { + pb_1.Message.setField(this, 5, value); + } + get block_hash() { + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; + } + set block_hash(value: string) { + pb_1.Message.setField(this, 6, value); + } + get block_time() { + return pb_1.Message.getWrapperField(this, dependency_6.google.protobuf.Timestamp, 7) as dependency_6.google.protobuf.Timestamp; + } + set block_time(value: dependency_6.google.protobuf.Timestamp) { + pb_1.Message.setWrapperField(this, 7, value); + } + get has_block_time() { + return pb_1.Message.getField(this, 7) != null; + } + get proposer_address() { + return pb_1.Message.getFieldWithDefault(this, 8, new Uint8Array(0)) as Uint8Array; + } + set proposer_address(value: Uint8Array) { + pb_1.Message.setField(this, 8, value); + } + get chain_id() { + return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; + } + set chain_id(value: number) { + pb_1.Message.setField(this, 9, value); + } + static fromObject(data: { + msg?: ReturnType; + trace_config?: ReturnType; + predecessors?: ReturnType[]; + block_number?: number; + block_hash?: string; + block_time?: ReturnType; + proposer_address?: Uint8Array; + chain_id?: number; + }): QueryTraceTxRequest { + const message = new QueryTraceTxRequest({}); + if (data.msg != null) { + message.msg = dependency_3.ethermint.evm.v1.MsgEthereumTx.fromObject(data.msg); + } + if (data.trace_config != null) { + message.trace_config = dependency_2.ethermint.evm.v1.TraceConfig.fromObject(data.trace_config); + } + if (data.predecessors != null) { + message.predecessors = data.predecessors.map(item => dependency_3.ethermint.evm.v1.MsgEthereumTx.fromObject(item)); + } + if (data.block_number != null) { + message.block_number = data.block_number; + } + if (data.block_hash != null) { + message.block_hash = data.block_hash; + } + if (data.block_time != null) { + message.block_time = dependency_6.google.protobuf.Timestamp.fromObject(data.block_time); + } + if (data.proposer_address != null) { + message.proposer_address = data.proposer_address; + } + if (data.chain_id != null) { + message.chain_id = data.chain_id; + } + return message; + } + toObject() { + const data: { + msg?: ReturnType; + trace_config?: ReturnType; + predecessors?: ReturnType[]; + block_number?: number; + block_hash?: string; + block_time?: ReturnType; + proposer_address?: Uint8Array; + chain_id?: number; + } = {}; + if (this.msg != null) { + data.msg = this.msg.toObject(); + } + if (this.trace_config != null) { + data.trace_config = this.trace_config.toObject(); + } + if (this.predecessors != null) { + data.predecessors = this.predecessors.map((item: dependency_3.ethermint.evm.v1.MsgEthereumTx) => item.toObject()); + } + if (this.block_number != null) { + data.block_number = this.block_number; + } + if (this.block_hash != null) { + data.block_hash = this.block_hash; + } + if (this.block_time != null) { + data.block_time = this.block_time.toObject(); + } + if (this.proposer_address != null) { + data.proposer_address = this.proposer_address; + } + if (this.chain_id != null) { + data.chain_id = this.chain_id; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_msg) + writer.writeMessage(1, this.msg, () => this.msg.serialize(writer)); + if (this.has_trace_config) + writer.writeMessage(3, this.trace_config, () => this.trace_config.serialize(writer)); + if (this.predecessors.length) + writer.writeRepeatedMessage(4, this.predecessors, (item: dependency_3.ethermint.evm.v1.MsgEthereumTx) => item.serialize(writer)); + if (this.block_number != 0) + writer.writeInt64(5, this.block_number); + if (this.block_hash.length) + writer.writeString(6, this.block_hash); + if (this.has_block_time) + writer.writeMessage(7, this.block_time, () => this.block_time.serialize(writer)); + if (this.proposer_address.length) + writer.writeBytes(8, this.proposer_address); + if (this.chain_id != 0) + writer.writeInt64(9, this.chain_id); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryTraceTxRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryTraceTxRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.msg, () => message.msg = dependency_3.ethermint.evm.v1.MsgEthereumTx.deserialize(reader)); + break; + case 3: + reader.readMessage(message.trace_config, () => message.trace_config = dependency_2.ethermint.evm.v1.TraceConfig.deserialize(reader)); + break; + case 4: + reader.readMessage(message.predecessors, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_3.ethermint.evm.v1.MsgEthereumTx.deserialize(reader), dependency_3.ethermint.evm.v1.MsgEthereumTx)); + break; + case 5: + message.block_number = reader.readInt64(); + break; + case 6: + message.block_hash = reader.readString(); + break; + case 7: + reader.readMessage(message.block_time, () => message.block_time = dependency_6.google.protobuf.Timestamp.deserialize(reader)); + break; + case 8: + message.proposer_address = reader.readBytes(); + break; + case 9: + message.chain_id = reader.readInt64(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryTraceTxRequest { + return QueryTraceTxRequest.deserialize(bytes); + } + } + export class QueryTraceTxResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + data?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("data" in data && data.data != undefined) { + this.data = data.data; + } + } + } + get data() { + return pb_1.Message.getFieldWithDefault(this, 1, new Uint8Array(0)) as Uint8Array; + } + set data(value: Uint8Array) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + data?: Uint8Array; + }): QueryTraceTxResponse { + const message = new QueryTraceTxResponse({}); + if (data.data != null) { + message.data = data.data; + } + return message; + } + toObject() { + const data: { + data?: Uint8Array; + } = {}; + if (this.data != null) { + data.data = this.data; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.data.length) + writer.writeBytes(1, this.data); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryTraceTxResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryTraceTxResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.data = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryTraceTxResponse { + return QueryTraceTxResponse.deserialize(bytes); + } + } + export class QueryTraceBlockRequest extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + txs?: dependency_3.ethermint.evm.v1.MsgEthereumTx[]; + trace_config?: dependency_2.ethermint.evm.v1.TraceConfig; + block_number?: number; + block_hash?: string; + block_time?: dependency_6.google.protobuf.Timestamp; + proposer_address?: Uint8Array; + chain_id?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("txs" in data && data.txs != undefined) { + this.txs = data.txs; + } + if ("trace_config" in data && data.trace_config != undefined) { + this.trace_config = data.trace_config; + } + if ("block_number" in data && data.block_number != undefined) { + this.block_number = data.block_number; + } + if ("block_hash" in data && data.block_hash != undefined) { + this.block_hash = data.block_hash; + } + if ("block_time" in data && data.block_time != undefined) { + this.block_time = data.block_time; + } + if ("proposer_address" in data && data.proposer_address != undefined) { + this.proposer_address = data.proposer_address; + } + if ("chain_id" in data && data.chain_id != undefined) { + this.chain_id = data.chain_id; + } + } + } + get txs() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_3.ethermint.evm.v1.MsgEthereumTx, 1) as dependency_3.ethermint.evm.v1.MsgEthereumTx[]; + } + set txs(value: dependency_3.ethermint.evm.v1.MsgEthereumTx[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get trace_config() { + return pb_1.Message.getWrapperField(this, dependency_2.ethermint.evm.v1.TraceConfig, 3) as dependency_2.ethermint.evm.v1.TraceConfig; + } + set trace_config(value: dependency_2.ethermint.evm.v1.TraceConfig) { + pb_1.Message.setWrapperField(this, 3, value); + } + get has_trace_config() { + return pb_1.Message.getField(this, 3) != null; + } + get block_number() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set block_number(value: number) { + pb_1.Message.setField(this, 5, value); + } + get block_hash() { + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; + } + set block_hash(value: string) { + pb_1.Message.setField(this, 6, value); + } + get block_time() { + return pb_1.Message.getWrapperField(this, dependency_6.google.protobuf.Timestamp, 7) as dependency_6.google.protobuf.Timestamp; + } + set block_time(value: dependency_6.google.protobuf.Timestamp) { + pb_1.Message.setWrapperField(this, 7, value); + } + get has_block_time() { + return pb_1.Message.getField(this, 7) != null; + } + get proposer_address() { + return pb_1.Message.getFieldWithDefault(this, 8, new Uint8Array(0)) as Uint8Array; + } + set proposer_address(value: Uint8Array) { + pb_1.Message.setField(this, 8, value); + } + get chain_id() { + return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; + } + set chain_id(value: number) { + pb_1.Message.setField(this, 9, value); + } + static fromObject(data: { + txs?: ReturnType[]; + trace_config?: ReturnType; + block_number?: number; + block_hash?: string; + block_time?: ReturnType; + proposer_address?: Uint8Array; + chain_id?: number; + }): QueryTraceBlockRequest { + const message = new QueryTraceBlockRequest({}); + if (data.txs != null) { + message.txs = data.txs.map(item => dependency_3.ethermint.evm.v1.MsgEthereumTx.fromObject(item)); + } + if (data.trace_config != null) { + message.trace_config = dependency_2.ethermint.evm.v1.TraceConfig.fromObject(data.trace_config); + } + if (data.block_number != null) { + message.block_number = data.block_number; + } + if (data.block_hash != null) { + message.block_hash = data.block_hash; + } + if (data.block_time != null) { + message.block_time = dependency_6.google.protobuf.Timestamp.fromObject(data.block_time); + } + if (data.proposer_address != null) { + message.proposer_address = data.proposer_address; + } + if (data.chain_id != null) { + message.chain_id = data.chain_id; + } + return message; + } + toObject() { + const data: { + txs?: ReturnType[]; + trace_config?: ReturnType; + block_number?: number; + block_hash?: string; + block_time?: ReturnType; + proposer_address?: Uint8Array; + chain_id?: number; + } = {}; + if (this.txs != null) { + data.txs = this.txs.map((item: dependency_3.ethermint.evm.v1.MsgEthereumTx) => item.toObject()); + } + if (this.trace_config != null) { + data.trace_config = this.trace_config.toObject(); + } + if (this.block_number != null) { + data.block_number = this.block_number; + } + if (this.block_hash != null) { + data.block_hash = this.block_hash; + } + if (this.block_time != null) { + data.block_time = this.block_time.toObject(); + } + if (this.proposer_address != null) { + data.proposer_address = this.proposer_address; + } + if (this.chain_id != null) { + data.chain_id = this.chain_id; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.txs.length) + writer.writeRepeatedMessage(1, this.txs, (item: dependency_3.ethermint.evm.v1.MsgEthereumTx) => item.serialize(writer)); + if (this.has_trace_config) + writer.writeMessage(3, this.trace_config, () => this.trace_config.serialize(writer)); + if (this.block_number != 0) + writer.writeInt64(5, this.block_number); + if (this.block_hash.length) + writer.writeString(6, this.block_hash); + if (this.has_block_time) + writer.writeMessage(7, this.block_time, () => this.block_time.serialize(writer)); + if (this.proposer_address.length) + writer.writeBytes(8, this.proposer_address); + if (this.chain_id != 0) + writer.writeInt64(9, this.chain_id); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryTraceBlockRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryTraceBlockRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.txs, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_3.ethermint.evm.v1.MsgEthereumTx.deserialize(reader), dependency_3.ethermint.evm.v1.MsgEthereumTx)); + break; + case 3: + reader.readMessage(message.trace_config, () => message.trace_config = dependency_2.ethermint.evm.v1.TraceConfig.deserialize(reader)); + break; + case 5: + message.block_number = reader.readInt64(); + break; + case 6: + message.block_hash = reader.readString(); + break; + case 7: + reader.readMessage(message.block_time, () => message.block_time = dependency_6.google.protobuf.Timestamp.deserialize(reader)); + break; + case 8: + message.proposer_address = reader.readBytes(); + break; + case 9: + message.chain_id = reader.readInt64(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryTraceBlockRequest { + return QueryTraceBlockRequest.deserialize(bytes); + } + } + export class QueryTraceBlockResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + data?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("data" in data && data.data != undefined) { + this.data = data.data; + } + } + } + get data() { + return pb_1.Message.getFieldWithDefault(this, 1, new Uint8Array(0)) as Uint8Array; + } + set data(value: Uint8Array) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + data?: Uint8Array; + }): QueryTraceBlockResponse { + const message = new QueryTraceBlockResponse({}); + if (data.data != null) { + message.data = data.data; + } + return message; + } + toObject() { + const data: { + data?: Uint8Array; + } = {}; + if (this.data != null) { + data.data = this.data; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.data.length) + writer.writeBytes(1, this.data); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryTraceBlockResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryTraceBlockResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.data = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryTraceBlockResponse { + return QueryTraceBlockResponse.deserialize(bytes); + } + } + export class QueryBaseFeeRequest extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}): QueryBaseFeeRequest { + const message = new QueryBaseFeeRequest({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryBaseFeeRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryBaseFeeRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryBaseFeeRequest { + return QueryBaseFeeRequest.deserialize(bytes); + } + } + export class QueryBaseFeeResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + base_fee?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("base_fee" in data && data.base_fee != undefined) { + this.base_fee = data.base_fee; + } + } + } + get base_fee() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set base_fee(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + base_fee?: string; + }): QueryBaseFeeResponse { + const message = new QueryBaseFeeResponse({}); + if (data.base_fee != null) { + message.base_fee = data.base_fee; + } + return message; + } + toObject() { + const data: { + base_fee?: string; + } = {}; + if (this.base_fee != null) { + data.base_fee = this.base_fee; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.base_fee.length) + writer.writeString(1, this.base_fee); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryBaseFeeResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryBaseFeeResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.base_fee = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryBaseFeeResponse { + return QueryBaseFeeResponse.deserialize(bytes); + } + } +} diff --git a/src/proto/ethermint/evm/v1/tx.ts b/src/proto/ethermint/evm/v1/tx.ts new file mode 100644 index 0000000..192e1bb --- /dev/null +++ b/src/proto/ethermint/evm/v1/tx.ts @@ -0,0 +1,1221 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.12.4 + * source: ethermint/evm/v1/tx.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../cosmos_proto/cosmos"; +import * as dependency_2 from "./evm"; +import * as dependency_3 from "./../../../gogoproto/gogo"; +import * as dependency_4 from "./../../../google/api/annotations"; +import * as dependency_5 from "./../../../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace ethermint.evm.v1 { + export class MsgEthereumTx extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + data?: dependency_5.google.protobuf.Any; + size?: number; + hash?: string; + from?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("data" in data && data.data != undefined) { + this.data = data.data; + } + if ("size" in data && data.size != undefined) { + this.size = data.size; + } + if ("hash" in data && data.hash != undefined) { + this.hash = data.hash; + } + if ("from" in data && data.from != undefined) { + this.from = data.from; + } + } + } + get data() { + return pb_1.Message.getWrapperField(this, dependency_5.google.protobuf.Any, 1) as dependency_5.google.protobuf.Any; + } + set data(value: dependency_5.google.protobuf.Any) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_data() { + return pb_1.Message.getField(this, 1) != null; + } + get size() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set size(value: number) { + pb_1.Message.setField(this, 2, value); + } + get hash() { + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; + } + set hash(value: string) { + pb_1.Message.setField(this, 3, value); + } + get from() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set from(value: string) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + data?: ReturnType; + size?: number; + hash?: string; + from?: string; + }): MsgEthereumTx { + const message = new MsgEthereumTx({}); + if (data.data != null) { + message.data = dependency_5.google.protobuf.Any.fromObject(data.data); + } + if (data.size != null) { + message.size = data.size; + } + if (data.hash != null) { + message.hash = data.hash; + } + if (data.from != null) { + message.from = data.from; + } + return message; + } + toObject() { + const data: { + data?: ReturnType; + size?: number; + hash?: string; + from?: string; + } = {}; + if (this.data != null) { + data.data = this.data.toObject(); + } + if (this.size != null) { + data.size = this.size; + } + if (this.hash != null) { + data.hash = this.hash; + } + if (this.from != null) { + data.from = this.from; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_data) + writer.writeMessage(1, this.data, () => this.data.serialize(writer)); + if (this.size != 0) + writer.writeDouble(2, this.size); + if (this.hash.length) + writer.writeString(3, this.hash); + if (this.from.length) + writer.writeString(4, this.from); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgEthereumTx { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgEthereumTx(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.data, () => message.data = dependency_5.google.protobuf.Any.deserialize(reader)); + break; + case 2: + message.size = reader.readDouble(); + break; + case 3: + message.hash = reader.readString(); + break; + case 4: + message.from = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgEthereumTx { + return MsgEthereumTx.deserialize(bytes); + } + } + export class LegacyTx extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + nonce?: number; + gas_price?: string; + gas?: number; + to?: string; + value?: string; + data?: Uint8Array; + v?: Uint8Array; + r?: Uint8Array; + s?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("nonce" in data && data.nonce != undefined) { + this.nonce = data.nonce; + } + if ("gas_price" in data && data.gas_price != undefined) { + this.gas_price = data.gas_price; + } + if ("gas" in data && data.gas != undefined) { + this.gas = data.gas; + } + if ("to" in data && data.to != undefined) { + this.to = data.to; + } + if ("value" in data && data.value != undefined) { + this.value = data.value; + } + if ("data" in data && data.data != undefined) { + this.data = data.data; + } + if ("v" in data && data.v != undefined) { + this.v = data.v; + } + if ("r" in data && data.r != undefined) { + this.r = data.r; + } + if ("s" in data && data.s != undefined) { + this.s = data.s; + } + } + } + get nonce() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + } + set nonce(value: number) { + pb_1.Message.setField(this, 1, value); + } + get gas_price() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set gas_price(value: string) { + pb_1.Message.setField(this, 2, value); + } + get gas() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set gas(value: number) { + pb_1.Message.setField(this, 3, value); + } + get to() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set to(value: string) { + pb_1.Message.setField(this, 4, value); + } + get value() { + return pb_1.Message.getFieldWithDefault(this, 5, "") as string; + } + set value(value: string) { + pb_1.Message.setField(this, 5, value); + } + get data() { + return pb_1.Message.getFieldWithDefault(this, 6, new Uint8Array(0)) as Uint8Array; + } + set data(value: Uint8Array) { + pb_1.Message.setField(this, 6, value); + } + get v() { + return pb_1.Message.getFieldWithDefault(this, 7, new Uint8Array(0)) as Uint8Array; + } + set v(value: Uint8Array) { + pb_1.Message.setField(this, 7, value); + } + get r() { + return pb_1.Message.getFieldWithDefault(this, 8, new Uint8Array(0)) as Uint8Array; + } + set r(value: Uint8Array) { + pb_1.Message.setField(this, 8, value); + } + get s() { + return pb_1.Message.getFieldWithDefault(this, 9, new Uint8Array(0)) as Uint8Array; + } + set s(value: Uint8Array) { + pb_1.Message.setField(this, 9, value); + } + static fromObject(data: { + nonce?: number; + gas_price?: string; + gas?: number; + to?: string; + value?: string; + data?: Uint8Array; + v?: Uint8Array; + r?: Uint8Array; + s?: Uint8Array; + }): LegacyTx { + const message = new LegacyTx({}); + if (data.nonce != null) { + message.nonce = data.nonce; + } + if (data.gas_price != null) { + message.gas_price = data.gas_price; + } + if (data.gas != null) { + message.gas = data.gas; + } + if (data.to != null) { + message.to = data.to; + } + if (data.value != null) { + message.value = data.value; + } + if (data.data != null) { + message.data = data.data; + } + if (data.v != null) { + message.v = data.v; + } + if (data.r != null) { + message.r = data.r; + } + if (data.s != null) { + message.s = data.s; + } + return message; + } + toObject() { + const data: { + nonce?: number; + gas_price?: string; + gas?: number; + to?: string; + value?: string; + data?: Uint8Array; + v?: Uint8Array; + r?: Uint8Array; + s?: Uint8Array; + } = {}; + if (this.nonce != null) { + data.nonce = this.nonce; + } + if (this.gas_price != null) { + data.gas_price = this.gas_price; + } + if (this.gas != null) { + data.gas = this.gas; + } + if (this.to != null) { + data.to = this.to; + } + if (this.value != null) { + data.value = this.value; + } + if (this.data != null) { + data.data = this.data; + } + if (this.v != null) { + data.v = this.v; + } + if (this.r != null) { + data.r = this.r; + } + if (this.s != null) { + data.s = this.s; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.nonce != 0) + writer.writeUint64(1, this.nonce); + if (this.gas_price.length) + writer.writeString(2, this.gas_price); + if (this.gas != 0) + writer.writeUint64(3, this.gas); + if (this.to.length) + writer.writeString(4, this.to); + if (this.value.length) + writer.writeString(5, this.value); + if (this.data.length) + writer.writeBytes(6, this.data); + if (this.v.length) + writer.writeBytes(7, this.v); + if (this.r.length) + writer.writeBytes(8, this.r); + if (this.s.length) + writer.writeBytes(9, this.s); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): LegacyTx { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new LegacyTx(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.nonce = reader.readUint64(); + break; + case 2: + message.gas_price = reader.readString(); + break; + case 3: + message.gas = reader.readUint64(); + break; + case 4: + message.to = reader.readString(); + break; + case 5: + message.value = reader.readString(); + break; + case 6: + message.data = reader.readBytes(); + break; + case 7: + message.v = reader.readBytes(); + break; + case 8: + message.r = reader.readBytes(); + break; + case 9: + message.s = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): LegacyTx { + return LegacyTx.deserialize(bytes); + } + } + export class AccessListTx extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + chain_id?: string; + nonce?: number; + gas_price?: string; + gas?: number; + to?: string; + value?: string; + data?: Uint8Array; + accesses?: dependency_2.ethermint.evm.v1.AccessTuple[]; + v?: Uint8Array; + r?: Uint8Array; + s?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [8], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("chain_id" in data && data.chain_id != undefined) { + this.chain_id = data.chain_id; + } + if ("nonce" in data && data.nonce != undefined) { + this.nonce = data.nonce; + } + if ("gas_price" in data && data.gas_price != undefined) { + this.gas_price = data.gas_price; + } + if ("gas" in data && data.gas != undefined) { + this.gas = data.gas; + } + if ("to" in data && data.to != undefined) { + this.to = data.to; + } + if ("value" in data && data.value != undefined) { + this.value = data.value; + } + if ("data" in data && data.data != undefined) { + this.data = data.data; + } + if ("accesses" in data && data.accesses != undefined) { + this.accesses = data.accesses; + } + if ("v" in data && data.v != undefined) { + this.v = data.v; + } + if ("r" in data && data.r != undefined) { + this.r = data.r; + } + if ("s" in data && data.s != undefined) { + this.s = data.s; + } + } + } + get chain_id() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set chain_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get nonce() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set nonce(value: number) { + pb_1.Message.setField(this, 2, value); + } + get gas_price() { + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; + } + set gas_price(value: string) { + pb_1.Message.setField(this, 3, value); + } + get gas() { + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; + } + set gas(value: number) { + pb_1.Message.setField(this, 4, value); + } + get to() { + return pb_1.Message.getFieldWithDefault(this, 5, "") as string; + } + set to(value: string) { + pb_1.Message.setField(this, 5, value); + } + get value() { + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; + } + set value(value: string) { + pb_1.Message.setField(this, 6, value); + } + get data() { + return pb_1.Message.getFieldWithDefault(this, 7, new Uint8Array(0)) as Uint8Array; + } + set data(value: Uint8Array) { + pb_1.Message.setField(this, 7, value); + } + get accesses() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.ethermint.evm.v1.AccessTuple, 8) as dependency_2.ethermint.evm.v1.AccessTuple[]; + } + set accesses(value: dependency_2.ethermint.evm.v1.AccessTuple[]) { + pb_1.Message.setRepeatedWrapperField(this, 8, value); + } + get v() { + return pb_1.Message.getFieldWithDefault(this, 9, new Uint8Array(0)) as Uint8Array; + } + set v(value: Uint8Array) { + pb_1.Message.setField(this, 9, value); + } + get r() { + return pb_1.Message.getFieldWithDefault(this, 10, new Uint8Array(0)) as Uint8Array; + } + set r(value: Uint8Array) { + pb_1.Message.setField(this, 10, value); + } + get s() { + return pb_1.Message.getFieldWithDefault(this, 11, new Uint8Array(0)) as Uint8Array; + } + set s(value: Uint8Array) { + pb_1.Message.setField(this, 11, value); + } + static fromObject(data: { + chain_id?: string; + nonce?: number; + gas_price?: string; + gas?: number; + to?: string; + value?: string; + data?: Uint8Array; + accesses?: ReturnType[]; + v?: Uint8Array; + r?: Uint8Array; + s?: Uint8Array; + }): AccessListTx { + const message = new AccessListTx({}); + if (data.chain_id != null) { + message.chain_id = data.chain_id; + } + if (data.nonce != null) { + message.nonce = data.nonce; + } + if (data.gas_price != null) { + message.gas_price = data.gas_price; + } + if (data.gas != null) { + message.gas = data.gas; + } + if (data.to != null) { + message.to = data.to; + } + if (data.value != null) { + message.value = data.value; + } + if (data.data != null) { + message.data = data.data; + } + if (data.accesses != null) { + message.accesses = data.accesses.map(item => dependency_2.ethermint.evm.v1.AccessTuple.fromObject(item)); + } + if (data.v != null) { + message.v = data.v; + } + if (data.r != null) { + message.r = data.r; + } + if (data.s != null) { + message.s = data.s; + } + return message; + } + toObject() { + const data: { + chain_id?: string; + nonce?: number; + gas_price?: string; + gas?: number; + to?: string; + value?: string; + data?: Uint8Array; + accesses?: ReturnType[]; + v?: Uint8Array; + r?: Uint8Array; + s?: Uint8Array; + } = {}; + if (this.chain_id != null) { + data.chain_id = this.chain_id; + } + if (this.nonce != null) { + data.nonce = this.nonce; + } + if (this.gas_price != null) { + data.gas_price = this.gas_price; + } + if (this.gas != null) { + data.gas = this.gas; + } + if (this.to != null) { + data.to = this.to; + } + if (this.value != null) { + data.value = this.value; + } + if (this.data != null) { + data.data = this.data; + } + if (this.accesses != null) { + data.accesses = this.accesses.map((item: dependency_2.ethermint.evm.v1.AccessTuple) => item.toObject()); + } + if (this.v != null) { + data.v = this.v; + } + if (this.r != null) { + data.r = this.r; + } + if (this.s != null) { + data.s = this.s; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.chain_id.length) + writer.writeString(1, this.chain_id); + if (this.nonce != 0) + writer.writeUint64(2, this.nonce); + if (this.gas_price.length) + writer.writeString(3, this.gas_price); + if (this.gas != 0) + writer.writeUint64(4, this.gas); + if (this.to.length) + writer.writeString(5, this.to); + if (this.value.length) + writer.writeString(6, this.value); + if (this.data.length) + writer.writeBytes(7, this.data); + if (this.accesses.length) + writer.writeRepeatedMessage(8, this.accesses, (item: dependency_2.ethermint.evm.v1.AccessTuple) => item.serialize(writer)); + if (this.v.length) + writer.writeBytes(9, this.v); + if (this.r.length) + writer.writeBytes(10, this.r); + if (this.s.length) + writer.writeBytes(11, this.s); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AccessListTx { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AccessListTx(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.chain_id = reader.readString(); + break; + case 2: + message.nonce = reader.readUint64(); + break; + case 3: + message.gas_price = reader.readString(); + break; + case 4: + message.gas = reader.readUint64(); + break; + case 5: + message.to = reader.readString(); + break; + case 6: + message.value = reader.readString(); + break; + case 7: + message.data = reader.readBytes(); + break; + case 8: + reader.readMessage(message.accesses, () => pb_1.Message.addToRepeatedWrapperField(message, 8, dependency_2.ethermint.evm.v1.AccessTuple.deserialize(reader), dependency_2.ethermint.evm.v1.AccessTuple)); + break; + case 9: + message.v = reader.readBytes(); + break; + case 10: + message.r = reader.readBytes(); + break; + case 11: + message.s = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AccessListTx { + return AccessListTx.deserialize(bytes); + } + } + export class DynamicFeeTx extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + chain_id?: string; + nonce?: number; + gas_tip_cap?: string; + gas_fee_cap?: string; + gas?: number; + to?: string; + value?: string; + data?: Uint8Array; + accesses?: dependency_2.ethermint.evm.v1.AccessTuple[]; + v?: Uint8Array; + r?: Uint8Array; + s?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [9], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("chain_id" in data && data.chain_id != undefined) { + this.chain_id = data.chain_id; + } + if ("nonce" in data && data.nonce != undefined) { + this.nonce = data.nonce; + } + if ("gas_tip_cap" in data && data.gas_tip_cap != undefined) { + this.gas_tip_cap = data.gas_tip_cap; + } + if ("gas_fee_cap" in data && data.gas_fee_cap != undefined) { + this.gas_fee_cap = data.gas_fee_cap; + } + if ("gas" in data && data.gas != undefined) { + this.gas = data.gas; + } + if ("to" in data && data.to != undefined) { + this.to = data.to; + } + if ("value" in data && data.value != undefined) { + this.value = data.value; + } + if ("data" in data && data.data != undefined) { + this.data = data.data; + } + if ("accesses" in data && data.accesses != undefined) { + this.accesses = data.accesses; + } + if ("v" in data && data.v != undefined) { + this.v = data.v; + } + if ("r" in data && data.r != undefined) { + this.r = data.r; + } + if ("s" in data && data.s != undefined) { + this.s = data.s; + } + } + } + get chain_id() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set chain_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get nonce() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set nonce(value: number) { + pb_1.Message.setField(this, 2, value); + } + get gas_tip_cap() { + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; + } + set gas_tip_cap(value: string) { + pb_1.Message.setField(this, 3, value); + } + get gas_fee_cap() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set gas_fee_cap(value: string) { + pb_1.Message.setField(this, 4, value); + } + get gas() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set gas(value: number) { + pb_1.Message.setField(this, 5, value); + } + get to() { + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; + } + set to(value: string) { + pb_1.Message.setField(this, 6, value); + } + get value() { + return pb_1.Message.getFieldWithDefault(this, 7, "") as string; + } + set value(value: string) { + pb_1.Message.setField(this, 7, value); + } + get data() { + return pb_1.Message.getFieldWithDefault(this, 8, new Uint8Array(0)) as Uint8Array; + } + set data(value: Uint8Array) { + pb_1.Message.setField(this, 8, value); + } + get accesses() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.ethermint.evm.v1.AccessTuple, 9) as dependency_2.ethermint.evm.v1.AccessTuple[]; + } + set accesses(value: dependency_2.ethermint.evm.v1.AccessTuple[]) { + pb_1.Message.setRepeatedWrapperField(this, 9, value); + } + get v() { + return pb_1.Message.getFieldWithDefault(this, 10, new Uint8Array(0)) as Uint8Array; + } + set v(value: Uint8Array) { + pb_1.Message.setField(this, 10, value); + } + get r() { + return pb_1.Message.getFieldWithDefault(this, 11, new Uint8Array(0)) as Uint8Array; + } + set r(value: Uint8Array) { + pb_1.Message.setField(this, 11, value); + } + get s() { + return pb_1.Message.getFieldWithDefault(this, 12, new Uint8Array(0)) as Uint8Array; + } + set s(value: Uint8Array) { + pb_1.Message.setField(this, 12, value); + } + static fromObject(data: { + chain_id?: string; + nonce?: number; + gas_tip_cap?: string; + gas_fee_cap?: string; + gas?: number; + to?: string; + value?: string; + data?: Uint8Array; + accesses?: ReturnType[]; + v?: Uint8Array; + r?: Uint8Array; + s?: Uint8Array; + }): DynamicFeeTx { + const message = new DynamicFeeTx({}); + if (data.chain_id != null) { + message.chain_id = data.chain_id; + } + if (data.nonce != null) { + message.nonce = data.nonce; + } + if (data.gas_tip_cap != null) { + message.gas_tip_cap = data.gas_tip_cap; + } + if (data.gas_fee_cap != null) { + message.gas_fee_cap = data.gas_fee_cap; + } + if (data.gas != null) { + message.gas = data.gas; + } + if (data.to != null) { + message.to = data.to; + } + if (data.value != null) { + message.value = data.value; + } + if (data.data != null) { + message.data = data.data; + } + if (data.accesses != null) { + message.accesses = data.accesses.map(item => dependency_2.ethermint.evm.v1.AccessTuple.fromObject(item)); + } + if (data.v != null) { + message.v = data.v; + } + if (data.r != null) { + message.r = data.r; + } + if (data.s != null) { + message.s = data.s; + } + return message; + } + toObject() { + const data: { + chain_id?: string; + nonce?: number; + gas_tip_cap?: string; + gas_fee_cap?: string; + gas?: number; + to?: string; + value?: string; + data?: Uint8Array; + accesses?: ReturnType[]; + v?: Uint8Array; + r?: Uint8Array; + s?: Uint8Array; + } = {}; + if (this.chain_id != null) { + data.chain_id = this.chain_id; + } + if (this.nonce != null) { + data.nonce = this.nonce; + } + if (this.gas_tip_cap != null) { + data.gas_tip_cap = this.gas_tip_cap; + } + if (this.gas_fee_cap != null) { + data.gas_fee_cap = this.gas_fee_cap; + } + if (this.gas != null) { + data.gas = this.gas; + } + if (this.to != null) { + data.to = this.to; + } + if (this.value != null) { + data.value = this.value; + } + if (this.data != null) { + data.data = this.data; + } + if (this.accesses != null) { + data.accesses = this.accesses.map((item: dependency_2.ethermint.evm.v1.AccessTuple) => item.toObject()); + } + if (this.v != null) { + data.v = this.v; + } + if (this.r != null) { + data.r = this.r; + } + if (this.s != null) { + data.s = this.s; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.chain_id.length) + writer.writeString(1, this.chain_id); + if (this.nonce != 0) + writer.writeUint64(2, this.nonce); + if (this.gas_tip_cap.length) + writer.writeString(3, this.gas_tip_cap); + if (this.gas_fee_cap.length) + writer.writeString(4, this.gas_fee_cap); + if (this.gas != 0) + writer.writeUint64(5, this.gas); + if (this.to.length) + writer.writeString(6, this.to); + if (this.value.length) + writer.writeString(7, this.value); + if (this.data.length) + writer.writeBytes(8, this.data); + if (this.accesses.length) + writer.writeRepeatedMessage(9, this.accesses, (item: dependency_2.ethermint.evm.v1.AccessTuple) => item.serialize(writer)); + if (this.v.length) + writer.writeBytes(10, this.v); + if (this.r.length) + writer.writeBytes(11, this.r); + if (this.s.length) + writer.writeBytes(12, this.s); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DynamicFeeTx { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DynamicFeeTx(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.chain_id = reader.readString(); + break; + case 2: + message.nonce = reader.readUint64(); + break; + case 3: + message.gas_tip_cap = reader.readString(); + break; + case 4: + message.gas_fee_cap = reader.readString(); + break; + case 5: + message.gas = reader.readUint64(); + break; + case 6: + message.to = reader.readString(); + break; + case 7: + message.value = reader.readString(); + break; + case 8: + message.data = reader.readBytes(); + break; + case 9: + reader.readMessage(message.accesses, () => pb_1.Message.addToRepeatedWrapperField(message, 9, dependency_2.ethermint.evm.v1.AccessTuple.deserialize(reader), dependency_2.ethermint.evm.v1.AccessTuple)); + break; + case 10: + message.v = reader.readBytes(); + break; + case 11: + message.r = reader.readBytes(); + break; + case 12: + message.s = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DynamicFeeTx { + return DynamicFeeTx.deserialize(bytes); + } + } + export class ExtensionOptionsEthereumTx extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}): ExtensionOptionsEthereumTx { + const message = new ExtensionOptionsEthereumTx({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ExtensionOptionsEthereumTx { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ExtensionOptionsEthereumTx(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ExtensionOptionsEthereumTx { + return ExtensionOptionsEthereumTx.deserialize(bytes); + } + } + export class MsgEthereumTxResponse extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + hash?: string; + logs?: dependency_2.ethermint.evm.v1.Log[]; + ret?: Uint8Array; + vm_error?: string; + gas_used?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("hash" in data && data.hash != undefined) { + this.hash = data.hash; + } + if ("logs" in data && data.logs != undefined) { + this.logs = data.logs; + } + if ("ret" in data && data.ret != undefined) { + this.ret = data.ret; + } + if ("vm_error" in data && data.vm_error != undefined) { + this.vm_error = data.vm_error; + } + if ("gas_used" in data && data.gas_used != undefined) { + this.gas_used = data.gas_used; + } + } + } + get hash() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set hash(value: string) { + pb_1.Message.setField(this, 1, value); + } + get logs() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.ethermint.evm.v1.Log, 2) as dependency_2.ethermint.evm.v1.Log[]; + } + set logs(value: dependency_2.ethermint.evm.v1.Log[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + get ret() { + return pb_1.Message.getFieldWithDefault(this, 3, new Uint8Array(0)) as Uint8Array; + } + set ret(value: Uint8Array) { + pb_1.Message.setField(this, 3, value); + } + get vm_error() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set vm_error(value: string) { + pb_1.Message.setField(this, 4, value); + } + get gas_used() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set gas_used(value: number) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + hash?: string; + logs?: ReturnType[]; + ret?: Uint8Array; + vm_error?: string; + gas_used?: number; + }): MsgEthereumTxResponse { + const message = new MsgEthereumTxResponse({}); + if (data.hash != null) { + message.hash = data.hash; + } + if (data.logs != null) { + message.logs = data.logs.map(item => dependency_2.ethermint.evm.v1.Log.fromObject(item)); + } + if (data.ret != null) { + message.ret = data.ret; + } + if (data.vm_error != null) { + message.vm_error = data.vm_error; + } + if (data.gas_used != null) { + message.gas_used = data.gas_used; + } + return message; + } + toObject() { + const data: { + hash?: string; + logs?: ReturnType[]; + ret?: Uint8Array; + vm_error?: string; + gas_used?: number; + } = {}; + if (this.hash != null) { + data.hash = this.hash; + } + if (this.logs != null) { + data.logs = this.logs.map((item: dependency_2.ethermint.evm.v1.Log) => item.toObject()); + } + if (this.ret != null) { + data.ret = this.ret; + } + if (this.vm_error != null) { + data.vm_error = this.vm_error; + } + if (this.gas_used != null) { + data.gas_used = this.gas_used; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.hash.length) + writer.writeString(1, this.hash); + if (this.logs.length) + writer.writeRepeatedMessage(2, this.logs, (item: dependency_2.ethermint.evm.v1.Log) => item.serialize(writer)); + if (this.ret.length) + writer.writeBytes(3, this.ret); + if (this.vm_error.length) + writer.writeString(4, this.vm_error); + if (this.gas_used != 0) + writer.writeUint64(5, this.gas_used); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgEthereumTxResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgEthereumTxResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.hash = reader.readString(); + break; + case 2: + reader.readMessage(message.logs, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.ethermint.evm.v1.Log.deserialize(reader), dependency_2.ethermint.evm.v1.Log)); + break; + case 3: + message.ret = reader.readBytes(); + break; + case 4: + message.vm_error = reader.readString(); + break; + case 5: + message.gas_used = reader.readUint64(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgEthereumTxResponse { + return MsgEthereumTxResponse.deserialize(bytes); + } + } +} diff --git a/src/types.ts b/src/types.ts index 49d687a..e756297 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,9 +1,11 @@ import assert from 'assert'; import { Validator } from 'jsonschema'; +import { ethers } from 'ethers'; import RecordSchema from './schema/record.json'; import { Util } from './util'; import * as attributes from './proto/vulcanize/registry/v1beta1/attributes'; +import * as evmTx from './proto/ethermint/evm/v1/tx'; import * as any from './proto/google/protobuf/any'; /** @@ -140,3 +142,33 @@ export class Payload { } } } + +export class EthereumTxData { + _tx: ethers.Transaction + + constructor (tx: ethers.Transaction) { + this._tx = tx + } + + serialize () { + var data= new evmTx.ethermint.evm.v1.LegacyTx({ + nonce: this._tx.nonce, + data: ethers.utils.arrayify(this._tx.data), + gas: this._tx.gasLimit.toNumber(), + gas_price: this._tx.gasPrice?.toString(), + r: ethers.utils.arrayify(this._tx.r!), + s: ethers.utils.arrayify(this._tx.s!), + + // TODO: Check if need to put in array + v: ethers.utils.arrayify([this._tx.v!]), + + to: this._tx.to, + value: this._tx.value.toString() + }) + + return new any.google.protobuf.Any({ + type_url: "/ethermint.evm.v1.TxData", + value: data.serialize() + }); + } +}