@coinlist-co/react 0.10.0 → 0.11.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.
- package/README.md +32 -0
- package/dist/{chunk-GSSAB4K5.js → chunk-B2HCVPCQ.js} +225 -247
- package/dist/chunk-B2HCVPCQ.js.map +1 -0
- package/dist/chunk-KDGNDAHA.js +146 -0
- package/dist/chunk-KDGNDAHA.js.map +1 -0
- package/dist/chunk-UIIXXLA7.js +1863 -0
- package/dist/chunk-UIIXXLA7.js.map +1 -0
- package/dist/client/index.cjs +10559 -3442
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +4219 -862
- package/dist/client/index.d.ts +4219 -862
- package/dist/client/index.js +8729 -2370
- package/dist/client/index.js.map +1 -1
- package/dist/collections-BhDkYmzV.d.cts +65 -0
- package/dist/collections-CZhHoQHr.d.ts +65 -0
- package/dist/config-B5mwS_2l.d.cts +1926 -0
- package/dist/config-B5mwS_2l.d.ts +1926 -0
- package/dist/server/index.cjs +981 -464
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +190 -163
- package/dist/server/index.d.ts +190 -163
- package/dist/server/index.js +151 -156
- package/dist/server/index.js.map +1 -1
- package/dist/shared/index.cjs +1810 -907
- package/dist/shared/index.cjs.map +1 -1
- package/dist/shared/index.d.cts +243 -132
- package/dist/shared/index.d.ts +243 -132
- package/dist/shared/index.js +102 -114
- package/dist/shared/index.js.map +1 -1
- package/package.json +10 -7
- package/dist/chunk-7BJ2HAG7.js +0 -442
- package/dist/chunk-7BJ2HAG7.js.map +0 -1
- package/dist/chunk-AAER5LOL.js +0 -22
- package/dist/chunk-AAER5LOL.js.map +0 -1
- package/dist/chunk-GSSAB4K5.js.map +0 -1
- package/dist/chunk-TUZKKFNW.js +0 -836
- package/dist/chunk-TUZKKFNW.js.map +0 -1
- package/dist/collections-CJ24dOda.d.cts +0 -28
- package/dist/collections-ZYLKp8JB.d.ts +0 -28
- package/dist/requirement-CDi5NJI8.d.cts +0 -1036
- package/dist/requirement-CDi5NJI8.d.ts +0 -1036
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ai as ClientId, a_ as RedirectUri, aj as CodeChallenge, aP as PKCEState, C as CodeVerifier, B as BlockchainAmount, b7 as SwapPreview, M as AssetDecimals, ab as Newtype } from './config-B5mwS_2l.cjs';
|
|
2
|
+
|
|
3
|
+
type PKCEParams = {
|
|
4
|
+
clientId: ClientId;
|
|
5
|
+
responseType: 'code';
|
|
6
|
+
redirectUri: RedirectUri;
|
|
7
|
+
codeChallenge: CodeChallenge;
|
|
8
|
+
codeChallengeMethod: 'S256';
|
|
9
|
+
state: PKCEState;
|
|
10
|
+
codeVerifier: CodeVerifier;
|
|
11
|
+
};
|
|
12
|
+
type PKCEConfig = {
|
|
13
|
+
clientId: ClientId;
|
|
14
|
+
redirectUri: RedirectUri;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Generates PKCE parameters for an OAuth2 authorization code flow.
|
|
18
|
+
* Pure crypto — no React, no DOM beyond Web Crypto API. Safe to use
|
|
19
|
+
* in server-side code and Next.js middleware.
|
|
20
|
+
*/
|
|
21
|
+
declare function generatePKCEParams(config: PKCEConfig): Promise<PKCEParams>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A read-only quote for a swap as domain amounts: how much goes in, the
|
|
25
|
+
* protocol fee, and how much would come out. Derived from the raw
|
|
26
|
+
* {@link SwapPreview} the swap contract returns.
|
|
27
|
+
*/
|
|
28
|
+
type SwapQuote = {
|
|
29
|
+
inputTokenAmount: BlockchainAmount;
|
|
30
|
+
fee: BlockchainAmount;
|
|
31
|
+
outputTokenAmount: BlockchainAmount;
|
|
32
|
+
};
|
|
33
|
+
declare const SwapQuote: {
|
|
34
|
+
/**
|
|
35
|
+
* Assembles a {@link SwapQuote} from a raw contract {@link SwapPreview}. The
|
|
36
|
+
* input and fee are denominated in the input token; the output in the output
|
|
37
|
+
* token.
|
|
38
|
+
*/
|
|
39
|
+
fromPreview: (preview: SwapPreview, inputDecimals: AssetDecimals, outputDecimals: AssetDecimals) => SwapQuote;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
type FormattedAmountUi = Newtype<string, 'FormattedAmountUi'>;
|
|
43
|
+
declare const FormattedAmountUi: (value: string) => FormattedAmountUi;
|
|
44
|
+
type FormattedPercentUi = Newtype<string, 'FormattedPercentUi'>;
|
|
45
|
+
declare const FormattedPercentUi: (value: string) => FormattedPercentUi;
|
|
46
|
+
type TxExplorerUrl = Newtype<string, 'TxExplorerUrl'>;
|
|
47
|
+
declare const TxExplorerUrl: (value: string) => TxExplorerUrl;
|
|
48
|
+
/**
|
|
49
|
+
* A wallet address shortened for display (e.g. `0x1234…5678`). Keeps a
|
|
50
|
+
* `0x${string}` base but drops the runtime `0x` narrowing.
|
|
51
|
+
*/
|
|
52
|
+
type ShortenedWalletAddress = Newtype<`0x${string}`, 'ShortenedWalletAddress'>;
|
|
53
|
+
declare const ShortenedWalletAddress: (value: string) => ShortenedWalletAddress;
|
|
54
|
+
type FormattedAmountAssetUi = Newtype<string, 'FormattedAmountAssetUi'>;
|
|
55
|
+
declare const FormattedAmountAssetUi: (value: string) => FormattedAmountAssetUi;
|
|
56
|
+
type AssetIconUrl = Newtype<string, 'AssetIconUrl'>;
|
|
57
|
+
declare const AssetIconUrl: (value: string) => AssetIconUrl;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* An array guaranteed to hold at least one element. Use it where an empty list
|
|
61
|
+
* would be a bug (e.g. the set of assets a swap always offers).
|
|
62
|
+
*/
|
|
63
|
+
type NonEmptyArray<T> = [T, ...T[]];
|
|
64
|
+
|
|
65
|
+
export { AssetIconUrl as A, FormattedAmountAssetUi as F, type NonEmptyArray as N, type PKCEConfig as P, SwapQuote as S, TxExplorerUrl as T, ShortenedWalletAddress as a, FormattedPercentUi as b, FormattedAmountUi as c, type PKCEParams as d, generatePKCEParams as g };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ai as ClientId, a_ as RedirectUri, aj as CodeChallenge, aP as PKCEState, C as CodeVerifier, B as BlockchainAmount, b7 as SwapPreview, M as AssetDecimals, ab as Newtype } from './config-B5mwS_2l.js';
|
|
2
|
+
|
|
3
|
+
type PKCEParams = {
|
|
4
|
+
clientId: ClientId;
|
|
5
|
+
responseType: 'code';
|
|
6
|
+
redirectUri: RedirectUri;
|
|
7
|
+
codeChallenge: CodeChallenge;
|
|
8
|
+
codeChallengeMethod: 'S256';
|
|
9
|
+
state: PKCEState;
|
|
10
|
+
codeVerifier: CodeVerifier;
|
|
11
|
+
};
|
|
12
|
+
type PKCEConfig = {
|
|
13
|
+
clientId: ClientId;
|
|
14
|
+
redirectUri: RedirectUri;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Generates PKCE parameters for an OAuth2 authorization code flow.
|
|
18
|
+
* Pure crypto — no React, no DOM beyond Web Crypto API. Safe to use
|
|
19
|
+
* in server-side code and Next.js middleware.
|
|
20
|
+
*/
|
|
21
|
+
declare function generatePKCEParams(config: PKCEConfig): Promise<PKCEParams>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A read-only quote for a swap as domain amounts: how much goes in, the
|
|
25
|
+
* protocol fee, and how much would come out. Derived from the raw
|
|
26
|
+
* {@link SwapPreview} the swap contract returns.
|
|
27
|
+
*/
|
|
28
|
+
type SwapQuote = {
|
|
29
|
+
inputTokenAmount: BlockchainAmount;
|
|
30
|
+
fee: BlockchainAmount;
|
|
31
|
+
outputTokenAmount: BlockchainAmount;
|
|
32
|
+
};
|
|
33
|
+
declare const SwapQuote: {
|
|
34
|
+
/**
|
|
35
|
+
* Assembles a {@link SwapQuote} from a raw contract {@link SwapPreview}. The
|
|
36
|
+
* input and fee are denominated in the input token; the output in the output
|
|
37
|
+
* token.
|
|
38
|
+
*/
|
|
39
|
+
fromPreview: (preview: SwapPreview, inputDecimals: AssetDecimals, outputDecimals: AssetDecimals) => SwapQuote;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
type FormattedAmountUi = Newtype<string, 'FormattedAmountUi'>;
|
|
43
|
+
declare const FormattedAmountUi: (value: string) => FormattedAmountUi;
|
|
44
|
+
type FormattedPercentUi = Newtype<string, 'FormattedPercentUi'>;
|
|
45
|
+
declare const FormattedPercentUi: (value: string) => FormattedPercentUi;
|
|
46
|
+
type TxExplorerUrl = Newtype<string, 'TxExplorerUrl'>;
|
|
47
|
+
declare const TxExplorerUrl: (value: string) => TxExplorerUrl;
|
|
48
|
+
/**
|
|
49
|
+
* A wallet address shortened for display (e.g. `0x1234…5678`). Keeps a
|
|
50
|
+
* `0x${string}` base but drops the runtime `0x` narrowing.
|
|
51
|
+
*/
|
|
52
|
+
type ShortenedWalletAddress = Newtype<`0x${string}`, 'ShortenedWalletAddress'>;
|
|
53
|
+
declare const ShortenedWalletAddress: (value: string) => ShortenedWalletAddress;
|
|
54
|
+
type FormattedAmountAssetUi = Newtype<string, 'FormattedAmountAssetUi'>;
|
|
55
|
+
declare const FormattedAmountAssetUi: (value: string) => FormattedAmountAssetUi;
|
|
56
|
+
type AssetIconUrl = Newtype<string, 'AssetIconUrl'>;
|
|
57
|
+
declare const AssetIconUrl: (value: string) => AssetIconUrl;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* An array guaranteed to hold at least one element. Use it where an empty list
|
|
61
|
+
* would be a bug (e.g. the set of assets a swap always offers).
|
|
62
|
+
*/
|
|
63
|
+
type NonEmptyArray<T> = [T, ...T[]];
|
|
64
|
+
|
|
65
|
+
export { AssetIconUrl as A, FormattedAmountAssetUi as F, type NonEmptyArray as N, type PKCEConfig as P, SwapQuote as S, TxExplorerUrl as T, ShortenedWalletAddress as a, FormattedPercentUi as b, FormattedAmountUi as c, type PKCEParams as d, generatePKCEParams as g };
|