From 6665501f02842dc7f2cd30da1c229404f25df744 Mon Sep 17 00:00:00 2001 From: Himitsuko Date: Mon, 24 Oct 2022 16:59:20 +0700 Subject: [PATCH] add: Sharing supported chains env --- constants/supported_chains.go | 40 +++++++++++++++++++++++++++++++++++ go.mod | 9 +++++++- go.sum | 12 +++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 constants/supported_chains.go diff --git a/constants/supported_chains.go b/constants/supported_chains.go new file mode 100644 index 0000000..1ccf571 --- /dev/null +++ b/constants/supported_chains.go @@ -0,0 +1,40 @@ +package constants + +var ( + SupportedChains = map[string]string{ + "bsc": "bsc", + "ethereum": "ethereum", + "moonriver": "moonriver", + "avalanche": "avalanche", + "aurora": "aurora", + "moonbeam": "moonbeam", + "fantom": "fantom", + "arbitrum": "arbitrum", + "polygon": "polygon", + "gnosis": "gnosis", + "optimism": "optimism", + "harmony": "harmony", + "celo": "celo", + "fuse": "fuse", + "coinex": "coinex", + "iotex": "iotex", + } + InternalKeysMap = map[string]string{ + "binance-smart-chain": "bsc", + "ethereum": "ethereum", + "moonriver": "moonriver", + "avalanche": "avalanche", + "aurora": "aurora", + "moonbeam": "moonbeam", + "fantom": "fantom", + "arbitrum": "arbitrum", + "polygon": "polygon", + "gnosis": "gnosis", + "optimism": "optimism", + "harmony": "harmony", + "celo": "celo", + "fuse": "fuse", + "coinex": "coinex", + "iotex": "iotex", + } +) diff --git a/go.mod b/go.mod index 0d36e83..1be7db5 100644 --- a/go.mod +++ b/go.mod @@ -4,4 +4,11 @@ go 1.18 require github.com/samber/lo v1.21.0 -require golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect +require ( + github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/ethereum/go-ethereum v1.10.25 // indirect + golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect + golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect +) diff --git a/go.sum b/go.sum index bdb4d70..72a9143 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,21 @@ +github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= +github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/ethereum/go-ethereum v1.10.25 h1:5dFrKJDnYf8L6/5o42abCE6a9yJm9cs4EJVRyYMr55s= +github.com/ethereum/go-ethereum v1.10.25/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/samber/lo v1.21.0 h1:FSby8pJQtX4KmyddTCCGhc3JvnnIVrDA+NW37rG+7G8= github.com/samber/lo v1.21.0/go.mod h1:2I7tgIv8Q1SG2xEIkRq0F2i2zgxVpnyPOP0d3Gj2r+A= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 h1:3MTrJm4PyNL9NBqvYDSj3DHl46qQakyfqfWo4jgfaEM= golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= +golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=