telescope
                                
                                 telescope copied to clipboard
                                
                                    telescope copied to clipboard
                            
                            
                            
                        use implicit recursion similar to fromPartial for toAmino/fromAmino
currently the toAmino/fromAmino functionality requires the proto parser store and proto refs so that it can query information about nested dependencies and imports.
This could be simplified by taking an approach for amino encoding similar to how fromPartial, fromJSON, toJSON and other methods inspired from ts-proto
This could be accomplished by adding toAminoandfromAmino` methods to the message objects:
export const MsgCreateValidator = {
  encode(message: MsgCreateValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
    if (message.description !== undefined) {
      Description.encode(message.description, writer.uint32(10).fork()).ldelim();
    }
    if (message.commission !== undefined) {
      CommissionRates.encode(message.commission, writer.uint32(18).fork()).ldelim();
    }
  }
  toAmino(message, obj) {
      if (message.description !== undefined) {
         obj.description = Description.toAmino(message.description);
     }
  }
this may be required for infinitely recursive structures.
Part of why this PR didn't get merged, it seemed that some structures were infinitely nested: https://github.com/osmosis-labs/telescope/pull/198
types themselves
- [x] CoinSDKType
- [x] CoinAminoTypeis like SDKType but with these https://github.com/osmosis-labs/telescope/blob/main/PROTO-AMINO.md
encoders
- [ ] string
- [x] numbers
- [x] long
- [ ] enum (using functions)
duration types
- [ ] https://github.com/osmosis-labs/osmojs/issues/12
- [ ] https://github.com/bitsongofficial/sinfonia-ui/blob/9aaa13947b971d220ae64600704645faf2133efb/src/signing/amino-types.ts#L89
- [ ] instead of coding the subfields inline, why not delegate to Duration.toAmino()andDuration.fromAmino()- can we do message type level encoding?
enum example
  "/cosmos.gov.v1beta1.MsgVote": {
    aminoType: "cosmos-sdk/MsgVote",
    toAmino: ({ option, proposalId, voter }: MsgVote): AminoMsgVote["value"] => {
      return {
        option: option,
        proposal_id: proposalId.toString(),
        voter: voter,
      };
    },
    fromAmino: ({ option, proposal_id, voter }: AminoMsgVote["value"]): MsgVote => {
      return {
        option: voteOptionFromJSON(option),
        proposalId: Long.fromString(proposal_id),
        voter: voter,
      };
    },
  },