launchpad icon indicating copy to clipboard operation
launchpad copied to clipboard

question: update_start_time message

Open pyramation opened this issue 3 years ago • 0 comments

Here is the latest export for ExecuteMsg (in Typescript)

export type ExecuteMsg = {
  mint: {
    [k: string]: unknown;
  };
} | {
  set_whitelist: {
    whitelist: string;
    [k: string]: unknown;
  };
} | {
  update_start_time: Timestamp;
} | {
  update_per_address_limit: {
    per_address_limit: number;
    [k: string]: unknown;
  };
} | {
  mint_to: {
    recipient: string;
    [k: string]: unknown;
  };
} | {
  mint_for: {
    recipient: string;
    token_id: number;
    [k: string]: unknown;
  };
} | {
  withdraw: {
    [k: string]: unknown;
  };
};

I noticed that update_start_time is the only one that doesn't take an object. Every other message uses either an empty object or an object with props.

update_start_time: Timestamp

The generated code as a result would be

updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: readonly Coin[]): Promise<ExecuteResult> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      update_start_time: {}
    }, fee, memo, funds);
  };

@JakeHartnell I'm curious if this is a convention to use objects or should we account for this in the cosmwasm-typescript-gen and allow scalar values?

Seems that this is likely an issue in the transpiler and I'll be tracking it here https://github.com/pyramation/cosmwasm-typescript-gen/issues/21

pyramation avatar Jun 16 '22 22:06 pyramation