@funkit/connect 11.3.0 → 11.4.1
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 +69 -0
- package/dist/clients/{chunk-DGBIV3ZS.js → chunk-B7UU2ETA.js} +0 -13
- package/dist/clients/{chunk-L2XMI4EX.js → chunk-BB5FHA47.js} +13 -12
- package/dist/clients/chunk-MSLPLXR2.js +30 -0
- package/dist/clients/{chunk-QQEGNLGD.js → chunk-TYG42JRZ.js} +4 -4
- package/dist/clients/{chunk-46L2KJJ4.js → chunk-UMU5S2WF.js} +34 -43
- package/dist/clients/internal/nado/withdrawalCallback.js +4 -11
- package/dist/clients/internal/nado/withdrawalConfig.d.ts +3 -1
- package/dist/clients/internal/nado/withdrawalConfig.js +2 -3
- package/dist/clients/internal/nado/withdrawalErrors.d.ts +6 -10
- package/dist/clients/internal/nado/withdrawalErrors.js +1 -2
- package/dist/clients/internal/nado/withdrawalForm.css +44 -36
- package/dist/clients/internal/nado/withdrawalForm.d.ts +1 -1
- package/dist/clients/internal/nado/withdrawalForm.js +20 -73
- package/dist/clients/internal/nado/withdrawalStatus.js +4 -8
- package/dist/clients/lighter.css +44 -36
- package/dist/clients/lighter.d.ts +0 -31
- package/dist/clients/lighter.js +10 -102
- package/dist/clients/nado.d.ts +3 -1
- package/dist/clients/nado.js +8 -15
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +47 -39
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +4 -4
- package/dist/clients/polymarket/index.css +47 -39
- package/dist/clients/polymarket/index.js +9 -9
- package/dist/components/Dropdown/BaseDropdown.css.d.ts +1 -0
- package/dist/components/Dropdown/BaseDropdown.d.ts +0 -1
- package/dist/domains/checkout.d.ts +6 -1
- package/dist/hooks/track/analytics/events.d.ts +19 -9
- package/dist/hooks/track/analytics/resolveExecutionProgressContext.d.ts +1 -0
- package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +11 -3
- package/dist/hooks/track/analytics/useTrackExecutionProgressEvents.d.ts +3 -33
- package/dist/hooks/track/useTrackV2.d.ts +2 -0
- package/dist/hooks/useAssetPrice.d.ts +1 -6
- package/dist/hooks/useBluvo.d.ts +7 -2
- package/dist/index.css +44 -36
- package/dist/index.js +922 -1205
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +5 -11
- package/dist/providers/FunkitCheckoutContext/types.d.ts +1 -1
- package/dist/providers/FunkitStatsigProvider.d.ts +1 -1
- package/dist/utils/withdrawal.d.ts +1 -21
- package/dist/wallets/walletConnectors/index.js +32 -32
- package/package.json +6 -6
- package/dist/clients/chunk-2576N7PQ.js +0 -44
- package/dist/clients/chunk-3P2C436B.js +0 -20
- package/dist/clients/chunk-63XTVHO3.js +0 -19
- package/dist/clients/chunk-6T6URLBM.js +0 -33
- package/dist/clients/chunk-FM7SFGAV.js +0 -106
- package/dist/clients/chunk-JFDRLSYM.js +0 -42
- package/dist/clients/chunk-TZGKB6WY.js +0 -160
- package/dist/clients/chunk-VIAEAD75.js +0 -61
- package/dist/clients/chunk-WZRW6WUM.js +0 -112
- package/dist/clients/chunk-Z7HTQFEO.js +0 -69
- package/dist/clients/internal/nado/consts.d.ts +0 -22
- package/dist/clients/internal/nado/consts.js +0 -15
- package/dist/clients/internal/nado/encoding.d.ts +0 -25
- package/dist/clients/internal/nado/encoding.js +0 -11
- package/dist/clients/internal/nado/errors.d.ts +0 -68
- package/dist/clients/internal/nado/errors.js +0 -19
- package/dist/clients/internal/nado/fetch.d.ts +0 -15
- package/dist/clients/internal/nado/fetch.js +0 -9
- package/dist/clients/internal/nado/gateway.d.ts +0 -61
- package/dist/clients/internal/nado/gateway.js +0 -17
- package/dist/clients/internal/nado/hooks.d.ts +0 -208
- package/dist/clients/internal/nado/hooks.js +0 -21
- package/dist/clients/internal/nado/indexer.d.ts +0 -43
- package/dist/clients/internal/nado/indexer.js +0 -13
- package/dist/clients/internal/nado/typedData.d.ts +0 -80
- package/dist/clients/internal/nado/typedData.js +0 -10
- package/dist/clients/internal/nado/withdrawalTypes.d.ts +0 -49
- package/dist/clients/internal/nado/withdrawalTypes.js +0 -1
- package/dist/utils/safeBigInt.d.ts +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,74 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 11.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1116a3c: Track brokerage account connection lifecycle events in analytics.
|
|
8
|
+
- 530d664: Dedupe `react-remove-scroll` to a single copy, and allow pinch-zoom over an open modal.
|
|
9
|
+
- 6c051e7: No consumer facing changes.
|
|
10
|
+
- 84683ff: No consumer facing changes.
|
|
11
|
+
- df95715: No consumer facing changes.
|
|
12
|
+
- d46284d: No consumer facing changes.
|
|
13
|
+
- 2522e00: No consumer facing changes.
|
|
14
|
+
- 1e6df43: Lighter Fast's unstaked withdrawal fee is now always accurate to the account's current stake, and the quote waits for it before pricing.
|
|
15
|
+
- b28ba34: Brace every `if`/`else`/loop body — formatting only, no behaviour change.
|
|
16
|
+
- dae8c51: Append EIP-681 `@<chainId>` suffix to EVM deposit QR code URIs so MetaMask mobile's scanner can resolve the network
|
|
17
|
+
- 1116a3c: Add sanitized error context to failed account connection analytics events.
|
|
18
|
+
- 5b8f4ff: Prevent dropdown animation styles from colliding with host-page styles, and ensure the withdrawal source-token dropdown uses the configured modal stacking order.
|
|
19
|
+
- 2ad0cd5: fix: keep dropdowns open when selecting their own items in shadow DOM
|
|
20
|
+
- b0cb492: fix: animate the correct notification banner icon when more than one is on screen
|
|
21
|
+
- Updated dependencies [4b25619]
|
|
22
|
+
- Updated dependencies [84683ff]
|
|
23
|
+
- Updated dependencies [df95715]
|
|
24
|
+
- Updated dependencies [d46284d]
|
|
25
|
+
- Updated dependencies [1e6df43]
|
|
26
|
+
- Updated dependencies [1e6df43]
|
|
27
|
+
- Updated dependencies [1e6df43]
|
|
28
|
+
- Updated dependencies [b28ba34]
|
|
29
|
+
- Updated dependencies [dae8c51]
|
|
30
|
+
- Updated dependencies [e75b048]
|
|
31
|
+
- Updated dependencies [2522e00]
|
|
32
|
+
- Updated dependencies [2ad0cd5]
|
|
33
|
+
- @funkit/utils@4.0.1
|
|
34
|
+
- @funkit/api-base@7.1.1
|
|
35
|
+
- @funkit/connect-core@4.0.0
|
|
36
|
+
- @funkit/fun-relay@2.13.0
|
|
37
|
+
|
|
38
|
+
## 11.4.0
|
|
39
|
+
|
|
40
|
+
### Minor Changes
|
|
41
|
+
|
|
42
|
+
- bbb0301: Lighter Native Bridge withdrawals record the same attribution row on every platform.
|
|
43
|
+
|
|
44
|
+
Move `trackLighterSecureWithdrawal` export from `connect` to `connect-core`
|
|
45
|
+
|
|
46
|
+
- 3e31f1c: Allow Nado withdrawals to start with the borrow toggle preselected.
|
|
47
|
+
- 3d95b7f: Risk assessment now screens on the transaction's chain: `getRiskAssessmentForAddress` accepts an optional `chainId`, and checkout and withdrawal screens send it.
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- 480d658: Consolidate common event properties.
|
|
52
|
+
- 76dafe1: Withdrawal flat-fee deduction now comes from `@funkit/connect-core`, so web and React Native price the same amount.
|
|
53
|
+
- 993ac35: React Native token pricing now falls back to Relay when the funkit price API can't price a token, so configured USD withdrawal limits stay enforced.
|
|
54
|
+
- db08b0d: fix(connect): reject non-decimal withdrawal source balance values
|
|
55
|
+
- e1354ad: Update fiat default pill amounts
|
|
56
|
+
- Updated dependencies [fade45e]
|
|
57
|
+
- Updated dependencies [759b3f4]
|
|
58
|
+
- Updated dependencies [c667b94]
|
|
59
|
+
- Updated dependencies [c667b94]
|
|
60
|
+
- Updated dependencies [53d7f38]
|
|
61
|
+
- Updated dependencies [76dafe1]
|
|
62
|
+
- Updated dependencies [bbb0301]
|
|
63
|
+
- Updated dependencies [07a4ae6]
|
|
64
|
+
- Updated dependencies [3d95b7f]
|
|
65
|
+
- Updated dependencies [993ac35]
|
|
66
|
+
- Updated dependencies [db08b0d]
|
|
67
|
+
- Updated dependencies [e1354ad]
|
|
68
|
+
- @funkit/api-base@7.1.0
|
|
69
|
+
- @funkit/connect-core@3.1.0
|
|
70
|
+
- @funkit/fun-relay@2.12.0
|
|
71
|
+
|
|
3
72
|
## 11.3.0
|
|
4
73
|
|
|
5
74
|
### Minor Changes
|
|
@@ -3,19 +3,7 @@
|
|
|
3
3
|
// src/utils/withdrawal.ts
|
|
4
4
|
import { chainMetadataById } from "@funkit/chains";
|
|
5
5
|
import { isEVMAddressEquivalent, isTokenEquivalent } from "@funkit/utils";
|
|
6
|
-
import * as dnum from "dnum";
|
|
7
6
|
import { parseUnits } from "viem";
|
|
8
|
-
function deductFlatFee(inputAmount, feeTokens) {
|
|
9
|
-
if (!feeTokens || feeTokens <= 0) {
|
|
10
|
-
return inputAmount;
|
|
11
|
-
}
|
|
12
|
-
try {
|
|
13
|
-
const net = dnum.subtract(inputAmount || "0", feeTokens);
|
|
14
|
-
return dnum.greaterThan(net, 0) ? dnum.toString(net) : "0";
|
|
15
|
-
} catch {
|
|
16
|
-
return "0";
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
7
|
function isCustomWithdrawalConfig(config) {
|
|
20
8
|
return "withdrawCallback" in config;
|
|
21
9
|
}
|
|
@@ -30,7 +18,6 @@ function toWithdrawalAmountBaseUnit(amount, decimals) {
|
|
|
30
18
|
}
|
|
31
19
|
|
|
32
20
|
export {
|
|
33
|
-
deductFlatFee,
|
|
34
21
|
isCustomWithdrawalConfig,
|
|
35
22
|
toWithdrawalAmountBaseUnit
|
|
36
23
|
};
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
POLYMARKET_PERPS_ROUTING_ID,
|
|
4
|
-
POLYMARKET_PREDICTIONS_ROUTING_ID
|
|
5
|
-
} from "./chunk-Y7WLUPTX.js";
|
|
6
|
-
import {
|
|
7
|
-
POLYGON_USDCE,
|
|
8
|
-
PUSD_TOKEN
|
|
9
|
-
} from "./chunk-IYCZWLAF.js";
|
|
10
2
|
import {
|
|
11
3
|
FunInput,
|
|
12
4
|
FunSkeletonBlock,
|
|
@@ -20,6 +12,14 @@ import {
|
|
|
20
12
|
import {
|
|
21
13
|
useFunkitTranslation
|
|
22
14
|
} from "./chunk-YUZ3B2Q3.js";
|
|
15
|
+
import {
|
|
16
|
+
POLYMARKET_PERPS_ROUTING_ID,
|
|
17
|
+
POLYMARKET_PREDICTIONS_ROUTING_ID
|
|
18
|
+
} from "./chunk-Y7WLUPTX.js";
|
|
19
|
+
import {
|
|
20
|
+
POLYGON_USDCE,
|
|
21
|
+
PUSD_TOKEN
|
|
22
|
+
} from "./chunk-IYCZWLAF.js";
|
|
23
23
|
import {
|
|
24
24
|
logger
|
|
25
25
|
} from "./chunk-AHYOV7AV.js";
|
|
@@ -241,9 +241,10 @@ var BaseDropdownItem_default = BaseDropdownItem;
|
|
|
241
241
|
|
|
242
242
|
// src/components/Dropdown/BaseDropdown.css.ts
|
|
243
243
|
var BORDER_RADIUS = "dropdown";
|
|
244
|
-
var baseDropdownItemWrapperStyles = "
|
|
245
|
-
var
|
|
246
|
-
var
|
|
244
|
+
var baseDropdownItemWrapperStyles = "_1nns6ys6 _1rsrm2f17";
|
|
245
|
+
var dropdownContentAnimationStyles = "_1nns6ys2";
|
|
246
|
+
var scrollGradientWrapperStyles = "_1nns6ys4";
|
|
247
|
+
var scrollableDropdownStyles = "_1nns6ys3";
|
|
247
248
|
|
|
248
249
|
// src/components/Icons/CaretDownIcon.tsx
|
|
249
250
|
import clsx2 from "clsx";
|
|
@@ -889,7 +890,7 @@ function BaseDropdown({
|
|
|
889
890
|
side: dropdownSide,
|
|
890
891
|
sideOffset: dropdownSide === "top" ? 8 : 6,
|
|
891
892
|
align: dropdownAlign,
|
|
892
|
-
className:
|
|
893
|
+
className: dropdownContentAnimationStyles,
|
|
893
894
|
style: {
|
|
894
895
|
zIndex: `calc(${themeVars.modalZIndex} + 1)`,
|
|
895
896
|
width: dropdownWidth ? `${dropdownWidth}px` : openDropdownFullWidth ? "var(--radix-dropdown-menu-trigger-width)" : void 0,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
i18n_default
|
|
4
|
+
} from "./chunk-C45VNQXY.js";
|
|
5
|
+
|
|
6
|
+
// src/clients/internal/nado/withdrawalErrors.ts
|
|
7
|
+
import {
|
|
8
|
+
toNadoWithdrawalFailure
|
|
9
|
+
} from "@funkit/connect-core/clients/nado";
|
|
10
|
+
import { isExpectedNadoWithdrawalFailure } from "@funkit/connect-core/clients/nado";
|
|
11
|
+
var MESSAGE_FOR = {
|
|
12
|
+
generic: () => i18n_default.t("withdrawal.nado.errorGeneric"),
|
|
13
|
+
network: () => i18n_default.t("withdrawal.nado.errorNetwork"),
|
|
14
|
+
rateLimited: () => i18n_default.t("withdrawal.nado.errorRateLimited"),
|
|
15
|
+
exceedsBorrowLimit: () => i18n_default.t("withdrawal.nado.errorExceedsBorrowLimit"),
|
|
16
|
+
invalidNonce: () => i18n_default.t("withdrawal.nado.errorInvalidNonce"),
|
|
17
|
+
noPriorDeposit: () => i18n_default.t("withdrawal.nado.errorNoPriorDeposit"),
|
|
18
|
+
withdrawRisk: () => i18n_default.t("withdrawal.nado.errorWithdrawRisk"),
|
|
19
|
+
// Never says "try again" — a fresh nonce on an unconfirmed withdrawal is the
|
|
20
|
+
// one retry that can pay out twice.
|
|
21
|
+
unconfirmed: () => i18n_default.t("withdrawal.nado.errorUnconfirmed")
|
|
22
|
+
};
|
|
23
|
+
function toNadoWithdrawalErrorMessage(error) {
|
|
24
|
+
return MESSAGE_FOR[toNadoWithdrawalFailure(error)]();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
toNadoWithdrawalErrorMessage,
|
|
29
|
+
isExpectedNadoWithdrawalFailure
|
|
30
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
isCustomWithdrawalConfig
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
buildNadoSubaccountId
|
|
7
|
-
} from "./chunk-6T6URLBM.js";
|
|
4
|
+
} from "./chunk-B7UU2ETA.js";
|
|
8
5
|
import {
|
|
9
6
|
logger
|
|
10
7
|
} from "./chunk-AHYOV7AV.js";
|
|
11
8
|
|
|
12
9
|
// src/clients/internal/nado/withdrawalConfig.ts
|
|
10
|
+
import {
|
|
11
|
+
buildNadoSubaccountId
|
|
12
|
+
} from "@funkit/connect-core/clients/nado";
|
|
13
13
|
var HEX_SHAPED_SUBACCOUNT_NAME = /^(?:[0-9a-f]{2})+$/i;
|
|
14
14
|
function isNadoWithdrawalConfig(config) {
|
|
15
15
|
return !!config && isCustomWithdrawalConfig(config) && config.customerConfig?.customerName === "nado";
|
|
@@ -1,45 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
buildWithdrawCollateralV2TypedData
|
|
4
|
-
} from "./chunk-2576N7PQ.js";
|
|
5
2
|
import {
|
|
6
3
|
isExpectedNadoWithdrawalFailure,
|
|
7
4
|
toNadoWithdrawalErrorMessage
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
safeBigInt
|
|
11
|
-
} from "./chunk-63XTVHO3.js";
|
|
5
|
+
} from "./chunk-MSLPLXR2.js";
|
|
12
6
|
import {
|
|
13
|
-
deductFlatFee,
|
|
14
7
|
toWithdrawalAmountBaseUnit
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
x18ToRawBaseUnit
|
|
18
|
-
} from "./chunk-6T6URLBM.js";
|
|
19
|
-
import {
|
|
20
|
-
executeNadoWithdrawCollateralV2,
|
|
21
|
-
getNadoMaxWithdrawable,
|
|
22
|
-
getNadoTxNonce
|
|
23
|
-
} from "./chunk-TZGKB6WY.js";
|
|
24
|
-
import {
|
|
25
|
-
INK_CHAIN_ID,
|
|
26
|
-
NADO_WITHDRAWAL_ACTION_TYPE
|
|
27
|
-
} from "./chunk-3P2C436B.js";
|
|
28
|
-
import {
|
|
29
|
-
NadoGatewayError,
|
|
30
|
-
NadoWithdrawalUnconfirmedError
|
|
31
|
-
} from "./chunk-Z7HTQFEO.js";
|
|
8
|
+
} from "./chunk-B7UU2ETA.js";
|
|
32
9
|
import {
|
|
33
10
|
getAccount,
|
|
34
11
|
signTypedData,
|
|
35
12
|
switchChain
|
|
36
13
|
} from "./chunk-OODIKHYE.js";
|
|
37
|
-
import {
|
|
38
|
-
generateClientMetadataForTokenTransfer
|
|
39
|
-
} from "./chunk-PENJ5JGH.js";
|
|
40
14
|
import {
|
|
41
15
|
i18n_default
|
|
42
16
|
} from "./chunk-C45VNQXY.js";
|
|
17
|
+
import {
|
|
18
|
+
generateClientMetadataForTokenTransfer
|
|
19
|
+
} from "./chunk-PENJ5JGH.js";
|
|
43
20
|
import {
|
|
44
21
|
logger
|
|
45
22
|
} from "./chunk-AHYOV7AV.js";
|
|
@@ -49,6 +26,18 @@ import {
|
|
|
49
26
|
NADO_API_KEY,
|
|
50
27
|
initializeCheckoutTokenTransferAddress
|
|
51
28
|
} from "@funkit/api-base";
|
|
29
|
+
import { deductFlatFee, safeBigInt } from "@funkit/connect-core";
|
|
30
|
+
import {
|
|
31
|
+
INK_CHAIN_ID,
|
|
32
|
+
NADO_WITHDRAWAL_ACTION_TYPE,
|
|
33
|
+
NadoGatewayError,
|
|
34
|
+
NadoWithdrawalUnconfirmedError,
|
|
35
|
+
buildWithdrawCollateralV2TypedData,
|
|
36
|
+
executeNadoWithdrawCollateralV2,
|
|
37
|
+
getNadoMaxWithdrawable,
|
|
38
|
+
getNadoTxNonce,
|
|
39
|
+
x18ToRawBaseUnit
|
|
40
|
+
} from "@funkit/connect-core/clients/nado";
|
|
52
41
|
import { isEVMAddressEquivalent } from "@funkit/utils";
|
|
53
42
|
|
|
54
43
|
// src/utils/signature.ts
|
|
@@ -143,7 +132,7 @@ function createNadoWithdrawalCallback({
|
|
|
143
132
|
destinationAddress
|
|
144
133
|
});
|
|
145
134
|
step = "sign";
|
|
146
|
-
const nonce = await getNadoTxNonce(walletAddress);
|
|
135
|
+
const nonce = await getNadoTxNonce(walletAddress, { logger });
|
|
147
136
|
const signature = await signTypedData(wagmiConfig, {
|
|
148
137
|
...buildWithdrawCollateralV2TypedData({
|
|
149
138
|
sender: subaccount,
|
|
@@ -160,15 +149,18 @@ function createNadoWithdrawalCallback({
|
|
|
160
149
|
productId
|
|
161
150
|
});
|
|
162
151
|
step = "execute";
|
|
163
|
-
await executeNadoWithdrawCollateralV2(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
152
|
+
await executeNadoWithdrawCollateralV2(
|
|
153
|
+
{
|
|
154
|
+
sender: subaccount,
|
|
155
|
+
productId,
|
|
156
|
+
amount: netRawAmount,
|
|
157
|
+
nonce,
|
|
158
|
+
sendTo: depositAddr,
|
|
159
|
+
signature,
|
|
160
|
+
spotLeverage
|
|
161
|
+
},
|
|
162
|
+
{ logger }
|
|
163
|
+
);
|
|
172
164
|
logger.info("nado:withdrawal:executeSubmitted", {
|
|
173
165
|
nonce: nonce.toString(),
|
|
174
166
|
depositAddr,
|
|
@@ -194,11 +186,10 @@ async function assertWithinMaxWithdrawable({
|
|
|
194
186
|
spotLeverage,
|
|
195
187
|
netRawAmount
|
|
196
188
|
}) {
|
|
197
|
-
const maxWithdrawableX18 = await getNadoMaxWithdrawable(
|
|
198
|
-
productId,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
});
|
|
189
|
+
const maxWithdrawableX18 = await getNadoMaxWithdrawable(
|
|
190
|
+
{ productId, sender: subaccount, spotLeverage },
|
|
191
|
+
{ logger }
|
|
192
|
+
);
|
|
202
193
|
const maxRawAmount = x18ToRawBaseUnit(
|
|
203
194
|
safeBigInt(maxWithdrawableX18, 0n),
|
|
204
195
|
decimals
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createNadoWithdrawalCallback
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-63XTVHO3.js";
|
|
8
|
-
import "../../chunk-DGBIV3ZS.js";
|
|
9
|
-
import "../../chunk-6T6URLBM.js";
|
|
10
|
-
import "../../chunk-TZGKB6WY.js";
|
|
11
|
-
import "../../chunk-3P2C436B.js";
|
|
12
|
-
import "../../chunk-WZRW6WUM.js";
|
|
13
|
-
import "../../chunk-Z7HTQFEO.js";
|
|
4
|
+
} from "../../chunk-UMU5S2WF.js";
|
|
5
|
+
import "../../chunk-MSLPLXR2.js";
|
|
6
|
+
import "../../chunk-B7UU2ETA.js";
|
|
14
7
|
import "../../chunk-OODIKHYE.js";
|
|
15
|
-
import "../../chunk-PENJ5JGH.js";
|
|
16
8
|
import "../../chunk-C45VNQXY.js";
|
|
9
|
+
import "../../chunk-PENJ5JGH.js";
|
|
17
10
|
import "../../chunk-AHYOV7AV.js";
|
|
18
11
|
export {
|
|
19
12
|
createNadoWithdrawalCallback
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { Address, Hex } from 'viem';
|
|
8
8
|
import type { CustomWithdrawalConfig, FunkitWithdrawalConfig } from '../../../providers/FunkitCheckoutContext';
|
|
9
|
-
import type
|
|
9
|
+
import { type NadoWithdrawalCustomerConfig } from '@funkit/connect-core/clients/nado';
|
|
10
10
|
export interface NadoWithdrawalConfig extends CustomWithdrawalConfig {
|
|
11
11
|
customerConfig: NadoWithdrawalCustomerConfig;
|
|
12
|
+
/** Initial state of the borrow (spot leverage) toggle; the user may still flip it. */
|
|
13
|
+
defaultSpotLeverage?: boolean;
|
|
12
14
|
}
|
|
13
15
|
export declare function isNadoWithdrawalConfig(config: FunkitWithdrawalConfig | null | undefined): config is NadoWithdrawalConfig;
|
|
14
16
|
/** Packed subaccount id, or undefined when one can't be built — the caller
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isNadoWithdrawalConfig,
|
|
4
4
|
resolveNadoSubaccount
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-6T6URLBM.js";
|
|
5
|
+
} from "../../chunk-TYG42JRZ.js";
|
|
6
|
+
import "../../chunk-B7UU2ETA.js";
|
|
8
7
|
import "../../chunk-AHYOV7AV.js";
|
|
9
8
|
export {
|
|
10
9
|
isNadoWithdrawalConfig,
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Nado
|
|
2
|
+
* Nado failure → the copy web shows for it.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Core classifies *which* failure it is (the part with the nonce-revert
|
|
5
|
+
* subtlety); this file owns web's wording. The map is exhaustive over
|
|
6
|
+
* `NadoWithdrawalFailure`, so a new failure code fails the build here until it
|
|
7
|
+
* has a line.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
* Whether the failure is one we have specific copy for. Shares the code set with
|
|
11
|
-
* {@link toNadoWithdrawalErrorMessage} so severity and messaging can't drift.
|
|
12
|
-
*/
|
|
13
|
-
export declare function isExpectedNadoWithdrawalFailure(error: unknown): boolean;
|
|
9
|
+
export { isExpectedNadoWithdrawalFailure } from '@funkit/connect-core/clients/nado';
|
|
14
10
|
export declare function toNadoWithdrawalErrorMessage(error: unknown): string;
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isExpectedNadoWithdrawalFailure,
|
|
4
4
|
toNadoWithdrawalErrorMessage
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-Z7HTQFEO.js";
|
|
5
|
+
} from "../../chunk-MSLPLXR2.js";
|
|
7
6
|
import "../../chunk-C45VNQXY.js";
|
|
8
7
|
export {
|
|
9
8
|
isExpectedNadoWithdrawalFailure,
|
|
@@ -16825,19 +16825,42 @@
|
|
|
16825
16825
|
transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
|
|
16826
16826
|
}
|
|
16827
16827
|
|
|
16828
|
-
/* vanilla-extract-css-ns:src/components/Dropdown/BaseDropdown.css.ts.vanilla.css?source=#
|
|
16829
|
-
|
|
16828
|
+
/* vanilla-extract-css-ns:src/components/Dropdown/BaseDropdown.css.ts.vanilla.css?source=#H4sIAAAAAAAAA9VVYWvbMBD9nl8hAoMEomC3XbcpFMq2f1HKOFvnRETWmdM5aTr634dlp03ahnZjH7ZPlji9d-_eneTrNe4qhhqj-pGHEC93MVM_R0plH9JHKWqgdLIzKlukvTCEWBHXRsUSPE6y-ZdP0y72MFIqz14C8xPAfEA9jK5fqshPqHiL7HUJ79D-MJrvc5_dWBDQvL7tF1FA8Gpceopox7eJvCEXBFnjBoNEowIFXBySnKdjtEGuPG31zihohbpcsWTyvgDWW2dl9RrWGL3FYu1EPx5OdNbFxsPuFcjFoCo6cRSMYvQgboOLAxFGrZy1GI6BxhRYEWMiKCkIBjFqPF4c8UERybeS-ISawVKPlQxLdsvVfr3CfnPxubnr9gWU6yVTG6xR3gUE1ksG6zDIREgVJEL1TG2AJ1rzWpfkiaOmBsN3psbSNnx9pPjWBaezvpkNMAaZLk525PkQJNS-Ju9V_jGroyrbwpW6wHuHPMnm5zOVzVQ2zy5nqh-se-2Cxbs0f8fmQSXI7_eur_Wv2ifU_Jfe9ZerAotaqLkaC7c4vj0ax8NrfwLaG_qEfurHCfBlCv5RLYcsZgVxcgPsQFsXofBo9yKmZtVduZTnsHcuOHHgO0_KliNxZ7Ro8J62aDv66xqtAzVpGCvkqBltW6LVNfVKA-k-hKHEaUrw1qvVDcLwZikFwdXQUWnbMvScqfLFs7C42oWlrtpQ9qeeOXMxOHO2b_IhuHLe65osGlURb4HtC_4ANZqnX87-7f6tJ_ifLScf_ii_AJ3ZdB5dBwAA */
|
|
16829
|
+
@keyframes _1nns6ys0 {
|
|
16830
|
+
0% {
|
|
16831
|
+
opacity: 0;
|
|
16832
|
+
transform: scale(0.97);
|
|
16833
|
+
}
|
|
16834
|
+
100% {
|
|
16835
|
+
opacity: 1;
|
|
16836
|
+
transform: scale(1);
|
|
16837
|
+
}
|
|
16838
|
+
}
|
|
16839
|
+
@keyframes _1nns6ys1 {
|
|
16840
|
+
0% {
|
|
16841
|
+
opacity: 1;
|
|
16842
|
+
transform: scale(1);
|
|
16843
|
+
}
|
|
16844
|
+
100% {
|
|
16845
|
+
opacity: 0;
|
|
16846
|
+
transform: scale(0.97);
|
|
16847
|
+
}
|
|
16848
|
+
}
|
|
16849
|
+
._1nns6ys2[data-rk][data-state=closed] {
|
|
16850
|
+
pointer-events: none;
|
|
16851
|
+
}
|
|
16852
|
+
[data-rk] ._1nns6ys3 {
|
|
16830
16853
|
overflow-y: auto;
|
|
16831
16854
|
scrollbar-width: none;
|
|
16832
16855
|
}
|
|
16833
|
-
[data-rk] .
|
|
16856
|
+
[data-rk] ._1nns6ys3::-webkit-scrollbar {
|
|
16834
16857
|
display: none;
|
|
16835
16858
|
}
|
|
16836
|
-
[data-rk] .
|
|
16859
|
+
[data-rk] ._1nns6ys4 {
|
|
16837
16860
|
position: relative;
|
|
16838
16861
|
overflow: hidden;
|
|
16839
16862
|
}
|
|
16840
|
-
[data-rk] .
|
|
16863
|
+
[data-rk] ._1nns6ys4::before {
|
|
16841
16864
|
content: "";
|
|
16842
16865
|
position: absolute;
|
|
16843
16866
|
top: 0;
|
|
@@ -16854,7 +16877,7 @@
|
|
|
16854
16877
|
transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
|
|
16855
16878
|
z-index: 1;
|
|
16856
16879
|
}
|
|
16857
|
-
[data-rk] .
|
|
16880
|
+
[data-rk] ._1nns6ys4::after {
|
|
16858
16881
|
content: "";
|
|
16859
16882
|
position: absolute;
|
|
16860
16883
|
bottom: 0;
|
|
@@ -16871,48 +16894,33 @@
|
|
|
16871
16894
|
transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
|
|
16872
16895
|
z-index: 1;
|
|
16873
16896
|
}
|
|
16874
|
-
[data-rk] .
|
|
16897
|
+
[data-rk] ._1nns6ys4[data-fade-top=true]::before {
|
|
16875
16898
|
opacity: 1;
|
|
16876
16899
|
}
|
|
16877
|
-
[data-rk] .
|
|
16900
|
+
[data-rk] ._1nns6ys4[data-fade-bottom=true]::after {
|
|
16878
16901
|
opacity: 1;
|
|
16879
16902
|
}
|
|
16880
|
-
[data-rk] .
|
|
16903
|
+
[data-rk] ._1nns6ys6 {
|
|
16881
16904
|
transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
|
|
16882
16905
|
}
|
|
16883
|
-
[data-rk] .
|
|
16906
|
+
[data-rk] ._1nns6ys6:has([aria-disabled=true]):hover {
|
|
16884
16907
|
background: initial;
|
|
16885
16908
|
cursor: not-allowed;
|
|
16886
16909
|
}
|
|
16887
|
-
|
|
16888
|
-
|
|
16889
|
-
|
|
16890
|
-
|
|
16891
|
-
|
|
16892
|
-
|
|
16893
|
-
}
|
|
16894
|
-
100% {
|
|
16895
|
-
opacity: 1;
|
|
16896
|
-
transform: scale(1);
|
|
16897
|
-
}
|
|
16898
|
-
}
|
|
16899
|
-
@keyframes funkit-dropdown-fade-out {
|
|
16900
|
-
0% {
|
|
16901
|
-
opacity: 1;
|
|
16902
|
-
transform: scale(1);
|
|
16910
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
16911
|
+
._1nns6ys2[data-rk][data-state=open] {
|
|
16912
|
+
animation-duration: 150ms;
|
|
16913
|
+
animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
16914
|
+
animation-fill-mode: forwards;
|
|
16915
|
+
animation-name: _1nns6ys0;
|
|
16903
16916
|
}
|
|
16904
|
-
|
|
16905
|
-
|
|
16906
|
-
|
|
16917
|
+
._1nns6ys2[data-rk][data-state=closed] {
|
|
16918
|
+
animation-duration: 150ms;
|
|
16919
|
+
animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
16920
|
+
animation-fill-mode: forwards;
|
|
16921
|
+
animation-name: _1nns6ys1;
|
|
16907
16922
|
}
|
|
16908
16923
|
}
|
|
16909
|
-
.funkit-dropdown-content[data-state=open] {
|
|
16910
|
-
animation: funkit-dropdown-fade-in 150ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
|
16911
|
-
}
|
|
16912
|
-
.funkit-dropdown-content[data-state=closed] {
|
|
16913
|
-
animation: funkit-dropdown-fade-out 150ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
|
16914
|
-
pointer-events: none;
|
|
16915
|
-
}
|
|
16916
16924
|
|
|
16917
16925
|
/* vanilla-extract-css-ns:src/components/Dropdown/BaseDropdownItem.css.ts.vanilla.css?source=Ll8xOGhodzNrMSB7CiAgY3Vyc29yOiBwb2ludGVyOwp9Ci5fMThoaHczazMgewogIGN1cnNvcjogbm90LWFsbG93ZWQ7CiAgb3BhY2l0eTogMC41Owp9 */
|
|
16918
16926
|
[data-rk] ._18hhw3k1 {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* these outputs onto its own props.
|
|
8
8
|
* - Every react-query call is a no-op (zero traffic) when the config isn't Nado.
|
|
9
9
|
*/
|
|
10
|
+
import { type NadoWithdrawalCustomerData } from '@funkit/connect-core/clients/nado';
|
|
10
11
|
import type { FunkitWithdrawalConfig } from '../../../providers/FunkitCheckoutContext';
|
|
11
|
-
import type { NadoWithdrawalCustomerData } from './withdrawalTypes';
|
|
12
12
|
/** Structurally matches the shared flow's `clientAmountToggle` (no modals import). */
|
|
13
13
|
export interface NadoAmountToggle {
|
|
14
14
|
label: string;
|