@coinlist-co/react 0.12.2-rc.31c2f50 → 0.12.2-rc.4851c6a

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 (36) hide show
  1. package/README.md +10 -0
  2. package/dist/{chunk-4IZ2F732.js → chunk-AYBP3HRJ.js} +10 -10
  3. package/dist/chunk-AYBP3HRJ.js.map +1 -0
  4. package/dist/{chunk-NBO5E2RO.js → chunk-GOUUYOPZ.js} +1243 -907
  5. package/dist/chunk-GOUUYOPZ.js.map +1 -0
  6. package/dist/{chunk-UJYSXXJF.js → chunk-LBIFCRFP.js} +160 -349
  7. package/dist/chunk-LBIFCRFP.js.map +1 -0
  8. package/dist/chunk-MJ6YXZWH.js +22 -0
  9. package/dist/chunk-MJ6YXZWH.js.map +1 -0
  10. package/dist/client/index.d.ts +3076 -4318
  11. package/dist/client/index.js +8571 -5709
  12. package/dist/client/index.js.map +1 -1
  13. package/dist/server/index.d.ts +7 -33
  14. package/dist/server/index.js +8 -4
  15. package/dist/server/index.js.map +1 -1
  16. package/dist/{tokens-namespace-D_XSpiS-.d.ts → time-Bzgi6FbG.d.ts} +2163 -2943
  17. package/dist/{token-registry-snapshot-BsAfBL_b.d.ts → token-registry-snapshot-BmjXOvvg.d.ts} +66 -36
  18. package/dist/universal/index.d.ts +59 -1313
  19. package/dist/universal/index.js +26 -42
  20. package/package.json +18 -14
  21. package/dist/chunk-4IZ2F732.js.map +0 -1
  22. package/dist/chunk-NBO5E2RO.js.map +0 -1
  23. package/dist/chunk-UJYSXXJF.js.map +0 -1
  24. package/dist/client/index.cjs +0 -17133
  25. package/dist/client/index.cjs.map +0 -1
  26. package/dist/client/index.d.cts +0 -6671
  27. package/dist/server/index.cjs +0 -4269
  28. package/dist/server/index.cjs.map +0 -1
  29. package/dist/server/index.d.cts +0 -378
  30. package/dist/time-CFocgYyl.d.cts +0 -50
  31. package/dist/time-DvgN98Q9.d.ts +0 -50
  32. package/dist/token-registry-snapshot-Cc_eA5zM.d.cts +0 -181
  33. package/dist/tokens-namespace-D_XSpiS-.d.cts +0 -3436
  34. package/dist/universal/index.cjs +0 -4321
  35. package/dist/universal/index.cjs.map +0 -1
  36. package/dist/universal/index.d.cts +0 -1629
@@ -1,26 +1,6 @@
1
- import { aL as ClientId, bA as RedirectUri, aM as CodeChallenge, bo as PKCEState, C as CodeVerifier, q as EvmWalletAddress, a as EthereumChain, aB as Tx, B as BlockchainAmount, bK as SwapPreview, a1 as AssetDecimals, aC as Newtype, D as TokenMetadata, aK as Chain, b as EvmContractAddress, bi as OfferToken } from './tokens-namespace-D_XSpiS-.js';
1
+ import { q as EvmWalletAddress, E as EthereumChain, b$ as Tx, bm as Newtype, U as TokenMetadata, aK as Chain, b as EvmContractAddress, bu as OfferToken } from './time-Bzgi6FbG.js';
2
2
  import { Hex, Abi, Hash, TransactionReceipt } from 'viem';
3
3
 
