@sodax/wallet-sdk-react 1.5.7-beta → 2.0.0-rc.10

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 (127) hide show
  1. package/README.md +107 -142
  2. package/dist/XConnector-12q0OVe5.d.ts +146 -0
  3. package/dist/chunk-7V7O3Q7Y.mjs +62 -0
  4. package/dist/chunk-C6M34IVL.mjs +86 -0
  5. package/dist/chunk-DQTYAMKF.mjs +1609 -0
  6. package/dist/chunk-FSOGMSJH.mjs +39 -0
  7. package/dist/chunk-IFXZQW4C.mjs +98 -0
  8. package/dist/chunk-JQ4H4GJ5.mjs +100 -0
  9. package/dist/chunk-LKSSME2J.mjs +31 -0
  10. package/dist/chunk-MWWVB7TD.mjs +123 -0
  11. package/dist/chunk-NAKCAL2M.mjs +32 -0
  12. package/dist/chunk-OPYSVPRW.mjs +144 -0
  13. package/dist/chunk-QMXBY3UI.mjs +1 -0
  14. package/dist/chunk-TACW7Z4D.mjs +31 -0
  15. package/dist/chunk-WPZOLGVB.mjs +148 -0
  16. package/dist/chunk-X7BHR7WS.mjs +200 -0
  17. package/dist/chunk-Z5GXDHGL.mjs +190 -0
  18. package/dist/config-DEsqgrG1.d.ts +151 -0
  19. package/dist/index.d.ts +768 -1498
  20. package/dist/index.mjs +453 -2005
  21. package/dist/xchains/bitcoin/index.d.ts +125 -0
  22. package/dist/xchains/bitcoin/index.mjs +14 -0
  23. package/dist/xchains/evm/index.d.ts +39 -0
  24. package/dist/xchains/evm/index.mjs +3 -0
  25. package/dist/xchains/icon/index.d.ts +37 -0
  26. package/dist/xchains/icon/index.mjs +5 -0
  27. package/dist/xchains/injective/index.d.ts +35 -0
  28. package/dist/xchains/injective/index.mjs +3 -0
  29. package/dist/xchains/near/index.d.ts +34 -0
  30. package/dist/xchains/near/index.mjs +4 -0
  31. package/dist/xchains/solana/index.d.ts +26 -0
  32. package/dist/xchains/solana/index.mjs +5 -0
  33. package/dist/xchains/stacks/index.d.ts +42 -0
  34. package/dist/xchains/stacks/index.mjs +3 -0
  35. package/dist/xchains/stellar/index.d.ts +44 -0
  36. package/dist/xchains/stellar/index.mjs +4 -0
  37. package/dist/xchains/sui/index.d.ts +37 -0
  38. package/dist/xchains/sui/index.mjs +5 -0
  39. package/docs/ADDING_A_NEW_CHAIN.md +440 -0
  40. package/docs/ARCHITECTURE.md +291 -0
  41. package/docs/BATCH_OPERATIONS.md +267 -0
  42. package/docs/CHAIN_DETECTION.md +216 -0
  43. package/docs/CONFIGURE_PROVIDER.md +360 -0
  44. package/docs/CONNECTORS.md +247 -0
  45. package/docs/CONNECT_FLOW.md +276 -0
  46. package/docs/EVM_SWITCH_CHAIN.md +161 -0
  47. package/docs/SIGN_MESSAGE.md +213 -0
  48. package/docs/SUB_PATH_EXPORTS.md +218 -0
  49. package/docs/WALLETCONNECT.md +154 -0
  50. package/docs/WALLET_MODAL.md +331 -0
  51. package/docs/WALLET_PROVIDER_BRIDGE.md +226 -0
  52. package/package.json +56 -22
  53. package/dist/index.cjs +0 -2147
  54. package/dist/index.cjs.map +0 -1
  55. package/dist/index.d.cts +0 -1579
  56. package/dist/index.mjs.map +0 -1
  57. package/src/Hydrate.ts +0 -65
  58. package/src/SodaxWalletProvider.tsx +0 -97
  59. package/src/actions/getXChainType.ts +0 -8
  60. package/src/actions/getXService.ts +0 -33
  61. package/src/actions/index.ts +0 -2
  62. package/src/assets/wallets/hana.svg +0 -6
  63. package/src/assets/wallets/havah.svg +0 -76
  64. package/src/assets/wallets/keplr.svg +0 -30
  65. package/src/assets/wallets/metamask.svg +0 -60
  66. package/src/assets/wallets/phantom.svg +0 -4
  67. package/src/assets/wallets/sui.svg +0 -20
  68. package/src/core/XConnector.ts +0 -54
  69. package/src/core/XService.ts +0 -85
  70. package/src/core/index.ts +0 -2
  71. package/src/hooks/index.ts +0 -11
  72. package/src/hooks/useEthereumChainId.ts +0 -44
  73. package/src/hooks/useEvmSwitchChain.ts +0 -91
  74. package/src/hooks/useWalletProvider.ts +0 -206
  75. package/src/hooks/useXAccount.ts +0 -51
  76. package/src/hooks/useXAccounts.ts +0 -56
  77. package/src/hooks/useXBalances.ts +0 -65
  78. package/src/hooks/useXConnect.ts +0 -118
  79. package/src/hooks/useXConnection.ts +0 -72
  80. package/src/hooks/useXConnectors.ts +0 -72
  81. package/src/hooks/useXDisconnect.ts +0 -73
  82. package/src/hooks/useXService.ts +0 -8
  83. package/src/hooks/useXSignMessage.ts +0 -82
  84. package/src/index.ts +0 -19
  85. package/src/types/index.ts +0 -22
  86. package/src/useXWagmiStore.ts +0 -116
  87. package/src/utils/index.ts +0 -21
  88. package/src/xchains/bitcoin/BitcoinXConnector.ts +0 -34
  89. package/src/xchains/bitcoin/BitcoinXService.ts +0 -40
  90. package/src/xchains/bitcoin/OKXXConnector.ts +0 -117
  91. package/src/xchains/bitcoin/UnisatXConnector.ts +0 -117
  92. package/src/xchains/bitcoin/XverseXConnector.ts +0 -232
  93. package/src/xchains/bitcoin/index.ts +0 -7
  94. package/src/xchains/bitcoin/useBitcoinXConnectors.ts +0 -14
  95. package/src/xchains/evm/EvmXConnector.ts +0 -27
  96. package/src/xchains/evm/EvmXService.ts +0 -211
  97. package/src/xchains/evm/index.ts +0 -3
  98. package/src/xchains/icon/IconHanaXConnector.ts +0 -39
  99. package/src/xchains/icon/IconXService.ts +0 -117
  100. package/src/xchains/icon/actions.ts +0 -28
  101. package/src/xchains/icon/iconex/index.tsx +0 -46
  102. package/src/xchains/icon/index.ts +0 -2
  103. package/src/xchains/injective/InjectiveXConnector.ts +0 -60
  104. package/src/xchains/injective/InjectiveXService.ts +0 -62
  105. package/src/xchains/injective/actions.ts +0 -32
  106. package/src/xchains/injective/index.ts +0 -2
  107. package/src/xchains/near/NearXConnector.ts +0 -42
  108. package/src/xchains/near/NearXService.ts +0 -46
  109. package/src/xchains/near/useNearXConnectors.ts +0 -23
  110. package/src/xchains/solana/SolanaXConnector.ts +0 -26
  111. package/src/xchains/solana/SolanaXService.ts +0 -46
  112. package/src/xchains/solana/index.ts +0 -2
  113. package/src/xchains/stacks/StacksXConnector.ts +0 -63
  114. package/src/xchains/stacks/StacksXService.ts +0 -59
  115. package/src/xchains/stacks/constants.ts +0 -42
  116. package/src/xchains/stacks/index.ts +0 -4
  117. package/src/xchains/stacks/useStacksXConnectors.ts +0 -7
  118. package/src/xchains/stellar/CustomSorobanServer.ts +0 -93
  119. package/src/xchains/stellar/StellarWalletsKitXConnector.ts +0 -53
  120. package/src/xchains/stellar/StellarXService.ts +0 -93
  121. package/src/xchains/stellar/actions.ts +0 -24
  122. package/src/xchains/stellar/index.tsx +0 -2
  123. package/src/xchains/stellar/useStellarXConnectors.ts +0 -21
  124. package/src/xchains/stellar/utils.ts +0 -49
  125. package/src/xchains/sui/SuiXConnector.ts +0 -28
  126. package/src/xchains/sui/SuiXService.ts +0 -66
  127. package/src/xchains/sui/index.ts +0 -2
