@talken/talkenkit 2.6.1 → 2.7.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 (49) hide show
  1. package/dist/abcWallet-XBPHUTFQ.js +172 -0
  2. package/dist/chunk-D3AVQQJG.js +5703 -0
  3. package/dist/index.js +1 -1
  4. package/dist/wallets/walletConnectors/abcWallet/AbstractChainProvider.d.ts +67 -0
  5. package/dist/wallets/walletConnectors/abcWallet/AbstractChainProvider.js +10 -0
  6. package/dist/wallets/walletConnectors/abcWallet/EventEmitter.d.ts +12 -0
  7. package/dist/wallets/walletConnectors/abcWallet/EventEmitter.js +7 -0
  8. package/dist/wallets/walletConnectors/abcWallet/ProviderError.d.ts +42 -0
  9. package/dist/wallets/walletConnectors/abcWallet/ProviderError.js +17 -0
  10. package/dist/wallets/walletConnectors/chunk-2KHTFKPP.js +186 -0
  11. package/dist/wallets/walletConnectors/chunk-34GT4R3A.js +501 -0
  12. package/dist/wallets/walletConnectors/chunk-3QC567QK.js +94 -0
  13. package/dist/wallets/walletConnectors/chunk-4666JD5V.js +333 -0
  14. package/dist/wallets/walletConnectors/chunk-4V3HRM2R.js +95 -0
  15. package/dist/wallets/walletConnectors/chunk-5QYCHHVB.js +98 -0
  16. package/dist/wallets/walletConnectors/chunk-5UITEZJU.js +121 -0
  17. package/dist/wallets/walletConnectors/chunk-7IBMHOYD.js +102 -0
  18. package/dist/wallets/walletConnectors/chunk-A2DZALFI.js +108 -0
  19. package/dist/wallets/walletConnectors/chunk-BZPKBSWY.js +66 -0
  20. package/dist/wallets/walletConnectors/chunk-CBKU2ERC.js +54 -0
  21. package/dist/wallets/walletConnectors/chunk-CEOJSQAI.js +66 -0
  22. package/dist/wallets/walletConnectors/chunk-DHWJ3552.js +93 -0
  23. package/dist/wallets/walletConnectors/chunk-EJALZNAR.js +101 -0
  24. package/dist/wallets/walletConnectors/chunk-FGYJTUYV.js +94 -0
  25. package/dist/wallets/walletConnectors/chunk-FVA6H2VF.js +95 -0
  26. package/dist/wallets/walletConnectors/chunk-GJ4CJL7F.js +57 -0
  27. package/dist/wallets/walletConnectors/chunk-HALTGRQW.js +87 -0
  28. package/dist/wallets/walletConnectors/chunk-HQO76VJR.js +1470 -0
  29. package/dist/wallets/walletConnectors/chunk-IL6T5D4L.js +362 -0
  30. package/dist/wallets/walletConnectors/chunk-IONL6LMJ.js +71 -0
  31. package/dist/wallets/walletConnectors/chunk-KBM7EYHR.js +58 -0
  32. package/dist/wallets/walletConnectors/chunk-KQDFRZT4.js +65 -0
  33. package/dist/wallets/walletConnectors/chunk-LBG7ZBQY.js +273 -0
  34. package/dist/wallets/walletConnectors/chunk-PAYYNMNP.js +347 -0
  35. package/dist/wallets/walletConnectors/chunk-PXL5G2PM.js +96 -0
  36. package/dist/wallets/walletConnectors/chunk-QB3QLNSL.js +76 -0
  37. package/dist/wallets/walletConnectors/chunk-QEDCPITY.js +344 -0
  38. package/dist/wallets/walletConnectors/chunk-QRU6XFHH.js +110 -0
  39. package/dist/wallets/walletConnectors/chunk-T6RB3SM7.js +73 -0
  40. package/dist/wallets/walletConnectors/chunk-TA4DDCKN.js +96 -0
  41. package/dist/wallets/walletConnectors/chunk-TWVKSPTP.js +91 -0
  42. package/dist/wallets/walletConnectors/chunk-V5LGED4F.js +103 -0
  43. package/dist/wallets/walletConnectors/chunk-VRI5ZALU.js +212 -0
  44. package/dist/wallets/walletConnectors/chunk-W5HMOCGP.js +18 -0
  45. package/dist/wallets/walletConnectors/chunk-XFCZU22I.js +58 -0
  46. package/dist/wallets/walletConnectors/chunk-XS6GJRRA.js +98 -0
  47. package/dist/wallets/walletConnectors/chunk-XSX5EECZ.js +96 -0
  48. package/dist/wallets/walletConnectors/index.js +34 -34
  49. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8505,7 +8505,7 @@ function setRainbowKitVersion({ version }) {
8505
8505
  }
