Skip to content
Open
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
8 changes: 4 additions & 4 deletions src/blockchains.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*#if _EVM

let supported = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain']
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain']
let supported = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain', 'celo']
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain', 'celo']
supported.svm = []

/*#elif _SVM
Expand All @@ -12,8 +12,8 @@ supported.svm = ['solana']

//#else */

let supported = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain']
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain']
let supported = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain', 'celo']
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain', 'celo']
supported.svm = ['solana']

//#endif
Expand Down
16 changes: 16 additions & 0 deletions src/exchanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import uniswap_v2 from './exchanges/uniswap_v2'
import uniswap_v3 from './exchanges/uniswap_v3'
import wavax from './exchanges/wavax'
import wbnb from './exchanges/wbnb'
import wcelo from './exchanges/wcelo'
import weth from './exchanges/weth'
import weth_arbitrum from './exchanges/weth_arbitrum'
import weth_base from './exchanges/weth_base'
Expand All @@ -34,6 +35,7 @@ const exchanges = [
wftm(),
wavax(),
wxdai(),
wcelo(),
]

exchanges.forEach((exchange)=>{
Expand Down Expand Up @@ -105,6 +107,12 @@ exchanges.worldchain = [
]
exchanges.worldchain.forEach((exchange)=>{ exchanges.worldchain[exchange.name] = exchange })

exchanges.celo = [
uniswap_v3('celo'),
wcelo('celo'),
]
exchanges.celo.forEach((exchange)=>{ exchanges.celo[exchange.name] = exchange })


/*#elif _SVM

Expand Down Expand Up @@ -148,6 +156,7 @@ import weth_optimism from './exchanges/weth_optimism'
import weth_base from './exchanges/weth_base'
import wftm from './exchanges/wftm'
import wmatic from './exchanges/wmatic'
import wcelo from './exchanges/wcelo'
import wxdai from './exchanges/wxdai'

const exchanges = [
Expand All @@ -170,6 +179,7 @@ const exchanges = [
wftm(),
wavax(),
wxdai(),
wcelo(),
]
exchanges.forEach((exchange)=>{
exchanges[exchange.name] = exchange
Expand Down Expand Up @@ -247,6 +257,12 @@ exchanges.worldchain = [
]
exchanges.worldchain.forEach((exchange)=>{ exchanges.worldchain[exchange.name] = exchange })

exchanges.celo = [
uniswap_v3('celo'),
wcelo('celo'),
]
exchanges.celo.forEach((exchange)=>{ exchanges.celo[exchange.name] = exchange })

//#endif

export default exchanges
24 changes: 23 additions & 1 deletion src/exchanges/uniswap_v3.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const exchange = {
slippage: true,
fees: [100, 500, 3000, 10000],

blockchains: ['ethereum', 'bsc', 'polygon', 'optimism', 'arbitrum', 'base', 'avalanche', 'worldchain', 'gnosis'],
blockchains: ['ethereum', 'bsc', 'polygon', 'optimism', 'arbitrum', 'base', 'avalanche', 'worldchain', 'gnosis', 'celo'],

ethereum: {
router: {
Expand Down Expand Up @@ -211,6 +211,28 @@ const exchange = {
}
},

celo: {
router: {
address: '0x5615CDAb10dc425a742d643d949a7F474C01abc4',
api: UniswapV3.ROUTER
},
factory: {
address: '0xAfE208a311B21f13EF87E33A90049fC17A7acDEc',
api: UniswapV3.FACTORY
},
pool: {
api: UniswapV3.POOL
},
quoter: {
address: '0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8',
api: UniswapV3.QUOTER
},
permit: {
address: '0x000000000022D473030F116dDEE9F6B43aC78BA3',
api: UniswapV3.PERMIT2
}
},

}

export default (scope)=>{
Expand Down
37 changes: 37 additions & 0 deletions src/exchanges/wcelo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import Blockchains from '@depay/web3-blockchains'
import Exchange from '../classes/Exchange'
import WETH from '../platforms/evm/weth'

const exchange = {

name: 'wcelo',
label: 'Wrapped Celo',
logo: Blockchains.celo.wrapped.logo,
protocol: 'weth',

slippage: false,

blockchains: ['celo'],

celo: {
router: {
address: Blockchains.celo.wrapped.address,
api: WETH.WETH
},
}
}

export default (scope)=>{

return new Exchange(

Object.assign(exchange, {
scope,
findPath: (args)=>WETH.findPath({ ...args, exchange }),
pathExists: (args)=>WETH.pathExists({ ...args, exchange }),
getAmounts: (args)=>WETH.getAmounts({ ...args, exchange }),
getPrep: (args)=>{},
getTransaction: (args)=>WETH.getTransaction({ ...args, exchange }),
})
)
}