Skip to content

Commit

Permalink
feat: enable taiko (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
myz1237 authored Jul 29, 2024
1 parent 8658990 commit 86cf72e
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
]
},
"dependencies": {
"@lifi/types": "^15.0.0"
"@lifi/types": "^15.1.0"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
Expand Down
28 changes: 28 additions & 0 deletions src/chains/supportedChains.evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -899,4 +899,32 @@ export const supportedEVMChains: EVMChain[] = [
rpcUrls: ['https://rpc.frax.com'],
},
},

// 167000 - Taiko
{
key: ChainKey.TAI,
chainType: ChainType.EVM,
name: 'Taiko',
coin: CoinKey.ETH,
id: 167000,
mainnet: true,
logoURI:
'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/taiko.png',
multicallAddress: multicallAddresses[ChainId.TAI],
metamask: {
chainId: prefixChainId(167000),
blockExplorerUrls: ['https://taikoscan.io/'],
chainName: 'Taiko Mainnet',
nativeCurrency: {
name: 'Ethereum',
symbol: 'ETH',
decimals: 18,
},
rpcUrls: [
'https://rpc.mainnet.taiko.xyz',
'https://rpc.taiko.xyz',
'https://rpc.taiko.tools',
],
},
},
]
23 changes: 23 additions & 0 deletions src/coins/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ export const basicCoins: BasicCoin[] = [
address: '0x0000000000000000000000000000000000000000',
decimals: 18,
},
[ChainId.TAI]: {
address: '0x0000000000000000000000000000000000000000',
decimals: 18,
},
},
},
// > MATIC
Expand Down Expand Up @@ -569,6 +573,10 @@ export const basicCoins: BasicCoin[] = [
address: '0xB75D0B03c06A926e488e2659DF1A861F860bD3d1',
decimals: 6,
},
[ChainId.TAI]: {
address: '0x2DEF195713CF4a606B49D07E520e22C17899a736',
decimals: 6,
},
},
},

Expand Down Expand Up @@ -699,6 +707,10 @@ export const basicCoins: BasicCoin[] = [
address: '0x3894085Ef7Ff0f0aeDf52E2A2704928d1Ec074F1',
decimals: 6,
},
[ChainId.TAI]: {
address: '0x07d83526730c7438048D55A4fc0b850e2aaB6f0b',
decimals: 6,
},
},
},
// USDC.e
Expand Down Expand Up @@ -1848,6 +1860,17 @@ export const wrappedTokens: { [ChainId: string]: StaticToken } = {
logoURI:
'https://static.debank.com/image/frax_token/logo_url/0xfc00000000000000000000000000000000000006/4313f25f6c5196e8fce2c80fa34c73d0.png',
},
[ChainId.TAI]: {
// https://taikoscan.io/address/0xa51894664a773981c6c112c43ce576f315d5b1b6
address: '0xa51894664a773981c6c112c43ce576f315d5b1b6',
symbol: 'WETH',
decimals: 18,
chainId: ChainId.TAI,
coinKey: CoinKey.WETH,
name: 'WETH',
logoURI:
'https://static.debank.com/image/mtr_token/logo_url/0x79a61d3a28f8c8537a3df63092927cfa1150fb3c/61844453e63cf81301f845d7864236f6.png',
},
}

export const findDefaultCoin = (coinKey: CoinKey): Coin => {
Expand Down
1 change: 1 addition & 0 deletions src/multicall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const multicallAddresses: { [ChainId: number]: string } = {
[ChainId.BLS]: '0xcA11bde05977b3631167028862bE2a173976CA11',
[ChainId.SEI]: '0xcA11bde05977b3631167028862bE2a173976CA11',
[ChainId.FRA]: '0xcA11bde05977b3631167028862bE2a173976CA11',
[ChainId.TAI]: '0xcA11bde05977b3631167028862bE2a173976CA11',

// TODO
// [ChainId.EXP]: '', // TODO
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ __metadata:
dependencies:
"@commitlint/cli": "npm:^19.3.0"
"@commitlint/config-conventional": "npm:^19.2.2"
"@lifi/types": "npm:^15.0.0"
"@lifi/types": "npm:^15.1.0"
"@solana/web3.js": "npm:^1.95.1"
"@types/fs-extra": "npm:^11.0.4"
"@typescript-eslint/eslint-plugin": "npm:^7.17.0"
Expand All @@ -611,10 +611,10 @@ __metadata:
languageName: unknown
linkType: soft

"@lifi/types@npm:^15.0.0":
version: 15.0.0
resolution: "@lifi/types@npm:15.0.0"
checksum: 10/22bc126bd156eb32dc43c1fdcbeac59b929f96e3025d9f5fca7c7547cee0fbc0adbaad5a548b7a3f4cfcb976f204fa082bac6d0bb741f19fab1788dff75b1e8d
"@lifi/types@npm:^15.1.0":
version: 15.1.0
resolution: "@lifi/types@npm:15.1.0"
checksum: 10/ecb98513416263c65d7b38080385249e836fee419f65f86ee88fbc86f7a3b6724af55d5df6690acdceae611ab266c94449b5c53ddf8af9677659ad6a36912bb9
languageName: node
linkType: hard

Expand Down

0 comments on commit 86cf72e

Please sign in to comment.