Skip to content
Merged
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
1 change: 1 addition & 0 deletions content/build/_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default {
'seid-devtool': 'Generate Boilerplate Tx Messages',
'tokenfactory-tutorial': 'Token Factory',
'tokenfactory-allowlist': 'Allowlists',
'global-wallet': 'Global Wallet',
'multi-sig-accounts': 'Multi-Sig Accounts',
'querying-state': 'Querying Blockchain State',

Expand Down
101 changes: 101 additions & 0 deletions content/build/global-wallet.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import { Callout } from 'nextra/components';

# Global Wallet

<Callout type="error">The wallet integration (Global Wallet) available on sei.io is provided and maintained by
Dynamic, an independent third-party service. Sei does not develop, operate, or control this integration, and makes
no representations or warranties regarding its functionality, security, or availability.
By clicking "Log in with Sei," you acknowledge that any interactions, transactions, or security measures related to
your wallet are managed solely by Dynamic. Sei is not responsible for any loss, unauthorized access, or security
breaches arising from your use of the wallet integration.
For support, security concerns, or troubleshooting related to the wallet integration, please refer to Dynamic’s
terms of service and support resources.
If you do not agree to these terms, please refrain from using the wallet integration on sei.io.</Callout>

Global wallet is a [Dynamic](https://www.dynamic.xyz/) based wallet solution that enables smooth user onboarding by
providing embedded wallet that does not require installation of any additional wallet add-ons.

Integration into existing dApp requires few lines of code and will work seamlessly across all dApps, provided dApp uses
EIP-6963-compatible wallets or libraries like RainbowKit, WalletConnect, Dynamic itself and others.

## EIP-6963
EIP-6963 is a standardized communication protocol for embedded wallets, enabling seamless cross-application
interoperability in the web3 ecosystem. It defines a common API for:

- Wallet Discovery & Pairing: Allowing decentralized applications (dApps) to locate and securely connect with embedded wallets.
- Authentication & Session Management: Facilitating unified login experiences and secure authentication across multiple apps.
- Transaction Signing: Providing a consistent method for users to sign transactions through their embedded wallets.

## Installation

1.**Install Global Wallet Package**

```bash copy
yarn add @sei-js/global-wallet
```
or
```bash copy
npm install @sei-js/global-wallet
```

2.**Importing the Global Wallet**
To use this wallet with any wallet provider that supports the EIP-6963 standard, you need to import the wallet
package in your project.

```javascript copy
import "@sei-js/global-wallet/eip6963";
```

For example, if you are using the Dynamic library, you can import the Global Wallet package as follows:

```javascript
import { DynamicContextProvider } from "@dynamic-labs/sdk-react-core";
import { EthereumWalletConnectors } from "@dynamic-labs/ethereum";
import { DynamicWagmiConnector } from "@dynamic-labs/wagmi-connector";
import { createConfig, WagmiProvider } from "wagmi";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { http } from "viem";
import { sei, seiTestnet } from "viem/chains";
import Main from "./Main";
import 'sei-global-wallet/eip6963';


const config = createConfig({
chains: [sei, seiTestnet],
multiInjectedProviderDiscovery: false,
transports: {
[sei.id]: http(),
[seiTestnet.id]: http(),
},
});

const queryClient = new QueryClient();

const App = () => (
<DynamicContextProvider
theme="auto"
settings={{
environmentId: "<Yor Dynamic Environment ID>",
walletConnectors: [EthereumWalletConnectors],
}}
>
<WagmiProvider config={config}>
<QueryClientProvider client={queryClient}>
<DynamicWagmiConnector>
<Main />
</DynamicWagmiConnector>
</QueryClientProvider>
</WagmiProvider>
</DynamicContextProvider>
);

export default App;
```

3.**Use Global Wallet**
Your wallet is now ready to use within the project.

## References and links

- [<ins>Dynamic Global Wallet Documentation</ins>](https://docs.dynamic.xyz/global-wallets/overview)
- [<ins>Creating Dynamic based example app</ins>](https://docs.dynamic.xyz/example-apps)