Skip to content

Commit

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

export type ExecuteContractMutationArgs<Message extends Record<string, unknown>> = Omit<
Expand All @@ -154,14 +155,15 @@ export const executeContract = async <Message extends Record<string, unknown>>({
fee,
contractAddress,
funds,
memo,
}: ExecuteContractArgs<Message>) => {
const { signingClients } = useGrazStore.getState();

if (!signingClients?.cosmWasm) {
throw new Error("CosmWasm signing client is not ready");
}

return signingClients.cosmWasm.execute(senderAddress, contractAddress, msg, fee, funds);
return signingClients.cosmWasm.execute(senderAddress, contractAddress, msg, fee, memo, funds);
};

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

return executeContract(executeArgs);
Expand Down

0 comments on commit 5083eb6

Please sign in to comment.