@funkit/connect 12.19.0 → 12.20.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/CHANGELOG.md +23 -0
- package/dist/clients/{chunk-FOXMRDKD.js → chunk-2BBOZQLZ.js} +1 -1
- package/dist/clients/{chunk-R25GIAD5.js → chunk-PZSKO3BJ.js} +1 -0
- package/dist/clients/{chunk-YSAAJSWT.js → chunk-R5VAX6YA.js} +8 -0
- package/dist/clients/{chunk-L6JL2XJY.js → chunk-TFIJZTGQ.js} +1 -1
- package/dist/clients/{chunk-KH2HLTHP.js → chunk-TLFE74BL.js} +4 -4
- package/dist/clients/{chunk-AELXD5XA.js → chunk-VFKEUHZT.js} +1 -1
- package/dist/clients/fanatics.js +2 -2
- package/dist/clients/internal/nado/withdrawalCallback.js +3 -3
- package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
- package/dist/clients/internal/nado/withdrawalForm.js +4 -4
- package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
- package/dist/clients/lighter.css +8 -1
- package/dist/clients/lighter.js +4 -4
- package/dist/clients/lighterRh.d.ts +44 -0
- package/dist/clients/lighterRh.js +51 -0
- package/dist/clients/mallard.js +2 -2
- package/dist/clients/nado.js +5 -5
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +3 -1
- package/dist/components/TokenSwapWidget/TokenSelectButton/TokenSelectButton.d.ts +1 -1
- package/dist/components/TokenSwapWidget/TokenSwapCard/TokenSwapCard.d.ts +14 -4
- package/dist/components/TokenSwapWidget/TokenSwapPercentOptions/TokenSwapPercentOptions.d.ts +9 -0
- package/dist/components/TokenSwapWidget/TokenSwapWidget.d.ts +4 -2
- package/dist/components/TokenSwapWidget/TokenSwapWidgetSkeleton/TokenSwapWidgetSkeleton.d.ts +3 -0
- package/dist/consts/customers.d.ts +5 -1
- package/dist/domains/convert/assets.d.ts +32 -0
- package/dist/domains/convert/inputAmount.d.ts +24 -21
- package/dist/domains/convert/reducer.d.ts +11 -6
- package/dist/domains/convert/screen.d.ts +6 -1
- package/dist/domains/convert/view.d.ts +4 -0
- package/dist/index.css +8 -1
- package/dist/index.js +1330 -1158
- package/dist/modals/CheckoutModal/Convert/ConvertAssetList.d.ts +1 -1
- package/dist/modals/CheckoutModal/Convert/ConvertAssetRow.d.ts +1 -19
- package/dist/modals/CheckoutModal/Convert/ConvertSelectDestinationStep.d.ts +1 -1
- package/dist/modals/CheckoutModal/Convert/ConvertSelectSourceStep.d.ts +0 -12
- package/dist/providers/ConvertProvider.d.ts +2 -0
- package/dist/shadow-css.js +1 -1
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +62 -62
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +4 -4
- package/dist/wallets/walletConnectors/{chunk-OVDCDVFX.js → chunk-34B7OJNT.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-JJBLW4IU.js → chunk-4FHNLTR3.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-TM7UBV3Q.js → chunk-ALGPGI6V.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-MWB6LFSG.js → chunk-BBB2J3US.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-IWPW26AL.js → chunk-BBDNB5TQ.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-53MYTA42.js → chunk-CU5J53XR.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-USLZMUJ3.js → chunk-HOCKAU5H.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-RJF2YEZ5.js → chunk-IA5432IR.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-ASTCNVJC.js → chunk-IWOMSW64.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-KE4CWI3A.js → chunk-NXWG6FG2.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-RQYEGJKL.js → chunk-RFCZYLNR.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-ANODOMIN.js → chunk-RXRYHMRI.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-PPQ6L4K2.js → chunk-SR5CZR3L.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-TIHTQ3OB.js → chunk-TRZDAXCQ.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-F45CUFRR.js → chunk-U52QO5HF.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-A5POD5SV.js → chunk-XODA5ESL.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-FYPQ3HP4.js → chunk-YRMBR6NA.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-65ULY6OC.js → chunk-ZSSSLFQF.js} +3 -3
|
@@ -12,42 +12,45 @@ export declare function parseConvertInputToBaseUnits({ inputValue, unit, tokenAm
|
|
|
12
12
|
decimals: number;
|
|
13
13
|
}): bigint | undefined;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* shows more than the user has. Display only: the exact amount is
|
|
17
|
-
* Empty in USD mode without a price, rather than a token amount under a `$`.
|
|
15
|
+
* A preset amount as plain field text in the current unit, rounded down so the
|
|
16
|
+
* field never shows more than the user has. Display only: the exact amount is
|
|
17
|
+
* kept apart. Empty in USD mode without a price, rather than a token amount under a `$`.
|
|
18
18
|
*/
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function formatConvertPresetInput({ baseUnits, decimals, unit, unitPriceUsd, }: {
|
|
20
20
|
baseUnits: bigint;
|
|
21
21
|
decimals: number;
|
|
22
22
|
unit: AmountUnit;
|
|
23
23
|
unitPriceUsd: number | undefined;
|
|
24
24
|
}): string;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
25
|
+
/**
|
|
26
|
+
* A percentage preset's exact amount, or `undefined` when there's nothing to fill.
|
|
27
|
+
* - Max keeps the gas reserve, so it always fits. Like checkout, it falls back to
|
|
28
|
+
* the full balance while the reserve loads, and is 0 when gas takes it all.
|
|
29
|
+
* - The rest take a share of the full balance, so on a native token they can
|
|
30
|
+
* exceed Max, which raises the usual insufficient-balance issue.
|
|
31
|
+
* - A share that rounds to 0 (dust) fills nothing rather than a silent "0".
|
|
32
|
+
*/
|
|
33
|
+
export declare function getConvertPercentBaseUnits({ percent, balanceBaseUnits, maxBaseUnits, }: {
|
|
34
|
+
percent: number;
|
|
35
|
+
balanceBaseUnits: bigint;
|
|
36
|
+
maxBaseUnits: bigint | null;
|
|
37
|
+
}): bigint | undefined;
|
|
34
38
|
export interface ConvertAmount extends AmountInUnits {
|
|
35
|
-
/** The field text;
|
|
39
|
+
/** The field text; the preset's rounded-down display while a preset is on. */
|
|
36
40
|
inputValue: string;
|
|
37
41
|
unit: AmountUnit;
|
|
38
|
-
/** What to quote:
|
|
42
|
+
/** What to quote: the preset's exact amount, or the typed one. */
|
|
39
43
|
baseUnits: bigint | undefined;
|
|
40
|
-
isMax: boolean;
|
|
41
44
|
}
|
|
42
45
|
/**
|
|
43
|
-
* The amount a draft describes at `unitPriceUsd`. While
|
|
44
|
-
* and converted amounts derive from it, so a price change or unit flip
|
|
45
|
-
* leaves them stale.
|
|
46
|
+
* The amount a draft describes at `unitPriceUsd`. While a preset is on, the
|
|
47
|
+
* field and converted amounts derive from it, so a price change or unit flip
|
|
48
|
+
* never leaves them stale.
|
|
46
49
|
*/
|
|
47
|
-
export declare function getConvertAmount({ inputValue, unit,
|
|
50
|
+
export declare function getConvertAmount({ inputValue, unit, presetBaseUnits, decimals, unitPriceUsd, }: {
|
|
48
51
|
inputValue: string;
|
|
49
52
|
unit: AmountUnit;
|
|
50
|
-
|
|
53
|
+
presetBaseUnits: bigint | undefined;
|
|
51
54
|
decimals: number;
|
|
52
55
|
unitPriceUsd: number | undefined;
|
|
53
56
|
}): ConvertAmount;
|
|
@@ -9,11 +9,11 @@ import type { ConvertResolvedAsset } from './types';
|
|
|
9
9
|
export interface ConvertDraft {
|
|
10
10
|
sourceKey: string | undefined;
|
|
11
11
|
destinationKey: string | undefined;
|
|
12
|
-
/** The field text as typed; stale while
|
|
12
|
+
/** The field text as typed; stale while a preset is on, which derives its own. */
|
|
13
13
|
inputValue: string;
|
|
14
14
|
unit: AmountUnit;
|
|
15
|
-
/**
|
|
16
|
-
|
|
15
|
+
/** A percentage preset's exact amount (Max included); typing clears it. */
|
|
16
|
+
presetBaseUnits: bigint | undefined;
|
|
17
17
|
}
|
|
18
18
|
/** What the user converted, frozen when they did; a locked screen reads only this. */
|
|
19
19
|
export interface ConvertSnapshot {
|
|
@@ -51,8 +51,8 @@ export type ConvertEvent = {
|
|
|
51
51
|
type: 'AMOUNT_EDITED';
|
|
52
52
|
inputValue: string;
|
|
53
53
|
} | {
|
|
54
|
-
type: '
|
|
55
|
-
|
|
54
|
+
type: 'PRESET_SET';
|
|
55
|
+
presetBaseUnits: bigint;
|
|
56
56
|
}
|
|
57
57
|
/** Converts the field at the live price; ignored without one. */
|
|
58
58
|
| {
|
|
@@ -61,6 +61,11 @@ export type ConvertEvent = {
|
|
|
61
61
|
} | {
|
|
62
62
|
type: 'SOURCE_PICKED';
|
|
63
63
|
sourceKey: string;
|
|
64
|
+
}
|
|
65
|
+
/** Balances loaded with no source picked: opens on the most valuable token. */
|
|
66
|
+
| {
|
|
67
|
+
type: 'SOURCE_PRESELECTED';
|
|
68
|
+
sourceKey: string;
|
|
64
69
|
} | {
|
|
65
70
|
type: 'DESTINATION_PICKED';
|
|
66
71
|
destinationKey: string;
|
|
@@ -104,7 +109,7 @@ export declare const INITIAL_CONVERT_STATE: ConvertState;
|
|
|
104
109
|
/**
|
|
105
110
|
* Convert's draft and submission. Pure: the provider runs the wallet steps
|
|
106
111
|
* and polling, and dispatches what they report.
|
|
107
|
-
* - An edit,
|
|
112
|
+
* - An edit, preset, pick or retry ends a `failed` submission; a locked one ignores them.
|
|
108
113
|
* - `CONVERT_STARTED` freezes the snapshot; nothing live reaches it after.
|
|
109
114
|
* - `untrackable` is final; `completed` ends with `SUCCESS_SHOWN`, which keeps
|
|
110
115
|
* the tokens and drops the amount, since it was converted.
|
|
@@ -125,6 +125,10 @@ export type ConvertActionButton =
|
|
|
125
125
|
| {
|
|
126
126
|
action: 'converted';
|
|
127
127
|
}
|
|
128
|
+
/** The first balance read is out, so there's no source yet. */
|
|
129
|
+
| {
|
|
130
|
+
action: 'loadingBalance';
|
|
131
|
+
}
|
|
128
132
|
/** A native EVM source's gas price is loading, so Max and the reserve are unknown. */
|
|
129
133
|
| {
|
|
130
134
|
action: 'estimatingGas';
|
|
@@ -150,10 +154,11 @@ export type ConvertActionButton =
|
|
|
150
154
|
* arrives, and waits out a refresh like checkout's confirmation screen. A
|
|
151
155
|
* submission in flight overrides all of it.
|
|
152
156
|
*/
|
|
153
|
-
export declare function getConvertActionButton({ submission, issue, quote, isQuoteFetching, isLookupFetching, isFeeReserveLoading, }: {
|
|
157
|
+
export declare function getConvertActionButton({ submission, issue, quote, isAwaitingBalances, isQuoteFetching, isLookupFetching, isFeeReserveLoading, }: {
|
|
154
158
|
submission: ConvertSubmission | undefined;
|
|
155
159
|
issue: ConvertScreenIssue | undefined;
|
|
156
160
|
quote: ConvertQuote | undefined;
|
|
161
|
+
isAwaitingBalances?: boolean;
|
|
157
162
|
isQuoteFetching: boolean;
|
|
158
163
|
/** A source wallet, recipient or balance read is running. */
|
|
159
164
|
isLookupFetching: boolean;
|
|
@@ -56,12 +56,16 @@ export interface ConvertView {
|
|
|
56
56
|
balances: ConvertBalances | undefined;
|
|
57
57
|
sourceAsset: ConvertResolvedAsset | undefined;
|
|
58
58
|
destinationAsset: ConvertResolvedAsset | undefined;
|
|
59
|
+
/** The first balance read is out, so there's no source to show yet. */
|
|
60
|
+
isAwaitingBalances: boolean;
|
|
59
61
|
/** Token units; `undefined` while unknown, so it never reads as 0. */
|
|
60
62
|
sourceTokenBalance: number | undefined;
|
|
61
63
|
destinationTokenBalance: number | undefined;
|
|
62
64
|
amount: ConvertAmount;
|
|
63
65
|
/** The source's Max; `null` while unknown or locked. */
|
|
64
66
|
maxBaseUnits: bigint | null;
|
|
67
|
+
/** Shows the percentage presets: the source has a balance to take a share of. */
|
|
68
|
+
canSelectPercent: boolean;
|
|
65
69
|
/** Shows the unit switch; off without a price to convert with. Locked, the widget disables it. */
|
|
66
70
|
canToggleUnit: boolean;
|
|
67
71
|
quote: ConvertQuote | undefined;
|
package/dist/index.css
CHANGED
|
@@ -14701,7 +14701,7 @@
|
|
|
14701
14701
|
}
|
|
14702
14702
|
}
|
|
14703
14703
|
|
|
14704
|
-
/* vanilla-extract-css-ns:src/components/Dialog/DialogContent.css.ts.vanilla.css?source=#
|
|
14704
|
+
/* vanilla-extract-css-ns:src/components/Dialog/DialogContent.css.ts.vanilla.css?source=#H4sIAA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QSqRCUV25u_eXBwMpSfS8n0DcA9nsu2ntXwxGsU_eQXYoP92uS9flmgv7a45cQH0kiIqA4uRppB_fXg7FtVWe9x9SzeP0nwlC3sZOm85pToumajSBbn3objOFDhYHupuB7j3obMHJDNQrePde8Nu_p8xgx9ERAAA */
|
|
14705
14705
|
[data-rk] ._1pzt4231 {
|
|
14706
14706
|
max-height: 525px;
|
|
14707
14707
|
max-width: 100vw;
|
|
@@ -14726,6 +14726,9 @@
|
|
|
14726
14726
|
[data-rk] ._1pzt4231:has(#confirmation-page) {
|
|
14727
14727
|
max-height: 825px;
|
|
14728
14728
|
}
|
|
14729
|
+
[data-rk] ._1pzt4231:has(#convert-page) {
|
|
14730
|
+
max-height: 825px;
|
|
14731
|
+
}
|
|
14729
14732
|
[data-rk] ._1pzt4231:has(#complete-page) {
|
|
14730
14733
|
max-height: 825px;
|
|
14731
14734
|
}
|
|
@@ -14786,6 +14789,10 @@
|
|
|
14786
14789
|
max-height: 80vh;
|
|
14787
14790
|
max-height: 95svh;
|
|
14788
14791
|
}
|
|
14792
|
+
[data-rk] ._1pzt4238:has(#convert-page) {
|
|
14793
|
+
max-height: 80vh;
|
|
14794
|
+
max-height: 95svh;
|
|
14795
|
+
}
|
|
14789
14796
|
[data-rk] ._1pzt423a {
|
|
14790
14797
|
min-width: initial;
|
|
14791
14798
|
width: 100vw;
|