Skip to content

Commit

Permalink
minor additions
Browse files Browse the repository at this point in the history
  • Loading branch information
karnthis committed Aug 12, 2024
1 parent 422d426 commit 5e7c1bf
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jackallabs/jackal.js",
"version": "3.0.0-rc.7",
"version": "3.0.0-rc.8",
"description": "Javascript library for interacting with the Jackal Chain",
"keywords": [
"jackal",
Expand Down Expand Up @@ -61,7 +61,7 @@
"@cosmjs/stargate": "^0.32.2",
"@jackallabs/bech32": "^1.2.0",
"@jackallabs/dogwood-tree": "^1.0.1",
"@jackallabs/jackal.js-protos": "2.0.0",
"@jackallabs/jackal.js-protos": "2.0.2",
"@karnthis/plzsu": "^1.0.0",
"@keplr-wallet/types": "^0.12.44",
"browserify-aes": "^1.2.0",
Expand Down
17 changes: 16 additions & 1 deletion src/classes/clientHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
connectHostQueryClient,
connectHostSigningClient,
connectJackalQueryClient,
connectJackalSigningClient,
connectJackalSigningClient, DCoin,
IIbcEngageBundle,
ITxLibrary,
THostQueryClient,
Expand Down Expand Up @@ -434,6 +434,21 @@ export class ClientHandler implements IClientHandler {
return this.jklSigner.txLibrary as unknown as ITxLibrary
}

/**
*
* @returns {Promise<DCoin>}
*/
async getJklBalance(): Promise<DCoin> {
if (!this.jklSigner) {
throw new Error(signerNotEnabled('ClientHandler', 'getJklBalance'))
}
const res = await this.jklQuery.queries.bank.balance({
address: this.getJackalAddress(),
denom: 'ujkl'
})
return res.balance as DCoin
}

/**
* Expose signing ClientHandler instance jkl address.
* @returns {string} - Jkl address.
Expand Down
3 changes: 3 additions & 0 deletions src/interfaces/classes/IClientHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
DCoin,
ITxLibrary, THostSigningClient,
TJackalSigningClient,
TQueryExtensions,
Expand Down Expand Up @@ -43,6 +44,8 @@ export interface IClientHandler {

getTxs(): ITxLibrary

getJklBalance(): Promise<DCoin>

getJackalAddress(): string

getHostAddress(): string
Expand Down

0 comments on commit 5e7c1bf

Please sign in to comment.