Skip to content

Commit 5331c58

Browse files
committed
feat: add support for peaq network
1 parent 3d326a5 commit 5331c58

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

integration/external/Zerodev.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ describe('Nevermined sdk with zerodev', () => {
288288
contractAddress, // DIDRegistry address
289289
'0x1c52ed414EDd1bCC20Ea670d42289e8bFC03C095', // Sales Template address
290290
'0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d', // ERC20 address
291+
'0x1bcA156f746C6Eb8b18d61654293e2Fc5b653fF5', // NFT1155 address
292+
'0x1bcA156f746C6Eb8b18d61654293e2Fc5b653fF5',
291293
)
292294
const sessionKey = await createSessionKey(owner, publicClient, permissions)
293295
assert.isDefined(sessionKey)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nevermined-io/sdk",
3-
"version": "3.0.27",
3+
"version": "3.0.28",
44
"description": "Javascript SDK for connecting with Nevermined Data Platform ",
55
"main": "./dist/node/sdk.js",
66
"typings": "./dist/node/sdk.d.ts",

scripts/download-artifacts.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fi
2020

2121
REPO_URL=https://artifacts.nevermined.network
2222
declare -A NETWORKS_MAP
23-
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" )
23+
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" )
2424

2525
SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
2626
UNPACK_DIR="$SCRIPT_DIR/../artifacts"

src/utils/Network.ts

+19
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export async function getNetworkName(networkId: number): Promise<string> {
4444
return 'geth-localnet'
4545
case 3141:
4646
return 'hyperspace'
47+
case 3338:
48+
return 'peaq'
4749
case 8453:
4850
return 'base'
4951
case 10200:
@@ -108,6 +110,8 @@ export function isTestnet(networkId: number): boolean {
108110
return true
109111
case 3141:
110112
return true
113+
case 3338:
114+
return false
111115
case 8453:
112116
return false
113117
case 10200:
@@ -155,6 +159,21 @@ export function getChain(networkId: number | undefined): Chain {
155159
return gnosis
156160
case 137:
157161
return polygon
162+
case 3338:
163+
return defineChain({
164+
id: networkId,
165+
name: 'peaq-network',
166+
nativeCurrency: {
167+
name: 'Peaq',
168+
symbol: 'PEAQ',
169+
decimals: 18,
170+
},
171+
rpcUrls: {
172+
default: {
173+
http: ['https://evm.peaq.network'],
174+
},
175+
},
176+
})
158177
case 8453:
159178
return base as Chain
160179
case 42161:

0 commit comments

Comments
 (0)