Skip to content

Commit beefc29

Browse files
authored
Merge pull request #1235 from MoralisWeb3/feat/flow-mainnet-testnet
feat: add support for flow mainnet and testnet
2 parents 71d2b43 + 5d4b2eb commit beefc29

File tree

4 files changed

+153
-16
lines changed

4 files changed

+153
-16
lines changed

.changeset/proud-plants-punch.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@moralisweb3/common-evm-utils': patch
3+
'@moralisweb3/evm-api': patch
4+
'moralis': patch
5+
---
6+
7+
Add support for Flow mainnet and testnet

packages/common/evmUtils/src/data/chaindata.ts

Lines changed: 121 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,12 @@ export const chainList: EvmChainListDataEntry[] = [
338338
],
339339
faucets: [],
340340
nativeCurrency: {
341-
name: 'MATIC',
342-
symbol: 'MATIC',
341+
name: 'POL',
342+
symbol: 'POL',
343343
decimals: 18,
344344
},
345345
infoURL: 'https://polygon.technology/',
346-
shortName: 'matic',
346+
shortName: 'pol',
347347
chainId: 137,
348348
networkId: 137,
349349
slip44: 966,
@@ -397,12 +397,66 @@ export const chainList: EvmChainListDataEntry[] = [
397397
},
398398
],
399399
},
400+
{
401+
name: 'EVM on Flow Testnet',
402+
chain: 'Flow',
403+
rpc: ['https://testnet.evm.nodes.onflow.org'],
404+
faucets: ['https://faucet.flow.com/fund-account'],
405+
nativeCurrency: {
406+
name: 'FLOW',
407+
symbol: 'FLOW',
408+
decimals: 18,
409+
},
410+
infoURL: 'https://developers.flow.com/evm/about',
411+
shortName: 'flow-testnet',
412+
chainId: 545,
413+
networkId: 545,
414+
icon: 'flowevm',
415+
explorers: [
416+
{
417+
name: 'FlowScan Testnet',
418+
url: 'https://evm-testnet.flowscan.io',
419+
standard: 'EIP3091',
420+
},
421+
],
422+
},
423+
{
424+
name: 'EVM on Flow',
425+
chain: 'Flow',
426+
rpc: ['https://mainnet.evm.nodes.onflow.org'],
427+
faucets: [],
428+
nativeCurrency: {
429+
name: 'FLOW',
430+
symbol: 'FLOW',
431+
decimals: 18,
432+
},
433+
infoURL: 'https://developers.flow.com/evm/about',
434+
shortName: 'flow-mainnet',
435+
chainId: 747,
436+
networkId: 747,
437+
icon: 'flowevm',
438+
explorers: [
439+
{
440+
name: 'FlowScan',
441+
url: 'https://evm.flowscan.io',
442+
standard: 'EIP3091',
443+
},
444+
],
445+
},
400446
{
401447
name: 'Moonbeam',
402448
chain: 'MOON',
403449
rpc: [
404450
'https://rpc.api.moonbeam.network',
405451
'wss://wss.api.moonbeam.network',
452+
'https://moonbeam.public.blastapi.io',
453+
'wss://moonbeam.public.blastapi.io',
454+
'https://moonbeam-rpc.dwellir.com',
455+
'wss://moonbeam-rpc.dwellir.com',
456+
'https://moonbeam.api.onfinality.io/public',
457+
'wss://moonbeam.api.onfinality.io/public-ws',
458+
'https://moonbeam.unitedbloc.com',
459+
'wss://moonbeam.unitedbloc.com',
406460
'https://moonbeam-rpc.publicnode.com',
407461
'wss://moonbeam-rpc.publicnode.com',
408462
'https://moonbeam.drpc.org',
@@ -432,6 +486,14 @@ export const chainList: EvmChainListDataEntry[] = [
432486
rpc: [
433487
'https://rpc.api.moonriver.moonbeam.network',
434488
'wss://wss.api.moonriver.moonbeam.network',
489+
'https://moonriver.public.blastapi.io',
490+
'wss://moonriver.public.blastapi.io',
491+
'https://moonriver-rpc.dwellir.com',
492+
'wss://moonriver-rpc.dwellir.com',
493+
'https://moonriver.api.onfinality.io/public',
494+
'wss://moonriver.api.onfinality.io/public-ws',
495+
'https://moonriver.unitedbloc.com',
496+
'wss://moonriver.unitedbloc.com',
435497
'https://moonriver-rpc.publicnode.com',
436498
'wss://moonriver-rpc.publicnode.com',
437499
'https://moonriver.drpc.org',
@@ -461,6 +523,14 @@ export const chainList: EvmChainListDataEntry[] = [
461523
rpc: [
462524
'https://rpc.api.moonbase.moonbeam.network',
463525
'wss://wss.api.moonbase.moonbeam.network',
526+
'https://moonbase-alpha.public.blastapi.io',
527+
'wss://moonbase-alpha.public.blastapi.io',
528+
'https://moonbase-rpc.dwellir.com',
529+
'wss://moonbase-rpc.dwellir.com',
530+
'https://moonbeam-alpha.api.onfinality.io/public',
531+
'wss://moonbeam-alpha.api.onfinality.io/public-ws',
532+
'https://moonbase.unitedbloc.com',
533+
'wss://moonbase.unitedbloc.com',
464534
'https://moonbase-alpha.drpc.org',
465535
'wss://moonbase-alpha.drpc.org',
466536
],
@@ -470,7 +540,7 @@ export const chainList: EvmChainListDataEntry[] = [
470540
symbol: 'DEV',
471541
decimals: 18,
472542
},
473-
infoURL: 'https://docs.moonbeam.network/networks/testnet/',
543+
infoURL: 'https://docs.moonbeam.network/learn/platform/networks/moonbase/',
474544
shortName: 'mbase',
475545
chainId: 1287,
476546
networkId: 1287,
@@ -606,6 +676,7 @@ export const chainList: EvmChainListDataEntry[] = [
606676
'wss://ethereum-holesky-rpc.publicnode.com',
607677
'https://holesky.drpc.org',
608678
'wss://holesky.drpc.org',
679+
'https://rpc-holesky.rockx.com',
609680
],
610681
faucets: ['https://faucet.holesky.ethpandaops.io', 'https://holesky-faucet.pk910.de'],
611682
nativeCurrency: {
@@ -759,6 +830,8 @@ export const chainList: EvmChainListDataEntry[] = [
759830
'wss://rpc.sepolia.linea.build',
760831
'https://linea-sepolia.infura.io/v3/${INFURA_API_KEY}',
761832
'wss://linea-sepolia.infura.io/ws/v3/${INFURA_API_KEY}',
833+
'https://linea-sepolia-rpc.publicnode.com',
834+
'wss://linea-sepolia-rpc.publicnode.com',
762835
],
763836
faucets: [],
764837
nativeCurrency: {
@@ -806,6 +879,8 @@ export const chainList: EvmChainListDataEntry[] = [
806879
'wss://rpc.linea.build',
807880
'https://linea-mainnet.infura.io/v3/${INFURA_API_KEY}',
808881
'wss://linea-mainnet.infura.io/ws/v3/${INFURA_API_KEY}',
882+
'https://linea-rpc.publicnode.com',
883+
'wss://linea-rpc.publicnode.com',
809884
],
810885
faucets: [],
811886
nativeCurrency: {
@@ -981,24 +1056,54 @@ export const chainList: EvmChainListDataEntry[] = [
9811056
],
9821057
},
9831058
{
984-
name: 'IVAR Chain Mainnet',
985-
chain: 'IVAR',
986-
icon: 'ivar',
987-
rpc: ['https://mainnet-rpc.ivarex.com'],
988-
faucets: ['https://faucet.ivarex.com/'],
1059+
name: 'Chiliz Spicy Testnet',
1060+
chain: 'CHZ',
1061+
rpc: ['https://spicy-rpc.chiliz.com'],
1062+
faucets: ['https://spicy-faucet.chiliz.com', 'https://tatum.io/faucets/chiliz'],
9891063
nativeCurrency: {
990-
name: 'Ivar',
991-
symbol: 'IVAR',
1064+
name: 'Chiliz',
1065+
symbol: 'CHZ',
9921066
decimals: 18,
9931067
},
994-
infoURL: 'https://ivarex.com',
995-
shortName: 'ivar',
1068+
icon: 'chilizspicy',
1069+
infoURL: 'https://www.chiliz.com/en/chain',
1070+
shortName: 'chzspicy',
1071+
chainId: 88882,
1072+
networkId: 88882,
1073+
slip44: 1,
1074+
explorers: [
1075+
{
1076+
name: 'spicy-explorer',
1077+
url: 'https://testnet.chiliscan.com',
1078+
standard: 'EIP3091',
1079+
},
1080+
],
1081+
},
1082+
{
1083+
name: 'Chiliz Chain Mainnet',
1084+
chain: 'CHZ',
1085+
icon: 'chilizchain',
1086+
rpc: ['https://rpc.chiliz.com', 'https://rpc.ankr.com/chiliz', 'https://chiliz.publicnode.com'],
1087+
faucets: ['https://spicy-faucet.chiliz.com', 'https://tatum.io/faucets/chiliz'],
1088+
nativeCurrency: {
1089+
name: 'Chiliz',
1090+
symbol: 'CHZ',
1091+
decimals: 18,
1092+
},
1093+
infoURL: 'https://chiliz.com',
1094+
shortName: 'chzmainnet',
9961095
chainId: 88888,
9971096
networkId: 88888,
1097+
redFlags: ['reusedChainId'],
9981098
explorers: [
9991099
{
1000-
name: 'ivarscan',
1001-
url: 'https://ivarscan.com',
1100+
name: 'chiliscan',
1101+
url: 'https://chiliscan.com',
1102+
standard: 'EIP3091',
1103+
},
1104+
{
1105+
name: 'chilizscan',
1106+
url: 'https://scan.chiliz.com',
10021107
standard: 'EIP3091',
10031108
},
10041109
],
@@ -1057,6 +1162,7 @@ export const chainList: EvmChainListDataEntry[] = [
10571162
'wss://ethereum-sepolia-rpc.publicnode.com',
10581163
'https://sepolia.drpc.org',
10591164
'wss://sepolia.drpc.org',
1165+
'https://rpc-sepolia.rockx.com',
10601166
],
10611167
faucets: ['http://fauceth.komputing.org?chain=11155111&address=${ADDRESS}'],
10621168
nativeCurrency: {

packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ describe('EvmChain', () => {
128128
expect(EvmChain.MOONRIVER.apiHex).toBe('0x505');
129129
expect(EvmChain.MOONBASE.apiHex).toBe('0x507');
130130
expect(EvmChain.LINEA_SEPOLIA.apiHex).toBe('0xe705');
131+
expect(EvmChain.FLOW.apiHex).toBe('0x2eb');
132+
expect(EvmChain.FLOW_TESTNET.apiHex).toBe('0x221');
131133
});
132134

133135
describe('metadata', () => {

packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,24 @@ export class EvmChain implements EvmChainable {
295295
return EvmChain.create(59141);
296296
}
297297

298+
/**
299+
* Returns FLOW mainnet chain
300+
*
301+
* @example EvmChain.FLOW
302+
*/
303+
public static get FLOW() {
304+
return EvmChain.create(747);
305+
}
306+
307+
/**
308+
* Returns FLOW testnet chain
309+
*
310+
* @example EvmChain.FLOW_TESTNET
311+
*/
312+
public static get FLOW_TESTNET() {
313+
return EvmChain.create(0x221);
314+
}
315+
298316
/**
299317
* Create a new instance of EvmChain from any valid address input.
300318
*
@@ -381,6 +399,8 @@ export class EvmChain implements EvmChainable {
381399
EvmChain.MOONRIVER,
382400
EvmChain.MOONBASE,
383401
EvmChain.LINEA_SEPOLIA,
402+
EvmChain.FLOW,
403+
EvmChain.FLOW_TESTNET,
384404
];
385405
}
386406

@@ -497,7 +517,9 @@ export class EvmChain implements EvmChainable {
497517
| '0x504'
498518
| '0x505'
499519
| '0x507'
500-
| '0xe705';
520+
| '0xe705'
521+
| '0x2eb'
522+
| '0x221';
501523
}
502524

503525
/**

0 commit comments

Comments
 (0)