@coinlist-co/react 0.12.2-rc.abd9d38 → 0.12.2-rc.bc20f5b
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.
- package/README.md +10 -0
- package/dist/{chunk-45LAPB7U.js → chunk-3WW5FLT7.js} +2 -2
- package/dist/{chunk-HDJEDOS4.js → chunk-C6GF7MDF.js} +759 -412
- package/dist/chunk-C6GF7MDF.js.map +1 -0
- package/dist/{chunk-M7WDZZPX.js → chunk-IZJ4JSSC.js} +69 -4
- package/dist/chunk-IZJ4JSSC.js.map +1 -0
- package/dist/client/index.cjs +11305 -7943
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +1545 -10
- package/dist/client/index.d.ts +1545 -10
- package/dist/client/index.js +7725 -4781
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.cjs +347 -62
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +6 -2
- package/dist/server/index.d.ts +6 -2
- package/dist/server/index.js +4 -2
- package/dist/server/index.js.map +1 -1
- package/dist/{tokens-namespace-DrwRi0AQ.d.cts → time-CVZpAkGY.d.cts} +815 -192
- package/dist/{tokens-namespace-DrwRi0AQ.d.ts → time-CVZpAkGY.d.ts} +815 -192
- package/dist/{token-registry-snapshot-C-Qs3Lgs.d.ts → token-registry-snapshot-BkwA8KmD.d.ts} +74 -8
- package/dist/{token-registry-snapshot-CpzLmsc2.d.cts → token-registry-snapshot-bR14QehS.d.cts} +74 -8
- package/dist/universal/index.cjs +812 -385
- package/dist/universal/index.cjs.map +1 -1
- package/dist/universal/index.d.cts +54 -6
- package/dist/universal/index.d.ts +54 -6
- package/dist/universal/index.js +30 -2
- package/package.json +1 -1
- package/dist/chunk-HDJEDOS4.js.map +0 -1
- package/dist/chunk-M7WDZZPX.js.map +0 -1
- package/dist/time-BOCS1TbH.d.cts +0 -50
- package/dist/time-C7mhO5_a.d.ts +0 -50
- /package/dist/{chunk-45LAPB7U.js.map → chunk-3WW5FLT7.js.map} +0 -0
package/dist/{token-registry-snapshot-C-Qs3Lgs.d.ts → token-registry-snapshot-BkwA8KmD.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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`
|
|
166
|
-
* then every `distribution` entry. `funding` entries name what
|
|
167
|
-
* with (USDC, USDT) and never the asset on offer, so they are
|
|
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`
|
|
170
|
-
*
|
|
171
|
-
*
|
|
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,
|
|
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 };
|
package/dist/{token-registry-snapshot-CpzLmsc2.d.cts → token-registry-snapshot-bR14QehS.d.cts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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`
|
|
166
|
-
* then every `distribution` entry. `funding` entries name what
|
|
167
|
-
* with (USDC, USDT) and never the asset on offer, so they are
|
|
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`
|
|
170
|
-
*
|
|
171
|
-
*
|
|
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,
|
|
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 };
|