@@ -0,0 +1,125 @@
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
+ import { XToken, IBitcoinWalletProvider, BtcWalletAddressType } from '@sodax/types';
3
+ export { BtcWalletAddressType } from '@sodax/types';
4
+ import { BitcoinWalletDefaults } from '@sodax/wallet-sdk-core';
5
+ import { AddressPurpose } from 'sats-connect';
6
+
7
+ declare class BitcoinXService extends XService {
8
+ private static instance;
9
+ private rpcUrl;
10
+ private constructor();
11
+ static getInstance(rpcUrl?: string): BitcoinXService;
12
+ getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
13
+ }
14
+
15
+ /**
16
+ * Abstract base class for Bitcoin wallet connectors.
17
+ * Subclasses implement wallet-specific connection logic (Unisat, Xverse, OKX).
18
+ *
19
+ * `defaults` carries per-call overrides forwarded to the wallet provider built
20
+ * by each subclass. Currently honored field: `defaultFinalize` — applied to
21
+ * `signTransaction` when the caller omits the `finalize` argument.
22
+ */
23
+ declare abstract class BitcoinXConnector extends XConnector {
24
+ protected readonly defaults: BitcoinWalletDefaults | undefined;
25
+ constructor(name: string, id: string, defaults?: BitcoinWalletDefaults);
26
+ getXService(): BitcoinXService;
27
+ abstract connect(): Promise<XAccount | undefined>;
28
+ abstract disconnect(): Promise<void>;
29
+ /**
30
+ * Returns an IBitcoinWalletProvider instance after connecting.
31
+ * Used by useSpokeProvider to build BitcoinSpokeProvider.
32
+ */
33
+ abstract getWalletProvider(): IBitcoinWalletProvider | undefined;
34
+ /**
35
+ * Recreates a walletProvider from the browser extension window object
36
+ * and stored xAccount data (no connect() call, no popup).
37
+ * Used to restore provider after page reload without requiring reconnect.
38
+ */
39
+ abstract recreateWalletProvider(xAccount: XAccount): IBitcoinWalletProvider | undefined;
40
+ }
41
+
42
+ interface UnisatWallet {
43
+ getAccounts(): Promise<string[]>;
44
+ getPublicKey(): Promise<string>;
45
+ signPsbt(psbtHex: string, options?: {
46
+ autoFinalized?: boolean;
47
+ }): Promise<string>;
48
+ signMessage(message: string, type?: 'bip322-simple' | 'ecdsa'): Promise<string>;
49
+ requestAccounts(): Promise<string[]>;
50
+ sendBitcoin(address: string, satoshis: number): Promise<string>;
51
+ }
52
+ declare global {
53
+ interface Window {
54
+ unisat?: UnisatWallet;
55
+ }
56
+ }
57
+ declare class UnisatXConnector extends BitcoinXConnector {
58
+ private walletProvider;
59
+ constructor(defaults?: BitcoinWalletDefaults);
60
+ static isAvailable(): boolean;
61
+ get isInstalled(): boolean;
62
+ get installUrl(): string;
63
+ get icon(): string;
64
+ connect(): Promise<XAccount | undefined>;
65
+ disconnect(): Promise<void>;
66
+ getWalletProvider(): IBitcoinWalletProvider | undefined;
67
+ recreateWalletProvider(xAccount: XAccount): IBitcoinWalletProvider | undefined;
68
+ }
69
+
70
+ declare class XverseXConnector extends BitcoinXConnector {
71
+ private walletProvider;
72
+ /** Address purpose used when connecting. Taproot (Ordinals) by default to match Radfi. */
73
+ addressPurpose: AddressPurpose;
74
+ constructor(defaults?: BitcoinWalletDefaults);
75
+ /** Set address purpose and persist to localStorage. */
76
+ setAddressPurpose(type: BtcWalletAddressType): void;
77
+ static isAvailable(): boolean;
78
+ get isInstalled(): boolean;
79
+ get installUrl(): string;
80
+ get icon(): string;
81
+ connect(): Promise<XAccount | undefined>;
82
+ disconnect(): Promise<void>;
83
+ getWalletProvider(): IBitcoinWalletProvider | undefined;
84
+ recreateWalletProvider(xAccount: XAccount): IBitcoinWalletProvider | undefined;
85
+ }
86
+
87
+ interface OKXBitcoinWallet {
88
+ getAccounts(): Promise<string[]>;
89
+ getPublicKey(): Promise<string>;
90
+ signPsbt(psbtHex: string, options?: {
91
+ autoFinalized?: boolean;
92
+ }): Promise<string>;
93
+ signMessage(message: string, type?: 'bip322-simple' | 'ecdsa'): Promise<string>;
94
+ connect(): Promise<{
95
+ address: string;
96
+ publicKey: string;
97
+ }>;
98
+ sendBitcoin(toAddress: string, satoshis: number): Promise<string>;
99
+ }
100
+ declare global {
101
+ interface Window {
102
+ okxwallet?: {
103
+ bitcoin?: OKXBitcoinWallet;
104
+ };
105
+ }
106
+ }
107
+ declare class OKXXConnector extends BitcoinXConnector {
108
+ private walletProvider;
109
+ constructor(defaults?: BitcoinWalletDefaults);
110
+ static isAvailable(): boolean;
111
+ get isInstalled(): boolean;
112
+ get installUrl(): string;
113
+ get icon(): string;
114
+ connect(): Promise<XAccount | undefined>;
115
+ disconnect(): Promise<void>;
116
+ getWalletProvider(): IBitcoinWalletProvider | undefined;
117
+ recreateWalletProvider(xAccount: XAccount): IBitcoinWalletProvider | undefined;
118
+ }
119
+
120
+ /**
121
+ * Hook to return available Bitcoin wallet connectors from the globally registered xService.
122
+ */
123
+ declare function useBitcoinXConnectors(): BitcoinXConnector[];
124
+
125
+ export { BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, XverseXConnector, useBitcoinXConnectors };
@@ -0,0 +1,14 @@
1
+ export { BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, XverseXConnector, useBitcoinXConnectors } from '../../chunk-DQTYAMKF.mjs';
2
+ import '../../chunk-X7BHR7WS.mjs';
3
+ import '../../chunk-JQ4H4GJ5.mjs';
4
+ import '../../chunk-Z5GXDHGL.mjs';
5
+ import '../../chunk-MWWVB7TD.mjs';
6
+ import '../../chunk-C6M34IVL.mjs';
7
+ import '../../chunk-FSOGMSJH.mjs';
8
+ import '../../chunk-WPZOLGVB.mjs';
9
+ import '../../chunk-TACW7Z4D.mjs';
10
+ import '../../chunk-NAKCAL2M.mjs';
11
+ import '../../chunk-7V7O3Q7Y.mjs';
12
+ import '../../chunk-OPYSVPRW.mjs';
13
+ import '../../chunk-QMXBY3UI.mjs';
14
+ import '../../chunk-IFXZQW4C.mjs';
@@ -0,0 +1,39 @@
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
+ import { XToken } from '@sodax/types';
3
+ import { f as EvmTypeConfig } from '../../config-DEsqgrG1.js';
4
+ import { Config, CreateConnectorFn, Connector } from 'wagmi';
5
+ import '@sodax/wallet-sdk-core';
6
+ import 'wagmi/connectors';
7
+
8
+ type WagmiOptions = {
9
+ reconnectOnMount?: boolean;
10
+ ssr?: boolean;
11
+ };
12
+ declare const createWagmiConfig: (evmChains?: EvmTypeConfig["chains"], options?: WagmiOptions & {
13
+ connectors?: CreateConnectorFn[];
14
+ }) => Config;
15
+ /**
16
+ * Service class for handling EVM chain interactions.
17
+ * Implements singleton pattern and provides methods for wallet/chain operations.
18
+ */
19
+ declare class EvmXService extends XService {
20
+ private static instance;
21
+ wagmiConfig: Config | undefined;
22
+ private constructor();
23
+ static getInstance(): EvmXService;
24
+ _getTokenBalance(address: string | undefined, chainId: number, tokenAddress: string): Promise<bigint>;
25
+ _getChainBalance(address: string | undefined, chainId: number): Promise<bigint>;
26
+ getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
27
+ getBalances(address: string | undefined, xTokens: XToken[]): Promise<Record<string, bigint>>;
28
+ }
29
+
30
+ declare class EvmXConnector extends XConnector {
31
+ connector: Connector;
32
+ constructor(connector: Connector);
33
+ connect(): Promise<XAccount | undefined>;
34
+ disconnect(): Promise<void>;
35
+ get id(): string;
36
+ get icon(): string | undefined;
37
+ }
38
+
39
+ export { EvmXConnector, EvmXService, createWagmiConfig as createWagmi, createWagmiConfig };
@@ -0,0 +1,3 @@
1
+ export { EvmXConnector, EvmXService, createWagmiConfig as createWagmi, createWagmiConfig } from '../../chunk-Z5GXDHGL.mjs';
2
+ import '../../chunk-7V7O3Q7Y.mjs';
3
+ import '../../chunk-IFXZQW4C.mjs';
@@ -0,0 +1,37 @@
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
+ import { IconService } from 'icon-sdk-js';
3
+ import { XToken } from '@sodax/types';
4
+
5
+ declare enum SupportedChainId {
6
+ MAINNET = 1
7
+ }
8
+ interface ChainInfo {
9
+ readonly name: string;
10
+ readonly node: string;
11
+ readonly APIEndpoint: string;
12
+ readonly debugAPIEndpoint: string;
13
+ readonly chainId: number;
14
+ readonly tracker: string;
15
+ }
16
+ declare const CHAIN_INFO: {
17
+ readonly [chainId: number]: ChainInfo;
18
+ };
19
+ declare class IconXService extends XService {
20
+ private static instance;
21
+ iconService: IconService;
22
+ private constructor();
23
+ static getInstance(rpcUrl?: string): IconXService;
24
+ private getAggregateData;
25
+ getBalances(address: string | undefined, xTokens: XToken[]): Promise<Record<string, bigint>>;
26
+ }
27
+
28
+ declare class IconHanaXConnector extends XConnector {
29
+ constructor();
30
+ get isInstalled(): boolean;
31
+ get installUrl(): string;
32
+ connect(): Promise<XAccount | undefined>;
33
+ disconnect(): Promise<void>;
34
+ get icon(): string;
35
+ }
36
+
37
+ export { CHAIN_INFO, IconHanaXConnector, IconXService, SupportedChainId };
@@ -0,0 +1,5 @@
1
+ export { CHAIN_INFO, IconHanaXConnector, IconXService, SupportedChainId } from '../../chunk-WPZOLGVB.mjs';
2
+ import '../../chunk-TACW7Z4D.mjs';
3
+ import '../../chunk-NAKCAL2M.mjs';
4
+ import '../../chunk-7V7O3Q7Y.mjs';
5
+ import '../../chunk-IFXZQW4C.mjs';
@@ -0,0 +1,35 @@
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
+ import { IndexerGrpcAccountPortfolioApi, ChainGrpcWasmApi } from '@injectivelabs/sdk-ts';
3
+ import { MsgBroadcaster } from '@injectivelabs/wallet-core';
4
+ import { InjectiveRpcConfig, XToken } from '@sodax/types';
5
+ import { WalletStrategy } from '@sodax/libs/injective/wallet-strategy';
6
+ import { Wallet } from '@injectivelabs/wallet-base';
7
+
8
+ declare class InjectiveXService extends XService {
9
+ private static instance;
10
+ walletStrategy: WalletStrategy;
11
+ indexerGrpcAccountPortfolioApi: IndexerGrpcAccountPortfolioApi;
12
+ chainGrpcWasmApi: ChainGrpcWasmApi;
13
+ msgBroadcaster: MsgBroadcaster;
14
+ private constructor();
15
+ /**
16
+ * @param rpcConfig - Only applied on first call. Subsequent calls return the
17
+ * existing instance unchanged — gRPC/Indexer clients are built in the
18
+ * constructor and can't be rebuilt at runtime. Pass the desired endpoints
19
+ * via `SodaxWalletProvider.config.rpcConfig` once at app init.
20
+ */
21
+ static getInstance(rpcConfig?: InjectiveRpcConfig): InjectiveXService;
22
+ getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
23
+ }
24
+
25
+ declare class InjectiveXConnector extends XConnector {
26
+ private wallet;
27
+ constructor(name: string, wallet: Wallet);
28
+ getXService(): InjectiveXService;
29
+ connect(): Promise<XAccount | undefined>;
30
+ disconnect(): Promise<void>;
31
+ get icon(): string | undefined;
32
+ get isInstalled(): boolean;
33
+ }
34
+
35
+ export { InjectiveXConnector, InjectiveXService };
@@ -0,0 +1,3 @@
1
+ export { InjectiveXConnector, InjectiveXService } from '../../chunk-MWWVB7TD.mjs';
2
+ import '../../chunk-QMXBY3UI.mjs';
3
+ import '../../chunk-IFXZQW4C.mjs';
@@ -0,0 +1,34 @@
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
+ import { XToken } from '@sodax/types';
3
+ import { NearConnector, NearWalletBase } from '@hot-labs/near-connect';
4
+
5
+ declare class NearXService extends XService {
6
+ private static instance;
7
+ walletSelector: NearConnector;
8
+ rpcUrl: string;
9
+ /**
10
+ * @param rpcUrl - Used by `getBalance` via `JsonRpcProvider({ url: rpcUrl })`.
11
+ * Does NOT affect `walletSelector` — `@hot-labs/near-connect` only accepts
12
+ * the network preset name (`'mainnet'`/`'testnet'`) and fetches RPC internally.
13
+ * Custom RPC is therefore read-only for balance queries.
14
+ */
15
+ private constructor();
16
+ /**
17
+ * @param rpcUrl - Re-applied on every call (matches StacksXService semantics).
18
+ * `rpcUrl` only drives `getBalance` via a per-call `JsonRpcProvider`, so it's
19
+ * safe to update at runtime — no persistent chain client to rebuild.
20
+ */
21
+ static getInstance(rpcUrl?: string): NearXService;
22
+ getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
23
+ }
24
+
25
+ declare class NearXConnector extends XConnector {
26
+ _wallet: NearWalletBase;
27
+ constructor(wallet: NearWalletBase);
28
+ getXService(): NearXService;
29
+ connect(): Promise<XAccount | undefined>;
30
+ disconnect(): Promise<void>;
31
+ get icon(): string;
32
+ }
33
+
34
+ export { NearXConnector, NearXService };
@@ -0,0 +1,4 @@
1
+ export { NearXConnector, NearXService } from '../../chunk-C6M34IVL.mjs';
2
+ import '../../chunk-NAKCAL2M.mjs';
3
+ import '../../chunk-QMXBY3UI.mjs';
4
+ import '../../chunk-IFXZQW4C.mjs';
@@ -0,0 +1,26 @@
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
+ import { XToken } from '@sodax/types';
3
+ import { Connection } from '@solana/web3.js';
4
+ import { WalletContextState, Wallet } from '@solana/wallet-adapter-react';
5
+
6
+ declare class SolanaXService extends XService {
7
+ private static instance;
8
+ connection: Connection | undefined;
9
+ wallet: WalletContextState | undefined;
10
+ private constructor();
11
+ static getInstance(): SolanaXService;
12
+ getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
13
+ }
14
+
15
+ declare class SolanaXConnector extends XConnector {
16
+ wallet: Wallet;
17
+ constructor(wallet: Wallet);
18
+ getXService(): SolanaXService;
19
+ connect(): Promise<XAccount | undefined>;
20
+ disconnect(): Promise<void>;
21
+ get icon(): string;
22
+ get isInstalled(): boolean;
23
+ get installUrl(): string | undefined;
24
+ }
25
+
26
+ export { SolanaXConnector, SolanaXService };
@@ -0,0 +1,5 @@
1
+ export { SolanaXConnector } from '../../chunk-LKSSME2J.mjs';
2
+ export { SolanaXService } from '../../chunk-FSOGMSJH.mjs';
3
+ import '../../chunk-7V7O3Q7Y.mjs';
4
+ import '../../chunk-QMXBY3UI.mjs';
5
+ import '../../chunk-IFXZQW4C.mjs';
@@ -0,0 +1,42 @@
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
+ import { StacksNetworkName, XToken } from '@sodax/types';
3
+ import { StacksNetwork } from '@sodax/libs/stacks/core';
4
+ import { StacksProvider } from '@sodax/libs/stacks/connect';
5
+
6
+ declare class StacksXService extends XService {
7
+ private static instance;
8
+ network: StacksNetwork;
9
+ private constructor();
10
+ static getInstance(network?: StacksNetworkName | StacksNetwork): StacksXService;
11
+ /**
12
+ * @warning Network / fetch / contract-read failures are silently swallowed —
13
+ * `0n` is returned on any error. Callers cannot distinguish "zero balance"
14
+ * from "fetch failed"; UI that needs to surface the failure must wrap this
15
+ * call externally and re-fetch on its own error path.
16
+ */
17
+ getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
18
+ }
19
+
20
+ interface StacksProviderConfig {
21
+ /** The provider ID matching the window path, e.g. 'LeatherProvider' or 'XverseProviders.BitcoinProvider' */
22
+ id: string;
23
+ name: string;
24
+ icon: string;
25
+ installUrl?: string;
26
+ }
27
+ declare class StacksXConnector extends XConnector {
28
+ private readonly config;
29
+ constructor(config: StacksProviderConfig);
30
+ connect(): Promise<XAccount | undefined>;
31
+ disconnect(): Promise<void>;
32
+ get icon(): string;
33
+ get isInstalled(): boolean;
34
+ get installUrl(): string | undefined;
35
+ getProvider(): StacksProvider | undefined;
36
+ }
37
+
38
+ declare const STACKS_PROVIDERS: StacksProviderConfig[];
39
+
40
+ declare function useStacksXConnectors(): StacksXConnector[];
41
+
42
+ export { STACKS_PROVIDERS, type StacksProviderConfig, StacksXConnector, StacksXService, useStacksXConnectors };
@@ -0,0 +1,3 @@
1
+ export { STACKS_PROVIDERS, StacksXConnector, StacksXService, useStacksXConnectors } from '../../chunk-OPYSVPRW.mjs';
2
+ import '../../chunk-QMXBY3UI.mjs';
3
+ import '../../chunk-IFXZQW4C.mjs';
@@ -0,0 +1,44 @@
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
+ import { StellarWalletsKit } from '@creit.tech/stellar-wallets-kit';
3
+ import * as StellarSdk from '@stellar/stellar-sdk';
4
+ import { rpc, Transaction, Memo, MemoType, Operation, FeeBumpTransaction } from '@stellar/stellar-sdk';
5
+ import { XToken } from '@sodax/types';
6
+
7
+ declare class CustomSorobanServer extends rpc.Server {
8
+ private readonly customHeaders;
9
+ constructor(serverUrl: string, customHeaders: Record<string, string>);
10
+ simulateTransaction(tx: Transaction<Memo<MemoType>, Operation[]>): Promise<rpc.Api.SimulateTransactionResponse>;
11
+ sendTransaction(tx: Transaction | FeeBumpTransaction): Promise<rpc.Api.SendTransactionResponse>;
12
+ getTransaction(hash: string): Promise<rpc.Api.GetTransactionResponse>;
13
+ }
14
+
15
+ declare class StellarXService extends XService {
16
+ private static instance;
17
+ walletsKit: StellarWalletsKit;
18
+ server: StellarSdk.Horizon.Server;
19
+ sorobanServer: CustomSorobanServer;
20
+ private constructor();
21
+ static getInstance(horizonRpcUrl?: string, sorobanRpcUrl?: string): StellarXService;
22
+ getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
23
+ }
24
+
25
+ type StellarWalletType = {
26
+ icon: string;
27
+ id: string;
28
+ isAvailable: boolean;
29
+ name: string;
30
+ type: string;
31
+ url: string;
32
+ };
33
+ declare class StellarWalletsKitXConnector extends XConnector {
34
+ _wallet: StellarWalletType;
35
+ constructor(wallet: StellarWalletType);
36
+ getXService(): StellarXService;
37
+ connect(): Promise<XAccount | undefined>;
38
+ disconnect(): Promise<void>;
39
+ get icon(): string;
40
+ get isInstalled(): boolean;
41
+ get installUrl(): string | undefined;
42
+ }
43
+
44
+ export { StellarWalletsKitXConnector, StellarXService };
@@ -0,0 +1,4 @@
1
+ export { StellarWalletsKitXConnector, StellarXService } from '../../chunk-X7BHR7WS.mjs';
2
+ import '../../chunk-NAKCAL2M.mjs';
3
+ import '../../chunk-QMXBY3UI.mjs';
4
+ import '../../chunk-IFXZQW4C.mjs';
@@ -0,0 +1,37 @@
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
+ import { ISuiWalletProvider, XToken } from '@sodax/types';
3
+
4
+ interface SuiClientLike {
5
+ getBalance(input: {
6
+ owner: string;
7
+ coinType: string;
8
+ }): Promise<{
9
+ totalBalance: string;
10
+ }>;
11
+ }
12
+ declare class SuiXService extends XService {
13
+ private static instance;
14
+ suiClient: SuiClientLike | undefined;
15
+ suiWallet: unknown;
16
+ suiAccount: unknown;
17
+ private constructor();
18
+ static getInstance(): SuiXService;
19
+ createWalletProvider(): ISuiWalletProvider | undefined;
20
+ getBalances(address: string | undefined, xTokens: readonly XToken[]): Promise<Record<string, bigint>>;
21
+ }
22
+
23
+ interface SuiWalletInfo {
24
+ id?: string;
25
+ name: string;
26
+ icon?: string;
27
+ }
28
+ declare class SuiXConnector extends XConnector {
29
+ readonly wallet: SuiWalletInfo;
30
+ constructor(wallet: unknown);
31
+ getXService(): SuiXService;
32
+ connect(): Promise<XAccount | undefined>;
33
+ disconnect(): Promise<void>;
34
+ get icon(): string | undefined;
35
+ }
36
+
37
+ export { SuiXConnector, SuiXService };
@@ -0,0 +1,5 @@
1
+ export { SuiXConnector, SuiXService } from '../../chunk-JQ4H4GJ5.mjs';
2
+ import '../../chunk-TACW7Z4D.mjs';
3
+ import '../../chunk-7V7O3Q7Y.mjs';
4
+ import '../../chunk-QMXBY3UI.mjs';
5
+ import '../../chunk-IFXZQW4C.mjs';