@particle-network/wallet
Version:
A wallet component that can be easily injected into the developer's website to provide rich custom styles.
53 lines (37 loc) • 1.29 kB
Markdown
# Particle Walelt
A wallet component that can be easily injected into the developer's website to provide rich custom styles.
## Installation
Install wallet and its peer dependencies.
```shell
yarn add -network/wallet
```
### Configure
Init Wallet with Particle project config, you can get the config from [Particle Dashboard](https://dashboard.particle.network/).
The modal support custom style, refer to [Wallet Service](https://docs.particle.network/developers/wallet-service/sdks/web).
```ts
import { walletEntryPlugin } from '-network/wallet';
// init wallet component, replace 'xxx' with project config.
walletEntryPlugin.init(
{
projectId: 'xxx',
clientKey: 'xxx',
appId: 'xxx',
},
walletOptions // optional: wallet custom configs
);
// set wallet provider
walletEntryPlugin.setWalletCore({
ethereum: provider, // optional: evm eip1193 provider
solana: wallet, // optional: solana wallet
});
// show wallet entry
walletEntryPlugin.walletEntryCreate();
// destroy wallet entry
walletEntryPlugin.walletEntryDestroy();
// open wallet
walletEntryPlugin.openWallet(params);
```
## Learn More
- [Website](https://particle.network)
- [Documentation](https://docs.particle.network/)
- [Live Demo](https://core-demo.particle.network/)