Skip to content

Commit

Permalink
Merge pull request #46 from gateway-fm/update/mainnet
Browse files Browse the repository at this point in the history
update: add log to the GetCallFulfillOracleQueryAll err
  • Loading branch information
asolovov authored Dec 22, 2023
2 parents d7d38a7 + 134fc2f commit 028dc75
Show file tree
Hide file tree
Showing 6 changed files with 1,403 additions and 1,391 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
23 changes: 12 additions & 11 deletions perpsv3.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,15 +436,16 @@ func getAddr(addr string, name string) (common.Address, error) {
return common.HexToAddress(addr), nil
}

// TODO: fix test and unmute
// createTest used for testing
func createTest(conf *config.PerpsvConfig) (*Perpsv3, error) {
lib := &Perpsv3{
config: conf,
}

if err := lib.init(); err != nil {
return nil, err
}

return lib, nil
}
//func createTest(conf *config.PerpsvConfig) (*Perpsv3, error) {
// lib := &Perpsv3{
// config: conf,
// }
//
// if err := lib.init(); err != nil {
// return nil, err
// }
//
// return lib, nil
//}
Loading

0 comments on commit 028dc75

Please sign in to comment.