8506
8506
  function useFingerprint() {
8507
8507
  const fingerprint = useCallback16(() => {
8508
- setRainbowKitVersion({ version: "2.6.1" });
8508
+ setRainbowKitVersion({ version: "2.7.0" });
8509
8509
  }, []);
8510
8510
  useEffect22(() => {
8511
8511
  fingerprint();
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Abstract base class for all ABC Wallet chain providers.
3
+ *
4
+ * Provides common wallet state management, API client access,
5
+ * and request interceptor patterns shared across EVM, Solana,
6
+ * Bitcoin, and Tron providers.
7
+ *
8
+ * @typeParam TWallet - Chain-specific wallet type (AbcEvmWallet, AbcSolanaWallet, etc.)
9
+ * @typeParam TInterceptor - Chain-specific interceptor type
10
+ */
11
+ import type { TransactionChain, TransactionReceipt } from '../../../providers/TransactionResultProvider/types';
12
+ import { EventEmitter } from './EventEmitter';
13
+ import type { TalkenApiClient } from './api/TalkenApiClient';
14
+ /** Minimal wallet interface that all chain wallets must satisfy */
15
+ interface BaseWalletShape {
16
+ address: string;
17
+ }
18
+ export declare abstract class AbstractChainProvider<TWallet extends BaseWalletShape, TInterceptor = unknown> extends EventEmitter {
19
+ protected wallet: TWallet | null;
20
+ protected connected: boolean;
21
+ protected requestInterceptor?: TInterceptor;
22
+ protected talkenApi?: TalkenApiClient;
23
+ constructor(talkenApi?: TalkenApiClient);
24
+ /**
25
+ * Set wallet and emit connection events.
26
+ * Subclasses can override to emit chain-specific events (e.g., chainChanged for EVM).
27
+ */
28
+ setWallet(wallet: TWallet): void;
29
+ /**
30
+ * Hook for subclasses to emit chain-specific events on wallet set.
31
+ * Called after wallet is assigned and accountsChanged is emitted.
32
+ */
33
+ protected onWalletSet(_wallet: TWallet): void;
34
+ /** Clear wallet and emit disconnect events. */
35
+ clearWallet(): void;
36
+ /** Whether a wallet is connected. */
37
+ isConnected(): boolean;
38
+ /** Set request interceptor for sign confirmation UI. */
39
+ setRequestInterceptor(interceptor?: TInterceptor): void;
40
+ /** Set TalkenApiClient instance. */
41
+ setTalkenApi(talkenApi: TalkenApiClient): void;
42
+ /**
43
+ * Get TalkenApiClient or throw if not initialized.
44
+ * Falls back to the global singleton.
45
+ */
46
+ protected getTalkenApiClientOrThrow(): TalkenApiClient;
47
+ /**
48
+ * Show pending transaction UI via singleton callback.
49
+ * Subclasses call this before sending a transaction.
50
+ */
51
+ protected showPendingTx(params: {
52
+ network: string;
53
+ chain: TransactionChain;
54
+ }): void;
55
+ /**
56
+ * Update transaction result UI via singleton callback.
57
+ * Subclasses call this after a transaction is confirmed.
58
+ */
59
+ protected updateTxResult(params: {
60
+ txHash: string;
61
+ network: string;
62
+ chain: TransactionChain;
63
+ receipt?: TransactionReceipt | null;
64
+ explorerUrl?: string;
65
+ }): void;
66
+ }
67
+ export {};
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import {
3
+ AbstractChainProvider
4
+ } from "../chunk-5UITEZJU.js";
5
+ import "../chunk-R6ZE7JAZ.js";
6
+ import "../chunk-CBKU2ERC.js";
7
+ import "../chunk-GJ4CJL7F.js";
8
+ export {
9
+ AbstractChainProvider
10
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Lightweight EventEmitter for ABC Wallet providers.
3
+ * Shared base class — all chain providers extend this.
4
+ */
5
+ export declare class EventEmitter {
6
+ private events;
7
+ on(event: string, listener: Function): this;
8
+ off(event: string, listener: Function): this;
9
+ removeListener(event: string, listener: Function): this;
10
+ emit(event: string, ...args: any[]): boolean;
11
+ removeAllListeners(event?: string): this;
12
+ }
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import {
3
+ EventEmitter
4
+ } from "../chunk-CBKU2ERC.js";
5
+ export {
6
+ EventEmitter
7
+ };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Shared error codes and error class for ABC Wallet providers.
3
+ *
4
+ * Common codes follow EIP-1193 / JSON-RPC conventions.
5
+ * Chain-specific codes (5000+) extend the base set.
6
+ */
7
+ /** Common error codes shared by all providers */
8
+ export declare const ProviderErrorCode: {
9
+ readonly USER_REJECTED: 4001;
10
+ readonly UNAUTHORIZED: 4100;
11
+ readonly UNSUPPORTED_METHOD: 4200;
12
+ readonly DISCONNECTED: 4900;
13
+ readonly CHAIN_DISCONNECTED: 4901;
14
+ readonly INVALID_PARAMS: -32602;
15
+ readonly INTERNAL_ERROR: -32603;
16
+ /** Asset transfer with insufficient balance (Bitcoin, Tron) */
17
+ readonly INSUFFICIENT_FUNDS: 5001;
18
+ /** Bitcoin UTXO not found */
19
+ readonly UTXO_NOT_FOUND: 5002;
20
+ };
21
+ /** Base provider error — all chain-specific errors extend this */
22
+ export declare class ProviderError extends Error {
23
+ code: number;
24
+ data?: unknown;
25
+ constructor(code: number, message: string, data?: unknown);
26
+ }
27
+ /**
28
+ * Chain-specific error subclasses.
29
+ * Kept for backward compatibility — consumers may catch by class name.
30
+ */
31
+ export declare class ProviderRpcError extends ProviderError {
32
+ constructor(code: number, message: string, data?: unknown);
33
+ }
34
+ export declare class SolanaProviderError extends ProviderError {
35
+ constructor(code: number, message: string, data?: unknown);
36
+ }
37
+ export declare class BitcoinProviderError extends ProviderError {
38
+ constructor(code: number, message: string, data?: unknown);
39
+ }
40
+ export declare class TronProviderError extends ProviderError {
41
+ constructor(code: number, message: string, data?: unknown);
42
+ }
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import {
3
+ BitcoinProviderError,
4
+ ProviderError,
5
+ ProviderErrorCode,
6
+ ProviderRpcError,
7
+ SolanaProviderError,
8
+ TronProviderError
9
+ } from "../chunk-GJ4CJL7F.js";
10
+ export {
11
+ BitcoinProviderError,
12
+ ProviderError,
13
+ ProviderErrorCode,
14
+ ProviderRpcError,
15
+ SolanaProviderError,
16
+ TronProviderError
17
+ };
@@ -0,0 +1,186 @@
1
+ "use client";
2
+ import {
3
+ isAndroid,
4
+ isIOS
5
+ } from "./chunk-RETKWSKD.js";
6
+ import {
7
+ getInjectedConnector,
8
+ hasInjectedProvider
9
+ } from "./chunk-PONHGUSY.js";
10
+ import {
11
+ getWalletConnectConnector
12
+ } from "./chunk-PODFK4OS.js";
13
+
14
+ // src/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.ts
15
+ function isMetaMask(ethereum) {
16
+ if (!ethereum?.isMetaMask)
17
+ return false;
18
+ if (ethereum.isBraveWallet && !ethereum._events && !ethereum._state)
19
+ return false;
20
+ if (ethereum.isApexWallet)
21
+ return false;
22
+ if (ethereum.isAvalanche)
23
+ return false;
24
+ if (ethereum.isBackpack)
25
+ return false;
26
+ if (ethereum.isBifrost)
27
+ return false;
28
+ if (ethereum.isBitKeep)
29
+ return false;
30
+ if (ethereum.isBitski)
31
+ return false;
32
+ if (ethereum.isBlockWallet)
33
+ return false;
34
+ if (ethereum.isCoinbaseWallet)
35
+ return false;
36
+ if (ethereum.isDawn)
37
+ return false;
38
+ if (ethereum.isEnkrypt)
39
+ return false;
40
+ if (ethereum.isExodus)
41
+ return false;
42
+ if (ethereum.isFrame)
43
+ return false;
44
+ if (ethereum.isFrontier)
45
+ return false;
46
+ if (ethereum.isGamestop)
47
+ return false;
48
+ if (ethereum.isHyperPay)
49
+ return false;
50
+ if (ethereum.isImToken)
51
+ return false;
52
+ if (ethereum.isKuCoinWallet)
53
+ return false;
54
+ if (ethereum.isMathWallet)
55
+ return false;
56
+ if (ethereum.isNestWallet)
57
+ return false;
58
+ if (ethereum.isOkxWallet || ethereum.isOKExWallet)
59
+ return false;
60
+ if (ethereum.isOneInchIOSWallet || ethereum.isOneInchAndroidWallet)
61
+ return false;
62
+ if (ethereum.isOpera)
63
+ return false;
64
+ if (ethereum.isPhantom)
65
+ return false;
66
+ if (ethereum.isPortal)
67
+ return false;
68
+ if (ethereum.isRabby)
69
+ return false;
70
+ if (ethereum.isRainbow)
71
+ return false;
72
+ if (ethereum.isStatus)
73
+ return false;
74
+ if (ethereum.isTalisman)
75
+ return false;
76
+ if (ethereum.isTally)
77
+ return false;
78
+ if (ethereum.isTokenPocket)
79
+ return false;
80
+ if (ethereum.isTokenary)
81
+ return false;
82
+ if (ethereum.isTrust || ethereum.isTrustWallet)
83
+ return false;
84
+ if (ethereum.isXDEFI)
85
+ return false;
86
+ if (ethereum.isZeal)
87
+ return false;
88
+ if (ethereum.isZerion)
89
+ return false;
90
+ if (ethereum.__seif)
91
+ return false;
92
+ return true;
93
+ }
94
+ var metaMaskWallet = ({
95
+ projectId,
96
+ walletConnectParameters
97
+ }) => {
98
+ const isMetaMaskInjected = hasInjectedProvider({ flag: "isMetaMask" });
99
+ const shouldUseWalletConnect = !isMetaMaskInjected;
100
+ const getUri = (uri) => {
101
+ return isAndroid() ? uri : isIOS() ? (
102
+ // currently broken in MetaMask v6.5.0 https://github.com/MetaMask/metamask-mobile/issues/6457
103
+ `metamask://wc?uri=${encodeURIComponent(uri)}`
104
+ ) : `https://metamask.app.link/wc?uri=${encodeURIComponent(uri)}`;
105
+ };
106
+ return {
107
+ id: "metaMask",
108
+ name: "MetaMask",
109
+ rdns: "io.metamask",
110
+ iconUrl: async () => (await import("./metaMaskWallet-YFHEHW7V.js")).default,
111
+ iconAccent: "#f6851a",
112
+ iconBackground: "#fff",
113
+ installed: !shouldUseWalletConnect ? isMetaMaskInjected : void 0,
114
+ downloadUrls: {
115
+ android: "https://play.google.com/store/apps/details?id=io.metamask",
116
+ ios: "https://apps.apple.com/us/app/metamask/id1438144202",
117
+ mobile: "https://metamask.io/download",
118
+ qrCode: "https://metamask.io/download",
119
+ chrome: "https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",
120
+ edge: "https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",
121
+ firefox: "https://addons.mozilla.org/firefox/addon/ether-metamask",
122
+ opera: "https://addons.opera.com/extensions/details/metamask-10",
123
+ browserExtension: "https://metamask.io/download"
124
+ },
125
+ mobile: {
126
+ getUri: shouldUseWalletConnect ? getUri : void 0
127
+ },
128
+ qrCode: shouldUseWalletConnect ? {
129
+ getUri,
130
+ instructions: {
131
+ learnMoreUrl: "https://metamask.io/faqs/",
132
+ steps: [
133
+ {
134
+ description: "wallet_connectors.metamask.qr_code.step1.description",
135
+ step: "install",
136
+ title: "wallet_connectors.metamask.qr_code.step1.title"
137
+ },
138
+ {
139
+ description: "wallet_connectors.metamask.qr_code.step2.description",
140
+ step: "create",
141
+ title: "wallet_connectors.metamask.qr_code.step2.title"
142
+ },
143
+ {
144
+ description: "wallet_connectors.metamask.qr_code.step3.description",
145
+ step: "refresh",
146
+ title: "wallet_connectors.metamask.qr_code.step3.title"
147
+ }
148
+ ]
149
+ }
150
+ } : void 0,
151
+ extension: {
152
+ instructions: {
153
+ learnMoreUrl: "https://metamask.io/faqs/",
154
+ steps: [
155
+ {
156
+ description: "wallet_connectors.metamask.extension.step1.description",
157
+ step: "install",
158
+ title: "wallet_connectors.metamask.extension.step1.title"
159
+ },
160
+ {
161
+ description: "wallet_connectors.metamask.extension.step2.description",
162
+ step: "create",
163
+ title: "wallet_connectors.metamask.extension.step2.title"
164
+ },
165
+ {
166
+ description: "wallet_connectors.metamask.extension.step3.description",
167
+ step: "refresh",
168
+ title: "wallet_connectors.metamask.extension.step3.title"
169
+ }
170
+ ]
171
+ }
172
+ },
173
+ createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
174
+ projectId,
175
+ walletConnectParameters
176
+ }) : getInjectedConnector({
177
+ target: typeof window !== "undefined" ? window.ethereum?.providers?.find(
178
+ isMetaMask
179
+ ) ?? window.ethereum : void 0
180
+ })
181
+ };
182
+ };
183
+
184
+ export {
185
+ metaMaskWallet
186
+ };