Skip to content

Commit

Permalink
🚨 prettier fix on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
Aboudjem committed Dec 20, 2023
1 parent 6b73047 commit 2d1fcc7
Show file tree
Hide file tree
Showing 183 changed files with 6,355 additions and 6,468 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ on:
branches:
- master
permissions:
id-token: write
contents: read
id-token: write
contents: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.17.1]

steps:
- uses: actions/checkout@v2

Expand All @@ -35,7 +35,7 @@ jobs:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: production-deploy
aws-region: us-east-1

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern
static website generator.

### Installation
### Installation

```
$ npm install
Expand Down Expand Up @@ -43,4 +43,3 @@ $ GIT_USER=<Your GitHub username> npm run deploy

If you are using GitHub pages for hosting, this command is a convenient way to
build the website and push to the `gh-pages` branch.

2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
};
2 changes: 1 addition & 1 deletion docs/Account/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
sidebar_position: 1
custom_edit_url: https://github.com/bcnmy/docs/blob/master/docs/Account/description.md
---

# Description

## What is a Smart Account?
Expand All @@ -14,5 +15,4 @@ The Biconomy Smart Account is an ERC 4337-compliant solution that works with any

The Biconomy Smart Accounts are signer agnostic, which allows you to use any authorization package of your choice as long as you can pass a signer to our SDK upon the creation of a Smart Account. Check out different ways you can create a Biconomy Smart Account [here](/category/signers).


Smart Accounts are further enhanced by validation modules that allow you to execute arbitrary logic before validating a `userOp`. This allows you, as a developer, to build modules that allow for session keys, multi-chain validation modules, pass keys, and more. Learn more about Modules [here](/category/modules)
13 changes: 6 additions & 7 deletions docs/Account/fiatonramp.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_label: 'Enable Fiat On Ramp'
sidebar_label: "Enable Fiat On Ramp"
sidebar_position: 7
custom_edit_url: https://github.com/bcnmy/docs/blob/master/docs/Account/fiatonramp.md
---
Expand All @@ -22,29 +22,28 @@ import Transak from "@biconomy/transak";

```js
// init the widget
const transak = new Transak('STAGING');
const transak = new Transak("STAGING");
transak.init();
```

- If you are using Fiat On Ramp then you can directly pass in the email like so:

```js
import Transak from '@biconomy/transak';
import Transak from "@biconomy/transak";

