Created
October 27, 2022 10:46
-
-
Save clockworkgr/ddac5242ae6f1a5338f536b89ea0acfb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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