Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MPC Corekit] Update Quick Start guide #995

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 2 additions & 42 deletions docs/sdk/mpc-core-kit/mpc-core-kit-js/initialize.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: "Web3Auth MPC Core Kit JS SDK - Initialize for Web | Documentation

import ChainConfig from "@site/src/common/sdk/pnp/web/_chain-config.mdx";
import Web3AuthOptions from "@site/src/common/sdk/pnp/web/_web3authcore-options.mdx";
import CreateAnInstance from "@site/src/common/sdk/mpc-core-kit/_create-an-instance.mdx";
import TabItem from "@theme/TabItem";
import Tabs from "@theme/Tabs";

Expand Down Expand Up @@ -194,48 +195,7 @@ export declare const UX_MODE: {

### Usage

<Tabs
defaultValue="secp256k1"
values={[
{ label: "Secp256k1", value: "secp256k1" },
{ label: "Ed25519", value: "ed25519" },
]}
>

<TabItem value="secp256k1">

```javascript
import { Web3AuthMPCCoreKit, WEB3AUTH_NETWORK } from "@web3auth/mpc-core-kit";
import { tssLib } from "@toruslabs/tss-dkls-lib";

const coreKitInstance = new Web3AuthMPCCoreKit({
web3AuthClientId: "YOUR_CLIENT_ID",
web3AuthNetwork: WEB3AUTH_NETWORK.MAINNET,
manualSync: true, // This is the recommended approach
tssLib: tssLib,
storage: window.storage,
});
```

</TabItem>

<TabItem value="ed25519">

```javascript
import { Web3AuthMPCCoreKit, WEB3AUTH_NETWORK } from "@web3auth/mpc-core-kit";
import { tssLib } from "@toruslabs/tss-frost-lib";

const coreKitInstance = new Web3AuthMPCCoreKit({
web3AuthClientId: "YOUR_CLIENT_ID",
web3AuthNetwork: WEB3AUTH_NETWORK.MAINNET,
manualSync: true, // This is the recommended approach
tssLib: tssLib,
storage: window.storage,
});
```

</TabItem>
</Tabs>
<CreateAnInstance />

## Initialize Web3AuthMPCCoreKit

Expand Down
45 changes: 45 additions & 0 deletions src/common/sdk/mpc-core-kit/_create-an-instance.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import TabItem from "@theme/TabItem";
import Tabs from "@theme/Tabs";

<Tabs
defaultValue="secp256k1"
values={[
{ label: "Secp256k1", value: "secp256k1" },
{ label: "Ed25519", value: "ed25519" },
]}
>

<TabItem value="secp256k1">

```javascript
import { Web3AuthMPCCoreKit, WEB3AUTH_NETWORK } from "@web3auth/mpc-core-kit";
import { tssLib } from "@toruslabs/tss-dkls-lib";

const coreKitInstance = new Web3AuthMPCCoreKit({
web3AuthClientId: "YOUR_CLIENT_ID",
web3AuthNetwork: WEB3AUTH_NETWORK.MAINNET,
manualSync: true, // This is the recommended approach
tssLib: tssLib,
storage: window.storage,
});
```

</TabItem>

<TabItem value="ed25519">

```javascript
import { Web3AuthMPCCoreKit, WEB3AUTH_NETWORK } from "@web3auth/mpc-core-kit";
import { tssLib } from "@toruslabs/tss-frost-lib";

const coreKitInstance = new Web3AuthMPCCoreKit({
web3AuthClientId: "YOUR_CLIENT_ID",
web3AuthNetwork: WEB3AUTH_NETWORK.MAINNET,
manualSync: true, // This is the recommended approach
tssLib: tssLib,
storage: window.storage,
});
```

</TabItem>
</Tabs>
Loading