hashgreen / hoogii-wallet

Hoogii is a crypto wallet extension for Chia Network
https://hoogii.app
Apache License 2.0
21 stars 7 forks source link

Feature/interface get balance #127

Closed ahwei closed 1 year ago

ahwei commented 1 year ago

Description

add interface get balance

demo code

for xch

 const balance = await window.chia.hoogii.request({
      method: 'getAssetBalance',
      params: { },
  })
 console.log('balance', balance)
//balance {spendableCoinCount: 0}

for cat (use assetId)

 const balance = await window.chia.hoogii.request({
      method: 'getAssetBalance',
      params: { type: 'cat', assetId: requestAsset },
  })
  console.log('balance', balance)
  //balance {spendableCoinCount: 0}

Fixes # (issue)

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Test Configuration:

Checklist: