@multiplatform.one/web3 8.2.2 → 8.4.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.
Files changed (211) hide show
  1. package/README.md +33 -2
  2. package/dist/cjs/clients/tron.cjs +176 -0
  3. package/dist/cjs/clients/tron.native.js +318 -0
  4. package/dist/cjs/clients/tron.native.js.map +1 -0
  5. package/dist/cjs/clients/useTronClient.cjs +50 -0
  6. package/dist/cjs/clients/useTronClient.native.js +63 -0
  7. package/dist/cjs/clients/useTronClient.native.js.map +1 -0
  8. package/dist/cjs/connectkit/adapters/TronAdapter.cjs +139 -0
  9. package/dist/cjs/connectkit/adapters/TronAdapter.native.js +217 -0
  10. package/dist/cjs/connectkit/adapters/TronAdapter.native.js.map +1 -0
  11. package/dist/cjs/connectkit/connectors/createWalletMessage.cjs +3 -3
  12. package/dist/cjs/connectkit/connectors/createWalletMessage.native.js +3 -3
  13. package/dist/cjs/connectkit/connectors/createWalletMessage.native.js.map +1 -1
  14. package/dist/cjs/connectkit/connectors/ensureWalletConnectors.cjs +2 -1
  15. package/dist/cjs/connectkit/connectors/ensureWalletConnectors.native.js +18 -35
  16. package/dist/cjs/connectkit/connectors/ensureWalletConnectors.native.js.map +1 -1
  17. package/dist/cjs/connectkit/connectors/syntheticChains.cjs +10 -4
  18. package/dist/cjs/connectkit/connectors/syntheticChains.native.js +10 -4
  19. package/dist/cjs/connectkit/connectors/syntheticChains.native.js.map +1 -1
  20. package/dist/cjs/connectkit/defaultConfig.cjs +2 -1
  21. package/dist/cjs/connectkit/defaultConfig.native.js +2 -1
  22. package/dist/cjs/connectkit/defaultConfig.native.js.map +1 -1
  23. package/dist/cjs/connectkit/siwe/SIWEContext.native.js.map +1 -1
  24. package/dist/cjs/connectkit/siwe/SIWEProvider.cjs +19 -16
  25. package/dist/cjs/connectkit/siwe/SIWEProvider.native.js +26 -16
  26. package/dist/cjs/connectkit/siwe/SIWEProvider.native.js.map +1 -1
  27. package/dist/cjs/connectkit/wallets/walletConfigs.cjs +12 -0
  28. package/dist/cjs/connectkit/wallets/walletConfigs.native.js +12 -0
  29. package/dist/cjs/connectkit/wallets/walletConfigs.native.js.map +1 -1
  30. package/dist/cjs/families/host.native.js.map +1 -1
  31. package/dist/cjs/families/tron.cjs +92 -0
  32. package/dist/cjs/families/tron.native.js +120 -0
  33. package/dist/cjs/families/tron.native.js.map +1 -0
  34. package/dist/cjs/keycloak/KeycloakWalletLogin.cjs +34 -3
  35. package/dist/cjs/keycloak/useWalletLogin.cjs +3 -2
  36. package/dist/cjs/providers/WalletProvider.cjs +1 -1
  37. package/dist/cjs/tron.cjs +46 -0
  38. package/dist/cjs/tron.native.js +49 -0
  39. package/dist/cjs/tron.native.js.map +1 -0
  40. package/dist/cjs/wagmi/host.cjs +9 -4
  41. package/dist/cjs/wagmi/host.native.js +6 -3
  42. package/dist/cjs/wagmi/host.native.js.map +1 -1
  43. package/dist/esm/clients/tron.mjs +133 -0
  44. package/dist/esm/clients/tron.mjs.map +1 -0
  45. package/dist/esm/clients/tron.native.js +272 -0
  46. package/dist/esm/clients/tron.native.js.map +1 -0
  47. package/dist/esm/clients/useTronClient.mjs +25 -0
  48. package/dist/esm/clients/useTronClient.mjs.map +1 -0
  49. package/dist/esm/clients/useTronClient.native.js +35 -0
  50. package/dist/esm/clients/useTronClient.native.js.map +1 -0
  51. package/dist/esm/connectkit/adapters/TronAdapter.mjs +111 -0
  52. package/dist/esm/connectkit/adapters/TronAdapter.mjs.map +1 -0
  53. package/dist/esm/connectkit/adapters/TronAdapter.native.js +186 -0
  54. package/dist/esm/connectkit/adapters/TronAdapter.native.js.map +1 -0
  55. package/dist/esm/connectkit/connectors/createWalletMessage.mjs +3 -3
  56. package/dist/esm/connectkit/connectors/createWalletMessage.mjs.map +1 -1
  57. package/dist/esm/connectkit/connectors/createWalletMessage.native.js +3 -3
  58. package/dist/esm/connectkit/connectors/createWalletMessage.native.js.map +1 -1
  59. package/dist/esm/connectkit/connectors/ensureWalletConnectors.mjs +2 -1
  60. package/dist/esm/connectkit/connectors/ensureWalletConnectors.mjs.map +1 -1
  61. package/dist/esm/connectkit/connectors/ensureWalletConnectors.native.js +18 -35
  62. package/dist/esm/connectkit/connectors/ensureWalletConnectors.native.js.map +1 -1
  63. package/dist/esm/connectkit/connectors/syntheticChains.mjs +8 -4
  64. package/dist/esm/connectkit/connectors/syntheticChains.mjs.map +1 -1
  65. package/dist/esm/connectkit/connectors/syntheticChains.native.js +8 -4
  66. package/dist/esm/connectkit/connectors/syntheticChains.native.js.map +1 -1
  67. package/dist/esm/connectkit/defaultConfig.mjs +2 -1
  68. package/dist/esm/connectkit/defaultConfig.mjs.map +1 -1
  69. package/dist/esm/connectkit/defaultConfig.native.js +2 -1
  70. package/dist/esm/connectkit/defaultConfig.native.js.map +1 -1
  71. package/dist/esm/connectkit/siwe/SIWEContext.mjs.map +1 -1
  72. package/dist/esm/connectkit/siwe/SIWEContext.native.js.map +1 -1
  73. package/dist/esm/connectkit/siwe/SIWEProvider.mjs +19 -16
  74. package/dist/esm/connectkit/siwe/SIWEProvider.mjs.map +1 -1
  75. package/dist/esm/connectkit/siwe/SIWEProvider.native.js +26 -16
  76. package/dist/esm/connectkit/siwe/SIWEProvider.native.js.map +1 -1
  77. package/dist/esm/connectkit/wallets/walletConfigs.mjs +12 -0
  78. package/dist/esm/connectkit/wallets/walletConfigs.mjs.map +1 -1
  79. package/dist/esm/connectkit/wallets/walletConfigs.native.js +12 -0
  80. package/dist/esm/connectkit/wallets/walletConfigs.native.js.map +1 -1
  81. package/dist/esm/families/host.mjs.map +1 -1
  82. package/dist/esm/families/host.native.js.map +1 -1
  83. package/dist/esm/families/tron.mjs +65 -0
  84. package/dist/esm/families/tron.mjs.map +1 -0
  85. package/dist/esm/families/tron.native.js +90 -0
  86. package/dist/esm/families/tron.native.js.map +1 -0
  87. package/dist/esm/keycloak/KeycloakWalletLogin.mjs +33 -3
  88. package/dist/esm/keycloak/KeycloakWalletLogin.mjs.map +1 -1
  89. package/dist/esm/keycloak/useWalletLogin.mjs +3 -2
  90. package/dist/esm/keycloak/useWalletLogin.mjs.map +1 -1
  91. package/dist/esm/providers/WalletProvider.mjs +1 -1
  92. package/dist/esm/providers/WalletProvider.mjs.map +1 -1
  93. package/dist/esm/tron.mjs +6 -0
  94. package/dist/esm/tron.mjs.map +1 -0
  95. package/dist/esm/tron.native.js +6 -0
  96. package/dist/esm/tron.native.js.map +1 -0
  97. package/dist/esm/wagmi/host.mjs +9 -4
  98. package/dist/esm/wagmi/host.mjs.map +1 -1
  99. package/dist/esm/wagmi/host.native.js +6 -3
  100. package/dist/esm/wagmi/host.native.js.map +1 -1
  101. package/dist/jsx/clients/tron.mjs +133 -0
  102. package/dist/jsx/clients/tron.mjs.map +1 -0
  103. package/dist/jsx/clients/tron.native.js +318 -0
  104. package/dist/jsx/clients/tron.native.js.map +1 -0
  105. package/dist/jsx/clients/useTronClient.mjs +25 -0
  106. package/dist/jsx/clients/useTronClient.mjs.map +1 -0
  107. package/dist/jsx/clients/useTronClient.native.js +63 -0
  108. package/dist/jsx/clients/useTronClient.native.js.map +1 -0
  109. package/dist/jsx/connectkit/adapters/TronAdapter.mjs +111 -0
  110. package/dist/jsx/connectkit/adapters/TronAdapter.mjs.map +1 -0
  111. package/dist/jsx/connectkit/adapters/TronAdapter.native.js +217 -0
  112. package/dist/jsx/connectkit/adapters/TronAdapter.native.js.map +1 -0
  113. package/dist/jsx/connectkit/connectors/createWalletMessage.mjs +3 -3
  114. package/dist/jsx/connectkit/connectors/createWalletMessage.mjs.map +1 -1
  115. package/dist/jsx/connectkit/connectors/createWalletMessage.native.js +3 -3
  116. package/dist/jsx/connectkit/connectors/createWalletMessage.native.js.map +1 -1
  117. package/dist/jsx/connectkit/connectors/ensureWalletConnectors.mjs +2 -1
  118. package/dist/jsx/connectkit/connectors/ensureWalletConnectors.mjs.map +1 -1
  119. package/dist/jsx/connectkit/connectors/ensureWalletConnectors.native.js +18 -35
  120. package/dist/jsx/connectkit/connectors/ensureWalletConnectors.native.js.map +1 -1
  121. package/dist/jsx/connectkit/connectors/syntheticChains.mjs +8 -4
  122. package/dist/jsx/connectkit/connectors/syntheticChains.mjs.map +1 -1
  123. package/dist/jsx/connectkit/connectors/syntheticChains.native.js +10 -4
  124. package/dist/jsx/connectkit/connectors/syntheticChains.native.js.map +1 -1
  125. package/dist/jsx/connectkit/defaultConfig.mjs +2 -1
  126. package/dist/jsx/connectkit/defaultConfig.mjs.map +1 -1
  127. package/dist/jsx/connectkit/defaultConfig.native.js +2 -1
  128. package/dist/jsx/connectkit/defaultConfig.native.js.map +1 -1
  129. package/dist/jsx/connectkit/siwe/SIWEContext.mjs.map +1 -1
  130. package/dist/jsx/connectkit/siwe/SIWEContext.native.js.map +1 -1
  131. package/dist/jsx/connectkit/siwe/SIWEProvider.mjs +19 -16
  132. package/dist/jsx/connectkit/siwe/SIWEProvider.mjs.map +1 -1
  133. package/dist/jsx/connectkit/siwe/SIWEProvider.native.js +26 -16
  134. package/dist/jsx/connectkit/siwe/SIWEProvider.native.js.map +1 -1
  135. package/dist/jsx/connectkit/wallets/walletConfigs.mjs +12 -0
  136. package/dist/jsx/connectkit/wallets/walletConfigs.mjs.map +1 -1
  137. package/dist/jsx/connectkit/wallets/walletConfigs.native.js +12 -0
  138. package/dist/jsx/connectkit/wallets/walletConfigs.native.js.map +1 -1
  139. package/dist/jsx/families/host.mjs.map +1 -1
  140. package/dist/jsx/families/host.native.js.map +1 -1
  141. package/dist/jsx/families/tron.mjs +65 -0
  142. package/dist/jsx/families/tron.mjs.map +1 -0
  143. package/dist/jsx/families/tron.native.js +120 -0
  144. package/dist/jsx/families/tron.native.js.map +1 -0
  145. package/dist/jsx/keycloak/KeycloakWalletLogin.mjs +33 -3
  146. package/dist/jsx/keycloak/KeycloakWalletLogin.mjs.map +1 -1
  147. package/dist/jsx/keycloak/useWalletLogin.mjs +3 -2
  148. package/dist/jsx/keycloak/useWalletLogin.mjs.map +1 -1
  149. package/dist/jsx/providers/WalletProvider.mjs +1 -1
  150. package/dist/jsx/providers/WalletProvider.mjs.map +1 -1
  151. package/dist/jsx/tron.mjs +6 -0
  152. package/dist/jsx/tron.mjs.map +1 -0
  153. package/dist/jsx/tron.native.js +49 -0
  154. package/dist/jsx/tron.native.js.map +1 -0
  155. package/dist/jsx/wagmi/host.mjs +9 -4
  156. package/dist/jsx/wagmi/host.mjs.map +1 -1
  157. package/dist/jsx/wagmi/host.native.js +6 -3
  158. package/dist/jsx/wagmi/host.native.js.map +1 -1
  159. package/dist/keycloak/login.iife.js +399 -399
  160. package/package.json +13 -7
  161. package/src/clients/tron.spec.ts +118 -0
  162. package/src/clients/tron.ts +186 -0
  163. package/src/clients/useTronClient.ts +26 -0
  164. package/src/connectkit/adapters/TronAdapter.spec.ts +155 -0
  165. package/src/connectkit/adapters/TronAdapter.ts +168 -0
  166. package/src/connectkit/adapters/discover.ts +1 -1
  167. package/src/connectkit/connectors/createWalletMessage.ts +3 -3
  168. package/src/connectkit/connectors/ensureWalletConnectors.ts +2 -1
  169. package/src/connectkit/connectors/syntheticChains.ts +8 -2
  170. package/src/connectkit/defaultConfig.ts +5 -2
  171. package/src/connectkit/siwe/SIWEContext.tsx +2 -0
  172. package/src/connectkit/siwe/SIWEProvider.tsx +23 -10
  173. package/src/connectkit/wallets/walletConfigs.tsx +8 -0
  174. package/src/families/host.ts +9 -2
  175. package/src/families/tron.spec.ts +118 -0
  176. package/src/families/tron.ts +63 -0
  177. package/src/keycloak/KeycloakWalletLogin.spec.tsx +110 -0
  178. package/src/keycloak/KeycloakWalletLogin.stories.tsx +93 -0
  179. package/src/keycloak/KeycloakWalletLogin.tsx +39 -2
  180. package/src/keycloak/useWalletLogin.ts +5 -1
  181. package/src/providers/WalletProvider.tsx +1 -1
  182. package/src/tron.ts +26 -0
  183. package/src/wagmi/host.tsx +6 -2
  184. package/types/clients/tron.d.ts +65 -0
  185. package/types/clients/tron.d.ts.map +1 -0
  186. package/types/clients/useTronClient.d.ts +8 -0
  187. package/types/clients/useTronClient.d.ts.map +1 -0
  188. package/types/connectkit/adapters/TronAdapter.d.ts +35 -0
  189. package/types/connectkit/adapters/TronAdapter.d.ts.map +1 -0
  190. package/types/connectkit/adapters/discover.d.ts +1 -1
  191. package/types/connectkit/adapters/discover.d.ts.map +1 -1
  192. package/types/connectkit/connectors/ensureWalletConnectors.d.ts.map +1 -1
  193. package/types/connectkit/connectors/syntheticChains.d.ts +4 -0
  194. package/types/connectkit/connectors/syntheticChains.d.ts.map +1 -1
  195. package/types/connectkit/defaultConfig.d.ts.map +1 -1
  196. package/types/connectkit/siwe/SIWEContext.d.ts +2 -0
  197. package/types/connectkit/siwe/SIWEContext.d.ts.map +1 -1
  198. package/types/connectkit/siwe/SIWEProvider.d.ts +0 -6
  199. package/types/connectkit/siwe/SIWEProvider.d.ts.map +1 -1
  200. package/types/connectkit/wallets/walletConfigs.d.ts.map +1 -1
  201. package/types/families/host.d.ts +9 -2
  202. package/types/families/host.d.ts.map +1 -1
  203. package/types/families/tron.d.ts +15 -0
  204. package/types/families/tron.d.ts.map +1 -0
  205. package/types/keycloak/KeycloakWalletLogin.d.ts +6 -1
  206. package/types/keycloak/KeycloakWalletLogin.d.ts.map +1 -1
  207. package/types/keycloak/useWalletLogin.d.ts +2 -0
  208. package/types/keycloak/useWalletLogin.d.ts.map +1 -1
  209. package/types/tron.d.ts +5 -0
  210. package/types/tron.d.ts.map +1 -0
  211. package/types/wagmi/host.d.ts.map +1 -1
