Skip to content

Commit

Permalink
additional refactoring to make extended params optional
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntVal authored and codingki committed Feb 24, 2023
1 parent 5083eb6 commit 2362a84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/graz/src/actions/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,16 @@ export interface ExecuteContractArgs<Message extends Record<string, unknown>> {
senderAddress: string;
contractAddress: string;
funds: Coin[];
memo: string | undefined;
memo: string;
}

export type ExecuteContractMutationArgs<Message extends Record<string, unknown>> = Omit<
ExecuteContractArgs<Message>,
"contractAddress" | "senderAddress" | "fee"
"contractAddress" | "senderAddress" | "fee" | "funds" | "memo"
> & {
fee?: StdFee | "auto" | number;
funds?: Coin[];
memo?: string;
};

export const executeContract = async <Message extends Record<string, unknown>>({
Expand Down
3 changes: 2 additions & 1 deletion packages/graz/src/hooks/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ export const useExecuteContract = <Message extends Record<string, unknown>>({
fee: args.fee ?? "auto",
senderAddress: accountAddress,
contractAddress,
funds: args.funds || [],
memo: args.memo ?? "",
funds: args.funds ?? [],
};

return executeContract(executeArgs);
Expand Down

0 comments on commit 2362a84

Please sign in to comment.