Skip to content

Commit

Permalink
Finalize CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
Schwartz10 committed Sep 4, 2024
1 parent 29e9b5b commit 71ddfb3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
6 changes: 2 additions & 4 deletions cmd/agent_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func econInfo(ctx context.Context, agent common.Address, afi *econ.AgentFi, s *s
printTable([]string{
"Liquidation value",
"Total debt",
"Debt to liquidation value % (DTL)",
"Debt-to-liquidation ratio (DTL)",
}, []string{
fmt.Sprintf("%0.09f FIL", util.ToFIL(afi.LiquidationValue())),
fmt.Sprintf("%0.09f FIL", util.ToFIL(afi.Debt())),
Expand All @@ -206,12 +206,10 @@ func econInfo(ctx context.Context, agent common.Address, afi *econ.AgentFi, s *s
printTable([]string{
"Max borrow to seal",
"Max borrow to withdraw",
"Current borrow limit",
"Current withdraw limit",
"Available to withdraw",
}, []string{
fmt.Sprintf("%0.09f FIL", util.ToFIL(afi.MaxBorrowAndSeal())),
fmt.Sprintf("%0.09f FIL", util.ToFIL(afi.MaxBorrowAndWithdraw())),
fmt.Sprintf("%0.09f FIL", util.ToFIL(afi.BorrowLimit())),
fmt.Sprintf("%0.09f FIL", util.ToFIL(afi.WithdrawLimit())),
})

Expand Down
7 changes: 5 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,13 @@ func initConfig() {
daemonURL := viper.GetString("daemon.rpc-url")
daemonToken := viper.GetString("daemon.token")
adoURL := viper.GetString("ado.address")
eventsURL := viper.GetString("routes.events-url")

override := viper.GetBool("routes.override")
if override || chainID == constants.LocalnetChainID || chainID == constants.AnvilChainID {
routerAddr := viper.GetString("routes.router")
router := common.HexToAddress(routerAddr)
err := sdk.LazyInit(context.Background(), &PoolsSDK, router, adoURL, "ADO", daemonURL, daemonToken)
err := sdk.LazyInit(context.Background(), &PoolsSDK, router, adoURL, "ADO", daemonURL, daemonToken, eventsURL)
if err != nil {
logFatal(err)
}
Expand All @@ -199,7 +200,9 @@ func initConfig() {
if daemonToken != "" {
extern.LotusToken = daemonToken
}

if eventsURL != "" {
extern.EventsURL = eventsURL
}
if adoURL != "" {
extern.AdoAddr = adoURL
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/filecoin-project/go-address v1.1.0
github.com/filecoin-project/go-state-types v0.14.0
github.com/filecoin-project/lotus v1.28.1
github.com/glifio/go-pools v1.1.0
github.com/glifio/go-pools v1.1.1
github.com/glifio/go-wallet-utils v0.0.0-20230719050429-ff6c4bc75533
github.com/golang/mock v1.6.0
github.com/ipfs/go-cid v0.4.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkN
github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ=
github.com/glifio/go-pools v1.1.0 h1:7tcKe3Ro8nsAzcN516eKbwuKgyrFK57UwElZ8zZ+7F4=
github.com/glifio/go-pools v1.1.0/go.mod h1:G+JltF4457QvLCk8cIMLTHl6L7HgB515Bv8IRgFJJx8=
github.com/glifio/go-pools v1.1.1 h1:mcsc/jegFZgAoSzobN02hivAVIVSJSS96iekOqL98uI=
github.com/glifio/go-pools v1.1.1/go.mod h1:G+JltF4457QvLCk8cIMLTHl6L7HgB515Bv8IRgFJJx8=
github.com/glifio/go-wallet-utils v0.0.0-20230719050429-ff6c4bc75533 h1:teuqQtVb7YMyqIOg+xUNO21qZAnm8ibhpKy4lIUBpag=
github.com/glifio/go-wallet-utils v0.0.0-20230719050429-ff6c4bc75533/go.mod h1:zJ9ksxDWIsuS80RtpjaM6swuKZ7OYdJH56I00EZRxD4=
github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
Expand Down

0 comments on commit 71ddfb3

Please # to comment.