Skip to content

Commit

Permalink
feat(winsdk): added GetWalletBalance (#1267)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlangzi authored Oct 31, 2023
1 parent f9e9aab commit 5a85b2b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions winsdk/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,24 @@ func RecoverWallet(mnemonic *C.char) *C.char {

return WithJSON(w, nil)
}

// GetWalletBalance - get wallet balance
// ## Inputs
// - clientID
// ## Outputs
//
// {
// "error":"",
// "result":\"0.00\"",
// }
//
//export GetWalletBalance
func GetWalletBalance(clientID *C.char) *C.char {
b, err := zcncore.GetWalletBalance(C.GoString(clientID))
if err != nil {
log.Error("win: ", err)
return WithJSON(0, err)
}

return WithJSON(b.ToToken())
}

0 comments on commit 5a85b2b

Please sign in to comment.