// use this info for transak package
const transak = new Transak('STAGING', {
const transak = new Transak("STAGING", {
walletAddress: userAddress,
userData: {
firstName: userInfo?.name || '',
email: userInfo?.email || '',
firstName: userInfo?.name || "",
email: userInfo?.email || "",
},
});
transak.init();
```
- On `transak.init()` Transak widget opens and users can buy on-ramp.
## Code Examples
- https://github.com/bcnmy/sdk-demo
Expand Down
88 changes: 46 additions & 42 deletions docs/Account/integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
sidebar_position: 2
custom_edit_url: https://github.com/bcnmy/docs/blob/master/docs/Account/integration.mdx
---

# Integration

To use the full potential of the `Biconomy Smart Account` you will need an instance of a [Bundler](/category/bundler) and [Paymaster](/category/paymaster). The Biconomy SDK provides you with access to all of this. Below is a basic installation and integration for smart accounts in your code.

## Installation

First, install the required packages for initializing the Smart Account.
First, install the required packages for initializing the Smart Account.

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

<Tabs>
<TabItem value="js" label="npm">
Expand Down Expand Up @@ -46,44 +47,47 @@ pnpm add @biconomy/account @biconomy/bundler @biconomy/paymaster @biconomy/commo
## Integration Example

```typescript

import { BiconomySmartAccountV2, DEFAULT_ENTRYPOINT_ADDRESS } from "@biconomy/account"
import { ECDSAOwnershipValidationModule, DEFAULT_ECDSA_OWNERSHIP_MODULE } from "@biconomy/modules";
import { ChainId } from "@biconomy/core-types"
import { IBundler, Bundler } from '@biconomy/bundler'
import { IPaymaster, BiconomyPaymaster } from '@biconomy/paymaster'

// create instance of bundler
const bundler: IBundler = new Bundler({
//https://dashboard.biconomy.io/ get bundler urls from your dashboard
bundlerUrl: "",
chainId: ChainId.POLYGON_MUMBAI,
entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS,
})


// create instance of paymaster
const paymaster: IPaymaster = new BiconomyPaymaster({
//https://dashboard.biconomy.io/ get paymaster urls from your dashboard
paymasterUrl: ""
})

// instance of ownership module
const ownerShipModule = await ECDSAOwnershipValidationModule.create({
signer: {}, // ethers signer object
moduleAddress: DEFAULT_ECDSA_OWNERSHIP_MODULE
})

const biconomyAccount = await BiconomySmartAccountV2.create({
chainId: ChainId.POLYGON_MUMBAI, //or any chain of your choice
bundler: bundler, // instance of bundler
paymaster: paymaster, // instance of paymaster
entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS, //entry point address for chain
defaultValidationModule: ownerShipModule, // either ECDSA or Multi chain to start
activeValidationModule: ownerShipModule // either ECDSA or Multi chain to start
})
const address = await biconomySmartAccount.getAccountAddress()

import {
BiconomySmartAccountV2,
DEFAULT_ENTRYPOINT_ADDRESS,
} from "@biconomy/account";
import {
ECDSAOwnershipValidationModule,
DEFAULT_ECDSA_OWNERSHIP_MODULE,
} from "@biconomy/modules";
import { ChainId } from "@biconomy/core-types";
import { IBundler, Bundler } from "@biconomy/bundler";
import { IPaymaster, BiconomyPaymaster } from "@biconomy/paymaster";

// create instance of bundler
const bundler: IBundler = new Bundler({
//https://dashboard.biconomy.io/ get bundler urls from your dashboard
bundlerUrl: "",
chainId: ChainId.POLYGON_MUMBAI,
entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS,
});

// create instance of paymaster
const paymaster: IPaymaster = new BiconomyPaymaster({
//https://dashboard.biconomy.io/ get paymaster urls from your dashboard
paymasterUrl: "",
});

// instance of ownership module
const ownerShipModule = await ECDSAOwnershipValidationModule.create({
signer: {}, // ethers signer object
moduleAddress: DEFAULT_ECDSA_OWNERSHIP_MODULE,
});

const biconomyAccount = await BiconomySmartAccountV2.create({
chainId: ChainId.POLYGON_MUMBAI, //or any chain of your choice
bundler: bundler, // instance of bundler
paymaster: paymaster, // instance of paymaster
entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS, //entry point address for chain
defaultValidationModule: ownerShipModule, // either ECDSA or Multi chain to start
activeValidationModule: ownerShipModule, // either ECDSA or Multi chain to start
});
const address = await biconomySmartAccount.getAccountAddress();
```

:::info
Expand All @@ -92,4 +96,4 @@ Make sure to call both create methods from an async function!

:::

Regardless of what frontend framework you may use these steps for creating a smart account will remain the same. See our [tutorials](/category/tutorials) for in depth integrations of the smart account.
Regardless of what frontend framework you may use these steps for creating a smart account will remain the same. See our [tutorials](/category/tutorials) for in depth integrations of the smart account.
45 changes: 19 additions & 26 deletions docs/Account/methods/create.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,39 @@
---
sidebar_label: 'Create Accounts'
sidebar_label: "Create Accounts"
sidebar_position: 1
custom_edit_url: https://github.com/bcnmy/docs/blob/master/docs/Account/methods/create.md
---

# Create

The create method on the BiconomySmartAccountV2 class takes a configuration object when creating a new smart account. See chart and example code below for implementation details. The addresses of ERC-4337 smart accounts follow a deterministic pattern. This enables you to identify the address off-chain before the account is actually deployed.

## BiconomySmartAccountV2Config

| Parameter | Description | Required |
|--------------------------|--------------------------------------------|----------|
| chainId | Chain Id of preferred network | Yes |
| paymaster | Instance of Paymaster Class | No |
| bundler | Instance of Bundler Class | No |
| entryPointAddress | Entry point address to be used | Yes |
| defaultValidationModule | Default validation module instance | Yes |
| activeValidationModule | Active validation module instance | No |
| rpcUrl | Optionally provide your own rpc url | No |
| index | Index number | No |

| Parameter | Description | Required |
| ----------------------- | ----------------------------------- | -------- |
| chainId | Chain Id of preferred network | Yes |
| paymaster | Instance of Paymaster Class | No |
| bundler | Instance of Bundler Class | No |
| entryPointAddress | Entry point address to be used | Yes |
| defaultValidationModule | Default validation module instance | Yes |
| activeValidationModule | Active validation module instance | No |
| rpcUrl | Optionally provide your own rpc url | No |
| index | Index number | No |

```javascript

const smartAccount = await BiconomySmartAccountV2.create({
chainId: ChainId.POLYGON_MUMBAI, //or any chain of your choice
bundler: bundler, // instance of bundler
paymaster: paymaster, // instance of paymaster
entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS, //entry point address for chain
defaultValidationModule: ownerShipModule, // either ECDSA or Multi chain to start
activeValidationModule: ownerShipModule // either ECDSA or Multi chain to start
})

chainId: ChainId.POLYGON_MUMBAI, //or any chain of your choice
bundler: bundler, // instance of bundler
paymaster: paymaster, // instance of paymaster
entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS, //entry point address for chain
defaultValidationModule: ownerShipModule, // either ECDSA or Multi chain to start
activeValidationModule: ownerShipModule, // either ECDSA or Multi chain to start
});
```

:::info
Building on Chiliz Mainnet or the Spicy Testnet? Note that the entry point address on this is different as it was deployed by us on the Biconomy team. The address of the entry point is : [0x00000061FEfce24A79343c27127435286BB7A4E1](https://scan.chiliz.com/address/0x00000061FEfce24A79343c27127435286BB7A4E1/contracts#address-tabs)
:::


In the coming sections we will refer to all methods by using `smartAcount.method`




Loading

0 comments on commit 2d1fcc7

Please sign in to comment.