import { BaseAccount, BaseAccountSDKType } from "../../../cosmos/auth/v1beta1/auth"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial } from "../../../helpers"; /** * EthAccount implements the authtypes.AccountI interface and embeds an * authtypes.BaseAccount type. It is compatible with the auth AccountKeeper. */ export interface EthAccount { baseAccount?: BaseAccount; codeHash: Uint8Array; } /** * EthAccount implements the authtypes.AccountI interface and embeds an * authtypes.BaseAccount type. It is compatible with the auth AccountKeeper. */ export interface EthAccountSDKType { base_account?: BaseAccountSDKType; code_hash: Uint8Array; } function createBaseEthAccount(): EthAccount { return { baseAccount: undefined, codeHash: new Uint8Array() }; } export const EthAccount = { encode(message: EthAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.baseAccount !== undefined) { BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); } if (message.codeHash.length !== 0) { writer.uint32(18).bytes(message.codeHash); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): EthAccount { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEthAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.baseAccount = BaseAccount.decode(reader, reader.uint32()); break; case 2: message.codeHash = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): EthAccount { const message = createBaseEthAccount(); message.baseAccount = object.baseAccount !== undefined && object.baseAccount !== null ? BaseAccount.fromPartial(object.baseAccount) : undefined; message.codeHash = object.codeHash ?? new Uint8Array(); return message; } };