From 4325db70173abd02098fbe64b7fb5e9d1c9b1eba Mon Sep 17 00:00:00 2001 From: spacehaz Date: Mon, 12 Aug 2024 16:22:17 +0300 Subject: [PATCH] added immutable network support --- CHANGELOG.md | 7 +++++++ package.json | 2 +- src/configs/index.ts | 6 ++---- src/helpers/define-json-rpc-url.ts | 18 ++++++------------ src/helpers/define-network-name.ts | 6 ++---- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a0bfc5..09e437d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Linkdrop SDK +## 2.1.8 +- added support for immutableZkevm network +- removed support for baseGoerli, goerli and mumbai + +## 2.1.7 +- token_name, linkdrop_token, token_image properties added to link params + ## 2.1.6 - available_wallets_on => preferred_wallet_on - available_wallets property removed diff --git a/package.json b/package.json index cb42faa..0a507d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "linkdrop-sdk", - "version": "2.1.7", + "version": "2.1.8", "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ diff --git a/src/configs/index.ts b/src/configs/index.ts index 173d707..3a42e69 100644 --- a/src/configs/index.ts +++ b/src/configs/index.ts @@ -6,7 +6,5 @@ export const testnetsClaimHostUrl = 'https://testnets.claim.linkdrop.io' export const polygonJSONRPCUrl = 'https://rpc-mainnet.maticvigil.com/v1/ad4cd2ea018ddb1ccd0418ffa43c27b3d99fbd55' export const mainnetJSONRPCUrl = 'https://mainnet.infura.io/v3/620c738fbe1843a18f47ada0e60e738a' -export const goerliJSONRPCUrl = 'https://goeli.infura.io/v3/620c738fbe1843a18f47ada0e60e738a' -export const mumbaiJSONRPCUrl = 'https://rpc-mumbai.maticvigil.com/v1/f592ae2e5afb3bebe39314e9bd0949de5b74cd2f' -export const basicJSONRPCUrl = 'https://developer-access-mainnet.base.org' -export const basicGoerliJSONRPCUrl = 'https://base-goerli.public.blastapi.io' +export const baseJSONRPCUrl = 'https://developer-access-mainnet.base.org' +export const immutableZkevmJSONRPCUrl = 'https://immutable-zkevm.drpc.org' diff --git a/src/helpers/define-json-rpc-url.ts b/src/helpers/define-json-rpc-url.ts index d395db7..43e2cff 100644 --- a/src/helpers/define-json-rpc-url.ts +++ b/src/helpers/define-json-rpc-url.ts @@ -1,11 +1,9 @@ import { defineNetworkName } from './' import { polygonJSONRPCUrl, - mumbaiJSONRPCUrl, - goerliJSONRPCUrl, mainnetJSONRPCUrl, - basicGoerliJSONRPCUrl, - basicJSONRPCUrl + baseJSONRPCUrl, + immutableZkevmJSONRPCUrl } from '../configs' const defineJSONRpcUrl = ({ chainId } : { chainId: number }) => { @@ -13,16 +11,12 @@ const defineJSONRpcUrl = ({ chainId } : { chainId: number }) => { switch (networkName) { case 'matic': return polygonJSONRPCUrl - case 'mumbai': - return mumbaiJSONRPCUrl - case 'goerli': - return goerliJSONRPCUrl case 'mainnet': return mainnetJSONRPCUrl - case 'basic': - return basicJSONRPCUrl - case 'basicGoerli': - return basicGoerliJSONRPCUrl + case 'base': + return baseJSONRPCUrl + case 'immutableZkevm': + return immutableZkevmJSONRPCUrl default: return alert('Current chain id is not supported') } diff --git a/src/helpers/define-network-name.ts b/src/helpers/define-network-name.ts index 8be273a..72dcc75 100644 --- a/src/helpers/define-network-name.ts +++ b/src/helpers/define-network-name.ts @@ -1,11 +1,9 @@ const defineNetworkName = (chainId: number | null) : string => { switch (Number(chainId)) { case 1: return 'mainnet' - case 5: return 'goerli' case 137: return 'matic' - case 80001: return 'mumbai' - case 8453: return 'basic' - case 84531: return 'basicMumbai' + case 8453: return 'base' + case 13371: return 'immutableZkevm' default: return 'mainnet' } }