Skip to content

Commit

Permalink
docs: format capsule doc (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
SahilAujla committed Oct 4, 2023
1 parent cba5cc4 commit ad22c6f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions site/smart-accounts/signers/capsule.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ head:

# Capsule

[Capsule](https://usecapsule.com/) is a signing solution that you can use to create secure, embedded MPC wallets with just an email or a social login. Capsule wallets are portable across applications, recoverable, and programmable, so your users do not need to create different signers or contract accounts for every application they use.
[Capsule](https://usecapsule.com/) is a signing solution that you can use to create secure, embedded [MPC wallets](https://www.alchemy.com/overviews/mpc-wallet) with just an email or a social login. Capsule-enabled wallets are portable across applications, recoverable, and programmable, so your users do not need to create different signers or contract accounts for every application they use.

Combining Capsule with Account Kit allows you to get the best of both on and off-chain programmability. You can use Capsule to create a wallet that works across apps, and then connect it to Account Kit to create expressive Smart Contract Accounts for your users!
Combining Capsule with Account Kit allows you to get the best of both on and off-chain programmability. You can use Capsule as a signer to create a wallet that works across apps, and then connect it to Account Kit to create expressive smart accounts for your users!

## Integration

Getting started with Capsule is easy-- simply get access to the SDK and an API key by filling out [this form](https://form.typeform.com/to/hLaJeYJW). From there, if you're adding additional permissions or automation and would like deeper support, please refer to our [full developer docs](https://docs.usecapsule.com) or get in touch via hello@usecapsule.com
Follow these steps to begin integrating Capsule:

1. Obtain access to the Capsule SDK and an API key by completing [this form](https://form.typeform.com/to/hLaJeYJW).
2. For further assistance or if you wish to add more permissions or automation, consult the [complete Capsule developer documentation](https://docs.usecapsule.com) or contact hello@usecapsule.com.

### Install the SDK

Expand Down Expand Up @@ -61,7 +64,7 @@ Next, setup the Capsule SDK and create a `SmartAccountSigner`
Let's see it in action with `aa-alchemy` and `LightSmartContractAccount` from `aa-accounts`:
::: code-group

```ts [example.ts]
```ts [alchemy.ts]
import { AlchemyProvider } from "@alchemy/aa-alchemy";
import { LightSmartContractAccount } from "@alchemy/aa-accounts";
import { sepolia } from "viem/chains";
Expand Down
8 changes: 4 additions & 4 deletions site/snippets/capsule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import Capsule, {
import { http } from "viem";
import { sepolia } from "viem/chains";

// get an API Key by filling out [this form](https://form.typeform.com/to/hLaJeYJW)
// get an API Key by filling out this form: https://form.typeform.com/to/hLaJeYJW
const CAPSULE_API_KEY = null;

// Capsule's viem client supports custom chains and providers
// Here we've included Alchemy's sepolia provider
// Remember to replace "ALCHEMY_API_KEY" with your own Alchemy API key, get one here: https://dashboard.alchemy.com/
const CHAIN = sepolia;
const CHAIN_PROVIDER = "https://eth-sepolia.g.alchemy.com/v2/ALCHEMY_API_KEY";
const PROVIDER = "https://eth-sepolia.g.alchemy.com/v2/ALCHEMY_API_KEY";

// Instantiate the Capsule SDK
// Use the DEVELOPMENT environment for development and PRODUCTION for releases
Expand All @@ -21,7 +21,7 @@ const capsule = new Capsule(Environment.DEVELOPMENT, CAPSULE_API_KEY);
// returns a viem client that wraps capsule for key methods
const capsuleClient = createCapsuleViemClient(capsule, {
chain: CHAIN,
transport: http(CHAIN_PROVIDER),
transport: http(PROVIDER),
});

// a smart account signer you can use as an owner on ISmartContractAccount
Expand Down

0 comments on commit ad22c6f

Please sign in to comment.