Skip to content

Commit

Permalink
update sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Feb 4, 2025
1 parent b212552 commit d898cae
Show file tree
Hide file tree
Showing 6 changed files with 737 additions and 632 deletions.
2 changes: 1 addition & 1 deletion docs/pages/permissionless/how-to/signers/para.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To use Para with permissionless.js, first create an application that integrates
Integrating permissionless.js with Para is straightforward after setting up the project. Para provides an Externally Owned Account (EOA) wallet to use as a signer with permissionless.js accounts.

### Create the Para signer
After following the Para documentation, you will have access to a `CapsuleWeb3Provider` object that you can pass as an owner to `createSmartAccountClient`:
After following the Para documentation, you will have access to a `ParaWeb3Provider` object that you can pass as an owner to `createSmartAccountClient`:

```typescript
// [!include ~/snippets/signers/para.ts:main]
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/permissionless/v0_1/how-to/signers/para.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To use Para with permissionless.js, first create an application that integrates
Integrating permissionless.js with Para is straightforward after setting up the project. Para provides an Externally Owned Account (EOA) wallet to use as a signer with permissionless.js accounts.

### Create the Para signer
After following the Para documentation, you will have access to a `CapsuleWeb3Provider` object that you can use to create a `SmartAccountSigner` object:
After following the Para documentation, you will have access to a `ParaWeb3Provider` object that you can use to create a `SmartAccountSigner` object:

```typescript
// [!include ~/snippets/v0_1/signers/para.ts:main]
Expand Down
16 changes: 10 additions & 6 deletions docs/snippets/signers/para.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
// [!region main]
import Capsule from "@usecapsule/web-sdk"
import { createCapsuleViemClient } from "@usecapsule/viem-v2-integration"
import Para from "@getpara/web-sdk"
import { createParaViemClient } from "@getpara/viem-v2-integration"
import { toSafeSmartAccount } from "permissionless/accounts"
import { http } from "viem"
import { sepolia } from "viem/chains"

// Param options here will be specific to your project. See the Capsule docs for more info.
const capsule = new Capsule(env, apiKey)
// Param options here will be specific to your project. See the Para docs for more info.
const para = new Para(env, apiKey)

// Follow the Capsule docs for more instructions on creating the Viem client https://docs.usecapsule.com/integration-guide/signing-transactions
const smartAccountOwner = createCapsuleViemClient(capsule, {
// Convert a Para viem client to a SmartAccountSigner
// Follow the Para docs for more instructions on creating the Viem client https://docs.getpara.com/integration-guide/signing-transactions
const viemClient = createParaViemClient(para, {
chain: sepolia,
transport: http("https://rpc.ankr.com/eth_sepolia"),
})

const smartAccountSigner = toSafeSmartAccount({ owners: [viemClient] })
// [!endregion main]
14 changes: 7 additions & 7 deletions docs/snippets/v0_1/signers/para.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// [!region main]
import Capsule from "@usecapsule/web-sdk"
import { createCapsuleViemClient } from '@usecapsule/viem-v2-integration';
import Para from "@getpara/web-sdk"
import { createParaViemClient } from "@getpara/viem-v2-integration"
import { walletClientToSmartAccountSigner } from "permissionless"
import { http } from "viem"
import { sepolia } from "viem/chains"

// Param options here will be specific to your project. See the Capsule docs for more info.
const capsule = new Capsule(env, apiKey)
// Param options here will be specific to your project. See the Para docs for more info.
const para = new Para(env, apiKey)

// Convert a Capsule viem client to a SmartAccountSigner
// Follow the Capsule docs for more instructions on creating the Viem client https://docs.usecapsule.com/integration-guide/signing-transactions
const viemClient = createCapsuleViemClient(capsule, {
// Convert a Para viem client to a SmartAccountSigner
// Follow the Para docs for more instructions on creating the Viem client https://docs.getpara.com/integration-guide/signing-transactions
const viemClient = createParaViemClient(para, {
chain: sepolia,
transport: http("https://rpc.ankr.com/eth_sepolia"),
})
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"@dfns/sdk": "^0.3.1",
"@dfns/sdk-keysigner": "^0.3.1",
"@fireblocks/fireblocks-web3-provider": "^1.3.3",
"@getpara/viem-v2-integration": "^1.0.0",
"@getpara/web-sdk": "^1.0.0",
"@lit-protocol/auth-helpers": "^3.0.0",
"@lit-protocol/lit-node-client": "^3.0.0",
"@lit-protocol/pkp-ethers": "^3.0.0",
Expand All @@ -29,8 +31,6 @@
"@turnkey/http": "^2.7.1",
"@turnkey/viem": "^0.4.10",
"@types/node": "^20.11.2",
"@usecapsule/viem-v2-integration": "^1.10.1",
"@usecapsule/web-sdk": "^1.13.1",
"@web3auth/base": "^7.3.2",
"@web3auth/modal": "^7.3.2",
"caniuse-lite": "^1.0.30001655",
Expand Down
Loading

0 comments on commit d898cae

Please sign in to comment.