Skip to content

Commit

Permalink
update mpc core kit guide
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushBherwani1998 committed Nov 21, 2024
1 parent 686f5db commit 5214257
Show file tree
Hide file tree
Showing 3 changed files with 259 additions and 196 deletions.
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

0 comments on commit 5214257

Please sign in to comment.