Skip to content

Instantly share code, notes, and snippets.

@clockworkgr
Created October 27, 2022 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clockworkgr/ddac5242ae6f1a5338f536b89ea0acfb to your computer and use it in GitHub Desktop.
Save clockworkgr/ddac5242ae6f1a5338f536b89ea0acfb to your computer and use it in GitHub Desktop.
export default function useCosmosBankV1Beta1() {
const client = useClient();
const QueryBalance = (address: string, query: any, options: any) => {
const key = { type: "QueryBalance", address, query };
return useQuery(
[key],
() => {
const { address, query } = key;
return client.CosmosBankV1Beta1.query.queryBalance(address, query ?? undefined).then((res) => res.data);
},
options,
);
};
//.....
//....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment