MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / showAllTokenBalance

Function showAllTokenBalance

cmd/cql/internal/wallet.go:99–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97}
98
99func showAllTokenBalance() {
100 var (
101 stableCoinBalance uint64
102 covenantCoinBalance uint64
103 err error
104 )
105
106 if stableCoinBalance, err = client.GetTokenBalance(types.Particle); err != nil {
107 if strings.Contains(err.Error(), "no such token balance") {
108 fmt.Println("Your account is not created in the TestNet, please apply tokens from our faucet first.")
109 } else {
110 ConsoleLog.WithError(err).Error("get Particle balance failed")
111 }
112
113 SetExitStatus(1)
114 return
115 }
116
117 if covenantCoinBalance, err = client.GetTokenBalance(types.Wave); err != nil {
118 if strings.Contains(err.Error(), "no such token balance") {
119 fmt.Println("Your account is not created in the TestNet, please apply tokens from our faucet first.")
120 } else {
121 ConsoleLog.WithError(err).Error("get Wave balance failed")
122 }
123
124 SetExitStatus(1)
125 return
126 }
127
128 fmt.Printf("Particle balance is: %d\n", stableCoinBalance)
129 fmt.Printf("Wave balance is: %d\n", covenantCoinBalance)
130}
131
132func showDatabaseDeposit(dsn string) {
133 dsnCfg, err := client.ParseDSN(dsn)

Callers 1

runWalletFunction · 0.85

Calls 7

GetTokenBalanceFunction · 0.92
SetExitStatusFunction · 0.85
ContainsMethod · 0.80
ErrorMethod · 0.80
PrintlnMethod · 0.80
WithErrorMethod · 0.80
PrintfMethod · 0.45

Tested by

no test coverage detected