@coinlist-co/react 0.12.2-rc.7b430dd → 0.12.2-rc.8a0d02a

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 (31) hide show
  1. package/dist/{chunk-DCW7NQXH.js → chunk-3WW5FLT7.js} +52 -19
  2. package/dist/chunk-3WW5FLT7.js.map +1 -0
  3. package/dist/{chunk-MOE5S6CE.js → chunk-C6GF7MDF.js} +915 -458
  4. package/dist/chunk-C6GF7MDF.js.map +1 -0
  5. package/dist/{chunk-VH34YC3Q.js → chunk-IZJ4JSSC.js} +78 -4
  6. package/dist/chunk-IZJ4JSSC.js.map +1 -0
  7. package/dist/client/index.cjs +12103 -8452
  8. package/dist/client/index.cjs.map +1 -1
  9. package/dist/client/index.d.cts +1640 -37
  10. package/dist/client/index.d.ts +1640 -37
  11. package/dist/client/index.js +7923 -4800
  12. package/dist/client/index.js.map +1 -1
  13. package/dist/server/index.cjs +789 -142
  14. package/dist/server/index.cjs.map +1 -1
  15. package/dist/server/index.d.cts +69 -41
  16. package/dist/server/index.d.ts +69 -41
  17. package/dist/server/index.js +323 -65
  18. package/dist/server/index.js.map +1 -1
  19. package/dist/{tokens-namespace-CIWBtgt2.d.cts → time-CVZpAkGY.d.cts} +878 -192
  20. package/dist/{tokens-namespace-CIWBtgt2.d.ts → time-CVZpAkGY.d.ts} +878 -192
  21. package/dist/{token-registry-snapshot-BNBNuDu1.d.ts → token-registry-snapshot-BkwA8KmD.d.ts} +74 -8
  22. package/dist/{token-registry-snapshot-CqI6dXM_.d.cts → token-registry-snapshot-bR14QehS.d.cts} +74 -8
  23. package/dist/universal/index.cjs +982 -448
  24. package/dist/universal/index.cjs.map +1 -1
  25. package/dist/universal/index.d.cts +91 -5
  26. package/dist/universal/index.d.ts +91 -5
  27. package/dist/universal/index.js +44 -2
  28. package/package.json +1 -1
  29. package/dist/chunk-DCW7NQXH.js.map +0 -1
  30. package/dist/chunk-MOE5S6CE.js.map +0 -1
  31. package/dist/chunk-VH34YC3Q.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { aI as ClientId, bw as RedirectUri, aJ as CodeChallenge, bk as PKCEState, C as CodeVerifier, q as EvmWalletAddress, a as EthereumChain, bN as Tx, B as BlockchainAmount, bG as SwapPreview, a0 as AssetDecimals, aA as Newtype, D as TokenMetadata, aH as Chain, b as EvmContractAddress, bf as OfferToken } from './tokens-namespace-CIWBtgt2.js';
1
+ import { b5 as ClientId, bX as RedirectUri, b6 as CodeChallenge, bL as PKCEState, C as CodeVerifier, v as EvmWalletAddress, a as EthereumChain, cc as Tx, B as BlockchainAmount, c5 as SwapPreview, a9 as AssetDecimals, aQ as Newtype, J as TokenMetadata, b4 as Chain, b as EvmContractAddress, aL as OfferToken } from './time-CVZpAkGY.js';
2
2
  import { Hex, Abi, Hash, TransactionReceipt } from 'viem';
3
3
 
