-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web-components): surface wallet connection rpc errors
- Loading branch information
1 parent
ebfc261
commit 7289e78
Showing
3 changed files
with
79 additions
and
17 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
packages/web-components/src/wallet-connection/queryBankBalances.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; | ||
import { QueryClientImpl } from 'cosmjs-types/cosmos/bank/v1beta1/query'; | ||
|
||
/** @typedef {import('@cosmjs/tendermint-rpc').Tendermint34Client} Tendermint34Client */ | ||
|
||
/** | ||
* @param {string} address | ||
* @param {Tendermint34Client} tendermint | ||
*/ | ||
export const queryBankBalances = async (address, tendermint) => { | ||
const queryClient = new QueryClient(tendermint); | ||
const rpcClient = createProtobufRpcClient(queryClient); | ||
const bankQueryService = new QueryClientImpl(rpcClient); | ||
|
||
const { balances } = await bankQueryService.AllBalances({ | ||
address, | ||
}); | ||
|
||
return balances; | ||
}; |
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
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