Skip to content

Commit

Permalink
Merge pull request #81 from emmaodia/master
Browse files Browse the repository at this point in the history
Fix: Errors in the React-Vite Tutorial
  • Loading branch information
Rahat-ch authored Oct 18, 2023
2 parents 91f9d11 + 9527379 commit b154eef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
7 changes: 4 additions & 3 deletions docs/tutorials/React_vite/initialize.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,18 @@ yarn add
@biconomy/core-types
@biconomy/paymaster
@biconomy/web3-auth
@biconomy/modules
[email protected]
```

We will use these tools to build out our front end. In addition, lets also
We will use these tools to build out our front end. In addition, let's also
install the following devDependencies:

```bash
yarn add @esbuild-plugins/node-globals-polyfill rollup-plugin-polyfill-node stream-browserify -D
```

After installing the above dependencies update you vite.config.ts to the
After installing the above dependencies update your `vite.config.ts` to the
following:

```js
Expand All @@ -77,7 +79,6 @@ export default defineConfig({
},
resolve: {
alias: {
process: "process/browser",
stream: "stream-browserify",
util: "util",
},
Expand Down
10 changes: 9 additions & 1 deletion docs/tutorials/React_vite/sdk-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { ethers } from 'ethers'
import { IBundler, Bundler } from '@biconomy/bundler'
import { BiconomySmartAccountV2, DEFAULT_ENTRYPOINT_ADDRESS } from "@biconomy/account"
import { IPaymaster, BiconomyPaymaster,} from '@biconomy/paymaster'
import { ECDSAOwnershipValidationModule, DEFAULT_ECDSA_OWNERSHIP_MODULE, } from "@biconomy/modules";
import Counter from './Components/Counter';
```

Expand All @@ -42,6 +43,8 @@ Here is information about the rest of the imports:
configuration and methods of smart accounts
- `IPaymaster` and `Paymaster` will be used to sponsor gas fees for an
account, provided specific predefined conditions are satisfied.
- `ECDSAOwnershipValidationModule`, and `DEFAULT_ECDSA_OWNERSHIP_MODULE,` to handle
the ECDSA Validation Signature for generating the smart accounts.

Now, let's setup our paymaster and bundler :

Expand Down Expand Up @@ -173,8 +176,13 @@ async function setupSmartAccount() {
);
setProvider(web3Provider);

const module = await ECDSAOwnershipValidationModule.create({
signer: web3Provider.getSigner(),
moduleAddress: DEFAULT_ECDSA_OWNERSHIP_MODULE,
});

try {
let biconomySmartAccount = await BiconomySmartAccountV2.create(
let biconomySmartAccount = await BiconomySmartAccountV2.create({
chainId: ChainId.POLYGON_MUMBAI,
bundler: bundler,
entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS,
Expand Down

0 comments on commit b154eef

Please sign in to comment.