4
4
  type PKCEParams = {
@@ -70,6 +70,30 @@ interface EvmWallet extends EvmSigner {
70
70
  type ConnectWallet = EvmSigner & {
71
71
  readonly chain: EthereumChain;
72
72
  };
73
+ /**
74
+ * The host's connector for an external wallet, as two lambdas: one opens it,
75
+ * one tears the connection down. The SDK ships no wallet stack, so this is how
76
+ * a screen offers "Connect wallet" without knowing whether AppKit, Privy or the
77
+ * host's own modal is behind it.
78
+ *
79
+ * One product type rather than two optional lambdas, because they come as a
80
+ * pair: a screen that can connect a wallet must be able to let it go again,
81
+ * and a host that supports neither passes `null` for the whole adapter, which
82
+ * hides the connect affordance entirely.
83
+ */
84
+ type ExternalWalletAdapter = {
85
+ /**
86
+ * Opens the host's wallet connector. Resolves once the attempt finishes; the
87
+ * SDK reads the outcome from the external wallet it is handed on the next
88
+ * render rather than from a return value, so a host that connects through a
89
+ * redirect still works.
90
+ *
91
+ * Rejecting is how a declined or failed connection is reported.
92
+ */
93
+ connect: () => Promise<void>;
94
+ /** Disconnects the external wallet. Resolves when it is gone. */
95
+ disconnect: () => Promise<void>;
96
+ };
73
97
 
74
98
  /**
75
99
  * A read-only quote for a swap as domain amounts: how much goes in, the
@@ -107,6 +131,46 @@ declare const FormattedAmountAssetUi: (value: string) => FormattedAmountAssetUi;
107
131
  type AssetIconUrl = Newtype<string, 'AssetIconUrl'>;
108
132
  declare const AssetIconUrl: (value: string) => AssetIconUrl;
109
133
 
134
+ /**
135
+ * The wallets a screen reads for and acts from, supplied by the host.
136
+ *
137
+ * The SDK ships no wallet stack, so wallet discovery and connection are
138
+ * inverted onto the host: it hands over ready {@link EvmWallet}s, and an
139
+ * adapter for connecting an external one when it supports that. Every wallet
140
+ * here is one that can sign for itself, so a screen can broadcast from the
141
+ * wallet that holds a position.
142
+ */
143
+ type WalletSelection = {
144
+ /**
145
+ * The user's embedded (custodial) wallets, in display order. Empty when
146
+ * they have none, which is a normal state, not an error.
147
+ */
148
+ embedded: EvmWallet[];
149
+ /** The connected external wallet, or `null` while none is connected. */
150
+ external: EvmWallet | null;
151
+ /**
152
+ * The host's external-wallet connector, or `null` when it offers none - in
153
+ * which case the screen shows no connect affordance at all. A host may
154
+ * still pass a connected `external` without one, to show a wallet the user
155
+ * cannot change from here.
156
+ */
157
+ externalAdapter: ExternalWalletAdapter | null;
158
+ };
159
+ declare const WalletSelection: {
160
+ /**
161
+ * Every wallet in display order - embedded first, then the external one -
162
+ * each address once. Addresses compare case-insensitively, so a host that
163
+ * hands the same wallet over as both embedded and external sees it once.
164
+ */
165
+ all: (selection: WalletSelection) => EvmWallet[];
166
+ };
167
+ /**
168
+ * Names a wallet for display, e.g. `'CoinList Wallet'` for the user's
169
+ * embedded one. `null` means it has no name, and the screen shows its
170
+ * shortened address instead.
171
+ */
172
+ type WalletLabelResolver = (address: EvmWalletAddress) => string | null;
173
+
110
174
  /**
111
175
  * An array guaranteed to hold at least one element. Use it where an empty list
112
176
  * would be a bug (e.g. the set of assets a swap always offers).
@@ -162,13 +226,15 @@ declare const TokenRegistrySnapshot: {
162
226
  }) => TokenMetadata | null;
163
227
  };
164
228
  /**
165
- * The tokens an offer is *about*, most specific first: every `swap` entry,
166
- * then every `distribution` entry. `funding` entries name what a swap is paid
167
- * with (USDC, USDT) and never the asset on offer, so they are left out.
229
+ * The tokens an offer is *about*, most specific first: every `swap` or
230
+ * `vault` entry, then every `distribution` entry. `funding` entries name what
231
+ * an offer is paid with (USDC, USDT) and never the asset on offer, so they are
232
+ * left out.
168
233
  *
169
- * `swap` outranks `distribution` because a swap product names the asset it
170
- * hands over precisely, while a sale's distribution entry names the same
171
- * token for a sale product and is accepted as the fallback. The checkout's
234
+ * `swap` and `vault` rank together - no offer type carries both - and outrank
235
+ * `distribution` because a swap or vault product names the token it hands over
236
+ * precisely, while a sale's distribution entry names the same token for a sale
237
+ * product and is accepted as the fallback. The checkout's
172
238
  * per-chain lookup and the catalogue's any-chain lookup both read this
173
239
  * ordering, which is why it is stated once, here.
174
240
  */
@@ -176,4 +242,4 @@ declare function offerDisplayTokens(offer: {
176
242
  tokens: readonly OfferToken[];
177
243
  }): OfferToken[];
178
244
 
179
- 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 };
245
+ 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, WalletSelection as W, ShortenedWalletAddress as a, FormattedPercentUi as b, type WalletLabelResolver as c, TokenRegistrySnapshot as d, type EvmSigner as e, type ExternalWalletAdapter as f, type WriteContractParams as g, FormattedAmountUi as h, type PKCEParams as i, generatePKCEParams as j, offerDisplayTokens as o };
@@ -1,4 +1,4 @@
1
- import { aI as ClientId, bw as RedirectUri, aJ as CodeChallenge, bk as PKCEState, C as CodeVerifier, q as EvmWalletAddress, a as EthereumChain, bN as Tx, B as BlockchainAmount, bG as SwapPreview, a0 as AssetDecimals, aA as Newtype, D as TokenMetadata, aH as Chain, b as EvmContractAddress, bf as OfferToken } from './tokens-namespace-CIWBtgt2.cjs';
1
+ import { b5 as ClientId, bX as RedirectUri, b6 as CodeChallenge, bL as PKCEState, C as CodeVerifier, v as EvmWalletAddress, a as EthereumChain, cc as Tx, B as BlockchainAmount, c5 as SwapPreview, a9 as AssetDecimals, aQ as Newtype, J as TokenMetadata, b4 as Chain, b as EvmContractAddress, aL as OfferToken } from './time-CVZpAkGY.cjs';
2
2
  import { Hex, Abi, Hash, TransactionReceipt } from 'viem';
