Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: add log to the GetCallFulfillOracleQueryAll err #46

Merged
merged 5 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading