Skip to content

Commit

Permalink
feat: add support for peaq network
Browse files Browse the repository at this point in the history
  • Loading branch information
eruizgar91 committed Aug 27, 2024
1 parent 3d326a5 commit 5331c58
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions integration/external/Zerodev.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ describe('Nevermined sdk with zerodev', () => {
contractAddress, // DIDRegistry address
'0x1c52ed414EDd1bCC20Ea670d42289e8bFC03C095', // Sales Template address
'0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d', // ERC20 address
'0x1bcA156f746C6Eb8b18d61654293e2Fc5b653fF5', // NFT1155 address
'0x1bcA156f746C6Eb8b18d61654293e2Fc5b653fF5',
)
const sessionKey = await createSessionKey(owner, publicClient, permissions)
assert.isDefined(sessionKey)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nevermined-io/sdk",
"version": "3.0.27",
"version": "3.0.28",
"description": "Javascript SDK for connecting with Nevermined Data Platform ",
"main": "./dist/node/sdk.js",
"typings": "./dist/node/sdk.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion scripts/download-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi

REPO_URL=https://artifacts.nevermined.network
declare -A NETWORKS_MAP
NETWORKS_MAP=( ["mainnet"]="1" ["rinkeby"]="4" ["optimism"]="10" ["kovan"]="42" ["gnosis"]="100" ["matic"]="137" ["base"]="8453" ["mumbai"]="80001" ["celo-alfajores"]="44787" ["celo"]="42220" ["aurora"]="1313161554" ["aurora-testnet"]="1313161555" ["arbitrum-one"]="42161" ["arbitrum-goerli"]="421613" ["arbitrum-sepolia"]="421614" )
NETWORKS_MAP=( ["mainnet"]="1" ["rinkeby"]="4" ["optimism"]="10" ["kovan"]="42" ["gnosis"]="100" ["matic"]="137" ["peaq"]="3338" ["base"]="8453" ["mumbai"]="80001" ["celo-alfajores"]="44787" ["celo"]="42220" ["aurora"]="1313161554" ["aurora-testnet"]="1313161555" ["arbitrum-one"]="42161" ["arbitrum-goerli"]="421613" ["arbitrum-sepolia"]="421614" )

SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
UNPACK_DIR="$SCRIPT_DIR/../artifacts"
Expand Down
19 changes: 19 additions & 0 deletions src/utils/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export async function getNetworkName(networkId: number): Promise<string> {
return 'geth-localnet'
case 3141:
return 'hyperspace'
case 3338:
return 'peaq'
case 8453:
return 'base'
case 10200:
Expand Down Expand Up @@ -108,6 +110,8 @@ export function isTestnet(networkId: number): boolean {
return true
case 3141:
return true
case 3338:
return false
case 8453:
return false
case 10200:
Expand Down Expand Up @@ -155,6 +159,21 @@ export function getChain(networkId: number | undefined): Chain {
return gnosis
case 137:
return polygon
case 3338:
return defineChain({
id: networkId,
name: 'peaq-network',
nativeCurrency: {
name: 'Peaq',
symbol: 'PEAQ',
decimals: 18,
},
rpcUrls: {
default: {
http: ['https://evm.peaq.network'],
},
},
})
case 8453:
return base as Chain
case 42161:
Expand Down

0 comments on commit 5331c58

Please sign in to comment.