From b6670df138a322a6e92d2c7d88115a47a0f0904f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 2 Nov 2023 15:34:28 -0400 Subject: [PATCH 1/8] Encode Dates as strings in Amino types. --- .../ast/src/encoding/amino/interface/utils.ts | 8 +-- .../src/encoding/proto/from-amino/utils.ts | 43 +++++++++++++- .../ast/src/encoding/proto/to-amino/utils.ts | 59 ++++++++++++++++++- .../encoding/proto/from-amino/utils.d.ts | 1 + .../types/encoding/proto/to-amino/utils.d.ts | 1 + 5 files changed, 102 insertions(+), 10 deletions(-) diff --git a/packages/ast/src/encoding/amino/interface/utils.ts b/packages/ast/src/encoding/amino/interface/utils.ts index da00f840fe..50b3f9dddd 100644 --- a/packages/ast/src/encoding/amino/interface/utils.ts +++ b/packages/ast/src/encoding/amino/interface/utils.ts @@ -52,13 +52,7 @@ export const aminoInterface = { const timestampFormat = args.context.pluginValue('prototypes.typingsFormat.timestamp'); switch (timestampFormat) { case 'date': - // TODO check is date is Date for amino? - // return t.tsPropertySignature( - // t.identifier(args.context.aminoCaseField(args.field)), - // t.tsTypeAnnotation( - // t.tsTypeReference(t.identifier('Date')) - // ) - // ); + return aminoInterface.string(args); case 'timestamp': default: return aminoInterface.type(args); diff --git a/packages/ast/src/encoding/proto/from-amino/utils.ts b/packages/ast/src/encoding/proto/from-amino/utils.ts index 2b3fd4246b..f5ef516270 100644 --- a/packages/ast/src/encoding/proto/from-amino/utils.ts +++ b/packages/ast/src/encoding/proto/from-amino/utils.ts @@ -327,7 +327,48 @@ export const fromAminoJSON = { }, timestamp(args: FromAminoJSONMethod) { - return fromAminoJSON.scalar(args); + let timestampFormat = args.context.pluginValue( + 'prototypes.typingsFormat.timestamp' + ); + const env = args.context.pluginValue( + 'env' + ); + if (!env || env == 'default') { + timestampFormat = 'timestamp'; + } + switch (timestampFormat) { + case 'timestamp': + return fromAminoJSON.type(args); + case 'date': + default: + return fromAminoJSON.timestampDate(args); + } + }, + + timestampDate(args: FromAminoJSONMethod) { + const { origName } = getFieldNames(args.field); + args.context.addUtil('isSet'); + args.context.addUtil('fromTimestamp'); + + const callExpr = t.callExpression( + t.identifier('fromTimestamp'), + [ + t.callExpression( + t.memberExpression( + t.identifier('Timestamp'), + t.identifier('fromAmino') + ), + [ + t.memberExpression( + t.identifier('object'), + t.identifier(origName) + ) + ] + ) + ] + ); + + return setProp(args, callExpr); }, // labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ diff --git a/packages/ast/src/encoding/proto/to-amino/utils.ts b/packages/ast/src/encoding/proto/to-amino/utils.ts index 21d5d7a20e..86812580fd 100644 --- a/packages/ast/src/encoding/proto/to-amino/utils.ts +++ b/packages/ast/src/encoding/proto/to-amino/utils.ts @@ -238,7 +238,62 @@ export const toAminoJSON = { }, timestamp(args: ToAminoJSONMethod) { - return toAminoJSON.scalar(args); + let timestampFormat = args.context.pluginValue( + 'prototypes.typingsFormat.timestamp' + ); + const env = args.context.pluginValue( + 'env' + ); + if (!env || env == 'default') { + timestampFormat = 'timestamp'; + } + switch (timestampFormat) { + case 'timestamp': + return toAminoJSON.type(args); + case 'date': + default: + args.context.addUtil('toTimestamp'); + return toAminoJSON.timestampDate(args); + } + }, + + timestampDate(args: ToAminoJSONMethod) { + const { propName, origName } = getFieldNames(args.field); + args.context.addUtil('toTimestamp'); + + return t.expressionStatement( + t.assignmentExpression( + '=', + t.memberExpression( + t.identifier('obj'), + t.identifier(origName) + ), + t.conditionalExpression( + t.memberExpression( + t.identifier('message'), + t.identifier(propName) + ), + t.callExpression( + t.memberExpression( + t.identifier('Timestamp'), + t.identifier('toAmino') + ), + [ + t.callExpression( + t.identifier('toTimestamp'), + [ + t.memberExpression( + t.identifier('message'), + t.identifier(propName) + ) + ] + ) + ] + ), + t.identifier('undefined') + ) + ) + ); }, pubkey(args: ToAminoJSONMethod) { @@ -694,7 +749,7 @@ export const toAminoMessages = { t.identifier('fromTimestamp'), [t.identifier('message')] ), - t.identifier('toString') + t.identifier('toISOString') ), [] ) diff --git a/packages/ast/types/encoding/proto/from-amino/utils.d.ts b/packages/ast/types/encoding/proto/from-amino/utils.d.ts index 03a1ec3b5b..e64c17c29f 100644 --- a/packages/ast/types/encoding/proto/from-amino/utils.d.ts +++ b/packages/ast/types/encoding/proto/from-amino/utils.d.ts @@ -30,6 +30,7 @@ export declare const fromAminoJSON: { bytes(args: FromAminoJSONMethod): t.ObjectProperty; duration(args: FromAminoJSONMethod): t.ObjectProperty; timestamp(args: FromAminoJSONMethod): t.ObjectProperty; + timestampDate(args: FromAminoJSONMethod): t.ObjectProperty; keyHash(args: FromAminoJSONMethod): t.ObjectProperty; array(args: FromAminoJSONMethod, expr: t.Expression): t.ObjectProperty; }; diff --git a/packages/ast/types/encoding/proto/to-amino/utils.d.ts b/packages/ast/types/encoding/proto/to-amino/utils.d.ts index 5a2ffc0c10..fdb3c8554c 100644 --- a/packages/ast/types/encoding/proto/to-amino/utils.d.ts +++ b/packages/ast/types/encoding/proto/to-amino/utils.d.ts @@ -27,6 +27,7 @@ export declare const toAminoJSON: { bytes(args: ToAminoJSONMethod): t.ExpressionStatement; duration(args: ToAminoJSONMethod): t.ExpressionStatement; timestamp(args: ToAminoJSONMethod): t.ExpressionStatement; + timestampDate(args: ToAminoJSONMethod): t.ExpressionStatement; pubkey(args: ToAminoJSONMethod): t.ExpressionStatement; rawBytes(args: ToAminoJSONMethod): t.ExpressionStatement; wasmByteCode(args: ToAminoJSONMethod): t.ExpressionStatement; From 63badbf10982649a279c73502b3d9b133e556ed2 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 Nov 2023 14:30:59 -0400 Subject: [PATCH 2/8] Updated fixtures and snapshots. --- .../output1/cosmos/authz/v1beta1/tx.amino.ts | 6 +-- .../output1/cosmos/group/v1/tx.amino.ts | 16 ++------ .../cosmos/upgrade/v1beta1/tx.amino.ts | 6 +-- .../output1/evmos/vesting/v1/tx.amino.ts | 5 +-- .../gamm/pool-models/balancer/tx/tx.amino.ts | 6 +-- .../output1/osmosis/incentives/tx.amino.ts | 10 +---- .../cosmos/authz/v1beta1/authz.ts | 8 ++-- .../cosmos/authz/v1beta1/tx.amino.ts | 6 +-- .../cosmos/evidence/v1beta1/evidence.ts | 4 +- .../cosmos/feegrant/v1beta1/feegrant.ts | 8 ++-- .../v-next/outputosmojs/cosmos/gov/v1/gov.ts | 16 ++++---- .../outputosmojs/cosmos/gov/v1beta1/gov.ts | 16 ++++---- .../outputosmojs/cosmos/group/v1/tx.amino.ts | 16 ++------ .../outputosmojs/cosmos/group/v1/types.ts | 24 +++++------ .../cosmos/slashing/v1beta1/slashing.ts | 4 +- .../cosmos/staking/v1beta1/staking.ts | 16 ++++---- .../outputosmojs/cosmos/staking/v1beta1/tx.ts | 8 ++-- .../cosmos/upgrade/v1beta1/tx.amino.ts | 6 +-- .../cosmos/upgrade/v1beta1/upgrade.ts | 4 +- .../outputosmojs/evmos/claims/v1/genesis.ts | 4 +- .../outputosmojs/evmos/epochs/v1/genesis.ts | 8 ++-- .../evmos/incentives/v1/incentives.ts | 4 +- .../outputosmojs/evmos/vesting/v1/tx.amino.ts | 5 +-- .../outputosmojs/evmos/vesting/v1/tx.ts | 4 +- .../outputosmojs/evmos/vesting/v1/vesting.ts | 4 +- .../outputosmojs/google/api/distribution.ts | 4 +- .../google/api/expr/v1alpha1/syntax.ts | 4 +- .../google/api/servicecontrol/v1/log_entry.ts | 4 +- .../api/servicecontrol/v1/metric_value.ts | 8 ++-- .../google/api/servicecontrol/v1/operation.ts | 8 ++-- .../api/servicemanagement/v1/resources.ts | 8 ++-- .../google/logging/v2/log_entry.ts | 8 ++-- .../google/logging/v2/logging_config.ts | 40 +++++++++---------- .../google/logging/v2/logging_metrics.ts | 8 ++-- .../outputosmojs/google/protobuf/timestamp.ts | 2 +- .../google/rpc/context/attribute_context.ts | 20 +++++----- .../lightclients/tendermint/v1/tendermint.ts | 4 +- .../osmosis/claim/v1beta1/params.ts | 4 +- .../incentive_record.ts | 4 +- .../osmosis/concentrated-liquidity/pool.ts | 4 +- .../concentrated-liquidity/position.ts | 4 +- .../osmosis/concentrated-liquidity/tx.ts | 12 +++--- .../downtime-detector/v1beta1/genesis.ts | 8 ++-- .../outputosmojs/osmosis/epochs/genesis.ts | 8 ++-- .../gamm/pool-models/balancer/balancerPool.ts | 4 +- .../gamm/pool-models/balancer/tx/tx.amino.ts | 6 +-- .../outputosmojs/osmosis/incentives/gauge.ts | 4 +- .../osmosis/incentives/tx.amino.ts | 10 +---- .../outputosmojs/osmosis/incentives/tx.ts | 4 +- .../outputosmojs/osmosis/lockup/lock.ts | 12 +++--- .../outputosmojs/osmosis/lockup/query.ts | 16 ++++---- .../osmosis/twap/v1beta1/query.ts | 12 +++--- .../osmosis/twap/v1beta1/twap_record.ts | 8 ++-- .../outputosmojs/tendermint/abci/types.ts | 8 ++-- .../outputosmojs/tendermint/p2p/types.ts | 12 +++--- .../outputosmojs/tendermint/types/evidence.ts | 8 ++-- .../outputosmojs/tendermint/types/types.ts | 16 ++++---- .../outputv2/cosmos/authz/v1beta1/authz.ts | 8 ++-- .../cosmos/evidence/v1beta1/evidence.ts | 4 +- .../cosmos/feegrant/v1beta1/feegrant.ts | 8 ++-- .../v-next/outputv2/cosmos/gov/v1/gov.ts | 16 ++++---- .../v-next/outputv2/cosmos/gov/v1beta1/gov.ts | 16 ++++---- .../v-next/outputv2/cosmos/group/v1/types.ts | 24 +++++------ .../cosmos/slashing/v1beta1/slashing.ts | 4 +- .../cosmos/staking/v1beta1/staking.ts | 16 ++++---- .../outputv2/cosmos/staking/v1beta1/tx.ts | 8 ++-- .../cosmos/upgrade/v1beta1/upgrade.ts | 4 +- .../outputv2/evmos/claims/v1/genesis.ts | 4 +- .../outputv2/evmos/epochs/v1/genesis.ts | 8 ++-- .../evmos/incentives/v1/incentives.ts | 4 +- .../v-next/outputv2/evmos/vesting/v1/tx.ts | 4 +- .../outputv2/evmos/vesting/v1/vesting.ts | 4 +- .../outputv2/google/api/distribution.ts | 4 +- .../google/api/expr/v1alpha1/syntax.ts | 4 +- .../google/api/servicecontrol/v1/log_entry.ts | 4 +- .../api/servicecontrol/v1/metric_value.ts | 8 ++-- .../google/api/servicecontrol/v1/operation.ts | 8 ++-- .../api/servicemanagement/v1/resources.ts | 8 ++-- .../outputv2/google/logging/v2/log_entry.ts | 8 ++-- .../google/logging/v2/logging_config.ts | 40 +++++++++---------- .../google/logging/v2/logging_metrics.ts | 8 ++-- .../outputv2/google/protobuf/timestamp.ts | 2 +- .../google/rpc/context/attribute_context.ts | 20 +++++----- .../lightclients/tendermint/v1/tendermint.ts | 4 +- .../outputv2/osmosis/claim/v1beta1/params.ts | 4 +- .../v-next/outputv2/osmosis/epochs/genesis.ts | 8 ++-- .../gamm/pool-models/balancer/balancerPool.ts | 4 +- .../outputv2/osmosis/incentives/gauge.ts | 4 +- .../v-next/outputv2/osmosis/incentives/tx.ts | 4 +- .../v-next/outputv2/osmosis/lockup/lock.ts | 12 +++--- .../v-next/outputv2/osmosis/lockup/query.ts | 16 ++++---- .../outputv2/osmosis/twap/v1beta1/query.ts | 12 +++--- .../osmosis/twap/v1beta1/twap_record.ts | 8 ++-- .../v-next/outputv2/tendermint/abci/types.ts | 8 ++-- .../v-next/outputv2/tendermint/p2p/types.ts | 12 +++--- .../outputv2/tendermint/types/evidence.ts | 8 ++-- .../v-next/outputv2/tendermint/types/types.ts | 16 ++++---- .../outputv3/cosmos/authz/v1beta1/authz.ts | 8 ++-- .../cosmos/evidence/v1beta1/evidence.ts | 4 +- .../cosmos/feegrant/v1beta1/feegrant.ts | 8 ++-- .../v-next/outputv3/cosmos/gov/v1/gov.ts | 16 ++++---- .../v-next/outputv3/cosmos/gov/v1beta1/gov.ts | 16 ++++---- .../v-next/outputv3/cosmos/group/v1/types.ts | 24 +++++------ .../cosmos/slashing/v1beta1/slashing.ts | 4 +- .../cosmos/staking/v1beta1/staking.ts | 16 ++++---- .../outputv3/cosmos/staking/v1beta1/tx.ts | 8 ++-- .../cosmos/upgrade/v1beta1/upgrade.ts | 4 +- .../outputv3/evmos/claims/v1/genesis.ts | 4 +- .../outputv3/evmos/epochs/v1/genesis.ts | 8 ++-- .../evmos/incentives/v1/incentives.ts | 4 +- .../v-next/outputv3/evmos/vesting/v1/tx.ts | 4 +- .../outputv3/evmos/vesting/v1/vesting.ts | 4 +- .../outputv3/google/api/distribution.ts | 4 +- .../google/api/expr/v1alpha1/syntax.ts | 4 +- .../google/api/servicecontrol/v1/log_entry.ts | 4 +- .../api/servicecontrol/v1/metric_value.ts | 8 ++-- .../google/api/servicecontrol/v1/operation.ts | 8 ++-- .../api/servicemanagement/v1/resources.ts | 8 ++-- .../outputv3/google/logging/v2/log_entry.ts | 8 ++-- .../google/logging/v2/logging_config.ts | 40 +++++++++---------- .../google/logging/v2/logging_metrics.ts | 8 ++-- .../outputv3/google/protobuf/timestamp.ts | 2 +- .../google/rpc/context/attribute_context.ts | 20 +++++----- .../lightclients/tendermint/v1/tendermint.ts | 4 +- .../outputv3/osmosis/claim/v1beta1/params.ts | 4 +- .../v-next/outputv3/osmosis/epochs/genesis.ts | 8 ++-- .../gamm/pool-models/balancer/balancerPool.ts | 4 +- .../outputv3/osmosis/incentives/gauge.ts | 4 +- .../v-next/outputv3/osmosis/incentives/tx.ts | 4 +- .../v-next/outputv3/osmosis/lockup/lock.ts | 12 +++--- .../v-next/outputv3/osmosis/lockup/query.ts | 16 ++++---- .../outputv3/osmosis/twap/v1beta1/query.ts | 12 +++--- .../osmosis/twap/v1beta1/twap_record.ts | 8 ++-- .../v-next/outputv3/tendermint/abci/types.ts | 8 ++-- .../v-next/outputv3/tendermint/p2p/types.ts | 12 +++--- .../outputv3/tendermint/types/evidence.ts | 8 ++-- .../v-next/outputv3/tendermint/types/types.ts | 16 ++++---- .../outputv4/cosmos/authz/v1beta1/authz.ts | 8 ++-- .../outputv4/cosmos/authz/v1beta1/tx.amino.ts | 6 +-- .../cosmos/evidence/v1beta1/evidence.ts | 4 +- .../cosmos/feegrant/v1beta1/feegrant.ts | 8 ++-- .../v-next/outputv4/cosmos/gov/v1/gov.ts | 16 ++++---- .../v-next/outputv4/cosmos/gov/v1beta1/gov.ts | 16 ++++---- .../outputv4/cosmos/group/v1/tx.amino.ts | 16 ++------ .../v-next/outputv4/cosmos/group/v1/types.ts | 24 +++++------ .../cosmos/slashing/v1beta1/slashing.ts | 4 +- .../cosmos/staking/v1beta1/staking.ts | 16 ++++---- .../outputv4/cosmos/staking/v1beta1/tx.ts | 8 ++-- .../cosmos/upgrade/v1beta1/tx.amino.ts | 6 +-- .../cosmos/upgrade/v1beta1/upgrade.ts | 4 +- .../outputv4/evmos/claims/v1/genesis.ts | 4 +- .../outputv4/evmos/epochs/v1/genesis.ts | 8 ++-- .../evmos/incentives/v1/incentives.ts | 4 +- .../outputv4/evmos/vesting/v1/tx.amino.ts | 5 +-- .../v-next/outputv4/evmos/vesting/v1/tx.ts | 4 +- .../outputv4/evmos/vesting/v1/vesting.ts | 4 +- .../outputv4/google/api/distribution.ts | 4 +- .../google/api/expr/v1alpha1/syntax.ts | 4 +- .../google/api/servicecontrol/v1/log_entry.ts | 4 +- .../api/servicecontrol/v1/metric_value.ts | 8 ++-- .../google/api/servicecontrol/v1/operation.ts | 8 ++-- .../api/servicemanagement/v1/resources.ts | 8 ++-- .../outputv4/google/logging/v2/log_entry.ts | 8 ++-- .../google/logging/v2/logging_config.ts | 40 +++++++++---------- .../google/logging/v2/logging_metrics.ts | 8 ++-- .../outputv4/google/protobuf/timestamp.ts | 2 +- .../google/rpc/context/attribute_context.ts | 20 +++++----- .../lightclients/tendermint/v1/tendermint.ts | 4 +- .../outputv4/osmosis/claim/v1beta1/params.ts | 4 +- .../v-next/outputv4/osmosis/epochs/genesis.ts | 8 ++-- .../gamm/pool-models/balancer/balancerPool.ts | 4 +- .../gamm/pool-models/balancer/tx/tx.amino.ts | 6 +-- .../outputv4/osmosis/incentives/gauge.ts | 4 +- .../outputv4/osmosis/incentives/tx.amino.ts | 10 +---- .../v-next/outputv4/osmosis/incentives/tx.ts | 4 +- .../v-next/outputv4/osmosis/lockup/lock.ts | 12 +++--- .../v-next/outputv4/osmosis/lockup/query.ts | 16 ++++---- .../outputv4/osmosis/twap/v1beta1/query.ts | 12 +++--- .../osmosis/twap/v1beta1/twap_record.ts | 8 ++-- .../v-next/outputv4/tendermint/abci/types.ts | 8 ++-- .../v-next/outputv4/tendermint/p2p/types.ts | 12 +++--- .../outputv4/tendermint/types/evidence.ts | 8 ++-- .../v-next/outputv4/tendermint/types/types.ts | 16 ++++---- .../__snapshots__/object.spec.ts.snap | 8 ++-- .../authz.timestamp.test.ts.snap | 13 +++--- 185 files changed, 784 insertions(+), 880 deletions(-) diff --git a/__fixtures__/output1/cosmos/authz/v1beta1/tx.amino.ts b/__fixtures__/output1/cosmos/authz/v1beta1/tx.amino.ts index dee011d143..b035d8f4ff 100644 --- a/__fixtures__/output1/cosmos/authz/v1beta1/tx.amino.ts +++ b/__fixtures__/output1/cosmos/authz/v1beta1/tx.amino.ts @@ -1,7 +1,6 @@ import { Grant, GrantSDKType } from "./authz"; import { Any, AnySDKType } from "../../../google/protobuf/any"; import { AminoMsg } from "@cosmjs/amino"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { MsgGrant, MsgGrantSDKType, MsgExec, MsgExecSDKType, MsgRevoke, MsgRevokeSDKType } from "./tx"; export interface MsgGrantAminoType extends AminoMsg { type: "cosmos-sdk/MsgGrant"; @@ -13,10 +12,7 @@ export interface MsgGrantAminoType extends AminoMsg { type_url: string; value: Uint8Array; }; - expiration: { - seconds: string; - nanos: number; - }; + expiration: string; }; }; } diff --git a/__fixtures__/output1/cosmos/group/v1/tx.amino.ts b/__fixtures__/output1/cosmos/group/v1/tx.amino.ts index e916efb20d..7bdef57235 100644 --- a/__fixtures__/output1/cosmos/group/v1/tx.amino.ts +++ b/__fixtures__/output1/cosmos/group/v1/tx.amino.ts @@ -2,7 +2,6 @@ import { Member, MemberSDKType, VoteOption, VoteOptionSDKType, voteOptionFromJSO import { Any, AnySDKType } from "../../../google/protobuf/any"; import { AminoMsg } from "@cosmjs/amino"; import { Long } from "../../../helpers"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { execFromJSON, MsgCreateGroup, MsgCreateGroupSDKType, MsgUpdateGroupMembers, MsgUpdateGroupMembersSDKType, MsgUpdateGroupAdmin, MsgUpdateGroupAdminSDKType, MsgUpdateGroupMetadata, MsgUpdateGroupMetadataSDKType, MsgCreateGroupPolicy, MsgCreateGroupPolicySDKType, MsgCreateGroupWithPolicy, MsgCreateGroupWithPolicySDKType, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyAdminSDKType, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyDecisionPolicySDKType, MsgUpdateGroupPolicyMetadata, MsgUpdateGroupPolicyMetadataSDKType, MsgSubmitProposal, MsgSubmitProposalSDKType, MsgWithdrawProposal, MsgWithdrawProposalSDKType, MsgVote, MsgVoteSDKType, MsgExec, MsgExecSDKType, MsgLeaveGroup, MsgLeaveGroupSDKType } from "./tx"; export interface MsgCreateGroupAminoType extends AminoMsg { type: "cosmos-sdk/MsgCreateGroup"; @@ -12,10 +11,7 @@ export interface MsgCreateGroupAminoType extends AminoMsg { address: string; weight: string; metadata: string; - added_at: { - seconds: string; - nanos: number; - }; + added_at: string; }[]; metadata: string; }; @@ -29,10 +25,7 @@ export interface MsgUpdateGroupMembersAminoType extends AminoMsg { address: string; weight: string; metadata: string; - added_at: { - seconds: string; - nanos: number; - }; + added_at: string; }[]; }; } @@ -72,10 +65,7 @@ export interface MsgCreateGroupWithPolicyAminoType extends AminoMsg { address: string; weight: string; metadata: string; - added_at: { - seconds: string; - nanos: number; - }; + added_at: string; }[]; group_metadata: string; group_policy_metadata: string; diff --git a/__fixtures__/output1/cosmos/upgrade/v1beta1/tx.amino.ts b/__fixtures__/output1/cosmos/upgrade/v1beta1/tx.amino.ts index 008a9442dc..9363380b44 100644 --- a/__fixtures__/output1/cosmos/upgrade/v1beta1/tx.amino.ts +++ b/__fixtures__/output1/cosmos/upgrade/v1beta1/tx.amino.ts @@ -1,7 +1,6 @@ import { Plan, PlanSDKType } from "./upgrade"; import { AminoMsg } from "@cosmjs/amino"; import { Long } from "../../../helpers"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Any, AnySDKType } from "../../../google/protobuf/any"; import { MsgSoftwareUpgrade, MsgSoftwareUpgradeSDKType, MsgCancelUpgrade, MsgCancelUpgradeSDKType } from "./tx"; export interface MsgSoftwareUpgradeAminoType extends AminoMsg { @@ -10,10 +9,7 @@ export interface MsgSoftwareUpgradeAminoType extends AminoMsg { authority: string; plan: { name: string; - time: { - seconds: string; - nanos: number; - }; + time: string; height: string; info: string; upgraded_client_state: { diff --git a/__fixtures__/output1/evmos/vesting/v1/tx.amino.ts b/__fixtures__/output1/evmos/vesting/v1/tx.amino.ts index 296eeaea6f..d9826dab6d 100644 --- a/__fixtures__/output1/evmos/vesting/v1/tx.amino.ts +++ b/__fixtures__/output1/evmos/vesting/v1/tx.amino.ts @@ -9,10 +9,7 @@ export interface MsgCreateClawbackVestingAccountAminoType extends AminoMsg { value: { from_address: string; to_address: string; - start_time: { - seconds: string; - nanos: number; - }; + start_time: string; lockup_periods: { length: string; amount: { diff --git a/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts b/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts index fd70c527f4..5cf1ac60c7 100644 --- a/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts +++ b/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts @@ -2,7 +2,6 @@ import { PoolParams, PoolParamsSDKType, PoolAsset, PoolAssetSDKType, SmoothWeightChangeParams, SmoothWeightChangeParamsSDKType } from "../balancerPool"; import { AminoMsg } from "@cosmjs/amino"; import { Long } from "../../../../../helpers"; -import { Timestamp, TimestampSDKType } from "../../../../../google/protobuf/timestamp"; import { Duration, DurationSDKType } from "../../../../../google/protobuf/duration"; import { Coin, CoinSDKType } from "../../../../../cosmos/base/v1beta1/coin"; import { MsgCreateBalancerPool, MsgCreateBalancerPoolSDKType } from "./tx"; @@ -14,10 +13,7 @@ export interface MsgCreateBalancerPoolAminoType extends AminoMsg { swap_fee: string; exit_fee: string; smooth_weight_change_params: { - start_time: { - seconds: string; - nanos: number; - }; + start_time: string; duration: { seconds: string; nanos: number; diff --git a/__fixtures__/output1/osmosis/incentives/tx.amino.ts b/__fixtures__/output1/osmosis/incentives/tx.amino.ts index 3e12d2cc96..e37a087742 100644 --- a/__fixtures__/output1/osmosis/incentives/tx.amino.ts +++ b/__fixtures__/output1/osmosis/incentives/tx.amino.ts @@ -18,19 +18,13 @@ export interface MsgCreateGaugeAminoType extends AminoMsg { seconds: string; nanos: number; }; - timestamp: { - seconds: string; - nanos: number; - }; + timestamp: string; }; coins: { denom: string; amount: string; }[]; - start_time: { - seconds: string; - nanos: number; - }; + start_time: string; num_epochs_paid_over: string; }; } diff --git a/__fixtures__/v-next/outputosmojs/cosmos/authz/v1beta1/authz.ts b/__fixtures__/v-next/outputosmojs/cosmos/authz/v1beta1/authz.ts index a6c88eae26..970ded502d 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/authz/v1beta1/authz.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/authz/v1beta1/authz.ts @@ -252,13 +252,13 @@ export const Grant = { fromAmino(object: GrantAmino): Grant { return { authorization: object?.authorization ? Any.fromAmino(object.authorization) : undefined, - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: Grant): GrantAmino { const obj: any = {}; obj.authorization = message.authorization ? Any.toAmino(message.authorization) : undefined; - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: GrantAminoMsg): Grant { @@ -387,7 +387,7 @@ export const GrantAuthorization = { granter: object.granter, grantee: object.grantee, authorization: object?.authorization ? Any.fromAmino(object.authorization) : undefined, - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: GrantAuthorization): GrantAuthorizationAmino { @@ -395,7 +395,7 @@ export const GrantAuthorization = { obj.granter = message.granter; obj.grantee = message.grantee; obj.authorization = message.authorization ? Any.toAmino(message.authorization) : undefined; - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/authz/v1beta1/tx.amino.ts b/__fixtures__/v-next/outputosmojs/cosmos/authz/v1beta1/tx.amino.ts index dee011d143..b035d8f4ff 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/authz/v1beta1/tx.amino.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/authz/v1beta1/tx.amino.ts @@ -1,7 +1,6 @@ import { Grant, GrantSDKType } from "./authz"; import { Any, AnySDKType } from "../../../google/protobuf/any"; import { AminoMsg } from "@cosmjs/amino"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { MsgGrant, MsgGrantSDKType, MsgExec, MsgExecSDKType, MsgRevoke, MsgRevokeSDKType } from "./tx"; export interface MsgGrantAminoType extends AminoMsg { type: "cosmos-sdk/MsgGrant"; @@ -13,10 +12,7 @@ export interface MsgGrantAminoType extends AminoMsg { type_url: string; value: Uint8Array; }; - expiration: { - seconds: string; - nanos: number; - }; + expiration: string; }; }; } diff --git a/__fixtures__/v-next/outputosmojs/cosmos/evidence/v1beta1/evidence.ts b/__fixtures__/v-next/outputosmojs/cosmos/evidence/v1beta1/evidence.ts index 940137b34a..06063b23ad 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/evidence/v1beta1/evidence.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/evidence/v1beta1/evidence.ts @@ -128,7 +128,7 @@ export const Equivocation = { fromAmino(object: EquivocationAmino): Equivocation { return { height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), power: BigInt(object.power), consensusAddress: object.consensus_address }; @@ -136,7 +136,7 @@ export const Equivocation = { toAmino(message: Equivocation): EquivocationAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.power = message.power ? message.power.toString() : undefined; obj.consensus_address = message.consensusAddress; return obj; diff --git a/__fixtures__/v-next/outputosmojs/cosmos/feegrant/v1beta1/feegrant.ts b/__fixtures__/v-next/outputosmojs/cosmos/feegrant/v1beta1/feegrant.ts index d9bc1ab71a..469d179be8 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/feegrant/v1beta1/feegrant.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/feegrant/v1beta1/feegrant.ts @@ -191,7 +191,7 @@ export const BasicAllowance = { fromAmino(object: BasicAllowanceAmino): BasicAllowance { return { spendLimit: Array.isArray(object?.spend_limit) ? object.spend_limit.map((e: any) => Coin.fromAmino(e)) : [], - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: BasicAllowance): BasicAllowanceAmino { @@ -201,7 +201,7 @@ export const BasicAllowance = { } else { obj.spend_limit = []; } - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: BasicAllowanceAminoMsg): BasicAllowance { @@ -360,7 +360,7 @@ export const PeriodicAllowance = { period: object?.period ? Duration.fromAmino(object.period) : undefined, periodSpendLimit: Array.isArray(object?.period_spend_limit) ? object.period_spend_limit.map((e: any) => Coin.fromAmino(e)) : [], periodCanSpend: Array.isArray(object?.period_can_spend) ? object.period_can_spend.map((e: any) => Coin.fromAmino(e)) : [], - periodReset: object.period_reset + periodReset: fromTimestamp(Timestamp.fromAmino(object.period_reset)) }; }, toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { @@ -377,7 +377,7 @@ export const PeriodicAllowance = { } else { obj.period_can_spend = []; } - obj.period_reset = message.periodReset; + obj.period_reset = message.periodReset ? Timestamp.toAmino(toTimestamp(message.periodReset)) : undefined; return obj; }, fromAminoMsg(object: PeriodicAllowanceAminoMsg): PeriodicAllowance { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/gov.ts b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/gov.ts index d0ee5f8e78..a655d8b450 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/gov.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/gov.ts @@ -749,11 +749,11 @@ export const Proposal = { messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object?.submit_time, - depositEndTime: object?.deposit_end_time, + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined, + depositEndTime: object?.deposit_end_time ? fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)) : undefined, totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object?.voting_start_time, - votingEndTime: object?.voting_end_time, + votingStartTime: object?.voting_start_time ? fromTimestamp(Timestamp.fromAmino(object.voting_start_time)) : undefined, + votingEndTime: object?.voting_end_time ? fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) : undefined, metadata: object.metadata }; }, @@ -767,15 +767,15 @@ export const Proposal = { } obj.status = message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime; - obj.deposit_end_time = message.depositEndTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : undefined; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime; - obj.voting_end_time = message.votingEndTime; + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : undefined; + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : undefined; obj.metadata = message.metadata; return obj; }, diff --git a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts index 63cc8f0acb..132f66edc4 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts @@ -868,11 +868,11 @@ export const Proposal = { content: object?.content ? Any.fromAmino(object.content) : undefined, status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object.submit_time, - depositEndTime: object.deposit_end_time, + submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), + depositEndTime: fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)), totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object.voting_start_time, - votingEndTime: object.voting_end_time + votingStartTime: fromTimestamp(Timestamp.fromAmino(object.voting_start_time)), + votingEndTime: fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) }; }, toAmino(message: Proposal): ProposalAmino { @@ -881,15 +881,15 @@ export const Proposal = { obj.content = message.content ? Any.toAmino(message.content) : undefined; obj.status = message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime; - obj.deposit_end_time = message.depositEndTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : undefined; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime; - obj.voting_end_time = message.votingEndTime; + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : undefined; + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : undefined; return obj; }, fromAminoMsg(object: ProposalAminoMsg): Proposal { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/group/v1/tx.amino.ts b/__fixtures__/v-next/outputosmojs/cosmos/group/v1/tx.amino.ts index e7787dfe21..e44a0f0c10 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/group/v1/tx.amino.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/group/v1/tx.amino.ts @@ -1,7 +1,6 @@ import { Member, MemberSDKType, VoteOption, VoteOptionSDKType, voteOptionFromJSON } from "./types"; import { Any, AnySDKType } from "../../../google/protobuf/any"; import { AminoMsg } from "@cosmjs/amino"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { execFromJSON, MsgCreateGroup, MsgCreateGroupSDKType, MsgUpdateGroupMembers, MsgUpdateGroupMembersSDKType, MsgUpdateGroupAdmin, MsgUpdateGroupAdminSDKType, MsgUpdateGroupMetadata, MsgUpdateGroupMetadataSDKType, MsgCreateGroupPolicy, MsgCreateGroupPolicySDKType, MsgCreateGroupWithPolicy, MsgCreateGroupWithPolicySDKType, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyAdminSDKType, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyDecisionPolicySDKType, MsgUpdateGroupPolicyMetadata, MsgUpdateGroupPolicyMetadataSDKType, MsgSubmitProposal, MsgSubmitProposalSDKType, MsgWithdrawProposal, MsgWithdrawProposalSDKType, MsgVote, MsgVoteSDKType, MsgExec, MsgExecSDKType, MsgLeaveGroup, MsgLeaveGroupSDKType } from "./tx"; export interface MsgCreateGroupAminoType extends AminoMsg { type: "cosmos-sdk/MsgCreateGroup"; @@ -11,10 +10,7 @@ export interface MsgCreateGroupAminoType extends AminoMsg { address: string; weight: string; metadata: string; - added_at: { - seconds: string; - nanos: number; - }; + added_at: string; }[]; metadata: string; }; @@ -28,10 +24,7 @@ export interface MsgUpdateGroupMembersAminoType extends AminoMsg { address: string; weight: string; metadata: string; - added_at: { - seconds: string; - nanos: number; - }; + added_at: string; }[]; }; } @@ -71,10 +64,7 @@ export interface MsgCreateGroupWithPolicyAminoType extends AminoMsg { address: string; weight: string; metadata: string; - added_at: { - seconds: string; - nanos: number; - }; + added_at: string; }[]; group_metadata: string; group_policy_metadata: string; diff --git a/__fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts b/__fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts index 8913ec9ceb..9dfa5d2079 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts @@ -630,7 +630,7 @@ export const Member = { address: object.address, weight: object.weight, metadata: object.metadata, - addedAt: object.added_at + addedAt: fromTimestamp(Timestamp.fromAmino(object.added_at)) }; }, toAmino(message: Member): MemberAmino { @@ -638,7 +638,7 @@ export const Member = { obj.address = message.address; obj.weight = message.weight; obj.metadata = message.metadata; - obj.added_at = message.addedAt; + obj.added_at = message.addedAt ? Timestamp.toAmino(toTimestamp(message.addedAt)) : undefined; return obj; }, fromAminoMsg(object: MemberAminoMsg): Member { @@ -1220,7 +1220,7 @@ export const GroupInfo = { metadata: object.metadata, version: BigInt(object.version), totalWeight: object.total_weight, - createdAt: object.created_at + createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) }; }, toAmino(message: GroupInfo): GroupInfoAmino { @@ -1230,7 +1230,7 @@ export const GroupInfo = { obj.metadata = message.metadata; obj.version = message.version ? message.version.toString() : undefined; obj.total_weight = message.totalWeight; - obj.created_at = message.createdAt; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : undefined; return obj; }, fromAminoMsg(object: GroupInfoAminoMsg): GroupInfo { @@ -1508,7 +1508,7 @@ export const GroupPolicyInfo = { metadata: object.metadata, version: BigInt(object.version), decisionPolicy: object?.decision_policy ? Any.fromAmino(object.decision_policy) : undefined, - createdAt: object.created_at + createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) }; }, toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { @@ -1519,7 +1519,7 @@ export const GroupPolicyInfo = { obj.metadata = message.metadata; obj.version = message.version ? message.version.toString() : undefined; obj.decision_policy = message.decisionPolicy ? Any.toAmino(message.decisionPolicy) : undefined; - obj.created_at = message.createdAt; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : undefined; return obj; }, fromAminoMsg(object: GroupPolicyInfoAminoMsg): GroupPolicyInfo { @@ -1782,13 +1782,13 @@ export const Proposal = { address: object.address, metadata: object.metadata, proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], - submitTime: object.submit_time, + submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), groupVersion: BigInt(object.group_version), groupPolicyVersion: BigInt(object.group_policy_version), status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - votingPeriodEnd: object.voting_period_end, + votingPeriodEnd: fromTimestamp(Timestamp.fromAmino(object.voting_period_end)), executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] }; @@ -1803,13 +1803,13 @@ export const Proposal = { } else { obj.proposers = []; } - obj.submit_time = message.submitTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; obj.group_version = message.groupVersion ? message.groupVersion.toString() : undefined; obj.group_policy_version = message.groupPolicyVersion ? message.groupPolicyVersion.toString() : undefined; obj.status = message.status; obj.result = message.result; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.voting_period_end = message.votingPeriodEnd; + obj.voting_period_end = message.votingPeriodEnd ? Timestamp.toAmino(toTimestamp(message.votingPeriodEnd)) : undefined; obj.executor_result = message.executorResult; if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); @@ -2095,7 +2095,7 @@ export const Vote = { voter: object.voter, option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata, - submitTime: object.submit_time + submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)) }; }, toAmino(message: Vote): VoteAmino { @@ -2104,7 +2104,7 @@ export const Vote = { obj.voter = message.voter; obj.option = message.option; obj.metadata = message.metadata; - obj.submit_time = message.submitTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; return obj; }, fromAminoMsg(object: VoteAminoMsg): Vote { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/slashing/v1beta1/slashing.ts b/__fixtures__/v-next/outputosmojs/cosmos/slashing/v1beta1/slashing.ts index 039ec74eb5..a221480438 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/slashing/v1beta1/slashing.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/slashing/v1beta1/slashing.ts @@ -196,7 +196,7 @@ export const ValidatorSigningInfo = { address: object.address, startHeight: BigInt(object.start_height), indexOffset: BigInt(object.index_offset), - jailedUntil: object.jailed_until, + jailedUntil: fromTimestamp(Timestamp.fromAmino(object.jailed_until)), tombstoned: object.tombstoned, missedBlocksCounter: BigInt(object.missed_blocks_counter) }; @@ -206,7 +206,7 @@ export const ValidatorSigningInfo = { obj.address = message.address; obj.start_height = message.startHeight ? message.startHeight.toString() : undefined; obj.index_offset = message.indexOffset ? message.indexOffset.toString() : undefined; - obj.jailed_until = message.jailedUntil; + obj.jailed_until = message.jailedUntil ? Timestamp.toAmino(toTimestamp(message.jailedUntil)) : undefined; obj.tombstoned = message.tombstoned; obj.missed_blocks_counter = message.missedBlocksCounter ? message.missedBlocksCounter.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/staking.ts b/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/staking.ts index 302493988a..c11ad72e15 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/staking.ts @@ -844,13 +844,13 @@ export const Commission = { fromAmino(object: CommissionAmino): Commission { return { commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: object.update_time + updateTime: fromTimestamp(Timestamp.fromAmino(object.update_time)) }; }, toAmino(message: Commission): CommissionAmino { const obj: any = {}; obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : undefined; - obj.update_time = message.updateTime; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; return obj; }, fromAminoMsg(object: CommissionAminoMsg): Commission { @@ -1227,7 +1227,7 @@ export const Validator = { delegatorShares: object.delegator_shares, description: object?.description ? Description.fromAmino(object.description) : undefined, unbondingHeight: BigInt(object.unbonding_height), - unbondingTime: object.unbonding_time, + unbondingTime: fromTimestamp(Timestamp.fromAmino(object.unbonding_time)), commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, minSelfDelegation: object.min_self_delegation }; @@ -1242,7 +1242,7 @@ export const Validator = { obj.delegator_shares = message.delegatorShares; obj.description = message.description ? Description.toAmino(message.description) : undefined; obj.unbonding_height = message.unbondingHeight ? message.unbondingHeight.toString() : undefined; - obj.unbonding_time = message.unbondingTime; + obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) : undefined; obj.commission = message.commission ? Commission.toAmino(message.commission) : undefined; obj.min_self_delegation = message.minSelfDelegation; return obj; @@ -2168,7 +2168,7 @@ export const UnbondingDelegationEntry = { fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: object.completion_time, + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), initialBalance: object.initial_balance, balance: object.balance }; @@ -2176,7 +2176,7 @@ export const UnbondingDelegationEntry = { toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; obj.initial_balance = message.initialBalance; obj.balance = message.balance; return obj; @@ -2305,7 +2305,7 @@ export const RedelegationEntry = { fromAmino(object: RedelegationEntryAmino): RedelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: object.completion_time, + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), initialBalance: object.initial_balance, sharesDst: object.shares_dst }; @@ -2313,7 +2313,7 @@ export const RedelegationEntry = { toAmino(message: RedelegationEntry): RedelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; obj.initial_balance = message.initialBalance; obj.shares_dst = message.sharesDst; return obj; diff --git a/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/tx.ts b/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/tx.ts index 8d9be1c973..a66df3cd9b 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/tx.ts @@ -1027,12 +1027,12 @@ export const MsgBeginRedelegateResponse = { }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { return { - completionTime: object.completion_time + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) }; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; return obj; }, fromAminoMsg(object: MsgBeginRedelegateResponseAminoMsg): MsgBeginRedelegateResponse { @@ -1241,12 +1241,12 @@ export const MsgUndelegateResponse = { }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { return { - completionTime: object.completion_time + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) }; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; return obj; }, fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/upgrade/v1beta1/tx.amino.ts b/__fixtures__/v-next/outputosmojs/cosmos/upgrade/v1beta1/tx.amino.ts index 1eb1068281..92673592c2 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/upgrade/v1beta1/tx.amino.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/upgrade/v1beta1/tx.amino.ts @@ -1,6 +1,5 @@ import { Plan, PlanSDKType } from "./upgrade"; import { AminoMsg } from "@cosmjs/amino"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Any, AnySDKType } from "../../../google/protobuf/any"; import { MsgSoftwareUpgrade, MsgSoftwareUpgradeSDKType, MsgCancelUpgrade, MsgCancelUpgradeSDKType } from "./tx"; export interface MsgSoftwareUpgradeAminoType extends AminoMsg { @@ -9,10 +8,7 @@ export interface MsgSoftwareUpgradeAminoType extends AminoMsg { authority: string; plan: { name: string; - time: { - seconds: string; - nanos: number; - }; + time: string; height: string; info: string; upgraded_client_state: { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/upgrade/v1beta1/upgrade.ts b/__fixtures__/v-next/outputosmojs/cosmos/upgrade/v1beta1/upgrade.ts index 5dd3388fc7..58e6c16733 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/upgrade/v1beta1/upgrade.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/upgrade/v1beta1/upgrade.ts @@ -247,7 +247,7 @@ export const Plan = { fromAmino(object: PlanAmino): Plan { return { name: object.name, - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), height: BigInt(object.height), info: object.info, upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined @@ -256,7 +256,7 @@ export const Plan = { toAmino(message: Plan): PlanAmino { const obj: any = {}; obj.name = message.name; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.height = message.height ? message.height.toString() : undefined; obj.info = message.info; obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; diff --git a/__fixtures__/v-next/outputosmojs/evmos/claims/v1/genesis.ts b/__fixtures__/v-next/outputosmojs/evmos/claims/v1/genesis.ts index 63946174ed..0ba572f046 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/claims/v1/genesis.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/claims/v1/genesis.ts @@ -324,7 +324,7 @@ export const Params = { fromAmino(object: ParamsAmino): Params { return { enableClaims: object.enable_claims, - airdropStartTime: object.airdrop_start_time, + airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimsDenom: object.claims_denom, @@ -335,7 +335,7 @@ export const Params = { toAmino(message: Params): ParamsAmino { const obj: any = {}; obj.enable_claims = message.enableClaims; - obj.airdrop_start_time = message.airdropStartTime; + obj.airdrop_start_time = message.airdropStartTime ? Timestamp.toAmino(toTimestamp(message.airdropStartTime)) : undefined; obj.duration_until_decay = message.durationUntilDecay ? Duration.toAmino(message.durationUntilDecay) : undefined; obj.duration_of_decay = message.durationOfDecay ? Duration.toAmino(message.durationOfDecay) : undefined; obj.claims_denom = message.claimsDenom; diff --git a/__fixtures__/v-next/outputosmojs/evmos/epochs/v1/genesis.ts b/__fixtures__/v-next/outputosmojs/evmos/epochs/v1/genesis.ts index 82dad62b17..86f4cd6819 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/epochs/v1/genesis.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/epochs/v1/genesis.ts @@ -178,10 +178,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: object.current_epoch_start_time, + currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; @@ -189,10 +189,10 @@ export const EpochInfo = { toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime; + obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(toTimestamp(message.currentEpochStartTime)) : undefined; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputosmojs/evmos/incentives/v1/incentives.ts b/__fixtures__/v-next/outputosmojs/evmos/incentives/v1/incentives.ts index 7d4af1c096..4c5ae12581 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/incentives/v1/incentives.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/incentives/v1/incentives.ts @@ -222,7 +222,7 @@ export const Incentive = { contract: object.contract, allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => DecCoin.fromAmino(e)) : [], epochs: object.epochs, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), totalGas: BigInt(object.total_gas) }; }, @@ -235,7 +235,7 @@ export const Incentive = { obj.allocations = []; } obj.epochs = message.epochs; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.total_gas = message.totalGas ? message.totalGas.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.amino.ts b/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.amino.ts index a11da2a219..ef55f48dca 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.amino.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.amino.ts @@ -8,10 +8,7 @@ export interface MsgCreateClawbackVestingAccountAminoType extends AminoMsg { value: { from_address: string; to_address: string; - start_time: { - seconds: string; - nanos: number; - }; + start_time: string; lockup_periods: { length: string; amount: { diff --git a/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.ts b/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.ts index 57395d834c..a83c04c79e 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.ts @@ -236,7 +236,7 @@ export const MsgCreateClawbackVestingAccount = { return { fromAddress: object.from_address, toAddress: object.to_address, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [], merge: object.merge @@ -246,7 +246,7 @@ export const MsgCreateClawbackVestingAccount = { const obj: any = {}; obj.from_address = message.fromAddress; obj.to_address = message.toAddress; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; if (message.lockupPeriods) { obj.lockup_periods = message.lockupPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/vesting.ts b/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/vesting.ts index d890b9a211..40b3c0c8ac 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/vesting.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/vesting.ts @@ -173,7 +173,7 @@ export const ClawbackVestingAccount = { return { baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined, funderAddress: object.funder_address, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [] }; @@ -182,7 +182,7 @@ export const ClawbackVestingAccount = { const obj: any = {}; obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; obj.funder_address = message.funderAddress; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; if (message.lockupPeriods) { obj.lockup_periods = message.lockupPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputosmojs/google/api/distribution.ts b/__fixtures__/v-next/outputosmojs/google/api/distribution.ts index f65fba9e38..9e2b8a6e46 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/distribution.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/distribution.ts @@ -1193,14 +1193,14 @@ export const Distribution_Exemplar = { fromAmino(object: Distribution_ExemplarAmino): Distribution_Exemplar { return { value: object.value, - timestamp: object?.timestamp, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, attachments: Array.isArray(object?.attachments) ? object.attachments.map((e: any) => Any.fromAmino(e)) : [] }; }, toAmino(message: Distribution_Exemplar): Distribution_ExemplarAmino { const obj: any = {}; obj.value = message.value; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; if (message.attachments) { obj.attachments = message.attachments.map(e => e ? Any.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputosmojs/google/api/expr/v1alpha1/syntax.ts b/__fixtures__/v-next/outputosmojs/google/api/expr/v1alpha1/syntax.ts index 165828be6a..f941adad86 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/expr/v1alpha1/syntax.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/expr/v1alpha1/syntax.ts @@ -1854,7 +1854,7 @@ export const Constant = { stringValue: object?.string_value, bytesValue: object?.bytes_value, durationValue: object?.duration_value ? Duration.fromAmino(object.duration_value) : undefined, - timestampValue: object?.timestamp_value + timestampValue: object?.timestamp_value ? fromTimestamp(Timestamp.fromAmino(object.timestamp_value)) : undefined }; }, toAmino(message: Constant): ConstantAmino { @@ -1867,7 +1867,7 @@ export const Constant = { obj.string_value = message.stringValue; obj.bytes_value = message.bytesValue; obj.duration_value = message.durationValue ? Duration.toAmino(message.durationValue) : undefined; - obj.timestamp_value = message.timestampValue; + obj.timestamp_value = message.timestampValue ? Timestamp.toAmino(toTimestamp(message.timestampValue)) : undefined; return obj; }, fromAminoMsg(object: ConstantAminoMsg): Constant { diff --git a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/log_entry.ts b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/log_entry.ts index 53c0168307..f9383d5c8d 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/log_entry.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/log_entry.ts @@ -515,7 +515,7 @@ export const LogEntry = { fromAmino(object: LogEntryAmino): LogEntry { return { name: object.name, - timestamp: object?.timestamp, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, trace: object.trace, @@ -536,7 +536,7 @@ export const LogEntry = { toAmino(message: LogEntry): LogEntryAmino { const obj: any = {}; obj.name = message.name; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.severity = message.severity; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; obj.trace = message.trace; diff --git a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/metric_value.ts b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/metric_value.ts index eb54a464b9..a5be14599e 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/metric_value.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/metric_value.ts @@ -385,8 +385,8 @@ export const MetricValue = { acc[key] = String(value); return acc; }, {}) : {}, - startTime: object?.start_time, - endTime: object?.end_time, + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, boolValue: object?.bool_value, int64Value: object?.int64_value ? BigInt(object.int64_value) : undefined, doubleValue: object?.double_value, @@ -402,8 +402,8 @@ export const MetricValue = { obj.labels[k] = v; }); } - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.bool_value = message.boolValue; obj.int64_value = message.int64Value ? message.int64Value.toString() : undefined; obj.double_value = message.doubleValue; diff --git a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/operation.ts b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/operation.ts index 740d000a24..2fb8c5602b 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/operation.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/operation.ts @@ -497,8 +497,8 @@ export const Operation = { operationId: object.operation_id, operationName: object.operation_name, consumerId: object.consumer_id, - startTime: object?.start_time, - endTime: object?.end_time, + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ [key: string]: string; }>((acc, [key, value]) => { @@ -516,8 +516,8 @@ export const Operation = { obj.operation_id = message.operationId; obj.operation_name = message.operationName; obj.consumer_id = message.consumerId; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.labels = {}; if (message.labels) { Object.entries(message.labels).forEach(([k, v]) => { diff --git a/__fixtures__/v-next/outputosmojs/google/api/servicemanagement/v1/resources.ts b/__fixtures__/v-next/outputosmojs/google/api/servicemanagement/v1/resources.ts index 676cd36246..5bd590ea1d 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/servicemanagement/v1/resources.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/servicemanagement/v1/resources.ts @@ -818,7 +818,7 @@ export const OperationMetadata = { resourceNames: Array.isArray(object?.resource_names) ? object.resource_names.map((e: any) => e) : [], steps: Array.isArray(object?.steps) ? object.steps.map((e: any) => OperationMetadata_Step.fromAmino(e)) : [], progressPercentage: object.progress_percentage, - startTime: object?.start_time + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined }; }, toAmino(message: OperationMetadata): OperationMetadataAmino { @@ -834,7 +834,7 @@ export const OperationMetadata = { obj.steps = []; } obj.progress_percentage = message.progressPercentage; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: OperationMetadataAminoMsg): OperationMetadata { @@ -1624,7 +1624,7 @@ export const Rollout = { fromAmino(object: RolloutAmino): Rollout { return { rolloutId: object.rollout_id, - createTime: object?.create_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, createdBy: object.created_by, status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: object?.traffic_percent_strategy ? Rollout_TrafficPercentStrategy.fromAmino(object.traffic_percent_strategy) : undefined, @@ -1635,7 +1635,7 @@ export const Rollout = { toAmino(message: Rollout): RolloutAmino { const obj: any = {}; obj.rollout_id = message.rolloutId; - obj.create_time = message.createTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; obj.created_by = message.createdBy; obj.status = message.status; obj.traffic_percent_strategy = message.trafficPercentStrategy ? Rollout_TrafficPercentStrategy.toAmino(message.trafficPercentStrategy) : undefined; diff --git a/__fixtures__/v-next/outputosmojs/google/logging/v2/log_entry.ts b/__fixtures__/v-next/outputosmojs/google/logging/v2/log_entry.ts index ee25ce5bc5..fdab428676 100644 --- a/__fixtures__/v-next/outputosmojs/google/logging/v2/log_entry.ts +++ b/__fixtures__/v-next/outputosmojs/google/logging/v2/log_entry.ts @@ -708,8 +708,8 @@ export const LogEntry = { protoPayload: object?.proto_payload ? Any.fromAmino(object.proto_payload) : undefined, textPayload: object?.text_payload, jsonPayload: object?.json_payload ? Struct.fromAmino(object.json_payload) : undefined, - timestamp: object?.timestamp, - receiveTimestamp: object?.receive_timestamp, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, + receiveTimestamp: object?.receive_timestamp ? fromTimestamp(Timestamp.fromAmino(object.receive_timestamp)) : undefined, severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: object.insert_id, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, @@ -734,8 +734,8 @@ export const LogEntry = { obj.proto_payload = message.protoPayload ? Any.toAmino(message.protoPayload) : undefined; obj.text_payload = message.textPayload; obj.json_payload = message.jsonPayload ? Struct.toAmino(message.jsonPayload) : undefined; - obj.timestamp = message.timestamp; - obj.receive_timestamp = message.receiveTimestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.receive_timestamp = message.receiveTimestamp ? Timestamp.toAmino(toTimestamp(message.receiveTimestamp)) : undefined; obj.severity = message.severity; obj.insert_id = message.insertId; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; diff --git a/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_config.ts b/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_config.ts index 05366674a0..a394f3c5a9 100644 --- a/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_config.ts +++ b/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_config.ts @@ -1917,8 +1917,8 @@ export const LogBucket = { return { name: object.name, description: object.description, - createTime: object?.create_time, - updateTime: object?.update_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, retentionDays: object.retention_days, locked: object.locked, lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : -1, @@ -1930,8 +1930,8 @@ export const LogBucket = { const obj: any = {}; obj.name = message.name; obj.description = message.description; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; obj.retention_days = message.retentionDays; obj.locked = message.locked; obj.lifecycle_state = message.lifecycleState; @@ -2075,8 +2075,8 @@ export const LogView = { return { name: object.name, description: object.description, - createTime: object?.create_time, - updateTime: object?.update_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, filter: object.filter }; }, @@ -2084,8 +2084,8 @@ export const LogView = { const obj: any = {}; obj.name = message.name; obj.description = message.description; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; obj.filter = message.filter; return obj; }, @@ -2328,8 +2328,8 @@ export const LogSink = { writerIdentity: object.writer_identity, includeChildren: object.include_children, bigqueryOptions: object?.bigquery_options ? BigQueryOptions.fromAmino(object.bigquery_options) : undefined, - createTime: object?.create_time, - updateTime: object?.update_time + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined }; }, toAmino(message: LogSink): LogSinkAmino { @@ -2348,8 +2348,8 @@ export const LogSink = { obj.writer_identity = message.writerIdentity; obj.include_children = message.includeChildren; obj.bigquery_options = message.bigqueryOptions ? BigQueryOptions.toAmino(message.bigqueryOptions) : undefined; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; return obj; }, fromAminoMsg(object: LogSinkAminoMsg): LogSink { @@ -4600,8 +4600,8 @@ export const LogExclusion = { description: object.description, filter: object.filter, disabled: object.disabled, - createTime: object?.create_time, - updateTime: object?.update_time + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined }; }, toAmino(message: LogExclusion): LogExclusionAmino { @@ -4610,8 +4610,8 @@ export const LogExclusion = { obj.description = message.description; obj.filter = message.filter; obj.disabled = message.disabled; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; return obj; }, fromAminoMsg(object: LogExclusionAminoMsg): LogExclusion { @@ -6170,8 +6170,8 @@ export const CopyLogEntriesMetadata = { }, fromAmino(object: CopyLogEntriesMetadataAmino): CopyLogEntriesMetadata { return { - startTime: object?.start_time, - endTime: object?.end_time, + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: object.cancellation_requested, request: object?.request ? CopyLogEntriesRequest.fromAmino(object.request) : undefined, @@ -6181,8 +6181,8 @@ export const CopyLogEntriesMetadata = { }, toAmino(message: CopyLogEntriesMetadata): CopyLogEntriesMetadataAmino { const obj: any = {}; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.state = message.state; obj.cancellation_requested = message.cancellationRequested; obj.request = message.request ? CopyLogEntriesRequest.toAmino(message.request) : undefined; diff --git a/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_metrics.ts b/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_metrics.ts index 97dd806541..06ab2f8e25 100644 --- a/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_metrics.ts +++ b/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_metrics.ts @@ -687,8 +687,8 @@ export const LogMetric = { return acc; }, {}) : {}, bucketOptions: object?.bucket_options ? Distribution_BucketOptions.fromAmino(object.bucket_options) : undefined, - createTime: object?.create_time, - updateTime: object?.update_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, @@ -707,8 +707,8 @@ export const LogMetric = { }); } obj.bucket_options = message.bucketOptions ? Distribution_BucketOptions.toAmino(message.bucketOptions) : undefined; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; obj.version = message.version; return obj; }, diff --git a/__fixtures__/v-next/outputosmojs/google/protobuf/timestamp.ts b/__fixtures__/v-next/outputosmojs/google/protobuf/timestamp.ts index 16549552ad..8728e15913 100644 --- a/__fixtures__/v-next/outputosmojs/google/protobuf/timestamp.ts +++ b/__fixtures__/v-next/outputosmojs/google/protobuf/timestamp.ts @@ -269,7 +269,7 @@ export const Timestamp = { return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - return fromTimestamp(message).toString(); + return fromTimestamp(message).toISOString(); }, fromAminoMsg(object: TimestampAminoMsg): Timestamp { return Timestamp.fromAmino(object.value); diff --git a/__fixtures__/v-next/outputosmojs/google/rpc/context/attribute_context.ts b/__fixtures__/v-next/outputosmojs/google/rpc/context/attribute_context.ts index 6a269c4f2f..6ec36e4d28 100644 --- a/__fixtures__/v-next/outputosmojs/google/rpc/context/attribute_context.ts +++ b/__fixtures__/v-next/outputosmojs/google/rpc/context/attribute_context.ts @@ -1718,7 +1718,7 @@ export const AttributeContext_Request = { host: object.host, scheme: object.scheme, query: object.query, - time: object?.time, + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, size: BigInt(object.size), protocol: object.protocol, reason: object.reason, @@ -1739,7 +1739,7 @@ export const AttributeContext_Request = { obj.host = message.host; obj.scheme = message.scheme; obj.query = message.query; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.size = message.size ? message.size.toString() : undefined; obj.protocol = message.protocol; obj.reason = message.reason; @@ -2016,7 +2016,7 @@ export const AttributeContext_Response = { acc[key] = String(value); return acc; }, {}) : {}, - time: object?.time, + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, backendLatency: object?.backend_latency ? Duration.fromAmino(object.backend_latency) : undefined }; }, @@ -2030,7 +2030,7 @@ export const AttributeContext_Response = { obj.headers[k] = v; }); } - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.backend_latency = message.backendLatency ? Duration.toAmino(message.backendLatency) : undefined; return obj; }, @@ -2536,9 +2536,9 @@ export const AttributeContext_Resource = { return acc; }, {}) : {}, displayName: object.display_name, - createTime: object?.create_time, - updateTime: object?.update_time, - deleteTime: object?.delete_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, + deleteTime: object?.delete_time ? fromTimestamp(Timestamp.fromAmino(object.delete_time)) : undefined, etag: object.etag, location: object.location }; @@ -2562,9 +2562,9 @@ export const AttributeContext_Resource = { }); } obj.display_name = message.displayName; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; - obj.delete_time = message.deleteTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; + obj.delete_time = message.deleteTime ? Timestamp.toAmino(toTimestamp(message.deleteTime)) : undefined; obj.etag = message.etag; obj.location = message.location; return obj; diff --git a/__fixtures__/v-next/outputosmojs/ibc/lightclients/tendermint/v1/tendermint.ts b/__fixtures__/v-next/outputosmojs/ibc/lightclients/tendermint/v1/tendermint.ts index 7082f66f69..b880ed41c7 100644 --- a/__fixtures__/v-next/outputosmojs/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/__fixtures__/v-next/outputosmojs/ibc/lightclients/tendermint/v1/tendermint.ts @@ -533,14 +533,14 @@ export const ConsensusState = { }, fromAmino(object: ConsensusStateAmino): ConsensusState { return { - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined, nextValidatorsHash: object.next_validators_hash }; }, toAmino(message: ConsensusState): ConsensusStateAmino { const obj: any = {}; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.root = message.root ? MerkleRoot.toAmino(message.root) : undefined; obj.next_validators_hash = message.nextValidatorsHash; return obj; diff --git a/__fixtures__/v-next/outputosmojs/osmosis/claim/v1beta1/params.ts b/__fixtures__/v-next/outputosmojs/osmosis/claim/v1beta1/params.ts index b777aeb2b3..5d13162208 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/claim/v1beta1/params.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/claim/v1beta1/params.ts @@ -123,7 +123,7 @@ export const Params = { }, fromAmino(object: ParamsAmino): Params { return { - airdropStartTime: object.airdrop_start_time, + airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimDenom: object.claim_denom @@ -131,7 +131,7 @@ export const Params = { }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.airdrop_start_time = message.airdropStartTime; + obj.airdrop_start_time = message.airdropStartTime ? Timestamp.toAmino(toTimestamp(message.airdropStartTime)) : undefined; obj.duration_until_decay = message.durationUntilDecay ? Duration.toAmino(message.durationUntilDecay) : undefined; obj.duration_of_decay = message.durationOfDecay ? Duration.toAmino(message.durationOfDecay) : undefined; obj.claim_denom = message.claimDenom; diff --git a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/incentive_record.ts b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/incentive_record.ts index f88e5e136a..fe645905f9 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/incentive_record.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/incentive_record.ts @@ -316,14 +316,14 @@ export const IncentiveRecordBody = { return { remainingAmount: object.remaining_amount, emissionRate: object.emission_rate, - startTime: object.start_time + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)) }; }, toAmino(message: IncentiveRecordBody): IncentiveRecordBodyAmino { const obj: any = {}; obj.remaining_amount = message.remainingAmount; obj.emission_rate = message.emissionRate; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: IncentiveRecordBodyAminoMsg): IncentiveRecordBody { diff --git a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/pool.ts b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/pool.ts index 966f0ef188..a77bac378a 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/pool.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/pool.ts @@ -263,7 +263,7 @@ export const Pool = { tickSpacing: BigInt(object.tick_spacing), exponentAtPriceOne: object.exponent_at_price_one, swapFee: object.swap_fee, - lastLiquidityUpdate: object.last_liquidity_update + lastLiquidityUpdate: fromTimestamp(Timestamp.fromAmino(object.last_liquidity_update)) }; }, toAmino(message: Pool): PoolAmino { @@ -279,7 +279,7 @@ export const Pool = { obj.tick_spacing = message.tickSpacing ? message.tickSpacing.toString() : undefined; obj.exponent_at_price_one = message.exponentAtPriceOne; obj.swap_fee = message.swapFee; - obj.last_liquidity_update = message.lastLiquidityUpdate; + obj.last_liquidity_update = message.lastLiquidityUpdate ? Timestamp.toAmino(toTimestamp(message.lastLiquidityUpdate)) : undefined; return obj; }, fromAminoMsg(object: PoolAminoMsg): Pool { diff --git a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/position.ts b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/position.ts index 1ddf9c543b..9607b1e3cb 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/position.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/position.ts @@ -193,7 +193,7 @@ export const Position = { poolId: BigInt(object.pool_id), lowerTick: BigInt(object.lower_tick), upperTick: BigInt(object.upper_tick), - joinTime: object.join_time, + joinTime: fromTimestamp(Timestamp.fromAmino(object.join_time)), liquidity: object.liquidity }; }, @@ -204,7 +204,7 @@ export const Position = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.lower_tick = message.lowerTick ? message.lowerTick.toString() : undefined; obj.upper_tick = message.upperTick ? message.upperTick.toString() : undefined; - obj.join_time = message.joinTime; + obj.join_time = message.joinTime ? Timestamp.toAmino(toTimestamp(message.joinTime)) : undefined; obj.liquidity = message.liquidity; return obj; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/tx.ts b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/tx.ts index 1161fe5c86..c71e2c0690 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/tx.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/tx.ts @@ -505,7 +505,7 @@ export const MsgCreatePositionResponse = { positionId: BigInt(object.position_id), amount0: object.amount0, amount1: object.amount1, - joinTime: object.join_time, + joinTime: fromTimestamp(Timestamp.fromAmino(object.join_time)), liquidityCreated: object.liquidity_created }; }, @@ -514,7 +514,7 @@ export const MsgCreatePositionResponse = { obj.position_id = message.positionId ? message.positionId.toString() : undefined; obj.amount0 = message.amount0; obj.amount1 = message.amount1; - obj.join_time = message.joinTime; + obj.join_time = message.joinTime ? Timestamp.toAmino(toTimestamp(message.joinTime)) : undefined; obj.liquidity_created = message.liquidityCreated; return obj; }, @@ -1378,7 +1378,7 @@ export const MsgCreateIncentive = { incentiveDenom: object.incentive_denom, incentiveAmount: object.incentive_amount, emissionRate: object.emission_rate, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), minUptime: object?.min_uptime ? Duration.fromAmino(object.min_uptime) : undefined }; }, @@ -1389,7 +1389,7 @@ export const MsgCreateIncentive = { obj.incentive_denom = message.incentiveDenom; obj.incentive_amount = message.incentiveAmount; obj.emission_rate = message.emissionRate; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.min_uptime = message.minUptime ? Duration.toAmino(message.minUptime) : undefined; return obj; }, @@ -1532,7 +1532,7 @@ export const MsgCreateIncentiveResponse = { incentiveDenom: object.incentive_denom, incentiveAmount: object.incentive_amount, emissionRate: object.emission_rate, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), minUptime: object?.min_uptime ? Duration.fromAmino(object.min_uptime) : undefined }; }, @@ -1541,7 +1541,7 @@ export const MsgCreateIncentiveResponse = { obj.incentive_denom = message.incentiveDenom; obj.incentive_amount = message.incentiveAmount; obj.emission_rate = message.emissionRate; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.min_uptime = message.minUptime ? Duration.toAmino(message.minUptime) : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/genesis.ts b/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/genesis.ts index 23725d2adc..4f9c404c72 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/genesis.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/genesis.ts @@ -105,13 +105,13 @@ export const GenesisDowntimeEntry = { fromAmino(object: GenesisDowntimeEntryAmino): GenesisDowntimeEntry { return { duration: isSet(object.duration) ? downtimeFromJSON(object.duration) : -1, - lastDowntime: object.last_downtime + lastDowntime: fromTimestamp(Timestamp.fromAmino(object.last_downtime)) }; }, toAmino(message: GenesisDowntimeEntry): GenesisDowntimeEntryAmino { const obj: any = {}; obj.duration = message.duration; - obj.last_downtime = message.lastDowntime; + obj.last_downtime = message.lastDowntime ? Timestamp.toAmino(toTimestamp(message.lastDowntime)) : undefined; return obj; }, fromAminoMsg(object: GenesisDowntimeEntryAminoMsg): GenesisDowntimeEntry { @@ -220,7 +220,7 @@ export const GenesisState = { fromAmino(object: GenesisStateAmino): GenesisState { return { downtimes: Array.isArray(object?.downtimes) ? object.downtimes.map((e: any) => GenesisDowntimeEntry.fromAmino(e)) : [], - lastBlockTime: object.last_block_time + lastBlockTime: fromTimestamp(Timestamp.fromAmino(object.last_block_time)) }; }, toAmino(message: GenesisState): GenesisStateAmino { @@ -230,7 +230,7 @@ export const GenesisState = { } else { obj.downtimes = []; } - obj.last_block_time = message.lastBlockTime; + obj.last_block_time = message.lastBlockTime ? Timestamp.toAmino(toTimestamp(message.lastBlockTime)) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/__fixtures__/v-next/outputosmojs/osmosis/epochs/genesis.ts b/__fixtures__/v-next/outputosmojs/osmosis/epochs/genesis.ts index 39be7f9e3e..d6d25a5697 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/epochs/genesis.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/epochs/genesis.ts @@ -231,10 +231,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: object.current_epoch_start_time, + currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; @@ -242,10 +242,10 @@ export const EpochInfo = { toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime; + obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(toTimestamp(message.currentEpochStartTime)) : undefined; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputosmojs/osmosis/gamm/pool-models/balancer/balancerPool.ts b/__fixtures__/v-next/outputosmojs/osmosis/gamm/pool-models/balancer/balancerPool.ts index 2d6dbf9589..d6b97b1f50 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/gamm/pool-models/balancer/balancerPool.ts @@ -277,7 +277,7 @@ export const SmoothWeightChangeParams = { }, fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { return { - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, initialPoolWeights: Array.isArray(object?.initial_pool_weights) ? object.initial_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [], targetPoolWeights: Array.isArray(object?.target_pool_weights) ? object.target_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [] @@ -285,7 +285,7 @@ export const SmoothWeightChangeParams = { }, toAmino(message: SmoothWeightChangeParams): SmoothWeightChangeParamsAmino { const obj: any = {}; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; if (message.initialPoolWeights) { obj.initial_pool_weights = message.initialPoolWeights.map(e => e ? PoolAsset.toAmino(e) : undefined); diff --git a/__fixtures__/v-next/outputosmojs/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts b/__fixtures__/v-next/outputosmojs/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts index ad8f12c620..e481a8e582 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts @@ -1,7 +1,6 @@ //@ts-nocheck import { PoolParams, PoolParamsSDKType, PoolAsset, PoolAssetSDKType, SmoothWeightChangeParams, SmoothWeightChangeParamsSDKType } from "../balancerPool"; import { AminoMsg } from "@cosmjs/amino"; -import { Timestamp, TimestampSDKType } from "../../../../../google/protobuf/timestamp"; import { Duration, DurationSDKType } from "../../../../../google/protobuf/duration"; import { Coin, CoinSDKType } from "../../../../../cosmos/base/v1beta1/coin"; import { MsgCreateBalancerPool, MsgCreateBalancerPoolSDKType } from "./tx"; @@ -13,10 +12,7 @@ export interface MsgCreateBalancerPoolAminoType extends AminoMsg { swap_fee: string; exit_fee: string; smooth_weight_change_params: { - start_time: { - seconds: string; - nanos: number; - }; + start_time: string; duration: { seconds: string; nanos: number; diff --git a/__fixtures__/v-next/outputosmojs/osmosis/incentives/gauge.ts b/__fixtures__/v-next/outputosmojs/osmosis/incentives/gauge.ts index 028fc78fd5..72aa38c38a 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/incentives/gauge.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/incentives/gauge.ts @@ -249,7 +249,7 @@ export const Gauge = { isPerpetual: object.is_perpetual, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), numEpochsPaidOver: BigInt(object.num_epochs_paid_over), filledEpochs: BigInt(object.filled_epochs), distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : [] @@ -265,7 +265,7 @@ export const Gauge = { } else { obj.coins = []; } - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; obj.filled_epochs = message.filledEpochs ? message.filledEpochs.toString() : undefined; if (message.distributedCoins) { diff --git a/__fixtures__/v-next/outputosmojs/osmosis/incentives/tx.amino.ts b/__fixtures__/v-next/outputosmojs/osmosis/incentives/tx.amino.ts index a00674a250..fc284ed915 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/incentives/tx.amino.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/incentives/tx.amino.ts @@ -17,19 +17,13 @@ export interface MsgCreateGaugeAminoType extends AminoMsg { seconds: string; nanos: number; }; - timestamp: { - seconds: string; - nanos: number; - }; + timestamp: string; }; coins: { denom: string; amount: string; }[]; - start_time: { - seconds: string; - nanos: number; - }; + start_time: string; num_epochs_paid_over: string; }; } diff --git a/__fixtures__/v-next/outputosmojs/osmosis/incentives/tx.ts b/__fixtures__/v-next/outputosmojs/osmosis/incentives/tx.ts index ae8bcb2189..d43ee74014 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/incentives/tx.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/incentives/tx.ts @@ -214,7 +214,7 @@ export const MsgCreateGauge = { owner: object.owner, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), numEpochsPaidOver: BigInt(object.num_epochs_paid_over) }; }, @@ -228,7 +228,7 @@ export const MsgCreateGauge = { } else { obj.coins = []; } - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/lockup/lock.ts b/__fixtures__/v-next/outputosmojs/osmosis/lockup/lock.ts index fcf0de3d5f..210e66af5f 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/lockup/lock.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/lockup/lock.ts @@ -297,7 +297,7 @@ export const PeriodLock = { ID: BigInt(object.ID), owner: object.owner, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - endTime: object.end_time, + endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] }; }, @@ -306,7 +306,7 @@ export const PeriodLock = { obj.ID = message.ID ? message.ID.toString() : undefined; obj.owner = message.owner; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.end_time = message.endTime; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; if (message.coins) { obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); } else { @@ -440,7 +440,7 @@ export const QueryCondition = { lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object.denom, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: QueryCondition): QueryConditionAmino { @@ -448,7 +448,7 @@ export const QueryCondition = { obj.lock_query_type = message.lockQueryType; obj.denom = message.denom; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: QueryConditionAminoMsg): QueryCondition { @@ -576,7 +576,7 @@ export const SyntheticLock = { return { underlyingLockId: BigInt(object.underlying_lock_id), synthDenom: object.synth_denom, - endTime: object.end_time, + endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined }; }, @@ -584,7 +584,7 @@ export const SyntheticLock = { const obj: any = {}; obj.underlying_lock_id = message.underlyingLockId ? message.underlyingLockId.toString() : undefined; obj.synth_denom = message.synthDenom; - obj.end_time = message.endTime; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/lockup/query.ts b/__fixtures__/v-next/outputosmojs/osmosis/lockup/query.ts index bf6400823e..2cff50ddb1 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/lockup/query.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/lockup/query.ts @@ -1372,13 +1372,13 @@ export const AccountLockedPastTimeRequest = { fromAmino(object: AccountLockedPastTimeRequestAmino): AccountLockedPastTimeRequest { return { owner: object.owner, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: AccountLockedPastTimeRequest): AccountLockedPastTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountLockedPastTimeRequestAminoMsg): AccountLockedPastTimeRequest { @@ -1583,13 +1583,13 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino): AccountLockedPastTimeNotUnlockingOnlyRequest { return { owner: object.owner, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyRequest): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg): AccountLockedPastTimeNotUnlockingOnlyRequest { @@ -1794,13 +1794,13 @@ export const AccountUnlockedBeforeTimeRequest = { fromAmino(object: AccountUnlockedBeforeTimeRequestAmino): AccountUnlockedBeforeTimeRequest { return { owner: object.owner, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: AccountUnlockedBeforeTimeRequest): AccountUnlockedBeforeTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountUnlockedBeforeTimeRequestAminoMsg): AccountUnlockedBeforeTimeRequest { @@ -2018,14 +2018,14 @@ export const AccountLockedPastTimeDenomRequest = { fromAmino(object: AccountLockedPastTimeDenomRequestAmino): AccountLockedPastTimeDenomRequest { return { owner: object.owner, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), denom: object.denom }; }, toAmino(message: AccountLockedPastTimeDenomRequest): AccountLockedPastTimeDenomRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.denom = message.denom; return obj; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/query.ts b/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/query.ts index 1511c8ac6b..f3ceb450b0 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/query.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/query.ts @@ -191,8 +191,8 @@ export const ArithmeticTwapRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: object.start_time, - endTime: object?.end_time + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined }; }, toAmino(message: ArithmeticTwapRequest): ArithmeticTwapRequestAmino { @@ -200,8 +200,8 @@ export const ArithmeticTwapRequest = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; return obj; }, fromAminoMsg(object: ArithmeticTwapRequestAminoMsg): ArithmeticTwapRequest { @@ -422,7 +422,7 @@ export const ArithmeticTwapToNowRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: object.start_time + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)) }; }, toAmino(message: ArithmeticTwapToNowRequest): ArithmeticTwapToNowRequestAmino { @@ -430,7 +430,7 @@ export const ArithmeticTwapToNowRequest = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: ArithmeticTwapToNowRequestAminoMsg): ArithmeticTwapToNowRequest { diff --git a/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/twap_record.ts b/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/twap_record.ts index 9286bd4e5b..a084797b33 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/twap_record.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/twap_record.ts @@ -248,12 +248,12 @@ export const TwapRecord = { asset0Denom: object.asset0_denom, asset1Denom: object.asset1_denom, height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), p0LastSpotPrice: object.p0_last_spot_price, p1LastSpotPrice: object.p1_last_spot_price, p0ArithmeticTwapAccumulator: object.p0_arithmetic_twap_accumulator, p1ArithmeticTwapAccumulator: object.p1_arithmetic_twap_accumulator, - lastErrorTime: object.last_error_time + lastErrorTime: fromTimestamp(Timestamp.fromAmino(object.last_error_time)) }; }, toAmino(message: TwapRecord): TwapRecordAmino { @@ -262,12 +262,12 @@ export const TwapRecord = { obj.asset0_denom = message.asset0Denom; obj.asset1_denom = message.asset1Denom; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.p0_last_spot_price = message.p0LastSpotPrice; obj.p1_last_spot_price = message.p1LastSpotPrice; obj.p0_arithmetic_twap_accumulator = message.p0ArithmeticTwapAccumulator; obj.p1_arithmetic_twap_accumulator = message.p1ArithmeticTwapAccumulator; - obj.last_error_time = message.lastErrorTime; + obj.last_error_time = message.lastErrorTime ? Timestamp.toAmino(toTimestamp(message.lastErrorTime)) : undefined; return obj; }, fromAminoMsg(object: TwapRecordAminoMsg): TwapRecord { diff --git a/__fixtures__/v-next/outputosmojs/tendermint/abci/types.ts b/__fixtures__/v-next/outputosmojs/tendermint/abci/types.ts index 4c5bf8cabc..b3d5ad4e5a 100644 --- a/__fixtures__/v-next/outputosmojs/tendermint/abci/types.ts +++ b/__fixtures__/v-next/outputosmojs/tendermint/abci/types.ts @@ -1717,7 +1717,7 @@ export const RequestInitChain = { }, fromAmino(object: RequestInitChainAmino): RequestInitChain { return { - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), chainId: object.chain_id, consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], @@ -1727,7 +1727,7 @@ export const RequestInitChain = { }, toAmino(message: RequestInitChain): RequestInitChainAmino { const obj: any = {}; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.chain_id = message.chainId; obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; if (message.validators) { @@ -6201,7 +6201,7 @@ export const Evidence = { type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), totalVotingPower: BigInt(object.total_voting_power) }; }, @@ -6210,7 +6210,7 @@ export const Evidence = { obj.type = message.type; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputosmojs/tendermint/p2p/types.ts b/__fixtures__/v-next/outputosmojs/tendermint/p2p/types.ts index 0bfb3d934c..87221ae8d4 100644 --- a/__fixtures__/v-next/outputosmojs/tendermint/p2p/types.ts +++ b/__fixtures__/v-next/outputosmojs/tendermint/p2p/types.ts @@ -588,7 +588,7 @@ export const PeerInfo = { return { id: object.id, addressInfo: Array.isArray(object?.address_info) ? object.address_info.map((e: any) => PeerAddressInfo.fromAmino(e)) : [], - lastConnected: object?.last_connected + lastConnected: object?.last_connected ? fromTimestamp(Timestamp.fromAmino(object.last_connected)) : undefined }; }, toAmino(message: PeerInfo): PeerInfoAmino { @@ -599,7 +599,7 @@ export const PeerInfo = { } else { obj.address_info = []; } - obj.last_connected = message.lastConnected; + obj.last_connected = message.lastConnected ? Timestamp.toAmino(toTimestamp(message.lastConnected)) : undefined; return obj; }, fromAminoMsg(object: PeerInfoAminoMsg): PeerInfo { @@ -720,16 +720,16 @@ export const PeerAddressInfo = { fromAmino(object: PeerAddressInfoAmino): PeerAddressInfo { return { address: object.address, - lastDialSuccess: object?.last_dial_success, - lastDialFailure: object?.last_dial_failure, + lastDialSuccess: object?.last_dial_success ? fromTimestamp(Timestamp.fromAmino(object.last_dial_success)) : undefined, + lastDialFailure: object?.last_dial_failure ? fromTimestamp(Timestamp.fromAmino(object.last_dial_failure)) : undefined, dialFailures: object.dial_failures }; }, toAmino(message: PeerAddressInfo): PeerAddressInfoAmino { const obj: any = {}; obj.address = message.address; - obj.last_dial_success = message.lastDialSuccess; - obj.last_dial_failure = message.lastDialFailure; + obj.last_dial_success = message.lastDialSuccess ? Timestamp.toAmino(toTimestamp(message.lastDialSuccess)) : undefined; + obj.last_dial_failure = message.lastDialFailure ? Timestamp.toAmino(toTimestamp(message.lastDialFailure)) : undefined; obj.dial_failures = message.dialFailures; return obj; }, diff --git a/__fixtures__/v-next/outputosmojs/tendermint/types/evidence.ts b/__fixtures__/v-next/outputosmojs/tendermint/types/evidence.ts index 1c45b8b2ce..3e48c065d4 100644 --- a/__fixtures__/v-next/outputosmojs/tendermint/types/evidence.ts +++ b/__fixtures__/v-next/outputosmojs/tendermint/types/evidence.ts @@ -285,7 +285,7 @@ export const DuplicateVoteEvidence = { voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, totalVotingPower: BigInt(object.total_voting_power), validatorPower: BigInt(object.validator_power), - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { @@ -294,7 +294,7 @@ export const DuplicateVoteEvidence = { obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; obj.validator_power = message.validatorPower ? message.validatorPower.toString() : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: DuplicateVoteEvidenceAminoMsg): DuplicateVoteEvidence { @@ -439,7 +439,7 @@ export const LightClientAttackEvidence = { commonHeight: BigInt(object.common_height), byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], totalVotingPower: BigInt(object.total_voting_power), - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { @@ -452,7 +452,7 @@ export const LightClientAttackEvidence = { obj.byzantine_validators = []; } obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: LightClientAttackEvidenceAminoMsg): LightClientAttackEvidence { diff --git a/__fixtures__/v-next/outputosmojs/tendermint/types/types.ts b/__fixtures__/v-next/outputosmojs/tendermint/types/types.ts index de5a2deb4d..96322a15c0 100644 --- a/__fixtures__/v-next/outputosmojs/tendermint/types/types.ts +++ b/__fixtures__/v-next/outputosmojs/tendermint/types/types.ts @@ -900,7 +900,7 @@ export const Header = { version: object?.version ? Consensus.fromAmino(object.version) : undefined, chainId: object.chain_id, height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, lastCommitHash: object.last_commit_hash, dataHash: object.data_hash, @@ -918,7 +918,7 @@ export const Header = { obj.version = message.version ? Consensus.toAmino(message.version) : undefined; obj.chain_id = message.chainId; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; obj.last_commit_hash = message.lastCommitHash; obj.data_hash = message.dataHash; @@ -1202,7 +1202,7 @@ export const Vote = { height: BigInt(object.height), round: object.round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), validatorAddress: object.validator_address, validatorIndex: object.validator_index, signature: object.signature @@ -1214,7 +1214,7 @@ export const Vote = { obj.height = message.height ? message.height.toString() : undefined; obj.round = message.round; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.validator_address = message.validatorAddress; obj.validator_index = message.validatorIndex; obj.signature = message.signature; @@ -1482,7 +1482,7 @@ export const CommitSig = { return { blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object.validator_address, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), signature: object.signature }; }, @@ -1490,7 +1490,7 @@ export const CommitSig = { const obj: any = {}; obj.block_id_flag = message.blockIdFlag; obj.validator_address = message.validatorAddress; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.signature = message.signature; return obj; }, @@ -1655,7 +1655,7 @@ export const Proposal = { round: object.round, polRound: object.pol_round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), signature: object.signature }; }, @@ -1666,7 +1666,7 @@ export const Proposal = { obj.round = message.round; obj.pol_round = message.polRound; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.signature = message.signature; return obj; }, diff --git a/__fixtures__/v-next/outputv2/cosmos/authz/v1beta1/authz.ts b/__fixtures__/v-next/outputv2/cosmos/authz/v1beta1/authz.ts index 58771f7b8a..632c05e070 100644 --- a/__fixtures__/v-next/outputv2/cosmos/authz/v1beta1/authz.ts +++ b/__fixtures__/v-next/outputv2/cosmos/authz/v1beta1/authz.ts @@ -314,13 +314,13 @@ export const Grant = { fromAmino(object: GrantAmino): Grant { return { authorization: object?.authorization ? Authorization_FromAmino(object.authorization) : undefined, - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: Grant): GrantAmino { const obj: any = {}; obj.authorization = message.authorization ? Authorization_ToAmino((message.authorization as Any)) : undefined; - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: GrantAminoMsg): Grant { @@ -444,7 +444,7 @@ export const GrantAuthorization = { granter: object.granter, grantee: object.grantee, authorization: object?.authorization ? Authorization_FromAmino(object.authorization) : undefined, - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: GrantAuthorization): GrantAuthorizationAmino { @@ -452,7 +452,7 @@ export const GrantAuthorization = { obj.granter = message.granter; obj.grantee = message.grantee; obj.authorization = message.authorization ? Authorization_ToAmino((message.authorization as Any)) : undefined; - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { diff --git a/__fixtures__/v-next/outputv2/cosmos/evidence/v1beta1/evidence.ts b/__fixtures__/v-next/outputv2/cosmos/evidence/v1beta1/evidence.ts index 4613d801ed..8d546c1097 100644 --- a/__fixtures__/v-next/outputv2/cosmos/evidence/v1beta1/evidence.ts +++ b/__fixtures__/v-next/outputv2/cosmos/evidence/v1beta1/evidence.ts @@ -139,7 +139,7 @@ export const Equivocation = { fromAmino(object: EquivocationAmino): Equivocation { return { height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), power: BigInt(object.power), consensusAddress: object.consensus_address }; @@ -147,7 +147,7 @@ export const Equivocation = { toAmino(message: Equivocation): EquivocationAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.power = message.power ? message.power.toString() : undefined; obj.consensus_address = message.consensusAddress; return obj; diff --git a/__fixtures__/v-next/outputv2/cosmos/feegrant/v1beta1/feegrant.ts b/__fixtures__/v-next/outputv2/cosmos/feegrant/v1beta1/feegrant.ts index a261bd56da..b1f3976dd2 100644 --- a/__fixtures__/v-next/outputv2/cosmos/feegrant/v1beta1/feegrant.ts +++ b/__fixtures__/v-next/outputv2/cosmos/feegrant/v1beta1/feegrant.ts @@ -271,7 +271,7 @@ export const BasicAllowance = { fromAmino(object: BasicAllowanceAmino): BasicAllowance { return { spendLimit: Array.isArray(object?.spend_limit) ? object.spend_limit.map((e: any) => Coin.fromAmino(e)) : [], - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: BasicAllowance): BasicAllowanceAmino { @@ -281,7 +281,7 @@ export const BasicAllowance = { } else { obj.spend_limit = []; } - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: BasicAllowanceAminoMsg): BasicAllowance { @@ -437,7 +437,7 @@ export const PeriodicAllowance = { period: object?.period ? Duration.fromAmino(object.period) : undefined, periodSpendLimit: Array.isArray(object?.period_spend_limit) ? object.period_spend_limit.map((e: any) => Coin.fromAmino(e)) : [], periodCanSpend: Array.isArray(object?.period_can_spend) ? object.period_can_spend.map((e: any) => Coin.fromAmino(e)) : [], - periodReset: object.period_reset + periodReset: fromTimestamp(Timestamp.fromAmino(object.period_reset)) }; }, toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { @@ -454,7 +454,7 @@ export const PeriodicAllowance = { } else { obj.period_can_spend = []; } - obj.period_reset = message.periodReset; + obj.period_reset = message.periodReset ? Timestamp.toAmino(toTimestamp(message.periodReset)) : undefined; return obj; }, fromAminoMsg(object: PeriodicAllowanceAminoMsg): PeriodicAllowance { diff --git a/__fixtures__/v-next/outputv2/cosmos/gov/v1/gov.ts b/__fixtures__/v-next/outputv2/cosmos/gov/v1/gov.ts index 072d93f2b9..10986adca8 100644 --- a/__fixtures__/v-next/outputv2/cosmos/gov/v1/gov.ts +++ b/__fixtures__/v-next/outputv2/cosmos/gov/v1/gov.ts @@ -846,11 +846,11 @@ export const Proposal = { messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object?.submit_time, - depositEndTime: object?.deposit_end_time, + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined, + depositEndTime: object?.deposit_end_time ? fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)) : undefined, totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object?.voting_start_time, - votingEndTime: object?.voting_end_time, + votingStartTime: object?.voting_start_time ? fromTimestamp(Timestamp.fromAmino(object.voting_start_time)) : undefined, + votingEndTime: object?.voting_end_time ? fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) : undefined, metadata: object.metadata }; }, @@ -864,15 +864,15 @@ export const Proposal = { } obj.status = message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime; - obj.deposit_end_time = message.depositEndTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : undefined; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime; - obj.voting_end_time = message.votingEndTime; + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : undefined; + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : undefined; obj.metadata = message.metadata; return obj; }, diff --git a/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/gov.ts b/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/gov.ts index 56e97c0fde..78de719ca2 100644 --- a/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/gov.ts @@ -994,11 +994,11 @@ export const Proposal = { content: object?.content ? ProposalContentI_FromAmino(object.content) : undefined, status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object.submit_time, - depositEndTime: object.deposit_end_time, + submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), + depositEndTime: fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)), totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object.voting_start_time, - votingEndTime: object.voting_end_time + votingStartTime: fromTimestamp(Timestamp.fromAmino(object.voting_start_time)), + votingEndTime: fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) }; }, toAmino(message: Proposal): ProposalAmino { @@ -1007,15 +1007,15 @@ export const Proposal = { obj.content = message.content ? ProposalContentI_ToAmino((message.content as Any)) : undefined; obj.status = message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime; - obj.deposit_end_time = message.depositEndTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : undefined; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime; - obj.voting_end_time = message.votingEndTime; + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : undefined; + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : undefined; return obj; }, fromAminoMsg(object: ProposalAminoMsg): Proposal { diff --git a/__fixtures__/v-next/outputv2/cosmos/group/v1/types.ts b/__fixtures__/v-next/outputv2/cosmos/group/v1/types.ts index 500cdb62af..a9275c68f4 100644 --- a/__fixtures__/v-next/outputv2/cosmos/group/v1/types.ts +++ b/__fixtures__/v-next/outputv2/cosmos/group/v1/types.ts @@ -858,7 +858,7 @@ export const Member = { address: object.address, weight: object.weight, metadata: object.metadata, - addedAt: object.added_at + addedAt: fromTimestamp(Timestamp.fromAmino(object.added_at)) }; }, toAmino(message: Member): MemberAmino { @@ -866,7 +866,7 @@ export const Member = { obj.address = message.address; obj.weight = message.weight; obj.metadata = message.metadata; - obj.added_at = message.addedAt; + obj.added_at = message.addedAt ? Timestamp.toAmino(toTimestamp(message.addedAt)) : undefined; return obj; }, fromAminoMsg(object: MemberAminoMsg): Member { @@ -1434,7 +1434,7 @@ export const GroupInfo = { metadata: object.metadata, version: BigInt(object.version), totalWeight: object.total_weight, - createdAt: object.created_at + createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) }; }, toAmino(message: GroupInfo): GroupInfoAmino { @@ -1444,7 +1444,7 @@ export const GroupInfo = { obj.metadata = message.metadata; obj.version = message.version ? message.version.toString() : undefined; obj.total_weight = message.totalWeight; - obj.created_at = message.createdAt; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : undefined; return obj; }, fromAminoMsg(object: GroupInfoAminoMsg): GroupInfo { @@ -1717,7 +1717,7 @@ export const GroupPolicyInfo = { metadata: object.metadata, version: BigInt(object.version), decisionPolicy: object?.decision_policy ? DecisionPolicy_FromAmino(object.decision_policy) : undefined, - createdAt: object.created_at + createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) }; }, toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { @@ -1728,7 +1728,7 @@ export const GroupPolicyInfo = { obj.metadata = message.metadata; obj.version = message.version ? message.version.toString() : undefined; obj.decision_policy = message.decisionPolicy ? DecisionPolicy_ToAmino((message.decisionPolicy as Any)) : undefined; - obj.created_at = message.createdAt; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : undefined; return obj; }, fromAminoMsg(object: GroupPolicyInfoAminoMsg): GroupPolicyInfo { @@ -1983,13 +1983,13 @@ export const Proposal = { address: object.address, metadata: object.metadata, proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], - submitTime: object.submit_time, + submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), groupVersion: BigInt(object.group_version), groupPolicyVersion: BigInt(object.group_policy_version), status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - votingPeriodEnd: object.voting_period_end, + votingPeriodEnd: fromTimestamp(Timestamp.fromAmino(object.voting_period_end)), executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] }; @@ -2004,13 +2004,13 @@ export const Proposal = { } else { obj.proposers = []; } - obj.submit_time = message.submitTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; obj.group_version = message.groupVersion ? message.groupVersion.toString() : undefined; obj.group_policy_version = message.groupPolicyVersion ? message.groupPolicyVersion.toString() : undefined; obj.status = message.status; obj.result = message.result; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.voting_period_end = message.votingPeriodEnd; + obj.voting_period_end = message.votingPeriodEnd ? Timestamp.toAmino(toTimestamp(message.votingPeriodEnd)) : undefined; obj.executor_result = message.executorResult; if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); @@ -2283,7 +2283,7 @@ export const Vote = { voter: object.voter, option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata, - submitTime: object.submit_time + submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)) }; }, toAmino(message: Vote): VoteAmino { @@ -2292,7 +2292,7 @@ export const Vote = { obj.voter = message.voter; obj.option = message.option; obj.metadata = message.metadata; - obj.submit_time = message.submitTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; return obj; }, fromAminoMsg(object: VoteAminoMsg): Vote { diff --git a/__fixtures__/v-next/outputv2/cosmos/slashing/v1beta1/slashing.ts b/__fixtures__/v-next/outputv2/cosmos/slashing/v1beta1/slashing.ts index 597086b4a8..81412d847c 100644 --- a/__fixtures__/v-next/outputv2/cosmos/slashing/v1beta1/slashing.ts +++ b/__fixtures__/v-next/outputv2/cosmos/slashing/v1beta1/slashing.ts @@ -236,7 +236,7 @@ export const ValidatorSigningInfo = { address: object.address, startHeight: BigInt(object.start_height), indexOffset: BigInt(object.index_offset), - jailedUntil: object.jailed_until, + jailedUntil: fromTimestamp(Timestamp.fromAmino(object.jailed_until)), tombstoned: object.tombstoned, missedBlocksCounter: BigInt(object.missed_blocks_counter) }; @@ -246,7 +246,7 @@ export const ValidatorSigningInfo = { obj.address = message.address; obj.start_height = message.startHeight ? message.startHeight.toString() : undefined; obj.index_offset = message.indexOffset ? message.indexOffset.toString() : undefined; - obj.jailed_until = message.jailedUntil; + obj.jailed_until = message.jailedUntil ? Timestamp.toAmino(toTimestamp(message.jailedUntil)) : undefined; obj.tombstoned = message.tombstoned; obj.missed_blocks_counter = message.missedBlocksCounter ? message.missedBlocksCounter.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/staking.ts b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/staking.ts index 2f47791c1f..b778a4955c 100644 --- a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/staking.ts @@ -1134,13 +1134,13 @@ export const Commission = { fromAmino(object: CommissionAmino): Commission { return { commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: object.update_time + updateTime: fromTimestamp(Timestamp.fromAmino(object.update_time)) }; }, toAmino(message: Commission): CommissionAmino { const obj: any = {}; obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : undefined; - obj.update_time = message.updateTime; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; return obj; }, fromAminoMsg(object: CommissionAminoMsg): Commission { @@ -1503,7 +1503,7 @@ export const Validator = { delegatorShares: object.delegator_shares, description: object?.description ? Description.fromAmino(object.description) : undefined, unbondingHeight: BigInt(object.unbonding_height), - unbondingTime: object.unbonding_time, + unbondingTime: fromTimestamp(Timestamp.fromAmino(object.unbonding_time)), commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, minSelfDelegation: object.min_self_delegation }; @@ -1518,7 +1518,7 @@ export const Validator = { obj.delegator_shares = message.delegatorShares; obj.description = message.description ? Description.toAmino(message.description) : undefined; obj.unbonding_height = message.unbondingHeight ? message.unbondingHeight.toString() : undefined; - obj.unbonding_time = message.unbondingTime; + obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) : undefined; obj.commission = message.commission ? Commission.toAmino(message.commission) : undefined; obj.min_self_delegation = message.minSelfDelegation; return obj; @@ -2404,7 +2404,7 @@ export const UnbondingDelegationEntry = { fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: object.completion_time, + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), initialBalance: object.initial_balance, balance: object.balance }; @@ -2412,7 +2412,7 @@ export const UnbondingDelegationEntry = { toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; obj.initial_balance = message.initialBalance; obj.balance = message.balance; return obj; @@ -2536,7 +2536,7 @@ export const RedelegationEntry = { fromAmino(object: RedelegationEntryAmino): RedelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: object.completion_time, + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), initialBalance: object.initial_balance, sharesDst: object.shares_dst }; @@ -2544,7 +2544,7 @@ export const RedelegationEntry = { toAmino(message: RedelegationEntry): RedelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; obj.initial_balance = message.initialBalance; obj.shares_dst = message.sharesDst; return obj; diff --git a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts index 6a2596add6..be27e00ea4 100644 --- a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts @@ -1112,12 +1112,12 @@ export const MsgBeginRedelegateResponse = { }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { return { - completionTime: object.completion_time + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) }; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; return obj; }, fromAminoMsg(object: MsgBeginRedelegateResponseAminoMsg): MsgBeginRedelegateResponse { @@ -1318,12 +1318,12 @@ export const MsgUndelegateResponse = { }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { return { - completionTime: object.completion_time + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) }; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; return obj; }, fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { diff --git a/__fixtures__/v-next/outputv2/cosmos/upgrade/v1beta1/upgrade.ts b/__fixtures__/v-next/outputv2/cosmos/upgrade/v1beta1/upgrade.ts index a259f569cb..c1ee00b0c3 100644 --- a/__fixtures__/v-next/outputv2/cosmos/upgrade/v1beta1/upgrade.ts +++ b/__fixtures__/v-next/outputv2/cosmos/upgrade/v1beta1/upgrade.ts @@ -330,7 +330,7 @@ export const Plan = { fromAmino(object: PlanAmino): Plan { return { name: object.name, - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), height: BigInt(object.height), info: object.info, upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined @@ -339,7 +339,7 @@ export const Plan = { toAmino(message: Plan): PlanAmino { const obj: any = {}; obj.name = message.name; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.height = message.height ? message.height.toString() : undefined; obj.info = message.info; obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; diff --git a/__fixtures__/v-next/outputv2/evmos/claims/v1/genesis.ts b/__fixtures__/v-next/outputv2/evmos/claims/v1/genesis.ts index 3621f9161e..f79d78d0e9 100644 --- a/__fixtures__/v-next/outputv2/evmos/claims/v1/genesis.ts +++ b/__fixtures__/v-next/outputv2/evmos/claims/v1/genesis.ts @@ -348,7 +348,7 @@ export const Params = { fromAmino(object: ParamsAmino): Params { return { enableClaims: object.enable_claims, - airdropStartTime: object.airdrop_start_time, + airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimsDenom: object.claims_denom, @@ -359,7 +359,7 @@ export const Params = { toAmino(message: Params): ParamsAmino { const obj: any = {}; obj.enable_claims = message.enableClaims; - obj.airdrop_start_time = message.airdropStartTime; + obj.airdrop_start_time = message.airdropStartTime ? Timestamp.toAmino(toTimestamp(message.airdropStartTime)) : undefined; obj.duration_until_decay = message.durationUntilDecay ? Duration.toAmino(message.durationUntilDecay) : undefined; obj.duration_of_decay = message.durationOfDecay ? Duration.toAmino(message.durationOfDecay) : undefined; obj.claims_denom = message.claimsDenom; diff --git a/__fixtures__/v-next/outputv2/evmos/epochs/v1/genesis.ts b/__fixtures__/v-next/outputv2/evmos/epochs/v1/genesis.ts index 29937ee523..28504d0c69 100644 --- a/__fixtures__/v-next/outputv2/evmos/epochs/v1/genesis.ts +++ b/__fixtures__/v-next/outputv2/evmos/epochs/v1/genesis.ts @@ -194,10 +194,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: object.current_epoch_start_time, + currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; @@ -205,10 +205,10 @@ export const EpochInfo = { toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime; + obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(toTimestamp(message.currentEpochStartTime)) : undefined; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv2/evmos/incentives/v1/incentives.ts b/__fixtures__/v-next/outputv2/evmos/incentives/v1/incentives.ts index b2db619e86..5dd6c29dac 100644 --- a/__fixtures__/v-next/outputv2/evmos/incentives/v1/incentives.ts +++ b/__fixtures__/v-next/outputv2/evmos/incentives/v1/incentives.ts @@ -280,7 +280,7 @@ export const Incentive = { contract: object.contract, allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => DecCoin.fromAmino(e)) : [], epochs: object.epochs, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), totalGas: BigInt(object.total_gas) }; }, @@ -293,7 +293,7 @@ export const Incentive = { obj.allocations = []; } obj.epochs = message.epochs; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.total_gas = message.totalGas ? message.totalGas.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv2/evmos/vesting/v1/tx.ts b/__fixtures__/v-next/outputv2/evmos/vesting/v1/tx.ts index dfe06ac3a2..91b93fade8 100644 --- a/__fixtures__/v-next/outputv2/evmos/vesting/v1/tx.ts +++ b/__fixtures__/v-next/outputv2/evmos/vesting/v1/tx.ts @@ -289,7 +289,7 @@ export const MsgCreateClawbackVestingAccount = { return { fromAddress: object.from_address, toAddress: object.to_address, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [], merge: object.merge @@ -299,7 +299,7 @@ export const MsgCreateClawbackVestingAccount = { const obj: any = {}; obj.from_address = message.fromAddress; obj.to_address = message.toAddress; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; if (message.lockupPeriods) { obj.lockup_periods = message.lockupPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv2/evmos/vesting/v1/vesting.ts b/__fixtures__/v-next/outputv2/evmos/vesting/v1/vesting.ts index 9ebfdcdd98..8920a9b6b5 100644 --- a/__fixtures__/v-next/outputv2/evmos/vesting/v1/vesting.ts +++ b/__fixtures__/v-next/outputv2/evmos/vesting/v1/vesting.ts @@ -191,7 +191,7 @@ export const ClawbackVestingAccount = { return { baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined, funderAddress: object.funder_address, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [] }; @@ -200,7 +200,7 @@ export const ClawbackVestingAccount = { const obj: any = {}; obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; obj.funder_address = message.funderAddress; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; if (message.lockupPeriods) { obj.lockup_periods = message.lockupPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv2/google/api/distribution.ts b/__fixtures__/v-next/outputv2/google/api/distribution.ts index 09d8546324..06432e6a6c 100644 --- a/__fixtures__/v-next/outputv2/google/api/distribution.ts +++ b/__fixtures__/v-next/outputv2/google/api/distribution.ts @@ -1371,14 +1371,14 @@ export const Distribution_Exemplar = { fromAmino(object: Distribution_ExemplarAmino): Distribution_Exemplar { return { value: object.value, - timestamp: object?.timestamp, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, attachments: Array.isArray(object?.attachments) ? object.attachments.map((e: any) => Any.fromAmino(e)) : [] }; }, toAmino(message: Distribution_Exemplar): Distribution_ExemplarAmino { const obj: any = {}; obj.value = message.value; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; if (message.attachments) { obj.attachments = message.attachments.map(e => e ? Any.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv2/google/api/expr/v1alpha1/syntax.ts b/__fixtures__/v-next/outputv2/google/api/expr/v1alpha1/syntax.ts index bceeb11e3f..99db4f397c 100644 --- a/__fixtures__/v-next/outputv2/google/api/expr/v1alpha1/syntax.ts +++ b/__fixtures__/v-next/outputv2/google/api/expr/v1alpha1/syntax.ts @@ -2181,7 +2181,7 @@ export const Constant = { stringValue: object?.string_value, bytesValue: object?.bytes_value, durationValue: object?.duration_value ? Duration.fromAmino(object.duration_value) : undefined, - timestampValue: object?.timestamp_value + timestampValue: object?.timestamp_value ? fromTimestamp(Timestamp.fromAmino(object.timestamp_value)) : undefined }; }, toAmino(message: Constant): ConstantAmino { @@ -2194,7 +2194,7 @@ export const Constant = { obj.string_value = message.stringValue; obj.bytes_value = message.bytesValue; obj.duration_value = message.durationValue ? Duration.toAmino(message.durationValue) : undefined; - obj.timestamp_value = message.timestampValue; + obj.timestamp_value = message.timestampValue ? Timestamp.toAmino(toTimestamp(message.timestampValue)) : undefined; return obj; }, fromAminoMsg(object: ConstantAminoMsg): Constant { diff --git a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/log_entry.ts b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/log_entry.ts index 2c47df7b3c..52dfa5359b 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/log_entry.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/log_entry.ts @@ -629,7 +629,7 @@ export const LogEntry = { fromAmino(object: LogEntryAmino): LogEntry { return { name: object.name, - timestamp: object?.timestamp, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, trace: object.trace, @@ -650,7 +650,7 @@ export const LogEntry = { toAmino(message: LogEntry): LogEntryAmino { const obj: any = {}; obj.name = message.name; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.severity = message.severity; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; obj.trace = message.trace; diff --git a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/metric_value.ts b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/metric_value.ts index 611a11e3e7..df646f9037 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/metric_value.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/metric_value.ts @@ -429,8 +429,8 @@ export const MetricValue = { acc[key] = String(value); return acc; }, {}) : {}, - startTime: object?.start_time, - endTime: object?.end_time, + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, boolValue: object?.bool_value, int64Value: object?.int64_value ? BigInt(object.int64_value) : undefined, doubleValue: object?.double_value, @@ -446,8 +446,8 @@ export const MetricValue = { obj.labels[k] = v; }); } - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.bool_value = message.boolValue; obj.int64_value = message.int64Value ? message.int64Value.toString() : undefined; obj.double_value = message.doubleValue; diff --git a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/operation.ts b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/operation.ts index ab6d796c78..e38efbae0a 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/operation.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/operation.ts @@ -567,8 +567,8 @@ export const Operation = { operationId: object.operation_id, operationName: object.operation_name, consumerId: object.consumer_id, - startTime: object?.start_time, - endTime: object?.end_time, + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ [key: string]: string; }>((acc, [key, value]) => { @@ -586,8 +586,8 @@ export const Operation = { obj.operation_id = message.operationId; obj.operation_name = message.operationName; obj.consumer_id = message.consumerId; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.labels = {}; if (message.labels) { Object.entries(message.labels).forEach(([k, v]) => { diff --git a/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/resources.ts b/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/resources.ts index 07d67244a0..41ae6b4dc4 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/resources.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/resources.ts @@ -1040,7 +1040,7 @@ export const OperationMetadata = { resourceNames: Array.isArray(object?.resource_names) ? object.resource_names.map((e: any) => e) : [], steps: Array.isArray(object?.steps) ? object.steps.map((e: any) => OperationMetadata_Step.fromAmino(e)) : [], progressPercentage: object.progress_percentage, - startTime: object?.start_time + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined }; }, toAmino(message: OperationMetadata): OperationMetadataAmino { @@ -1056,7 +1056,7 @@ export const OperationMetadata = { obj.steps = []; } obj.progress_percentage = message.progressPercentage; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: OperationMetadataAminoMsg): OperationMetadata { @@ -1803,7 +1803,7 @@ export const Rollout = { fromAmino(object: RolloutAmino): Rollout { return { rolloutId: object.rollout_id, - createTime: object?.create_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, createdBy: object.created_by, status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: object?.traffic_percent_strategy ? Rollout_TrafficPercentStrategy.fromAmino(object.traffic_percent_strategy) : undefined, @@ -1814,7 +1814,7 @@ export const Rollout = { toAmino(message: Rollout): RolloutAmino { const obj: any = {}; obj.rollout_id = message.rolloutId; - obj.create_time = message.createTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; obj.created_by = message.createdBy; obj.status = message.status; obj.traffic_percent_strategy = message.trafficPercentStrategy ? Rollout_TrafficPercentStrategy.toAmino(message.trafficPercentStrategy) : undefined; diff --git a/__fixtures__/v-next/outputv2/google/logging/v2/log_entry.ts b/__fixtures__/v-next/outputv2/google/logging/v2/log_entry.ts index 2b83a0f63c..c5e1438bad 100644 --- a/__fixtures__/v-next/outputv2/google/logging/v2/log_entry.ts +++ b/__fixtures__/v-next/outputv2/google/logging/v2/log_entry.ts @@ -929,8 +929,8 @@ export const LogEntry = { protoPayload: object?.proto_payload ? Any.fromAmino(object.proto_payload) : undefined, textPayload: object?.text_payload, jsonPayload: object?.json_payload ? Struct.fromAmino(object.json_payload) : undefined, - timestamp: object?.timestamp, - receiveTimestamp: object?.receive_timestamp, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, + receiveTimestamp: object?.receive_timestamp ? fromTimestamp(Timestamp.fromAmino(object.receive_timestamp)) : undefined, severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: object.insert_id, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, @@ -955,8 +955,8 @@ export const LogEntry = { obj.proto_payload = message.protoPayload ? Any.toAmino(message.protoPayload) : undefined; obj.text_payload = message.textPayload; obj.json_payload = message.jsonPayload ? Struct.toAmino(message.jsonPayload) : undefined; - obj.timestamp = message.timestamp; - obj.receive_timestamp = message.receiveTimestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.receive_timestamp = message.receiveTimestamp ? Timestamp.toAmino(toTimestamp(message.receiveTimestamp)) : undefined; obj.severity = message.severity; obj.insert_id = message.insertId; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; diff --git a/__fixtures__/v-next/outputv2/google/logging/v2/logging_config.ts b/__fixtures__/v-next/outputv2/google/logging/v2/logging_config.ts index f89b1b830d..d1e892d4d2 100644 --- a/__fixtures__/v-next/outputv2/google/logging/v2/logging_config.ts +++ b/__fixtures__/v-next/outputv2/google/logging/v2/logging_config.ts @@ -3198,8 +3198,8 @@ export const LogBucket = { return { name: object.name, description: object.description, - createTime: object?.create_time, - updateTime: object?.update_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, retentionDays: object.retention_days, locked: object.locked, lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : -1, @@ -3211,8 +3211,8 @@ export const LogBucket = { const obj: any = {}; obj.name = message.name; obj.description = message.description; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; obj.retention_days = message.retentionDays; obj.locked = message.locked; obj.lifecycle_state = message.lifecycleState; @@ -3347,8 +3347,8 @@ export const LogView = { return { name: object.name, description: object.description, - createTime: object?.create_time, - updateTime: object?.update_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, filter: object.filter }; }, @@ -3356,8 +3356,8 @@ export const LogView = { const obj: any = {}; obj.name = message.name; obj.description = message.description; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; obj.filter = message.filter; return obj; }, @@ -3586,8 +3586,8 @@ export const LogSink = { writerIdentity: object.writer_identity, includeChildren: object.include_children, bigqueryOptions: object?.bigquery_options ? BigQueryOptions.fromAmino(object.bigquery_options) : undefined, - createTime: object?.create_time, - updateTime: object?.update_time + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined }; }, toAmino(message: LogSink): LogSinkAmino { @@ -3606,8 +3606,8 @@ export const LogSink = { obj.writer_identity = message.writerIdentity; obj.include_children = message.includeChildren; obj.bigquery_options = message.bigqueryOptions ? BigQueryOptions.toAmino(message.bigqueryOptions) : undefined; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; return obj; }, fromAminoMsg(object: LogSinkAminoMsg): LogSink { @@ -5743,8 +5743,8 @@ export const LogExclusion = { description: object.description, filter: object.filter, disabled: object.disabled, - createTime: object?.create_time, - updateTime: object?.update_time + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined }; }, toAmino(message: LogExclusion): LogExclusionAmino { @@ -5753,8 +5753,8 @@ export const LogExclusion = { obj.description = message.description; obj.filter = message.filter; obj.disabled = message.disabled; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; return obj; }, fromAminoMsg(object: LogExclusionAminoMsg): LogExclusion { @@ -7235,8 +7235,8 @@ export const CopyLogEntriesMetadata = { }, fromAmino(object: CopyLogEntriesMetadataAmino): CopyLogEntriesMetadata { return { - startTime: object?.start_time, - endTime: object?.end_time, + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: object.cancellation_requested, request: object?.request ? CopyLogEntriesRequest.fromAmino(object.request) : undefined, @@ -7246,8 +7246,8 @@ export const CopyLogEntriesMetadata = { }, toAmino(message: CopyLogEntriesMetadata): CopyLogEntriesMetadataAmino { const obj: any = {}; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.state = message.state; obj.cancellation_requested = message.cancellationRequested; obj.request = message.request ? CopyLogEntriesRequest.toAmino(message.request) : undefined; diff --git a/__fixtures__/v-next/outputv2/google/logging/v2/logging_metrics.ts b/__fixtures__/v-next/outputv2/google/logging/v2/logging_metrics.ts index 70530fdb1b..18f4641e31 100644 --- a/__fixtures__/v-next/outputv2/google/logging/v2/logging_metrics.ts +++ b/__fixtures__/v-next/outputv2/google/logging/v2/logging_metrics.ts @@ -920,8 +920,8 @@ export const LogMetric = { return acc; }, {}) : {}, bucketOptions: object?.bucket_options ? Distribution_BucketOptions.fromAmino(object.bucket_options) : undefined, - createTime: object?.create_time, - updateTime: object?.update_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, @@ -940,8 +940,8 @@ export const LogMetric = { }); } obj.bucket_options = message.bucketOptions ? Distribution_BucketOptions.toAmino(message.bucketOptions) : undefined; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; obj.version = message.version; return obj; }, diff --git a/__fixtures__/v-next/outputv2/google/protobuf/timestamp.ts b/__fixtures__/v-next/outputv2/google/protobuf/timestamp.ts index 895f2983d9..035dfcc718 100644 --- a/__fixtures__/v-next/outputv2/google/protobuf/timestamp.ts +++ b/__fixtures__/v-next/outputv2/google/protobuf/timestamp.ts @@ -354,7 +354,7 @@ export const Timestamp = { return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - return fromTimestamp(message).toString(); + return fromTimestamp(message).toISOString(); }, fromAminoMsg(object: TimestampAminoMsg): Timestamp { return Timestamp.fromAmino(object.value); diff --git a/__fixtures__/v-next/outputv2/google/rpc/context/attribute_context.ts b/__fixtures__/v-next/outputv2/google/rpc/context/attribute_context.ts index 2bcf2f6d5f..3a0ab93b04 100644 --- a/__fixtures__/v-next/outputv2/google/rpc/context/attribute_context.ts +++ b/__fixtures__/v-next/outputv2/google/rpc/context/attribute_context.ts @@ -2092,7 +2092,7 @@ export const AttributeContext_Request = { host: object.host, scheme: object.scheme, query: object.query, - time: object?.time, + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, size: BigInt(object.size), protocol: object.protocol, reason: object.reason, @@ -2113,7 +2113,7 @@ export const AttributeContext_Request = { obj.host = message.host; obj.scheme = message.scheme; obj.query = message.query; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.size = message.size ? message.size.toString() : undefined; obj.protocol = message.protocol; obj.reason = message.reason; @@ -2376,7 +2376,7 @@ export const AttributeContext_Response = { acc[key] = String(value); return acc; }, {}) : {}, - time: object?.time, + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, backendLatency: object?.backend_latency ? Duration.fromAmino(object.backend_latency) : undefined }; }, @@ -2390,7 +2390,7 @@ export const AttributeContext_Response = { obj.headers[k] = v; }); } - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.backend_latency = message.backendLatency ? Duration.toAmino(message.backendLatency) : undefined; return obj; }, @@ -2858,9 +2858,9 @@ export const AttributeContext_Resource = { return acc; }, {}) : {}, displayName: object.display_name, - createTime: object?.create_time, - updateTime: object?.update_time, - deleteTime: object?.delete_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, + deleteTime: object?.delete_time ? fromTimestamp(Timestamp.fromAmino(object.delete_time)) : undefined, etag: object.etag, location: object.location }; @@ -2884,9 +2884,9 @@ export const AttributeContext_Resource = { }); } obj.display_name = message.displayName; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; - obj.delete_time = message.deleteTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; + obj.delete_time = message.deleteTime ? Timestamp.toAmino(toTimestamp(message.deleteTime)) : undefined; obj.etag = message.etag; obj.location = message.location; return obj; diff --git a/__fixtures__/v-next/outputv2/ibc/lightclients/tendermint/v1/tendermint.ts b/__fixtures__/v-next/outputv2/ibc/lightclients/tendermint/v1/tendermint.ts index 5bea0379b1..2fd0cc0958 100644 --- a/__fixtures__/v-next/outputv2/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/__fixtures__/v-next/outputv2/ibc/lightclients/tendermint/v1/tendermint.ts @@ -638,14 +638,14 @@ export const ConsensusState = { }, fromAmino(object: ConsensusStateAmino): ConsensusState { return { - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined, nextValidatorsHash: object.next_validators_hash }; }, toAmino(message: ConsensusState): ConsensusStateAmino { const obj: any = {}; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.root = message.root ? MerkleRoot.toAmino(message.root) : undefined; obj.next_validators_hash = message.nextValidatorsHash; return obj; diff --git a/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/params.ts b/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/params.ts index f9b3eb9030..8ea7272677 100644 --- a/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/params.ts +++ b/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/params.ts @@ -132,7 +132,7 @@ export const Params = { }, fromAmino(object: ParamsAmino): Params { return { - airdropStartTime: object.airdrop_start_time, + airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimDenom: object.claim_denom @@ -140,7 +140,7 @@ export const Params = { }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.airdrop_start_time = message.airdropStartTime; + obj.airdrop_start_time = message.airdropStartTime ? Timestamp.toAmino(toTimestamp(message.airdropStartTime)) : undefined; obj.duration_until_decay = message.durationUntilDecay ? Duration.toAmino(message.durationUntilDecay) : undefined; obj.duration_of_decay = message.durationOfDecay ? Duration.toAmino(message.durationOfDecay) : undefined; obj.claim_denom = message.claimDenom; diff --git a/__fixtures__/v-next/outputv2/osmosis/epochs/genesis.ts b/__fixtures__/v-next/outputv2/osmosis/epochs/genesis.ts index 13921f38c6..e457ed3325 100644 --- a/__fixtures__/v-next/outputv2/osmosis/epochs/genesis.ts +++ b/__fixtures__/v-next/outputv2/osmosis/epochs/genesis.ts @@ -297,10 +297,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: object.current_epoch_start_time, + currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; @@ -308,10 +308,10 @@ export const EpochInfo = { toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime; + obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(toTimestamp(message.currentEpochStartTime)) : undefined; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv2/osmosis/gamm/pool-models/balancer/balancerPool.ts b/__fixtures__/v-next/outputv2/osmosis/gamm/pool-models/balancer/balancerPool.ts index 8b0c0c7389..f24d61703c 100644 --- a/__fixtures__/v-next/outputv2/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/__fixtures__/v-next/outputv2/osmosis/gamm/pool-models/balancer/balancerPool.ts @@ -380,7 +380,7 @@ export const SmoothWeightChangeParams = { }, fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { return { - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, initialPoolWeights: Array.isArray(object?.initial_pool_weights) ? object.initial_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [], targetPoolWeights: Array.isArray(object?.target_pool_weights) ? object.target_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [] @@ -388,7 +388,7 @@ export const SmoothWeightChangeParams = { }, toAmino(message: SmoothWeightChangeParams): SmoothWeightChangeParamsAmino { const obj: any = {}; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; if (message.initialPoolWeights) { obj.initial_pool_weights = message.initialPoolWeights.map(e => e ? PoolAsset.toAmino(e) : undefined); diff --git a/__fixtures__/v-next/outputv2/osmosis/incentives/gauge.ts b/__fixtures__/v-next/outputv2/osmosis/incentives/gauge.ts index b655e26649..51c94ec1ff 100644 --- a/__fixtures__/v-next/outputv2/osmosis/incentives/gauge.ts +++ b/__fixtures__/v-next/outputv2/osmosis/incentives/gauge.ts @@ -299,7 +299,7 @@ export const Gauge = { isPerpetual: object.is_perpetual, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), numEpochsPaidOver: BigInt(object.num_epochs_paid_over), filledEpochs: BigInt(object.filled_epochs), distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : [] @@ -315,7 +315,7 @@ export const Gauge = { } else { obj.coins = []; } - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; obj.filled_epochs = message.filledEpochs ? message.filledEpochs.toString() : undefined; if (message.distributedCoins) { diff --git a/__fixtures__/v-next/outputv2/osmosis/incentives/tx.ts b/__fixtures__/v-next/outputv2/osmosis/incentives/tx.ts index 5db8aad821..afeb668515 100644 --- a/__fixtures__/v-next/outputv2/osmosis/incentives/tx.ts +++ b/__fixtures__/v-next/outputv2/osmosis/incentives/tx.ts @@ -263,7 +263,7 @@ export const MsgCreateGauge = { owner: object.owner, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), numEpochsPaidOver: BigInt(object.num_epochs_paid_over) }; }, @@ -277,7 +277,7 @@ export const MsgCreateGauge = { } else { obj.coins = []; } - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv2/osmosis/lockup/lock.ts b/__fixtures__/v-next/outputv2/osmosis/lockup/lock.ts index 30339738a7..8989c753bb 100644 --- a/__fixtures__/v-next/outputv2/osmosis/lockup/lock.ts +++ b/__fixtures__/v-next/outputv2/osmosis/lockup/lock.ts @@ -390,7 +390,7 @@ export const PeriodLock = { ID: BigInt(object.ID), owner: object.owner, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - endTime: object.end_time, + endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] }; }, @@ -399,7 +399,7 @@ export const PeriodLock = { obj.ID = message.ID ? message.ID.toString() : undefined; obj.owner = message.owner; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.end_time = message.endTime; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; if (message.coins) { obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); } else { @@ -528,7 +528,7 @@ export const QueryCondition = { lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object.denom, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: QueryCondition): QueryConditionAmino { @@ -536,7 +536,7 @@ export const QueryCondition = { obj.lock_query_type = message.lockQueryType; obj.denom = message.denom; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: QueryConditionAminoMsg): QueryCondition { @@ -661,7 +661,7 @@ export const SyntheticLock = { return { underlyingLockId: BigInt(object.underlying_lock_id), synthDenom: object.synth_denom, - endTime: object.end_time, + endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined }; }, @@ -669,7 +669,7 @@ export const SyntheticLock = { const obj: any = {}; obj.underlying_lock_id = message.underlyingLockId ? message.underlyingLockId.toString() : undefined; obj.synth_denom = message.synthDenom; - obj.end_time = message.endTime; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv2/osmosis/lockup/query.ts b/__fixtures__/v-next/outputv2/osmosis/lockup/query.ts index 7762efbbf0..2d7bee88b3 100644 --- a/__fixtures__/v-next/outputv2/osmosis/lockup/query.ts +++ b/__fixtures__/v-next/outputv2/osmosis/lockup/query.ts @@ -1576,13 +1576,13 @@ export const AccountLockedPastTimeRequest = { fromAmino(object: AccountLockedPastTimeRequestAmino): AccountLockedPastTimeRequest { return { owner: object.owner, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: AccountLockedPastTimeRequest): AccountLockedPastTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountLockedPastTimeRequestAminoMsg): AccountLockedPastTimeRequest { @@ -1778,13 +1778,13 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino): AccountLockedPastTimeNotUnlockingOnlyRequest { return { owner: object.owner, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyRequest): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg): AccountLockedPastTimeNotUnlockingOnlyRequest { @@ -1980,13 +1980,13 @@ export const AccountUnlockedBeforeTimeRequest = { fromAmino(object: AccountUnlockedBeforeTimeRequestAmino): AccountUnlockedBeforeTimeRequest { return { owner: object.owner, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: AccountUnlockedBeforeTimeRequest): AccountUnlockedBeforeTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountUnlockedBeforeTimeRequestAminoMsg): AccountUnlockedBeforeTimeRequest { @@ -2194,14 +2194,14 @@ export const AccountLockedPastTimeDenomRequest = { fromAmino(object: AccountLockedPastTimeDenomRequestAmino): AccountLockedPastTimeDenomRequest { return { owner: object.owner, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), denom: object.denom }; }, toAmino(message: AccountLockedPastTimeDenomRequest): AccountLockedPastTimeDenomRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.denom = message.denom; return obj; }, diff --git a/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/query.ts b/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/query.ts index 24600b3598..42670bd9e7 100644 --- a/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/query.ts @@ -232,8 +232,8 @@ export const ArithmeticTwapRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: object.start_time, - endTime: object?.end_time + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined }; }, toAmino(message: ArithmeticTwapRequest): ArithmeticTwapRequestAmino { @@ -241,8 +241,8 @@ export const ArithmeticTwapRequest = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; return obj; }, fromAminoMsg(object: ArithmeticTwapRequestAminoMsg): ArithmeticTwapRequest { @@ -454,7 +454,7 @@ export const ArithmeticTwapToNowRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: object.start_time + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)) }; }, toAmino(message: ArithmeticTwapToNowRequest): ArithmeticTwapToNowRequestAmino { @@ -462,7 +462,7 @@ export const ArithmeticTwapToNowRequest = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: ArithmeticTwapToNowRequestAminoMsg): ArithmeticTwapToNowRequest { diff --git a/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/twap_record.ts b/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/twap_record.ts index 6661a3c439..7900f534cf 100644 --- a/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/twap_record.ts +++ b/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/twap_record.ts @@ -280,12 +280,12 @@ export const TwapRecord = { asset0Denom: object.asset0_denom, asset1Denom: object.asset1_denom, height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), p0LastSpotPrice: object.p0_last_spot_price, p1LastSpotPrice: object.p1_last_spot_price, p0ArithmeticTwapAccumulator: object.p0_arithmetic_twap_accumulator, p1ArithmeticTwapAccumulator: object.p1_arithmetic_twap_accumulator, - lastErrorTime: object.last_error_time + lastErrorTime: fromTimestamp(Timestamp.fromAmino(object.last_error_time)) }; }, toAmino(message: TwapRecord): TwapRecordAmino { @@ -294,12 +294,12 @@ export const TwapRecord = { obj.asset0_denom = message.asset0Denom; obj.asset1_denom = message.asset1Denom; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.p0_last_spot_price = message.p0LastSpotPrice; obj.p1_last_spot_price = message.p1LastSpotPrice; obj.p0_arithmetic_twap_accumulator = message.p0ArithmeticTwapAccumulator; obj.p1_arithmetic_twap_accumulator = message.p1ArithmeticTwapAccumulator; - obj.last_error_time = message.lastErrorTime; + obj.last_error_time = message.lastErrorTime ? Timestamp.toAmino(toTimestamp(message.lastErrorTime)) : undefined; return obj; }, fromAminoMsg(object: TwapRecordAminoMsg): TwapRecord { diff --git a/__fixtures__/v-next/outputv2/tendermint/abci/types.ts b/__fixtures__/v-next/outputv2/tendermint/abci/types.ts index 8ce1cc0585..3f70299525 100644 --- a/__fixtures__/v-next/outputv2/tendermint/abci/types.ts +++ b/__fixtures__/v-next/outputv2/tendermint/abci/types.ts @@ -2175,7 +2175,7 @@ export const RequestInitChain = { }, fromAmino(object: RequestInitChainAmino): RequestInitChain { return { - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), chainId: object.chain_id, consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], @@ -2185,7 +2185,7 @@ export const RequestInitChain = { }, toAmino(message: RequestInitChain): RequestInitChainAmino { const obj: any = {}; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.chain_id = message.chainId; obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; if (message.validators) { @@ -6501,7 +6501,7 @@ export const Evidence = { type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), totalVotingPower: BigInt(object.total_voting_power) }; }, @@ -6510,7 +6510,7 @@ export const Evidence = { obj.type = message.type; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv2/tendermint/p2p/types.ts b/__fixtures__/v-next/outputv2/tendermint/p2p/types.ts index 9c30299551..e2b5e66a8d 100644 --- a/__fixtures__/v-next/outputv2/tendermint/p2p/types.ts +++ b/__fixtures__/v-next/outputv2/tendermint/p2p/types.ts @@ -616,7 +616,7 @@ export const PeerInfo = { return { id: object.id, addressInfo: Array.isArray(object?.address_info) ? object.address_info.map((e: any) => PeerAddressInfo.fromAmino(e)) : [], - lastConnected: object?.last_connected + lastConnected: object?.last_connected ? fromTimestamp(Timestamp.fromAmino(object.last_connected)) : undefined }; }, toAmino(message: PeerInfo): PeerInfoAmino { @@ -627,7 +627,7 @@ export const PeerInfo = { } else { obj.address_info = []; } - obj.last_connected = message.lastConnected; + obj.last_connected = message.lastConnected ? Timestamp.toAmino(toTimestamp(message.lastConnected)) : undefined; return obj; }, fromAminoMsg(object: PeerInfoAminoMsg): PeerInfo { @@ -740,16 +740,16 @@ export const PeerAddressInfo = { fromAmino(object: PeerAddressInfoAmino): PeerAddressInfo { return { address: object.address, - lastDialSuccess: object?.last_dial_success, - lastDialFailure: object?.last_dial_failure, + lastDialSuccess: object?.last_dial_success ? fromTimestamp(Timestamp.fromAmino(object.last_dial_success)) : undefined, + lastDialFailure: object?.last_dial_failure ? fromTimestamp(Timestamp.fromAmino(object.last_dial_failure)) : undefined, dialFailures: object.dial_failures }; }, toAmino(message: PeerAddressInfo): PeerAddressInfoAmino { const obj: any = {}; obj.address = message.address; - obj.last_dial_success = message.lastDialSuccess; - obj.last_dial_failure = message.lastDialFailure; + obj.last_dial_success = message.lastDialSuccess ? Timestamp.toAmino(toTimestamp(message.lastDialSuccess)) : undefined; + obj.last_dial_failure = message.lastDialFailure ? Timestamp.toAmino(toTimestamp(message.lastDialFailure)) : undefined; obj.dial_failures = message.dialFailures; return obj; }, diff --git a/__fixtures__/v-next/outputv2/tendermint/types/evidence.ts b/__fixtures__/v-next/outputv2/tendermint/types/evidence.ts index 054600a90a..a0ef739376 100644 --- a/__fixtures__/v-next/outputv2/tendermint/types/evidence.ts +++ b/__fixtures__/v-next/outputv2/tendermint/types/evidence.ts @@ -321,7 +321,7 @@ export const DuplicateVoteEvidence = { voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, totalVotingPower: BigInt(object.total_voting_power), validatorPower: BigInt(object.validator_power), - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { @@ -330,7 +330,7 @@ export const DuplicateVoteEvidence = { obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; obj.validator_power = message.validatorPower ? message.validatorPower.toString() : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: DuplicateVoteEvidenceAminoMsg): DuplicateVoteEvidence { @@ -472,7 +472,7 @@ export const LightClientAttackEvidence = { commonHeight: BigInt(object.common_height), byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], totalVotingPower: BigInt(object.total_voting_power), - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { @@ -485,7 +485,7 @@ export const LightClientAttackEvidence = { obj.byzantine_validators = []; } obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: LightClientAttackEvidenceAminoMsg): LightClientAttackEvidence { diff --git a/__fixtures__/v-next/outputv2/tendermint/types/types.ts b/__fixtures__/v-next/outputv2/tendermint/types/types.ts index d302540c1f..944f722882 100644 --- a/__fixtures__/v-next/outputv2/tendermint/types/types.ts +++ b/__fixtures__/v-next/outputv2/tendermint/types/types.ts @@ -1035,7 +1035,7 @@ export const Header = { version: object?.version ? Consensus.fromAmino(object.version) : undefined, chainId: object.chain_id, height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, lastCommitHash: object.last_commit_hash, dataHash: object.data_hash, @@ -1053,7 +1053,7 @@ export const Header = { obj.version = message.version ? Consensus.toAmino(message.version) : undefined; obj.chain_id = message.chainId; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; obj.last_commit_hash = message.lastCommitHash; obj.data_hash = message.dataHash; @@ -1324,7 +1324,7 @@ export const Vote = { height: BigInt(object.height), round: object.round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), validatorAddress: object.validator_address, validatorIndex: object.validator_index, signature: object.signature @@ -1336,7 +1336,7 @@ export const Vote = { obj.height = message.height ? message.height.toString() : undefined; obj.round = message.round; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.validator_address = message.validatorAddress; obj.validator_index = message.validatorIndex; obj.signature = message.signature; @@ -1592,7 +1592,7 @@ export const CommitSig = { return { blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object.validator_address, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), signature: object.signature }; }, @@ -1600,7 +1600,7 @@ export const CommitSig = { const obj: any = {}; obj.block_id_flag = message.blockIdFlag; obj.validator_address = message.validatorAddress; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.signature = message.signature; return obj; }, @@ -1758,7 +1758,7 @@ export const Proposal = { round: object.round, polRound: object.pol_round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), signature: object.signature }; }, @@ -1769,7 +1769,7 @@ export const Proposal = { obj.round = message.round; obj.pol_round = message.polRound; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.signature = message.signature; return obj; }, diff --git a/__fixtures__/v-next/outputv3/cosmos/authz/v1beta1/authz.ts b/__fixtures__/v-next/outputv3/cosmos/authz/v1beta1/authz.ts index 3d125269db..fee8819e8a 100644 --- a/__fixtures__/v-next/outputv3/cosmos/authz/v1beta1/authz.ts +++ b/__fixtures__/v-next/outputv3/cosmos/authz/v1beta1/authz.ts @@ -289,13 +289,13 @@ export const Grant = { fromAmino(object: GrantAmino): Grant { return { authorization: object?.authorization ? Authorization_FromAmino(object.authorization) : undefined, - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: Grant): GrantAmino { const obj: any = {}; obj.authorization = message.authorization ? Authorization_ToAmino((message.authorization as Any)) : undefined; - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromProtoMsg(message: GrantProtoMsg): Grant { @@ -410,7 +410,7 @@ export const GrantAuthorization = { granter: object.granter, grantee: object.grantee, authorization: object?.authorization ? Authorization_FromAmino(object.authorization) : undefined, - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: GrantAuthorization): GrantAuthorizationAmino { @@ -418,7 +418,7 @@ export const GrantAuthorization = { obj.granter = message.granter; obj.grantee = message.grantee; obj.authorization = message.authorization ? Authorization_ToAmino((message.authorization as Any)) : undefined; - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromProtoMsg(message: GrantAuthorizationProtoMsg): GrantAuthorization { diff --git a/__fixtures__/v-next/outputv3/cosmos/evidence/v1beta1/evidence.ts b/__fixtures__/v-next/outputv3/cosmos/evidence/v1beta1/evidence.ts index fc15cde9f0..014aed9647 100644 --- a/__fixtures__/v-next/outputv3/cosmos/evidence/v1beta1/evidence.ts +++ b/__fixtures__/v-next/outputv3/cosmos/evidence/v1beta1/evidence.ts @@ -135,7 +135,7 @@ export const Equivocation = { fromAmino(object: EquivocationAmino): Equivocation { return { height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), power: BigInt(object.power), consensusAddress: object.consensus_address }; @@ -143,7 +143,7 @@ export const Equivocation = { toAmino(message: Equivocation): EquivocationAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.power = message.power ? message.power.toString() : undefined; obj.consensus_address = message.consensusAddress; return obj; diff --git a/__fixtures__/v-next/outputv3/cosmos/feegrant/v1beta1/feegrant.ts b/__fixtures__/v-next/outputv3/cosmos/feegrant/v1beta1/feegrant.ts index 47ff3a8943..85b5073bb1 100644 --- a/__fixtures__/v-next/outputv3/cosmos/feegrant/v1beta1/feegrant.ts +++ b/__fixtures__/v-next/outputv3/cosmos/feegrant/v1beta1/feegrant.ts @@ -255,7 +255,7 @@ export const BasicAllowance = { fromAmino(object: BasicAllowanceAmino): BasicAllowance { return { spendLimit: Array.isArray(object?.spend_limit) ? object.spend_limit.map((e: any) => Coin.fromAmino(e)) : [], - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: BasicAllowance): BasicAllowanceAmino { @@ -265,7 +265,7 @@ export const BasicAllowance = { } else { obj.spend_limit = []; } - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromProtoMsg(message: BasicAllowanceProtoMsg): BasicAllowance { @@ -412,7 +412,7 @@ export const PeriodicAllowance = { period: object?.period ? Duration.fromAmino(object.period) : undefined, periodSpendLimit: Array.isArray(object?.period_spend_limit) ? object.period_spend_limit.map((e: any) => Coin.fromAmino(e)) : [], periodCanSpend: Array.isArray(object?.period_can_spend) ? object.period_can_spend.map((e: any) => Coin.fromAmino(e)) : [], - periodReset: object.period_reset + periodReset: fromTimestamp(Timestamp.fromAmino(object.period_reset)) }; }, toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { @@ -429,7 +429,7 @@ export const PeriodicAllowance = { } else { obj.period_can_spend = []; } - obj.period_reset = message.periodReset; + obj.period_reset = message.periodReset ? Timestamp.toAmino(toTimestamp(message.periodReset)) : undefined; return obj; }, fromProtoMsg(message: PeriodicAllowanceProtoMsg): PeriodicAllowance { diff --git a/__fixtures__/v-next/outputv3/cosmos/gov/v1/gov.ts b/__fixtures__/v-next/outputv3/cosmos/gov/v1/gov.ts index b3c8462edd..1874e6bf5f 100644 --- a/__fixtures__/v-next/outputv3/cosmos/gov/v1/gov.ts +++ b/__fixtures__/v-next/outputv3/cosmos/gov/v1/gov.ts @@ -796,11 +796,11 @@ export const Proposal = { messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object?.submit_time, - depositEndTime: object?.deposit_end_time, + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined, + depositEndTime: object?.deposit_end_time ? fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)) : undefined, totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object?.voting_start_time, - votingEndTime: object?.voting_end_time, + votingStartTime: object?.voting_start_time ? fromTimestamp(Timestamp.fromAmino(object.voting_start_time)) : undefined, + votingEndTime: object?.voting_end_time ? fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) : undefined, metadata: object.metadata }; }, @@ -814,15 +814,15 @@ export const Proposal = { } obj.status = message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime; - obj.deposit_end_time = message.depositEndTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : undefined; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime; - obj.voting_end_time = message.votingEndTime; + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : undefined; + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : undefined; obj.metadata = message.metadata; return obj; }, diff --git a/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/gov.ts b/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/gov.ts index 52a124b8da..5d87c4d97d 100644 --- a/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/gov.ts @@ -931,11 +931,11 @@ export const Proposal = { content: object?.content ? ProposalContentI_FromAmino(object.content) : undefined, status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object.submit_time, - depositEndTime: object.deposit_end_time, + submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), + depositEndTime: fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)), totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object.voting_start_time, - votingEndTime: object.voting_end_time + votingStartTime: fromTimestamp(Timestamp.fromAmino(object.voting_start_time)), + votingEndTime: fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) }; }, toAmino(message: Proposal): ProposalAmino { @@ -944,15 +944,15 @@ export const Proposal = { obj.content = message.content ? ProposalContentI_ToAmino((message.content as Any)) : undefined; obj.status = message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime; - obj.deposit_end_time = message.depositEndTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : undefined; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime; - obj.voting_end_time = message.votingEndTime; + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : undefined; + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : undefined; return obj; }, fromProtoMsg(message: ProposalProtoMsg): Proposal { diff --git a/__fixtures__/v-next/outputv3/cosmos/group/v1/types.ts b/__fixtures__/v-next/outputv3/cosmos/group/v1/types.ts index aba5749b78..12fe5c5172 100644 --- a/__fixtures__/v-next/outputv3/cosmos/group/v1/types.ts +++ b/__fixtures__/v-next/outputv3/cosmos/group/v1/types.ts @@ -814,7 +814,7 @@ export const Member = { address: object.address, weight: object.weight, metadata: object.metadata, - addedAt: object.added_at + addedAt: fromTimestamp(Timestamp.fromAmino(object.added_at)) }; }, toAmino(message: Member): MemberAmino { @@ -822,7 +822,7 @@ export const Member = { obj.address = message.address; obj.weight = message.weight; obj.metadata = message.metadata; - obj.added_at = message.addedAt; + obj.added_at = message.addedAt ? Timestamp.toAmino(toTimestamp(message.addedAt)) : undefined; return obj; }, fromProtoMsg(message: MemberProtoMsg): Member { @@ -1345,7 +1345,7 @@ export const GroupInfo = { metadata: object.metadata, version: BigInt(object.version), totalWeight: object.total_weight, - createdAt: object.created_at + createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) }; }, toAmino(message: GroupInfo): GroupInfoAmino { @@ -1355,7 +1355,7 @@ export const GroupInfo = { obj.metadata = message.metadata; obj.version = message.version ? message.version.toString() : undefined; obj.total_weight = message.totalWeight; - obj.created_at = message.createdAt; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : undefined; return obj; }, fromProtoMsg(message: GroupInfoProtoMsg): GroupInfo { @@ -1610,7 +1610,7 @@ export const GroupPolicyInfo = { metadata: object.metadata, version: BigInt(object.version), decisionPolicy: object?.decision_policy ? DecisionPolicy_FromAmino(object.decision_policy) : undefined, - createdAt: object.created_at + createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) }; }, toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { @@ -1621,7 +1621,7 @@ export const GroupPolicyInfo = { obj.metadata = message.metadata; obj.version = message.version ? message.version.toString() : undefined; obj.decision_policy = message.decisionPolicy ? DecisionPolicy_ToAmino((message.decisionPolicy as Any)) : undefined; - obj.created_at = message.createdAt; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : undefined; return obj; }, fromProtoMsg(message: GroupPolicyInfoProtoMsg): GroupPolicyInfo { @@ -1867,13 +1867,13 @@ export const Proposal = { address: object.address, metadata: object.metadata, proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], - submitTime: object.submit_time, + submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), groupVersion: BigInt(object.group_version), groupPolicyVersion: BigInt(object.group_policy_version), status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - votingPeriodEnd: object.voting_period_end, + votingPeriodEnd: fromTimestamp(Timestamp.fromAmino(object.voting_period_end)), executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] }; @@ -1888,13 +1888,13 @@ export const Proposal = { } else { obj.proposers = []; } - obj.submit_time = message.submitTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; obj.group_version = message.groupVersion ? message.groupVersion.toString() : undefined; obj.group_policy_version = message.groupPolicyVersion ? message.groupPolicyVersion.toString() : undefined; obj.status = message.status; obj.result = message.result; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.voting_period_end = message.votingPeriodEnd; + obj.voting_period_end = message.votingPeriodEnd ? Timestamp.toAmino(toTimestamp(message.votingPeriodEnd)) : undefined; obj.executor_result = message.executorResult; if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); @@ -2149,7 +2149,7 @@ export const Vote = { voter: object.voter, option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata, - submitTime: object.submit_time + submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)) }; }, toAmino(message: Vote): VoteAmino { @@ -2158,7 +2158,7 @@ export const Vote = { obj.voter = message.voter; obj.option = message.option; obj.metadata = message.metadata; - obj.submit_time = message.submitTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; return obj; }, fromProtoMsg(message: VoteProtoMsg): Vote { diff --git a/__fixtures__/v-next/outputv3/cosmos/slashing/v1beta1/slashing.ts b/__fixtures__/v-next/outputv3/cosmos/slashing/v1beta1/slashing.ts index f4cf0c32b4..2f76e73d9d 100644 --- a/__fixtures__/v-next/outputv3/cosmos/slashing/v1beta1/slashing.ts +++ b/__fixtures__/v-next/outputv3/cosmos/slashing/v1beta1/slashing.ts @@ -228,7 +228,7 @@ export const ValidatorSigningInfo = { address: object.address, startHeight: BigInt(object.start_height), indexOffset: BigInt(object.index_offset), - jailedUntil: object.jailed_until, + jailedUntil: fromTimestamp(Timestamp.fromAmino(object.jailed_until)), tombstoned: object.tombstoned, missedBlocksCounter: BigInt(object.missed_blocks_counter) }; @@ -238,7 +238,7 @@ export const ValidatorSigningInfo = { obj.address = message.address; obj.start_height = message.startHeight ? message.startHeight.toString() : undefined; obj.index_offset = message.indexOffset ? message.indexOffset.toString() : undefined; - obj.jailed_until = message.jailedUntil; + obj.jailed_until = message.jailedUntil ? Timestamp.toAmino(toTimestamp(message.jailedUntil)) : undefined; obj.tombstoned = message.tombstoned; obj.missed_blocks_counter = message.missedBlocksCounter ? message.missedBlocksCounter.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/staking.ts b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/staking.ts index f318f5b34b..4990fc0279 100644 --- a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/staking.ts @@ -1036,13 +1036,13 @@ export const Commission = { fromAmino(object: CommissionAmino): Commission { return { commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: object.update_time + updateTime: fromTimestamp(Timestamp.fromAmino(object.update_time)) }; }, toAmino(message: Commission): CommissionAmino { const obj: any = {}; obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : undefined; - obj.update_time = message.updateTime; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; return obj; }, fromProtoMsg(message: CommissionProtoMsg): Commission { @@ -1387,7 +1387,7 @@ export const Validator = { delegatorShares: object.delegator_shares, description: object?.description ? Description.fromAmino(object.description) : undefined, unbondingHeight: BigInt(object.unbonding_height), - unbondingTime: object.unbonding_time, + unbondingTime: fromTimestamp(Timestamp.fromAmino(object.unbonding_time)), commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, minSelfDelegation: object.min_self_delegation }; @@ -1402,7 +1402,7 @@ export const Validator = { obj.delegator_shares = message.delegatorShares; obj.description = message.description ? Description.toAmino(message.description) : undefined; obj.unbonding_height = message.unbondingHeight ? message.unbondingHeight.toString() : undefined; - obj.unbonding_time = message.unbondingTime; + obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) : undefined; obj.commission = message.commission ? Commission.toAmino(message.commission) : undefined; obj.min_self_delegation = message.minSelfDelegation; return obj; @@ -2216,7 +2216,7 @@ export const UnbondingDelegationEntry = { fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: object.completion_time, + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), initialBalance: object.initial_balance, balance: object.balance }; @@ -2224,7 +2224,7 @@ export const UnbondingDelegationEntry = { toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; obj.initial_balance = message.initialBalance; obj.balance = message.balance; return obj; @@ -2339,7 +2339,7 @@ export const RedelegationEntry = { fromAmino(object: RedelegationEntryAmino): RedelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: object.completion_time, + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), initialBalance: object.initial_balance, sharesDst: object.shares_dst }; @@ -2347,7 +2347,7 @@ export const RedelegationEntry = { toAmino(message: RedelegationEntry): RedelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; obj.initial_balance = message.initialBalance; obj.shares_dst = message.sharesDst; return obj; diff --git a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts index e23a4f2c33..5cc88b4811 100644 --- a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts @@ -1009,12 +1009,12 @@ export const MsgBeginRedelegateResponse = { }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { return { - completionTime: object.completion_time + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) }; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; return obj; }, fromProtoMsg(message: MsgBeginRedelegateResponseProtoMsg): MsgBeginRedelegateResponse { @@ -1197,12 +1197,12 @@ export const MsgUndelegateResponse = { }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { return { - completionTime: object.completion_time + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) }; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; return obj; }, fromProtoMsg(message: MsgUndelegateResponseProtoMsg): MsgUndelegateResponse { diff --git a/__fixtures__/v-next/outputv3/cosmos/upgrade/v1beta1/upgrade.ts b/__fixtures__/v-next/outputv3/cosmos/upgrade/v1beta1/upgrade.ts index d7b87cb0d7..8e3a11ff78 100644 --- a/__fixtures__/v-next/outputv3/cosmos/upgrade/v1beta1/upgrade.ts +++ b/__fixtures__/v-next/outputv3/cosmos/upgrade/v1beta1/upgrade.ts @@ -314,7 +314,7 @@ export const Plan = { fromAmino(object: PlanAmino): Plan { return { name: object.name, - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), height: BigInt(object.height), info: object.info, upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined @@ -323,7 +323,7 @@ export const Plan = { toAmino(message: Plan): PlanAmino { const obj: any = {}; obj.name = message.name; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.height = message.height ? message.height.toString() : undefined; obj.info = message.info; obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; diff --git a/__fixtures__/v-next/outputv3/evmos/claims/v1/genesis.ts b/__fixtures__/v-next/outputv3/evmos/claims/v1/genesis.ts index b96ee295bf..89cafdfad8 100644 --- a/__fixtures__/v-next/outputv3/evmos/claims/v1/genesis.ts +++ b/__fixtures__/v-next/outputv3/evmos/claims/v1/genesis.ts @@ -337,7 +337,7 @@ export const Params = { fromAmino(object: ParamsAmino): Params { return { enableClaims: object.enable_claims, - airdropStartTime: object.airdrop_start_time, + airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimsDenom: object.claims_denom, @@ -348,7 +348,7 @@ export const Params = { toAmino(message: Params): ParamsAmino { const obj: any = {}; obj.enable_claims = message.enableClaims; - obj.airdrop_start_time = message.airdropStartTime; + obj.airdrop_start_time = message.airdropStartTime ? Timestamp.toAmino(toTimestamp(message.airdropStartTime)) : undefined; obj.duration_until_decay = message.durationUntilDecay ? Duration.toAmino(message.durationUntilDecay) : undefined; obj.duration_of_decay = message.durationOfDecay ? Duration.toAmino(message.durationOfDecay) : undefined; obj.claims_denom = message.claimsDenom; diff --git a/__fixtures__/v-next/outputv3/evmos/epochs/v1/genesis.ts b/__fixtures__/v-next/outputv3/evmos/epochs/v1/genesis.ts index c5e4711bb5..7e5f6a2f51 100644 --- a/__fixtures__/v-next/outputv3/evmos/epochs/v1/genesis.ts +++ b/__fixtures__/v-next/outputv3/evmos/epochs/v1/genesis.ts @@ -186,10 +186,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: object.current_epoch_start_time, + currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; @@ -197,10 +197,10 @@ export const EpochInfo = { toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime; + obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(toTimestamp(message.currentEpochStartTime)) : undefined; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv3/evmos/incentives/v1/incentives.ts b/__fixtures__/v-next/outputv3/evmos/incentives/v1/incentives.ts index fb6221e12e..a246edc744 100644 --- a/__fixtures__/v-next/outputv3/evmos/incentives/v1/incentives.ts +++ b/__fixtures__/v-next/outputv3/evmos/incentives/v1/incentives.ts @@ -264,7 +264,7 @@ export const Incentive = { contract: object.contract, allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => DecCoin.fromAmino(e)) : [], epochs: object.epochs, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), totalGas: BigInt(object.total_gas) }; }, @@ -277,7 +277,7 @@ export const Incentive = { obj.allocations = []; } obj.epochs = message.epochs; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.total_gas = message.totalGas ? message.totalGas.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv3/evmos/vesting/v1/tx.ts b/__fixtures__/v-next/outputv3/evmos/vesting/v1/tx.ts index 9a0a8c0a3a..2d3f98842c 100644 --- a/__fixtures__/v-next/outputv3/evmos/vesting/v1/tx.ts +++ b/__fixtures__/v-next/outputv3/evmos/vesting/v1/tx.ts @@ -273,7 +273,7 @@ export const MsgCreateClawbackVestingAccount = { return { fromAddress: object.from_address, toAddress: object.to_address, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [], merge: object.merge @@ -283,7 +283,7 @@ export const MsgCreateClawbackVestingAccount = { const obj: any = {}; obj.from_address = message.fromAddress; obj.to_address = message.toAddress; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; if (message.lockupPeriods) { obj.lockup_periods = message.lockupPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv3/evmos/vesting/v1/vesting.ts b/__fixtures__/v-next/outputv3/evmos/vesting/v1/vesting.ts index 923ebce5f0..4eae89658a 100644 --- a/__fixtures__/v-next/outputv3/evmos/vesting/v1/vesting.ts +++ b/__fixtures__/v-next/outputv3/evmos/vesting/v1/vesting.ts @@ -187,7 +187,7 @@ export const ClawbackVestingAccount = { return { baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined, funderAddress: object.funder_address, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [] }; @@ -196,7 +196,7 @@ export const ClawbackVestingAccount = { const obj: any = {}; obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; obj.funder_address = message.funderAddress; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; if (message.lockupPeriods) { obj.lockup_periods = message.lockupPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv3/google/api/distribution.ts b/__fixtures__/v-next/outputv3/google/api/distribution.ts index d5bd43cb3c..74982affac 100644 --- a/__fixtures__/v-next/outputv3/google/api/distribution.ts +++ b/__fixtures__/v-next/outputv3/google/api/distribution.ts @@ -1325,14 +1325,14 @@ export const Distribution_Exemplar = { fromAmino(object: Distribution_ExemplarAmino): Distribution_Exemplar { return { value: object.value, - timestamp: object?.timestamp, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, attachments: Array.isArray(object?.attachments) ? object.attachments.map((e: any) => Any.fromAmino(e)) : [] }; }, toAmino(message: Distribution_Exemplar): Distribution_ExemplarAmino { const obj: any = {}; obj.value = message.value; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; if (message.attachments) { obj.attachments = message.attachments.map(e => e ? Any.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv3/google/api/expr/v1alpha1/syntax.ts b/__fixtures__/v-next/outputv3/google/api/expr/v1alpha1/syntax.ts index a82e952d03..309cf87172 100644 --- a/__fixtures__/v-next/outputv3/google/api/expr/v1alpha1/syntax.ts +++ b/__fixtures__/v-next/outputv3/google/api/expr/v1alpha1/syntax.ts @@ -2098,7 +2098,7 @@ export const Constant = { stringValue: object?.string_value, bytesValue: object?.bytes_value, durationValue: object?.duration_value ? Duration.fromAmino(object.duration_value) : undefined, - timestampValue: object?.timestamp_value + timestampValue: object?.timestamp_value ? fromTimestamp(Timestamp.fromAmino(object.timestamp_value)) : undefined }; }, toAmino(message: Constant): ConstantAmino { @@ -2111,7 +2111,7 @@ export const Constant = { obj.string_value = message.stringValue; obj.bytes_value = message.bytesValue; obj.duration_value = message.durationValue ? Duration.toAmino(message.durationValue) : undefined; - obj.timestamp_value = message.timestampValue; + obj.timestamp_value = message.timestampValue ? Timestamp.toAmino(toTimestamp(message.timestampValue)) : undefined; return obj; }, fromProtoMsg(message: ConstantProtoMsg): Constant { diff --git a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/log_entry.ts b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/log_entry.ts index 06b65384c4..1305303ce6 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/log_entry.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/log_entry.ts @@ -610,7 +610,7 @@ export const LogEntry = { fromAmino(object: LogEntryAmino): LogEntry { return { name: object.name, - timestamp: object?.timestamp, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, trace: object.trace, @@ -631,7 +631,7 @@ export const LogEntry = { toAmino(message: LogEntry): LogEntryAmino { const obj: any = {}; obj.name = message.name; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.severity = message.severity; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; obj.trace = message.trace; diff --git a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/metric_value.ts b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/metric_value.ts index 4120104a0c..6b3621661c 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/metric_value.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/metric_value.ts @@ -414,8 +414,8 @@ export const MetricValue = { acc[key] = String(value); return acc; }, {}) : {}, - startTime: object?.start_time, - endTime: object?.end_time, + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, boolValue: object?.bool_value, int64Value: object?.int64_value ? BigInt(object.int64_value) : undefined, doubleValue: object?.double_value, @@ -431,8 +431,8 @@ export const MetricValue = { obj.labels[k] = v; }); } - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.bool_value = message.boolValue; obj.int64_value = message.int64Value ? message.int64Value.toString() : undefined; obj.double_value = message.doubleValue; diff --git a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/operation.ts b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/operation.ts index 0e9a4a6408..0b1cce01bf 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/operation.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/operation.ts @@ -556,8 +556,8 @@ export const Operation = { operationId: object.operation_id, operationName: object.operation_name, consumerId: object.consumer_id, - startTime: object?.start_time, - endTime: object?.end_time, + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ [key: string]: string; }>((acc, [key, value]) => { @@ -575,8 +575,8 @@ export const Operation = { obj.operation_id = message.operationId; obj.operation_name = message.operationName; obj.consumer_id = message.consumerId; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.labels = {}; if (message.labels) { Object.entries(message.labels).forEach(([k, v]) => { diff --git a/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/resources.ts b/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/resources.ts index 502f9c131c..3998e8feda 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/resources.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/resources.ts @@ -989,7 +989,7 @@ export const OperationMetadata = { resourceNames: Array.isArray(object?.resource_names) ? object.resource_names.map((e: any) => e) : [], steps: Array.isArray(object?.steps) ? object.steps.map((e: any) => OperationMetadata_Step.fromAmino(e)) : [], progressPercentage: object.progress_percentage, - startTime: object?.start_time + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined }; }, toAmino(message: OperationMetadata): OperationMetadataAmino { @@ -1005,7 +1005,7 @@ export const OperationMetadata = { obj.steps = []; } obj.progress_percentage = message.progressPercentage; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromProtoMsg(message: OperationMetadataProtoMsg): OperationMetadata { @@ -1731,7 +1731,7 @@ export const Rollout = { fromAmino(object: RolloutAmino): Rollout { return { rolloutId: object.rollout_id, - createTime: object?.create_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, createdBy: object.created_by, status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: object?.traffic_percent_strategy ? Rollout_TrafficPercentStrategy.fromAmino(object.traffic_percent_strategy) : undefined, @@ -1742,7 +1742,7 @@ export const Rollout = { toAmino(message: Rollout): RolloutAmino { const obj: any = {}; obj.rollout_id = message.rolloutId; - obj.create_time = message.createTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; obj.created_by = message.createdBy; obj.status = message.status; obj.traffic_percent_strategy = message.trafficPercentStrategy ? Rollout_TrafficPercentStrategy.toAmino(message.trafficPercentStrategy) : undefined; diff --git a/__fixtures__/v-next/outputv3/google/logging/v2/log_entry.ts b/__fixtures__/v-next/outputv3/google/logging/v2/log_entry.ts index d5552a9b91..c58380bd78 100644 --- a/__fixtures__/v-next/outputv3/google/logging/v2/log_entry.ts +++ b/__fixtures__/v-next/outputv3/google/logging/v2/log_entry.ts @@ -906,8 +906,8 @@ export const LogEntry = { protoPayload: object?.proto_payload ? Any.fromAmino(object.proto_payload) : undefined, textPayload: object?.text_payload, jsonPayload: object?.json_payload ? Struct.fromAmino(object.json_payload) : undefined, - timestamp: object?.timestamp, - receiveTimestamp: object?.receive_timestamp, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, + receiveTimestamp: object?.receive_timestamp ? fromTimestamp(Timestamp.fromAmino(object.receive_timestamp)) : undefined, severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: object.insert_id, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, @@ -932,8 +932,8 @@ export const LogEntry = { obj.proto_payload = message.protoPayload ? Any.toAmino(message.protoPayload) : undefined; obj.text_payload = message.textPayload; obj.json_payload = message.jsonPayload ? Struct.toAmino(message.jsonPayload) : undefined; - obj.timestamp = message.timestamp; - obj.receive_timestamp = message.receiveTimestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.receive_timestamp = message.receiveTimestamp ? Timestamp.toAmino(toTimestamp(message.receiveTimestamp)) : undefined; obj.severity = message.severity; obj.insert_id = message.insertId; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; diff --git a/__fixtures__/v-next/outputv3/google/logging/v2/logging_config.ts b/__fixtures__/v-next/outputv3/google/logging/v2/logging_config.ts index 28d45d52c2..af656084b6 100644 --- a/__fixtures__/v-next/outputv3/google/logging/v2/logging_config.ts +++ b/__fixtures__/v-next/outputv3/google/logging/v2/logging_config.ts @@ -3042,8 +3042,8 @@ export const LogBucket = { return { name: object.name, description: object.description, - createTime: object?.create_time, - updateTime: object?.update_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, retentionDays: object.retention_days, locked: object.locked, lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : -1, @@ -3055,8 +3055,8 @@ export const LogBucket = { const obj: any = {}; obj.name = message.name; obj.description = message.description; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; obj.retention_days = message.retentionDays; obj.locked = message.locked; obj.lifecycle_state = message.lifecycleState; @@ -3188,8 +3188,8 @@ export const LogView = { return { name: object.name, description: object.description, - createTime: object?.create_time, - updateTime: object?.update_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, filter: object.filter }; }, @@ -3197,8 +3197,8 @@ export const LogView = { const obj: any = {}; obj.name = message.name; obj.description = message.description; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; obj.filter = message.filter; return obj; }, @@ -3424,8 +3424,8 @@ export const LogSink = { writerIdentity: object.writer_identity, includeChildren: object.include_children, bigqueryOptions: object?.bigquery_options ? BigQueryOptions.fromAmino(object.bigquery_options) : undefined, - createTime: object?.create_time, - updateTime: object?.update_time + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined }; }, toAmino(message: LogSink): LogSinkAmino { @@ -3444,8 +3444,8 @@ export const LogSink = { obj.writer_identity = message.writerIdentity; obj.include_children = message.includeChildren; obj.bigquery_options = message.bigqueryOptions ? BigQueryOptions.toAmino(message.bigqueryOptions) : undefined; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; return obj; }, fromProtoMsg(message: LogSinkProtoMsg): LogSink { @@ -5518,8 +5518,8 @@ export const LogExclusion = { description: object.description, filter: object.filter, disabled: object.disabled, - createTime: object?.create_time, - updateTime: object?.update_time + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined }; }, toAmino(message: LogExclusion): LogExclusionAmino { @@ -5528,8 +5528,8 @@ export const LogExclusion = { obj.description = message.description; obj.filter = message.filter; obj.disabled = message.disabled; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; return obj; }, fromProtoMsg(message: LogExclusionProtoMsg): LogExclusion { @@ -6968,8 +6968,8 @@ export const CopyLogEntriesMetadata = { }, fromAmino(object: CopyLogEntriesMetadataAmino): CopyLogEntriesMetadata { return { - startTime: object?.start_time, - endTime: object?.end_time, + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: object.cancellation_requested, request: object?.request ? CopyLogEntriesRequest.fromAmino(object.request) : undefined, @@ -6979,8 +6979,8 @@ export const CopyLogEntriesMetadata = { }, toAmino(message: CopyLogEntriesMetadata): CopyLogEntriesMetadataAmino { const obj: any = {}; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.state = message.state; obj.cancellation_requested = message.cancellationRequested; obj.request = message.request ? CopyLogEntriesRequest.toAmino(message.request) : undefined; diff --git a/__fixtures__/v-next/outputv3/google/logging/v2/logging_metrics.ts b/__fixtures__/v-next/outputv3/google/logging/v2/logging_metrics.ts index f8af3c851f..c21a2c8009 100644 --- a/__fixtures__/v-next/outputv3/google/logging/v2/logging_metrics.ts +++ b/__fixtures__/v-next/outputv3/google/logging/v2/logging_metrics.ts @@ -885,8 +885,8 @@ export const LogMetric = { return acc; }, {}) : {}, bucketOptions: object?.bucket_options ? Distribution_BucketOptions.fromAmino(object.bucket_options) : undefined, - createTime: object?.create_time, - updateTime: object?.update_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, @@ -905,8 +905,8 @@ export const LogMetric = { }); } obj.bucket_options = message.bucketOptions ? Distribution_BucketOptions.toAmino(message.bucketOptions) : undefined; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; obj.version = message.version; return obj; }, diff --git a/__fixtures__/v-next/outputv3/google/protobuf/timestamp.ts b/__fixtures__/v-next/outputv3/google/protobuf/timestamp.ts index d2332d5af9..7389ac460c 100644 --- a/__fixtures__/v-next/outputv3/google/protobuf/timestamp.ts +++ b/__fixtures__/v-next/outputv3/google/protobuf/timestamp.ts @@ -350,7 +350,7 @@ export const Timestamp = { return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - return fromTimestamp(message).toString(); + return fromTimestamp(message).toISOString(); }, fromProtoMsg(message: TimestampProtoMsg): Timestamp { return Timestamp.decode(message.value); diff --git a/__fixtures__/v-next/outputv3/google/rpc/context/attribute_context.ts b/__fixtures__/v-next/outputv3/google/rpc/context/attribute_context.ts index ac520da8cf..09bc418b93 100644 --- a/__fixtures__/v-next/outputv3/google/rpc/context/attribute_context.ts +++ b/__fixtures__/v-next/outputv3/google/rpc/context/attribute_context.ts @@ -2026,7 +2026,7 @@ export const AttributeContext_Request = { host: object.host, scheme: object.scheme, query: object.query, - time: object?.time, + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, size: BigInt(object.size), protocol: object.protocol, reason: object.reason, @@ -2047,7 +2047,7 @@ export const AttributeContext_Request = { obj.host = message.host; obj.scheme = message.scheme; obj.query = message.query; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.size = message.size ? message.size.toString() : undefined; obj.protocol = message.protocol; obj.reason = message.reason; @@ -2304,7 +2304,7 @@ export const AttributeContext_Response = { acc[key] = String(value); return acc; }, {}) : {}, - time: object?.time, + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, backendLatency: object?.backend_latency ? Duration.fromAmino(object.backend_latency) : undefined }; }, @@ -2318,7 +2318,7 @@ export const AttributeContext_Response = { obj.headers[k] = v; }); } - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.backend_latency = message.backendLatency ? Duration.toAmino(message.backendLatency) : undefined; return obj; }, @@ -2777,9 +2777,9 @@ export const AttributeContext_Resource = { return acc; }, {}) : {}, displayName: object.display_name, - createTime: object?.create_time, - updateTime: object?.update_time, - deleteTime: object?.delete_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, + deleteTime: object?.delete_time ? fromTimestamp(Timestamp.fromAmino(object.delete_time)) : undefined, etag: object.etag, location: object.location }; @@ -2803,9 +2803,9 @@ export const AttributeContext_Resource = { }); } obj.display_name = message.displayName; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; - obj.delete_time = message.deleteTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; + obj.delete_time = message.deleteTime ? Timestamp.toAmino(toTimestamp(message.deleteTime)) : undefined; obj.etag = message.etag; obj.location = message.location; return obj; diff --git a/__fixtures__/v-next/outputv3/ibc/lightclients/tendermint/v1/tendermint.ts b/__fixtures__/v-next/outputv3/ibc/lightclients/tendermint/v1/tendermint.ts index cb4d3e9b10..09f3a214f5 100644 --- a/__fixtures__/v-next/outputv3/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/__fixtures__/v-next/outputv3/ibc/lightclients/tendermint/v1/tendermint.ts @@ -609,14 +609,14 @@ export const ConsensusState = { }, fromAmino(object: ConsensusStateAmino): ConsensusState { return { - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined, nextValidatorsHash: object.next_validators_hash }; }, toAmino(message: ConsensusState): ConsensusStateAmino { const obj: any = {}; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.root = message.root ? MerkleRoot.toAmino(message.root) : undefined; obj.next_validators_hash = message.nextValidatorsHash; return obj; diff --git a/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/params.ts b/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/params.ts index b7893d163a..b4b5bd2d31 100644 --- a/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/params.ts +++ b/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/params.ts @@ -128,7 +128,7 @@ export const Params = { }, fromAmino(object: ParamsAmino): Params { return { - airdropStartTime: object.airdrop_start_time, + airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimDenom: object.claim_denom @@ -136,7 +136,7 @@ export const Params = { }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.airdrop_start_time = message.airdropStartTime; + obj.airdrop_start_time = message.airdropStartTime ? Timestamp.toAmino(toTimestamp(message.airdropStartTime)) : undefined; obj.duration_until_decay = message.durationUntilDecay ? Duration.toAmino(message.durationUntilDecay) : undefined; obj.duration_of_decay = message.durationOfDecay ? Duration.toAmino(message.durationOfDecay) : undefined; obj.claim_denom = message.claimDenom; diff --git a/__fixtures__/v-next/outputv3/osmosis/epochs/genesis.ts b/__fixtures__/v-next/outputv3/osmosis/epochs/genesis.ts index bede0ea451..5263c25fc7 100644 --- a/__fixtures__/v-next/outputv3/osmosis/epochs/genesis.ts +++ b/__fixtures__/v-next/outputv3/osmosis/epochs/genesis.ts @@ -289,10 +289,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: object.current_epoch_start_time, + currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; @@ -300,10 +300,10 @@ export const EpochInfo = { toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime; + obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(toTimestamp(message.currentEpochStartTime)) : undefined; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv3/osmosis/gamm/pool-models/balancer/balancerPool.ts b/__fixtures__/v-next/outputv3/osmosis/gamm/pool-models/balancer/balancerPool.ts index e5efa81f5b..4920b97c47 100644 --- a/__fixtures__/v-next/outputv3/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/__fixtures__/v-next/outputv3/osmosis/gamm/pool-models/balancer/balancerPool.ts @@ -364,7 +364,7 @@ export const SmoothWeightChangeParams = { }, fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { return { - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, initialPoolWeights: Array.isArray(object?.initial_pool_weights) ? object.initial_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [], targetPoolWeights: Array.isArray(object?.target_pool_weights) ? object.target_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [] @@ -372,7 +372,7 @@ export const SmoothWeightChangeParams = { }, toAmino(message: SmoothWeightChangeParams): SmoothWeightChangeParamsAmino { const obj: any = {}; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; if (message.initialPoolWeights) { obj.initial_pool_weights = message.initialPoolWeights.map(e => e ? PoolAsset.toAmino(e) : undefined); diff --git a/__fixtures__/v-next/outputv3/osmosis/incentives/gauge.ts b/__fixtures__/v-next/outputv3/osmosis/incentives/gauge.ts index 756d920432..eedf00a523 100644 --- a/__fixtures__/v-next/outputv3/osmosis/incentives/gauge.ts +++ b/__fixtures__/v-next/outputv3/osmosis/incentives/gauge.ts @@ -291,7 +291,7 @@ export const Gauge = { isPerpetual: object.is_perpetual, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), numEpochsPaidOver: BigInt(object.num_epochs_paid_over), filledEpochs: BigInt(object.filled_epochs), distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : [] @@ -307,7 +307,7 @@ export const Gauge = { } else { obj.coins = []; } - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; obj.filled_epochs = message.filledEpochs ? message.filledEpochs.toString() : undefined; if (message.distributedCoins) { diff --git a/__fixtures__/v-next/outputv3/osmosis/incentives/tx.ts b/__fixtures__/v-next/outputv3/osmosis/incentives/tx.ts index 34277efdf1..037c887623 100644 --- a/__fixtures__/v-next/outputv3/osmosis/incentives/tx.ts +++ b/__fixtures__/v-next/outputv3/osmosis/incentives/tx.ts @@ -247,7 +247,7 @@ export const MsgCreateGauge = { owner: object.owner, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), numEpochsPaidOver: BigInt(object.num_epochs_paid_over) }; }, @@ -261,7 +261,7 @@ export const MsgCreateGauge = { } else { obj.coins = []; } - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv3/osmosis/lockup/lock.ts b/__fixtures__/v-next/outputv3/osmosis/lockup/lock.ts index b86e22e740..86ff91fc6c 100644 --- a/__fixtures__/v-next/outputv3/osmosis/lockup/lock.ts +++ b/__fixtures__/v-next/outputv3/osmosis/lockup/lock.ts @@ -378,7 +378,7 @@ export const PeriodLock = { ID: BigInt(object.ID), owner: object.owner, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - endTime: object.end_time, + endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] }; }, @@ -387,7 +387,7 @@ export const PeriodLock = { obj.ID = message.ID ? message.ID.toString() : undefined; obj.owner = message.owner; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.end_time = message.endTime; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; if (message.coins) { obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); } else { @@ -507,7 +507,7 @@ export const QueryCondition = { lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object.denom, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: QueryCondition): QueryConditionAmino { @@ -515,7 +515,7 @@ export const QueryCondition = { obj.lock_query_type = message.lockQueryType; obj.denom = message.denom; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromProtoMsg(message: QueryConditionProtoMsg): QueryCondition { @@ -631,7 +631,7 @@ export const SyntheticLock = { return { underlyingLockId: BigInt(object.underlying_lock_id), synthDenom: object.synth_denom, - endTime: object.end_time, + endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined }; }, @@ -639,7 +639,7 @@ export const SyntheticLock = { const obj: any = {}; obj.underlying_lock_id = message.underlyingLockId ? message.underlyingLockId.toString() : undefined; obj.synth_denom = message.synthDenom; - obj.end_time = message.endTime; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv3/osmosis/lockup/query.ts b/__fixtures__/v-next/outputv3/osmosis/lockup/query.ts index 27df7f1c02..977db38470 100644 --- a/__fixtures__/v-next/outputv3/osmosis/lockup/query.ts +++ b/__fixtures__/v-next/outputv3/osmosis/lockup/query.ts @@ -1350,13 +1350,13 @@ export const AccountLockedPastTimeRequest = { fromAmino(object: AccountLockedPastTimeRequestAmino): AccountLockedPastTimeRequest { return { owner: object.owner, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: AccountLockedPastTimeRequest): AccountLockedPastTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromProtoMsg(message: AccountLockedPastTimeRequestProtoMsg): AccountLockedPastTimeRequest { @@ -1534,13 +1534,13 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino): AccountLockedPastTimeNotUnlockingOnlyRequest { return { owner: object.owner, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyRequest): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromProtoMsg(message: AccountLockedPastTimeNotUnlockingOnlyRequestProtoMsg): AccountLockedPastTimeNotUnlockingOnlyRequest { @@ -1718,13 +1718,13 @@ export const AccountUnlockedBeforeTimeRequest = { fromAmino(object: AccountUnlockedBeforeTimeRequestAmino): AccountUnlockedBeforeTimeRequest { return { owner: object.owner, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: AccountUnlockedBeforeTimeRequest): AccountUnlockedBeforeTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromProtoMsg(message: AccountUnlockedBeforeTimeRequestProtoMsg): AccountUnlockedBeforeTimeRequest { @@ -1914,14 +1914,14 @@ export const AccountLockedPastTimeDenomRequest = { fromAmino(object: AccountLockedPastTimeDenomRequestAmino): AccountLockedPastTimeDenomRequest { return { owner: object.owner, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), denom: object.denom }; }, toAmino(message: AccountLockedPastTimeDenomRequest): AccountLockedPastTimeDenomRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.denom = message.denom; return obj; }, diff --git a/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/query.ts b/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/query.ts index 73adc2bf12..59fab4c780 100644 --- a/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/query.ts @@ -208,8 +208,8 @@ export const ArithmeticTwapRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: object.start_time, - endTime: object?.end_time + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined }; }, toAmino(message: ArithmeticTwapRequest): ArithmeticTwapRequestAmino { @@ -217,8 +217,8 @@ export const ArithmeticTwapRequest = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; return obj; }, fromProtoMsg(message: ArithmeticTwapRequestProtoMsg): ArithmeticTwapRequest { @@ -412,7 +412,7 @@ export const ArithmeticTwapToNowRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: object.start_time + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)) }; }, toAmino(message: ArithmeticTwapToNowRequest): ArithmeticTwapToNowRequestAmino { @@ -420,7 +420,7 @@ export const ArithmeticTwapToNowRequest = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromProtoMsg(message: ArithmeticTwapToNowRequestProtoMsg): ArithmeticTwapToNowRequest { diff --git a/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/twap_record.ts b/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/twap_record.ts index 3812d4f2ce..de306eff7f 100644 --- a/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/twap_record.ts +++ b/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/twap_record.ts @@ -276,12 +276,12 @@ export const TwapRecord = { asset0Denom: object.asset0_denom, asset1Denom: object.asset1_denom, height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), p0LastSpotPrice: object.p0_last_spot_price, p1LastSpotPrice: object.p1_last_spot_price, p0ArithmeticTwapAccumulator: object.p0_arithmetic_twap_accumulator, p1ArithmeticTwapAccumulator: object.p1_arithmetic_twap_accumulator, - lastErrorTime: object.last_error_time + lastErrorTime: fromTimestamp(Timestamp.fromAmino(object.last_error_time)) }; }, toAmino(message: TwapRecord): TwapRecordAmino { @@ -290,12 +290,12 @@ export const TwapRecord = { obj.asset0_denom = message.asset0Denom; obj.asset1_denom = message.asset1Denom; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.p0_last_spot_price = message.p0LastSpotPrice; obj.p1_last_spot_price = message.p1LastSpotPrice; obj.p0_arithmetic_twap_accumulator = message.p0ArithmeticTwapAccumulator; obj.p1_arithmetic_twap_accumulator = message.p1ArithmeticTwapAccumulator; - obj.last_error_time = message.lastErrorTime; + obj.last_error_time = message.lastErrorTime ? Timestamp.toAmino(toTimestamp(message.lastErrorTime)) : undefined; return obj; }, fromProtoMsg(message: TwapRecordProtoMsg): TwapRecord { diff --git a/__fixtures__/v-next/outputv3/tendermint/abci/types.ts b/__fixtures__/v-next/outputv3/tendermint/abci/types.ts index 4e57b42661..cc1bf4f2fc 100644 --- a/__fixtures__/v-next/outputv3/tendermint/abci/types.ts +++ b/__fixtures__/v-next/outputv3/tendermint/abci/types.ts @@ -1984,7 +1984,7 @@ export const RequestInitChain = { }, fromAmino(object: RequestInitChainAmino): RequestInitChain { return { - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), chainId: object.chain_id, consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], @@ -1994,7 +1994,7 @@ export const RequestInitChain = { }, toAmino(message: RequestInitChain): RequestInitChainAmino { const obj: any = {}; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.chain_id = message.chainId; obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; if (message.validators) { @@ -6199,7 +6199,7 @@ export const Evidence = { type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), totalVotingPower: BigInt(object.total_voting_power) }; }, @@ -6208,7 +6208,7 @@ export const Evidence = { obj.type = message.type; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv3/tendermint/p2p/types.ts b/__fixtures__/v-next/outputv3/tendermint/p2p/types.ts index efe7daf445..c60b169517 100644 --- a/__fixtures__/v-next/outputv3/tendermint/p2p/types.ts +++ b/__fixtures__/v-next/outputv3/tendermint/p2p/types.ts @@ -587,7 +587,7 @@ export const PeerInfo = { return { id: object.id, addressInfo: Array.isArray(object?.address_info) ? object.address_info.map((e: any) => PeerAddressInfo.fromAmino(e)) : [], - lastConnected: object?.last_connected + lastConnected: object?.last_connected ? fromTimestamp(Timestamp.fromAmino(object.last_connected)) : undefined }; }, toAmino(message: PeerInfo): PeerInfoAmino { @@ -598,7 +598,7 @@ export const PeerInfo = { } else { obj.address_info = []; } - obj.last_connected = message.lastConnected; + obj.last_connected = message.lastConnected ? Timestamp.toAmino(toTimestamp(message.lastConnected)) : undefined; return obj; }, fromProtoMsg(message: PeerInfoProtoMsg): PeerInfo { @@ -708,16 +708,16 @@ export const PeerAddressInfo = { fromAmino(object: PeerAddressInfoAmino): PeerAddressInfo { return { address: object.address, - lastDialSuccess: object?.last_dial_success, - lastDialFailure: object?.last_dial_failure, + lastDialSuccess: object?.last_dial_success ? fromTimestamp(Timestamp.fromAmino(object.last_dial_success)) : undefined, + lastDialFailure: object?.last_dial_failure ? fromTimestamp(Timestamp.fromAmino(object.last_dial_failure)) : undefined, dialFailures: object.dial_failures }; }, toAmino(message: PeerAddressInfo): PeerAddressInfoAmino { const obj: any = {}; obj.address = message.address; - obj.last_dial_success = message.lastDialSuccess; - obj.last_dial_failure = message.lastDialFailure; + obj.last_dial_success = message.lastDialSuccess ? Timestamp.toAmino(toTimestamp(message.lastDialSuccess)) : undefined; + obj.last_dial_failure = message.lastDialFailure ? Timestamp.toAmino(toTimestamp(message.lastDialFailure)) : undefined; obj.dial_failures = message.dialFailures; return obj; }, diff --git a/__fixtures__/v-next/outputv3/tendermint/types/evidence.ts b/__fixtures__/v-next/outputv3/tendermint/types/evidence.ts index 1131903d05..af1a3b7066 100644 --- a/__fixtures__/v-next/outputv3/tendermint/types/evidence.ts +++ b/__fixtures__/v-next/outputv3/tendermint/types/evidence.ts @@ -302,7 +302,7 @@ export const DuplicateVoteEvidence = { voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, totalVotingPower: BigInt(object.total_voting_power), validatorPower: BigInt(object.validator_power), - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { @@ -311,7 +311,7 @@ export const DuplicateVoteEvidence = { obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; obj.validator_power = message.validatorPower ? message.validatorPower.toString() : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromProtoMsg(message: DuplicateVoteEvidenceProtoMsg): DuplicateVoteEvidence { @@ -450,7 +450,7 @@ export const LightClientAttackEvidence = { commonHeight: BigInt(object.common_height), byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], totalVotingPower: BigInt(object.total_voting_power), - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { @@ -463,7 +463,7 @@ export const LightClientAttackEvidence = { obj.byzantine_validators = []; } obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromProtoMsg(message: LightClientAttackEvidenceProtoMsg): LightClientAttackEvidence { diff --git a/__fixtures__/v-next/outputv3/tendermint/types/types.ts b/__fixtures__/v-next/outputv3/tendermint/types/types.ts index 719841956e..068e365dc4 100644 --- a/__fixtures__/v-next/outputv3/tendermint/types/types.ts +++ b/__fixtures__/v-next/outputv3/tendermint/types/types.ts @@ -974,7 +974,7 @@ export const Header = { version: object?.version ? Consensus.fromAmino(object.version) : undefined, chainId: object.chain_id, height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, lastCommitHash: object.last_commit_hash, dataHash: object.data_hash, @@ -992,7 +992,7 @@ export const Header = { obj.version = message.version ? Consensus.toAmino(message.version) : undefined; obj.chain_id = message.chainId; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; obj.last_commit_hash = message.lastCommitHash; obj.data_hash = message.dataHash; @@ -1257,7 +1257,7 @@ export const Vote = { height: BigInt(object.height), round: object.round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), validatorAddress: object.validator_address, validatorIndex: object.validator_index, signature: object.signature @@ -1269,7 +1269,7 @@ export const Vote = { obj.height = message.height ? message.height.toString() : undefined; obj.round = message.round; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.validator_address = message.validatorAddress; obj.validator_index = message.validatorIndex; obj.signature = message.signature; @@ -1519,7 +1519,7 @@ export const CommitSig = { return { blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object.validator_address, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), signature: object.signature }; }, @@ -1527,7 +1527,7 @@ export const CommitSig = { const obj: any = {}; obj.block_id_flag = message.blockIdFlag; obj.validator_address = message.validatorAddress; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.signature = message.signature; return obj; }, @@ -1682,7 +1682,7 @@ export const Proposal = { round: object.round, polRound: object.pol_round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), signature: object.signature }; }, @@ -1693,7 +1693,7 @@ export const Proposal = { obj.round = message.round; obj.pol_round = message.polRound; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.signature = message.signature; return obj; }, diff --git a/__fixtures__/v-next/outputv4/cosmos/authz/v1beta1/authz.ts b/__fixtures__/v-next/outputv4/cosmos/authz/v1beta1/authz.ts index a681fd68b8..b102545d3f 100644 --- a/__fixtures__/v-next/outputv4/cosmos/authz/v1beta1/authz.ts +++ b/__fixtures__/v-next/outputv4/cosmos/authz/v1beta1/authz.ts @@ -254,13 +254,13 @@ export const Grant = { fromAmino(object: GrantAmino): Grant { return { authorization: object?.authorization ? Any.fromAmino(object.authorization) : undefined, - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: Grant): GrantAmino { const obj: any = {}; obj.authorization = message.authorization ? Any.toAmino(message.authorization) : undefined; - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: GrantAminoMsg): Grant { @@ -391,7 +391,7 @@ export const GrantAuthorization = { granter: object.granter, grantee: object.grantee, authorization: object?.authorization ? Any.fromAmino(object.authorization) : undefined, - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: GrantAuthorization): GrantAuthorizationAmino { @@ -399,7 +399,7 @@ export const GrantAuthorization = { obj.granter = message.granter; obj.grantee = message.grantee; obj.authorization = message.authorization ? Any.toAmino(message.authorization) : undefined; - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { diff --git a/__fixtures__/v-next/outputv4/cosmos/authz/v1beta1/tx.amino.ts b/__fixtures__/v-next/outputv4/cosmos/authz/v1beta1/tx.amino.ts index dee011d143..b035d8f4ff 100644 --- a/__fixtures__/v-next/outputv4/cosmos/authz/v1beta1/tx.amino.ts +++ b/__fixtures__/v-next/outputv4/cosmos/authz/v1beta1/tx.amino.ts @@ -1,7 +1,6 @@ import { Grant, GrantSDKType } from "./authz"; import { Any, AnySDKType } from "../../../google/protobuf/any"; import { AminoMsg } from "@cosmjs/amino"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { MsgGrant, MsgGrantSDKType, MsgExec, MsgExecSDKType, MsgRevoke, MsgRevokeSDKType } from "./tx"; export interface MsgGrantAminoType extends AminoMsg { type: "cosmos-sdk/MsgGrant"; @@ -13,10 +12,7 @@ export interface MsgGrantAminoType extends AminoMsg { type_url: string; value: Uint8Array; }; - expiration: { - seconds: string; - nanos: number; - }; + expiration: string; }; }; } diff --git a/__fixtures__/v-next/outputv4/cosmos/evidence/v1beta1/evidence.ts b/__fixtures__/v-next/outputv4/cosmos/evidence/v1beta1/evidence.ts index dfaaf68dc0..484f7e12df 100644 --- a/__fixtures__/v-next/outputv4/cosmos/evidence/v1beta1/evidence.ts +++ b/__fixtures__/v-next/outputv4/cosmos/evidence/v1beta1/evidence.ts @@ -132,7 +132,7 @@ export const Equivocation = { fromAmino(object: EquivocationAmino): Equivocation { return { height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), power: BigInt(object.power), consensusAddress: object.consensus_address }; @@ -140,7 +140,7 @@ export const Equivocation = { toAmino(message: Equivocation): EquivocationAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.power = message.power ? message.power.toString() : undefined; obj.consensus_address = message.consensusAddress; return obj; diff --git a/__fixtures__/v-next/outputv4/cosmos/feegrant/v1beta1/feegrant.ts b/__fixtures__/v-next/outputv4/cosmos/feegrant/v1beta1/feegrant.ts index 196a53a7de..b9e6427d4f 100644 --- a/__fixtures__/v-next/outputv4/cosmos/feegrant/v1beta1/feegrant.ts +++ b/__fixtures__/v-next/outputv4/cosmos/feegrant/v1beta1/feegrant.ts @@ -191,7 +191,7 @@ export const BasicAllowance = { fromAmino(object: BasicAllowanceAmino): BasicAllowance { return { spendLimit: Array.isArray(object?.spend_limit) ? object.spend_limit.map((e: any) => Coin.fromAmino(e)) : [], - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: BasicAllowance): BasicAllowanceAmino { @@ -201,7 +201,7 @@ export const BasicAllowance = { } else { obj.spend_limit = []; } - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: BasicAllowanceAminoMsg): BasicAllowance { @@ -364,7 +364,7 @@ export const PeriodicAllowance = { period: object?.period ? Duration.fromAmino(object.period) : undefined, periodSpendLimit: Array.isArray(object?.period_spend_limit) ? object.period_spend_limit.map((e: any) => Coin.fromAmino(e)) : [], periodCanSpend: Array.isArray(object?.period_can_spend) ? object.period_can_spend.map((e: any) => Coin.fromAmino(e)) : [], - periodReset: object.period_reset + periodReset: fromTimestamp(Timestamp.fromAmino(object.period_reset)) }; }, toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { @@ -381,7 +381,7 @@ export const PeriodicAllowance = { } else { obj.period_can_spend = []; } - obj.period_reset = message.periodReset; + obj.period_reset = message.periodReset ? Timestamp.toAmino(toTimestamp(message.periodReset)) : undefined; return obj; }, fromAminoMsg(object: PeriodicAllowanceAminoMsg): PeriodicAllowance { diff --git a/__fixtures__/v-next/outputv4/cosmos/gov/v1/gov.ts b/__fixtures__/v-next/outputv4/cosmos/gov/v1/gov.ts index 0fb0951cfb..d8c4ce33a4 100644 --- a/__fixtures__/v-next/outputv4/cosmos/gov/v1/gov.ts +++ b/__fixtures__/v-next/outputv4/cosmos/gov/v1/gov.ts @@ -755,11 +755,11 @@ export const Proposal = { messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object?.submit_time, - depositEndTime: object?.deposit_end_time, + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined, + depositEndTime: object?.deposit_end_time ? fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)) : undefined, totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object?.voting_start_time, - votingEndTime: object?.voting_end_time, + votingStartTime: object?.voting_start_time ? fromTimestamp(Timestamp.fromAmino(object.voting_start_time)) : undefined, + votingEndTime: object?.voting_end_time ? fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) : undefined, metadata: object.metadata }; }, @@ -773,15 +773,15 @@ export const Proposal = { } obj.status = message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime; - obj.deposit_end_time = message.depositEndTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : undefined; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime; - obj.voting_end_time = message.votingEndTime; + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : undefined; + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : undefined; obj.metadata = message.metadata; return obj; }, diff --git a/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/gov.ts b/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/gov.ts index f4f05f92d4..1ef30b466b 100644 --- a/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/gov.ts @@ -876,11 +876,11 @@ export const Proposal = { content: object?.content ? Any.fromAmino(object.content) : undefined, status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object.submit_time, - depositEndTime: object.deposit_end_time, + submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), + depositEndTime: fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)), totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object.voting_start_time, - votingEndTime: object.voting_end_time + votingStartTime: fromTimestamp(Timestamp.fromAmino(object.voting_start_time)), + votingEndTime: fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) }; }, toAmino(message: Proposal): ProposalAmino { @@ -889,15 +889,15 @@ export const Proposal = { obj.content = message.content ? Any.toAmino(message.content) : undefined; obj.status = message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime; - obj.deposit_end_time = message.depositEndTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : undefined; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime; - obj.voting_end_time = message.votingEndTime; + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : undefined; + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : undefined; return obj; }, fromAminoMsg(object: ProposalAminoMsg): Proposal { diff --git a/__fixtures__/v-next/outputv4/cosmos/group/v1/tx.amino.ts b/__fixtures__/v-next/outputv4/cosmos/group/v1/tx.amino.ts index e7787dfe21..e44a0f0c10 100644 --- a/__fixtures__/v-next/outputv4/cosmos/group/v1/tx.amino.ts +++ b/__fixtures__/v-next/outputv4/cosmos/group/v1/tx.amino.ts @@ -1,7 +1,6 @@ import { Member, MemberSDKType, VoteOption, VoteOptionSDKType, voteOptionFromJSON } from "./types"; import { Any, AnySDKType } from "../../../google/protobuf/any"; import { AminoMsg } from "@cosmjs/amino"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { execFromJSON, MsgCreateGroup, MsgCreateGroupSDKType, MsgUpdateGroupMembers, MsgUpdateGroupMembersSDKType, MsgUpdateGroupAdmin, MsgUpdateGroupAdminSDKType, MsgUpdateGroupMetadata, MsgUpdateGroupMetadataSDKType, MsgCreateGroupPolicy, MsgCreateGroupPolicySDKType, MsgCreateGroupWithPolicy, MsgCreateGroupWithPolicySDKType, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyAdminSDKType, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyDecisionPolicySDKType, MsgUpdateGroupPolicyMetadata, MsgUpdateGroupPolicyMetadataSDKType, MsgSubmitProposal, MsgSubmitProposalSDKType, MsgWithdrawProposal, MsgWithdrawProposalSDKType, MsgVote, MsgVoteSDKType, MsgExec, MsgExecSDKType, MsgLeaveGroup, MsgLeaveGroupSDKType } from "./tx"; export interface MsgCreateGroupAminoType extends AminoMsg { type: "cosmos-sdk/MsgCreateGroup"; @@ -11,10 +10,7 @@ export interface MsgCreateGroupAminoType extends AminoMsg { address: string; weight: string; metadata: string; - added_at: { - seconds: string; - nanos: number; - }; + added_at: string; }[]; metadata: string; }; @@ -28,10 +24,7 @@ export interface MsgUpdateGroupMembersAminoType extends AminoMsg { address: string; weight: string; metadata: string; - added_at: { - seconds: string; - nanos: number; - }; + added_at: string; }[]; }; } @@ -71,10 +64,7 @@ export interface MsgCreateGroupWithPolicyAminoType extends AminoMsg { address: string; weight: string; metadata: string; - added_at: { - seconds: string; - nanos: number; - }; + added_at: string; }[]; group_metadata: string; group_policy_metadata: string; diff --git a/__fixtures__/v-next/outputv4/cosmos/group/v1/types.ts b/__fixtures__/v-next/outputv4/cosmos/group/v1/types.ts index 1a3228bf0d..c82a233718 100644 --- a/__fixtures__/v-next/outputv4/cosmos/group/v1/types.ts +++ b/__fixtures__/v-next/outputv4/cosmos/group/v1/types.ts @@ -630,7 +630,7 @@ export const Member = { address: object.address, weight: object.weight, metadata: object.metadata, - addedAt: object.added_at + addedAt: fromTimestamp(Timestamp.fromAmino(object.added_at)) }; }, toAmino(message: Member): MemberAmino { @@ -638,7 +638,7 @@ export const Member = { obj.address = message.address; obj.weight = message.weight; obj.metadata = message.metadata; - obj.added_at = message.addedAt; + obj.added_at = message.addedAt ? Timestamp.toAmino(toTimestamp(message.addedAt)) : undefined; return obj; }, fromAminoMsg(object: MemberAminoMsg): Member { @@ -1232,7 +1232,7 @@ export const GroupInfo = { metadata: object.metadata, version: BigInt(object.version), totalWeight: object.total_weight, - createdAt: object.created_at + createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) }; }, toAmino(message: GroupInfo): GroupInfoAmino { @@ -1242,7 +1242,7 @@ export const GroupInfo = { obj.metadata = message.metadata; obj.version = message.version ? message.version.toString() : undefined; obj.total_weight = message.totalWeight; - obj.created_at = message.createdAt; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : undefined; return obj; }, fromAminoMsg(object: GroupInfoAminoMsg): GroupInfo { @@ -1530,7 +1530,7 @@ export const GroupPolicyInfo = { metadata: object.metadata, version: BigInt(object.version), decisionPolicy: object?.decision_policy ? Any.fromAmino(object.decision_policy) : undefined, - createdAt: object.created_at + createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) }; }, toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { @@ -1541,7 +1541,7 @@ export const GroupPolicyInfo = { obj.metadata = message.metadata; obj.version = message.version ? message.version.toString() : undefined; obj.decision_policy = message.decisionPolicy ? Any.toAmino(message.decisionPolicy) : undefined; - obj.created_at = message.createdAt; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : undefined; return obj; }, fromAminoMsg(object: GroupPolicyInfoAminoMsg): GroupPolicyInfo { @@ -1812,13 +1812,13 @@ export const Proposal = { address: object.address, metadata: object.metadata, proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], - submitTime: object.submit_time, + submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), groupVersion: BigInt(object.group_version), groupPolicyVersion: BigInt(object.group_policy_version), status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - votingPeriodEnd: object.voting_period_end, + votingPeriodEnd: fromTimestamp(Timestamp.fromAmino(object.voting_period_end)), executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] }; @@ -1833,13 +1833,13 @@ export const Proposal = { } else { obj.proposers = []; } - obj.submit_time = message.submitTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; obj.group_version = message.groupVersion ? message.groupVersion.toString() : undefined; obj.group_policy_version = message.groupPolicyVersion ? message.groupPolicyVersion.toString() : undefined; obj.status = message.status; obj.result = message.result; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.voting_period_end = message.votingPeriodEnd; + obj.voting_period_end = message.votingPeriodEnd ? Timestamp.toAmino(toTimestamp(message.votingPeriodEnd)) : undefined; obj.executor_result = message.executorResult; if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); @@ -2127,7 +2127,7 @@ export const Vote = { voter: object.voter, option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata, - submitTime: object.submit_time + submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)) }; }, toAmino(message: Vote): VoteAmino { @@ -2136,7 +2136,7 @@ export const Vote = { obj.voter = message.voter; obj.option = message.option; obj.metadata = message.metadata; - obj.submit_time = message.submitTime; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; return obj; }, fromAminoMsg(object: VoteAminoMsg): Vote { diff --git a/__fixtures__/v-next/outputv4/cosmos/slashing/v1beta1/slashing.ts b/__fixtures__/v-next/outputv4/cosmos/slashing/v1beta1/slashing.ts index 61e0eb127a..bf3cc9ef1f 100644 --- a/__fixtures__/v-next/outputv4/cosmos/slashing/v1beta1/slashing.ts +++ b/__fixtures__/v-next/outputv4/cosmos/slashing/v1beta1/slashing.ts @@ -202,7 +202,7 @@ export const ValidatorSigningInfo = { address: object.address, startHeight: BigInt(object.start_height), indexOffset: BigInt(object.index_offset), - jailedUntil: object.jailed_until, + jailedUntil: fromTimestamp(Timestamp.fromAmino(object.jailed_until)), tombstoned: object.tombstoned, missedBlocksCounter: BigInt(object.missed_blocks_counter) }; @@ -212,7 +212,7 @@ export const ValidatorSigningInfo = { obj.address = message.address; obj.start_height = message.startHeight ? message.startHeight.toString() : undefined; obj.index_offset = message.indexOffset ? message.indexOffset.toString() : undefined; - obj.jailed_until = message.jailedUntil; + obj.jailed_until = message.jailedUntil ? Timestamp.toAmino(toTimestamp(message.jailedUntil)) : undefined; obj.tombstoned = message.tombstoned; obj.missed_blocks_counter = message.missedBlocksCounter ? message.missedBlocksCounter.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/staking.ts b/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/staking.ts index 04fa26a64e..6385c53020 100644 --- a/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/staking.ts @@ -848,13 +848,13 @@ export const Commission = { fromAmino(object: CommissionAmino): Commission { return { commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: object.update_time + updateTime: fromTimestamp(Timestamp.fromAmino(object.update_time)) }; }, toAmino(message: Commission): CommissionAmino { const obj: any = {}; obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : undefined; - obj.update_time = message.updateTime; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; return obj; }, fromAminoMsg(object: CommissionAminoMsg): Commission { @@ -1239,7 +1239,7 @@ export const Validator = { delegatorShares: object.delegator_shares, description: object?.description ? Description.fromAmino(object.description) : undefined, unbondingHeight: BigInt(object.unbonding_height), - unbondingTime: object.unbonding_time, + unbondingTime: fromTimestamp(Timestamp.fromAmino(object.unbonding_time)), commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, minSelfDelegation: object.min_self_delegation }; @@ -1254,7 +1254,7 @@ export const Validator = { obj.delegator_shares = message.delegatorShares; obj.description = message.description ? Description.toAmino(message.description) : undefined; obj.unbonding_height = message.unbondingHeight ? message.unbondingHeight.toString() : undefined; - obj.unbonding_time = message.unbondingTime; + obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) : undefined; obj.commission = message.commission ? Commission.toAmino(message.commission) : undefined; obj.min_self_delegation = message.minSelfDelegation; return obj; @@ -2182,7 +2182,7 @@ export const UnbondingDelegationEntry = { fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: object.completion_time, + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), initialBalance: object.initial_balance, balance: object.balance }; @@ -2190,7 +2190,7 @@ export const UnbondingDelegationEntry = { toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; obj.initial_balance = message.initialBalance; obj.balance = message.balance; return obj; @@ -2321,7 +2321,7 @@ export const RedelegationEntry = { fromAmino(object: RedelegationEntryAmino): RedelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: object.completion_time, + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), initialBalance: object.initial_balance, sharesDst: object.shares_dst }; @@ -2329,7 +2329,7 @@ export const RedelegationEntry = { toAmino(message: RedelegationEntry): RedelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; obj.initial_balance = message.initialBalance; obj.shares_dst = message.sharesDst; return obj; diff --git a/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/tx.ts b/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/tx.ts index ca6ca8de6a..41d228788a 100644 --- a/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/tx.ts @@ -1044,12 +1044,12 @@ export const MsgBeginRedelegateResponse = { }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { return { - completionTime: object.completion_time + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) }; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; return obj; }, fromAminoMsg(object: MsgBeginRedelegateResponseAminoMsg): MsgBeginRedelegateResponse { @@ -1260,12 +1260,12 @@ export const MsgUndelegateResponse = { }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { return { - completionTime: object.completion_time + completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) }; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; return obj; }, fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { diff --git a/__fixtures__/v-next/outputv4/cosmos/upgrade/v1beta1/tx.amino.ts b/__fixtures__/v-next/outputv4/cosmos/upgrade/v1beta1/tx.amino.ts index 1eb1068281..92673592c2 100644 --- a/__fixtures__/v-next/outputv4/cosmos/upgrade/v1beta1/tx.amino.ts +++ b/__fixtures__/v-next/outputv4/cosmos/upgrade/v1beta1/tx.amino.ts @@ -1,6 +1,5 @@ import { Plan, PlanSDKType } from "./upgrade"; import { AminoMsg } from "@cosmjs/amino"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Any, AnySDKType } from "../../../google/protobuf/any"; import { MsgSoftwareUpgrade, MsgSoftwareUpgradeSDKType, MsgCancelUpgrade, MsgCancelUpgradeSDKType } from "./tx"; export interface MsgSoftwareUpgradeAminoType extends AminoMsg { @@ -9,10 +8,7 @@ export interface MsgSoftwareUpgradeAminoType extends AminoMsg { authority: string; plan: { name: string; - time: { - seconds: string; - nanos: number; - }; + time: string; height: string; info: string; upgraded_client_state: { diff --git a/__fixtures__/v-next/outputv4/cosmos/upgrade/v1beta1/upgrade.ts b/__fixtures__/v-next/outputv4/cosmos/upgrade/v1beta1/upgrade.ts index 9b3602f5fb..1736d215d9 100644 --- a/__fixtures__/v-next/outputv4/cosmos/upgrade/v1beta1/upgrade.ts +++ b/__fixtures__/v-next/outputv4/cosmos/upgrade/v1beta1/upgrade.ts @@ -251,7 +251,7 @@ export const Plan = { fromAmino(object: PlanAmino): Plan { return { name: object.name, - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), height: BigInt(object.height), info: object.info, upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined @@ -260,7 +260,7 @@ export const Plan = { toAmino(message: Plan): PlanAmino { const obj: any = {}; obj.name = message.name; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.height = message.height ? message.height.toString() : undefined; obj.info = message.info; obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; diff --git a/__fixtures__/v-next/outputv4/evmos/claims/v1/genesis.ts b/__fixtures__/v-next/outputv4/evmos/claims/v1/genesis.ts index a4c6dcbf11..6624d9ee48 100644 --- a/__fixtures__/v-next/outputv4/evmos/claims/v1/genesis.ts +++ b/__fixtures__/v-next/outputv4/evmos/claims/v1/genesis.ts @@ -330,7 +330,7 @@ export const Params = { fromAmino(object: ParamsAmino): Params { return { enableClaims: object.enable_claims, - airdropStartTime: object.airdrop_start_time, + airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimsDenom: object.claims_denom, @@ -341,7 +341,7 @@ export const Params = { toAmino(message: Params): ParamsAmino { const obj: any = {}; obj.enable_claims = message.enableClaims; - obj.airdrop_start_time = message.airdropStartTime; + obj.airdrop_start_time = message.airdropStartTime ? Timestamp.toAmino(toTimestamp(message.airdropStartTime)) : undefined; obj.duration_until_decay = message.durationUntilDecay ? Duration.toAmino(message.durationUntilDecay) : undefined; obj.duration_of_decay = message.durationOfDecay ? Duration.toAmino(message.durationOfDecay) : undefined; obj.claims_denom = message.claimsDenom; diff --git a/__fixtures__/v-next/outputv4/evmos/epochs/v1/genesis.ts b/__fixtures__/v-next/outputv4/evmos/epochs/v1/genesis.ts index 2492a9280c..25a9a17782 100644 --- a/__fixtures__/v-next/outputv4/evmos/epochs/v1/genesis.ts +++ b/__fixtures__/v-next/outputv4/evmos/epochs/v1/genesis.ts @@ -184,10 +184,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: object.current_epoch_start_time, + currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; @@ -195,10 +195,10 @@ export const EpochInfo = { toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime; + obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(toTimestamp(message.currentEpochStartTime)) : undefined; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv4/evmos/incentives/v1/incentives.ts b/__fixtures__/v-next/outputv4/evmos/incentives/v1/incentives.ts index f14c1d3b37..56a1faf6f1 100644 --- a/__fixtures__/v-next/outputv4/evmos/incentives/v1/incentives.ts +++ b/__fixtures__/v-next/outputv4/evmos/incentives/v1/incentives.ts @@ -224,7 +224,7 @@ export const Incentive = { contract: object.contract, allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => DecCoin.fromAmino(e)) : [], epochs: object.epochs, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), totalGas: BigInt(object.total_gas) }; }, @@ -237,7 +237,7 @@ export const Incentive = { obj.allocations = []; } obj.epochs = message.epochs; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.total_gas = message.totalGas ? message.totalGas.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv4/evmos/vesting/v1/tx.amino.ts b/__fixtures__/v-next/outputv4/evmos/vesting/v1/tx.amino.ts index a11da2a219..ef55f48dca 100644 --- a/__fixtures__/v-next/outputv4/evmos/vesting/v1/tx.amino.ts +++ b/__fixtures__/v-next/outputv4/evmos/vesting/v1/tx.amino.ts @@ -8,10 +8,7 @@ export interface MsgCreateClawbackVestingAccountAminoType extends AminoMsg { value: { from_address: string; to_address: string; - start_time: { - seconds: string; - nanos: number; - }; + start_time: string; lockup_periods: { length: string; amount: { diff --git a/__fixtures__/v-next/outputv4/evmos/vesting/v1/tx.ts b/__fixtures__/v-next/outputv4/evmos/vesting/v1/tx.ts index 7e4e374afa..1e7b488b50 100644 --- a/__fixtures__/v-next/outputv4/evmos/vesting/v1/tx.ts +++ b/__fixtures__/v-next/outputv4/evmos/vesting/v1/tx.ts @@ -236,7 +236,7 @@ export const MsgCreateClawbackVestingAccount = { return { fromAddress: object.from_address, toAddress: object.to_address, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [], merge: object.merge @@ -246,7 +246,7 @@ export const MsgCreateClawbackVestingAccount = { const obj: any = {}; obj.from_address = message.fromAddress; obj.to_address = message.toAddress; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; if (message.lockupPeriods) { obj.lockup_periods = message.lockupPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv4/evmos/vesting/v1/vesting.ts b/__fixtures__/v-next/outputv4/evmos/vesting/v1/vesting.ts index 6678e6ad59..0e3bfd8b85 100644 --- a/__fixtures__/v-next/outputv4/evmos/vesting/v1/vesting.ts +++ b/__fixtures__/v-next/outputv4/evmos/vesting/v1/vesting.ts @@ -175,7 +175,7 @@ export const ClawbackVestingAccount = { return { baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined, funderAddress: object.funder_address, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [] }; @@ -184,7 +184,7 @@ export const ClawbackVestingAccount = { const obj: any = {}; obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; obj.funder_address = message.funderAddress; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; if (message.lockupPeriods) { obj.lockup_periods = message.lockupPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv4/google/api/distribution.ts b/__fixtures__/v-next/outputv4/google/api/distribution.ts index a4e80ab0f7..854ec4ca7f 100644 --- a/__fixtures__/v-next/outputv4/google/api/distribution.ts +++ b/__fixtures__/v-next/outputv4/google/api/distribution.ts @@ -1205,14 +1205,14 @@ export const Distribution_Exemplar = { fromAmino(object: Distribution_ExemplarAmino): Distribution_Exemplar { return { value: object.value, - timestamp: object?.timestamp, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, attachments: Array.isArray(object?.attachments) ? object.attachments.map((e: any) => Any.fromAmino(e)) : [] }; }, toAmino(message: Distribution_Exemplar): Distribution_ExemplarAmino { const obj: any = {}; obj.value = message.value; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; if (message.attachments) { obj.attachments = message.attachments.map(e => e ? Any.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv4/google/api/expr/v1alpha1/syntax.ts b/__fixtures__/v-next/outputv4/google/api/expr/v1alpha1/syntax.ts index 5784bb89e7..64ae56f4ed 100644 --- a/__fixtures__/v-next/outputv4/google/api/expr/v1alpha1/syntax.ts +++ b/__fixtures__/v-next/outputv4/google/api/expr/v1alpha1/syntax.ts @@ -1900,7 +1900,7 @@ export const Constant = { stringValue: object?.string_value, bytesValue: object?.bytes_value, durationValue: object?.duration_value ? Duration.fromAmino(object.duration_value) : undefined, - timestampValue: object?.timestamp_value + timestampValue: object?.timestamp_value ? fromTimestamp(Timestamp.fromAmino(object.timestamp_value)) : undefined }; }, toAmino(message: Constant): ConstantAmino { @@ -1913,7 +1913,7 @@ export const Constant = { obj.string_value = message.stringValue; obj.bytes_value = message.bytesValue; obj.duration_value = message.durationValue ? Duration.toAmino(message.durationValue) : undefined; - obj.timestamp_value = message.timestampValue; + obj.timestamp_value = message.timestampValue ? Timestamp.toAmino(toTimestamp(message.timestampValue)) : undefined; return obj; }, fromAminoMsg(object: ConstantAminoMsg): Constant { diff --git a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/log_entry.ts b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/log_entry.ts index 5287d9ddaf..18f89f1955 100644 --- a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/log_entry.ts +++ b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/log_entry.ts @@ -525,7 +525,7 @@ export const LogEntry = { fromAmino(object: LogEntryAmino): LogEntry { return { name: object.name, - timestamp: object?.timestamp, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, trace: object.trace, @@ -546,7 +546,7 @@ export const LogEntry = { toAmino(message: LogEntry): LogEntryAmino { const obj: any = {}; obj.name = message.name; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.severity = message.severity; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; obj.trace = message.trace; diff --git a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/metric_value.ts b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/metric_value.ts index 27201e2f55..79070c6a04 100644 --- a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/metric_value.ts +++ b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/metric_value.ts @@ -389,8 +389,8 @@ export const MetricValue = { acc[key] = String(value); return acc; }, {}) : {}, - startTime: object?.start_time, - endTime: object?.end_time, + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, boolValue: object?.bool_value, int64Value: object?.int64_value ? BigInt(object.int64_value) : undefined, doubleValue: object?.double_value, @@ -406,8 +406,8 @@ export const MetricValue = { obj.labels[k] = v; }); } - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.bool_value = message.boolValue; obj.int64_value = message.int64Value ? message.int64Value.toString() : undefined; obj.double_value = message.doubleValue; diff --git a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/operation.ts b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/operation.ts index 10d1f2f871..d3b8604539 100644 --- a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/operation.ts +++ b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/operation.ts @@ -497,8 +497,8 @@ export const Operation = { operationId: object.operation_id, operationName: object.operation_name, consumerId: object.consumer_id, - startTime: object?.start_time, - endTime: object?.end_time, + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ [key: string]: string; }>((acc, [key, value]) => { @@ -516,8 +516,8 @@ export const Operation = { obj.operation_id = message.operationId; obj.operation_name = message.operationName; obj.consumer_id = message.consumerId; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.labels = {}; if (message.labels) { Object.entries(message.labels).forEach(([k, v]) => { diff --git a/__fixtures__/v-next/outputv4/google/api/servicemanagement/v1/resources.ts b/__fixtures__/v-next/outputv4/google/api/servicemanagement/v1/resources.ts index 6e87092130..eb9d8ee838 100644 --- a/__fixtures__/v-next/outputv4/google/api/servicemanagement/v1/resources.ts +++ b/__fixtures__/v-next/outputv4/google/api/servicemanagement/v1/resources.ts @@ -818,7 +818,7 @@ export const OperationMetadata = { resourceNames: Array.isArray(object?.resource_names) ? object.resource_names.map((e: any) => e) : [], steps: Array.isArray(object?.steps) ? object.steps.map((e: any) => OperationMetadata_Step.fromAmino(e)) : [], progressPercentage: object.progress_percentage, - startTime: object?.start_time + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined }; }, toAmino(message: OperationMetadata): OperationMetadataAmino { @@ -834,7 +834,7 @@ export const OperationMetadata = { obj.steps = []; } obj.progress_percentage = message.progressPercentage; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: OperationMetadataAminoMsg): OperationMetadata { @@ -1628,7 +1628,7 @@ export const Rollout = { fromAmino(object: RolloutAmino): Rollout { return { rolloutId: object.rollout_id, - createTime: object?.create_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, createdBy: object.created_by, status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: object?.traffic_percent_strategy ? Rollout_TrafficPercentStrategy.fromAmino(object.traffic_percent_strategy) : undefined, @@ -1639,7 +1639,7 @@ export const Rollout = { toAmino(message: Rollout): RolloutAmino { const obj: any = {}; obj.rollout_id = message.rolloutId; - obj.create_time = message.createTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; obj.created_by = message.createdBy; obj.status = message.status; obj.traffic_percent_strategy = message.trafficPercentStrategy ? Rollout_TrafficPercentStrategy.toAmino(message.trafficPercentStrategy) : undefined; diff --git a/__fixtures__/v-next/outputv4/google/logging/v2/log_entry.ts b/__fixtures__/v-next/outputv4/google/logging/v2/log_entry.ts index 551cd57324..1f98b6d166 100644 --- a/__fixtures__/v-next/outputv4/google/logging/v2/log_entry.ts +++ b/__fixtures__/v-next/outputv4/google/logging/v2/log_entry.ts @@ -722,8 +722,8 @@ export const LogEntry = { protoPayload: object?.proto_payload ? Any.fromAmino(object.proto_payload) : undefined, textPayload: object?.text_payload, jsonPayload: object?.json_payload ? Struct.fromAmino(object.json_payload) : undefined, - timestamp: object?.timestamp, - receiveTimestamp: object?.receive_timestamp, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, + receiveTimestamp: object?.receive_timestamp ? fromTimestamp(Timestamp.fromAmino(object.receive_timestamp)) : undefined, severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: object.insert_id, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, @@ -748,8 +748,8 @@ export const LogEntry = { obj.proto_payload = message.protoPayload ? Any.toAmino(message.protoPayload) : undefined; obj.text_payload = message.textPayload; obj.json_payload = message.jsonPayload ? Struct.toAmino(message.jsonPayload) : undefined; - obj.timestamp = message.timestamp; - obj.receive_timestamp = message.receiveTimestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.receive_timestamp = message.receiveTimestamp ? Timestamp.toAmino(toTimestamp(message.receiveTimestamp)) : undefined; obj.severity = message.severity; obj.insert_id = message.insertId; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; diff --git a/__fixtures__/v-next/outputv4/google/logging/v2/logging_config.ts b/__fixtures__/v-next/outputv4/google/logging/v2/logging_config.ts index 1f5f7669fa..d68d0ffa58 100644 --- a/__fixtures__/v-next/outputv4/google/logging/v2/logging_config.ts +++ b/__fixtures__/v-next/outputv4/google/logging/v2/logging_config.ts @@ -1919,8 +1919,8 @@ export const LogBucket = { return { name: object.name, description: object.description, - createTime: object?.create_time, - updateTime: object?.update_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, retentionDays: object.retention_days, locked: object.locked, lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : -1, @@ -1932,8 +1932,8 @@ export const LogBucket = { const obj: any = {}; obj.name = message.name; obj.description = message.description; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; obj.retention_days = message.retentionDays; obj.locked = message.locked; obj.lifecycle_state = message.lifecycleState; @@ -2077,8 +2077,8 @@ export const LogView = { return { name: object.name, description: object.description, - createTime: object?.create_time, - updateTime: object?.update_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, filter: object.filter }; }, @@ -2086,8 +2086,8 @@ export const LogView = { const obj: any = {}; obj.name = message.name; obj.description = message.description; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; obj.filter = message.filter; return obj; }, @@ -2332,8 +2332,8 @@ export const LogSink = { writerIdentity: object.writer_identity, includeChildren: object.include_children, bigqueryOptions: object?.bigquery_options ? BigQueryOptions.fromAmino(object.bigquery_options) : undefined, - createTime: object?.create_time, - updateTime: object?.update_time + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined }; }, toAmino(message: LogSink): LogSinkAmino { @@ -2352,8 +2352,8 @@ export const LogSink = { obj.writer_identity = message.writerIdentity; obj.include_children = message.includeChildren; obj.bigquery_options = message.bigqueryOptions ? BigQueryOptions.toAmino(message.bigqueryOptions) : undefined; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; return obj; }, fromAminoMsg(object: LogSinkAminoMsg): LogSink { @@ -4622,8 +4622,8 @@ export const LogExclusion = { description: object.description, filter: object.filter, disabled: object.disabled, - createTime: object?.create_time, - updateTime: object?.update_time + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined }; }, toAmino(message: LogExclusion): LogExclusionAmino { @@ -4632,8 +4632,8 @@ export const LogExclusion = { obj.description = message.description; obj.filter = message.filter; obj.disabled = message.disabled; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; return obj; }, fromAminoMsg(object: LogExclusionAminoMsg): LogExclusion { @@ -6208,8 +6208,8 @@ export const CopyLogEntriesMetadata = { }, fromAmino(object: CopyLogEntriesMetadataAmino): CopyLogEntriesMetadata { return { - startTime: object?.start_time, - endTime: object?.end_time, + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: object.cancellation_requested, request: object?.request ? CopyLogEntriesRequest.fromAmino(object.request) : undefined, @@ -6219,8 +6219,8 @@ export const CopyLogEntriesMetadata = { }, toAmino(message: CopyLogEntriesMetadata): CopyLogEntriesMetadataAmino { const obj: any = {}; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.state = message.state; obj.cancellation_requested = message.cancellationRequested; obj.request = message.request ? CopyLogEntriesRequest.toAmino(message.request) : undefined; diff --git a/__fixtures__/v-next/outputv4/google/logging/v2/logging_metrics.ts b/__fixtures__/v-next/outputv4/google/logging/v2/logging_metrics.ts index 57478dabd5..391302d144 100644 --- a/__fixtures__/v-next/outputv4/google/logging/v2/logging_metrics.ts +++ b/__fixtures__/v-next/outputv4/google/logging/v2/logging_metrics.ts @@ -691,8 +691,8 @@ export const LogMetric = { return acc; }, {}) : {}, bucketOptions: object?.bucket_options ? Distribution_BucketOptions.fromAmino(object.bucket_options) : undefined, - createTime: object?.create_time, - updateTime: object?.update_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, @@ -711,8 +711,8 @@ export const LogMetric = { }); } obj.bucket_options = message.bucketOptions ? Distribution_BucketOptions.toAmino(message.bucketOptions) : undefined; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; obj.version = message.version; return obj; }, diff --git a/__fixtures__/v-next/outputv4/google/protobuf/timestamp.ts b/__fixtures__/v-next/outputv4/google/protobuf/timestamp.ts index eacd15c447..9386b51ec5 100644 --- a/__fixtures__/v-next/outputv4/google/protobuf/timestamp.ts +++ b/__fixtures__/v-next/outputv4/google/protobuf/timestamp.ts @@ -271,7 +271,7 @@ export const Timestamp = { return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - return fromTimestamp(message).toString(); + return fromTimestamp(message).toISOString(); }, fromAminoMsg(object: TimestampAminoMsg): Timestamp { return Timestamp.fromAmino(object.value); diff --git a/__fixtures__/v-next/outputv4/google/rpc/context/attribute_context.ts b/__fixtures__/v-next/outputv4/google/rpc/context/attribute_context.ts index 0d5324cad5..0c562711a4 100644 --- a/__fixtures__/v-next/outputv4/google/rpc/context/attribute_context.ts +++ b/__fixtures__/v-next/outputv4/google/rpc/context/attribute_context.ts @@ -1740,7 +1740,7 @@ export const AttributeContext_Request = { host: object.host, scheme: object.scheme, query: object.query, - time: object?.time, + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, size: BigInt(object.size), protocol: object.protocol, reason: object.reason, @@ -1761,7 +1761,7 @@ export const AttributeContext_Request = { obj.host = message.host; obj.scheme = message.scheme; obj.query = message.query; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.size = message.size ? message.size.toString() : undefined; obj.protocol = message.protocol; obj.reason = message.reason; @@ -2044,7 +2044,7 @@ export const AttributeContext_Response = { acc[key] = String(value); return acc; }, {}) : {}, - time: object?.time, + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, backendLatency: object?.backend_latency ? Duration.fromAmino(object.backend_latency) : undefined }; }, @@ -2058,7 +2058,7 @@ export const AttributeContext_Response = { obj.headers[k] = v; }); } - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.backend_latency = message.backendLatency ? Duration.toAmino(message.backendLatency) : undefined; return obj; }, @@ -2564,9 +2564,9 @@ export const AttributeContext_Resource = { return acc; }, {}) : {}, displayName: object.display_name, - createTime: object?.create_time, - updateTime: object?.update_time, - deleteTime: object?.delete_time, + createTime: object?.create_time ? fromTimestamp(Timestamp.fromAmino(object.create_time)) : undefined, + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined, + deleteTime: object?.delete_time ? fromTimestamp(Timestamp.fromAmino(object.delete_time)) : undefined, etag: object.etag, location: object.location }; @@ -2590,9 +2590,9 @@ export const AttributeContext_Resource = { }); } obj.display_name = message.displayName; - obj.create_time = message.createTime; - obj.update_time = message.updateTime; - obj.delete_time = message.deleteTime; + obj.create_time = message.createTime ? Timestamp.toAmino(toTimestamp(message.createTime)) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; + obj.delete_time = message.deleteTime ? Timestamp.toAmino(toTimestamp(message.deleteTime)) : undefined; obj.etag = message.etag; obj.location = message.location; return obj; diff --git a/__fixtures__/v-next/outputv4/ibc/lightclients/tendermint/v1/tendermint.ts b/__fixtures__/v-next/outputv4/ibc/lightclients/tendermint/v1/tendermint.ts index 8d2fc05928..8ef30059db 100644 --- a/__fixtures__/v-next/outputv4/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/__fixtures__/v-next/outputv4/ibc/lightclients/tendermint/v1/tendermint.ts @@ -547,14 +547,14 @@ export const ConsensusState = { }, fromAmino(object: ConsensusStateAmino): ConsensusState { return { - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined, nextValidatorsHash: object.next_validators_hash }; }, toAmino(message: ConsensusState): ConsensusStateAmino { const obj: any = {}; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.root = message.root ? MerkleRoot.toAmino(message.root) : undefined; obj.next_validators_hash = message.nextValidatorsHash; return obj; diff --git a/__fixtures__/v-next/outputv4/osmosis/claim/v1beta1/params.ts b/__fixtures__/v-next/outputv4/osmosis/claim/v1beta1/params.ts index 6b36a1a92e..ec22b41892 100644 --- a/__fixtures__/v-next/outputv4/osmosis/claim/v1beta1/params.ts +++ b/__fixtures__/v-next/outputv4/osmosis/claim/v1beta1/params.ts @@ -127,7 +127,7 @@ export const Params = { }, fromAmino(object: ParamsAmino): Params { return { - airdropStartTime: object.airdrop_start_time, + airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimDenom: object.claim_denom @@ -135,7 +135,7 @@ export const Params = { }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.airdrop_start_time = message.airdropStartTime; + obj.airdrop_start_time = message.airdropStartTime ? Timestamp.toAmino(toTimestamp(message.airdropStartTime)) : undefined; obj.duration_until_decay = message.durationUntilDecay ? Duration.toAmino(message.durationUntilDecay) : undefined; obj.duration_of_decay = message.durationOfDecay ? Duration.toAmino(message.durationOfDecay) : undefined; obj.claim_denom = message.claimDenom; diff --git a/__fixtures__/v-next/outputv4/osmosis/epochs/genesis.ts b/__fixtures__/v-next/outputv4/osmosis/epochs/genesis.ts index 35bc6a4b03..257c052ee4 100644 --- a/__fixtures__/v-next/outputv4/osmosis/epochs/genesis.ts +++ b/__fixtures__/v-next/outputv4/osmosis/epochs/genesis.ts @@ -237,10 +237,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: object.current_epoch_start_time, + currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; @@ -248,10 +248,10 @@ export const EpochInfo = { toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime; + obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(toTimestamp(message.currentEpochStartTime)) : undefined; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv4/osmosis/gamm/pool-models/balancer/balancerPool.ts b/__fixtures__/v-next/outputv4/osmosis/gamm/pool-models/balancer/balancerPool.ts index 3853765c67..2c70a1604e 100644 --- a/__fixtures__/v-next/outputv4/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/__fixtures__/v-next/outputv4/osmosis/gamm/pool-models/balancer/balancerPool.ts @@ -279,7 +279,7 @@ export const SmoothWeightChangeParams = { }, fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { return { - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, initialPoolWeights: Array.isArray(object?.initial_pool_weights) ? object.initial_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [], targetPoolWeights: Array.isArray(object?.target_pool_weights) ? object.target_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [] @@ -287,7 +287,7 @@ export const SmoothWeightChangeParams = { }, toAmino(message: SmoothWeightChangeParams): SmoothWeightChangeParamsAmino { const obj: any = {}; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; if (message.initialPoolWeights) { obj.initial_pool_weights = message.initialPoolWeights.map(e => e ? PoolAsset.toAmino(e) : undefined); diff --git a/__fixtures__/v-next/outputv4/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts b/__fixtures__/v-next/outputv4/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts index ad8f12c620..e481a8e582 100644 --- a/__fixtures__/v-next/outputv4/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts +++ b/__fixtures__/v-next/outputv4/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts @@ -1,7 +1,6 @@ //@ts-nocheck import { PoolParams, PoolParamsSDKType, PoolAsset, PoolAssetSDKType, SmoothWeightChangeParams, SmoothWeightChangeParamsSDKType } from "../balancerPool"; import { AminoMsg } from "@cosmjs/amino"; -import { Timestamp, TimestampSDKType } from "../../../../../google/protobuf/timestamp"; import { Duration, DurationSDKType } from "../../../../../google/protobuf/duration"; import { Coin, CoinSDKType } from "../../../../../cosmos/base/v1beta1/coin"; import { MsgCreateBalancerPool, MsgCreateBalancerPoolSDKType } from "./tx"; @@ -13,10 +12,7 @@ export interface MsgCreateBalancerPoolAminoType extends AminoMsg { swap_fee: string; exit_fee: string; smooth_weight_change_params: { - start_time: { - seconds: string; - nanos: number; - }; + start_time: string; duration: { seconds: string; nanos: number; diff --git a/__fixtures__/v-next/outputv4/osmosis/incentives/gauge.ts b/__fixtures__/v-next/outputv4/osmosis/incentives/gauge.ts index 789a4ada8b..cd15557488 100644 --- a/__fixtures__/v-next/outputv4/osmosis/incentives/gauge.ts +++ b/__fixtures__/v-next/outputv4/osmosis/incentives/gauge.ts @@ -257,7 +257,7 @@ export const Gauge = { isPerpetual: object.is_perpetual, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), numEpochsPaidOver: BigInt(object.num_epochs_paid_over), filledEpochs: BigInt(object.filled_epochs), distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : [] @@ -273,7 +273,7 @@ export const Gauge = { } else { obj.coins = []; } - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; obj.filled_epochs = message.filledEpochs ? message.filledEpochs.toString() : undefined; if (message.distributedCoins) { diff --git a/__fixtures__/v-next/outputv4/osmosis/incentives/tx.amino.ts b/__fixtures__/v-next/outputv4/osmosis/incentives/tx.amino.ts index a00674a250..fc284ed915 100644 --- a/__fixtures__/v-next/outputv4/osmosis/incentives/tx.amino.ts +++ b/__fixtures__/v-next/outputv4/osmosis/incentives/tx.amino.ts @@ -17,19 +17,13 @@ export interface MsgCreateGaugeAminoType extends AminoMsg { seconds: string; nanos: number; }; - timestamp: { - seconds: string; - nanos: number; - }; + timestamp: string; }; coins: { denom: string; amount: string; }[]; - start_time: { - seconds: string; - nanos: number; - }; + start_time: string; num_epochs_paid_over: string; }; } diff --git a/__fixtures__/v-next/outputv4/osmosis/incentives/tx.ts b/__fixtures__/v-next/outputv4/osmosis/incentives/tx.ts index e3e8b84ece..582b8bca81 100644 --- a/__fixtures__/v-next/outputv4/osmosis/incentives/tx.ts +++ b/__fixtures__/v-next/outputv4/osmosis/incentives/tx.ts @@ -218,7 +218,7 @@ export const MsgCreateGauge = { owner: object.owner, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: object.start_time, + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), numEpochsPaidOver: BigInt(object.num_epochs_paid_over) }; }, @@ -232,7 +232,7 @@ export const MsgCreateGauge = { } else { obj.coins = []; } - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv4/osmosis/lockup/lock.ts b/__fixtures__/v-next/outputv4/osmosis/lockup/lock.ts index 1e24db06df..21ec62d663 100644 --- a/__fixtures__/v-next/outputv4/osmosis/lockup/lock.ts +++ b/__fixtures__/v-next/outputv4/osmosis/lockup/lock.ts @@ -301,7 +301,7 @@ export const PeriodLock = { ID: BigInt(object.ID), owner: object.owner, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - endTime: object.end_time, + endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] }; }, @@ -310,7 +310,7 @@ export const PeriodLock = { obj.ID = message.ID ? message.ID.toString() : undefined; obj.owner = message.owner; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.end_time = message.endTime; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; if (message.coins) { obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); } else { @@ -446,7 +446,7 @@ export const QueryCondition = { lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object.denom, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: QueryCondition): QueryConditionAmino { @@ -454,7 +454,7 @@ export const QueryCondition = { obj.lock_query_type = message.lockQueryType; obj.denom = message.denom; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: QueryConditionAminoMsg): QueryCondition { @@ -586,7 +586,7 @@ export const SyntheticLock = { return { underlyingLockId: BigInt(object.underlying_lock_id), synthDenom: object.synth_denom, - endTime: object.end_time, + endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), duration: object?.duration ? Duration.fromAmino(object.duration) : undefined }; }, @@ -594,7 +594,7 @@ export const SyntheticLock = { const obj: any = {}; obj.underlying_lock_id = message.underlyingLockId ? message.underlyingLockId.toString() : undefined; obj.synth_denom = message.synthDenom; - obj.end_time = message.endTime; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv4/osmosis/lockup/query.ts b/__fixtures__/v-next/outputv4/osmosis/lockup/query.ts index 3cb1bd9ce7..360889e7a1 100644 --- a/__fixtures__/v-next/outputv4/osmosis/lockup/query.ts +++ b/__fixtures__/v-next/outputv4/osmosis/lockup/query.ts @@ -1374,13 +1374,13 @@ export const AccountLockedPastTimeRequest = { fromAmino(object: AccountLockedPastTimeRequestAmino): AccountLockedPastTimeRequest { return { owner: object.owner, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: AccountLockedPastTimeRequest): AccountLockedPastTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountLockedPastTimeRequestAminoMsg): AccountLockedPastTimeRequest { @@ -1585,13 +1585,13 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino): AccountLockedPastTimeNotUnlockingOnlyRequest { return { owner: object.owner, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyRequest): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg): AccountLockedPastTimeNotUnlockingOnlyRequest { @@ -1796,13 +1796,13 @@ export const AccountUnlockedBeforeTimeRequest = { fromAmino(object: AccountUnlockedBeforeTimeRequestAmino): AccountUnlockedBeforeTimeRequest { return { owner: object.owner, - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: AccountUnlockedBeforeTimeRequest): AccountUnlockedBeforeTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountUnlockedBeforeTimeRequestAminoMsg): AccountUnlockedBeforeTimeRequest { @@ -2020,14 +2020,14 @@ export const AccountLockedPastTimeDenomRequest = { fromAmino(object: AccountLockedPastTimeDenomRequestAmino): AccountLockedPastTimeDenomRequest { return { owner: object.owner, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), denom: object.denom }; }, toAmino(message: AccountLockedPastTimeDenomRequest): AccountLockedPastTimeDenomRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.denom = message.denom; return obj; }, diff --git a/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/query.ts b/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/query.ts index 645ea563a2..e56100654f 100644 --- a/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/query.ts @@ -193,8 +193,8 @@ export const ArithmeticTwapRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: object.start_time, - endTime: object?.end_time + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined }; }, toAmino(message: ArithmeticTwapRequest): ArithmeticTwapRequestAmino { @@ -202,8 +202,8 @@ export const ArithmeticTwapRequest = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; return obj; }, fromAminoMsg(object: ArithmeticTwapRequestAminoMsg): ArithmeticTwapRequest { @@ -426,7 +426,7 @@ export const ArithmeticTwapToNowRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: object.start_time + startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)) }; }, toAmino(message: ArithmeticTwapToNowRequest): ArithmeticTwapToNowRequestAmino { @@ -434,7 +434,7 @@ export const ArithmeticTwapToNowRequest = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: ArithmeticTwapToNowRequestAminoMsg): ArithmeticTwapToNowRequest { diff --git a/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/twap_record.ts b/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/twap_record.ts index 6bc5f258a5..9358f8bb7c 100644 --- a/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/twap_record.ts +++ b/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/twap_record.ts @@ -252,12 +252,12 @@ export const TwapRecord = { asset0Denom: object.asset0_denom, asset1Denom: object.asset1_denom, height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), p0LastSpotPrice: object.p0_last_spot_price, p1LastSpotPrice: object.p1_last_spot_price, p0ArithmeticTwapAccumulator: object.p0_arithmetic_twap_accumulator, p1ArithmeticTwapAccumulator: object.p1_arithmetic_twap_accumulator, - lastErrorTime: object.last_error_time + lastErrorTime: fromTimestamp(Timestamp.fromAmino(object.last_error_time)) }; }, toAmino(message: TwapRecord): TwapRecordAmino { @@ -266,12 +266,12 @@ export const TwapRecord = { obj.asset0_denom = message.asset0Denom; obj.asset1_denom = message.asset1Denom; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.p0_last_spot_price = message.p0LastSpotPrice; obj.p1_last_spot_price = message.p1LastSpotPrice; obj.p0_arithmetic_twap_accumulator = message.p0ArithmeticTwapAccumulator; obj.p1_arithmetic_twap_accumulator = message.p1ArithmeticTwapAccumulator; - obj.last_error_time = message.lastErrorTime; + obj.last_error_time = message.lastErrorTime ? Timestamp.toAmino(toTimestamp(message.lastErrorTime)) : undefined; return obj; }, fromAminoMsg(object: TwapRecordAminoMsg): TwapRecord { diff --git a/__fixtures__/v-next/outputv4/tendermint/abci/types.ts b/__fixtures__/v-next/outputv4/tendermint/abci/types.ts index abe7608c02..e3a97b6882 100644 --- a/__fixtures__/v-next/outputv4/tendermint/abci/types.ts +++ b/__fixtures__/v-next/outputv4/tendermint/abci/types.ts @@ -1756,7 +1756,7 @@ export const RequestInitChain = { }, fromAmino(object: RequestInitChainAmino): RequestInitChain { return { - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), chainId: object.chain_id, consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], @@ -1766,7 +1766,7 @@ export const RequestInitChain = { }, toAmino(message: RequestInitChain): RequestInitChainAmino { const obj: any = {}; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.chain_id = message.chainId; obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; if (message.validators) { @@ -6341,7 +6341,7 @@ export const Evidence = { type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), totalVotingPower: BigInt(object.total_voting_power) }; }, @@ -6350,7 +6350,7 @@ export const Evidence = { obj.type = message.type; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv4/tendermint/p2p/types.ts b/__fixtures__/v-next/outputv4/tendermint/p2p/types.ts index 43e801bbcd..3fada72cfc 100644 --- a/__fixtures__/v-next/outputv4/tendermint/p2p/types.ts +++ b/__fixtures__/v-next/outputv4/tendermint/p2p/types.ts @@ -598,7 +598,7 @@ export const PeerInfo = { return { id: object.id, addressInfo: Array.isArray(object?.address_info) ? object.address_info.map((e: any) => PeerAddressInfo.fromAmino(e)) : [], - lastConnected: object?.last_connected + lastConnected: object?.last_connected ? fromTimestamp(Timestamp.fromAmino(object.last_connected)) : undefined }; }, toAmino(message: PeerInfo): PeerInfoAmino { @@ -609,7 +609,7 @@ export const PeerInfo = { } else { obj.address_info = []; } - obj.last_connected = message.lastConnected; + obj.last_connected = message.lastConnected ? Timestamp.toAmino(toTimestamp(message.lastConnected)) : undefined; return obj; }, fromAminoMsg(object: PeerInfoAminoMsg): PeerInfo { @@ -730,16 +730,16 @@ export const PeerAddressInfo = { fromAmino(object: PeerAddressInfoAmino): PeerAddressInfo { return { address: object.address, - lastDialSuccess: object?.last_dial_success, - lastDialFailure: object?.last_dial_failure, + lastDialSuccess: object?.last_dial_success ? fromTimestamp(Timestamp.fromAmino(object.last_dial_success)) : undefined, + lastDialFailure: object?.last_dial_failure ? fromTimestamp(Timestamp.fromAmino(object.last_dial_failure)) : undefined, dialFailures: object.dial_failures }; }, toAmino(message: PeerAddressInfo): PeerAddressInfoAmino { const obj: any = {}; obj.address = message.address; - obj.last_dial_success = message.lastDialSuccess; - obj.last_dial_failure = message.lastDialFailure; + obj.last_dial_success = message.lastDialSuccess ? Timestamp.toAmino(toTimestamp(message.lastDialSuccess)) : undefined; + obj.last_dial_failure = message.lastDialFailure ? Timestamp.toAmino(toTimestamp(message.lastDialFailure)) : undefined; obj.dial_failures = message.dialFailures; return obj; }, diff --git a/__fixtures__/v-next/outputv4/tendermint/types/evidence.ts b/__fixtures__/v-next/outputv4/tendermint/types/evidence.ts index 48ec6acb9f..f66193ab2b 100644 --- a/__fixtures__/v-next/outputv4/tendermint/types/evidence.ts +++ b/__fixtures__/v-next/outputv4/tendermint/types/evidence.ts @@ -297,7 +297,7 @@ export const DuplicateVoteEvidence = { voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, totalVotingPower: BigInt(object.total_voting_power), validatorPower: BigInt(object.validator_power), - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { @@ -306,7 +306,7 @@ export const DuplicateVoteEvidence = { obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; obj.validator_power = message.validatorPower ? message.validatorPower.toString() : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: DuplicateVoteEvidenceAminoMsg): DuplicateVoteEvidence { @@ -457,7 +457,7 @@ export const LightClientAttackEvidence = { commonHeight: BigInt(object.common_height), byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], totalVotingPower: BigInt(object.total_voting_power), - timestamp: object.timestamp + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) }; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { @@ -470,7 +470,7 @@ export const LightClientAttackEvidence = { obj.byzantine_validators = []; } obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: LightClientAttackEvidenceAminoMsg): LightClientAttackEvidence { diff --git a/__fixtures__/v-next/outputv4/tendermint/types/types.ts b/__fixtures__/v-next/outputv4/tendermint/types/types.ts index 818e20c2ee..aebd183bc8 100644 --- a/__fixtures__/v-next/outputv4/tendermint/types/types.ts +++ b/__fixtures__/v-next/outputv4/tendermint/types/types.ts @@ -910,7 +910,7 @@ export const Header = { version: object?.version ? Consensus.fromAmino(object.version) : undefined, chainId: object.chain_id, height: BigInt(object.height), - time: object.time, + time: fromTimestamp(Timestamp.fromAmino(object.time)), lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, lastCommitHash: object.last_commit_hash, dataHash: object.data_hash, @@ -928,7 +928,7 @@ export const Header = { obj.version = message.version ? Consensus.toAmino(message.version) : undefined; obj.chain_id = message.chainId; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; obj.last_commit_hash = message.lastCommitHash; obj.data_hash = message.dataHash; @@ -1216,7 +1216,7 @@ export const Vote = { height: BigInt(object.height), round: object.round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), validatorAddress: object.validator_address, validatorIndex: object.validator_index, signature: object.signature @@ -1228,7 +1228,7 @@ export const Vote = { obj.height = message.height ? message.height.toString() : undefined; obj.round = message.round; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.validator_address = message.validatorAddress; obj.validator_index = message.validatorIndex; obj.signature = message.signature; @@ -1500,7 +1500,7 @@ export const CommitSig = { return { blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object.validator_address, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), signature: object.signature }; }, @@ -1508,7 +1508,7 @@ export const CommitSig = { const obj: any = {}; obj.block_id_flag = message.blockIdFlag; obj.validator_address = message.validatorAddress; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.signature = message.signature; return obj; }, @@ -1677,7 +1677,7 @@ export const Proposal = { round: object.round, polRound: object.pol_round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object.timestamp, + timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), signature: object.signature }; }, @@ -1688,7 +1688,7 @@ export const Proposal = { obj.round = message.round; obj.pol_round = message.polRound; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.signature = message.signature; return obj; }, diff --git a/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap b/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap index 7a8ed2d25d..9262c9a3d3 100644 --- a/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap +++ b/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap @@ -2025,7 +2025,7 @@ exports[`google/api/expr/v1alpha1/syntax Constant 1`] = ` stringValue: object?.string_value, bytesValue: object?.bytes_value, durationValue: object?.duration_value ? Duration.fromAmino(object.duration_value) : undefined, - timestampValue: object?.timestamp_value + timestampValue: object?.timestamp_value ? Timestamp.fromAmino(object.timestamp_value) : undefined }; }, toAmino(message: Constant): ConstantAmino { @@ -2038,7 +2038,7 @@ exports[`google/api/expr/v1alpha1/syntax Constant 1`] = ` obj.string_value = message.stringValue; obj.bytes_value = message.bytesValue; obj.duration_value = message.durationValue ? Duration.toAmino(message.durationValue) : undefined; - obj.timestamp_value = message.timestampValue; + obj.timestamp_value = message.timestampValue ? Timestamp.toAmino(message.timestampValue) : undefined; return obj; }, fromAminoMsg(object: ConstantAminoMsg): Constant { @@ -2760,7 +2760,7 @@ exports[`google/api/servicecontrol/v1/log_entry LogEntry 1`] = ` fromAmino(object: LogEntryAmino): LogEntry { return { name: object.name, - timestamp: object?.timestamp, + timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, trace: object.trace, @@ -2781,7 +2781,7 @@ exports[`google/api/servicecontrol/v1/log_entry LogEntry 1`] = ` toAmino(message: LogEntry): LogEntryAmino { const obj: any = {}; obj.name = message.name; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; obj.severity = message.severity; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; obj.trace = message.trace; diff --git a/packages/ast/src/encoding/__tests__/__snapshots__/authz.timestamp.test.ts.snap b/packages/ast/src/encoding/__tests__/__snapshots__/authz.timestamp.test.ts.snap index 8c27bc2c9c..3821b1c30d 100644 --- a/packages/ast/src/encoding/__tests__/__snapshots__/authz.timestamp.test.ts.snap +++ b/packages/ast/src/encoding/__tests__/__snapshots__/authz.timestamp.test.ts.snap @@ -81,13 +81,13 @@ exports[`cosmos/authz/v1beta1/authz date 2`] = ` fromAmino(object: GrantAmino): Grant { return { authorization: object?.authorization ? Any.fromAmino(object.authorization) : undefined, - expiration: object?.expiration + expiration: object?.expiration ? fromTimestamp(Timestamp.fromAmino(object.expiration)) : undefined }; }, toAmino(message: Grant): GrantAmino { const obj: any = {}; obj.authorization = message.authorization ? Any.toAmino(message.authorization) : undefined; - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: GrantAminoMsg): Grant { @@ -122,10 +122,7 @@ exports[`cosmos/authz/v1beta1/authz date 3`] = ` type_url: string; value: Uint8Array; }; - expiration: { - seconds: string; - nanos: number; - }; + expiration: string; }; }" `; @@ -243,13 +240,13 @@ exports[`cosmos/authz/v1beta1/authz timestamp 2`] = ` fromAmino(object: GrantAmino): Grant { return { authorization: object?.authorization ? Any.fromAmino(object.authorization) : undefined, - expiration: object?.expiration + expiration: object?.expiration ? Timestamp.fromAmino(object.expiration) : undefined }; }, toAmino(message: Grant): GrantAmino { const obj: any = {}; obj.authorization = message.authorization ? Any.toAmino(message.authorization) : undefined; - obj.expiration = message.expiration; + obj.expiration = message.expiration ? Timestamp.toAmino(message.expiration) : undefined; return obj; }, fromAminoMsg(object: GrantAminoMsg): Grant { From 680eeee88fdff14a7797f582c92a8d9ed4880e0b Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 Nov 2023 14:56:44 -0400 Subject: [PATCH 3/8] Updated Timestamp amino converter. --- .../ast/src/encoding/proto/to-amino/utils.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/ast/src/encoding/proto/to-amino/utils.ts b/packages/ast/src/encoding/proto/to-amino/utils.ts index 86812580fd..22f0799c10 100644 --- a/packages/ast/src/encoding/proto/to-amino/utils.ts +++ b/packages/ast/src/encoding/proto/to-amino/utils.ts @@ -746,12 +746,21 @@ export const toAminoMessages = { t.callExpression( t.memberExpression( t.callExpression( - t.identifier('fromTimestamp'), - [t.identifier('message')] + t.memberExpression( + t.callExpression( + t.identifier('fromTimestamp'), + [t.identifier('message')] + ), + t.identifier('toISOString') + ), + [] ), - t.identifier('toISOString') + t.identifier('replace') ), - [] + [ + t.regExpLiteral('\\.\\d+Z$'), + t.stringLiteral('Z') + ] ) ) }, From c83d232582fa565cc3957768b20031d8905def92 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 Nov 2023 14:56:53 -0400 Subject: [PATCH 4/8] Updated fixtures and snapshots. --- __fixtures__/v-next/outputosmojs/google/protobuf/timestamp.ts | 2 +- __fixtures__/v-next/outputv2/google/protobuf/timestamp.ts | 2 +- __fixtures__/v-next/outputv3/google/protobuf/timestamp.ts | 2 +- __fixtures__/v-next/outputv4/google/protobuf/timestamp.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__fixtures__/v-next/outputosmojs/google/protobuf/timestamp.ts b/__fixtures__/v-next/outputosmojs/google/protobuf/timestamp.ts index 8728e15913..babec48dab 100644 --- a/__fixtures__/v-next/outputosmojs/google/protobuf/timestamp.ts +++ b/__fixtures__/v-next/outputosmojs/google/protobuf/timestamp.ts @@ -269,7 +269,7 @@ export const Timestamp = { return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - return fromTimestamp(message).toISOString(); + return fromTimestamp(message).toISOString().replace(/\.\d+Z$/, "Z"); }, fromAminoMsg(object: TimestampAminoMsg): Timestamp { return Timestamp.fromAmino(object.value); diff --git a/__fixtures__/v-next/outputv2/google/protobuf/timestamp.ts b/__fixtures__/v-next/outputv2/google/protobuf/timestamp.ts index 035dfcc718..af23e0791b 100644 --- a/__fixtures__/v-next/outputv2/google/protobuf/timestamp.ts +++ b/__fixtures__/v-next/outputv2/google/protobuf/timestamp.ts @@ -354,7 +354,7 @@ export const Timestamp = { return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - return fromTimestamp(message).toISOString(); + return fromTimestamp(message).toISOString().replace(/\.\d+Z$/, "Z"); }, fromAminoMsg(object: TimestampAminoMsg): Timestamp { return Timestamp.fromAmino(object.value); diff --git a/__fixtures__/v-next/outputv3/google/protobuf/timestamp.ts b/__fixtures__/v-next/outputv3/google/protobuf/timestamp.ts index 7389ac460c..54116f5f72 100644 --- a/__fixtures__/v-next/outputv3/google/protobuf/timestamp.ts +++ b/__fixtures__/v-next/outputv3/google/protobuf/timestamp.ts @@ -350,7 +350,7 @@ export const Timestamp = { return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - return fromTimestamp(message).toISOString(); + return fromTimestamp(message).toISOString().replace(/\.\d+Z$/, "Z"); }, fromProtoMsg(message: TimestampProtoMsg): Timestamp { return Timestamp.decode(message.value); diff --git a/__fixtures__/v-next/outputv4/google/protobuf/timestamp.ts b/__fixtures__/v-next/outputv4/google/protobuf/timestamp.ts index 9386b51ec5..497d725979 100644 --- a/__fixtures__/v-next/outputv4/google/protobuf/timestamp.ts +++ b/__fixtures__/v-next/outputv4/google/protobuf/timestamp.ts @@ -271,7 +271,7 @@ export const Timestamp = { return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - return fromTimestamp(message).toISOString(); + return fromTimestamp(message).toISOString().replace(/\.\d+Z$/, "Z"); }, fromAminoMsg(object: TimestampAminoMsg): Timestamp { return Timestamp.fromAmino(object.value); From 8fdbd02a7e024408652a10d52d987ba1f224dfab Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 Nov 2023 15:16:23 -0400 Subject: [PATCH 5/8] Cleaned up redundant lines and fixed Timestamp Amino type. --- .../__tests__/__snapshots__/authz.timestamp.test.ts.snap | 5 +---- packages/ast/src/encoding/amino/interface/utils.ts | 9 +-------- packages/ast/src/encoding/proto/from-amino/utils.ts | 1 - .../ast/src/encoding/proto/from-json/strict-utils.ts | 1 - packages/ast/src/encoding/proto/from-json/utils.ts | 1 - packages/ast/src/encoding/proto/from-sdk-json/utils.ts | 1 - packages/ast/src/encoding/proto/from-sdk/utils.ts | 1 - packages/ast/src/encoding/proto/to-amino/utils.ts | 1 - packages/ast/types/encoding/amino/interface/utils.d.ts | 2 +- 9 files changed, 3 insertions(+), 19 deletions(-) diff --git a/packages/ast/src/encoding/__tests__/__snapshots__/authz.timestamp.test.ts.snap b/packages/ast/src/encoding/__tests__/__snapshots__/authz.timestamp.test.ts.snap index 3821b1c30d..5c4035351d 100644 --- a/packages/ast/src/encoding/__tests__/__snapshots__/authz.timestamp.test.ts.snap +++ b/packages/ast/src/encoding/__tests__/__snapshots__/authz.timestamp.test.ts.snap @@ -281,10 +281,7 @@ exports[`cosmos/authz/v1beta1/authz timestamp 3`] = ` type_url: string; value: Uint8Array; }; - expiration: { - seconds: string; - nanos: number; - }; + expiration: string; }; }" `; diff --git a/packages/ast/src/encoding/amino/interface/utils.ts b/packages/ast/src/encoding/amino/interface/utils.ts index 50b3f9dddd..58fce68902 100644 --- a/packages/ast/src/encoding/amino/interface/utils.ts +++ b/packages/ast/src/encoding/amino/interface/utils.ts @@ -49,14 +49,7 @@ export const aminoInterface = { } }, timestamp(args: RenderAminoField) { - const timestampFormat = args.context.pluginValue('prototypes.typingsFormat.timestamp'); - switch (timestampFormat) { - case 'date': - return aminoInterface.string(args); - case 'timestamp': - default: - return aminoInterface.type(args); - } + return aminoInterface.string(args); }, enum(args: RenderAminoField) { return t.tsPropertySignature( diff --git a/packages/ast/src/encoding/proto/from-amino/utils.ts b/packages/ast/src/encoding/proto/from-amino/utils.ts index f5ef516270..ef7345d847 100644 --- a/packages/ast/src/encoding/proto/from-amino/utils.ts +++ b/packages/ast/src/encoding/proto/from-amino/utils.ts @@ -347,7 +347,6 @@ export const fromAminoJSON = { timestampDate(args: FromAminoJSONMethod) { const { origName } = getFieldNames(args.field); - args.context.addUtil('isSet'); args.context.addUtil('fromTimestamp'); const callExpr = t.callExpression( diff --git a/packages/ast/src/encoding/proto/from-json/strict-utils.ts b/packages/ast/src/encoding/proto/from-json/strict-utils.ts index c509acc9b1..3977cdb5bb 100644 --- a/packages/ast/src/encoding/proto/from-json/strict-utils.ts +++ b/packages/ast/src/encoding/proto/from-json/strict-utils.ts @@ -386,7 +386,6 @@ export const fromJSON = { return fromJSON.timestampTimestamp(args); case 'date': default: - args.context.addUtil('toTimestamp'); return fromJSON.timestampDate(args); } }, diff --git a/packages/ast/src/encoding/proto/from-json/utils.ts b/packages/ast/src/encoding/proto/from-json/utils.ts index 880c714f9a..3cc46dee39 100644 --- a/packages/ast/src/encoding/proto/from-json/utils.ts +++ b/packages/ast/src/encoding/proto/from-json/utils.ts @@ -339,7 +339,6 @@ export const fromJSON = { return fromJSON.timestampTimestamp(args); case 'date': default: - args.context.addUtil('toTimestamp'); return fromJSON.timestampDate(args); } }, diff --git a/packages/ast/src/encoding/proto/from-sdk-json/utils.ts b/packages/ast/src/encoding/proto/from-sdk-json/utils.ts index 7f3781ff13..f8de0b664f 100644 --- a/packages/ast/src/encoding/proto/from-sdk-json/utils.ts +++ b/packages/ast/src/encoding/proto/from-sdk-json/utils.ts @@ -231,7 +231,6 @@ export const fromSDKJSON = { return fromSDKJSON.timestampTimestamp(args); case 'date': default: - args.context.addUtil('toTimestamp'); return fromSDKJSON.timestampDate(args); } }, diff --git a/packages/ast/src/encoding/proto/from-sdk/utils.ts b/packages/ast/src/encoding/proto/from-sdk/utils.ts index f55a942fb0..ab195f21ff 100644 --- a/packages/ast/src/encoding/proto/from-sdk/utils.ts +++ b/packages/ast/src/encoding/proto/from-sdk/utils.ts @@ -161,7 +161,6 @@ export const fromSDK = { return fromSDK.type(args); case 'date': default: - args.context.addUtil('toTimestamp'); return fromSDK.timestampDate(args); } }, diff --git a/packages/ast/src/encoding/proto/to-amino/utils.ts b/packages/ast/src/encoding/proto/to-amino/utils.ts index 22f0799c10..37b7ed521c 100644 --- a/packages/ast/src/encoding/proto/to-amino/utils.ts +++ b/packages/ast/src/encoding/proto/to-amino/utils.ts @@ -252,7 +252,6 @@ export const toAminoJSON = { return toAminoJSON.type(args); case 'date': default: - args.context.addUtil('toTimestamp'); return toAminoJSON.timestampDate(args); } }, diff --git a/packages/ast/types/encoding/amino/interface/utils.d.ts b/packages/ast/types/encoding/amino/interface/utils.d.ts index 68cf0be95f..4d95be235f 100644 --- a/packages/ast/types/encoding/amino/interface/utils.d.ts +++ b/packages/ast/types/encoding/amino/interface/utils.d.ts @@ -6,7 +6,7 @@ export declare const aminoInterface: { long(args: RenderAminoField): t.TSPropertySignature; height(args: RenderAminoField): t.TSPropertySignature; duration(args: RenderAminoField): any; - timestamp(args: RenderAminoField): any; + timestamp(args: RenderAminoField): t.TSPropertySignature; enum(args: RenderAminoField): t.TSPropertySignature; pubkey(args: RenderAminoField): t.TSPropertySignature; enumArray(args: RenderAminoField): t.TSPropertySignature; From 0e0dc5d246680a3cbea4d332493980c4dc3080a5 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 Nov 2023 15:43:11 -0400 Subject: [PATCH 6/8] Fixed Timestamp Amino type again and allow to be optional. --- .../src/encoding/proto/from-amino/utils.ts | 40 ++++++++++++------- packages/ast/src/encoding/types.ts | 4 ++ 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/packages/ast/src/encoding/proto/from-amino/utils.ts b/packages/ast/src/encoding/proto/from-amino/utils.ts index ef7345d847..137aa57604 100644 --- a/packages/ast/src/encoding/proto/from-amino/utils.ts +++ b/packages/ast/src/encoding/proto/from-amino/utils.ts @@ -346,28 +346,38 @@ export const fromAminoJSON = { }, timestampDate(args: FromAminoJSONMethod) { - const { origName } = getFieldNames(args.field); + const { propName, origName } = getFieldNames(args.field); args.context.addUtil('fromTimestamp'); - const callExpr = t.callExpression( - t.identifier('fromTimestamp'), - [ + return t.objectProperty( + t.identifier(propName), + t.conditionalExpression( + t.optionalMemberExpression( + t.identifier('object'), + t.identifier(origName), + false, + true + ), t.callExpression( - t.memberExpression( - t.identifier('Timestamp'), - t.identifier('fromAmino') - ), + t.identifier('fromTimestamp'), [ - t.memberExpression( - t.identifier('object'), - t.identifier(origName) + t.callExpression( + t.memberExpression( + t.identifier('Timestamp'), + t.identifier('fromAmino') + ), + [ + t.memberExpression( + t.identifier('object'), + t.identifier(origName) + ) + ] ) ] - ) - ] + ), + t.identifier('undefined') + ) ); - - return setProp(args, callExpr); }, // labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ diff --git a/packages/ast/src/encoding/types.ts b/packages/ast/src/encoding/types.ts index 95cd902b7b..1b8346a917 100644 --- a/packages/ast/src/encoding/types.ts +++ b/packages/ast/src/encoding/types.ts @@ -351,6 +351,10 @@ export const getTSTypeFromGoogleType = ( switch (type) { case 'google.protobuf.Timestamp': + if (options === 'Amino' || options === 'AminoMsg') { + return t.tsStringKeyword(); + } + switch (context.pluginValue('prototypes.typingsFormat.timestamp')) { case 'timestamp': return t.tsTypeReference(identifier('Timestamp')); From 2bd802ffbbee33657a109763a4258b07720b5ba5 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 Nov 2023 15:44:10 -0400 Subject: [PATCH 7/8] Updated fixtures and snapshots. --- .../cosmos/evidence/v1beta1/evidence.ts | 2 +- .../cosmos/feegrant/v1beta1/feegrant.ts | 2 +- .../outputosmojs/cosmos/gov/v1beta1/gov.ts | 8 +++---- .../outputosmojs/cosmos/group/v1/types.ts | 12 +++++----- .../cosmos/slashing/v1beta1/slashing.ts | 2 +- .../cosmos/staking/v1beta1/staking.ts | 8 +++---- .../outputosmojs/cosmos/staking/v1beta1/tx.ts | 4 ++-- .../cosmos/upgrade/v1beta1/upgrade.ts | 2 +- .../outputosmojs/evmos/claims/v1/genesis.ts | 2 +- .../outputosmojs/evmos/epochs/v1/genesis.ts | 4 ++-- .../evmos/incentives/v1/incentives.ts | 2 +- .../outputosmojs/evmos/vesting/v1/tx.ts | 2 +- .../outputosmojs/evmos/vesting/v1/vesting.ts | 2 +- .../lightclients/tendermint/v1/tendermint.ts | 2 +- .../osmosis/claim/v1beta1/params.ts | 2 +- .../incentive_record.ts | 2 +- .../osmosis/concentrated-liquidity/pool.ts | 2 +- .../concentrated-liquidity/position.ts | 2 +- .../osmosis/concentrated-liquidity/tx.ts | 6 ++--- .../downtime-detector/v1beta1/genesis.ts | 4 ++-- .../outputosmojs/osmosis/epochs/genesis.ts | 4 ++-- .../gamm/pool-models/balancer/balancerPool.ts | 2 +- .../outputosmojs/osmosis/incentives/gauge.ts | 2 +- .../outputosmojs/osmosis/incentives/tx.ts | 2 +- .../outputosmojs/osmosis/lockup/lock.ts | 6 ++--- .../outputosmojs/osmosis/lockup/query.ts | 8 +++---- .../osmosis/twap/v1beta1/query.ts | 4 ++-- .../osmosis/twap/v1beta1/twap_record.ts | 4 ++-- .../outputosmojs/tendermint/abci/types.ts | 4 ++-- .../outputosmojs/tendermint/types/evidence.ts | 4 ++-- .../outputosmojs/tendermint/types/types.ts | 8 +++---- .../outputv2/cosmos/authz/v1beta1/authz.ts | 4 ++-- .../cosmos/evidence/v1beta1/evidence.ts | 4 ++-- .../cosmos/feegrant/v1beta1/feegrant.ts | 6 ++--- .../v-next/outputv2/cosmos/gov/v1/gov.ts | 8 +++---- .../v-next/outputv2/cosmos/gov/v1beta1/gov.ts | 16 ++++++------- .../v-next/outputv2/cosmos/group/v1/types.ts | 24 +++++++++---------- .../cosmos/slashing/v1beta1/slashing.ts | 4 ++-- .../cosmos/staking/v1beta1/staking.ts | 16 ++++++------- .../outputv2/cosmos/staking/v1beta1/tx.ts | 8 +++---- .../cosmos/upgrade/v1beta1/upgrade.ts | 4 ++-- .../outputv2/evmos/claims/v1/genesis.ts | 4 ++-- .../outputv2/evmos/epochs/v1/genesis.ts | 8 +++---- .../evmos/incentives/v1/incentives.ts | 4 ++-- .../v-next/outputv2/evmos/vesting/v1/tx.ts | 4 ++-- .../outputv2/evmos/vesting/v1/vesting.ts | 4 ++-- .../outputv2/google/api/distribution.ts | 2 +- .../google/api/expr/v1alpha1/syntax.ts | 2 +- .../google/api/servicecontrol/v1/log_entry.ts | 2 +- .../api/servicecontrol/v1/metric_value.ts | 4 ++-- .../google/api/servicecontrol/v1/operation.ts | 4 ++-- .../api/servicemanagement/v1/resources.ts | 4 ++-- .../outputv2/google/logging/v2/log_entry.ts | 4 ++-- .../google/logging/v2/logging_config.ts | 20 ++++++++-------- .../google/logging/v2/logging_metrics.ts | 4 ++-- .../google/rpc/context/attribute_context.ts | 10 ++++---- .../lightclients/tendermint/v1/tendermint.ts | 4 ++-- .../outputv2/osmosis/claim/v1beta1/params.ts | 4 ++-- .../v-next/outputv2/osmosis/epochs/genesis.ts | 8 +++---- .../gamm/pool-models/balancer/balancerPool.ts | 4 ++-- .../outputv2/osmosis/incentives/gauge.ts | 4 ++-- .../v-next/outputv2/osmosis/incentives/tx.ts | 4 ++-- .../v-next/outputv2/osmosis/lockup/lock.ts | 12 +++++----- .../v-next/outputv2/osmosis/lockup/query.ts | 16 ++++++------- .../outputv2/osmosis/twap/v1beta1/query.ts | 10 ++++---- .../osmosis/twap/v1beta1/twap_record.ts | 8 +++---- .../v-next/outputv2/tendermint/abci/types.ts | 8 +++---- .../v-next/outputv2/tendermint/p2p/types.ts | 6 ++--- .../outputv2/tendermint/types/evidence.ts | 8 +++---- .../v-next/outputv2/tendermint/types/types.ts | 16 ++++++------- .../outputv3/cosmos/authz/v1beta1/authz.ts | 4 ++-- .../cosmos/evidence/v1beta1/evidence.ts | 4 ++-- .../cosmos/feegrant/v1beta1/feegrant.ts | 6 ++--- .../v-next/outputv3/cosmos/gov/v1/gov.ts | 8 +++---- .../v-next/outputv3/cosmos/gov/v1beta1/gov.ts | 16 ++++++------- .../v-next/outputv3/cosmos/group/v1/types.ts | 24 +++++++++---------- .../cosmos/slashing/v1beta1/slashing.ts | 4 ++-- .../cosmos/staking/v1beta1/staking.ts | 16 ++++++------- .../outputv3/cosmos/staking/v1beta1/tx.ts | 8 +++---- .../cosmos/upgrade/v1beta1/upgrade.ts | 4 ++-- .../outputv3/evmos/claims/v1/genesis.ts | 4 ++-- .../outputv3/evmos/epochs/v1/genesis.ts | 8 +++---- .../evmos/incentives/v1/incentives.ts | 4 ++-- .../v-next/outputv3/evmos/vesting/v1/tx.ts | 4 ++-- .../outputv3/evmos/vesting/v1/vesting.ts | 4 ++-- .../outputv3/google/api/distribution.ts | 2 +- .../google/api/expr/v1alpha1/syntax.ts | 2 +- .../google/api/servicecontrol/v1/log_entry.ts | 2 +- .../api/servicecontrol/v1/metric_value.ts | 4 ++-- .../google/api/servicecontrol/v1/operation.ts | 4 ++-- .../api/servicemanagement/v1/resources.ts | 4 ++-- .../outputv3/google/logging/v2/log_entry.ts | 4 ++-- .../google/logging/v2/logging_config.ts | 20 ++++++++-------- .../google/logging/v2/logging_metrics.ts | 4 ++-- .../google/rpc/context/attribute_context.ts | 10 ++++---- .../lightclients/tendermint/v1/tendermint.ts | 4 ++-- .../outputv3/osmosis/claim/v1beta1/params.ts | 4 ++-- .../v-next/outputv3/osmosis/epochs/genesis.ts | 8 +++---- .../gamm/pool-models/balancer/balancerPool.ts | 4 ++-- .../outputv3/osmosis/incentives/gauge.ts | 4 ++-- .../v-next/outputv3/osmosis/incentives/tx.ts | 4 ++-- .../v-next/outputv3/osmosis/lockup/lock.ts | 12 +++++----- .../v-next/outputv3/osmosis/lockup/query.ts | 16 ++++++------- .../outputv3/osmosis/twap/v1beta1/query.ts | 10 ++++---- .../osmosis/twap/v1beta1/twap_record.ts | 8 +++---- .../v-next/outputv3/tendermint/abci/types.ts | 8 +++---- .../v-next/outputv3/tendermint/p2p/types.ts | 6 ++--- .../outputv3/tendermint/types/evidence.ts | 8 +++---- .../v-next/outputv3/tendermint/types/types.ts | 16 ++++++------- .../cosmos/evidence/v1beta1/evidence.ts | 2 +- .../cosmos/feegrant/v1beta1/feegrant.ts | 2 +- .../v-next/outputv4/cosmos/gov/v1beta1/gov.ts | 8 +++---- .../v-next/outputv4/cosmos/group/v1/types.ts | 12 +++++----- .../cosmos/slashing/v1beta1/slashing.ts | 2 +- .../cosmos/staking/v1beta1/staking.ts | 8 +++---- .../outputv4/cosmos/staking/v1beta1/tx.ts | 4 ++-- .../cosmos/upgrade/v1beta1/upgrade.ts | 2 +- .../outputv4/evmos/claims/v1/genesis.ts | 2 +- .../outputv4/evmos/epochs/v1/genesis.ts | 4 ++-- .../evmos/incentives/v1/incentives.ts | 2 +- .../v-next/outputv4/evmos/vesting/v1/tx.ts | 2 +- .../outputv4/evmos/vesting/v1/vesting.ts | 2 +- .../lightclients/tendermint/v1/tendermint.ts | 2 +- .../outputv4/osmosis/claim/v1beta1/params.ts | 2 +- .../v-next/outputv4/osmosis/epochs/genesis.ts | 4 ++-- .../gamm/pool-models/balancer/balancerPool.ts | 2 +- .../outputv4/osmosis/incentives/gauge.ts | 2 +- .../v-next/outputv4/osmosis/incentives/tx.ts | 2 +- .../v-next/outputv4/osmosis/lockup/lock.ts | 6 ++--- .../v-next/outputv4/osmosis/lockup/query.ts | 8 +++---- .../outputv4/osmosis/twap/v1beta1/query.ts | 4 ++-- .../osmosis/twap/v1beta1/twap_record.ts | 4 ++-- .../v-next/outputv4/tendermint/abci/types.ts | 4 ++-- .../outputv4/tendermint/types/evidence.ts | 4 ++-- .../v-next/outputv4/tendermint/types/types.ts | 8 +++---- .../amino.interface.test.ts.snap | 4 ++-- 136 files changed, 400 insertions(+), 400 deletions(-) diff --git a/__fixtures__/v-next/outputosmojs/cosmos/evidence/v1beta1/evidence.ts b/__fixtures__/v-next/outputosmojs/cosmos/evidence/v1beta1/evidence.ts index 06063b23ad..2a9f67ebaa 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/evidence/v1beta1/evidence.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/evidence/v1beta1/evidence.ts @@ -128,7 +128,7 @@ export const Equivocation = { fromAmino(object: EquivocationAmino): Equivocation { return { height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, power: BigInt(object.power), consensusAddress: object.consensus_address }; diff --git a/__fixtures__/v-next/outputosmojs/cosmos/feegrant/v1beta1/feegrant.ts b/__fixtures__/v-next/outputosmojs/cosmos/feegrant/v1beta1/feegrant.ts index 469d179be8..d1943ba8c2 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/feegrant/v1beta1/feegrant.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/feegrant/v1beta1/feegrant.ts @@ -360,7 +360,7 @@ export const PeriodicAllowance = { period: object?.period ? Duration.fromAmino(object.period) : undefined, periodSpendLimit: Array.isArray(object?.period_spend_limit) ? object.period_spend_limit.map((e: any) => Coin.fromAmino(e)) : [], periodCanSpend: Array.isArray(object?.period_can_spend) ? object.period_can_spend.map((e: any) => Coin.fromAmino(e)) : [], - periodReset: fromTimestamp(Timestamp.fromAmino(object.period_reset)) + periodReset: object?.period_reset ? fromTimestamp(Timestamp.fromAmino(object.period_reset)) : undefined }; }, toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts index 132f66edc4..1f5963c588 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts @@ -868,11 +868,11 @@ export const Proposal = { content: object?.content ? Any.fromAmino(object.content) : undefined, status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), - depositEndTime: fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)), + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined, + depositEndTime: object?.deposit_end_time ? fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)) : undefined, totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: fromTimestamp(Timestamp.fromAmino(object.voting_start_time)), - votingEndTime: fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) + votingStartTime: object?.voting_start_time ? fromTimestamp(Timestamp.fromAmino(object.voting_start_time)) : undefined, + votingEndTime: object?.voting_end_time ? fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) : undefined }; }, toAmino(message: Proposal): ProposalAmino { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts b/__fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts index 9dfa5d2079..76c651de2b 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts @@ -630,7 +630,7 @@ export const Member = { address: object.address, weight: object.weight, metadata: object.metadata, - addedAt: fromTimestamp(Timestamp.fromAmino(object.added_at)) + addedAt: object?.added_at ? fromTimestamp(Timestamp.fromAmino(object.added_at)) : undefined }; }, toAmino(message: Member): MemberAmino { @@ -1220,7 +1220,7 @@ export const GroupInfo = { metadata: object.metadata, version: BigInt(object.version), totalWeight: object.total_weight, - createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) + createdAt: object?.created_at ? fromTimestamp(Timestamp.fromAmino(object.created_at)) : undefined }; }, toAmino(message: GroupInfo): GroupInfoAmino { @@ -1508,7 +1508,7 @@ export const GroupPolicyInfo = { metadata: object.metadata, version: BigInt(object.version), decisionPolicy: object?.decision_policy ? Any.fromAmino(object.decision_policy) : undefined, - createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) + createdAt: object?.created_at ? fromTimestamp(Timestamp.fromAmino(object.created_at)) : undefined }; }, toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { @@ -1782,13 +1782,13 @@ export const Proposal = { address: object.address, metadata: object.metadata, proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], - submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined, groupVersion: BigInt(object.group_version), groupPolicyVersion: BigInt(object.group_policy_version), status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - votingPeriodEnd: fromTimestamp(Timestamp.fromAmino(object.voting_period_end)), + votingPeriodEnd: object?.voting_period_end ? fromTimestamp(Timestamp.fromAmino(object.voting_period_end)) : undefined, executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] }; @@ -2095,7 +2095,7 @@ export const Vote = { voter: object.voter, option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata, - submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)) + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined }; }, toAmino(message: Vote): VoteAmino { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/slashing/v1beta1/slashing.ts b/__fixtures__/v-next/outputosmojs/cosmos/slashing/v1beta1/slashing.ts index a221480438..a1e8e86c9a 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/slashing/v1beta1/slashing.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/slashing/v1beta1/slashing.ts @@ -196,7 +196,7 @@ export const ValidatorSigningInfo = { address: object.address, startHeight: BigInt(object.start_height), indexOffset: BigInt(object.index_offset), - jailedUntil: fromTimestamp(Timestamp.fromAmino(object.jailed_until)), + jailedUntil: object?.jailed_until ? fromTimestamp(Timestamp.fromAmino(object.jailed_until)) : undefined, tombstoned: object.tombstoned, missedBlocksCounter: BigInt(object.missed_blocks_counter) }; diff --git a/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/staking.ts b/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/staking.ts index c11ad72e15..d39f835887 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/staking.ts @@ -844,7 +844,7 @@ export const Commission = { fromAmino(object: CommissionAmino): Commission { return { commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: fromTimestamp(Timestamp.fromAmino(object.update_time)) + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined }; }, toAmino(message: Commission): CommissionAmino { @@ -1227,7 +1227,7 @@ export const Validator = { delegatorShares: object.delegator_shares, description: object?.description ? Description.fromAmino(object.description) : undefined, unbondingHeight: BigInt(object.unbonding_height), - unbondingTime: fromTimestamp(Timestamp.fromAmino(object.unbonding_time)), + unbondingTime: object?.unbonding_time ? fromTimestamp(Timestamp.fromAmino(object.unbonding_time)) : undefined, commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, minSelfDelegation: object.min_self_delegation }; @@ -2168,7 +2168,7 @@ export const UnbondingDelegationEntry = { fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined, initialBalance: object.initial_balance, balance: object.balance }; @@ -2305,7 +2305,7 @@ export const RedelegationEntry = { fromAmino(object: RedelegationEntryAmino): RedelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined, initialBalance: object.initial_balance, sharesDst: object.shares_dst }; diff --git a/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/tx.ts b/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/tx.ts index a66df3cd9b..c1fd16bc0a 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/tx.ts @@ -1027,7 +1027,7 @@ export const MsgBeginRedelegateResponse = { }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { return { - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined }; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { @@ -1241,7 +1241,7 @@ export const MsgUndelegateResponse = { }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { return { - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined }; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/upgrade/v1beta1/upgrade.ts b/__fixtures__/v-next/outputosmojs/cosmos/upgrade/v1beta1/upgrade.ts index 58e6c16733..fc4e2e9317 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/upgrade/v1beta1/upgrade.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/upgrade/v1beta1/upgrade.ts @@ -247,7 +247,7 @@ export const Plan = { fromAmino(object: PlanAmino): Plan { return { name: object.name, - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, height: BigInt(object.height), info: object.info, upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined diff --git a/__fixtures__/v-next/outputosmojs/evmos/claims/v1/genesis.ts b/__fixtures__/v-next/outputosmojs/evmos/claims/v1/genesis.ts index 0ba572f046..542ba0cbf6 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/claims/v1/genesis.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/claims/v1/genesis.ts @@ -324,7 +324,7 @@ export const Params = { fromAmino(object: ParamsAmino): Params { return { enableClaims: object.enable_claims, - airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), + airdropStartTime: object?.airdrop_start_time ? fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)) : undefined, durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimsDenom: object.claims_denom, diff --git a/__fixtures__/v-next/outputosmojs/evmos/epochs/v1/genesis.ts b/__fixtures__/v-next/outputosmojs/evmos/epochs/v1/genesis.ts index 86f4cd6819..c13db3d802 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/epochs/v1/genesis.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/epochs/v1/genesis.ts @@ -178,10 +178,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), + currentEpochStartTime: object?.current_epoch_start_time ? fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)) : undefined, epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; diff --git a/__fixtures__/v-next/outputosmojs/evmos/incentives/v1/incentives.ts b/__fixtures__/v-next/outputosmojs/evmos/incentives/v1/incentives.ts index 4c5ae12581..7930363397 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/incentives/v1/incentives.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/incentives/v1/incentives.ts @@ -222,7 +222,7 @@ export const Incentive = { contract: object.contract, allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => DecCoin.fromAmino(e)) : [], epochs: object.epochs, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, totalGas: BigInt(object.total_gas) }; }, diff --git a/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.ts b/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.ts index a83c04c79e..7720eb79c5 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.ts @@ -236,7 +236,7 @@ export const MsgCreateClawbackVestingAccount = { return { fromAddress: object.from_address, toAddress: object.to_address, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [], merge: object.merge diff --git a/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/vesting.ts b/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/vesting.ts index 40b3c0c8ac..dd64793f49 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/vesting.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/vesting/v1/vesting.ts @@ -173,7 +173,7 @@ export const ClawbackVestingAccount = { return { baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined, funderAddress: object.funder_address, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [] }; diff --git a/__fixtures__/v-next/outputosmojs/ibc/lightclients/tendermint/v1/tendermint.ts b/__fixtures__/v-next/outputosmojs/ibc/lightclients/tendermint/v1/tendermint.ts index b880ed41c7..e8284f6d8d 100644 --- a/__fixtures__/v-next/outputosmojs/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/__fixtures__/v-next/outputosmojs/ibc/lightclients/tendermint/v1/tendermint.ts @@ -533,7 +533,7 @@ export const ConsensusState = { }, fromAmino(object: ConsensusStateAmino): ConsensusState { return { - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined, nextValidatorsHash: object.next_validators_hash }; diff --git a/__fixtures__/v-next/outputosmojs/osmosis/claim/v1beta1/params.ts b/__fixtures__/v-next/outputosmojs/osmosis/claim/v1beta1/params.ts index 5d13162208..bff8ee3abe 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/claim/v1beta1/params.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/claim/v1beta1/params.ts @@ -123,7 +123,7 @@ export const Params = { }, fromAmino(object: ParamsAmino): Params { return { - airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), + airdropStartTime: object?.airdrop_start_time ? fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)) : undefined, durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimDenom: object.claim_denom diff --git a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/incentive_record.ts b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/incentive_record.ts index fe645905f9..f1c0c7040b 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/incentive_record.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/incentive_record.ts @@ -316,7 +316,7 @@ export const IncentiveRecordBody = { return { remainingAmount: object.remaining_amount, emissionRate: object.emission_rate, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)) + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined }; }, toAmino(message: IncentiveRecordBody): IncentiveRecordBodyAmino { diff --git a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/pool.ts b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/pool.ts index a77bac378a..d44351e82f 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/pool.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/pool.ts @@ -263,7 +263,7 @@ export const Pool = { tickSpacing: BigInt(object.tick_spacing), exponentAtPriceOne: object.exponent_at_price_one, swapFee: object.swap_fee, - lastLiquidityUpdate: fromTimestamp(Timestamp.fromAmino(object.last_liquidity_update)) + lastLiquidityUpdate: object?.last_liquidity_update ? fromTimestamp(Timestamp.fromAmino(object.last_liquidity_update)) : undefined }; }, toAmino(message: Pool): PoolAmino { diff --git a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/position.ts b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/position.ts index 9607b1e3cb..1d35fd9403 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/position.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/position.ts @@ -193,7 +193,7 @@ export const Position = { poolId: BigInt(object.pool_id), lowerTick: BigInt(object.lower_tick), upperTick: BigInt(object.upper_tick), - joinTime: fromTimestamp(Timestamp.fromAmino(object.join_time)), + joinTime: object?.join_time ? fromTimestamp(Timestamp.fromAmino(object.join_time)) : undefined, liquidity: object.liquidity }; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/tx.ts b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/tx.ts index c71e2c0690..718ed38451 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/tx.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/concentrated-liquidity/tx.ts @@ -505,7 +505,7 @@ export const MsgCreatePositionResponse = { positionId: BigInt(object.position_id), amount0: object.amount0, amount1: object.amount1, - joinTime: fromTimestamp(Timestamp.fromAmino(object.join_time)), + joinTime: object?.join_time ? fromTimestamp(Timestamp.fromAmino(object.join_time)) : undefined, liquidityCreated: object.liquidity_created }; }, @@ -1378,7 +1378,7 @@ export const MsgCreateIncentive = { incentiveDenom: object.incentive_denom, incentiveAmount: object.incentive_amount, emissionRate: object.emission_rate, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, minUptime: object?.min_uptime ? Duration.fromAmino(object.min_uptime) : undefined }; }, @@ -1532,7 +1532,7 @@ export const MsgCreateIncentiveResponse = { incentiveDenom: object.incentive_denom, incentiveAmount: object.incentive_amount, emissionRate: object.emission_rate, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, minUptime: object?.min_uptime ? Duration.fromAmino(object.min_uptime) : undefined }; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/genesis.ts b/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/genesis.ts index 4f9c404c72..a7f717d5e3 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/genesis.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/genesis.ts @@ -105,7 +105,7 @@ export const GenesisDowntimeEntry = { fromAmino(object: GenesisDowntimeEntryAmino): GenesisDowntimeEntry { return { duration: isSet(object.duration) ? downtimeFromJSON(object.duration) : -1, - lastDowntime: fromTimestamp(Timestamp.fromAmino(object.last_downtime)) + lastDowntime: object?.last_downtime ? fromTimestamp(Timestamp.fromAmino(object.last_downtime)) : undefined }; }, toAmino(message: GenesisDowntimeEntry): GenesisDowntimeEntryAmino { @@ -220,7 +220,7 @@ export const GenesisState = { fromAmino(object: GenesisStateAmino): GenesisState { return { downtimes: Array.isArray(object?.downtimes) ? object.downtimes.map((e: any) => GenesisDowntimeEntry.fromAmino(e)) : [], - lastBlockTime: fromTimestamp(Timestamp.fromAmino(object.last_block_time)) + lastBlockTime: object?.last_block_time ? fromTimestamp(Timestamp.fromAmino(object.last_block_time)) : undefined }; }, toAmino(message: GenesisState): GenesisStateAmino { diff --git a/__fixtures__/v-next/outputosmojs/osmosis/epochs/genesis.ts b/__fixtures__/v-next/outputosmojs/osmosis/epochs/genesis.ts index d6d25a5697..fb682b2fe0 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/epochs/genesis.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/epochs/genesis.ts @@ -231,10 +231,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), + currentEpochStartTime: object?.current_epoch_start_time ? fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)) : undefined, epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; diff --git a/__fixtures__/v-next/outputosmojs/osmosis/gamm/pool-models/balancer/balancerPool.ts b/__fixtures__/v-next/outputosmojs/osmosis/gamm/pool-models/balancer/balancerPool.ts index d6b97b1f50..05ea30e002 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/gamm/pool-models/balancer/balancerPool.ts @@ -277,7 +277,7 @@ export const SmoothWeightChangeParams = { }, fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { return { - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, initialPoolWeights: Array.isArray(object?.initial_pool_weights) ? object.initial_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [], targetPoolWeights: Array.isArray(object?.target_pool_weights) ? object.target_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [] diff --git a/__fixtures__/v-next/outputosmojs/osmosis/incentives/gauge.ts b/__fixtures__/v-next/outputosmojs/osmosis/incentives/gauge.ts index 72aa38c38a..71ef930c41 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/incentives/gauge.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/incentives/gauge.ts @@ -249,7 +249,7 @@ export const Gauge = { isPerpetual: object.is_perpetual, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, numEpochsPaidOver: BigInt(object.num_epochs_paid_over), filledEpochs: BigInt(object.filled_epochs), distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : [] diff --git a/__fixtures__/v-next/outputosmojs/osmosis/incentives/tx.ts b/__fixtures__/v-next/outputosmojs/osmosis/incentives/tx.ts index d43ee74014..3fbe329d31 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/incentives/tx.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/incentives/tx.ts @@ -214,7 +214,7 @@ export const MsgCreateGauge = { owner: object.owner, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, numEpochsPaidOver: BigInt(object.num_epochs_paid_over) }; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/lockup/lock.ts b/__fixtures__/v-next/outputosmojs/osmosis/lockup/lock.ts index 210e66af5f..1fe9a9973d 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/lockup/lock.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/lockup/lock.ts @@ -297,7 +297,7 @@ export const PeriodLock = { ID: BigInt(object.ID), owner: object.owner, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] }; }, @@ -440,7 +440,7 @@ export const QueryCondition = { lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object.denom, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: QueryCondition): QueryConditionAmino { @@ -576,7 +576,7 @@ export const SyntheticLock = { return { underlyingLockId: BigInt(object.underlying_lock_id), synthDenom: object.synth_denom, - endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined }; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/lockup/query.ts b/__fixtures__/v-next/outputosmojs/osmosis/lockup/query.ts index 2cff50ddb1..170ded1105 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/lockup/query.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/lockup/query.ts @@ -1372,7 +1372,7 @@ export const AccountLockedPastTimeRequest = { fromAmino(object: AccountLockedPastTimeRequestAmino): AccountLockedPastTimeRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: AccountLockedPastTimeRequest): AccountLockedPastTimeRequestAmino { @@ -1583,7 +1583,7 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino): AccountLockedPastTimeNotUnlockingOnlyRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyRequest): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { @@ -1794,7 +1794,7 @@ export const AccountUnlockedBeforeTimeRequest = { fromAmino(object: AccountUnlockedBeforeTimeRequestAmino): AccountUnlockedBeforeTimeRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: AccountUnlockedBeforeTimeRequest): AccountUnlockedBeforeTimeRequestAmino { @@ -2018,7 +2018,7 @@ export const AccountLockedPastTimeDenomRequest = { fromAmino(object: AccountLockedPastTimeDenomRequestAmino): AccountLockedPastTimeDenomRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, denom: object.denom }; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/query.ts b/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/query.ts index f3ceb450b0..6b25912419 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/query.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/query.ts @@ -191,7 +191,7 @@ export const ArithmeticTwapRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined }; }, @@ -422,7 +422,7 @@ export const ArithmeticTwapToNowRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)) + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined }; }, toAmino(message: ArithmeticTwapToNowRequest): ArithmeticTwapToNowRequestAmino { diff --git a/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/twap_record.ts b/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/twap_record.ts index a084797b33..211328fc98 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/twap_record.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/twap/v1beta1/twap_record.ts @@ -248,12 +248,12 @@ export const TwapRecord = { asset0Denom: object.asset0_denom, asset1Denom: object.asset1_denom, height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, p0LastSpotPrice: object.p0_last_spot_price, p1LastSpotPrice: object.p1_last_spot_price, p0ArithmeticTwapAccumulator: object.p0_arithmetic_twap_accumulator, p1ArithmeticTwapAccumulator: object.p1_arithmetic_twap_accumulator, - lastErrorTime: fromTimestamp(Timestamp.fromAmino(object.last_error_time)) + lastErrorTime: object?.last_error_time ? fromTimestamp(Timestamp.fromAmino(object.last_error_time)) : undefined }; }, toAmino(message: TwapRecord): TwapRecordAmino { diff --git a/__fixtures__/v-next/outputosmojs/tendermint/abci/types.ts b/__fixtures__/v-next/outputosmojs/tendermint/abci/types.ts index b3d5ad4e5a..9834a06a18 100644 --- a/__fixtures__/v-next/outputosmojs/tendermint/abci/types.ts +++ b/__fixtures__/v-next/outputosmojs/tendermint/abci/types.ts @@ -1717,7 +1717,7 @@ export const RequestInitChain = { }, fromAmino(object: RequestInitChainAmino): RequestInitChain { return { - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, chainId: object.chain_id, consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], @@ -6201,7 +6201,7 @@ export const Evidence = { type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, totalVotingPower: BigInt(object.total_voting_power) }; }, diff --git a/__fixtures__/v-next/outputosmojs/tendermint/types/evidence.ts b/__fixtures__/v-next/outputosmojs/tendermint/types/evidence.ts index 3e48c065d4..bdcbbc5318 100644 --- a/__fixtures__/v-next/outputosmojs/tendermint/types/evidence.ts +++ b/__fixtures__/v-next/outputosmojs/tendermint/types/evidence.ts @@ -285,7 +285,7 @@ export const DuplicateVoteEvidence = { voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, totalVotingPower: BigInt(object.total_voting_power), validatorPower: BigInt(object.validator_power), - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { @@ -439,7 +439,7 @@ export const LightClientAttackEvidence = { commonHeight: BigInt(object.common_height), byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], totalVotingPower: BigInt(object.total_voting_power), - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { diff --git a/__fixtures__/v-next/outputosmojs/tendermint/types/types.ts b/__fixtures__/v-next/outputosmojs/tendermint/types/types.ts index 96322a15c0..9aed6ea14f 100644 --- a/__fixtures__/v-next/outputosmojs/tendermint/types/types.ts +++ b/__fixtures__/v-next/outputosmojs/tendermint/types/types.ts @@ -900,7 +900,7 @@ export const Header = { version: object?.version ? Consensus.fromAmino(object.version) : undefined, chainId: object.chain_id, height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, lastCommitHash: object.last_commit_hash, dataHash: object.data_hash, @@ -1202,7 +1202,7 @@ export const Vote = { height: BigInt(object.height), round: object.round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, validatorAddress: object.validator_address, validatorIndex: object.validator_index, signature: object.signature @@ -1482,7 +1482,7 @@ export const CommitSig = { return { blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object.validator_address, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, signature: object.signature }; }, @@ -1655,7 +1655,7 @@ export const Proposal = { round: object.round, polRound: object.pol_round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, signature: object.signature }; }, diff --git a/__fixtures__/v-next/outputv2/cosmos/authz/v1beta1/authz.ts b/__fixtures__/v-next/outputv2/cosmos/authz/v1beta1/authz.ts index 632c05e070..b49a4c1fc0 100644 --- a/__fixtures__/v-next/outputv2/cosmos/authz/v1beta1/authz.ts +++ b/__fixtures__/v-next/outputv2/cosmos/authz/v1beta1/authz.ts @@ -75,7 +75,7 @@ export interface GrantAmino { * doesn't have a time expiration (other conditions in `authorization` * may apply to invalidate the grant) */ - expiration?: Date; + expiration?: string; } export interface GrantAminoMsg { type: "cosmos-sdk/Grant"; @@ -114,7 +114,7 @@ export interface GrantAuthorizationAmino { granter: string; grantee: string; authorization?: AnyAmino; - expiration?: Date; + expiration?: string; } export interface GrantAuthorizationAminoMsg { type: "cosmos-sdk/GrantAuthorization"; diff --git a/__fixtures__/v-next/outputv2/cosmos/evidence/v1beta1/evidence.ts b/__fixtures__/v-next/outputv2/cosmos/evidence/v1beta1/evidence.ts index 8d546c1097..872adee816 100644 --- a/__fixtures__/v-next/outputv2/cosmos/evidence/v1beta1/evidence.ts +++ b/__fixtures__/v-next/outputv2/cosmos/evidence/v1beta1/evidence.ts @@ -22,7 +22,7 @@ export interface EquivocationProtoMsg { */ export interface EquivocationAmino { height: string; - time?: Date; + time?: string; power: string; consensus_address: string; } @@ -139,7 +139,7 @@ export const Equivocation = { fromAmino(object: EquivocationAmino): Equivocation { return { height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, power: BigInt(object.power), consensusAddress: object.consensus_address }; diff --git a/__fixtures__/v-next/outputv2/cosmos/feegrant/v1beta1/feegrant.ts b/__fixtures__/v-next/outputv2/cosmos/feegrant/v1beta1/feegrant.ts index b1f3976dd2..6af080f765 100644 --- a/__fixtures__/v-next/outputv2/cosmos/feegrant/v1beta1/feegrant.ts +++ b/__fixtures__/v-next/outputv2/cosmos/feegrant/v1beta1/feegrant.ts @@ -36,7 +36,7 @@ export interface BasicAllowanceAmino { */ spend_limit: CoinAmino[]; /** expiration specifies an optional time when this allowance expires */ - expiration?: Date; + expiration?: string; } export interface BasicAllowanceAminoMsg { type: "cosmos-sdk/BasicAllowance"; @@ -106,7 +106,7 @@ export interface PeriodicAllowanceAmino { * it is calculated from the start time of the first transaction after the * last period ended */ - period_reset?: Date; + period_reset?: string; } export interface PeriodicAllowanceAminoMsg { type: "cosmos-sdk/PeriodicAllowance"; @@ -437,7 +437,7 @@ export const PeriodicAllowance = { period: object?.period ? Duration.fromAmino(object.period) : undefined, periodSpendLimit: Array.isArray(object?.period_spend_limit) ? object.period_spend_limit.map((e: any) => Coin.fromAmino(e)) : [], periodCanSpend: Array.isArray(object?.period_can_spend) ? object.period_can_spend.map((e: any) => Coin.fromAmino(e)) : [], - periodReset: fromTimestamp(Timestamp.fromAmino(object.period_reset)) + periodReset: object?.period_reset ? fromTimestamp(Timestamp.fromAmino(object.period_reset)) : undefined }; }, toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { diff --git a/__fixtures__/v-next/outputv2/cosmos/gov/v1/gov.ts b/__fixtures__/v-next/outputv2/cosmos/gov/v1/gov.ts index 10986adca8..f91ed0f7a3 100644 --- a/__fixtures__/v-next/outputv2/cosmos/gov/v1/gov.ts +++ b/__fixtures__/v-next/outputv2/cosmos/gov/v1/gov.ts @@ -231,11 +231,11 @@ export interface ProposalAmino { * proposal's voting period has ended. */ final_tally_result?: TallyResultAmino; - submit_time?: Date; - deposit_end_time?: Date; + submit_time?: string; + deposit_end_time?: string; total_deposit: CoinAmino[]; - voting_start_time?: Date; - voting_end_time?: Date; + voting_start_time?: string; + voting_end_time?: string; /** metadata is any arbitrary metadata attached to the proposal. */ metadata: string; } diff --git a/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/gov.ts b/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/gov.ts index 78de719ca2..b3e05900ed 100644 --- a/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/gov.ts @@ -284,11 +284,11 @@ export interface ProposalAmino { * proposal's voting period has ended. */ final_tally_result?: TallyResultAmino; - submit_time?: Date; - deposit_end_time?: Date; + submit_time?: string; + deposit_end_time?: string; total_deposit: CoinAmino[]; - voting_start_time?: Date; - voting_end_time?: Date; + voting_start_time?: string; + voting_end_time?: string; } export interface ProposalAminoMsg { type: "cosmos-sdk/Proposal"; @@ -994,11 +994,11 @@ export const Proposal = { content: object?.content ? ProposalContentI_FromAmino(object.content) : undefined, status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), - depositEndTime: fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)), + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined, + depositEndTime: object?.deposit_end_time ? fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)) : undefined, totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: fromTimestamp(Timestamp.fromAmino(object.voting_start_time)), - votingEndTime: fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) + votingStartTime: object?.voting_start_time ? fromTimestamp(Timestamp.fromAmino(object.voting_start_time)) : undefined, + votingEndTime: object?.voting_end_time ? fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) : undefined }; }, toAmino(message: Proposal): ProposalAmino { diff --git a/__fixtures__/v-next/outputv2/cosmos/group/v1/types.ts b/__fixtures__/v-next/outputv2/cosmos/group/v1/types.ts index a9275c68f4..4d572651b2 100644 --- a/__fixtures__/v-next/outputv2/cosmos/group/v1/types.ts +++ b/__fixtures__/v-next/outputv2/cosmos/group/v1/types.ts @@ -247,7 +247,7 @@ export interface MemberAmino { /** metadata is any arbitrary metadata to attached to the member. */ metadata: string; /** added_at is a timestamp specifying when a member was added. */ - added_at?: Date; + added_at?: string; } export interface MemberAminoMsg { type: "cosmos-sdk/Member"; @@ -442,7 +442,7 @@ export interface GroupInfoAmino { /** total_weight is the sum of the group members' weights. */ total_weight: string; /** created_at is a timestamp specifying when a group was created. */ - created_at?: Date; + created_at?: string; } export interface GroupInfoAminoMsg { type: "cosmos-sdk/GroupInfo"; @@ -529,7 +529,7 @@ export interface GroupPolicyInfoAmino { /** decision_policy specifies the group policy's decision policy. */ decision_policy?: AnyAmino; /** created_at is a timestamp specifying when a group policy was created. */ - created_at?: Date; + created_at?: string; } export interface GroupPolicyInfoAminoMsg { type: "cosmos-sdk/GroupPolicyInfo"; @@ -619,7 +619,7 @@ export interface ProposalAmino { /** proposers are the account addresses of the proposers. */ proposers: string[]; /** submit_time is a timestamp specifying when a proposal was submitted. */ - submit_time?: Date; + submit_time?: string; /** * group_version tracks the version of the group that this proposal corresponds to. * When group membership is changed, existing proposals from previous group versions will become invalid. @@ -651,7 +651,7 @@ export interface ProposalAmino { * at this point, and the `final_tally_result`, as well * as `status` and `result` fields will be accordingly updated. */ - voting_period_end?: Date; + voting_period_end?: string; /** executor_result is the final result based on the votes and election rule. Initial value is NotRun. */ executor_result: ProposalExecutorResult; /** messages is a list of Msgs that will be executed if the proposal passes. */ @@ -747,7 +747,7 @@ export interface VoteAmino { /** metadata is any arbitrary metadata to attached to the vote. */ metadata: string; /** submit_time is the timestamp when the vote was submitted. */ - submit_time?: Date; + submit_time?: string; } export interface VoteAminoMsg { type: "cosmos-sdk/Vote"; @@ -858,7 +858,7 @@ export const Member = { address: object.address, weight: object.weight, metadata: object.metadata, - addedAt: fromTimestamp(Timestamp.fromAmino(object.added_at)) + addedAt: object?.added_at ? fromTimestamp(Timestamp.fromAmino(object.added_at)) : undefined }; }, toAmino(message: Member): MemberAmino { @@ -1434,7 +1434,7 @@ export const GroupInfo = { metadata: object.metadata, version: BigInt(object.version), totalWeight: object.total_weight, - createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) + createdAt: object?.created_at ? fromTimestamp(Timestamp.fromAmino(object.created_at)) : undefined }; }, toAmino(message: GroupInfo): GroupInfoAmino { @@ -1717,7 +1717,7 @@ export const GroupPolicyInfo = { metadata: object.metadata, version: BigInt(object.version), decisionPolicy: object?.decision_policy ? DecisionPolicy_FromAmino(object.decision_policy) : undefined, - createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) + createdAt: object?.created_at ? fromTimestamp(Timestamp.fromAmino(object.created_at)) : undefined }; }, toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { @@ -1983,13 +1983,13 @@ export const Proposal = { address: object.address, metadata: object.metadata, proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], - submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined, groupVersion: BigInt(object.group_version), groupPolicyVersion: BigInt(object.group_policy_version), status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - votingPeriodEnd: fromTimestamp(Timestamp.fromAmino(object.voting_period_end)), + votingPeriodEnd: object?.voting_period_end ? fromTimestamp(Timestamp.fromAmino(object.voting_period_end)) : undefined, executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] }; @@ -2283,7 +2283,7 @@ export const Vote = { voter: object.voter, option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata, - submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)) + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined }; }, toAmino(message: Vote): VoteAmino { diff --git a/__fixtures__/v-next/outputv2/cosmos/slashing/v1beta1/slashing.ts b/__fixtures__/v-next/outputv2/cosmos/slashing/v1beta1/slashing.ts index 81412d847c..f19fde1d1f 100644 --- a/__fixtures__/v-next/outputv2/cosmos/slashing/v1beta1/slashing.ts +++ b/__fixtures__/v-next/outputv2/cosmos/slashing/v1beta1/slashing.ts @@ -49,7 +49,7 @@ export interface ValidatorSigningInfoAmino { */ index_offset: string; /** Timestamp until which the validator is jailed due to liveness downtime. */ - jailed_until?: Date; + jailed_until?: string; /** * Whether or not a validator has been tombstoned (killed out of validator set). It is set * once the validator commits an equivocation or for any other configured misbehiavor. @@ -236,7 +236,7 @@ export const ValidatorSigningInfo = { address: object.address, startHeight: BigInt(object.start_height), indexOffset: BigInt(object.index_offset), - jailedUntil: fromTimestamp(Timestamp.fromAmino(object.jailed_until)), + jailedUntil: object?.jailed_until ? fromTimestamp(Timestamp.fromAmino(object.jailed_until)) : undefined, tombstoned: object.tombstoned, missedBlocksCounter: BigInt(object.missed_blocks_counter) }; diff --git a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/staking.ts b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/staking.ts index b778a4955c..61c2c9c59c 100644 --- a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/staking.ts @@ -152,7 +152,7 @@ export interface CommissionAmino { /** commission_rates defines the initial commission rates to be used for creating a validator. */ commission_rates?: CommissionRatesAmino; /** update_time is the last time the commission rate was changed. */ - update_time?: Date; + update_time?: string; } export interface CommissionAminoMsg { type: "cosmos-sdk/Commission"; @@ -274,7 +274,7 @@ export interface ValidatorAmino { /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ unbonding_height: string; /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ - unbonding_time?: Date; + unbonding_time?: string; /** commission defines the commission parameters. */ commission?: CommissionAmino; /** min_self_delegation is the validator's self declared minimum self delegation. */ @@ -548,7 +548,7 @@ export interface UnbondingDelegationEntryAmino { /** creation_height is the height which the unbonding took place. */ creation_height: string; /** completion_time is the unix time for unbonding completion. */ - completion_time?: Date; + completion_time?: string; /** initial_balance defines the tokens initially scheduled to receive at completion. */ initial_balance: string; /** balance defines the tokens to receive at completion. */ @@ -585,7 +585,7 @@ export interface RedelegationEntryAmino { /** creation_height defines the height which the redelegation took place. */ creation_height: string; /** completion_time defines the unix time for redelegation completion. */ - completion_time?: Date; + completion_time?: string; /** initial_balance defines the initial balance when redelegation started. */ initial_balance: string; /** shares_dst is the amount of destination-validator shares created by redelegation. */ @@ -1134,7 +1134,7 @@ export const Commission = { fromAmino(object: CommissionAmino): Commission { return { commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: fromTimestamp(Timestamp.fromAmino(object.update_time)) + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined }; }, toAmino(message: Commission): CommissionAmino { @@ -1503,7 +1503,7 @@ export const Validator = { delegatorShares: object.delegator_shares, description: object?.description ? Description.fromAmino(object.description) : undefined, unbondingHeight: BigInt(object.unbonding_height), - unbondingTime: fromTimestamp(Timestamp.fromAmino(object.unbonding_time)), + unbondingTime: object?.unbonding_time ? fromTimestamp(Timestamp.fromAmino(object.unbonding_time)) : undefined, commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, minSelfDelegation: object.min_self_delegation }; @@ -2404,7 +2404,7 @@ export const UnbondingDelegationEntry = { fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined, initialBalance: object.initial_balance, balance: object.balance }; @@ -2536,7 +2536,7 @@ export const RedelegationEntry = { fromAmino(object: RedelegationEntryAmino): RedelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined, initialBalance: object.initial_balance, sharesDst: object.shares_dst }; diff --git a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts index be27e00ea4..3c3002d279 100644 --- a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts @@ -214,7 +214,7 @@ export interface MsgBeginRedelegateResponseProtoMsg { } /** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ export interface MsgBeginRedelegateResponseAmino { - completion_time?: Date; + completion_time?: string; } export interface MsgBeginRedelegateResponseAminoMsg { type: "cosmos-sdk/MsgBeginRedelegateResponse"; @@ -269,7 +269,7 @@ export interface MsgUndelegateResponseProtoMsg { } /** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponseAmino { - completion_time?: Date; + completion_time?: string; } export interface MsgUndelegateResponseAminoMsg { type: "cosmos-sdk/MsgUndelegateResponse"; @@ -1112,7 +1112,7 @@ export const MsgBeginRedelegateResponse = { }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { return { - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined }; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { @@ -1318,7 +1318,7 @@ export const MsgUndelegateResponse = { }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { return { - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined }; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { diff --git a/__fixtures__/v-next/outputv2/cosmos/upgrade/v1beta1/upgrade.ts b/__fixtures__/v-next/outputv2/cosmos/upgrade/v1beta1/upgrade.ts index c1ee00b0c3..6121fdb74e 100644 --- a/__fixtures__/v-next/outputv2/cosmos/upgrade/v1beta1/upgrade.ts +++ b/__fixtures__/v-next/outputv2/cosmos/upgrade/v1beta1/upgrade.ts @@ -62,7 +62,7 @@ export interface PlanAmino { * If this field is not empty, an error will be thrown. */ /** @deprecated */ - time?: Date; + time?: string; /** * The height at which the upgrade must be performed. * Only used if Time is not set. @@ -330,7 +330,7 @@ export const Plan = { fromAmino(object: PlanAmino): Plan { return { name: object.name, - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, height: BigInt(object.height), info: object.info, upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined diff --git a/__fixtures__/v-next/outputv2/evmos/claims/v1/genesis.ts b/__fixtures__/v-next/outputv2/evmos/claims/v1/genesis.ts index f79d78d0e9..390716abbc 100644 --- a/__fixtures__/v-next/outputv2/evmos/claims/v1/genesis.ts +++ b/__fixtures__/v-next/outputv2/evmos/claims/v1/genesis.ts @@ -60,7 +60,7 @@ export interface ParamsAmino { /** enable claiming process */ enable_claims: boolean; /** timestamp of the airdrop start */ - airdrop_start_time?: Date; + airdrop_start_time?: string; /** duration until decay of claimable tokens begin */ duration_until_decay?: DurationAmino; /** duration of the token claim decay period */ @@ -348,7 +348,7 @@ export const Params = { fromAmino(object: ParamsAmino): Params { return { enableClaims: object.enable_claims, - airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), + airdropStartTime: object?.airdrop_start_time ? fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)) : undefined, durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimsDenom: object.claims_denom, diff --git a/__fixtures__/v-next/outputv2/evmos/epochs/v1/genesis.ts b/__fixtures__/v-next/outputv2/evmos/epochs/v1/genesis.ts index 28504d0c69..94cace6074 100644 --- a/__fixtures__/v-next/outputv2/evmos/epochs/v1/genesis.ts +++ b/__fixtures__/v-next/outputv2/evmos/epochs/v1/genesis.ts @@ -18,10 +18,10 @@ export interface EpochInfoProtoMsg { } export interface EpochInfoAmino { identifier: string; - start_time?: Date; + start_time?: string; duration?: DurationAmino; current_epoch: string; - current_epoch_start_time?: Date; + current_epoch_start_time?: string; epoch_counting_started: boolean; current_epoch_start_height: string; } @@ -194,10 +194,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), + currentEpochStartTime: object?.current_epoch_start_time ? fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)) : undefined, epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; diff --git a/__fixtures__/v-next/outputv2/evmos/incentives/v1/incentives.ts b/__fixtures__/v-next/outputv2/evmos/incentives/v1/incentives.ts index 5dd6c29dac..9f10733d70 100644 --- a/__fixtures__/v-next/outputv2/evmos/incentives/v1/incentives.ts +++ b/__fixtures__/v-next/outputv2/evmos/incentives/v1/incentives.ts @@ -35,7 +35,7 @@ export interface IncentiveAmino { /** number of remaining epochs */ epochs: number; /** distribution start time */ - start_time?: Date; + start_time?: string; /** cumulative gas spent by all gasmeters of the incentive during the epoch */ total_gas: string; } @@ -280,7 +280,7 @@ export const Incentive = { contract: object.contract, allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => DecCoin.fromAmino(e)) : [], epochs: object.epochs, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, totalGas: BigInt(object.total_gas) }; }, diff --git a/__fixtures__/v-next/outputv2/evmos/vesting/v1/tx.ts b/__fixtures__/v-next/outputv2/evmos/vesting/v1/tx.ts index 91b93fade8..5d98b55465 100644 --- a/__fixtures__/v-next/outputv2/evmos/vesting/v1/tx.ts +++ b/__fixtures__/v-next/outputv2/evmos/vesting/v1/tx.ts @@ -41,7 +41,7 @@ export interface MsgCreateClawbackVestingAccountAmino { /** to_address specifies the account to receive the funds */ to_address: string; /** start_time defines the time at which the vesting period begins */ - start_time?: Date; + start_time?: string; /** lockup_periods defines the unlocking schedule relative to the start_time */ lockup_periods: PeriodAmino[]; /** vesting_periods defines thevesting schedule relative to the start_time */ @@ -289,7 +289,7 @@ export const MsgCreateClawbackVestingAccount = { return { fromAddress: object.from_address, toAddress: object.to_address, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [], merge: object.merge diff --git a/__fixtures__/v-next/outputv2/evmos/vesting/v1/vesting.ts b/__fixtures__/v-next/outputv2/evmos/vesting/v1/vesting.ts index 8920a9b6b5..2f1c3fdfed 100644 --- a/__fixtures__/v-next/outputv2/evmos/vesting/v1/vesting.ts +++ b/__fixtures__/v-next/outputv2/evmos/vesting/v1/vesting.ts @@ -43,7 +43,7 @@ export interface ClawbackVestingAccountAmino { /** funder_address specifies the account which can perform clawback */ funder_address: string; /** start_time defines the time at which the vesting period begins */ - start_time?: Date; + start_time?: string; /** lockup_periods defines the unlocking schedule relative to the start_time */ lockup_periods: PeriodAmino[]; /** vesting_periods defines the vesting schedule relative to the start_time */ @@ -191,7 +191,7 @@ export const ClawbackVestingAccount = { return { baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined, funderAddress: object.funder_address, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [] }; diff --git a/__fixtures__/v-next/outputv2/google/api/distribution.ts b/__fixtures__/v-next/outputv2/google/api/distribution.ts index 06432e6a6c..d61257a45b 100644 --- a/__fixtures__/v-next/outputv2/google/api/distribution.ts +++ b/__fixtures__/v-next/outputv2/google/api/distribution.ts @@ -515,7 +515,7 @@ export interface Distribution_ExemplarAmino { */ value: number; /** The observation (sampling) time of the above value. */ - timestamp?: Date; + timestamp?: string; /** * Contextual information about the example value. Examples are: * diff --git a/__fixtures__/v-next/outputv2/google/api/expr/v1alpha1/syntax.ts b/__fixtures__/v-next/outputv2/google/api/expr/v1alpha1/syntax.ts index 99db4f397c..35afa2b8df 100644 --- a/__fixtures__/v-next/outputv2/google/api/expr/v1alpha1/syntax.ts +++ b/__fixtures__/v-next/outputv2/google/api/expr/v1alpha1/syntax.ts @@ -670,7 +670,7 @@ export interface ConstantAmino { * Deprecated: timestamp is no longer considered a builtin cel type. */ /** @deprecated */ - timestamp_value?: Date; + timestamp_value?: string; } export interface ConstantAminoMsg { type: "/google.api.expr.v1alpha1.Constant"; diff --git a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/log_entry.ts b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/log_entry.ts index 52dfa5359b..727e06dd70 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/log_entry.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/log_entry.ts @@ -106,7 +106,7 @@ export interface LogEntryAmino { * The time the event described by the log entry occurred. If * omitted, defaults to operation start time. */ - timestamp?: Date; + timestamp?: string; /** * The severity of the log entry. The default value is * `LogSeverity.DEFAULT`. diff --git a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/metric_value.ts b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/metric_value.ts index df646f9037..57332e3d15 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/metric_value.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/metric_value.ts @@ -81,13 +81,13 @@ export interface MetricValueAmino { * documentation in the service configuration for details. If not specified, * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used. */ - start_time?: Date; + start_time?: string; /** * The end of the time period over which this metric value's measurement * applies. If not specified, * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used. */ - end_time?: Date; + end_time?: string; /** A boolean value. */ bool_value?: boolean; /** A signed 64-bit integer value. */ diff --git a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/operation.ts b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/operation.ts index e38efbae0a..25de38a793 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/operation.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/operation.ts @@ -185,7 +185,7 @@ export interface OperationAmino { */ consumer_id: string; /** Required. Start time of the operation. */ - start_time?: Date; + start_time?: string; /** * End time of the operation. * Required when the operation is used in @@ -193,7 +193,7 @@ export interface OperationAmino { * but optional when the operation is used in * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check]. */ - end_time?: Date; + end_time?: string; /** * Labels describing the operation. Only the following labels are allowed: * diff --git a/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/resources.ts b/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/resources.ts index 41ae6b4dc4..aeff23a537 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/resources.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/resources.ts @@ -328,7 +328,7 @@ export interface OperationMetadataAmino { /** Percentage of completion of this operation, ranging from 0 to 100. */ progress_percentage: number; /** The start time of the operation. */ - start_time?: Date; + start_time?: string; } export interface OperationMetadataAminoMsg { type: "/google.api.servicemanagement.v1.OperationMetadata"; @@ -621,7 +621,7 @@ export interface RolloutAmino { */ rollout_id: string; /** Creation time of the rollout. Readonly. */ - create_time?: Date; + create_time?: string; /** The user who created the Rollout. Readonly. */ created_by: string; /** diff --git a/__fixtures__/v-next/outputv2/google/logging/v2/log_entry.ts b/__fixtures__/v-next/outputv2/google/logging/v2/log_entry.ts index c5e1438bad..f0251cdca1 100644 --- a/__fixtures__/v-next/outputv2/google/logging/v2/log_entry.ts +++ b/__fixtures__/v-next/outputv2/google/logging/v2/log_entry.ts @@ -246,9 +246,9 @@ export interface LogEntryAmino { * the past, and that don't exceed 24 hours in the future. Log entries outside * those time boundaries aren't ingested by Logging. */ - timestamp?: Date; + timestamp?: string; /** Output only. The time the log entry was received by Logging. */ - receive_timestamp?: Date; + receive_timestamp?: string; /** Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`. */ severity: LogSeverity; /** diff --git a/__fixtures__/v-next/outputv2/google/logging/v2/logging_config.ts b/__fixtures__/v-next/outputv2/google/logging/v2/logging_config.ts index d1e892d4d2..2eb22d3fc9 100644 --- a/__fixtures__/v-next/outputv2/google/logging/v2/logging_config.ts +++ b/__fixtures__/v-next/outputv2/google/logging/v2/logging_config.ts @@ -259,9 +259,9 @@ export interface LogBucketAmino { * Output only. The creation timestamp of the bucket. This is not set for any of the * default buckets. */ - create_time?: Date; + create_time?: string; /** Output only. The last update timestamp of the bucket. */ - update_time?: Date; + update_time?: string; /** * Logs will be retained by default for this amount of time, after which they * will automatically be deleted. The minimum retention period is 1 day. If @@ -364,9 +364,9 @@ export interface LogViewAmino { /** Describes this view. */ description: string; /** Output only. The creation timestamp of the view. */ - create_time?: Date; + create_time?: string; /** Output only. The last update timestamp of the view. */ - update_time?: Date; + update_time?: string; /** * Filter that restricts which log entries in a bucket are visible in this * view. @@ -629,13 +629,13 @@ export interface LogSinkAmino { * * This field may not be present for older sinks. */ - create_time?: Date; + create_time?: string; /** * Output only. The last update timestamp of the sink. * * This field may not be present for older sinks. */ - update_time?: Date; + update_time?: string; } export interface LogSinkAminoMsg { type: "/google.logging.v2.LogSink"; @@ -1880,13 +1880,13 @@ export interface LogExclusionAmino { * * This field may not be present for older exclusions. */ - create_time?: Date; + create_time?: string; /** * Output only. The last update timestamp of the exclusion. * * This field may not be present for older exclusions. */ - update_time?: Date; + update_time?: string; } export interface LogExclusionAminoMsg { type: "/google.logging.v2.LogExclusion"; @@ -2975,9 +2975,9 @@ export interface CopyLogEntriesMetadataProtoMsg { /** Metadata for CopyLogEntries long running operations. */ export interface CopyLogEntriesMetadataAmino { /** The create time of an operation. */ - start_time?: Date; + start_time?: string; /** The end time of an operation. */ - end_time?: Date; + end_time?: string; /** State of an operation. */ state: OperationState; /** Identifies whether the user has requested cancellation of the operation. */ diff --git a/__fixtures__/v-next/outputv2/google/logging/v2/logging_metrics.ts b/__fixtures__/v-next/outputv2/google/logging/v2/logging_metrics.ts index 18f4641e31..72febb3ab1 100644 --- a/__fixtures__/v-next/outputv2/google/logging/v2/logging_metrics.ts +++ b/__fixtures__/v-next/outputv2/google/logging/v2/logging_metrics.ts @@ -321,13 +321,13 @@ export interface LogMetricAmino { * * This field may not be present for older metrics. */ - create_time?: Date; + create_time?: string; /** * Output only. The last update timestamp of the metric. * * This field may not be present for older metrics. */ - update_time?: Date; + update_time?: string; /** * Deprecated. The API version that created or updated this metric. * The v2 format is used by default and cannot be changed. diff --git a/__fixtures__/v-next/outputv2/google/rpc/context/attribute_context.ts b/__fixtures__/v-next/outputv2/google/rpc/context/attribute_context.ts index 3a0ab93b04..4e6573de7c 100644 --- a/__fixtures__/v-next/outputv2/google/rpc/context/attribute_context.ts +++ b/__fixtures__/v-next/outputv2/google/rpc/context/attribute_context.ts @@ -597,7 +597,7 @@ export interface AttributeContext_RequestAmino { * The timestamp when the `destination` service receives the last byte of * the request. */ - time?: Date; + time?: string; /** The HTTP request size in bytes. If unknown, it must be -1. */ size: string; /** @@ -718,7 +718,7 @@ export interface AttributeContext_ResponseAmino { * The timestamp when the `destination` service sends the last byte of * the response. */ - time?: Date; + time?: string; /** * The length of time it takes the backend service to fully respond to a * request. Measured from when the destination service starts to send the @@ -948,18 +948,18 @@ export interface AttributeContext_ResourceAmino { * Output only. The timestamp when the resource was created. This may * be either the time creation was initiated or when it was completed. */ - create_time?: Date; + create_time?: string; /** * Output only. The timestamp when the resource was last updated. Any * change to the resource made by users must refresh this value. * Changes to a resource made by the service should refresh this value. */ - update_time?: Date; + update_time?: string; /** * Output only. The timestamp when the resource was deleted. * If the resource is not deleted, this must be empty. */ - delete_time?: Date; + delete_time?: string; /** * Output only. An opaque value that uniquely identifies a version or * generation of a resource. It can be used to confirm that the client diff --git a/__fixtures__/v-next/outputv2/ibc/lightclients/tendermint/v1/tendermint.ts b/__fixtures__/v-next/outputv2/ibc/lightclients/tendermint/v1/tendermint.ts index 2fd0cc0958..7d4b6d1b00 100644 --- a/__fixtures__/v-next/outputv2/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/__fixtures__/v-next/outputv2/ibc/lightclients/tendermint/v1/tendermint.ts @@ -140,7 +140,7 @@ export interface ConsensusStateAmino { * timestamp that corresponds to the block height in which the ConsensusState * was stored. */ - timestamp?: Date; + timestamp?: string; /** commitment root (i.e app hash) */ root?: MerkleRootAmino; next_validators_hash: Uint8Array; @@ -638,7 +638,7 @@ export const ConsensusState = { }, fromAmino(object: ConsensusStateAmino): ConsensusState { return { - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined, nextValidatorsHash: object.next_validators_hash }; diff --git a/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/params.ts b/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/params.ts index 8ea7272677..3f1304304b 100644 --- a/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/params.ts +++ b/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/params.ts @@ -17,7 +17,7 @@ export interface ParamsProtoMsg { } /** Params defines the claim module's parameters. */ export interface ParamsAmino { - airdrop_start_time?: Date; + airdrop_start_time?: string; duration_until_decay?: DurationAmino; duration_of_decay?: DurationAmino; /** denom of claimable asset */ @@ -132,7 +132,7 @@ export const Params = { }, fromAmino(object: ParamsAmino): Params { return { - airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), + airdropStartTime: object?.airdrop_start_time ? fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)) : undefined, durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimDenom: object.claim_denom diff --git a/__fixtures__/v-next/outputv2/osmosis/epochs/genesis.ts b/__fixtures__/v-next/outputv2/osmosis/epochs/genesis.ts index e457ed3325..62c5ced2a5 100644 --- a/__fixtures__/v-next/outputv2/osmosis/epochs/genesis.ts +++ b/__fixtures__/v-next/outputv2/osmosis/epochs/genesis.ts @@ -77,7 +77,7 @@ export interface EpochInfoAmino { * If start_time is in the future, the epoch will not begin until the start * time. */ - start_time?: Date; + start_time?: string; /** * duration is the time in between epoch ticks. * In order for intended behavior to be met, duration should @@ -111,7 +111,7 @@ export interface EpochInfoAmino { * * The t=34 block will start the epoch for (30, 35] * * The **t=36** block will start the epoch for (35, 40] */ - current_epoch_start_time?: Date; + current_epoch_start_time?: string; /** * epoch_counting_started is a boolean, that indicates whether this * epoch timer has began yet. @@ -297,10 +297,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), + currentEpochStartTime: object?.current_epoch_start_time ? fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)) : undefined, epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; diff --git a/__fixtures__/v-next/outputv2/osmosis/gamm/pool-models/balancer/balancerPool.ts b/__fixtures__/v-next/outputv2/osmosis/gamm/pool-models/balancer/balancerPool.ts index f24d61703c..c7909a0ea2 100644 --- a/__fixtures__/v-next/outputv2/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/__fixtures__/v-next/outputv2/osmosis/gamm/pool-models/balancer/balancerPool.ts @@ -66,7 +66,7 @@ export interface SmoothWeightChangeParamsAmino { * If a parameter change / pool instantiation leaves this blank, * it should be generated by the state_machine as the current time. */ - start_time?: Date; + start_time?: string; /** Duration for the weights to change over */ duration?: DurationAmino; /** @@ -380,7 +380,7 @@ export const SmoothWeightChangeParams = { }, fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { return { - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, initialPoolWeights: Array.isArray(object?.initial_pool_weights) ? object.initial_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [], targetPoolWeights: Array.isArray(object?.target_pool_weights) ? object.target_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [] diff --git a/__fixtures__/v-next/outputv2/osmosis/incentives/gauge.ts b/__fixtures__/v-next/outputv2/osmosis/incentives/gauge.ts index 51c94ec1ff..0aad1714a0 100644 --- a/__fixtures__/v-next/outputv2/osmosis/incentives/gauge.ts +++ b/__fixtures__/v-next/outputv2/osmosis/incentives/gauge.ts @@ -77,7 +77,7 @@ export interface GaugeAmino { */ coins: CoinAmino[]; /** start_time is the distribution start time */ - start_time?: Date; + start_time?: string; /** * num_epochs_paid_over is the number of total epochs distribution will be * completed over @@ -299,7 +299,7 @@ export const Gauge = { isPerpetual: object.is_perpetual, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, numEpochsPaidOver: BigInt(object.num_epochs_paid_over), filledEpochs: BigInt(object.filled_epochs), distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : [] diff --git a/__fixtures__/v-next/outputv2/osmosis/incentives/tx.ts b/__fixtures__/v-next/outputv2/osmosis/incentives/tx.ts index afeb668515..1ce5343c17 100644 --- a/__fixtures__/v-next/outputv2/osmosis/incentives/tx.ts +++ b/__fixtures__/v-next/outputv2/osmosis/incentives/tx.ts @@ -55,7 +55,7 @@ export interface MsgCreateGaugeAmino { /** coins are coin(s) to be distributed by the gauge */ coins: CoinAmino[]; /** start_time is the distribution start time */ - start_time?: Date; + start_time?: string; /** * num_epochs_paid_over is the number of epochs distribution will be completed * over @@ -263,7 +263,7 @@ export const MsgCreateGauge = { owner: object.owner, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, numEpochsPaidOver: BigInt(object.num_epochs_paid_over) }; }, diff --git a/__fixtures__/v-next/outputv2/osmosis/lockup/lock.ts b/__fixtures__/v-next/outputv2/osmosis/lockup/lock.ts index 8989c753bb..552c05185c 100644 --- a/__fixtures__/v-next/outputv2/osmosis/lockup/lock.ts +++ b/__fixtures__/v-next/outputv2/osmosis/lockup/lock.ts @@ -106,7 +106,7 @@ export interface PeriodLockAmino { * This value is first initialized when an unlock has started for the lock, * end time being block time + duration. */ - end_time?: Date; + end_time?: string; /** Coins are the tokens locked within the lock, kept in the module account. */ coins: CoinAmino[]; } @@ -176,7 +176,7 @@ export interface QueryConditionAmino { * Timestamp field must not be nil when the lock query type is `ByLockTime`. * Querying locks with timestamp is currently not implemented. */ - timestamp?: Date; + timestamp?: string; } export interface QueryConditionAminoMsg { type: "osmosis/lockup/query-condition"; @@ -246,7 +246,7 @@ export interface SyntheticLockAmino { * used for unbonding synthetic lockups, for active synthetic lockups, this * value is set to uninitialized value */ - end_time?: Date; + end_time?: string; /** * Duration is the duration for a synthetic lock to mature * at the point of unbonding has started. @@ -390,7 +390,7 @@ export const PeriodLock = { ID: BigInt(object.ID), owner: object.owner, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] }; }, @@ -528,7 +528,7 @@ export const QueryCondition = { lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object.denom, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: QueryCondition): QueryConditionAmino { @@ -661,7 +661,7 @@ export const SyntheticLock = { return { underlyingLockId: BigInt(object.underlying_lock_id), synthDenom: object.synth_denom, - endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined }; }, diff --git a/__fixtures__/v-next/outputv2/osmosis/lockup/query.ts b/__fixtures__/v-next/outputv2/osmosis/lockup/query.ts index 2d7bee88b3..e2ee5795d8 100644 --- a/__fixtures__/v-next/outputv2/osmosis/lockup/query.ts +++ b/__fixtures__/v-next/outputv2/osmosis/lockup/query.ts @@ -174,7 +174,7 @@ export interface AccountLockedPastTimeRequestProtoMsg { } export interface AccountLockedPastTimeRequestAmino { owner: string; - timestamp?: Date; + timestamp?: string; } export interface AccountLockedPastTimeRequestAminoMsg { type: "osmosis/lockup/account-locked-past-time-request"; @@ -211,7 +211,7 @@ export interface AccountLockedPastTimeNotUnlockingOnlyRequestProtoMsg { } export interface AccountLockedPastTimeNotUnlockingOnlyRequestAmino { owner: string; - timestamp?: Date; + timestamp?: string; } export interface AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg { type: "osmosis/lockup/account-locked-past-time-not-unlocking-only-request"; @@ -248,7 +248,7 @@ export interface AccountUnlockedBeforeTimeRequestProtoMsg { } export interface AccountUnlockedBeforeTimeRequestAmino { owner: string; - timestamp?: Date; + timestamp?: string; } export interface AccountUnlockedBeforeTimeRequestAminoMsg { type: "osmosis/lockup/account-unlocked-before-time-request"; @@ -286,7 +286,7 @@ export interface AccountLockedPastTimeDenomRequestProtoMsg { } export interface AccountLockedPastTimeDenomRequestAmino { owner: string; - timestamp?: Date; + timestamp?: string; denom: string; } export interface AccountLockedPastTimeDenomRequestAminoMsg { @@ -1576,7 +1576,7 @@ export const AccountLockedPastTimeRequest = { fromAmino(object: AccountLockedPastTimeRequestAmino): AccountLockedPastTimeRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: AccountLockedPastTimeRequest): AccountLockedPastTimeRequestAmino { @@ -1778,7 +1778,7 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino): AccountLockedPastTimeNotUnlockingOnlyRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyRequest): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { @@ -1980,7 +1980,7 @@ export const AccountUnlockedBeforeTimeRequest = { fromAmino(object: AccountUnlockedBeforeTimeRequestAmino): AccountUnlockedBeforeTimeRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: AccountUnlockedBeforeTimeRequest): AccountUnlockedBeforeTimeRequestAmino { @@ -2194,7 +2194,7 @@ export const AccountLockedPastTimeDenomRequest = { fromAmino(object: AccountLockedPastTimeDenomRequestAmino): AccountLockedPastTimeDenomRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, denom: object.denom }; }, diff --git a/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/query.ts b/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/query.ts index 42670bd9e7..53f48711f8 100644 --- a/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/query.ts @@ -19,8 +19,8 @@ export interface ArithmeticTwapRequestAmino { pool_id: string; base_asset: string; quote_asset: string; - start_time?: Date; - end_time?: Date; + start_time?: string; + end_time?: string; } export interface ArithmeticTwapRequestAminoMsg { type: "osmosis/twap/arithmetic-twap-request"; @@ -64,7 +64,7 @@ export interface ArithmeticTwapToNowRequestAmino { pool_id: string; base_asset: string; quote_asset: string; - start_time?: Date; + start_time?: string; } export interface ArithmeticTwapToNowRequestAminoMsg { type: "osmosis/twap/arithmetic-twap-to-now-request"; @@ -232,7 +232,7 @@ export const ArithmeticTwapRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined }; }, @@ -454,7 +454,7 @@ export const ArithmeticTwapToNowRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)) + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined }; }, toAmino(message: ArithmeticTwapToNowRequest): ArithmeticTwapToNowRequestAmino { diff --git a/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/twap_record.ts b/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/twap_record.ts index 7900f534cf..d3d69bafb2 100644 --- a/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/twap_record.ts +++ b/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/twap_record.ts @@ -65,7 +65,7 @@ export interface TwapRecordAmino { * This field should only exist until we have a global registry in the state * machine, mapping prior block heights within {TIME RANGE} to times. */ - time?: Date; + time?: string; /** * We store the last spot prices in the struct, so that we can interpolate * accumulator values for times between when accumulator records are stored. @@ -79,7 +79,7 @@ export interface TwapRecordAmino { * It is used to alert the caller if they are getting a potentially erroneous * TWAP, due to an unforeseen underlying error. */ - last_error_time?: Date; + last_error_time?: string; } export interface TwapRecordAminoMsg { type: "osmosis/twap/twap-record"; @@ -280,12 +280,12 @@ export const TwapRecord = { asset0Denom: object.asset0_denom, asset1Denom: object.asset1_denom, height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, p0LastSpotPrice: object.p0_last_spot_price, p1LastSpotPrice: object.p1_last_spot_price, p0ArithmeticTwapAccumulator: object.p0_arithmetic_twap_accumulator, p1ArithmeticTwapAccumulator: object.p1_arithmetic_twap_accumulator, - lastErrorTime: fromTimestamp(Timestamp.fromAmino(object.last_error_time)) + lastErrorTime: object?.last_error_time ? fromTimestamp(Timestamp.fromAmino(object.last_error_time)) : undefined }; }, toAmino(message: TwapRecord): TwapRecordAmino { diff --git a/__fixtures__/v-next/outputv2/tendermint/abci/types.ts b/__fixtures__/v-next/outputv2/tendermint/abci/types.ts index 3f70299525..b2e241ba08 100644 --- a/__fixtures__/v-next/outputv2/tendermint/abci/types.ts +++ b/__fixtures__/v-next/outputv2/tendermint/abci/types.ts @@ -346,7 +346,7 @@ export interface RequestInitChainProtoMsg { value: Uint8Array; } export interface RequestInitChainAmino { - time?: Date; + time?: string; chain_id: string; consensus_params?: ConsensusParamsAmino; validators: ValidatorUpdateAmino[]; @@ -1328,7 +1328,7 @@ export interface EvidenceAmino { /** The height when the offense occurred */ height: string; /** The corresponding time where the offense occurred */ - time?: Date; + time?: string; /** * Total voting power of the validator set in case the ABCI application does * not store historical validators. @@ -2175,7 +2175,7 @@ export const RequestInitChain = { }, fromAmino(object: RequestInitChainAmino): RequestInitChain { return { - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, chainId: object.chain_id, consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], @@ -6501,7 +6501,7 @@ export const Evidence = { type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, totalVotingPower: BigInt(object.total_voting_power) }; }, diff --git a/__fixtures__/v-next/outputv2/tendermint/p2p/types.ts b/__fixtures__/v-next/outputv2/tendermint/p2p/types.ts index e2b5e66a8d..7457d03ce7 100644 --- a/__fixtures__/v-next/outputv2/tendermint/p2p/types.ts +++ b/__fixtures__/v-next/outputv2/tendermint/p2p/types.ts @@ -95,7 +95,7 @@ export interface PeerInfoProtoMsg { export interface PeerInfoAmino { id: string; address_info: PeerAddressInfoAmino[]; - last_connected?: Date; + last_connected?: string; } export interface PeerInfoAminoMsg { type: "/tendermint.p2p.PeerInfo"; @@ -118,8 +118,8 @@ export interface PeerAddressInfoProtoMsg { } export interface PeerAddressInfoAmino { address: string; - last_dial_success?: Date; - last_dial_failure?: Date; + last_dial_success?: string; + last_dial_failure?: string; dial_failures: number; } export interface PeerAddressInfoAminoMsg { diff --git a/__fixtures__/v-next/outputv2/tendermint/types/evidence.ts b/__fixtures__/v-next/outputv2/tendermint/types/evidence.ts index a0ef739376..2d061e6202 100644 --- a/__fixtures__/v-next/outputv2/tendermint/types/evidence.ts +++ b/__fixtures__/v-next/outputv2/tendermint/types/evidence.ts @@ -42,7 +42,7 @@ export interface DuplicateVoteEvidenceAmino { vote_b?: VoteAmino; total_voting_power: string; validator_power: string; - timestamp?: Date; + timestamp?: string; } export interface DuplicateVoteEvidenceAminoMsg { type: "/tendermint.types.DuplicateVoteEvidence"; @@ -74,7 +74,7 @@ export interface LightClientAttackEvidenceAmino { common_height: string; byzantine_validators: ValidatorAmino[]; total_voting_power: string; - timestamp?: Date; + timestamp?: string; } export interface LightClientAttackEvidenceAminoMsg { type: "/tendermint.types.LightClientAttackEvidence"; @@ -321,7 +321,7 @@ export const DuplicateVoteEvidence = { voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, totalVotingPower: BigInt(object.total_voting_power), validatorPower: BigInt(object.validator_power), - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { @@ -472,7 +472,7 @@ export const LightClientAttackEvidence = { commonHeight: BigInt(object.common_height), byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], totalVotingPower: BigInt(object.total_voting_power), - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { diff --git a/__fixtures__/v-next/outputv2/tendermint/types/types.ts b/__fixtures__/v-next/outputv2/tendermint/types/types.ts index 944f722882..aa3b9f969a 100644 --- a/__fixtures__/v-next/outputv2/tendermint/types/types.ts +++ b/__fixtures__/v-next/outputv2/tendermint/types/types.ts @@ -202,7 +202,7 @@ export interface HeaderAmino { version?: ConsensusAmino; chain_id: string; height: string; - time?: Date; + time?: string; /** prev block info */ last_block_id?: BlockIDAmino; /** hashes of block data */ @@ -302,7 +302,7 @@ export interface VoteAmino { round: number; /** zero if vote is nil. */ block_id?: BlockIDAmino; - timestamp?: Date; + timestamp?: string; validator_address: Uint8Array; validator_index: number; signature: Uint8Array; @@ -369,7 +369,7 @@ export interface CommitSigProtoMsg { export interface CommitSigAmino { block_id_flag: BlockIDFlag; validator_address: Uint8Array; - timestamp?: Date; + timestamp?: string; signature: Uint8Array; } export interface CommitSigAminoMsg { @@ -402,7 +402,7 @@ export interface ProposalAmino { round: number; pol_round: number; block_id?: BlockIDAmino; - timestamp?: Date; + timestamp?: string; signature: Uint8Array; } export interface ProposalAminoMsg { @@ -1035,7 +1035,7 @@ export const Header = { version: object?.version ? Consensus.fromAmino(object.version) : undefined, chainId: object.chain_id, height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, lastCommitHash: object.last_commit_hash, dataHash: object.data_hash, @@ -1324,7 +1324,7 @@ export const Vote = { height: BigInt(object.height), round: object.round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, validatorAddress: object.validator_address, validatorIndex: object.validator_index, signature: object.signature @@ -1592,7 +1592,7 @@ export const CommitSig = { return { blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object.validator_address, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, signature: object.signature }; }, @@ -1758,7 +1758,7 @@ export const Proposal = { round: object.round, polRound: object.pol_round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, signature: object.signature }; }, diff --git a/__fixtures__/v-next/outputv3/cosmos/authz/v1beta1/authz.ts b/__fixtures__/v-next/outputv3/cosmos/authz/v1beta1/authz.ts index fee8819e8a..d6135b2039 100644 --- a/__fixtures__/v-next/outputv3/cosmos/authz/v1beta1/authz.ts +++ b/__fixtures__/v-next/outputv3/cosmos/authz/v1beta1/authz.ts @@ -71,7 +71,7 @@ export interface GrantAmino { * doesn't have a time expiration (other conditions in `authorization` * may apply to invalidate the grant) */ - expiration?: Date; + expiration?: string; } /** * Grant gives permissions to execute @@ -106,7 +106,7 @@ export interface GrantAuthorizationAmino { granter: string; grantee: string; authorization?: AnyAmino; - expiration?: Date; + expiration?: string; } /** * GrantAuthorization extends a grant with both the addresses of the grantee and granter. diff --git a/__fixtures__/v-next/outputv3/cosmos/evidence/v1beta1/evidence.ts b/__fixtures__/v-next/outputv3/cosmos/evidence/v1beta1/evidence.ts index 014aed9647..c404e654ca 100644 --- a/__fixtures__/v-next/outputv3/cosmos/evidence/v1beta1/evidence.ts +++ b/__fixtures__/v-next/outputv3/cosmos/evidence/v1beta1/evidence.ts @@ -22,7 +22,7 @@ export interface EquivocationProtoMsg { */ export interface EquivocationAmino { height: string; - time?: Date; + time?: string; power: string; consensus_address: string; } @@ -135,7 +135,7 @@ export const Equivocation = { fromAmino(object: EquivocationAmino): Equivocation { return { height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, power: BigInt(object.power), consensusAddress: object.consensus_address }; diff --git a/__fixtures__/v-next/outputv3/cosmos/feegrant/v1beta1/feegrant.ts b/__fixtures__/v-next/outputv3/cosmos/feegrant/v1beta1/feegrant.ts index 85b5073bb1..0e6bf1ba3b 100644 --- a/__fixtures__/v-next/outputv3/cosmos/feegrant/v1beta1/feegrant.ts +++ b/__fixtures__/v-next/outputv3/cosmos/feegrant/v1beta1/feegrant.ts @@ -36,7 +36,7 @@ export interface BasicAllowanceAmino { */ spend_limit: CoinAmino[]; /** expiration specifies an optional time when this allowance expires */ - expiration?: Date; + expiration?: string; } /** * BasicAllowance implements Allowance with a one-time grant of tokens @@ -102,7 +102,7 @@ export interface PeriodicAllowanceAmino { * it is calculated from the start time of the first transaction after the * last period ended */ - period_reset?: Date; + period_reset?: string; } /** * PeriodicAllowance extends Allowance to allow for both a maximum cap, @@ -412,7 +412,7 @@ export const PeriodicAllowance = { period: object?.period ? Duration.fromAmino(object.period) : undefined, periodSpendLimit: Array.isArray(object?.period_spend_limit) ? object.period_spend_limit.map((e: any) => Coin.fromAmino(e)) : [], periodCanSpend: Array.isArray(object?.period_can_spend) ? object.period_can_spend.map((e: any) => Coin.fromAmino(e)) : [], - periodReset: fromTimestamp(Timestamp.fromAmino(object.period_reset)) + periodReset: object?.period_reset ? fromTimestamp(Timestamp.fromAmino(object.period_reset)) : undefined }; }, toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { diff --git a/__fixtures__/v-next/outputv3/cosmos/gov/v1/gov.ts b/__fixtures__/v-next/outputv3/cosmos/gov/v1/gov.ts index 1874e6bf5f..c0364b58ea 100644 --- a/__fixtures__/v-next/outputv3/cosmos/gov/v1/gov.ts +++ b/__fixtures__/v-next/outputv3/cosmos/gov/v1/gov.ts @@ -223,11 +223,11 @@ export interface ProposalAmino { * proposal's voting period has ended. */ final_tally_result?: TallyResultAmino; - submit_time?: Date; - deposit_end_time?: Date; + submit_time?: string; + deposit_end_time?: string; total_deposit: CoinAmino[]; - voting_start_time?: Date; - voting_end_time?: Date; + voting_start_time?: string; + voting_end_time?: string; /** metadata is any arbitrary metadata attached to the proposal. */ metadata: string; } diff --git a/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/gov.ts b/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/gov.ts index 5d87c4d97d..cf818986fe 100644 --- a/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/gov.ts @@ -272,11 +272,11 @@ export interface ProposalAmino { * proposal's voting period has ended. */ final_tally_result?: TallyResultAmino; - submit_time?: Date; - deposit_end_time?: Date; + submit_time?: string; + deposit_end_time?: string; total_deposit: CoinAmino[]; - voting_start_time?: Date; - voting_end_time?: Date; + voting_start_time?: string; + voting_end_time?: string; } /** Proposal defines the core field members of a governance proposal. */ export interface ProposalSDKType { @@ -931,11 +931,11 @@ export const Proposal = { content: object?.content ? ProposalContentI_FromAmino(object.content) : undefined, status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), - depositEndTime: fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)), + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined, + depositEndTime: object?.deposit_end_time ? fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)) : undefined, totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: fromTimestamp(Timestamp.fromAmino(object.voting_start_time)), - votingEndTime: fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) + votingStartTime: object?.voting_start_time ? fromTimestamp(Timestamp.fromAmino(object.voting_start_time)) : undefined, + votingEndTime: object?.voting_end_time ? fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) : undefined }; }, toAmino(message: Proposal): ProposalAmino { diff --git a/__fixtures__/v-next/outputv3/cosmos/group/v1/types.ts b/__fixtures__/v-next/outputv3/cosmos/group/v1/types.ts index 12fe5c5172..b79859cc45 100644 --- a/__fixtures__/v-next/outputv3/cosmos/group/v1/types.ts +++ b/__fixtures__/v-next/outputv3/cosmos/group/v1/types.ts @@ -247,7 +247,7 @@ export interface MemberAmino { /** metadata is any arbitrary metadata to attached to the member. */ metadata: string; /** added_at is a timestamp specifying when a member was added. */ - added_at?: Date; + added_at?: string; } /** * Member represents a group member with an account address, @@ -422,7 +422,7 @@ export interface GroupInfoAmino { /** total_weight is the sum of the group members' weights. */ total_weight: string; /** created_at is a timestamp specifying when a group was created. */ - created_at?: Date; + created_at?: string; } /** GroupInfo represents the high-level on-chain information for a group. */ export interface GroupInfoSDKType { @@ -501,7 +501,7 @@ export interface GroupPolicyInfoAmino { /** decision_policy specifies the group policy's decision policy. */ decision_policy?: AnyAmino; /** created_at is a timestamp specifying when a group policy was created. */ - created_at?: Date; + created_at?: string; } /** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ export interface GroupPolicyInfoSDKType { @@ -587,7 +587,7 @@ export interface ProposalAmino { /** proposers are the account addresses of the proposers. */ proposers: string[]; /** submit_time is a timestamp specifying when a proposal was submitted. */ - submit_time?: Date; + submit_time?: string; /** * group_version tracks the version of the group that this proposal corresponds to. * When group membership is changed, existing proposals from previous group versions will become invalid. @@ -619,7 +619,7 @@ export interface ProposalAmino { * at this point, and the `final_tally_result`, as well * as `status` and `result` fields will be accordingly updated. */ - voting_period_end?: Date; + voting_period_end?: string; /** executor_result is the final result based on the votes and election rule. Initial value is NotRun. */ executor_result: ProposalExecutorResult; /** messages is a list of Msgs that will be executed if the proposal passes. */ @@ -707,7 +707,7 @@ export interface VoteAmino { /** metadata is any arbitrary metadata to attached to the vote. */ metadata: string; /** submit_time is the timestamp when the vote was submitted. */ - submit_time?: Date; + submit_time?: string; } /** Vote represents a vote for a proposal. */ export interface VoteSDKType { @@ -814,7 +814,7 @@ export const Member = { address: object.address, weight: object.weight, metadata: object.metadata, - addedAt: fromTimestamp(Timestamp.fromAmino(object.added_at)) + addedAt: object?.added_at ? fromTimestamp(Timestamp.fromAmino(object.added_at)) : undefined }; }, toAmino(message: Member): MemberAmino { @@ -1345,7 +1345,7 @@ export const GroupInfo = { metadata: object.metadata, version: BigInt(object.version), totalWeight: object.total_weight, - createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) + createdAt: object?.created_at ? fromTimestamp(Timestamp.fromAmino(object.created_at)) : undefined }; }, toAmino(message: GroupInfo): GroupInfoAmino { @@ -1610,7 +1610,7 @@ export const GroupPolicyInfo = { metadata: object.metadata, version: BigInt(object.version), decisionPolicy: object?.decision_policy ? DecisionPolicy_FromAmino(object.decision_policy) : undefined, - createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) + createdAt: object?.created_at ? fromTimestamp(Timestamp.fromAmino(object.created_at)) : undefined }; }, toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { @@ -1867,13 +1867,13 @@ export const Proposal = { address: object.address, metadata: object.metadata, proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], - submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined, groupVersion: BigInt(object.group_version), groupPolicyVersion: BigInt(object.group_policy_version), status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - votingPeriodEnd: fromTimestamp(Timestamp.fromAmino(object.voting_period_end)), + votingPeriodEnd: object?.voting_period_end ? fromTimestamp(Timestamp.fromAmino(object.voting_period_end)) : undefined, executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] }; @@ -2149,7 +2149,7 @@ export const Vote = { voter: object.voter, option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata, - submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)) + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined }; }, toAmino(message: Vote): VoteAmino { diff --git a/__fixtures__/v-next/outputv3/cosmos/slashing/v1beta1/slashing.ts b/__fixtures__/v-next/outputv3/cosmos/slashing/v1beta1/slashing.ts index 2f76e73d9d..75651c24ff 100644 --- a/__fixtures__/v-next/outputv3/cosmos/slashing/v1beta1/slashing.ts +++ b/__fixtures__/v-next/outputv3/cosmos/slashing/v1beta1/slashing.ts @@ -49,7 +49,7 @@ export interface ValidatorSigningInfoAmino { */ index_offset: string; /** Timestamp until which the validator is jailed due to liveness downtime. */ - jailed_until?: Date; + jailed_until?: string; /** * Whether or not a validator has been tombstoned (killed out of validator set). It is set * once the validator commits an equivocation or for any other configured misbehiavor. @@ -228,7 +228,7 @@ export const ValidatorSigningInfo = { address: object.address, startHeight: BigInt(object.start_height), indexOffset: BigInt(object.index_offset), - jailedUntil: fromTimestamp(Timestamp.fromAmino(object.jailed_until)), + jailedUntil: object?.jailed_until ? fromTimestamp(Timestamp.fromAmino(object.jailed_until)) : undefined, tombstoned: object.tombstoned, missedBlocksCounter: BigInt(object.missed_blocks_counter) }; diff --git a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/staking.ts b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/staking.ts index 4990fc0279..f19da37d73 100644 --- a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/staking.ts @@ -144,7 +144,7 @@ export interface CommissionAmino { /** commission_rates defines the initial commission rates to be used for creating a validator. */ commission_rates?: CommissionRatesAmino; /** update_time is the last time the commission rate was changed. */ - update_time?: Date; + update_time?: string; } /** Commission defines commission parameters for a given validator. */ export interface CommissionSDKType { @@ -258,7 +258,7 @@ export interface ValidatorAmino { /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ unbonding_height: string; /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ - unbonding_time?: Date; + unbonding_time?: string; /** commission defines the commission parameters. */ commission?: CommissionAmino; /** min_self_delegation is the validator's self declared minimum self delegation. */ @@ -500,7 +500,7 @@ export interface UnbondingDelegationEntryAmino { /** creation_height is the height which the unbonding took place. */ creation_height: string; /** completion_time is the unix time for unbonding completion. */ - completion_time?: Date; + completion_time?: string; /** initial_balance defines the tokens initially scheduled to receive at completion. */ initial_balance: string; /** balance defines the tokens to receive at completion. */ @@ -533,7 +533,7 @@ export interface RedelegationEntryAmino { /** creation_height defines the height which the redelegation took place. */ creation_height: string; /** completion_time defines the unix time for redelegation completion. */ - completion_time?: Date; + completion_time?: string; /** initial_balance defines the initial balance when redelegation started. */ initial_balance: string; /** shares_dst is the amount of destination-validator shares created by redelegation. */ @@ -1036,7 +1036,7 @@ export const Commission = { fromAmino(object: CommissionAmino): Commission { return { commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: fromTimestamp(Timestamp.fromAmino(object.update_time)) + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined }; }, toAmino(message: Commission): CommissionAmino { @@ -1387,7 +1387,7 @@ export const Validator = { delegatorShares: object.delegator_shares, description: object?.description ? Description.fromAmino(object.description) : undefined, unbondingHeight: BigInt(object.unbonding_height), - unbondingTime: fromTimestamp(Timestamp.fromAmino(object.unbonding_time)), + unbondingTime: object?.unbonding_time ? fromTimestamp(Timestamp.fromAmino(object.unbonding_time)) : undefined, commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, minSelfDelegation: object.min_self_delegation }; @@ -2216,7 +2216,7 @@ export const UnbondingDelegationEntry = { fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined, initialBalance: object.initial_balance, balance: object.balance }; @@ -2339,7 +2339,7 @@ export const RedelegationEntry = { fromAmino(object: RedelegationEntryAmino): RedelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined, initialBalance: object.initial_balance, sharesDst: object.shares_dst }; diff --git a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts index 5cc88b4811..8f1b84e263 100644 --- a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts @@ -186,7 +186,7 @@ export interface MsgBeginRedelegateResponseProtoMsg { } /** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ export interface MsgBeginRedelegateResponseAmino { - completion_time?: Date; + completion_time?: string; } /** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ export interface MsgBeginRedelegateResponseSDKType { @@ -233,7 +233,7 @@ export interface MsgUndelegateResponseProtoMsg { } /** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponseAmino { - completion_time?: Date; + completion_time?: string; } /** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponseSDKType { @@ -1009,7 +1009,7 @@ export const MsgBeginRedelegateResponse = { }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { return { - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined }; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { @@ -1197,7 +1197,7 @@ export const MsgUndelegateResponse = { }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { return { - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined }; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { diff --git a/__fixtures__/v-next/outputv3/cosmos/upgrade/v1beta1/upgrade.ts b/__fixtures__/v-next/outputv3/cosmos/upgrade/v1beta1/upgrade.ts index 8e3a11ff78..6a2476ccad 100644 --- a/__fixtures__/v-next/outputv3/cosmos/upgrade/v1beta1/upgrade.ts +++ b/__fixtures__/v-next/outputv3/cosmos/upgrade/v1beta1/upgrade.ts @@ -62,7 +62,7 @@ export interface PlanAmino { * If this field is not empty, an error will be thrown. */ /** @deprecated */ - time?: Date; + time?: string; /** * The height at which the upgrade must be performed. * Only used if Time is not set. @@ -314,7 +314,7 @@ export const Plan = { fromAmino(object: PlanAmino): Plan { return { name: object.name, - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, height: BigInt(object.height), info: object.info, upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined diff --git a/__fixtures__/v-next/outputv3/evmos/claims/v1/genesis.ts b/__fixtures__/v-next/outputv3/evmos/claims/v1/genesis.ts index 89cafdfad8..5d864e4557 100644 --- a/__fixtures__/v-next/outputv3/evmos/claims/v1/genesis.ts +++ b/__fixtures__/v-next/outputv3/evmos/claims/v1/genesis.ts @@ -56,7 +56,7 @@ export interface ParamsAmino { /** enable claiming process */ enable_claims: boolean; /** timestamp of the airdrop start */ - airdrop_start_time?: Date; + airdrop_start_time?: string; /** duration until decay of claimable tokens begin */ duration_until_decay?: DurationAmino; /** duration of the token claim decay period */ @@ -337,7 +337,7 @@ export const Params = { fromAmino(object: ParamsAmino): Params { return { enableClaims: object.enable_claims, - airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), + airdropStartTime: object?.airdrop_start_time ? fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)) : undefined, durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimsDenom: object.claims_denom, diff --git a/__fixtures__/v-next/outputv3/evmos/epochs/v1/genesis.ts b/__fixtures__/v-next/outputv3/evmos/epochs/v1/genesis.ts index 7e5f6a2f51..8ae1ee996c 100644 --- a/__fixtures__/v-next/outputv3/evmos/epochs/v1/genesis.ts +++ b/__fixtures__/v-next/outputv3/evmos/epochs/v1/genesis.ts @@ -18,10 +18,10 @@ export interface EpochInfoProtoMsg { } export interface EpochInfoAmino { identifier: string; - start_time?: Date; + start_time?: string; duration?: DurationAmino; current_epoch: string; - current_epoch_start_time?: Date; + current_epoch_start_time?: string; epoch_counting_started: boolean; current_epoch_start_height: string; } @@ -186,10 +186,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), + currentEpochStartTime: object?.current_epoch_start_time ? fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)) : undefined, epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; diff --git a/__fixtures__/v-next/outputv3/evmos/incentives/v1/incentives.ts b/__fixtures__/v-next/outputv3/evmos/incentives/v1/incentives.ts index a246edc744..16a7d95071 100644 --- a/__fixtures__/v-next/outputv3/evmos/incentives/v1/incentives.ts +++ b/__fixtures__/v-next/outputv3/evmos/incentives/v1/incentives.ts @@ -35,7 +35,7 @@ export interface IncentiveAmino { /** number of remaining epochs */ epochs: number; /** distribution start time */ - start_time?: Date; + start_time?: string; /** cumulative gas spent by all gasmeters of the incentive during the epoch */ total_gas: string; } @@ -264,7 +264,7 @@ export const Incentive = { contract: object.contract, allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => DecCoin.fromAmino(e)) : [], epochs: object.epochs, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, totalGas: BigInt(object.total_gas) }; }, diff --git a/__fixtures__/v-next/outputv3/evmos/vesting/v1/tx.ts b/__fixtures__/v-next/outputv3/evmos/vesting/v1/tx.ts index 2d3f98842c..b1acaadeb3 100644 --- a/__fixtures__/v-next/outputv3/evmos/vesting/v1/tx.ts +++ b/__fixtures__/v-next/outputv3/evmos/vesting/v1/tx.ts @@ -41,7 +41,7 @@ export interface MsgCreateClawbackVestingAccountAmino { /** to_address specifies the account to receive the funds */ to_address: string; /** start_time defines the time at which the vesting period begins */ - start_time?: Date; + start_time?: string; /** lockup_periods defines the unlocking schedule relative to the start_time */ lockup_periods: PeriodAmino[]; /** vesting_periods defines thevesting schedule relative to the start_time */ @@ -273,7 +273,7 @@ export const MsgCreateClawbackVestingAccount = { return { fromAddress: object.from_address, toAddress: object.to_address, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [], merge: object.merge diff --git a/__fixtures__/v-next/outputv3/evmos/vesting/v1/vesting.ts b/__fixtures__/v-next/outputv3/evmos/vesting/v1/vesting.ts index 4eae89658a..21af49ae66 100644 --- a/__fixtures__/v-next/outputv3/evmos/vesting/v1/vesting.ts +++ b/__fixtures__/v-next/outputv3/evmos/vesting/v1/vesting.ts @@ -43,7 +43,7 @@ export interface ClawbackVestingAccountAmino { /** funder_address specifies the account which can perform clawback */ funder_address: string; /** start_time defines the time at which the vesting period begins */ - start_time?: Date; + start_time?: string; /** lockup_periods defines the unlocking schedule relative to the start_time */ lockup_periods: PeriodAmino[]; /** vesting_periods defines the vesting schedule relative to the start_time */ @@ -187,7 +187,7 @@ export const ClawbackVestingAccount = { return { baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined, funderAddress: object.funder_address, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [] }; diff --git a/__fixtures__/v-next/outputv3/google/api/distribution.ts b/__fixtures__/v-next/outputv3/google/api/distribution.ts index 74982affac..625584cd2c 100644 --- a/__fixtures__/v-next/outputv3/google/api/distribution.ts +++ b/__fixtures__/v-next/outputv3/google/api/distribution.ts @@ -491,7 +491,7 @@ export interface Distribution_ExemplarAmino { */ value: number; /** The observation (sampling) time of the above value. */ - timestamp?: Date; + timestamp?: string; /** * Contextual information about the example value. Examples are: * diff --git a/__fixtures__/v-next/outputv3/google/api/expr/v1alpha1/syntax.ts b/__fixtures__/v-next/outputv3/google/api/expr/v1alpha1/syntax.ts index 309cf87172..0256663728 100644 --- a/__fixtures__/v-next/outputv3/google/api/expr/v1alpha1/syntax.ts +++ b/__fixtures__/v-next/outputv3/google/api/expr/v1alpha1/syntax.ts @@ -634,7 +634,7 @@ export interface ConstantAmino { * Deprecated: timestamp is no longer considered a builtin cel type. */ /** @deprecated */ - timestamp_value?: Date; + timestamp_value?: string; } /** * Represents a primitive literal. diff --git a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/log_entry.ts b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/log_entry.ts index 1305303ce6..b7d0481b76 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/log_entry.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/log_entry.ts @@ -102,7 +102,7 @@ export interface LogEntryAmino { * The time the event described by the log entry occurred. If * omitted, defaults to operation start time. */ - timestamp?: Date; + timestamp?: string; /** * The severity of the log entry. The default value is * `LogSeverity.DEFAULT`. diff --git a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/metric_value.ts b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/metric_value.ts index 6b3621661c..88f9a4df23 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/metric_value.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/metric_value.ts @@ -77,13 +77,13 @@ export interface MetricValueAmino { * documentation in the service configuration for details. If not specified, * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used. */ - start_time?: Date; + start_time?: string; /** * The end of the time period over which this metric value's measurement * applies. If not specified, * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used. */ - end_time?: Date; + end_time?: string; /** A boolean value. */ bool_value?: boolean; /** A signed 64-bit integer value. */ diff --git a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/operation.ts b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/operation.ts index 0b1cce01bf..242bd1a142 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/operation.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/operation.ts @@ -181,7 +181,7 @@ export interface OperationAmino { */ consumer_id: string; /** Required. Start time of the operation. */ - start_time?: Date; + start_time?: string; /** * End time of the operation. * Required when the operation is used in @@ -189,7 +189,7 @@ export interface OperationAmino { * but optional when the operation is used in * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check]. */ - end_time?: Date; + end_time?: string; /** * Labels describing the operation. Only the following labels are allowed: * diff --git a/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/resources.ts b/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/resources.ts index 3998e8feda..94cf9c550d 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/resources.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/resources.ts @@ -324,7 +324,7 @@ export interface OperationMetadataAmino { /** Percentage of completion of this operation, ranging from 0 to 100. */ progress_percentage: number; /** The start time of the operation. */ - start_time?: Date; + start_time?: string; } /** The metadata associated with a long running operation resource. */ export interface OperationMetadataSDKType { @@ -589,7 +589,7 @@ export interface RolloutAmino { */ rollout_id: string; /** Creation time of the rollout. Readonly. */ - create_time?: Date; + create_time?: string; /** The user who created the Rollout. Readonly. */ created_by: string; /** diff --git a/__fixtures__/v-next/outputv3/google/logging/v2/log_entry.ts b/__fixtures__/v-next/outputv3/google/logging/v2/log_entry.ts index c58380bd78..33624d164d 100644 --- a/__fixtures__/v-next/outputv3/google/logging/v2/log_entry.ts +++ b/__fixtures__/v-next/outputv3/google/logging/v2/log_entry.ts @@ -242,9 +242,9 @@ export interface LogEntryAmino { * the past, and that don't exceed 24 hours in the future. Log entries outside * those time boundaries aren't ingested by Logging. */ - timestamp?: Date; + timestamp?: string; /** Output only. The time the log entry was received by Logging. */ - receive_timestamp?: Date; + receive_timestamp?: string; /** Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`. */ severity: LogSeverity; /** diff --git a/__fixtures__/v-next/outputv3/google/logging/v2/logging_config.ts b/__fixtures__/v-next/outputv3/google/logging/v2/logging_config.ts index af656084b6..3e838e79e7 100644 --- a/__fixtures__/v-next/outputv3/google/logging/v2/logging_config.ts +++ b/__fixtures__/v-next/outputv3/google/logging/v2/logging_config.ts @@ -259,9 +259,9 @@ export interface LogBucketAmino { * Output only. The creation timestamp of the bucket. This is not set for any of the * default buckets. */ - create_time?: Date; + create_time?: string; /** Output only. The last update timestamp of the bucket. */ - update_time?: Date; + update_time?: string; /** * Logs will be retained by default for this amount of time, after which they * will automatically be deleted. The minimum retention period is 1 day. If @@ -360,9 +360,9 @@ export interface LogViewAmino { /** Describes this view. */ description: string; /** Output only. The creation timestamp of the view. */ - create_time?: Date; + create_time?: string; /** Output only. The last update timestamp of the view. */ - update_time?: Date; + update_time?: string; /** * Filter that restricts which log entries in a bucket are visible in this * view. @@ -621,13 +621,13 @@ export interface LogSinkAmino { * * This field may not be present for older sinks. */ - create_time?: Date; + create_time?: string; /** * Output only. The last update timestamp of the sink. * * This field may not be present for older sinks. */ - update_time?: Date; + update_time?: string; } /** * Describes a sink used to export log entries to one of the following @@ -1788,13 +1788,13 @@ export interface LogExclusionAmino { * * This field may not be present for older exclusions. */ - create_time?: Date; + create_time?: string; /** * Output only. The last update timestamp of the exclusion. * * This field may not be present for older exclusions. */ - update_time?: Date; + update_time?: string; } /** * Specifies a set of log entries that are filtered out by a sink. If @@ -2827,9 +2827,9 @@ export interface CopyLogEntriesMetadataProtoMsg { /** Metadata for CopyLogEntries long running operations. */ export interface CopyLogEntriesMetadataAmino { /** The create time of an operation. */ - start_time?: Date; + start_time?: string; /** The end time of an operation. */ - end_time?: Date; + end_time?: string; /** State of an operation. */ state: OperationState; /** Identifies whether the user has requested cancellation of the operation. */ diff --git a/__fixtures__/v-next/outputv3/google/logging/v2/logging_metrics.ts b/__fixtures__/v-next/outputv3/google/logging/v2/logging_metrics.ts index c21a2c8009..4c291d1b44 100644 --- a/__fixtures__/v-next/outputv3/google/logging/v2/logging_metrics.ts +++ b/__fixtures__/v-next/outputv3/google/logging/v2/logging_metrics.ts @@ -317,13 +317,13 @@ export interface LogMetricAmino { * * This field may not be present for older metrics. */ - create_time?: Date; + create_time?: string; /** * Output only. The last update timestamp of the metric. * * This field may not be present for older metrics. */ - update_time?: Date; + update_time?: string; /** * Deprecated. The API version that created or updated this metric. * The v2 format is used by default and cannot be changed. diff --git a/__fixtures__/v-next/outputv3/google/rpc/context/attribute_context.ts b/__fixtures__/v-next/outputv3/google/rpc/context/attribute_context.ts index 09bc418b93..02308d9055 100644 --- a/__fixtures__/v-next/outputv3/google/rpc/context/attribute_context.ts +++ b/__fixtures__/v-next/outputv3/google/rpc/context/attribute_context.ts @@ -573,7 +573,7 @@ export interface AttributeContext_RequestAmino { * The timestamp when the `destination` service receives the last byte of * the request. */ - time?: Date; + time?: string; /** The HTTP request size in bytes. If unknown, it must be -1. */ size: string; /** @@ -686,7 +686,7 @@ export interface AttributeContext_ResponseAmino { * The timestamp when the `destination` service sends the last byte of * the response. */ - time?: Date; + time?: string; /** * The length of time it takes the backend service to fully respond to a * request. Measured from when the destination service starts to send the @@ -904,18 +904,18 @@ export interface AttributeContext_ResourceAmino { * Output only. The timestamp when the resource was created. This may * be either the time creation was initiated or when it was completed. */ - create_time?: Date; + create_time?: string; /** * Output only. The timestamp when the resource was last updated. Any * change to the resource made by users must refresh this value. * Changes to a resource made by the service should refresh this value. */ - update_time?: Date; + update_time?: string; /** * Output only. The timestamp when the resource was deleted. * If the resource is not deleted, this must be empty. */ - delete_time?: Date; + delete_time?: string; /** * Output only. An opaque value that uniquely identifies a version or * generation of a resource. It can be used to confirm that the client diff --git a/__fixtures__/v-next/outputv3/ibc/lightclients/tendermint/v1/tendermint.ts b/__fixtures__/v-next/outputv3/ibc/lightclients/tendermint/v1/tendermint.ts index 09f3a214f5..183414f78c 100644 --- a/__fixtures__/v-next/outputv3/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/__fixtures__/v-next/outputv3/ibc/lightclients/tendermint/v1/tendermint.ts @@ -136,7 +136,7 @@ export interface ConsensusStateAmino { * timestamp that corresponds to the block height in which the ConsensusState * was stored. */ - timestamp?: Date; + timestamp?: string; /** commitment root (i.e app hash) */ root?: MerkleRootAmino; next_validators_hash: Uint8Array; @@ -609,7 +609,7 @@ export const ConsensusState = { }, fromAmino(object: ConsensusStateAmino): ConsensusState { return { - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined, nextValidatorsHash: object.next_validators_hash }; diff --git a/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/params.ts b/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/params.ts index b4b5bd2d31..a27ad4d764 100644 --- a/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/params.ts +++ b/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/params.ts @@ -17,7 +17,7 @@ export interface ParamsProtoMsg { } /** Params defines the claim module's parameters. */ export interface ParamsAmino { - airdrop_start_time?: Date; + airdrop_start_time?: string; duration_until_decay?: DurationAmino; duration_of_decay?: DurationAmino; /** denom of claimable asset */ @@ -128,7 +128,7 @@ export const Params = { }, fromAmino(object: ParamsAmino): Params { return { - airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), + airdropStartTime: object?.airdrop_start_time ? fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)) : undefined, durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimDenom: object.claim_denom diff --git a/__fixtures__/v-next/outputv3/osmosis/epochs/genesis.ts b/__fixtures__/v-next/outputv3/osmosis/epochs/genesis.ts index 5263c25fc7..edb10880ee 100644 --- a/__fixtures__/v-next/outputv3/osmosis/epochs/genesis.ts +++ b/__fixtures__/v-next/outputv3/osmosis/epochs/genesis.ts @@ -77,7 +77,7 @@ export interface EpochInfoAmino { * If start_time is in the future, the epoch will not begin until the start * time. */ - start_time?: Date; + start_time?: string; /** * duration is the time in between epoch ticks. * In order for intended behavior to be met, duration should @@ -111,7 +111,7 @@ export interface EpochInfoAmino { * * The t=34 block will start the epoch for (30, 35] * * The **t=36** block will start the epoch for (35, 40] */ - current_epoch_start_time?: Date; + current_epoch_start_time?: string; /** * epoch_counting_started is a boolean, that indicates whether this * epoch timer has began yet. @@ -289,10 +289,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), + currentEpochStartTime: object?.current_epoch_start_time ? fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)) : undefined, epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; diff --git a/__fixtures__/v-next/outputv3/osmosis/gamm/pool-models/balancer/balancerPool.ts b/__fixtures__/v-next/outputv3/osmosis/gamm/pool-models/balancer/balancerPool.ts index 4920b97c47..e88314a078 100644 --- a/__fixtures__/v-next/outputv3/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/__fixtures__/v-next/outputv3/osmosis/gamm/pool-models/balancer/balancerPool.ts @@ -66,7 +66,7 @@ export interface SmoothWeightChangeParamsAmino { * If a parameter change / pool instantiation leaves this blank, * it should be generated by the state_machine as the current time. */ - start_time?: Date; + start_time?: string; /** Duration for the weights to change over */ duration?: DurationAmino; /** @@ -364,7 +364,7 @@ export const SmoothWeightChangeParams = { }, fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { return { - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, initialPoolWeights: Array.isArray(object?.initial_pool_weights) ? object.initial_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [], targetPoolWeights: Array.isArray(object?.target_pool_weights) ? object.target_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [] diff --git a/__fixtures__/v-next/outputv3/osmosis/incentives/gauge.ts b/__fixtures__/v-next/outputv3/osmosis/incentives/gauge.ts index eedf00a523..8a0c77bf3c 100644 --- a/__fixtures__/v-next/outputv3/osmosis/incentives/gauge.ts +++ b/__fixtures__/v-next/outputv3/osmosis/incentives/gauge.ts @@ -77,7 +77,7 @@ export interface GaugeAmino { */ coins: CoinAmino[]; /** start_time is the distribution start time */ - start_time?: Date; + start_time?: string; /** * num_epochs_paid_over is the number of total epochs distribution will be * completed over @@ -291,7 +291,7 @@ export const Gauge = { isPerpetual: object.is_perpetual, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, numEpochsPaidOver: BigInt(object.num_epochs_paid_over), filledEpochs: BigInt(object.filled_epochs), distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : [] diff --git a/__fixtures__/v-next/outputv3/osmosis/incentives/tx.ts b/__fixtures__/v-next/outputv3/osmosis/incentives/tx.ts index 037c887623..382396b145 100644 --- a/__fixtures__/v-next/outputv3/osmosis/incentives/tx.ts +++ b/__fixtures__/v-next/outputv3/osmosis/incentives/tx.ts @@ -55,7 +55,7 @@ export interface MsgCreateGaugeAmino { /** coins are coin(s) to be distributed by the gauge */ coins: CoinAmino[]; /** start_time is the distribution start time */ - start_time?: Date; + start_time?: string; /** * num_epochs_paid_over is the number of epochs distribution will be completed * over @@ -247,7 +247,7 @@ export const MsgCreateGauge = { owner: object.owner, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, numEpochsPaidOver: BigInt(object.num_epochs_paid_over) }; }, diff --git a/__fixtures__/v-next/outputv3/osmosis/lockup/lock.ts b/__fixtures__/v-next/outputv3/osmosis/lockup/lock.ts index 86ff91fc6c..30ee59ad2e 100644 --- a/__fixtures__/v-next/outputv3/osmosis/lockup/lock.ts +++ b/__fixtures__/v-next/outputv3/osmosis/lockup/lock.ts @@ -106,7 +106,7 @@ export interface PeriodLockAmino { * This value is first initialized when an unlock has started for the lock, * end time being block time + duration. */ - end_time?: Date; + end_time?: string; /** Coins are the tokens locked within the lock, kept in the module account. */ coins: CoinAmino[]; } @@ -172,7 +172,7 @@ export interface QueryConditionAmino { * Timestamp field must not be nil when the lock query type is `ByLockTime`. * Querying locks with timestamp is currently not implemented. */ - timestamp?: Date; + timestamp?: string; } /** * QueryCondition is a struct used for querying locks upon different conditions. @@ -238,7 +238,7 @@ export interface SyntheticLockAmino { * used for unbonding synthetic lockups, for active synthetic lockups, this * value is set to uninitialized value */ - end_time?: Date; + end_time?: string; /** * Duration is the duration for a synthetic lock to mature * at the point of unbonding has started. @@ -378,7 +378,7 @@ export const PeriodLock = { ID: BigInt(object.ID), owner: object.owner, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] }; }, @@ -507,7 +507,7 @@ export const QueryCondition = { lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object.denom, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: QueryCondition): QueryConditionAmino { @@ -631,7 +631,7 @@ export const SyntheticLock = { return { underlyingLockId: BigInt(object.underlying_lock_id), synthDenom: object.synth_denom, - endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined }; }, diff --git a/__fixtures__/v-next/outputv3/osmosis/lockup/query.ts b/__fixtures__/v-next/outputv3/osmosis/lockup/query.ts index 977db38470..c2904890a8 100644 --- a/__fixtures__/v-next/outputv3/osmosis/lockup/query.ts +++ b/__fixtures__/v-next/outputv3/osmosis/lockup/query.ts @@ -134,7 +134,7 @@ export interface AccountLockedPastTimeRequestProtoMsg { } export interface AccountLockedPastTimeRequestAmino { owner: string; - timestamp?: Date; + timestamp?: string; } export interface AccountLockedPastTimeRequestSDKType { owner: string; @@ -163,7 +163,7 @@ export interface AccountLockedPastTimeNotUnlockingOnlyRequestProtoMsg { } export interface AccountLockedPastTimeNotUnlockingOnlyRequestAmino { owner: string; - timestamp?: Date; + timestamp?: string; } export interface AccountLockedPastTimeNotUnlockingOnlyRequestSDKType { owner: string; @@ -192,7 +192,7 @@ export interface AccountUnlockedBeforeTimeRequestProtoMsg { } export interface AccountUnlockedBeforeTimeRequestAmino { owner: string; - timestamp?: Date; + timestamp?: string; } export interface AccountUnlockedBeforeTimeRequestSDKType { owner: string; @@ -222,7 +222,7 @@ export interface AccountLockedPastTimeDenomRequestProtoMsg { } export interface AccountLockedPastTimeDenomRequestAmino { owner: string; - timestamp?: Date; + timestamp?: string; denom: string; } export interface AccountLockedPastTimeDenomRequestSDKType { @@ -1350,7 +1350,7 @@ export const AccountLockedPastTimeRequest = { fromAmino(object: AccountLockedPastTimeRequestAmino): AccountLockedPastTimeRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: AccountLockedPastTimeRequest): AccountLockedPastTimeRequestAmino { @@ -1534,7 +1534,7 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino): AccountLockedPastTimeNotUnlockingOnlyRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyRequest): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { @@ -1718,7 +1718,7 @@ export const AccountUnlockedBeforeTimeRequest = { fromAmino(object: AccountUnlockedBeforeTimeRequestAmino): AccountUnlockedBeforeTimeRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: AccountUnlockedBeforeTimeRequest): AccountUnlockedBeforeTimeRequestAmino { @@ -1914,7 +1914,7 @@ export const AccountLockedPastTimeDenomRequest = { fromAmino(object: AccountLockedPastTimeDenomRequestAmino): AccountLockedPastTimeDenomRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, denom: object.denom }; }, diff --git a/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/query.ts b/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/query.ts index 59fab4c780..87f1923147 100644 --- a/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/query.ts @@ -19,8 +19,8 @@ export interface ArithmeticTwapRequestAmino { pool_id: string; base_asset: string; quote_asset: string; - start_time?: Date; - end_time?: Date; + start_time?: string; + end_time?: string; } export interface ArithmeticTwapRequestSDKType { pool_id: bigint; @@ -56,7 +56,7 @@ export interface ArithmeticTwapToNowRequestAmino { pool_id: string; base_asset: string; quote_asset: string; - start_time?: Date; + start_time?: string; } export interface ArithmeticTwapToNowRequestSDKType { pool_id: bigint; @@ -208,7 +208,7 @@ export const ArithmeticTwapRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined }; }, @@ -412,7 +412,7 @@ export const ArithmeticTwapToNowRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)) + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined }; }, toAmino(message: ArithmeticTwapToNowRequest): ArithmeticTwapToNowRequestAmino { diff --git a/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/twap_record.ts b/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/twap_record.ts index de306eff7f..1ac940f404 100644 --- a/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/twap_record.ts +++ b/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/twap_record.ts @@ -65,7 +65,7 @@ export interface TwapRecordAmino { * This field should only exist until we have a global registry in the state * machine, mapping prior block heights within {TIME RANGE} to times. */ - time?: Date; + time?: string; /** * We store the last spot prices in the struct, so that we can interpolate * accumulator values for times between when accumulator records are stored. @@ -79,7 +79,7 @@ export interface TwapRecordAmino { * It is used to alert the caller if they are getting a potentially erroneous * TWAP, due to an unforeseen underlying error. */ - last_error_time?: Date; + last_error_time?: string; } /** * A TWAP record should be indexed in state by pool_id, (asset pair), timestamp @@ -276,12 +276,12 @@ export const TwapRecord = { asset0Denom: object.asset0_denom, asset1Denom: object.asset1_denom, height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, p0LastSpotPrice: object.p0_last_spot_price, p1LastSpotPrice: object.p1_last_spot_price, p0ArithmeticTwapAccumulator: object.p0_arithmetic_twap_accumulator, p1ArithmeticTwapAccumulator: object.p1_arithmetic_twap_accumulator, - lastErrorTime: fromTimestamp(Timestamp.fromAmino(object.last_error_time)) + lastErrorTime: object?.last_error_time ? fromTimestamp(Timestamp.fromAmino(object.last_error_time)) : undefined }; }, toAmino(message: TwapRecord): TwapRecordAmino { diff --git a/__fixtures__/v-next/outputv3/tendermint/abci/types.ts b/__fixtures__/v-next/outputv3/tendermint/abci/types.ts index cc1bf4f2fc..a8092c4caa 100644 --- a/__fixtures__/v-next/outputv3/tendermint/abci/types.ts +++ b/__fixtures__/v-next/outputv3/tendermint/abci/types.ts @@ -326,7 +326,7 @@ export interface RequestInitChainProtoMsg { value: Uint8Array; } export interface RequestInitChainAmino { - time?: Date; + time?: string; chain_id: string; consensus_params?: ConsensusParamsAmino; validators: ValidatorUpdateAmino[]; @@ -1160,7 +1160,7 @@ export interface EvidenceAmino { /** The height when the offense occurred */ height: string; /** The corresponding time where the offense occurred */ - time?: Date; + time?: string; /** * Total voting power of the validator set in case the ABCI application does * not store historical validators. @@ -1984,7 +1984,7 @@ export const RequestInitChain = { }, fromAmino(object: RequestInitChainAmino): RequestInitChain { return { - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, chainId: object.chain_id, consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], @@ -6199,7 +6199,7 @@ export const Evidence = { type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, totalVotingPower: BigInt(object.total_voting_power) }; }, diff --git a/__fixtures__/v-next/outputv3/tendermint/p2p/types.ts b/__fixtures__/v-next/outputv3/tendermint/p2p/types.ts index c60b169517..037b6f8b7d 100644 --- a/__fixtures__/v-next/outputv3/tendermint/p2p/types.ts +++ b/__fixtures__/v-next/outputv3/tendermint/p2p/types.ts @@ -83,7 +83,7 @@ export interface PeerInfoProtoMsg { export interface PeerInfoAmino { id: string; address_info: PeerAddressInfoAmino[]; - last_connected?: Date; + last_connected?: string; } export interface PeerInfoSDKType { id: string; @@ -102,8 +102,8 @@ export interface PeerAddressInfoProtoMsg { } export interface PeerAddressInfoAmino { address: string; - last_dial_success?: Date; - last_dial_failure?: Date; + last_dial_success?: string; + last_dial_failure?: string; dial_failures: number; } export interface PeerAddressInfoSDKType { diff --git a/__fixtures__/v-next/outputv3/tendermint/types/evidence.ts b/__fixtures__/v-next/outputv3/tendermint/types/evidence.ts index af1a3b7066..12efc94257 100644 --- a/__fixtures__/v-next/outputv3/tendermint/types/evidence.ts +++ b/__fixtures__/v-next/outputv3/tendermint/types/evidence.ts @@ -38,7 +38,7 @@ export interface DuplicateVoteEvidenceAmino { vote_b?: VoteAmino; total_voting_power: string; validator_power: string; - timestamp?: Date; + timestamp?: string; } /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ export interface DuplicateVoteEvidenceSDKType { @@ -66,7 +66,7 @@ export interface LightClientAttackEvidenceAmino { common_height: string; byzantine_validators: ValidatorAmino[]; total_voting_power: string; - timestamp?: Date; + timestamp?: string; } /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidenceSDKType { @@ -302,7 +302,7 @@ export const DuplicateVoteEvidence = { voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, totalVotingPower: BigInt(object.total_voting_power), validatorPower: BigInt(object.validator_power), - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { @@ -450,7 +450,7 @@ export const LightClientAttackEvidence = { commonHeight: BigInt(object.common_height), byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], totalVotingPower: BigInt(object.total_voting_power), - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { diff --git a/__fixtures__/v-next/outputv3/tendermint/types/types.ts b/__fixtures__/v-next/outputv3/tendermint/types/types.ts index 068e365dc4..e7b0d90099 100644 --- a/__fixtures__/v-next/outputv3/tendermint/types/types.ts +++ b/__fixtures__/v-next/outputv3/tendermint/types/types.ts @@ -190,7 +190,7 @@ export interface HeaderAmino { version?: ConsensusAmino; chain_id: string; height: string; - time?: Date; + time?: string; /** prev block info */ last_block_id?: BlockIDAmino; /** hashes of block data */ @@ -282,7 +282,7 @@ export interface VoteAmino { round: number; /** zero if vote is nil. */ block_id?: BlockIDAmino; - timestamp?: Date; + timestamp?: string; validator_address: Uint8Array; validator_index: number; signature: Uint8Array; @@ -341,7 +341,7 @@ export interface CommitSigProtoMsg { export interface CommitSigAmino { block_id_flag: BlockIDFlag; validator_address: Uint8Array; - timestamp?: Date; + timestamp?: string; signature: Uint8Array; } /** CommitSig is a part of the Vote included in a Commit. */ @@ -370,7 +370,7 @@ export interface ProposalAmino { round: number; pol_round: number; block_id?: BlockIDAmino; - timestamp?: Date; + timestamp?: string; signature: Uint8Array; } export interface ProposalSDKType { @@ -974,7 +974,7 @@ export const Header = { version: object?.version ? Consensus.fromAmino(object.version) : undefined, chainId: object.chain_id, height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, lastCommitHash: object.last_commit_hash, dataHash: object.data_hash, @@ -1257,7 +1257,7 @@ export const Vote = { height: BigInt(object.height), round: object.round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, validatorAddress: object.validator_address, validatorIndex: object.validator_index, signature: object.signature @@ -1519,7 +1519,7 @@ export const CommitSig = { return { blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object.validator_address, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, signature: object.signature }; }, @@ -1682,7 +1682,7 @@ export const Proposal = { round: object.round, polRound: object.pol_round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, signature: object.signature }; }, diff --git a/__fixtures__/v-next/outputv4/cosmos/evidence/v1beta1/evidence.ts b/__fixtures__/v-next/outputv4/cosmos/evidence/v1beta1/evidence.ts index 484f7e12df..c9058c199d 100644 --- a/__fixtures__/v-next/outputv4/cosmos/evidence/v1beta1/evidence.ts +++ b/__fixtures__/v-next/outputv4/cosmos/evidence/v1beta1/evidence.ts @@ -132,7 +132,7 @@ export const Equivocation = { fromAmino(object: EquivocationAmino): Equivocation { return { height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, power: BigInt(object.power), consensusAddress: object.consensus_address }; diff --git a/__fixtures__/v-next/outputv4/cosmos/feegrant/v1beta1/feegrant.ts b/__fixtures__/v-next/outputv4/cosmos/feegrant/v1beta1/feegrant.ts index b9e6427d4f..1e4f84d5b4 100644 --- a/__fixtures__/v-next/outputv4/cosmos/feegrant/v1beta1/feegrant.ts +++ b/__fixtures__/v-next/outputv4/cosmos/feegrant/v1beta1/feegrant.ts @@ -364,7 +364,7 @@ export const PeriodicAllowance = { period: object?.period ? Duration.fromAmino(object.period) : undefined, periodSpendLimit: Array.isArray(object?.period_spend_limit) ? object.period_spend_limit.map((e: any) => Coin.fromAmino(e)) : [], periodCanSpend: Array.isArray(object?.period_can_spend) ? object.period_can_spend.map((e: any) => Coin.fromAmino(e)) : [], - periodReset: fromTimestamp(Timestamp.fromAmino(object.period_reset)) + periodReset: object?.period_reset ? fromTimestamp(Timestamp.fromAmino(object.period_reset)) : undefined }; }, toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { diff --git a/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/gov.ts b/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/gov.ts index 1ef30b466b..a5f4796db1 100644 --- a/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/gov.ts @@ -876,11 +876,11 @@ export const Proposal = { content: object?.content ? Any.fromAmino(object.content) : undefined, status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), - depositEndTime: fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)), + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined, + depositEndTime: object?.deposit_end_time ? fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)) : undefined, totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: fromTimestamp(Timestamp.fromAmino(object.voting_start_time)), - votingEndTime: fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) + votingStartTime: object?.voting_start_time ? fromTimestamp(Timestamp.fromAmino(object.voting_start_time)) : undefined, + votingEndTime: object?.voting_end_time ? fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) : undefined }; }, toAmino(message: Proposal): ProposalAmino { diff --git a/__fixtures__/v-next/outputv4/cosmos/group/v1/types.ts b/__fixtures__/v-next/outputv4/cosmos/group/v1/types.ts index c82a233718..5debdcde78 100644 --- a/__fixtures__/v-next/outputv4/cosmos/group/v1/types.ts +++ b/__fixtures__/v-next/outputv4/cosmos/group/v1/types.ts @@ -630,7 +630,7 @@ export const Member = { address: object.address, weight: object.weight, metadata: object.metadata, - addedAt: fromTimestamp(Timestamp.fromAmino(object.added_at)) + addedAt: object?.added_at ? fromTimestamp(Timestamp.fromAmino(object.added_at)) : undefined }; }, toAmino(message: Member): MemberAmino { @@ -1232,7 +1232,7 @@ export const GroupInfo = { metadata: object.metadata, version: BigInt(object.version), totalWeight: object.total_weight, - createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) + createdAt: object?.created_at ? fromTimestamp(Timestamp.fromAmino(object.created_at)) : undefined }; }, toAmino(message: GroupInfo): GroupInfoAmino { @@ -1530,7 +1530,7 @@ export const GroupPolicyInfo = { metadata: object.metadata, version: BigInt(object.version), decisionPolicy: object?.decision_policy ? Any.fromAmino(object.decision_policy) : undefined, - createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at)) + createdAt: object?.created_at ? fromTimestamp(Timestamp.fromAmino(object.created_at)) : undefined }; }, toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { @@ -1812,13 +1812,13 @@ export const Proposal = { address: object.address, metadata: object.metadata, proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], - submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)), + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined, groupVersion: BigInt(object.group_version), groupPolicyVersion: BigInt(object.group_policy_version), status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - votingPeriodEnd: fromTimestamp(Timestamp.fromAmino(object.voting_period_end)), + votingPeriodEnd: object?.voting_period_end ? fromTimestamp(Timestamp.fromAmino(object.voting_period_end)) : undefined, executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] }; @@ -2127,7 +2127,7 @@ export const Vote = { voter: object.voter, option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata, - submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)) + submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined }; }, toAmino(message: Vote): VoteAmino { diff --git a/__fixtures__/v-next/outputv4/cosmos/slashing/v1beta1/slashing.ts b/__fixtures__/v-next/outputv4/cosmos/slashing/v1beta1/slashing.ts index bf3cc9ef1f..289710e517 100644 --- a/__fixtures__/v-next/outputv4/cosmos/slashing/v1beta1/slashing.ts +++ b/__fixtures__/v-next/outputv4/cosmos/slashing/v1beta1/slashing.ts @@ -202,7 +202,7 @@ export const ValidatorSigningInfo = { address: object.address, startHeight: BigInt(object.start_height), indexOffset: BigInt(object.index_offset), - jailedUntil: fromTimestamp(Timestamp.fromAmino(object.jailed_until)), + jailedUntil: object?.jailed_until ? fromTimestamp(Timestamp.fromAmino(object.jailed_until)) : undefined, tombstoned: object.tombstoned, missedBlocksCounter: BigInt(object.missed_blocks_counter) }; diff --git a/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/staking.ts b/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/staking.ts index 6385c53020..2d8fc475ca 100644 --- a/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/staking.ts @@ -848,7 +848,7 @@ export const Commission = { fromAmino(object: CommissionAmino): Commission { return { commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: fromTimestamp(Timestamp.fromAmino(object.update_time)) + updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined }; }, toAmino(message: Commission): CommissionAmino { @@ -1239,7 +1239,7 @@ export const Validator = { delegatorShares: object.delegator_shares, description: object?.description ? Description.fromAmino(object.description) : undefined, unbondingHeight: BigInt(object.unbonding_height), - unbondingTime: fromTimestamp(Timestamp.fromAmino(object.unbonding_time)), + unbondingTime: object?.unbonding_time ? fromTimestamp(Timestamp.fromAmino(object.unbonding_time)) : undefined, commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, minSelfDelegation: object.min_self_delegation }; @@ -2182,7 +2182,7 @@ export const UnbondingDelegationEntry = { fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined, initialBalance: object.initial_balance, balance: object.balance }; @@ -2321,7 +2321,7 @@ export const RedelegationEntry = { fromAmino(object: RedelegationEntryAmino): RedelegationEntry { return { creationHeight: BigInt(object.creation_height), - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)), + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined, initialBalance: object.initial_balance, sharesDst: object.shares_dst }; diff --git a/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/tx.ts b/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/tx.ts index 41d228788a..e87746caad 100644 --- a/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/tx.ts @@ -1044,7 +1044,7 @@ export const MsgBeginRedelegateResponse = { }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { return { - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined }; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { @@ -1260,7 +1260,7 @@ export const MsgUndelegateResponse = { }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { return { - completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)) + completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined }; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { diff --git a/__fixtures__/v-next/outputv4/cosmos/upgrade/v1beta1/upgrade.ts b/__fixtures__/v-next/outputv4/cosmos/upgrade/v1beta1/upgrade.ts index 1736d215d9..0545529afc 100644 --- a/__fixtures__/v-next/outputv4/cosmos/upgrade/v1beta1/upgrade.ts +++ b/__fixtures__/v-next/outputv4/cosmos/upgrade/v1beta1/upgrade.ts @@ -251,7 +251,7 @@ export const Plan = { fromAmino(object: PlanAmino): Plan { return { name: object.name, - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, height: BigInt(object.height), info: object.info, upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined diff --git a/__fixtures__/v-next/outputv4/evmos/claims/v1/genesis.ts b/__fixtures__/v-next/outputv4/evmos/claims/v1/genesis.ts index 6624d9ee48..1d31b9437b 100644 --- a/__fixtures__/v-next/outputv4/evmos/claims/v1/genesis.ts +++ b/__fixtures__/v-next/outputv4/evmos/claims/v1/genesis.ts @@ -330,7 +330,7 @@ export const Params = { fromAmino(object: ParamsAmino): Params { return { enableClaims: object.enable_claims, - airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), + airdropStartTime: object?.airdrop_start_time ? fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)) : undefined, durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimsDenom: object.claims_denom, diff --git a/__fixtures__/v-next/outputv4/evmos/epochs/v1/genesis.ts b/__fixtures__/v-next/outputv4/evmos/epochs/v1/genesis.ts index 25a9a17782..5d76a6af72 100644 --- a/__fixtures__/v-next/outputv4/evmos/epochs/v1/genesis.ts +++ b/__fixtures__/v-next/outputv4/evmos/epochs/v1/genesis.ts @@ -184,10 +184,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), + currentEpochStartTime: object?.current_epoch_start_time ? fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)) : undefined, epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; diff --git a/__fixtures__/v-next/outputv4/evmos/incentives/v1/incentives.ts b/__fixtures__/v-next/outputv4/evmos/incentives/v1/incentives.ts index 56a1faf6f1..bdddc06885 100644 --- a/__fixtures__/v-next/outputv4/evmos/incentives/v1/incentives.ts +++ b/__fixtures__/v-next/outputv4/evmos/incentives/v1/incentives.ts @@ -224,7 +224,7 @@ export const Incentive = { contract: object.contract, allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => DecCoin.fromAmino(e)) : [], epochs: object.epochs, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, totalGas: BigInt(object.total_gas) }; }, diff --git a/__fixtures__/v-next/outputv4/evmos/vesting/v1/tx.ts b/__fixtures__/v-next/outputv4/evmos/vesting/v1/tx.ts index 1e7b488b50..5a9fd66f7f 100644 --- a/__fixtures__/v-next/outputv4/evmos/vesting/v1/tx.ts +++ b/__fixtures__/v-next/outputv4/evmos/vesting/v1/tx.ts @@ -236,7 +236,7 @@ export const MsgCreateClawbackVestingAccount = { return { fromAddress: object.from_address, toAddress: object.to_address, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [], merge: object.merge diff --git a/__fixtures__/v-next/outputv4/evmos/vesting/v1/vesting.ts b/__fixtures__/v-next/outputv4/evmos/vesting/v1/vesting.ts index 0e3bfd8b85..f7c22f923f 100644 --- a/__fixtures__/v-next/outputv4/evmos/vesting/v1/vesting.ts +++ b/__fixtures__/v-next/outputv4/evmos/vesting/v1/vesting.ts @@ -175,7 +175,7 @@ export const ClawbackVestingAccount = { return { baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined, funderAddress: object.funder_address, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [], vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [] }; diff --git a/__fixtures__/v-next/outputv4/ibc/lightclients/tendermint/v1/tendermint.ts b/__fixtures__/v-next/outputv4/ibc/lightclients/tendermint/v1/tendermint.ts index 8ef30059db..57d9e5d0d9 100644 --- a/__fixtures__/v-next/outputv4/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/__fixtures__/v-next/outputv4/ibc/lightclients/tendermint/v1/tendermint.ts @@ -547,7 +547,7 @@ export const ConsensusState = { }, fromAmino(object: ConsensusStateAmino): ConsensusState { return { - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined, nextValidatorsHash: object.next_validators_hash }; diff --git a/__fixtures__/v-next/outputv4/osmosis/claim/v1beta1/params.ts b/__fixtures__/v-next/outputv4/osmosis/claim/v1beta1/params.ts index ec22b41892..8abccdf983 100644 --- a/__fixtures__/v-next/outputv4/osmosis/claim/v1beta1/params.ts +++ b/__fixtures__/v-next/outputv4/osmosis/claim/v1beta1/params.ts @@ -127,7 +127,7 @@ export const Params = { }, fromAmino(object: ParamsAmino): Params { return { - airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)), + airdropStartTime: object?.airdrop_start_time ? fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)) : undefined, durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined, durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined, claimDenom: object.claim_denom diff --git a/__fixtures__/v-next/outputv4/osmosis/epochs/genesis.ts b/__fixtures__/v-next/outputv4/osmosis/epochs/genesis.ts index 257c052ee4..8885fb7be2 100644 --- a/__fixtures__/v-next/outputv4/osmosis/epochs/genesis.ts +++ b/__fixtures__/v-next/outputv4/osmosis/epochs/genesis.ts @@ -237,10 +237,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)), + currentEpochStartTime: object?.current_epoch_start_time ? fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)) : undefined, epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: BigInt(object.current_epoch_start_height) }; diff --git a/__fixtures__/v-next/outputv4/osmosis/gamm/pool-models/balancer/balancerPool.ts b/__fixtures__/v-next/outputv4/osmosis/gamm/pool-models/balancer/balancerPool.ts index 2c70a1604e..163a517c79 100644 --- a/__fixtures__/v-next/outputv4/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/__fixtures__/v-next/outputv4/osmosis/gamm/pool-models/balancer/balancerPool.ts @@ -279,7 +279,7 @@ export const SmoothWeightChangeParams = { }, fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { return { - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, initialPoolWeights: Array.isArray(object?.initial_pool_weights) ? object.initial_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [], targetPoolWeights: Array.isArray(object?.target_pool_weights) ? object.target_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [] diff --git a/__fixtures__/v-next/outputv4/osmosis/incentives/gauge.ts b/__fixtures__/v-next/outputv4/osmosis/incentives/gauge.ts index cd15557488..d87bd157a2 100644 --- a/__fixtures__/v-next/outputv4/osmosis/incentives/gauge.ts +++ b/__fixtures__/v-next/outputv4/osmosis/incentives/gauge.ts @@ -257,7 +257,7 @@ export const Gauge = { isPerpetual: object.is_perpetual, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, numEpochsPaidOver: BigInt(object.num_epochs_paid_over), filledEpochs: BigInt(object.filled_epochs), distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : [] diff --git a/__fixtures__/v-next/outputv4/osmosis/incentives/tx.ts b/__fixtures__/v-next/outputv4/osmosis/incentives/tx.ts index 582b8bca81..12c3be3acf 100644 --- a/__fixtures__/v-next/outputv4/osmosis/incentives/tx.ts +++ b/__fixtures__/v-next/outputv4/osmosis/incentives/tx.ts @@ -218,7 +218,7 @@ export const MsgCreateGauge = { owner: object.owner, distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, numEpochsPaidOver: BigInt(object.num_epochs_paid_over) }; }, diff --git a/__fixtures__/v-next/outputv4/osmosis/lockup/lock.ts b/__fixtures__/v-next/outputv4/osmosis/lockup/lock.ts index 21ec62d663..22ac41fc27 100644 --- a/__fixtures__/v-next/outputv4/osmosis/lockup/lock.ts +++ b/__fixtures__/v-next/outputv4/osmosis/lockup/lock.ts @@ -301,7 +301,7 @@ export const PeriodLock = { ID: BigInt(object.ID), owner: object.owner, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] }; }, @@ -446,7 +446,7 @@ export const QueryCondition = { lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object.denom, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: QueryCondition): QueryConditionAmino { @@ -586,7 +586,7 @@ export const SyntheticLock = { return { underlyingLockId: BigInt(object.underlying_lock_id), synthDenom: object.synth_denom, - endTime: fromTimestamp(Timestamp.fromAmino(object.end_time)), + endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined }; }, diff --git a/__fixtures__/v-next/outputv4/osmosis/lockup/query.ts b/__fixtures__/v-next/outputv4/osmosis/lockup/query.ts index 360889e7a1..ebcf4a5a2c 100644 --- a/__fixtures__/v-next/outputv4/osmosis/lockup/query.ts +++ b/__fixtures__/v-next/outputv4/osmosis/lockup/query.ts @@ -1374,7 +1374,7 @@ export const AccountLockedPastTimeRequest = { fromAmino(object: AccountLockedPastTimeRequestAmino): AccountLockedPastTimeRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: AccountLockedPastTimeRequest): AccountLockedPastTimeRequestAmino { @@ -1585,7 +1585,7 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino): AccountLockedPastTimeNotUnlockingOnlyRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyRequest): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { @@ -1796,7 +1796,7 @@ export const AccountUnlockedBeforeTimeRequest = { fromAmino(object: AccountUnlockedBeforeTimeRequestAmino): AccountUnlockedBeforeTimeRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: AccountUnlockedBeforeTimeRequest): AccountUnlockedBeforeTimeRequestAmino { @@ -2020,7 +2020,7 @@ export const AccountLockedPastTimeDenomRequest = { fromAmino(object: AccountLockedPastTimeDenomRequestAmino): AccountLockedPastTimeDenomRequest { return { owner: object.owner, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, denom: object.denom }; }, diff --git a/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/query.ts b/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/query.ts index e56100654f..63b8b777e2 100644 --- a/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/query.ts @@ -193,7 +193,7 @@ export const ArithmeticTwapRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)), + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined, endTime: object?.end_time ? fromTimestamp(Timestamp.fromAmino(object.end_time)) : undefined }; }, @@ -426,7 +426,7 @@ export const ArithmeticTwapToNowRequest = { poolId: BigInt(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)) + startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined }; }, toAmino(message: ArithmeticTwapToNowRequest): ArithmeticTwapToNowRequestAmino { diff --git a/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/twap_record.ts b/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/twap_record.ts index 9358f8bb7c..5be3e47fa1 100644 --- a/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/twap_record.ts +++ b/__fixtures__/v-next/outputv4/osmosis/twap/v1beta1/twap_record.ts @@ -252,12 +252,12 @@ export const TwapRecord = { asset0Denom: object.asset0_denom, asset1Denom: object.asset1_denom, height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, p0LastSpotPrice: object.p0_last_spot_price, p1LastSpotPrice: object.p1_last_spot_price, p0ArithmeticTwapAccumulator: object.p0_arithmetic_twap_accumulator, p1ArithmeticTwapAccumulator: object.p1_arithmetic_twap_accumulator, - lastErrorTime: fromTimestamp(Timestamp.fromAmino(object.last_error_time)) + lastErrorTime: object?.last_error_time ? fromTimestamp(Timestamp.fromAmino(object.last_error_time)) : undefined }; }, toAmino(message: TwapRecord): TwapRecordAmino { diff --git a/__fixtures__/v-next/outputv4/tendermint/abci/types.ts b/__fixtures__/v-next/outputv4/tendermint/abci/types.ts index e3a97b6882..e5208f8de6 100644 --- a/__fixtures__/v-next/outputv4/tendermint/abci/types.ts +++ b/__fixtures__/v-next/outputv4/tendermint/abci/types.ts @@ -1756,7 +1756,7 @@ export const RequestInitChain = { }, fromAmino(object: RequestInitChainAmino): RequestInitChain { return { - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, chainId: object.chain_id, consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], @@ -6341,7 +6341,7 @@ export const Evidence = { type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, totalVotingPower: BigInt(object.total_voting_power) }; }, diff --git a/__fixtures__/v-next/outputv4/tendermint/types/evidence.ts b/__fixtures__/v-next/outputv4/tendermint/types/evidence.ts index f66193ab2b..074bb4b339 100644 --- a/__fixtures__/v-next/outputv4/tendermint/types/evidence.ts +++ b/__fixtures__/v-next/outputv4/tendermint/types/evidence.ts @@ -297,7 +297,7 @@ export const DuplicateVoteEvidence = { voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, totalVotingPower: BigInt(object.total_voting_power), validatorPower: BigInt(object.validator_power), - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { @@ -457,7 +457,7 @@ export const LightClientAttackEvidence = { commonHeight: BigInt(object.common_height), byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], totalVotingPower: BigInt(object.total_voting_power), - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)) + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined }; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { diff --git a/__fixtures__/v-next/outputv4/tendermint/types/types.ts b/__fixtures__/v-next/outputv4/tendermint/types/types.ts index aebd183bc8..e83f223e60 100644 --- a/__fixtures__/v-next/outputv4/tendermint/types/types.ts +++ b/__fixtures__/v-next/outputv4/tendermint/types/types.ts @@ -910,7 +910,7 @@ export const Header = { version: object?.version ? Consensus.fromAmino(object.version) : undefined, chainId: object.chain_id, height: BigInt(object.height), - time: fromTimestamp(Timestamp.fromAmino(object.time)), + time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined, lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, lastCommitHash: object.last_commit_hash, dataHash: object.data_hash, @@ -1216,7 +1216,7 @@ export const Vote = { height: BigInt(object.height), round: object.round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, validatorAddress: object.validator_address, validatorIndex: object.validator_index, signature: object.signature @@ -1500,7 +1500,7 @@ export const CommitSig = { return { blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object.validator_address, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, signature: object.signature }; }, @@ -1677,7 +1677,7 @@ export const Proposal = { round: object.round, polRound: object.pol_round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)), + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, signature: object.signature }; }, diff --git a/packages/ast/src/encoding/proto/interface/__tests__/__snapshots__/amino.interface.test.ts.snap b/packages/ast/src/encoding/proto/interface/__tests__/__snapshots__/amino.interface.test.ts.snap index e7bcc65247..8956618f7b 100644 --- a/packages/ast/src/encoding/proto/interface/__tests__/__snapshots__/amino.interface.test.ts.snap +++ b/packages/ast/src/encoding/proto/interface/__tests__/__snapshots__/amino.interface.test.ts.snap @@ -144,7 +144,7 @@ export interface GrantAmino { * doesn't have a time expiration (other conditions in \`authorization\` * may apply to invalidate the grant) */ - expiration?: Date; + expiration?: string; }" `; @@ -157,7 +157,7 @@ export interface GrantAuthorizationAmino { granter: string; grantee: string; authorization?: AnyAmino; - expiration?: Date; + expiration?: string; }" `; From 0b2ae6acba0e07145b7433f1014ca2deb29e2261 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 Nov 2023 16:02:40 -0400 Subject: [PATCH 8/8] Fixed plugin timestamp getter. --- .../ast/src/encoding/__snapshots__/object.spec.ts.snap | 8 ++++---- packages/ast/src/encoding/proto/from-amino/utils.ts | 8 +------- packages/ast/src/encoding/proto/to-amino/utils.ts | 8 +------- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap b/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap index 9262c9a3d3..9dcb377edc 100644 --- a/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap +++ b/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap @@ -2025,7 +2025,7 @@ exports[`google/api/expr/v1alpha1/syntax Constant 1`] = ` stringValue: object?.string_value, bytesValue: object?.bytes_value, durationValue: object?.duration_value ? Duration.fromAmino(object.duration_value) : undefined, - timestampValue: object?.timestamp_value ? Timestamp.fromAmino(object.timestamp_value) : undefined + timestampValue: object?.timestamp_value ? fromTimestamp(Timestamp.fromAmino(object.timestamp_value)) : undefined }; }, toAmino(message: Constant): ConstantAmino { @@ -2038,7 +2038,7 @@ exports[`google/api/expr/v1alpha1/syntax Constant 1`] = ` obj.string_value = message.stringValue; obj.bytes_value = message.bytesValue; obj.duration_value = message.durationValue ? Duration.toAmino(message.durationValue) : undefined; - obj.timestamp_value = message.timestampValue ? Timestamp.toAmino(message.timestampValue) : undefined; + obj.timestamp_value = message.timestampValue ? Timestamp.toAmino(toTimestamp(message.timestampValue)) : undefined; return obj; }, fromAminoMsg(object: ConstantAminoMsg): Constant { @@ -2760,7 +2760,7 @@ exports[`google/api/servicecontrol/v1/log_entry LogEntry 1`] = ` fromAmino(object: LogEntryAmino): LogEntry { return { name: object.name, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined, severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, trace: object.trace, @@ -2781,7 +2781,7 @@ exports[`google/api/servicecontrol/v1/log_entry LogEntry 1`] = ` toAmino(message: LogEntry): LogEntryAmino { const obj: any = {}; obj.name = message.name; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.severity = message.severity; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; obj.trace = message.trace; diff --git a/packages/ast/src/encoding/proto/from-amino/utils.ts b/packages/ast/src/encoding/proto/from-amino/utils.ts index 137aa57604..2977bbd93b 100644 --- a/packages/ast/src/encoding/proto/from-amino/utils.ts +++ b/packages/ast/src/encoding/proto/from-amino/utils.ts @@ -327,15 +327,9 @@ export const fromAminoJSON = { }, timestamp(args: FromAminoJSONMethod) { - let timestampFormat = args.context.pluginValue( + const timestampFormat = args.context.pluginValue( 'prototypes.typingsFormat.timestamp' ); - const env = args.context.pluginValue( - 'env' - ); - if (!env || env == 'default') { - timestampFormat = 'timestamp'; - } switch (timestampFormat) { case 'timestamp': return fromAminoJSON.type(args); diff --git a/packages/ast/src/encoding/proto/to-amino/utils.ts b/packages/ast/src/encoding/proto/to-amino/utils.ts index 37b7ed521c..9b0944093f 100644 --- a/packages/ast/src/encoding/proto/to-amino/utils.ts +++ b/packages/ast/src/encoding/proto/to-amino/utils.ts @@ -238,15 +238,9 @@ export const toAminoJSON = { }, timestamp(args: ToAminoJSONMethod) { - let timestampFormat = args.context.pluginValue( + const timestampFormat = args.context.pluginValue( 'prototypes.typingsFormat.timestamp' ); - const env = args.context.pluginValue( - 'env' - ); - if (!env || env == 'default') { - timestampFormat = 'timestamp'; - } switch (timestampFormat) { case 'timestamp': return toAminoJSON.type(args);