diff --git a/dist/esm/index.js b/dist/esm/index.js index b1df18b..1584ff1 100644 --- a/dist/esm/index.js +++ b/dist/esm/index.js @@ -529,10 +529,8 @@ const logo = 'data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMzMgMzIiIGZpbGw9 var worldchain = { name: 'worldchain', - // id: '0x1e0', - // networkId: '480', - id: '0xa', - networkId: '10', + id: '0x1e0', + networkId: '480', namespace: 'eip155', platform: 'evm', label: 'World Chain', @@ -551,47 +549,24 @@ var worldchain = { address: '0x4200000000000000000000000000000000000006', logo: ethereum.wrapped.logo, }, - // stables: { // max. 2 per fiat currency - // usd: ['0x79A02482A880bCE3F13e09Da970dC34db4CD24d1'] - // }, - // explorer: 'https://worldchain-mainnet.explorer.alchemy.com', - // explorerUrlFor: ({ transaction, token, address })=>{ - // if(transaction) { return `https://worldchain-mainnet.explorer.alchemy.com/tx/${transaction.id || transaction}` } - // if(token) { return `https://worldchain-mainnet.explorer.alchemy.com/token/${token}` } - // if(address) { return `https://worldchain-mainnet.explorer.alchemy.com/address/${address}` } - // }, stables: { // max. 2 per fiat currency - usd: ['0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', '0x7F5c764cBc14f9669B88837ca1490cCa17c31607'] + usd: ['0x79A02482A880bCE3F13e09Da970dC34db4CD24d1'] }, - explorer: 'https://optimistic.etherscan.io', + explorer: 'https://worldchain-mainnet.explorer.alchemy.com', explorerUrlFor: ({ transaction, token, address })=>{ - if(transaction) { return `https://optimistic.etherscan.io/tx/${transaction.id || transaction}` } - if(token) { return `https://optimistic.etherscan.io/token/${token}` } - if(address) { return `https://optimistic.etherscan.io/address/${address}` } + if(transaction) { return `https://worldchain-mainnet.explorer.alchemy.com/tx/${transaction.id || transaction}` } + if(token) { return `https://worldchain-mainnet.explorer.alchemy.com/token/${token}` } + if(address) { return `https://worldchain-mainnet.explorer.alchemy.com/address/${address}` } }, endpoints: [ // make sure provider supports batch size of 50 batch requests! - 'https://endpoints.omniatech.io/v1/op/mainnet/public', - 'https://optimism.llamarpc.com', - 'https://optimism.publicnode.com' + 'https://worldchain-mainnet.blastapi.io/1b1a6314-79bf-4afe-b48b-c943fca35292', + 'https://worldchain-mainnet.g.alchemy.com/public' ], - // endpoints: [ // make sure provider supports batch size of 50 batch requests! - // 'https://worldchain-mainnet.blastapi.io/1b1a6314-79bf-4afe-b48b-c943fca35292', - // 'https://worldchain-mainnet.g.alchemy.com/public' - // ], tokens: [ // only major tokens {"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "symbol": "ETH", "name": "Ether", "decimals": 18, "logo": ethereum.currency.logo, "type": "NATIVE"}, {"address": "0x4200000000000000000000000000000000000006", "symbol": "WETH", "name": "Wrapped Ether", "decimals": 18, "logo": ethereum.wrapped.logo, "type": "20"}, - {"address": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", "symbol": "USDT", "name": "Tether", "decimals": 6, "logo": 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x94b008aA00579c1307B0EF2c499aD98a8ce58e58/logo.png', "type": "20"}, - {"address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", "symbol": "USDC", "name": "USD Coin", "decimals": 6, "logo": 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x7F5c764cBc14f9669B88837ca1490cCa17c31607/logo.png', "type": "20"}, - {"address": "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1", "symbol": "DAI", "name": "Dai Stablecoin", "decimals": 18, "logo": 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png', "type": "20"}, - {"address": "0x4200000000000000000000000000000000000042", "symbol": "OP", "name": "Optimism", "decimals": 18, "logo": 'https://user-images.githubusercontent.com/1300064/219575413-d7990d69-1d21-44ef-a2b1-e9c682c79802.svg', "type": "20"}, + {"address": "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1", "symbol": "USDC.e", "name": "Bridged USDC", "decimals": 6, "logo": "", "type": "20"} ], - // tokens: [ // only major tokens - // {"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "symbol": "ETH", "name": "Ether", "decimals": 18, "logo": ethereum.currency.logo, "type": "NATIVE"}, - // {"address": "0x4200000000000000000000000000000000000006", "symbol": "WETH", "name": "Wrapped Ether", "decimals": 18, "logo": ethereum.wrapped.logo, "type": "20"}, - // {"address": "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1", "symbol": "USDC.e", "name": "Bridged USDC", "decimals": 6, "logo": "", "type": "20"}, - // {"address": "", "symbol": "WLD", "name": "Bridged USDC", "decimals": 6, "logo": "", "type": "20"}, - // ], zero: '0x0000000000000000000000000000000000000000', maxInt: '115792089237316195423570985008687907853269984665640564039457584007913129639935', permit2: '0x000000000022D473030F116dDEE9F6B43aC78BA3' diff --git a/dist/umd/index.js b/dist/umd/index.js index 7eb07d0..de69de5 100644 --- a/dist/umd/index.js +++ b/dist/umd/index.js @@ -535,10 +535,8 @@ var worldchain = { name: 'worldchain', - // id: '0x1e0', - // networkId: '480', - id: '0xa', - networkId: '10', + id: '0x1e0', + networkId: '480', namespace: 'eip155', platform: 'evm', label: 'World Chain', @@ -557,47 +555,24 @@ address: '0x4200000000000000000000000000000000000006', logo: ethereum.wrapped.logo, }, - // stables: { // max. 2 per fiat currency - // usd: ['0x79A02482A880bCE3F13e09Da970dC34db4CD24d1'] - // }, - // explorer: 'https://worldchain-mainnet.explorer.alchemy.com', - // explorerUrlFor: ({ transaction, token, address })=>{ - // if(transaction) { return `https://worldchain-mainnet.explorer.alchemy.com/tx/${transaction.id || transaction}` } - // if(token) { return `https://worldchain-mainnet.explorer.alchemy.com/token/${token}` } - // if(address) { return `https://worldchain-mainnet.explorer.alchemy.com/address/${address}` } - // }, stables: { // max. 2 per fiat currency - usd: ['0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', '0x7F5c764cBc14f9669B88837ca1490cCa17c31607'] + usd: ['0x79A02482A880bCE3F13e09Da970dC34db4CD24d1'] }, - explorer: 'https://optimistic.etherscan.io', + explorer: 'https://worldchain-mainnet.explorer.alchemy.com', explorerUrlFor: ({ transaction, token, address })=>{ - if(transaction) { return `https://optimistic.etherscan.io/tx/${transaction.id || transaction}` } - if(token) { return `https://optimistic.etherscan.io/token/${token}` } - if(address) { return `https://optimistic.etherscan.io/address/${address}` } + if(transaction) { return `https://worldchain-mainnet.explorer.alchemy.com/tx/${transaction.id || transaction}` } + if(token) { return `https://worldchain-mainnet.explorer.alchemy.com/token/${token}` } + if(address) { return `https://worldchain-mainnet.explorer.alchemy.com/address/${address}` } }, endpoints: [ // make sure provider supports batch size of 50 batch requests! - 'https://endpoints.omniatech.io/v1/op/mainnet/public', - 'https://optimism.llamarpc.com', - 'https://optimism.publicnode.com' + 'https://worldchain-mainnet.blastapi.io/1b1a6314-79bf-4afe-b48b-c943fca35292', + 'https://worldchain-mainnet.g.alchemy.com/public' ], - // endpoints: [ // make sure provider supports batch size of 50 batch requests! - // 'https://worldchain-mainnet.blastapi.io/1b1a6314-79bf-4afe-b48b-c943fca35292', - // 'https://worldchain-mainnet.g.alchemy.com/public' - // ], tokens: [ // only major tokens {"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "symbol": "ETH", "name": "Ether", "decimals": 18, "logo": ethereum.currency.logo, "type": "NATIVE"}, {"address": "0x4200000000000000000000000000000000000006", "symbol": "WETH", "name": "Wrapped Ether", "decimals": 18, "logo": ethereum.wrapped.logo, "type": "20"}, - {"address": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", "symbol": "USDT", "name": "Tether", "decimals": 6, "logo": 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x94b008aA00579c1307B0EF2c499aD98a8ce58e58/logo.png', "type": "20"}, - {"address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", "symbol": "USDC", "name": "USD Coin", "decimals": 6, "logo": 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x7F5c764cBc14f9669B88837ca1490cCa17c31607/logo.png', "type": "20"}, - {"address": "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1", "symbol": "DAI", "name": "Dai Stablecoin", "decimals": 18, "logo": 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png', "type": "20"}, - {"address": "0x4200000000000000000000000000000000000042", "symbol": "OP", "name": "Optimism", "decimals": 18, "logo": 'https://user-images.githubusercontent.com/1300064/219575413-d7990d69-1d21-44ef-a2b1-e9c682c79802.svg', "type": "20"}, + {"address": "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1", "symbol": "USDC.e", "name": "Bridged USDC", "decimals": 6, "logo": "", "type": "20"} ], - // tokens: [ // only major tokens - // {"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "symbol": "ETH", "name": "Ether", "decimals": 18, "logo": ethereum.currency.logo, "type": "NATIVE"}, - // {"address": "0x4200000000000000000000000000000000000006", "symbol": "WETH", "name": "Wrapped Ether", "decimals": 18, "logo": ethereum.wrapped.logo, "type": "20"}, - // {"address": "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1", "symbol": "USDC.e", "name": "Bridged USDC", "decimals": 6, "logo": "", "type": "20"}, - // {"address": "", "symbol": "WLD", "name": "Bridged USDC", "decimals": 6, "logo": "", "type": "20"}, - // ], zero: '0x0000000000000000000000000000000000000000', maxInt: '115792089237316195423570985008687907853269984665640564039457584007913129639935', permit2: '0x000000000022D473030F116dDEE9F6B43aC78BA3' diff --git a/package.json b/package.json index 4b33194..93048b7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@depay/web3-blockchains", "moduleName": "Web3Blockchains", - "version": "9.6.0", + "version": "9.6.1", "description": "JavaScript library containing aggregated information and abstractions for web3 blockchains.", "main": "dist/umd/index.js", "module": "dist/esm/index.js", diff --git a/src/blockchains/worldchain.js b/src/blockchains/worldchain.js index eeb03a3..3900bc9 100644 --- a/src/blockchains/worldchain.js +++ b/src/blockchains/worldchain.js @@ -3,10 +3,8 @@ import ethereum from './ethereum' export default { name: 'worldchain', - // id: '0x1e0', - // networkId: '480', - id: '0xa', - networkId: '10', + id: '0x1e0', + networkId: '480', namespace: 'eip155', platform: 'evm', label: 'World Chain', @@ -25,47 +23,24 @@ export default { address: '0x4200000000000000000000000000000000000006', logo: ethereum.wrapped.logo, }, - // stables: { // max. 2 per fiat currency - // usd: ['0x79A02482A880bCE3F13e09Da970dC34db4CD24d1'] - // }, - // explorer: 'https://worldchain-mainnet.explorer.alchemy.com', - // explorerUrlFor: ({ transaction, token, address })=>{ - // if(transaction) { return `https://worldchain-mainnet.explorer.alchemy.com/tx/${transaction.id || transaction}` } - // if(token) { return `https://worldchain-mainnet.explorer.alchemy.com/token/${token}` } - // if(address) { return `https://worldchain-mainnet.explorer.alchemy.com/address/${address}` } - // }, stables: { // max. 2 per fiat currency - usd: ['0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', '0x7F5c764cBc14f9669B88837ca1490cCa17c31607'] + usd: ['0x79A02482A880bCE3F13e09Da970dC34db4CD24d1'] }, - explorer: 'https://optimistic.etherscan.io', + explorer: 'https://worldchain-mainnet.explorer.alchemy.com', explorerUrlFor: ({ transaction, token, address })=>{ - if(transaction) { return `https://optimistic.etherscan.io/tx/${transaction.id || transaction}` } - if(token) { return `https://optimistic.etherscan.io/token/${token}` } - if(address) { return `https://optimistic.etherscan.io/address/${address}` } + if(transaction) { return `https://worldchain-mainnet.explorer.alchemy.com/tx/${transaction.id || transaction}` } + if(token) { return `https://worldchain-mainnet.explorer.alchemy.com/token/${token}` } + if(address) { return `https://worldchain-mainnet.explorer.alchemy.com/address/${address}` } }, endpoints: [ // make sure provider supports batch size of 50 batch requests! - 'https://endpoints.omniatech.io/v1/op/mainnet/public', - 'https://optimism.llamarpc.com', - 'https://optimism.publicnode.com' + 'https://worldchain-mainnet.blastapi.io/1b1a6314-79bf-4afe-b48b-c943fca35292', + 'https://worldchain-mainnet.g.alchemy.com/public' ], - // endpoints: [ // make sure provider supports batch size of 50 batch requests! - // 'https://worldchain-mainnet.blastapi.io/1b1a6314-79bf-4afe-b48b-c943fca35292', - // 'https://worldchain-mainnet.g.alchemy.com/public' - // ], tokens: [ // only major tokens {"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "symbol": "ETH", "name": "Ether", "decimals": 18, "logo": ethereum.currency.logo, "type": "NATIVE"}, {"address": "0x4200000000000000000000000000000000000006", "symbol": "WETH", "name": "Wrapped Ether", "decimals": 18, "logo": ethereum.wrapped.logo, "type": "20"}, - {"address": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", "symbol": "USDT", "name": "Tether", "decimals": 6, "logo": 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x94b008aA00579c1307B0EF2c499aD98a8ce58e58/logo.png', "type": "20"}, - {"address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", "symbol": "USDC", "name": "USD Coin", "decimals": 6, "logo": 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x7F5c764cBc14f9669B88837ca1490cCa17c31607/logo.png', "type": "20"}, - {"address": "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1", "symbol": "DAI", "name": "Dai Stablecoin", "decimals": 18, "logo": 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png', "type": "20"}, - {"address": "0x4200000000000000000000000000000000000042", "symbol": "OP", "name": "Optimism", "decimals": 18, "logo": 'https://user-images.githubusercontent.com/1300064/219575413-d7990d69-1d21-44ef-a2b1-e9c682c79802.svg', "type": "20"}, + {"address": "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1", "symbol": "USDC.e", "name": "Bridged USDC", "decimals": 6, "logo": "", "type": "20"} ], - // tokens: [ // only major tokens - // {"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "symbol": "ETH", "name": "Ether", "decimals": 18, "logo": ethereum.currency.logo, "type": "NATIVE"}, - // {"address": "0x4200000000000000000000000000000000000006", "symbol": "WETH", "name": "Wrapped Ether", "decimals": 18, "logo": ethereum.wrapped.logo, "type": "20"}, - // {"address": "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1", "symbol": "USDC.e", "name": "Bridged USDC", "decimals": 6, "logo": "", "type": "20"}, - // {"address": "", "symbol": "WLD", "name": "Bridged USDC", "decimals": 6, "logo": "", "type": "20"}, - // ], zero: '0x0000000000000000000000000000000000000000', maxInt: '115792089237316195423570985008687907853269984665640564039457584007913129639935', permit2: '0x000000000022D473030F116dDEE9F6B43aC78BA3' diff --git a/tests/units/blockchains/worldchain.spec.js b/tests/units/blockchains/worldchain.spec.js index cc2d5ae..292d330 100644 --- a/tests/units/blockchains/worldchain.spec.js +++ b/tests/units/blockchains/worldchain.spec.js @@ -5,8 +5,8 @@ describe('worldchain', () => { it('provides basic structured data', () => { let blockchain = Blockchains.findByName('worldchain'); expect(blockchain.name).toEqual('worldchain'); - expect(blockchain.id).toEqual('0xa'); - expect(blockchain.networkId).toEqual('10'); + expect(blockchain.id).toEqual('0x1e0'); + expect(blockchain.networkId).toEqual('480'); expect(blockchain.namespace).toEqual('eip155'); expect(blockchain.label).toEqual('World Chain'); expect(blockchain.fullName).toEqual('World Chain Mainnet'); @@ -19,20 +19,20 @@ describe('worldchain', () => { expect(blockchain.currency.address).toEqual('0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'); expect(blockchain.wrapped.logo).toEqual("https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"); expect(blockchain.wrapped.address).toEqual('0x4200000000000000000000000000000000000006'); - // expect(blockchain.stables.usd).toEqual([]); - // expect(blockchain.explorer).toEqual('https://worldchain-mainnet.explorer.alchemy.com'); - // expect(blockchain.explorerUrlFor({ - // transaction: { id: '0x1907a9841e7abbc08e63586e5c9abbf7d0d42c5dc4a371304f439e2f949f51f' } - // })).toEqual('https://worldchain-mainnet.explorer.alchemy.com/tx/0x1907a9841e7abbc08e63586e5c9abbf7d0d42c5dc4a371304f439e2f949f51f') - // expect(blockchain.explorerUrlFor({ - // transaction: '0x1907a9841e7abbc08e63586e5c9abbf7d0d42c5dc4a371304f439e2f949f51f' - // })).toEqual('https://worldchain-mainnet.explorer.alchemy.com/tx/0x1907a9841e7abbc08e63586e5c9abbf7d0d42c5dc4a371304f439e2f949f51f') - // expect(blockchain.explorerUrlFor({ - // token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb' - // })).toEqual('https://worldchain-mainnet.explorer.alchemy.com/token/0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb') - // expect(blockchain.explorerUrlFor({ - // address: '0x08B277154218CCF3380CAE48d630DA13462E3950' - // })).toEqual('https://worldchain-mainnet.explorer.alchemy.com/address/0x08B277154218CCF3380CAE48d630DA13462E3950') + expect(blockchain.stables.usd).toEqual(['0x79A02482A880bCE3F13e09Da970dC34db4CD24d1']); + expect(blockchain.explorer).toEqual('https://worldchain-mainnet.explorer.alchemy.com'); + expect(blockchain.explorerUrlFor({ + transaction: { id: '0x1907a9841e7abbc08e63586e5c9abbf7d0d42c5dc4a371304f439e2f949f51f' } + })).toEqual('https://worldchain-mainnet.explorer.alchemy.com/tx/0x1907a9841e7abbc08e63586e5c9abbf7d0d42c5dc4a371304f439e2f949f51f') + expect(blockchain.explorerUrlFor({ + transaction: '0x1907a9841e7abbc08e63586e5c9abbf7d0d42c5dc4a371304f439e2f949f51f' + })).toEqual('https://worldchain-mainnet.explorer.alchemy.com/tx/0x1907a9841e7abbc08e63586e5c9abbf7d0d42c5dc4a371304f439e2f949f51f') + expect(blockchain.explorerUrlFor({ + token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb' + })).toEqual('https://worldchain-mainnet.explorer.alchemy.com/token/0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb') + expect(blockchain.explorerUrlFor({ + address: '0x08B277154218CCF3380CAE48d630DA13462E3950' + })).toEqual('https://worldchain-mainnet.explorer.alchemy.com/address/0x08B277154218CCF3380CAE48d630DA13462E3950') expect(blockchain.zero).toEqual('0x0000000000000000000000000000000000000000'); expect(blockchain.maxInt).toEqual('115792089237316195423570985008687907853269984665640564039457584007913129639935'); expect(blockchain.permit2).toEqual('0x000000000022D473030F116dDEE9F6B43aC78BA3');