@dogeos/dogeos-sdk 3.0.10-beta.0 → 3.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -1
- package/dist/dogeos-sdk.css +1 -1
- package/dist/{features-animation-CV9YPT-7.js → features-animation-D36_sZEh.js} +1 -1
- package/dist/{index-C3Wa2b52.js → index-Bq8_nfhM.js} +6385 -6196
- package/dist/index-Dg0uCNZL.js +18 -0
- package/dist/index-DpFTw21a.js +1423 -0
- package/dist/index.d.ts +81 -22
- package/dist/index.js +7 -6
- package/dist/src-UW24ZMRV-BPvKRGSZ.js +5 -0
- package/package.json +1 -1
- package/dist/index-DF0LHs_L.js +0 -18
- package/dist/index-HXXrwVr7.js +0 -1423
- package/dist/src-UW24ZMRV-Ci5cXeii.js +0 -5
package/README.md
CHANGED
|
@@ -610,6 +610,53 @@ export function SwitchChainButton() {
|
|
|
610
610
|
}
|
|
611
611
|
```
|
|
612
612
|
|
|
613
|
+
### Get Wallet Providers
|
|
614
|
+
|
|
615
|
+
Use the `useProviders` hook to get all available providers from the currently connected wallet. This is useful for wallets that support multiple chains (e.g., OKX Wallet supports EVM, Solana, and Aptos):
|
|
616
|
+
|
|
617
|
+
```tsx
|
|
618
|
+
import { useProviders } from "@dogeos/dogeos-sdk";
|
|
619
|
+
|
|
620
|
+
export function ProvidersInfo() {
|
|
621
|
+
const { providers, currentProvider } = useProviders();
|
|
622
|
+
|
|
623
|
+
if (!providers) {
|
|
624
|
+
return <div>No wallet connected</div>;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
// providers is an object with chain types as keys
|
|
628
|
+
// e.g., { evm: { provider, protocol, standard }, solana: { ... }, aptos: { ... } }
|
|
629
|
+
const supportedChains = Object.keys(providers).filter(
|
|
630
|
+
(chainType) => providers[chainType as keyof typeof providers] !== null
|
|
631
|
+
);
|
|
632
|
+
|
|
633
|
+
return (
|
|
634
|
+
<div>
|
|
635
|
+
<h3>Supported Chains:</h3>
|
|
636
|
+
<ul>
|
|
637
|
+
{supportedChains.map((chainType) => (
|
|
638
|
+
<li key={chainType}>{chainType.toUpperCase()}</li>
|
|
639
|
+
))}
|
|
640
|
+
</ul>
|
|
641
|
+
<p>Current Provider: {currentProvider ? "Connected" : "Not connected"}</p>
|
|
642
|
+
</div>
|
|
643
|
+
);
|
|
644
|
+
}
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
**Returns:**
|
|
648
|
+
|
|
649
|
+
```tsx
|
|
650
|
+
interface UseProviders {
|
|
651
|
+
// All available providers from the current wallet, keyed by chain type
|
|
652
|
+
providers: ConnectorProviders | null;
|
|
653
|
+
// The currently active provider
|
|
654
|
+
currentProvider: WalletProvider | null;
|
|
655
|
+
}
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
**Note:** `providers` contains all connectors supported by the current wallet. For example, if you connect OKX Wallet, `providers` may include `evm`, `solana`, and `aptos` connectors. The `currentProvider` is the provider currently being used for the active chain.
|
|
659
|
+
|
|
613
660
|
### Integration with Wagmi
|
|
614
661
|
|
|
615
662
|
Wallet Connect Kit can seamlessly integrate with Wagmi. If you're already using `WagmiProvider`, Wallet Connect Kit will automatically detect and use Wagmi's configuration:
|
|
@@ -681,7 +728,7 @@ interface WalletConnectKitConfig {
|
|
|
681
728
|
* @default undefined
|
|
682
729
|
* @example
|
|
683
730
|
* ```tsx
|
|
684
|
-
* import { WalletConnectProvider } from "@
|
|
731
|
+
* import { WalletConnectProvider } from "@dogeos/dogeos-sdk";
|
|
685
732
|
* const config: WalletConnectKitConfig = {
|
|
686
733
|
* defaultConnectChain: 'evm',
|
|
687
734
|
* };
|
|
@@ -735,6 +782,7 @@ type ChainType = "evm" | "solana" | "aptos" | "dogecoin";
|
|
|
735
782
|
- `WalletConnectProvider` - Main Provider component
|
|
736
783
|
- `useAccount` - Account information Hook
|
|
737
784
|
- `useWalletConnect` - Connect Hook
|
|
785
|
+
- `useProviders` - Providers information Hook (get all available providers from current wallet)
|
|
738
786
|
- `getChains` - Utility function to configure chains (can wrap backend API chains)
|
|
739
787
|
- Types: `WalletConnectKitConfig`, `Chain`, `WalletConfig`, `UseAccount`, `ChainType`, `ModalView`, `ThemeConfig`, `UserLoginConfig`
|
|
740
788
|
|