@dogeos/dogeos-sdk 3.0.13-beta.3 → 3.0.14-beta.0
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 +55 -19
- package/dist/{features-animation-lQM_iR9q.js → features-animation-BeahLJIq.js} +1 -1
- package/dist/{index-_ucuEk2Q.js → index-Bb5ol8mj.js} +4 -4
- package/dist/{index-BlgYlOS9.js → index-CuRx8gCh.js} +8268 -8184
- package/dist/{index-VRRzz9XN.js → index-CxpYwj3g.js} +1 -1
- package/dist/index.d.ts +6 -9
- package/dist/index.js +1 -1
- package/dist/src-UW24ZMRV-CIXOW27n.js +5 -0
- package/package.json +3 -3
- package/dist/src-UW24ZMRV-BlwxOd4h.js +0 -5
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
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
|
|
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
|
|
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
|
|
621
|
-
const { connectors
|
|
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 },
|
|
629
|
-
const
|
|
630
|
-
|
|
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
|
-
<
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
</
|
|
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
|
|
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.
|
|
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
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as Ct, H as Z, I as Ie, d as q, J as Ee, e as Mt, K as Mn, p as Ae, N as Fn, O as Dn, Q as Rn, a as P, R as le, T as On, U as In, V as Ne, W as H, X as Ft, b as Y, Y as En, Z as Nn, f as ne, w as Dt, B as ue, n as I, c as se, _ as ce, $ as Kn, h as Bn, r as Rt, a0 as Ke, a1 as Ln, x as kn, a2 as _n, j as O, a3 as Ot, a4 as It, a5 as Et, a6 as He, a7 as Nt, E as Gn, a8 as Un, a9 as $n, aa as qe, ab as jn, ac as Wn, ad as zn, ae as Hn, af as qn, ag as Yn, ah as Xn, ai as Zn, aj as Jn, ak as Qn, al as es } from "./index-
|
|
1
|
+
import { G as Ct, H as Z, I as Ie, d as q, J as Ee, e as Mt, K as Mn, p as Ae, N as Fn, O as Dn, Q as Rn, a as P, R as le, T as On, U as In, V as Ne, W as H, X as Ft, b as Y, Y as En, Z as Nn, f as ne, w as Dt, B as ue, n as I, c as se, _ as ce, $ as Kn, h as Bn, r as Rt, a0 as Ke, a1 as Ln, x as kn, a2 as _n, j as O, a3 as Ot, a4 as It, a5 as Et, a6 as He, a7 as Nt, E as Gn, a8 as Un, a9 as $n, aa as qe, ab as jn, ac as Wn, ad as zn, ae as Hn, af as qn, ag as Yn, ah as Xn, ai as Zn, aj as Jn, ak as Qn, al as es } from "./index-CuRx8gCh.js";
|
|
2
2
|
import { Fragment as ts } from "react";
|
|
3
3
|
function Kt(t, e) {
|
|
4
4
|
if (!Array.isArray(e))
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
}
|
|
12
12
|
})();
|
|
13
13
|
|
|
14
|
-
import { f as T, a as R, c as O, b as Ot, i as F, p as z, d as le, n as M, P as he, e as Ft, L as ce, S as ue, g as de, m as Nt, h as Gt, r as Wt, j as me, s as $, k as H, l as et } from "./index-
|
|
15
|
-
import { A as Zi, q as Ki, M as Ji, z as Qi, y as ts, w as es, v as is, u as ss, C as os, E as ns, t as as, o as rs, D as ls, x as hs, F as cs, B as us } from "./index-
|
|
16
|
-
import { i as fe, e as _t, p as pe, a as b, s as ge, m as ye, b as v, c as J, d as y, f as ve, g as xe, h as Pe, j as zt, k as it, l as $t, n as Te, F as Ht, o as st, q as De, r as ot, t as Xt, u as Se, S as Ee, v as Ae, w as V, x as N, y as G, z as nt, A as Re, B as Le, C as Ce, D as B, E as je, G as Ve } from "./features-animation-
|
|
17
|
-
import { K as ms, N as fs, V as ps, a4 as gs, H as ys, a2 as vs, P as xs, Q as Ps, R as Ts, T as Ds, U as Ss, W as Es, J as As, _ as Rs, X as Ls, Y as Cs, Z as js, M as Vs, a1 as Bs, a3 as Ms, $ as ws, O as ks, a0 as bs, L as Us, I as Is } from "./features-animation-
|
|
14
|
+
import { f as T, a as R, c as O, b as Ot, i as F, p as z, d as le, n as M, P as he, e as Ft, L as ce, S as ue, g as de, m as Nt, h as Gt, r as Wt, j as me, s as $, k as H, l as et } from "./index-CuRx8gCh.js";
|
|
15
|
+
import { A as Zi, q as Ki, M as Ji, z as Qi, y as ts, w as es, v as is, u as ss, C as os, E as ns, t as as, o as rs, D as ls, x as hs, F as cs, B as us } from "./index-CuRx8gCh.js";
|
|
16
|
+
import { i as fe, e as _t, p as pe, a as b, s as ge, m as ye, b as v, c as J, d as y, f as ve, g as xe, h as Pe, j as zt, k as it, l as $t, n as Te, F as Ht, o as st, q as De, r as ot, t as Xt, u as Se, S as Ee, v as Ae, w as V, x as N, y as G, z as nt, A as Re, B as Le, C as Ce, D as B, E as je, G as Ve } from "./features-animation-BeahLJIq.js";
|
|
17
|
+
import { K as ms, N as fs, V as ps, a4 as gs, H as ys, a2 as vs, P as xs, Q as Ps, R as Ts, T as Ds, U as Ss, W as Es, J as As, _ as Rs, X as Ls, Y as Cs, Z as js, M as Vs, a1 as Bs, a3 as Ms, $ as ws, O as ks, a0 as bs, L as Us, I as Is } from "./features-animation-BeahLJIq.js";
|
|
18
18
|
import { jsx as Be } from "react/jsx-runtime";
|
|
19
19
|
import { useContext as Q, useId as Me, useEffect as we, useCallback as ke, Component as be } from "react";
|
|
20
20
|
const at = (t, e) => Math.abs(t - e);
|