From 7b7bbdf912c4b3af993bcc545c0603fbcdca9348 Mon Sep 17 00:00:00 2001 From: vignesha22 <82584664+vignesha22@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:44:47 +0530 Subject: [PATCH] PRO-1968 - Updated Examples with ARKA public key (#71) [skip ci] --- CHANGELOG.md | 5 ++++- examples/13-paymaster.ts | 4 ++-- examples/16-paymaster-arka.ts | 4 ++-- examples/19-paymaster-validUntil-validAfter.ts | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad064ba..9e582f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ # Changelog ## [1.3.11] - 2023-11-08 +### Breaking Changes +- Removed api_key from estimate function on the sdk and added the same on the queryString, please refer examples/13-paymaster.ts for more info + ### Bug Fixes -- Updated paymaster url to accept arka api_key and chainId as queryString +- Updated paymaster url to accept arka apiKey and chainId as queryString - Added optional parameters such as entryPointAddress and Factory walletAddress for custom chain interaction - Bug fixes for handling errors on connecting with custom chain interaction diff --git a/examples/13-paymaster.ts b/examples/13-paymaster.ts index e6de636..2052c91 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 = ''; +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 async function main() { // initializating sdk... @@ -35,7 +35,7 @@ async function main() { console.log('balances: ', balance); // estimate transactions added to the batch and get the fee data for the UserOp - const op = await primeSdk.estimate({ url: `https://arka.etherspot.io?api_key=${api_key}&chainId=${Number(process.env.CHAIN_ID)}`, context: { mode: 'sponsor' } }); + const op = await primeSdk.estimate({ url: `https://arka.etherspot.io?apiKey=${api_key}&chainId=${Number(process.env.CHAIN_ID)}`, context: { mode: 'sponsor' } }); console.log(`Estimate UserOp: ${await printOp(op)}`); // sign the UserOp and sending to the bundler... diff --git a/examples/16-paymaster-arka.ts b/examples/16-paymaster-arka.ts index b937d2d..5768735 100644 --- a/examples/16-paymaster-arka.ts +++ b/examples/16-paymaster-arka.ts @@ -10,8 +10,8 @@ dotenv.config(); const recipient = '0x80a1874E1046B1cc5deFdf4D3153838B72fF94Ac'; // recipient wallet address const value = '0.0001'; // transfer value -const arka_api_key = ''; -const arka_url = ''; +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)}`; async function main() { diff --git a/examples/19-paymaster-validUntil-validAfter.ts b/examples/19-paymaster-validUntil-validAfter.ts index 271fa45..d0de48c 100644 --- a/examples/19-paymaster-validUntil-validAfter.ts +++ b/examples/19-paymaster-validUntil-validAfter.ts @@ -9,8 +9,8 @@ dotenv.config(); const recipient = '0x80a1874E1046B1cc5deFdf4D3153838B72fF94Ac'; // recipient wallet address const value = '0.0001'; // transfer value -const arka_api_key = ''; -const arka_url = ''; +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)}`; async function main() {