@@ -423,3 +423,113 @@ describe("KeycloakWalletLogin after the page reloads during the wallet trip", ()
423
423
  expect(screen.queryByText("Mock Connector")).toBeNull();
424
424
  });
425
425
  });
426
+
427
+ describe("KeycloakWalletLogin when a sign-in fails (FZ-1825)", () => {
428
+ function failingFetch(answer: { nonce?: () => Response; sign?: Error }) {
429
+ vi.stubGlobal(
430
+ "fetch",
431
+ vi.fn(async (input: RequestInfo | URL, init?: RequestInit) => {
432
+ if (String(input).endsWith("/nonce"))
433
+ return answer.nonce?.() ?? new Response("nonce123abc");
434
+ const body = String(
435
+ init?.body ?? (input instanceof Request ? await input.clone().text() : ""),
436
+ );
437
+ if (answer.sign && /"method":"(eth_sign|personal_sign)"/.test(body)) throw answer.sign;
438
+ return new Response("not found", { status: 404 });
439
+ }),
440
+ );
441
+ }
442
+
443
+ async function connectedLogin() {
444
+ const rendered = renderLogin({ wagmiConfig: makeConfig(memoryStorage(), true) });
445
+ await waitFor(() => expect(rendered.config.state.status).toBe("connected"));
446
+ return rendered;
447
+ }
448
+
449
+ it("keeps an empty live region under the wallet button before anything fails", async () => {
450
+ await connectedLogin();
451
+ const region = document.getElementById("mpo-wallet-login-error");
452
+ expect(region?.getAttribute("aria-live")).toBe("polite");
453
+ expect(region?.textContent).toBe("");
454
+ });
455
+
456
+ it("a rejected signature says so under the button, which stays usable", async () => {
457
+ failingFetch({
458
+ sign: Object.assign(new Error("User rejected the request."), { code: 4001 }),
459
+ });
460
+ const { walletButton } = await connectedLogin();
461
+ const region = document.getElementById("mpo-wallet-login-error")!;
462
+
463
+ fireEvent.click(walletButton);
464
+ await waitFor(() => expect(region.textContent).toBe("You declined the signature. Try again."));
465
+ expect(document.getElementById("mpo-wallet-login-error")).toBe(region);
466
+ expect(walletButton.disabled).toBe(false);
467
+ expect(walletButton.textContent).toBe("Sign in with Wallet");
468
+
469
+ failingFetch({});
470
+ fireEvent.click(walletButton);
471
+ await waitFor(() => expect(region.textContent).toBe(""));
472
+ });
473
+
474
+ // The sign-in joins the page's mount-time nonce fetch, which react-query
475
+ // retries three times with backoff before it fails (about seven seconds).
476
+ it.each([
477
+ ["a 503 nonce", () => new Response("down", { status: 503 })],
478
+ ["an empty siww nonce", () => new Response("")],
479
+ [
480
+ "an unreachable server",
481
+ () => {
482
+ throw new TypeError("Failed to fetch");
483
+ },
484
+ ],
485
+ ] as const)(
486
+ "%s says the sign-in server couldn't be reached, in plain words",
487
+ { timeout: 20_000 },
488
+ async (_case, nonce) => {
489
+ const logged = vi.spyOn(console, "error").mockImplementation(() => {});
490
+ failingFetch({ nonce });
491
+ const { walletButton } = await connectedLogin();
492
+
493
+ fireEvent.click(walletButton);
494
+ const region = document.getElementById("mpo-wallet-login-error")!;
495
+ await waitFor(
496
+ () => expect(region.textContent).toBe("Couldn't reach the sign-in server. Try again."),
497
+ { timeout: 15_000 },
498
+ );
499
+ expect(region.textContent).not.toMatch(/keycloak|nonce|\d{3}/i);
500
+ expect(walletButton.disabled).toBe(false);
501
+ expect(logged.mock.calls.some(([label]) => label === "signIn error")).toBe(true);
502
+ },
503
+ );
504
+
505
+ it("any other failure says the sign-in failed, without the server's words", async () => {
506
+ failingFetch({
507
+ sign: Object.assign(new Error("Internal JSON-RPC error."), { code: -32603 }),
508
+ });
509
+ const { walletButton } = await connectedLogin();
510
+
511
+ fireEvent.click(walletButton);
512
+ const region = document.getElementById("mpo-wallet-login-error")!;
513
+ await waitFor(() => expect(region.textContent).toBe("Couldn't sign in. Try again."));
514
+ });
515
+
516
+ it("paints the failure line in the field error ink, or the page's own class", async () => {
517
+ failingFetch({
518
+ sign: Object.assign(new Error("User rejected the request."), { code: 4001 }),
519
+ });
520
+ const { walletButton } = await connectedLogin();
521
+ fireEvent.click(walletButton);
522
+ const region = document.getElementById("mpo-wallet-login-error")!;
523
+ await waitFor(() => expect(region.textContent).not.toBe(""));
524
+ // jsdom drops light-dark() colours; the Storybook shots on FZ-1825 measure the ink.
525
+ expect(region.style.colorScheme).toBe("light dark");
526
+ cleanup();
527
+
528
+ renderLogin({ wagmiConfig: makeConfig(memoryStorage(), true), errorClassName: "kc-error" });
529
+ const themed = document.getElementById("mpo-wallet-login-error")!;
530
+ expect(themed.className).toBe("");
531
+ fireEvent.click(document.getElementById("mpo-wallet-login") as HTMLButtonElement);
532
+ await waitFor(() => expect(themed.className).toBe("kc-error"));
533
+ expect(themed.getAttribute("style")).toBeNull();
534
+ });
535
+ });
@@ -0,0 +1,93 @@
1
+ import type { ReactElement } from "react";
2
+ import { userEvent, within } from "storybook/test";
3
+ import { createConfig, createStorage, http } from "wagmi";
4
+ import { mainnet } from "wagmi/chains";
5
+ import { mock } from "wagmi/connectors";
6
+ import { KeycloakWalletLogin } from "./KeycloakWalletLogin";
7
+
8
+ const KEYCLOAK = "https://keycloak-wallet-login.mock.test";
9
+ const ACCOUNT = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
10
+
11
+ function memoryStorage() {
12
+ const map = new Map<string, string>();
13
+ return {
14
+ getItem: (key: string) => map.get(key) ?? null,
15
+ setItem: (key: string, value: string) => void map.set(key, value),
16
+ removeItem: (key: string) => void map.delete(key),
17
+ };
18
+ }
19
+
20
+ function connectedWallet() {
21
+ return createConfig({
22
+ chains: [mainnet],
23
+ connectors: [
24
+ mock({ accounts: [ACCOUNT], features: { reconnect: true, defaultConnected: true } }),
25
+ ],
26
+ transports: { [mainnet.id]: http() },
27
+ storage: createStorage({ storage: memoryStorage() }),
28
+ });
29
+ }
30
+
31
+ function answerKeycloak(nonce: () => Response) {
32
+ return () => {
33
+ const realFetch = window.fetch;
34
+ window.fetch = async (input: RequestInfo | URL, init?: RequestInit) => {
35
+ const url =
36
+ typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
37
+ if (url.endsWith("/nonce")) return nonce();
38
+ const body = String(init?.body ?? "");
39
+ if (/"method":"(eth_sign|personal_sign)"/.test(body)) {
40
+ throw Object.assign(new Error("User rejected the request."), { code: 4001 });
41
+ }
42
+ if (!url.startsWith(KEYCLOAK)) return realFetch(input, init);
43
+ return new Response("not found", { status: 404 });
44
+ };
45
+ return () => {
46
+ window.fetch = realFetch;
47
+ };
48
+ };
49
+ }
50
+
51
+ async function pressWallet({ canvasElement }: { canvasElement: HTMLElement }) {
52
+ const canvas = within(canvasElement);
53
+ await userEvent.click(await canvas.findByRole("button", { name: /sign in with wallet/i }));
54
+ await canvas.findByText(/try again/i, {}, { timeout: 20_000 });
55
+ }
56
+
57
+ const meta = {
58
+ title: "Web3/KeycloakWalletLogin",
59
+ component: KeycloakWalletLogin,
60
+ tags: ["!test"],
61
+ parameters: { layout: "centered" },
62
+ decorators: [
63
+ (Story: () => ReactElement) => (
64
+ <div style={{ width: 320 }}>
65
+ <Story />
66
+ </div>
67
+ ),
68
+ ],
69
+ };
70
+ export default meta;
71
+
72
+ export const Idle = {
73
+ beforeEach: answerKeycloak(() => new Response("nonce123abc")),
74
+ render: () => (
75
+ <KeycloakWalletLogin baseUrl={KEYCLOAK} realm="main" wagmiConfig={connectedWallet()} />
76
+ ),
77
+ };
78
+
79
+ export const Declined = {
80
+ beforeEach: answerKeycloak(() => new Response("nonce123abc")),
81
+ render: () => (
82
+ <KeycloakWalletLogin baseUrl={KEYCLOAK} realm="main" wagmiConfig={connectedWallet()} />
83
+ ),
84
+ play: pressWallet,
85
+ };
86
+
87
+ export const ServerUnreachable = {
88
+ beforeEach: answerKeycloak(() => new Response("down", { status: 503 })),
89
+ render: () => (
90
+ <KeycloakWalletLogin baseUrl={KEYCLOAK} realm="main" wagmiConfig={connectedWallet()} />
91
+ ),
92
+ play: pressWallet,
93
+ };
@@ -14,7 +14,7 @@ import type { MobileConnectOptions } from "../connectkit/openConnector";
14
14
  import { ConnectKitProvider } from "../connectkit/web3Provider";