3
3
 
4
4
  type PKCEParams = {
@@ -70,6 +70,30 @@ interface EvmWallet extends EvmSigner {
70
70
  type ConnectWallet = EvmSigner & {
71
71
  readonly chain: EthereumChain;
72
72
  };
73
+ /**
74
+ * The host's connector for an external wallet, as two lambdas: one opens it,
75
+ * one tears the connection down. The SDK ships no wallet stack, so this is how
76
+ * a screen offers "Connect wallet" without knowing whether AppKit, Privy or the
77
+ * host's own modal is behind it.
78
+ *
79
+ * One product type rather than two optional lambdas, because they come as a
80
+ * pair: a screen that can connect a wallet must be able to let it go again,
81
+ * and a host that supports neither passes `null` for the whole adapter, which
82
+ * hides the connect affordance entirely.
83
+ */
84
+ type ExternalWalletAdapter = {
85
+ /**
86
+ * Opens the host's wallet connector. Resolves once the attempt finishes; the
87
+ * SDK reads the outcome from the external wallet it is handed on the next
88
+ * render rather than from a return value, so a host that connects through a
89
+ * redirect still works.
90
+ *
91
+ * Rejecting is how a declined or failed connection is reported.
92
+ */
93
+ connect: () => Promise<void>;
94
+ /** Disconnects the external wallet. Resolves when it is gone. */
95
+ disconnect: () => Promise<void>;
96
+ };
73
97
 
74
98
  /**
75
99
  * A read-only quote for a swap as domain amounts: how much goes in, the
@@ -107,6 +131,46 @@ declare const FormattedAmountAssetUi: (value: string) => FormattedAmountAssetUi;
107
131
  type AssetIconUrl = Newtype<string, 'AssetIconUrl'>;
108
132
  declare const AssetIconUrl: (value: string) => AssetIconUrl;
109
133
 
134
+ /**
135
+ * The wallets a screen reads for and acts from, supplied by the host.
136
+ *
137
+ * The SDK ships no wallet stack, so wallet discovery and connection are
138
+ * inverted onto the host: it hands over ready {@link EvmWallet}s, and an
139
+ * adapter for connecting an external one when it supports that. Every wallet
140
+ * here is one that can sign for itself, so a screen can broadcast from the
141
+ * wallet that holds a position.
142
+ */
143
+ type WalletSelection = {
144
+ /**
145
+ * The user's embedded (custodial) wallets, in display order. Empty when
146
+ * they have none, which is a normal state, not an error.
147
+ */
148
+ embedded: EvmWallet[];
149
+ /** The connected external wallet, or `null` while none is connected. */
150
+ external: EvmWallet | null;
151
+ /**
152
+ * The host's external-wallet connector, or `null` when it offers none - in
153
+ * which case the screen shows no connect affordance at all. A host may
154
+ * still pass a connected `external` without one, to show a wallet the user
155
+ * cannot change from here.
156
+ */
157
+ externalAdapter: ExternalWalletAdapter | null;
158
+ };
159
+ declare const WalletSelection: {
160
+ /**
161
+ * Every wallet in display order - embedded first, then the external one -
162
+ * each address once. Addresses compare case-insensitively, so a host that
163
+ * hands the same wallet over as both embedded and external sees it once.
164
+ */
165
+ all: (selection: WalletSelection) => EvmWallet[];
166
+ };
167
+ /**
168
+ * Names a wallet for display, e.g. `'CoinList Wallet'` for the user's
169
+ * embedded one. `null` means it has no name, and the screen shows its
170
+ * shortened address instead.
171
+ */
172
+ type WalletLabelResolver = (address: EvmWalletAddress) => string | null;
173
+
110
174
  /**
111
175
  * An array guaranteed to hold at least one element. Use it where an empty list
112
176
  * would be a bug (e.g. the set of assets a swap always offers).
@@ -162,13 +226,15 @@ declare const TokenRegistrySnapshot: {
162
226
  }) => TokenMetadata | null;
163
227
  };
164
228
  /**
165
- * The tokens an offer is *about*, most specific first: every `swap` entry,
166
- * then every `distribution` entry. `funding` entries name what a swap is paid
167
- * with (USDC, USDT) and never the asset on offer, so they are left out.
229
+ * The tokens an offer is *about*, most specific first: every `swap` or
230
+ * `vault` entry, then every `distribution` entry. `funding` entries name what
231
+ * an offer is paid with (USDC, USDT) and never the asset on offer, so they are
232
+ * left out.
168
233
  *
169
- * `swap` outranks `distribution` because a swap product names the asset it
170
- * hands over precisely, while a sale's distribution entry names the same
171
- * token for a sale product and is accepted as the fallback. The checkout's
234
+ * `swap` and `vault` rank together - no offer type carries both - and outrank
235
+ * `distribution` because a swap or vault product names the token it hands over
236
+ * precisely, while a sale's distribution entry names the same token for a sale
237
+ * product and is accepted as the fallback. The checkout's
172
238
  * per-chain lookup and the catalogue's any-chain lookup both read this
173
239
  * ordering, which is why it is stated once, here.
174
240
  */
@@ -176,4 +242,4 @@ declare function offerDisplayTokens(offer: {
176
242
  tokens: readonly OfferToken[];
177
243
  }): OfferToken[];
178
244
 
179
- 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 };
245
+ 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, WalletSelection as W, ShortenedWalletAddress as a, FormattedPercentUi as b, type WalletLabelResolver as c, TokenRegistrySnapshot as d, type EvmSigner as e, type ExternalWalletAdapter as f, type WriteContractParams as g, FormattedAmountUi as h, type PKCEParams as i, generatePKCEParams as j, offerDisplayTokens as o };