Skip to content

Commit

Permalink
feat: add worldcoin assets (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
myz1237 authored Dec 9, 2024
1 parent 76ec97b commit adddbe8
Show file tree
Hide file tree
Showing 5 changed files with 83 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": "^v16.2.1"
"@lifi/types": "^v16.4.0"
},
"devDependencies": {
"@commitlint/cli": "^19.5.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 @@ -1068,4 +1068,32 @@ export const supportedEVMChains: EVMChain[] = [
],
},
},

// 480 - WCC
{
key: ChainKey.WCC,
chainType: ChainType.EVM,
name: 'World Chain',
coin: CoinKey.ETH,
id: ChainId.WCC,
mainnet: true,
logoURI:
'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/world.svg',
multicallAddress: multicallAddresses[ChainId.WCC],

metamask: {
chainId: prefixChainId(480),
blockExplorerUrls: ['worldscan.org'],
chainName: 'Worldchain Mainnet',
nativeCurrency: {
name: 'Ethereum',
symbol: 'ETH',
decimals: 18,
},
rpcUrls: [
'https://worldchain-mainnet.g.alchemy.com/public',
'https://worldchain-mainnet.gateway.tenderly.co',
],
},
},
]
48 changes: 48 additions & 0 deletions src/coins/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ export const basicCoins: BasicCoin[] = [
address: '0xE7798f023fC62146e8Aa1b36Da45fb70855a77Ea',
decimals: 18,
},
[ChainId.WCC]: {
address: '0x0000000000000000000000000000000000000000',
decimals: 18,
},
},
},
// > MATIC
Expand Down Expand Up @@ -842,6 +846,12 @@ export const basicCoins: BasicCoin[] = [
name: 'Bridged USD Coin',
symbol: 'USDC.e',
},
[ChainId.WCC]: {
address: '0x79A02482A880bCE3F13e09Da970dC34db4CD24d1',
decimals: 6,
name: 'Bridged USDC (world-chain-mainnet)',
symbol: 'USDC.e',
},
},
},
// axlUSDC
Expand Down Expand Up @@ -1139,6 +1149,10 @@ export const basicCoins: BasicCoin[] = [
address: '0xea034fb02eb1808c2cc3adbc15f447b93cbe08e1',
decimals: 8,
},
[ChainId.WCC]: {
address: '0x03C7054BCB39f7b2e5B2c7AcB37583e32D70Cfa3',
decimals: 8,
},
},
},

Expand Down Expand Up @@ -1801,6 +1815,29 @@ export const basicCoins: BasicCoin[] = [
},
},

// WLD
{
key: CoinKey.WLD,
name: CoinKey.WLD,
logoURI:
'https://static.debank.com/image/eth_token/logo_url/0x163f8c2467924be0ae7b5347228cabf260318753/30ac094d49a4b6e7561810c16ddc8c69.png',
verified: true,
chains: {
[ChainId.ETH]: {
address: '0x163f8c2467924be0ae7b5347228cabf260318753',
decimals: 18,
},
[ChainId.OPT]: {
address: '0xdC6fF44d5d932Cbd77B52E5612Ba0529DC6226F1',
decimals: 18,
},
[ChainId.WCC]: {
address: '0x2cFc85d8E48F8EAB294be644d9E25C3030863003',
decimals: 18,
},
},
},

// > Bitcoin
{
key: CoinKey.BTC,
Expand Down Expand Up @@ -2275,6 +2312,17 @@ export const wrappedTokens: { [ChainId: string]: StaticToken } = {
logoURI:
'https://static.debank.com/image/bsc_token/logo_url/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c/1177dec1b9b7f58a799c3f22d93b04e1.png',
},
[ChainId.WCC]: {
// https://worldscan.org/token/0x4200000000000000000000000000000000000006
address: '0x4200000000000000000000000000000000000006',
symbol: 'WETH',
decimals: 18,
chainId: ChainId.WCC,
coinKey: CoinKey.WETH,
name: 'WETH',
logoURI:
'https://static.debank.com/image/world_token/logo_url/world/48bfb74adddd170e936578aec422836d.png',
},
}
export const findDefaultCoin = (coinKey: CoinKey): Coin => {
const coin = defaultCoins.find((coin) => coin.key === coinKey)
Expand Down
1 change: 1 addition & 0 deletions src/multicall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const multicallAddresses: { [ChainId: number]: string } = {
[ChainId.KAI]: '0xcA11bde05977b3631167028862bE2a173976CA11',
[ChainId.XLY]: '0xcA11bde05977b3631167028862bE2a173976CA11',
[ChainId.OPB]: '0xcA11bde05977b3631167028862bE2a173976CA11',
[ChainId.WCC]: '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 @@ -599,7 +599,7 @@ __metadata:
dependencies:
"@commitlint/cli": "npm:^19.5.0"
"@commitlint/config-conventional": "npm:^19.2.2"
"@lifi/types": "npm:^v16.2.1"
"@lifi/types": "npm:^v16.4.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 @@ -620,10 +620,10 @@ __metadata:
languageName: unknown
linkType: soft

"@lifi/types@npm:^v16.2.1":
version: 16.2.1
resolution: "@lifi/types@npm:16.2.1"
checksum: 10/f7648b0ea45b6f4a40a173dc5e1fd57e4a8a96b7d016f396784756abb0c0ffdcff8e68998841abde89009e78f7f4705a0464bd7179bf164d1895a269a728b986
"@lifi/types@npm:^v16.4.0":
version: 16.4.0
resolution: "@lifi/types@npm:16.4.0"
checksum: 10/bee77d21796b7a014f1454d27f978f643451741dae40ea580f24be285056e547139c8f3b9e03be7869dd87871a06c3d7eb28e52edaf8ddec1ef06941726f3a73
languageName: node
linkType: hard

Expand Down

0 comments on commit adddbe8

Please sign in to comment.