Skip to content

Commit

Permalink
feat: add PGN Mainnet & Testnet chain (#1533)
Browse files Browse the repository at this point in the history
* Add PGN Mainnet & Testnet chain

* Update pgn.ts

* Update pgnTestnet.ts

---------

Co-authored-by: jxom <jakemoxey@gmail.com>
  • Loading branch information
laitsky and jxom committed Nov 24, 2023
1 parent 9361f34 commit 5897b5b
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-lemons-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Added PGN Mainnet & Testnet chain
38 changes: 38 additions & 0 deletions src/chains/definitions/pgn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { defineChain } from '../../utils/chain/defineChain.js'
import { formattersOptimism } from '../optimism/formatters.js'

export const pgn = /*#__PURE__*/ defineChain(
{
id: 424,
network: 'pgn',
name: 'PGN',
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: ['https://rpc.publicgoods.network'],
},
public: {
http: ['https://rpc.publicgoods.network'],
},
},
blockExplorers: {
default: {
name: 'PGN Explorer',
url: 'https://explorer.publicgoods.network',
},
blocksout: {
name: 'PGN Explorer',
url: 'https://explorer.publicgoods.network',
},
},
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 3380209,
},
},
},
{
formatters: formattersOptimism,
},
)
39 changes: 39 additions & 0 deletions src/chains/definitions/pgnTestnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { defineChain } from '../../utils/chain/defineChain.js'
import { formattersOptimism } from '../optimism/formatters.js'

export const pgnTestnet = /*#__PURE__*/ defineChain(
{
id: 58008,
network: 'pgn-testnet',
name: 'PGN ',
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: ['https://sepolia.publicgoods.network'],
},
public: {
http: ['https://sepolia.publicgoods.network'],
},
},
blockExplorers: {
default: {
name: 'PGN Testnet Explorer',
url: 'https://explorer.sepolia.publicgoods.network',
},
blocksout: {
name: 'PGN Testnet Explorer',
url: 'https://explorer.sepolia.publicgoods.network',
},
},
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 3754925,
},
},
testnet: true,
},
{
formatters: formattersOptimism,
},
)
2 changes: 2 additions & 0 deletions src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export { optimismGoerli } from './definitions/optimismGoerli.js'
export { optimismSepolia } from './definitions/optimismSepolia.js'
export { opBNB } from './definitions/opBNB.js'
export { opBNBTestnet } from './definitions/opBNBTestnet.js'
export { pgn } from './definitions/pgn.js'
export { pgnTestnet } from './definitions/pgnTestnet.js'
export { plinga } from './definitions/plinga.js'
export { polygon } from './definitions/polygon.js'
export { polygonMumbai } from './definitions/polygonMumbai.js'
Expand Down

0 comments on commit 5897b5b

Please sign in to comment.