15
15
  import type { BrowserFlowOptions } from "./browserFlow";
16
16
  import { deriveKeycloakFromLocation, keycloakWallet } from "./keycloakWallet";
17
- import type { KeycloakWalletResource } from "./types";
17
+ import { KeycloakWalletError, type KeycloakWalletResource } from "./types";
18
18
  import { useWalletLogin } from "./useWalletLogin";
19
19
 
20
20
  export interface KeycloakWalletLoginProps {
@@ -44,6 +44,8 @@ export interface KeycloakWalletLoginProps {
44
44
  className?: string;
45
45
  /** Replaces the built-in button look, e.g. the theme's `kcButtonClass`. */
46
46
  buttonClassName?: string;
47
+ /** Replaces the built-in failure line look, e.g. the theme's `kcInputErrorMessageClass`. */
48
+ errorClassName?: string;
47
49
  /** The wagmi config to sign with; built from the app props and `chains` when absent. */
48
50
  wagmiConfig?: Config;
49
51
  }
@@ -97,6 +99,31 @@ const buttonStyle: CSSProperties = {
97
99
  const themeScopeStyle: CSSProperties = { display: "block" };
98
100
 
99
101
  const noticeStyle: CSSProperties = { margin: "8px 0 0", fontSize: 13 };
102
+ const hiddenNoticeStyle: CSSProperties = { margin: 0 };
103
+ // MPO's field error ink ($red10 light and dark, form-colors.md) for a page that brings no class of its own.
104
+ const errorStyle: CSSProperties = {
105
+ ...noticeStyle,
106
+ colorScheme: "light dark",
107
+ color: "light-dark(#dc3e42, #ec5d5e)",
108
+ };
109
+
110
+ const declinedMessage = "You declined the signature. Try again.";
111
+ const unreachableMessage = "Couldn't reach the sign-in server. Try again.";
112
+ const failedMessage = "Couldn't sign in. Try again.";
113
+
114
+ /** The words a failed wallet sign-in shows; the raw reason stays on the error and in the console. */
115
+ export function walletLoginFailureMessage(
116
+ status: StatusState,
117
+ error: Error | null,
118
+ ): string | undefined {
119
+ if (status === StatusState.REJECTED) return declinedMessage;
120
+ if (status !== StatusState.ERROR) return undefined;
121
+ if (error instanceof TypeError) return unreachableMessage;
122
+ if (error instanceof KeycloakWalletError && (error.status < 300 || error.status >= 500)) {
123
+ return unreachableMessage;
124
+ }
125
+ return failedMessage;
126
+ }
100
127
 
101
128
  const themedNoticeStyle: CSSProperties = { ...noticeStyle, color: "var(--ck-body-color)" };
102
129
 
@@ -180,11 +207,13 @@ function LoginButtons({
180
207
  gpgLabel = "Sign in with GPG",
181
208
  className,
182
209
  buttonClassName,
210
+ errorClassName,
183
211
  }: KeycloakWalletLoginProps) {
184
- const { login, status, dropped } = useWalletLogin();
212
+ const { login, status, dropped, error } = useWalletLogin();
185
213
  const { openGpg } = useWeb3Modal();
186
214
  const style = buttonClassName ? undefined : buttonStyle;
187
215
  const busy = status === StatusState.LOADING || status === StatusState.SUCCESS;
216
+ const failure = dropped || busy ? undefined : walletLoginFailureMessage(status, error);
188
217
  const buttons = (
189
218
  <div className={className ?? "mpo-keycloak-wallet-login"}>
190
219
  <button
@@ -201,6 +230,14 @@ function LoginButtons({
201
230
  <WalletIcon />
202
231
  <span>{busy ? "Signing…" : walletLabel}</span>
203
232
  </button>
233
+ <p
234
+ id="mpo-wallet-login-error"
235
+ aria-live="polite"
236
+ className={failure ? errorClassName : undefined}
237
+ style={!failure ? hiddenNoticeStyle : errorClassName ? undefined : errorStyle}
238
+ >
239
+ {failure}
240
+ </p>
204
241
  {dropped && !busy && (
205
242
  <p
206
243
  id="mpo-wallet-login-dropped"
@@ -29,6 +29,8 @@ export interface UseWalletLoginResult {
29
29
  * connects afresh and clears it.
30
30
  */
31
31
  dropped: boolean;
32
+ /** What ended the last signature, while status is ERROR or REJECTED. */
33
+ error: Error | null;
32
34
  }
33
35
 
34
36
  function readIntent(key: string, ttl: number): boolean {
@@ -98,7 +100,8 @@ export function useWalletLogin(opts: UseWalletLoginOptions = {}): UseWalletLogin
98
100
  setDropped(false);
99
101
  // A failed signature leaves SIWE on ERROR, which the sign-in step would
100
102
  // show the next attempt as "Unknown Error".
101
- if (!signIn && siwe?.status === StatusState.ERROR) siwe.resetStatus();
103
+ if (!signIn && (siwe?.status === StatusState.ERROR || siwe?.status === StatusState.REJECTED))
104
+ siwe.resetStatus();
102
105
  if (isConnected) {
103
106
  await sign();
104
107
  return;
@@ -129,5 +132,6 @@ export function useWalletLogin(opts: UseWalletLoginOptions = {}): UseWalletLogin
129
132
  isConnected,
130
133
  address,
131
134
  dropped,
135
+ error: signIn ? null : (siwe?.error ?? null),
132
136
  };
133
137
  }
@@ -51,7 +51,7 @@ const defaultQueryClient = new QueryClient();
51
51
  type WagmiConfigResult = ReturnType<typeof createConfig>;
52
52
  const wagmiConfigCache = new Map<string, WagmiConfigResult>();
53
53
 
54
- const walletEcosystems = ["solana", "sui", "bitcoin"] as const;
54
+ const walletEcosystems = ["solana", "sui", "bitcoin", "tron"] as const;
55
55
 
56
56
  function hosts(families: readonly WalletFamily[], ecosystem: HostedEcosystem) {
57
57
  return families.some((family) => wagmiHosting(family)?.ecosystem === ecosystem);
package/src/tron.ts ADDED
@@ -0,0 +1,26 @@
1
+ // `@multiplatform.one/web3/tron`: the Tron family and its client, for web
2
+ // only. A subpath with no react-native entry, so no Tron code reaches the
3
+ // native bundle until Tron has a bridge namespace.
4
+ export {
5
+ isTronAddress,
6
+ readTrc20Balance,
7
+ toTronBase58,
8
+ toTronHex,
9
+ tronAddressBytes,
10
+ tronClient,
11
+ tronGridUrls,
12
+ TronGridError,
13
+ type Trc20BalanceParameters,
14
+ type TronClient,
15
+ type TronClientOptions,
16
+ type TronGridOptions,
17
+ type TronNetwork,
18
+ } from "./clients/tron";
19
+ export { useTronClient } from "./clients/useTronClient";
20
+ export {
21
+ discoverTronWallets,
22
+ hasTronWallet,
23
+ TronAdapter,
24
+ tronNetworkOf,
25
+ } from "./connectkit/adapters/TronAdapter";
26
+ export { tron, tronDriver, tronMessage, type TronFamilyOptions } from "./families/tron";
@@ -30,7 +30,7 @@ export function hostFamiliesOnWagmi(
30
30
  return families.map((family) => {
31
31
  const hosting = wagmiHosting(family);
32
32
  if (!hosting) return family;
33
- const { ecosystem, chainId, solanaChain } = hosting;
33
+ const { ecosystem, chainId, solanaChain, client } = hosting;
34
34
  if (ecosystem === "evm")
35
35
  return defineWalletFamily({ ...family, driver: () => wagmiDriver(config) });
36
36
  return defineWalletFamily({
@@ -39,7 +39,11 @@ export function hostFamiliesOnWagmi(
39
39
  wagmiDriver(config, {
40
40
  filter: (connector) => connectorAdapter(connector, ecosystem) !== null,
41
41
  ...(chainId === undefined ? {} : { chainId }),
42
- client: (connector) => clientForConnector(connector, solanaChain ? { solanaChain } : {}),
42
+ client: (connector) => {
43
+ if (!client) return clientForConnector(connector, solanaChain ? { solanaChain } : {});
44
+ const adapter = connectorAdapter(connector, ecosystem);
45
+ return adapter?.address ? client(adapter) : null;
46
+ },
43
47
  }),
44
48
  });
45
49
  });
@@ -0,0 +1,65 @@
1
+ import type { WalletAdapter } from "../connectkit/adapters/types";
2
+ import type { ChainClient } from "./types";
3
+ /** The Tron networks TronGrid serves. */
4
+ export type TronNetwork = "mainnet" | "nile" | "shasta";
5
+ /** TronGrid's HTTP API per network. */
6
+ export declare const tronGridUrls: Readonly<Record<TronNetwork, string>>;
7
+ /**
8
+ * A Tron address as its 21 bytes, version byte 0x41 first. Takes base58
9
+ * (`T…`), 41-prefixed hex, or a bare 20-byte EVM-style hex. Throws on a bad
10
+ * checksum or length.
11
+ */
12
+ export declare function tronAddressBytes(address: string): Uint8Array;
13
+ /** The base58 form TronLink shows (`T…`), from any form tronAddressBytes takes. */
14
+ export declare function toTronBase58(address: string): string;
15
+ /** The 41-prefixed hex form TronGrid takes when `visible` is false. */
16
+ export declare function toTronHex(address: string): string;
17
+ /** Whether `address` is a well-formed Tron address in any form tronAddressBytes takes. */
18
+ export declare function isTronAddress(address: string): boolean;
19
+ /** Where a TronGrid read goes: a network, or an API URL of the app's own. */
20
+ export interface TronGridOptions {
21
+ /** Defaults to `mainnet`. Ignored when `apiUrl` is given. */
22
+ network?: TronNetwork;
23
+ /** A TronGrid-compatible full node, in place of the network's TronGrid URL. */
24
+ apiUrl?: string;
25
+ /** Sent as `TRON-PRO-API-KEY`. TronGrid serves keyless reads at a lower rate. */
26
+ apiKey?: string;
27
+ fetch?: typeof fetch;
28
+ signal?: AbortSignal;
29
+ }
30
+ export interface Trc20BalanceParameters extends TronGridOptions {
31
+ /** The TRC-20 contract. */
32
+ token: string;
33
+ /** The account whose balance is read. */
34
+ owner: string;
35
+ }
36
+ /** A TronGrid call that answered without a result. */
37
+ export declare class TronGridError extends Error {
38
+ readonly status?: number;
39
+ constructor(message: string, status?: number);
40
+ }
41
+ /**
42
+ * A TRC-20 `balanceOf(owner)` in the token's smallest unit, read through
43
+ * TronGrid's `triggerconstantcontract`. No wallet and no tronweb: one POST.
44
+ */
45
+ export declare function readTrc20Balance(parameters: Trc20BalanceParameters): Promise<bigint>;
46
+ type MessageAdapter = Pick<WalletAdapter, "address" | "signMessage">;
47
+ export interface TronClientOptions extends Omit<TronGridOptions, "signal"> {
48
+ }
49
+ /**
50
+ * The connected Tron wallet: message signing through TronLink and TRC-20
51
+ * reads through TronGrid on the wallet's network.
52
+ */
53
+ export interface TronClient extends ChainClient<"tron"> {
54
+ readonly address: string;
55
+ readonly chainId: "tron";
56
+ /** The network TronLink's node is on, which `trc20Balance` reads. */
57
+ readonly network: TronNetwork;
58
+ /** TronLink's `signMessageV2`, 0x hex. */
59
+ signMessage(message: string): Promise<string>;
60
+ /** A TRC-20 balance in the token's smallest unit, for the connected account unless `owner` is given. */
61
+ trc20Balance(token: string, owner?: string, signal?: AbortSignal): Promise<bigint>;
62
+ }
63
+ export declare function tronClient(adapter: MessageAdapter, options?: TronClientOptions): TronClient;
64
+ export {};
65
+ //# sourceMappingURL=tron.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tron.d.ts","sourceRoot":"","sources":["../../src/clients/tron.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,SAAS,CAAC;AAE7D,yCAAyC;AACzC,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAExD,uCAAuC;AACvC,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAI7D,CAAC;AAMH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAuB5D;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAOtD;AAED,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,6DAA6D;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BAAgB,UAAU,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAc/F"}
@@ -0,0 +1,8 @@
1
+ import { type TronClient } from "./tron";
2
+ /**
3
+ * The connected TronLink wallet: the connection store's client when one is
4
+ * mounted, else wagmi's shim connector's. Undefined while no Tron wallet
5
+ * holds the connection.
6
+ */
7
+ export declare function useTronClient(): TronClient | undefined;
8
+ //# sourceMappingURL=useTronClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTronClient.d.ts","sourceRoot":"","sources":["../../src/clients/useTronClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,UAAU,GAAG,SAAS,CAatD"}
@@ -0,0 +1,35 @@
1
+ import type { TronNetwork } from "../../clients/tron";
2
+ import type { WalletEntry } from "./discover";
3
+ import type { SignInMessageOptions, WalletAdapter, WalletAddress } from "./types";
4
+ /** The network TronLink's full node is on, from its host. Mainnet for an unknown node. */
5
+ export declare function tronNetworkOf(host: string | undefined): TronNetwork;
6
+ /** TronLink is on this page: the TIP-1193 `window.tron`, or the older `window.tronLink`. */
7
+ export declare function hasTronWallet(): boolean;
8
+ /**
9
+ * TronLink over its injected provider: `tron_requestAccounts` (or TIP-1193's
10
+ * `eth_requestAccounts`) to connect, `tronWeb.defaultAddress.base58` for the
11
+ * account, `tronWeb.trx.signMessageV2` to sign. No tronweb package.
12
+ */
13
+ export declare class TronAdapter implements WalletAdapter {
14
+ readonly chain = "tron";
15
+ address: WalletAddress | null;
16
+ isConnected: boolean;
17
+ get network(): TronNetwork;
18
+ get networkId(): string;
19
+ connect(): Promise<void>;
20
+ /**
21
+ * Takes the account TronLink already shares with this page, without a
22
+ * prompt. False when it shares none; throws while TronLink has not
23
+ * injected itself yet.
24
+ */
25
+ restore(): Promise<boolean>;
26
+ /** TronLink's account switches and disconnects; the account is read back from tronWeb on each. */
27
+ subscribe(listener: () => void): () => void;
28
+ disconnect(): Promise<void>;
29
+ buildMessage(_opts: SignInMessageOptions): Promise<string>;
30
+ /** TronLink's `signMessageV2`: the 0x hex signature over the TIP-191 prefixed message. */
31
+ signMessage(message: string): Promise<string>;
32
+ }
33
+ /** TronLink when it is on the page, as the one Tron wallet entry. */
34
+ export declare function discoverTronWallets(): WalletEntry[];
35
+ //# sourceMappingURL=TronAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TronAdapter.d.ts","sourceRoot":"","sources":["../../../src/connectkit/adapters/TronAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAwClF,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAInE;AAED,4FAA4F;AAC5F,wBAAgB,aAAa,IAAI,OAAO,CAGvC;AAED;;;;GAIG;AACH,qBAAa,WAAY,YAAW,aAAa;IAC/C,QAAQ,CAAC,KAAK,UAAU;IACxB,OAAO,EAAE,aAAa,GAAG,IAAI,CAAQ;IACrC,WAAW,UAAS;IAEpB,IAAI,OAAO,IAAI,WAAW,CAGzB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAuB9B;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IASjC,kGAAkG;IAClG,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IA+BrC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B,YAAY,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIhE,0FAA0F;IACpF,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAMpD;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,IAAI,WAAW,EAAE,CAKnD"}
@@ -1,5 +1,5 @@
1
1
  import type { WalletAdapter } from "./types";
2
- export type WalletEcosystem = "solana" | "sui" | "bitcoin";
2
+ export type WalletEcosystem = "solana" | "sui" | "bitcoin" | "tron";
3
3
  export interface WalletEntry {
4
4
  /** Stable id, e.g. "wallet:solana:phantom" — matches a walletConfigs key. */
5
5
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../../src/connectkit/adapters/discover.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAE3D,MAAM,WAAW,WAAW;IAC1B,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,SAAS,EAAE,eAAe,CAAC;IAC3B,qCAAqC;IACrC,OAAO,EAAE,aAAa,CAAC;IACvB,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAAI,WAAW,EAAE,CAqD/C"}
1
+ {"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../../src/connectkit/adapters/discover.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC;AAEpE,MAAM,WAAW,WAAW;IAC1B,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,SAAS,EAAE,eAAe,CAAC;IAC3B,qCAAqC;IACrC,OAAO,EAAE,aAAa,CAAC;IACvB,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAAI,WAAW,EAAE,CAqD/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"ensureWalletConnectors.d.ts","sourceRoot":"","sources":["../../../src/connectkit/connectors/ensureWalletConnectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAgC,MAAM,OAAO,CAAC;AAOlE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAiC7D"}
1
+ {"version":3,"file":"ensureWalletConnectors.d.ts","sourceRoot":"","sources":["../../../src/connectkit/connectors/ensureWalletConnectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAgC,MAAM,OAAO,CAAC;AAQlE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAiC7D"}
@@ -6,6 +6,8 @@ export declare const SOLANA_CHAIN_ID = 5459788;
6
6
  export declare const SUI_CHAIN_ID = 5461321;
7
7
  /** @deprecated The wagmi shim for Solana, Sui and Bitcoin wallets, which goes in a later major when the connect modal reads the connection store (MPO-385). Use the `sol()`, `sui()` and `btc()` families and `useConnection()`. */
8
8
  export declare const BITCOIN_CHAIN_ID = 4346947;
9
+ /** @deprecated The wagmi shim for Solana, Sui, Bitcoin and Tron wallets, which goes in a later major when the connect modal reads the connection store (MPO-385). Use the `tron()` family from `./tron` and `useConnection()`. */
10
+ export declare const TRON_CHAIN_ID = 5526104;
9
11
  export declare const syntheticChainIdByEcosystem: Record<Exclude<Ecosystem, "evm">, number>;
10
12
  export declare const ecosystemBySyntheticChainId: Record<number, Ecosystem>;
11
13
  /** @deprecated The wagmi shim for Solana, Sui and Bitcoin wallets, which goes in a later major when the connect modal reads the connection store (MPO-385). Use the `sol()`, `sui()` and `btc()` families and `useConnection()`. */
@@ -16,6 +18,8 @@ export declare const solanaChain: Chain;
16
18
  export declare const suiChain: Chain;
17
19
  /** @deprecated The wagmi shim for Solana, Sui and Bitcoin wallets, which goes in a later major when the connect modal reads the connection store (MPO-385). Use the `sol()`, `sui()` and `btc()` families and `useConnection()`. */
18
20
  export declare const bitcoinChain: Chain;
21
+ /** @deprecated The wagmi shim for Solana, Sui, Bitcoin and Tron wallets, which goes in a later major when the connect modal reads the connection store (MPO-385). Use the `tron()` family from `./tron` and `useConnection()`. */
22
+ export declare const tronChain: Chain;
19
23
  /** @deprecated The wagmi shim for Solana, Sui and Bitcoin wallets, which goes in a later major when the connect modal reads the connection store (MPO-385). Use the `sol()`, `sui()` and `btc()` families and `useConnection()`. */
20
24
  export declare const syntheticChains: Chain[];
21
25
  //# sourceMappingURL=syntheticChains.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"syntheticChains.d.ts","sourceRoot":"","sources":["../../../src/connectkit/connectors/syntheticChains.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAI/D,oOAAoO;AACpO,eAAO,MAAM,eAAe,UAAW,CAAC;AACxC,oOAAoO;AACpO,eAAO,MAAM,YAAY,UAAW,CAAC;AACrC,oOAAoO;AACpO,eAAO,MAAM,gBAAgB,UAAW,CAAC;AAEzC,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,CAIjF,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAIjE,CAAC;AAEF,oOAAoO;AACpO,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,KAAG,OACK,CAAC;AAmB5D,oOAAoO;AACpO,eAAO,MAAM,WAAW,OAAiD,CAAC;AAC1E,oOAAoO;AACpO,eAAO,MAAM,QAAQ,OAA2C,CAAC;AACjE,oOAAoO;AACpO,eAAO,MAAM,YAAY,OAAmD,CAAC;AAE7E,oOAAoO;AACpO,eAAO,MAAM,eAAe,EAAE,KAAK,EAA0C,CAAC"}
1
+ {"version":3,"file":"syntheticChains.d.ts","sourceRoot":"","sources":["../../../src/connectkit/connectors/syntheticChains.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAI/D,oOAAoO;AACpO,eAAO,MAAM,eAAe,UAAW,CAAC;AACxC,oOAAoO;AACpO,eAAO,MAAM,YAAY,UAAW,CAAC;AACrC,oOAAoO;AACpO,eAAO,MAAM,gBAAgB,UAAW,CAAC;AACzC,kOAAkO;AAClO,eAAO,MAAM,aAAa,UAAW,CAAC;AAEtC,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,CAKjF,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAKjE,CAAC;AAEF,oOAAoO;AACpO,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,KAAG,OACK,CAAC;AAmB5D,oOAAoO;AACpO,eAAO,MAAM,WAAW,OAAiD,CAAC;AAC1E,oOAAoO;AACpO,eAAO,MAAM,QAAQ,OAA2C,CAAC;AACjE,oOAAoO;AACpO,eAAO,MAAM,YAAY,OAAmD,CAAC;AAC7E,kOAAkO;AAClO,eAAO,MAAM,SAAS,OAA6C,CAAC;AAEpE,oOAAoO;AACpO,eAAO,MAAM,eAAe,EAAE,KAAK,EAAqD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaultConfig.d.ts","sourceRoot":"","sources":["../../src/connectkit/defaultConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAAQ,MAAM,OAAO,CAAC;AAE1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,uBAAuB,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAI9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAM5E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEvE,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,wBAAwB,CAAC,EAAE,wBAAwB,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC;IAEvE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;;OAGG;IACH,8BAA8B,CAAC,EAAE,sBAAsB,CAAC;IAIxD,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,eAAe,EAAE,CAAC;CACrD,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAEpC,QAAA,MAAM,aAAa,GAAI,uLAapB,kBAAkB,KAAG,sBAsDvB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"defaultConfig.d.ts","sourceRoot":"","sources":["../../src/connectkit/defaultConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAAQ,MAAM,OAAO,CAAC;AAE1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,uBAAuB,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAI9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAO5E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEvE,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,wBAAwB,CAAC,EAAE,wBAAwB,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC;IAEvE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;;OAGG;IACH,8BAA8B,CAAC,EAAE,sBAAsB,CAAC;IAIxD,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,eAAe,EAAE,CAAC;CACrD,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAEpC,QAAA,MAAM,aAAa,GAAI,uLAapB,kBAAkB,KAAG,sBAwDvB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -42,6 +42,8 @@ export type SIWEContextValue = Required<Omit<SIWEConfig, "onSign" | "subscribeNo
42
42
  nonce: ReturnType<typeof useQuery<string | null>>;
43
43
  session: ReturnType<typeof useQuery<SIWESession | null>>;
44
44
  status: StatusState;
45
+ /** What ended the last sign-in, while status is ERROR or REJECTED. */
46
+ error: Error | null;
45
47
  signIn: () => Promise<SIWESession | false>;
46
48
  resetStatus: () => void;
47
49
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SIWEContext.d.ts","sourceRoot":"","sources":["../../../src/connectkit/siwe/SIWEContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,E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,IAAI,CAAC,CAAC,CAAC;IACzD,MAAM,EAAE,WAAW,CAAC;IACpB,sEAAsE;IACtE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC;IAC3C,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEJ,eAAO,MAAM,WAAW,kDAA+C,CAAC"}
@@ -7,12 +7,6 @@ type Props = SIWEConfig & {
7
7
  };
8
8
  export declare const SIWE_NONCE_QUERY_KEY = "ckSiweNonce";
9
9
  export declare const SIWE_SESSION_QUERY_KEY = "ckSiweSession";
10
- /**
11
- * Sign-in over wagmi's account, mounted outside ConnectKitProvider.
12
- * @deprecated Goes in a later major. `SignInProvider` signs with whichever family the
13
- * connection store holds: `<SignInProvider {...kc.signInConfig(onSign)}>`,
14
- * or Web3Provider's `signIn` prop.
15
- */
16
10
  export declare const SIWEProvider: ({ children, enabled, nonceRefetchInterval, sessionRefetchInterval, signOutOnDisconnect, signOutOnAccountChange, signOutOnNetworkChange, onSignIn, onSignOut, ...siweConfig }: Props) => import("react/jsx-runtime").JSX.Element;
17
11
  export {};
18
12
  //# sourceMappingURL=SIWEProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SIWEProvider.d.ts","sourceRoot":"","sources":["../../../src/connectkit/siwe/SIWEProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmC,MAAM,OAAO,CAAC;AAMnE,OAAO,EAAe,UAAU,EAAe,WAAW,EAAE,MAAM,eAAe,CAAC;AAIlF,KAAK,KAAK,GAAG,UAAU,GAAG;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAClD,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AAKtD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,8KAW1B,KAAK,4CA0NP,CAAC"}
1
+ {"version":3,"file":"SIWEProvider.d.ts","sourceRoot":"","sources":["../../../src/connectkit/siwe/SIWEProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmC,MAAM,OAAO,CAAC;AAMnE,OAAO,EAAe,UAAU,EAAe,WAAW,EAAE,MAAM,eAAe,CAAC;AAIlF,KAAK,KAAK,GAAG,UAAU,GAAG;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAClD,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AAyBtD,eAAO,MAAM,YAAY,GAAI,8KAW1B,KAAK,4CAyNP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"walletConfigs.d.ts","sourceRoot":"","sources":["../../../src/connectkit/wallets/walletConfigs.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAE9B,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAEhC,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEhC,SAAS,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAE7C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,YAAY,CAAC,EAAE;QAIb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAElB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,OAAO,CAAC,EAAE,MAAM,CA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AAa,EAAE;IAC1B,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC;CAsT1B,CAAC"}
@@ -1,8 +1,10 @@
1
1
  import type { Config } from "wagmi";
2
2
  import type { SolanaChain } from "../clients/solanaMessage";
3
+ import type { ChainClient } from "../clients/types";
4
+ import type { WalletAdapter } from "../connectkit/adapters/types";
3
5
  import type { WalletFamily } from "../core/family";
4
- /** The ecosystem a wagmi connector carries: `evm`, or a Solana, Sui or Bitcoin shim's. */
5
- export type HostedEcosystem = "evm" | "solana" | "sui" | "bitcoin";
6
+ /** The ecosystem a wagmi connector carries: `evm`, or a Solana, Sui, Bitcoin or Tron shim's. */
7
+ export type HostedEcosystem = "evm" | "solana" | "sui" | "bitcoin" | "tron";
6
8
  /**
7
9
  * How a Web3Provider hosts a built-in family on its wagmi config while the
8
10
  * ConnectKit modal still lists and connects every wallet through wagmi
@@ -17,6 +19,11 @@ export interface WagmiHosting {
17
19
  readonly solanaChain?: SolanaChain;
18
20
  /** The wagmi config the app gave `eth()`, which the provider then uses. */
19
21
  readonly config?: Config;
22
+ /**
23
+ * The family's client over its shim's adapter, for a family whose client
24
+ * the shared connector lookup does not build, such as Tron's web-only one.
25
+ */
26
+ readonly client?: (adapter: WalletAdapter) => ChainClient | null;
20
27
  }
21
28
  export declare function withHosting(family: WalletFamily, spec: WagmiHosting): WalletFamily;
22
29
  /** How a Web3Provider hosts this family on wagmi; undefined for GPG and a family of the app's own. */
@@ -1 +1 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/families/host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,0FAA0F;AAC1F,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,GAA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