4
- type PKCEParams = {
5
- clientId: ClientId;
6
- responseType: 'code';
7
- redirectUri: RedirectUri;
8
- codeChallenge: CodeChallenge;
9
- codeChallengeMethod: 'S256';
10
- state: PKCEState;
11
- codeVerifier: CodeVerifier;
12
- };
13
- type PKCEConfig = {
14
- clientId: ClientId;
15
- redirectUri: RedirectUri;
16
- };
17
- /**
18
- * Generates PKCE parameters for an OAuth2 authorization code flow.
19
- * Pure crypto — no React, no DOM beyond Web Crypto API. Safe to use
20
- * in server-side code and Next.js middleware.
21
- */
22
- declare function generatePKCEParams(config: PKCEConfig): Promise<PKCEParams>;
23
-
24
4
  type WriteContractParams = {
25
5
  abi: Abi;
26
6
  address: `0x${string}`;
@@ -70,24 +50,29 @@ interface EvmWallet extends EvmSigner {
70
50
  type ConnectWallet = EvmSigner & {
71
51
  readonly chain: EthereumChain;
72
52
  };
73
-
74
53
  /**
75
- * A read-only quote for a swap as domain amounts: how much goes in, the
76
- * protocol fee, and how much would come out. Derived from the raw
77
- * {@link SwapPreview} the swap contract returns.
54
+ * The host's connector for an external wallet, as two lambdas: one opens it,
55
+ * one tears the connection down. The SDK ships no wallet stack, so this is how
56
+ * a screen offers "Connect wallet" without knowing whether AppKit, Privy or the
57
+ * host's own modal is behind it.
58
+ *
59
+ * One product type rather than two optional lambdas, because they come as a
60
+ * pair: a screen that can connect a wallet must be able to let it go again,
61
+ * and a host that supports neither passes `null` for the whole adapter, which
62
+ * hides the connect affordance entirely.
78
63
  */
79
- type SwapQuote = {
80
- inputTokenAmount: BlockchainAmount;
81
- fee: BlockchainAmount;
82
- outputTokenAmount: BlockchainAmount;
83
- };
84
- declare const SwapQuote: {
64
+ type ExternalWalletAdapter = {
85
65
  /**
86
- * Assembles a {@link SwapQuote} from a raw contract {@link SwapPreview}. The
87
- * input and fee are denominated in the input token; the output in the output
88
- * token.
66
+ * Opens the host's wallet connector. Resolves once the attempt finishes; the
67
+ * SDK reads the outcome from the external wallet it is handed on the next
68
+ * render rather than from a return value, so a host that connects through a
69
+ * redirect still works.
70
+ *
71
+ * Rejecting is how a declined or failed connection is reported.
89
72
  */
90
- fromPreview: (preview: SwapPreview, inputDecimals: AssetDecimals, outputDecimals: AssetDecimals) => SwapQuote;
73
+ connect: () => Promise<void>;
74
+ /** Disconnects the external wallet. Resolves when it is gone. */
75
+ disconnect: () => Promise<void>;
91
76
  };
92
77
 
93
78
  type FormattedAmountUi = Newtype<string, 'FormattedAmountUi'>;
@@ -107,6 +92,51 @@ declare const FormattedAmountAssetUi: (value: string) => FormattedAmountAssetUi;
107
92
  type AssetIconUrl = Newtype<string, 'AssetIconUrl'>;
108
93
  declare const AssetIconUrl: (value: string) => AssetIconUrl;
109
94
 
95
+ /**
96
+ * The wallets a screen reads for and acts from, supplied by the host.
97
+ *
98
+ * The SDK ships no wallet stack, so wallet discovery and connection are
99
+ * inverted onto the host: it hands over ready {@link EvmWallet}s, and an
100
+ * adapter for connecting an external one when it supports that. Every wallet
101
+ * here is one that can sign for itself, so a screen can broadcast from the
102
+ * wallet that holds a position.
103
+ *
104
+ * @alpha
105
+ */
106
+ type WalletSelection = {
107
+ /**
108
+ * The user's embedded (custodial) wallets, in display order. Empty when
109
+ * they have none, which is a normal state, not an error.
110
+ */
111
+ embedded: EvmWallet[];
112
+ /** The connected external wallet, or `null` while none is connected. */
113
+ external: EvmWallet | null;
114
+ /**
115
+ * The host's external-wallet connector, or `null` when it offers none - in
116
+ * which case the screen shows no connect affordance at all. A host may
117
+ * still pass a connected `external` without one, to show a wallet the user
118
+ * cannot change from here.
119
+ */
120
+ externalAdapter: ExternalWalletAdapter | null;
121
+ };
122
+ /** @alpha */
123
+ declare const WalletSelection: {
124
+ /**
125
+ * Every wallet in display order - embedded first, then the external one -
126
+ * each address once. Addresses compare case-insensitively, so a host that
127
+ * hands the same wallet over as both embedded and external sees it once.
128
+ */
129
+ all: (selection: WalletSelection) => EvmWallet[];
130
+ };
131
+ /**
132
+ * Names a wallet for display, e.g. `'CoinList Wallet'` for the user's
133
+ * embedded one. `null` means it has no name, and the screen shows its
134
+ * shortened address instead.
135
+ *
136
+ * @alpha
137
+ */
138
+ type WalletLabelResolver = (address: EvmWalletAddress) => string | null;
139
+
110
140
  /**
111
141
  * An array guaranteed to hold at least one element. Use it where an empty list
112
142
  * would be a bug (e.g. the set of assets a swap always offers).
@@ -178,4 +208,4 @@ declare function offerDisplayTokens(offer: {
178
208
  tokens: readonly OfferToken[];
179
209
  }): OfferToken[];
180
210
 
181
- export { AssetIconUrl as A, type BroadcastTxParams as B, type ConnectWallet as C, type EvmWallet as E, FormattedAmountAssetUi as F, type NonEmptyArray as N, type PKCEConfig as P, SwapQuote as S, TxExplorerUrl as T, type WriteContractParams as W, ShortenedWalletAddress as a, FormattedPercentUi as b, TokenRegistrySnapshot as c, type EvmSigner as d, FormattedAmountUi as e, type PKCEParams as f, generatePKCEParams as g, offerDisplayTokens as o };
211
+ export { AssetIconUrl as A, type BroadcastTxParams as B, type ConnectWallet as C, type EvmWallet as E, FormattedAmountAssetUi as F, type NonEmptyArray as N, ShortenedWalletAddress as S, TxExplorerUrl as T, WalletSelection as W, type WalletLabelResolver as a, FormattedPercentUi as b, TokenRegistrySnapshot as c, FormattedAmountUi as d, type EvmSigner as e, type ExternalWalletAdapter as f, type TokenKey as g, type WriteContractParams as h, offerDisplayTokens as o };