@dogeos/dogeos-sdk 3.0.10 → 3.0.12
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 +54 -6
- package/dist/dogeos-sdk.css +1 -1
- package/dist/{features-animation-CV9YPT-7.js → features-animation-B5P3qL6l.js} +1 -1
- package/dist/{index-C3Wa2b52.js → index-DLBiNCEM.js} +6404 -6208
- package/dist/index-DcxyaROk.js +1423 -0
- package/dist/index-DrHcr1tD.js +18 -0
- package/dist/index.d.ts +88 -22
- package/dist/index.js +7 -5
- package/dist/src-UW24ZMRV-BdqBy3qR.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
|
@@ -48,8 +48,8 @@ import { WalletConnectProvider } from "@dogeos/dogeos-sdk";
|
|
|
48
48
|
|
|
49
49
|
const dogeConfig = {
|
|
50
50
|
...config,
|
|
51
|
-
clientId:
|
|
52
|
-
}
|
|
51
|
+
clientId: "your-client-id",
|
|
52
|
+
};
|
|
53
53
|
|
|
54
54
|
export default function App() {
|
|
55
55
|
return (
|
|
@@ -229,7 +229,7 @@ export function App() {
|
|
|
229
229
|
}, []);
|
|
230
230
|
|
|
231
231
|
return (
|
|
232
|
-
<WalletConnectProvider config={{ chains, clientId: "your-client-id"
|
|
232
|
+
<WalletConnectProvider config={{ chains, clientId: "your-client-id" }}>
|
|
233
233
|
<YourApp />
|
|
234
234
|
</WalletConnectProvider>
|
|
235
235
|
);
|
|
@@ -254,7 +254,7 @@ export function App() {
|
|
|
254
254
|
}, []);
|
|
255
255
|
|
|
256
256
|
return (
|
|
257
|
-
<WalletConnectProvider config={{ connectors
|
|
257
|
+
<WalletConnectProvider config={{ connectors, clientId: "your-client-id" }}>
|
|
258
258
|
<YourApp />
|
|
259
259
|
</WalletConnectProvider>
|
|
260
260
|
);
|
|
@@ -328,7 +328,7 @@ const config = {
|
|
|
328
328
|
},
|
|
329
329
|
},
|
|
330
330
|
} as ThemeConfig,
|
|
331
|
-
clientId: "your-client-id"
|
|
331
|
+
clientId: "your-client-id",
|
|
332
332
|
};
|
|
333
333
|
|
|
334
334
|
export function App() {
|
|
@@ -610,6 +610,53 @@ export function SwitchChainButton() {
|
|
|
610
610
|
}
|
|
611
611
|
```
|
|
612
612
|
|
|
613
|
+
### Get Wallet Providers and Connectors
|
|
614
|
+
|
|
615
|
+
Use the `useConnectors` hook to get all available connectors 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 { useConnectors } from "@dogeos/dogeos-sdk";
|
|
619
|
+
|
|
620
|
+
export function ProvidersInfo() {
|
|
621
|
+
const { connectors, currentProvider } = useConnectors();
|
|
622
|
+
|
|
623
|
+
if (!connectors) {
|
|
624
|
+
return <div>No wallet connected</div>;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
// connectors is an object with chain types as keys
|
|
628
|
+
// e.g., { evm: { provider, protocol, standard }, solana: { ... }, aptos: { ... } }
|
|
629
|
+
const supportedChains = Object.keys(connectors).filter(
|
|
630
|
+
(chainType) => connectors[chainType as keyof typeof connectors] !== 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 useConnectors {
|
|
651
|
+
// All available providers from the current wallet, keyed by chain type
|
|
652
|
+
connectors: ConnectorProviders | null;
|
|
653
|
+
// The currently active provider
|
|
654
|
+
currentProvider: WalletProvider | null;
|
|
655
|
+
}
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
**Note:** `connectors` contains all connectors supported by the current wallet. For example, if you connect OKX Wallet, `connectors` 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
|
+
- `useConnectors` - 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
|
|