Skip to content

Commit

Permalink
Update README.md (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-sekara authored Aug 24, 2023
1 parent 0cd3b62 commit 20250d5
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 20250d5

Please sign in to comment.