Skip to content

Commit

Permalink
update wallet services docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushBherwani1998 committed Sep 19, 2024
1 parent 9bc5001 commit 687879e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 49 deletions.
24 changes: 5 additions & 19 deletions src/common/sdk/wallet-services/_wallet-services-hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,12 @@ component, use the `useWalletServicesPlugin` function.

```tsx
export interface IBaseWalletServicesHookContext {
/**
* Indicates whether the plugin is connected and ready to be used.
*/
isPluginConnected: boolean;
/**
* Shows the Wallet Connect Scanner to connect with dApps having Wallet Connect login option.
* This is useful for interoperability with dApps having Wallet Connect login option.
* @returns A Promise that resolves when the Wallet Connect Scanner is shown.
*/
showWalletConnectScanner(): Promise<void>;
/**
* Shows the TopUp modal to select local currency and amount to top up the wallet.
* @returns A Promise that resolves when the TopUp modal is shown.
*/
showCheckout(): Promise<void>;
/**
* Shows the Wallet Services modal UI to be used as a wallet UI.
* @returns A Promise that resolves when the Wallet Services modal UI is shown.
*/
showWalletUI(): Promise<void>;
showWalletConnectScanner(
showWalletConnectParams?: BaseEmbedControllerState["showWalletConnect"],
): Promise<void>;
showCheckout(showCheckoutParams?: BaseEmbedControllerState["showCheckout"]): Promise<void>;
showWalletUI(showWalletUiParams?: BaseEmbedControllerState["showWalletUi"]): Promise<void>;
}
```

Expand Down
43 changes: 13 additions & 30 deletions src/common/sdk/wallet-services/_wallet-services.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import PluginConfig from "@site/src/common/sdk/pnp/web/_plugin-config.mdx";
import PluginsExample from "@site/src/common/sdk/pnp/web/_plugins-example.mdx";

### [`@web3auth/wallet-services-plugin`](https://npmjs.com/package/@web3auth/wallet-services-plugin)

Wallet Services Plugin Enable allows your application to use templated wallet UI screens. Take
control of and personalize the wallet interface, and optionally, activate an embedded wallet for
your users.
The [Wallet Services Plugin](https://npmjs.com/package/@web3auth/wallet-services-plugin) enables
your application to integrate essential features like wallet top-ups, WalletConnect, and
customizable wallet and transaction UI screens. You gain full control to personalize the wallet
interface to suit your brand, while also having the option to embed a seamless wallet experience
directly for your users.

:::note Note

Expand All @@ -24,36 +24,19 @@ npm install --save @web3auth/wallet-services-plugin

## Initialization

Import the `WalletServicesPlugin` **class** from `@web3auth/wallet-services-plugin`.

```javascript
import { WalletServicesPlugin } from "@web3auth/wallet-services-plugin";
```

#### Assign the `WalletServicesPlugin` class to a variable

After creating your Web3Auth instance, you need to initialize the Wallet Services Plugin and add it
to a class for further usage.

```javascript
const walletServicesPlugin = new WalletServicesPlugin(options);
```
to the Web3Auth instance for further usage.

This constructor takes an object with `wsEmbedOpts` & `walletInitOptions` as input.

### Arguments
### Parameters

<PluginConfig />

## Add the `walletServicesPlugin` class to your `Web3Auth` instance
### Example

After initializing the `walletServicesPlugin`, use the `addPlugin()` function to your Web3Auth
instance, you can use the Wallet Services Plugin for your dApp.
```ts
import { WalletServicesPlugin } from "@web3auth/wallet-services-plugin";

const walletServicesPlugin = new WalletServicesPlugin();
// Use the existing Web3Auth instance
web3auth.addPlugin(walletServicesPlugin);
```
web3AuthInstance.addPlugin(walletServicesPlugin);
```

### Example

<PluginsExample />

0 comments on commit 687879e

Please sign in to comment.