When estimating a transaction with the SDK on testnets we support
we can pass in the testnet api key value as ‘etherspot_public_key’
and set the mode of the transaction to be sponsored like so:
Copy
try {const CHAIN_ID = 11155111;const API_KEY = 'etherspot_public_key'; // replace this with your api keyconst op = await primeSdk.estimate({ url: `https://rpc.etherspot.io/paymaster?apiKey=${API_KEY}&chainId=${CHAIN_ID}&useVp=true`, context: { mode: 'sponsor' } });} catch(err) { console.log(err);}