<EtherspotTransactionKit />
The top level component that injects the Etherspot Platform into your React app
Introduction
How to use
// Import the following libraries
import { EtherspotTransactionKit } from '@etherspot/transaction-kit';
// We're importing Ethers here to create a random wallet
import { ethers } from 'ethers';
/**
* Later in your app's function code...
*/
// Let's create the random wallet for demonstration purposes.
const randomWallet = ethers.Wallet.createRandom();
// Pass the private key into a new ethers.Wallet to return a
// provider. This is the account we pass into EtherspotUi.
const providerWallet = new ethers.Wallet(randomWallet.privateKey);
/**
* In your app's render function, "wrap" the <App /> tag...
*/
root.render(
<React.StrictMode>
<EtherspotTransactionKit provider={providerWallet}> // <-- open here
<App />
</EtherspotTransactionKit> // <-- close here
</React.StrictMode>
);🎉 Congratulations
Last updated
Was this helpful?