From d1ef9b4123d202f35d8e8241e4d190684bc3e96d Mon Sep 17 00:00:00 2001 From: CedarMist <134699267+CedarMist@users.noreply.github.com> Date: Mon, 14 Aug 2023 19:48:18 +0100 Subject: [PATCH] feat: Add Oasis Sapphire & Emerald chains (#471) * Create sapphire.ts * Update sapphire.ts to use hexadecimal chain id (0x5afe) * Create sapphireTestnet.ts * Create emerald.ts * Update sapphire.ts - added webSocket URL * Update emerald.ts - fixed webSocket URLs * added WebSocket URL for sapphire testnet & changed testnet token to TEST * Update emerald.ts * Update sapphire.ts * Update sapphireTestnet.ts * Add changeset * Ran pnpm lint & lint:fix * Add Sapphire, Sapphire Testnet & Emerald to index.ts --------- Co-authored-by: jxom --- .changeset/giant-pandas-laugh.md | 5 ++++ packages/chains/src/emerald.ts | 34 ++++++++++++++++++++++++++ packages/chains/src/index.ts | 3 +++ packages/chains/src/sapphire.ts | 34 ++++++++++++++++++++++++++ packages/chains/src/sapphireTestnet.ts | 28 +++++++++++++++++++++ 5 files changed, 104 insertions(+) create mode 100644 .changeset/giant-pandas-laugh.md create mode 100644 packages/chains/src/emerald.ts create mode 100644 packages/chains/src/sapphire.ts create mode 100644 packages/chains/src/sapphireTestnet.ts diff --git a/.changeset/giant-pandas-laugh.md b/.changeset/giant-pandas-laugh.md new file mode 100644 index 00000000..e4bca1c6 --- /dev/null +++ b/.changeset/giant-pandas-laugh.md @@ -0,0 +1,5 @@ +--- +"@wagmi/chains": patch +--- + +Added Emerald, Sapphire & Sapphire Testnet chains. diff --git a/packages/chains/src/emerald.ts b/packages/chains/src/emerald.ts new file mode 100644 index 00000000..0573f39e --- /dev/null +++ b/packages/chains/src/emerald.ts @@ -0,0 +1,34 @@ +import { Chain } from './types' + +export const emerald = { + id: 42262, + name: 'Oasis Emerald', + network: 'emerald', + nativeCurrency: { + decimals: 18, + name: 'Oasis ROSE', + symbol: 'ROSE', + }, + rpcUrls: { + default: { + http: ['https://emerald.oasis.dev'], + webSocket: ['wss://emerald.oasis.dev/ws'], + }, + public: { + http: ['https://emerald.oasis.dev'], + webSocket: ['wss://emerald.oasis.dev/ws'], + }, + }, + blockExplorers: { + default: { + name: 'Oasis Explorer', + url: 'https://explorer.emerald.oasis.dev', + }, + }, + contracts: { + multicall3: { + address: '0xcA11bde05977b3631167028862bE2a173976CA11', + blockCreated: 1481392, + }, + }, +} as const satisfies Chain diff --git a/packages/chains/src/index.ts b/packages/chains/src/index.ts index 840c25dd..297e07ff 100644 --- a/packages/chains/src/index.ts +++ b/packages/chains/src/index.ts @@ -31,6 +31,7 @@ export { dfk } from './dfk' export { dogechain } from './dogechain' export { edgeware } from './edgeware' export { edgewareTestnet } from './edgewareTestnet' +export { emerald } from './emerald' export { eos } from './eos' export { eosTestnet } from './eosTestnet' export { evmos } from './evmos' @@ -95,6 +96,8 @@ export { ronin } from './ronin' export { saigon } from './saigon' export { scrollSepolia } from './scrollSepolia' export { scrollTestnet } from './scrollTestnet' +export { sapphire } from './sapphire' +export { sapphireTestnet } from './sapphireTestnet' export { sepolia } from './sepolia' export { skaleBlockBrawlers } from './skale/brawl' export { skaleCalypso } from './skale/calypso' diff --git a/packages/chains/src/sapphire.ts b/packages/chains/src/sapphire.ts new file mode 100644 index 00000000..19af3824 --- /dev/null +++ b/packages/chains/src/sapphire.ts @@ -0,0 +1,34 @@ +import { Chain } from './types' + +export const sapphire = { + id: 23294, + name: 'Oasis Sapphire', + network: 'sapphire', + nativeCurrency: { + decimals: 18, + name: 'Oasis ROSE', + symbol: 'ROSE', + }, + rpcUrls: { + default: { + http: ['https://sapphire.oasis.io'], + webSocket: ['wss://sapphire.oasis.io/ws'], + }, + public: { + http: ['https://sapphire.oasis.io'], + webSocket: ['wss://sapphire.oasis.io/ws'], + }, + }, + blockExplorers: { + default: { + name: 'Oasis Explorer', + url: 'https://explorer.oasis.io/mainnet/sapphire', + }, + }, + contracts: { + multicall3: { + address: '0xcA11bde05977b3631167028862bE2a173976CA11', + blockCreated: 734531, + }, + }, +} as const satisfies Chain diff --git a/packages/chains/src/sapphireTestnet.ts b/packages/chains/src/sapphireTestnet.ts new file mode 100644 index 00000000..0ab5f50f --- /dev/null +++ b/packages/chains/src/sapphireTestnet.ts @@ -0,0 +1,28 @@ +import { Chain } from './types' + +export const sapphireTestnet = { + id: 23295, + name: 'Oasis Sapphire Testnet', + network: 'sapphireTestnet', + nativeCurrency: { + decimals: 18, + name: 'Oasis TEST', + symbol: 'TEST', + }, + rpcUrls: { + default: { + http: ['https://testnet.sapphire.oasis.dev'], + webSocket: ['wss://testnet.sapphire.oasis.dev/ws'], + }, + public: { + http: ['https://testnet.sapphire.oasis.dev'], + webSocket: ['wss://testnet.sapphire.oasis.dev/ws'], + }, + }, + blockExplorers: { + default: { + name: 'Oasis Explorer', + url: 'https://explorer.oasis.io/testnet/sapphire', + }, + }, +} as const satisfies Chain