@dogeos/dogeos-sdk 3.0.13-beta.3 → 3.0.13

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.
Files changed (2) hide show
  1. package/README.md +55 -19
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Wallet Connect Kit
1
+ # Dogeos Connect Kit
2
2
 
3
3
  A lightweight React SDK for integrating crypto wallet connection functionality into your applications. It provides a configurable wallet list modal and basic account operations.
4
4
 
@@ -132,7 +132,7 @@ export function SignMessageButton() {
132
132
 
133
133
  try {
134
134
  const signature = await signMessage({
135
- message: "Hello Tomo Wallet",
135
+ message: "Hello Dogeos Wallet",
136
136
  });
137
137
  console.log("Signature result:", signature);
138
138
  } catch (error) {
@@ -612,33 +612,69 @@ export function SwitchChainButton() {
612
612
 
613
613
  ### Get Wallet Providers and Connectors
614
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):
615
+ Use the `useConnectors` hook to get all available providers from the currently connected wallet, grouped by chain type.
616
+ This is useful for multi-chain wallets (for example, OKX Wallet supports EVM, Solana, Aptos, Dogecoin, etc.).
617
+ Different chain providers are usually based on different underlying protocols, for example EVM providers commonly follow the EIP-1193 standard, while Dogecoin providers may come from Unisat-compatible implementations.
616
618
 
617
619
  ```tsx
618
620
  import { useConnectors } from "@dogeos/dogeos-sdk";
619
621
 
620
- export function ProvidersInfo() {
621
- const { connectors, currentProvider } = useConnectors();
622
+ export function SignMessageExamples() {
623
+ const { connectors } = useConnectors();
622
624
 
623
625
  if (!connectors) {
624
626
  return <div>No wallet connected</div>;
625
627
  }
626
628
 
627
629
  // 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
- );
630
+ // e.g., { evm: { provider, protocol, standard }, dogecoin: { provider, protocol, standard }, ... }
631
+ const evmConnector = connectors.evm ?? null;
632
+ const dogeConnector = connectors.dogecoin ?? null;
633
+
634
+ // EVM provider usually follows EIP-1193 standard
635
+ const evmProvider = evmConnector?.provider;
636
+ // Dogecoin provider usually comes from a Unisat-compatible provider
637
+ const dogeProvider = dogeConnector?.provider;
638
+
639
+ const handleEvmSignMessage = async () => {
640
+ if (!evmProvider) return;
641
+
642
+ const accounts = await evmProvider.request({
643
+ method: "eth_requestAccounts",
644
+ });
645
+ const from = accounts[0];
646
+
647
+ const message = "Hello from EVM";
648
+
649
+ // EIP-1193 personal_sign example
650
+ const signature = await evmProvider.request({
651
+ method: "personal_sign",
652
+ params: [message, from],
653
+ });
654
+
655
+ console.log("EVM signature:", signature);
656
+ };
657
+
658
+ const handleDogeSignMessage = async () => {
659
+ if (!dogeProvider) return;
660
+
661
+ const message = "Hello from Dogecoin";
662
+
663
+ // Unisat-like Dogecoin signMessage example
664
+ // Most Unisat-compatible providers expose a signMessage method
665
+ const signature = await dogeProvider.signMessage(message);
666
+
667
+ console.log("Dogecoin signature:", signature);
668
+ };
632
669
 
633
670
  return (
634
671
  <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>
672
+ <button disabled={!evmProvider} onClick={handleEvmSignMessage}>
673
+ Sign EVM Message
674
+ </button>
675
+ <button disabled={!dogeProvider} onClick={handleDogeSignMessage}>
676
+ Sign Dogecoin Message
677
+ </button>
642
678
  </div>
643
679
  );
644
680
  }
@@ -647,15 +683,15 @@ export function ProvidersInfo() {
647
683
  **Returns:**
648
684
 
649
685
  ```tsx
650
- interface useConnectors {
686
+ interface UseConnectors {
651
687
  // All available providers from the current wallet, keyed by chain type
652
688
  connectors: ConnectorProviders | null;
653
- // The currently active provider
689
+ // The currently active provider for the selected chain
654
690
  currentProvider: WalletProvider | null;
655
691
  }
656
692
  ```
657
693
 
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.
694
+ **Note:** `connectors` contains all connectors supported by the current wallet. For example, if you connect OKX Wallet, `connectors` may include `evm`, `dogecoin`, `solana`, and `aptos` connectors. Each entry provides a `provider` instance that you can use directly to call chain-specific RPC methods.
659
695
 
660
696
  ### Integration with Wagmi
661
697
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dogeos/dogeos-sdk",
3
3
  "private": false,
4
- "version": "3.0.13-beta.3",
4
+ "version": "3.0.13",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",