Skip to content

Commit

Permalink
update: add log to the GetCallFulfillOracleQueryAll err
Browse files Browse the repository at this point in the history
  • Loading branch information
asolovov committed Dec 22, 2023
1 parent 5312d8a commit 7d5ea61
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func GetOptimismGoerliDefaultConfig(rpcURL string) *PerpsvConfig {
// GetBaseAndromedaDefaultConfig is used to get default lib config for base andromeda test net
func GetBaseAndromedaDefaultConfig(rpcURL string) *PerpsvConfig {
if rpcURL == "" {
rpcURL = "https://base-goerli.publicnode.com"
rpcURL = "https://rpc.ankr.com/base_goerli/6259fa6541ffabb10ca241f7f437c2389ab7dda38c7be817ab0fb76992e73ae5"
}

return &PerpsvConfig{
Expand Down Expand Up @@ -87,7 +87,7 @@ func GetBaseAndromedaDefaultConfig(rpcURL string) *PerpsvConfig {
// GetBaseMainnetDefaultConfig is used to get default lib config for base main net
func GetBaseMainnetDefaultConfig(rpcURL string) *PerpsvConfig {
if rpcURL == "" {
rpcURL = "https://base.fastnode.cc/FNqVEtfWuTiChBumceweFPGEbNkZxtDXrAsHaoklAKNmfQhfxhVQBMijfetdNKMV/"
rpcURL = "https://rpc.ankr.com/base/6259fa6541ffabb10ca241f7f437c2389ab7dda38c7be817ab0fb76992e73ae5"
}

return &PerpsvConfig{
Expand Down
8 changes: 8 additions & 0 deletions examples/new_lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
perpsv3_Go "github.com/gateway-fm/perpsv3-Go"
"log"
"math/big"
)

func main() {
Expand All @@ -18,6 +19,13 @@ func main() {
log.Fatal(err)
}

res, err := lib.GetAvailableMargin(big.NewInt(1))
if err != nil {
log.Fatal(err)
}

log.Println(res)

//...
// call needed methods
// ...
Expand Down
4 changes: 2 additions & 2 deletions services/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ func (s *Service) getRequiredMaintenanceMarginRetries(accountId *big.Int, fails
res, err = s.getRequiredMaintenanceMarginMulticallNoPyth(accountId, true)
if err != nil && fails <= s.multicallRetries {
time.Sleep(s.multicallWait)
return s.getAvailableMarginMulticallRetries(accountId, fails+1)
return s.getRequiredMaintenanceMarginRetries(accountId, fails+1)
}
case config.BaseMainnet:
res, err = s.getRequiredMaintenanceMarginMulticall(accountId, true)
if err != nil && fails <= s.multicallRetries {
time.Sleep(s.multicallWait)
return s.getAvailableMarginMulticallRetries(accountId, fails+1)
return s.getRequiredMaintenanceMarginRetries(accountId, fails+1)
}
default:
res, err = s.getRequiredMaintenanceMargin(accountId)
Expand Down

0 comments on commit 7d5ea61

Please sign in to comment.