add traderjoe router

add usdt.e alias
This commit is contained in:
Laurent Le Houerou 2021-11-19 10:25:59 +04:00
parent f1729770e3
commit 005d54e57d
4 changed files with 798 additions and 0 deletions

View File

@ -75,5 +75,6 @@ func NewTokenMapper() evm.TokenMapper {
tm.AddAlias("BTC", "WBTC.e")
tm.AddAlias("USDC", "USDC.e")
tm.AddAlias("DAI", "DAI.e")
tm.AddAlias("USDT", "USDT.e")
return tm
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

21
traderjoe/router.go Normal file
View File

@ -0,0 +1,21 @@
package traderjoe
import (
"git.lehouerou.net/laurent/evm"
"git.lehouerou.net/laurent/evm/avalanche"
"git.lehouerou.net/laurent/evm/traderjoe/contracts"
"github.com/ethereum/go-ethereum/common"
"github.com/pkg/errors"
)
const (
RouterAddress = "0x60aE616a2155Ee3d9A68541Ba4544862310933d4"
)
func NewRouter(client *avalanche.Client) (*evm.UniswapRouter, error) {
contract, err := contracts.NewRouter(common.HexToAddress(RouterAddress), client)
if err != nil {
return nil, errors.Wrap(err, "init contract")
}
return evm.NewUniswapRouter("traderjoe", client, contract), nil
}