Skip to content

Commit

Permalink
Merge branch 'main' into test-selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-sekara authored Sep 27, 2023
2 parents 45b458e + 20250d5 commit db5f26f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ supported networks and their selectors.

```go
import (
"github.com/smartcontractkit/ccip-chain-selectors"
chainselectors "github.com/smartcontractkit/chain-selectors"
)

func main() {
// Getting selector based on ChainId
selector, err := selectors.SelectorFromChainId(420)
selector, err := chainselectors.SelectorFromChainId(420)

// Getting ChainId based on ChainSelector
chainId, err := selectors.ChainIdFromSelector(2664363617261496610)
chainId, err := chainselectors.ChainIdFromSelector(2664363617261496610)

// Accessing mapping directly
lookupChainId := uint64(1337)
if chainSelector, exists := selectors.EvmChainIdToChainSelector()[lookupChainId]; exists {
if chainSelector, exists := chainselectors.EvmChainIdToChainSelector()[lookupChainId]; exists {
fmt.Println("Found chain selector for chain", lookupChainId, ":", chainSelector)
}
}
Expand Down

0 comments on commit db5f26f

Please sign in to comment.