diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d583fe..5479d21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## [1.6.5] - 2024-04-03 +### New +- Added Rootstock testnet and mainnet network support + ## [1.6.4] - 2024-03-20 ### New - Added `getTransactions` endpoint into DataUtils diff --git a/examples/13-paymaster.ts b/examples/13-paymaster.ts index a70942d..35ab87b 100644 --- a/examples/13-paymaster.ts +++ b/examples/13-paymaster.ts @@ -8,7 +8,7 @@ dotenv.config(); const recipient = '0x80a1874E1046B1cc5deFdf4D3153838B72fF94Ac'; // recipient wallet address const value = '0.01'; // transfer value -const api_key = 'arka_public_key'; // Only testnets are available, if you need further assistance in setting up a paymaster service for your dapp, please reach out to us on discord or https://etherspot.fyi/arka/intro +const apiKey = 'arka_public_key'; // Only testnets are available, if you need further assistance in setting up a paymaster service for your dapp, please reach out to us on discord or https://etherspot.fyi/arka/intro const bundlerApiKey = 'eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjMxMDZiOGY2NTRhZTRhZTM4MGVjYjJiN2Q2NDMzMjM4IiwiaCI6Im11cm11cjEyOCJ9'; async function main() { @@ -38,7 +38,7 @@ async function main() { // estimate transactions added to the batch and get the fee data for the UserOp const op = await primeSdk.estimate({ - paymasterDetails: { url: `https://arka.etherspot.io?apiKey=${api_key}&chainId=${Number(process.env.CHAIN_ID)}`, context: { mode: 'sponsor' } } + paymasterDetails: { url: `https://arka.etherspot.io?apiKey=${apiKey}&chainId=${Number(process.env.CHAIN_ID)}`, context: { mode: 'sponsor' } } }); console.log(`Estimate UserOp: ${await printOp(op)}`); diff --git a/examples/16-paymaster-arka.ts b/examples/16-paymaster-arka.ts index 5aac61f..4a83470 100644 --- a/examples/16-paymaster-arka.ts +++ b/examples/16-paymaster-arka.ts @@ -11,9 +11,9 @@ const recipient = '0x80a1874E1046B1cc5deFdf4D3153838B72fF94Ac'; // recipient wal const value = '0.0001'; // transfer value const bundlerApiKey = 'eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjMxMDZiOGY2NTRhZTRhZTM4MGVjYjJiN2Q2NDMzMjM4IiwiaCI6Im11cm11cjEyOCJ9'; -const arka_api_key = 'arka_public_key'; -const arka_url = 'https://arka.etherspot.io'; // Only testnets are available, if you need further assistance in setting up a paymaster service for your dapp, please reach out to us on discord or https://etherspot.fyi/arka/intro -const queryString = `?apiKey=${arka_api_key}&chainId=${Number(process.env.CHAIN_ID)}`; +const arkaApiKey = 'arka_public_key'; +const arkaUrl = 'https://arka.etherspot.io'; // Only testnets are available, if you need further assistance in setting up a paymaster service for your dapp, please reach out to us on discord or https://etherspot.fyi/arka/intro +const queryString = `?apiKey=${arkaApiKey}&chainId=${Number(process.env.CHAIN_ID)}`; async function main() { // initializing sdk... @@ -40,7 +40,7 @@ async function main() { * The fetching of pimlico erc20 paymaster address is only required for the first time for each specified gas token since we need to approve the tokens to spend * from the paymaster address on behalf of you. */ - const returnedValue = await fetch(`${arka_url}/pimlicoAddress${queryString}`, { + const returnedValue = await fetch(`${arkaUrl}/pimlicoAddress${queryString}`, { method: 'POST', headers: { 'Accept': 'application/json', @@ -90,7 +90,7 @@ async function main() { // estimate transactions added to the batch and get the fee data for the UserOp const op = await primeSdk.estimate({ - paymasterDetails: { url: `${arka_url}${queryString}`, context: { token: "USDC", mode: 'erc20' } } + paymasterDetails: { url: `${arkaUrl}${queryString}`, context: { token: "USDC", mode: 'erc20' } } }); console.log(`Estimate UserOp: ${await printOp(op)}`); diff --git a/examples/19-paymaster-validUntil-validAfter.ts b/examples/19-paymaster-validUntil-validAfter.ts index 66aaa87..57090f9 100644 --- a/examples/19-paymaster-validUntil-validAfter.ts +++ b/examples/19-paymaster-validUntil-validAfter.ts @@ -10,9 +10,9 @@ const recipient = '0x80a1874E1046B1cc5deFdf4D3153838B72fF94Ac'; // recipient wal const value = '0.0001'; // transfer value const bundlerApiKey = 'eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjMxMDZiOGY2NTRhZTRhZTM4MGVjYjJiN2Q2NDMzMjM4IiwiaCI6Im11cm11cjEyOCJ9'; -const arka_api_key = 'arka_public_key'; // Only testnets are available, if you need further assistance in setting up a paymaster service for your dapp, please reach out to us on discord or https://etherspot.fyi/arka/intro -const arka_url = 'https://arka.etherspot.io'; -const queryString = `?apiKey=${arka_api_key}&chainId=${Number(process.env.CHAIN_ID)}`; +const arkaApiKey = 'arka_public_key'; // Only testnets are available, if you need further assistance in setting up a paymaster service for your dapp, please reach out to us on discord or https://etherspot.fyi/arka/intro +const arkaUrl = 'https://arka.etherspot.io'; +const queryString = `?apiKey=${arkaApiKey}&chainId=${Number(process.env.CHAIN_ID)}`; async function main() { // initializing sdk... @@ -48,7 +48,7 @@ async function main() { validUntil and validAfter is relevant only with sponsor transactions and not for token paymasters */ const op = await primeSdk.estimate({ - paymasterDetails: { url: `${arka_url}${queryString}`, context: { mode: 'sponsor', validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000 } } + paymasterDetails: { url: `${arkaUrl}${queryString}`, context: { mode: 'sponsor', validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000 } } }); console.log(`Estimate UserOp: ${await printOp(op)}`); diff --git a/examples/24-ArkaPaymaster.ts b/examples/24-ArkaPaymaster.ts index 0a3e8ed..e1e1506 100644 --- a/examples/24-ArkaPaymaster.ts +++ b/examples/24-ArkaPaymaster.ts @@ -4,11 +4,11 @@ import * as dotenv from 'dotenv'; dotenv.config(); async function main() { - const arka_api_key = 'arka_public_key'; - const arka_url = 'https://arka.etherspot.io'; // Only testnets are available, if you need further assistance in setting up a paymaster service for your dapp, please reach out to us on discord or https://etherspot.fyi/arka/intro + const arkaApiKey = 'arka_public_key'; + const arkaUrl = 'https://arka.etherspot.io'; // Only testnets are available, if you need further assistance in setting up a paymaster service for your dapp, please reach out to us on discord or https://etherspot.fyi/arka/intro // initializating sdk... - const arkaPaymaster = new ArkaPaymaster(Number(process.env.CHAIN_ID), arka_api_key, arka_url); + const arkaPaymaster = new ArkaPaymaster(Number(process.env.CHAIN_ID), arkaApiKey, arkaUrl); console.log(await arkaPaymaster.metadata()); console.log(await arkaPaymaster.getTokenPaymasterAddress("eUSDC")) diff --git a/package-lock.json b/package-lock.json index 93dcaee..36451c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@etherspot/prime-sdk", - "version": "1.6.4", + "version": "1.6.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@etherspot/prime-sdk", - "version": "1.6.4", + "version": "1.6.5", "license": "MIT", "dependencies": { "@apollo/client": "3.8.7", diff --git a/package.json b/package.json index 051863e..5b0f4d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@etherspot/prime-sdk", - "version": "1.6.4", + "version": "1.6.5", "description": "Etherspot Prime (Account Abstraction) SDK", "keywords": [ "ether", diff --git a/src/sdk/network/constants.ts b/src/sdk/network/constants.ts index d8a7709..dc8c980 100644 --- a/src/sdk/network/constants.ts +++ b/src/sdk/network/constants.ts @@ -17,7 +17,8 @@ export enum NetworkNames { KromaTestnet = 'kromaTestnet', Mainnet = 'mainnet', OptimismGoerli = 'optimismGoerli', - RSKTestnet = 'RSKTestnet', + Rootstock = 'rootstock', + RootstockTestnet = 'rootstockTestnet', VerseTestnet = 'verseTestnet', Mantle = 'Mantle', MantleTestnet = 'MantleTestnet', @@ -37,7 +38,7 @@ export enum NetworkNames { } export const SupportedNetworks = - [1, 5, 10, 14, 31, 56, 97, 100, 114, 122, 123, 137, 420, 1001, 2357, 5000, 5001, 8217, 8453, 10200, 20197, 42161, 43113, 43114, 59140, 59144, 80001, 84531, 84532, 421613, 534351, 534352, 11155111] + [1, 5, 10, 14, 30, 31, 56, 97, 100, 114, 122, 123, 137, 420, 1001, 2357, 5000, 5001, 8217, 8453, 10200, 20197, 42161, 43113, 43114, 59140, 59144, 80001, 84531, 84532, 421613, 534351, 534352, 11155111] export const NETWORK_NAME_TO_CHAIN_ID: { [key: string]: number; @@ -58,7 +59,8 @@ export const NETWORK_NAME_TO_CHAIN_ID: { [NetworkNames.KromaTestnet]: 2357, [NetworkNames.Mainnet]: 1, [NetworkNames.OptimismGoerli]: 420, - [NetworkNames.RSKTestnet]: 31, + [NetworkNames.Rootstock]: 30, + [NetworkNames.RootstockTestnet]: 31, [NetworkNames.VerseTestnet]: 20197, [NetworkNames.Mantle]: 5000, [NetworkNames.MantleTestnet]: 5001, @@ -298,15 +300,27 @@ export const Networks: { } }, }, + [30]: { + chainId: 30, + bundler: 'https://rpc.etherspot.io/rootstock', + contracts: { + entryPoint: '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789', + walletFactory: { + etherspot: '0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E', + zeroDev: '', + simpleAccount: '', + } + }, + }, [31]: { chainId: 31, - bundler: '', + bundler: 'https://rootstocktestnet-bundler.etherspot.io/', contracts: { - entryPoint: '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789', + entryPoint: '0x48e60BBb664aEfAc9f14aDB42e5FB5b4a119EB66', walletFactory: { etherspot: '0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E', zeroDev: '', - simpleAccount: '0x9406Cc6185a346906296840746125a0E44976454', + simpleAccount: '', } }, },