@funkit/connect 9.24.0 → 9.26.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 +50 -0
- package/dist/clients/{chunk-7G3QEQFB.js → chunk-2NBYHUIW.js} +1 -1
- package/dist/clients/{chunk-JN6WUYT2.js → chunk-4IWQ2UT5.js} +8 -5
- package/dist/clients/{chunk-VJZW3MA3.js → chunk-F4SCUKY6.js} +1 -1
- package/dist/clients/{chunk-7UIDHSYG.js → chunk-LUHEVXPD.js} +1 -8
- package/dist/clients/chunk-STLOQEN7.js +11 -0
- package/dist/clients/chunk-UPZNKPYU.js +27 -0
- package/dist/clients/{chunk-MXPZTW2H.js → chunk-VT3ERWXE.js} +4 -2
- package/dist/clients/fanatics.js +5 -3
- package/dist/clients/lighter.css +0 -5
- package/dist/clients/lighter.js +7 -4
- package/dist/clients/mallard.d.ts +43 -1
- package/dist/clients/mallard.js +112 -3
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +0 -5
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +7 -5
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +2 -2
- package/dist/clients/polymarket/index.css +0 -5
- package/dist/clients/polymarket/index.js +7 -5
- package/dist/clients/polymarket/polymarket.js +1 -1
- package/dist/components/FunCheckoutHistory/FunCheckoutHistoryContent.d.ts +1 -2
- package/dist/components/FunTransactionSummary/PaymentAmountSummary.d.ts +2 -1
- package/dist/domains/clientMetadata.d.ts +21 -0
- package/dist/domains/nado.d.ts +9 -0
- package/dist/hooks/track/CheckoutModalEvent.d.ts +0 -1
- package/dist/hooks/useGetAssetHoldingsFromRpc.d.ts +23 -0
- package/dist/hooks/useInjectedAssetHoldings.d.ts +23 -0
- package/dist/hooks/useXstockAssetHoldings.d.ts +15 -0
- package/dist/hooks/useXstocksWrappedTokenAddress.d.ts +16 -0
- package/dist/index.css +0 -5
- package/dist/index.js +2740 -2321
- package/dist/modals/CheckoutModal/CheckoutComplete/CheckoutComplete.d.ts +1 -1
- package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +0 -1
- package/dist/modals/CheckoutModal/InputAmount/useNadoDirectTransfer.d.ts +64 -0
- package/dist/modals/CheckoutModal/SelectAsset/SelectAsset.d.ts +1 -1
- package/dist/modals/CheckoutModal/SourceChange/FormOfPaymentsList.d.ts +1 -1
- package/dist/modals/CheckoutModal/SourceChange/buildSourceGroups.d.ts +2 -2
- package/dist/modals/CheckoutModal/stepTransition.d.ts +0 -3
- package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +12 -0
- package/dist/modals/WithdrawalModal/WithdrawalSwappedIframeController.d.ts +3 -1
- package/dist/modals/WithdrawalModal/useFiatWithdrawal.d.ts +40 -0
- package/dist/modals/WithdrawalModal/useWithdrawal.d.ts +2 -2
- package/dist/providers/FunkitCheckoutContext/types.d.ts +21 -0
- package/dist/utils/assets.d.ts +7 -0
- package/dist/utils/checkoutHistory.d.ts +1 -5
- package/dist/utils/swappedRouteOverride.d.ts +27 -0
- package/dist/wagmi/actions.d.ts +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 +33 -33
- 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/components/FunCheckoutHistory/FunCheckoutHistoryHelp.d.ts +0 -10
- package/dist/modals/CheckoutModal/CheckoutHelp/CheckoutHelp.d.ts +0 -9
- package/dist/clients/{chunk-ME4OAQIY.js → chunk-O5CTDT3L.js} +0 -0
- package/dist/wallets/walletConnectors/{chunk-W2LCLDPX.js → chunk-2VP2F6EK.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-IULPZP2Q.js → chunk-4T6ZSRJF.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-WAHGI5L7.js → chunk-6BW3HLBG.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YO2K4MBH.js → chunk-CCQV2ZET.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-TKB2OY6G.js → chunk-CPI4TD43.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-OX37G4YT.js → chunk-F5XEEVG6.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-JPN6TWIT.js → chunk-HNRB7KJU.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-WKNQMP4A.js → chunk-HTHAK6XB.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-GUQM4QSL.js → chunk-MIQTHJ6X.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-4NV5BYRP.js → chunk-RB3HR4R2.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-SWFF3TWJ.js → chunk-RVOY537T.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-KI5Y2BBF.js → chunk-STVVP43G.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-OEEGYENV.js → chunk-UK7C2JXW.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YQFGVZGR.js → chunk-VAPGUPHO.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-XCNHV3HS.js → chunk-VTM6EECM.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-NR2OGDHQ.js → chunk-X6CGV36L.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-AVDUNQUW.js → chunk-YEZM4CK4.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-KCRO2AGO.js → chunk-ZNX4EMPB.js} +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 9.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 907d703: Add `useMallardWithdrawalConfig` (+ `MALLARD_USDG_ADDRESS`, `MALLARD_USDG_ICON_SRC`, `MallardWithdrawalConfig`) for Mallard (Robinhood chain) withdrawals: builds a `WalletWithdrawalConfig` for USDG signed by the user's connected wallet.
|
|
8
|
+
|
|
9
|
+
Also relaxes the withdrawal modal's "Use connected wallet" recipient shortcut to show for connected-wallet withdrawals (where the source is the connected wallet), not just proxy-based flows.
|
|
10
|
+
|
|
11
|
+
- b836b7c: Add a Statsig-driven source-route override (`swappedwithdrawalsourceoverrides`) for Swapped fiat withdrawals: when the requested target asset isn't supported by Swapped, enforce a known-good accepted route keyed on the user's source asset. Empty config leaves existing behavior unchanged.
|
|
12
|
+
- b8c578e: Type and validate Swapped sell order data on receipt; order execution lands in a follow-up
|
|
13
|
+
- ab7c4b9: Execute Swapped withdrawals via the Relay route through `useWithdrawal` (EXACT_OUT quote with real fees)
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 5d6146d: Update the "Use other assets" tooltip copy in the source-change list
|
|
18
|
+
- 0db2b47: Fix a new deposit started off the active checkout keeping the prior route's behavior: switching destination (e.g. Mallard USDG spot → perps) now re-binds the per-route deposit actions instead of dropping them, so the perps source token is selectable again.
|
|
19
|
+
- 9ff1e58: Initialize the relay client from the active wagmi config (`useConfig`), sourcing each chain's RPC from its configured transport. Fixes `WaitForTransactionReceiptTimeoutError` on chains whose default RPC isn't reachable.
|
|
20
|
+
- 8c0afe8: Rename the "Other options" source/payment section header to "More options" for consistency
|
|
21
|
+
- Updated dependencies [86d2a31]
|
|
22
|
+
- Updated dependencies [a24681e]
|
|
23
|
+
- Updated dependencies [b8c578e]
|
|
24
|
+
- @funkit/connect-core@1.4.0
|
|
25
|
+
- @funkit/fun-relay@2.8.5
|
|
26
|
+
|
|
27
|
+
## 9.25.0
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- 639d776: Remove the deprecated `/support` API service. The `POST /support/send-message` endpoint is being decommissioned on the API server, so all client references are removed.
|
|
32
|
+
|
|
33
|
+
`@funkit/api-base` (breaking): the `sendSupportMessage` function and the `SendSupportMessageRequest` type are no longer exported. There is no replacement client — integrate with the support provider directly, or contact the Fun.xyz team for the supported path.
|
|
34
|
+
|
|
35
|
+
`@funkit/connect`: the in-app checkout "Tell us more" report form (which posted to `/support`) has been removed. The "Get help" affordances in checkout-complete, the post-checkout history detail, and notifications now open the support contact link (`CONTACT_US_LINK`) in a new tab, consistent with the existing direct-execution help flow. No public exports changed.
|
|
36
|
+
|
|
37
|
+
- 23ec218: Nado: deposit the user's on-chain balance of the target spot token (e.g. QQQx/SPYx on Ink) via a same-token, same-chain ERC-20 transfer run from the confirmation step, instead of routing through Relay. Behind the `enable-rpc-xstock-assets` gate (off by default).
|
|
38
|
+
- cd57fba: Foundational types and config for the xStock direct-transfer flow: add the optional `assetClass` field to `DynamicTargetAssetCandidate`, the `enable-rpc-xstock-assets` feature gate, the `getActiveDynamicTargetAsset` / Nado asset-class helpers, and the wSPYx / wQQQx asset logos. Additive only — no behavior change.
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- b777bcf: Read a target token's (and its xStocks wrapper's) on-chain balance via RPC and inject it as a payable holding, behind the `enable-rpc-xstock-assets` gate (off by default).
|
|
43
|
+
- Updated dependencies [fc74160]
|
|
44
|
+
- Updated dependencies [bb08629]
|
|
45
|
+
- Updated dependencies [639d776]
|
|
46
|
+
- Updated dependencies [23ec218]
|
|
47
|
+
- Updated dependencies [09452ce]
|
|
48
|
+
- Updated dependencies [cd57fba]
|
|
49
|
+
- @funkit/api-base@5.0.0
|
|
50
|
+
- @funkit/connect-core@1.3.0
|
|
51
|
+
- @funkit/fun-relay@2.8.4
|
|
52
|
+
|
|
3
53
|
## 9.24.0
|
|
4
54
|
|
|
5
55
|
### Minor Changes
|
|
@@ -6,21 +6,23 @@ import {
|
|
|
6
6
|
FunInput,
|
|
7
7
|
FunSkeletonBlock,
|
|
8
8
|
TooltipAnchorRefContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VT3ERWXE.js";
|
|
10
10
|
import {
|
|
11
11
|
Box,
|
|
12
12
|
Text,
|
|
13
|
-
themeVars
|
|
13
|
+
themeVars
|
|
14
|
+
} from "./chunk-LUHEVXPD.js";
|
|
15
|
+
import {
|
|
14
16
|
useFunkitTranslation
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-STLOQEN7.js";
|
|
16
18
|
import {
|
|
17
19
|
POLYMARKET_PERPS_ROUTING_ID,
|
|
18
20
|
POLYMARKET_PREDICTIONS_ROUTING_ID
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-F4SCUKY6.js";
|
|
20
22
|
import {
|
|
21
23
|
POLYGON_USDCE,
|
|
22
24
|
PUSD_TOKEN
|
|
23
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-O5CTDT3L.js";
|
|
24
26
|
import {
|
|
25
27
|
logger
|
|
26
28
|
} from "./chunk-AHYOV7AV.js";
|
|
@@ -96,6 +98,7 @@ var useScrollDivider = () => {
|
|
|
96
98
|
};
|
|
97
99
|
|
|
98
100
|
// src/providers/FunkitProvider.tsx
|
|
101
|
+
import { LogLevel, initializeRelayClient } from "@funkit/fun-relay";
|
|
99
102
|
import { QueryClientProvider } from "@tanstack/react-query";
|
|
100
103
|
import React8, {
|
|
101
104
|
createContext,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
VAULT_DEPOSITOR_ABI,
|
|
9
9
|
VAULT_DEPOSITOR_POLYGON,
|
|
10
10
|
createPerpsGenerateActionParams
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-O5CTDT3L.js";
|
|
12
12
|
|
|
13
13
|
// src/clients/polymarket/createPolymarketDepositConfig.ts
|
|
14
14
|
import { encodeFunctionData, erc20Abi, maxUint256 } from "viem";
|
|
@@ -102,15 +102,8 @@ var Text = React2.forwardRef(
|
|
|
102
102
|
);
|
|
103
103
|
Text.displayName = "Text";
|
|
104
104
|
|
|
105
|
-
// src/hooks/useFunkitTranslation.ts
|
|
106
|
-
import { useTranslation } from "react-i18next";
|
|
107
|
-
function useFunkitTranslation() {
|
|
108
|
-
return useTranslation();
|
|
109
|
-
}
|
|
110
|
-
|
|
111
105
|
export {
|
|
112
106
|
themeVars,
|
|
113
107
|
Box,
|
|
114
|
-
Text
|
|
115
|
-
useFunkitTranslation
|
|
108
|
+
Text
|
|
116
109
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/wagmi/hooks.ts
|
|
4
|
+
import {
|
|
5
|
+
useAccount,
|
|
6
|
+
useAccountEffect,
|
|
7
|
+
useBalance,
|
|
8
|
+
useConfig,
|
|
9
|
+
useConnect,
|
|
10
|
+
useDisconnect,
|
|
11
|
+
useEnsAvatar,
|
|
12
|
+
useEnsName,
|
|
13
|
+
useGasPrice,
|
|
14
|
+
useReconnect,
|
|
15
|
+
useSendTransaction,
|
|
16
|
+
useSwitchChain,
|
|
17
|
+
useWalletClient,
|
|
18
|
+
useWatchAsset,
|
|
19
|
+
useWriteContract
|
|
20
|
+
} from "wagmi";
|
|
21
|
+
import { WagmiProvider } from "wagmi";
|
|
22
|
+
import { createConfig, createConnector, http } from "wagmi";
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
useAccount,
|
|
26
|
+
useConfig
|
|
27
|
+
};
|
package/dist/clients/fanatics.js
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AsyncImage,
|
|
4
4
|
preloadRemoteImages
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2NBYHUIW.js";
|
|
6
6
|
import {
|
|
7
7
|
Box,
|
|
8
|
-
Text
|
|
8
|
+
Text
|
|
9
|
+
} from "./chunk-LUHEVXPD.js";
|
|
10
|
+
import {
|
|
9
11
|
useFunkitTranslation
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-STLOQEN7.js";
|
|
11
13
|
import "./chunk-AHYOV7AV.js";
|
|
12
14
|
|
|
13
15
|
// src/clients/fanatics.tsx
|
package/dist/clients/lighter.css
CHANGED
|
@@ -16942,11 +16942,6 @@
|
|
|
16942
16942
|
width: auto !important;
|
|
16943
16943
|
}
|
|
16944
16944
|
|
|
16945
|
-
/* vanilla-extract-css-ns:src/components/FunInput/FunTextAreaInput.css.ts.vanilla.css?source=Ll8xcTl3czY1MCB7CiAgdHJhbnNpdGlvbjogYWxsIDE1MG1zIGN1YmljLWJlemllcigwLjMsIDAsIDAuMDYsIDEpOwp9 */
|
|
16946
|
-
[data-rk] ._1q9ws650 {
|
|
16947
|
-
transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
|
|
16948
|
-
}
|
|
16949
|
-
|
|
16950
16945
|
/* vanilla-extract-css-ns:src/css/touchableStyles.css.ts.vanilla.css?source=Ll83cmt1YmIzLC5fN3JrdWJiMzo6YWZ0ZXIgewogIC0tXzdya3ViYjA6IDE7CiAgLS1fN3JrdWJiMTogMTsKfQouXzdya3ViYjM6aG92ZXIgewogIHRyYW5zZm9ybTogc2NhbGUodmFyKC0tXzdya3ViYjApKTsKfQouXzdya3ViYjM6YWN0aXZlIHsKICB0cmFuc2Zvcm06IHNjYWxlKHZhcigtLV83cmt1YmIxKSk7Cn0KLl83cmt1YmIzOmFjdGl2ZTo6YWZ0ZXIgewogIGNvbnRlbnQ6ICIiOwogIGJvdHRvbTogLTFweDsKICBkaXNwbGF5OiBibG9jazsKICBsZWZ0OiAtMXB4OwogIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICByaWdodDogLTFweDsKICB0b3A6IC0xcHg7CiAgdHJhbnNmb3JtOiBzY2FsZShjYWxjKCgxIC8gdmFyKC0tXzdya3ViYjEpKSAqIHZhcigtLV83cmt1YmIwKSkpOwp9Ci5fN3JrdWJiNSwuXzdya3ViYjU6OmFmdGVyIHsKICAtLV83cmt1YmIwOiAxOwogIC0tXzdya3ViYjE6IDE7Cn0KLl83cmt1YmI1OmhvdmVyIHsKICBmaWx0ZXI6IGJyaWdodG5lc3MoMC44KTsKfQouXzdya3ViYjU6YWN0aXZlOjphZnRlciB7CiAgZmlsdGVyOiBicmlnaHRuZXNzKDAuOCk7Cn0KLl83cmt1YmI2LC5fN3JrdWJiNjo6YWZ0ZXIgewogIC0tXzdya3ViYjA6IDEuMDI1Owp9Ci5fN3JrdWJiNywuXzdya3ViYjc6OmFmdGVyIHsKICAtLV83cmt1YmIwOiAxLjE7Cn0KLl83cmt1YmI4LC5fN3JrdWJiODo6YWZ0ZXIgewogIC0tXzdya3ViYjE6IDAuOTU7Cn0KLl83cmt1YmI5LC5fN3JrdWJiOTo6YWZ0ZXIgewogIC0tXzdya3ViYjE6IDAuOTsKfQ */
|
|
16951
16946
|
[data-rk] ._7rkubb3,
|
|
16952
16947
|
[data-rk] ._7rkubb3::after {
|
package/dist/clients/lighter.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
AsyncImage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2NBYHUIW.js";
|
|
5
5
|
import {
|
|
6
6
|
useFunkitConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VT3ERWXE.js";
|
|
8
|
+
import {
|
|
9
|
+
Box
|
|
10
|
+
} from "./chunk-LUHEVXPD.js";
|
|
11
|
+
import "./chunk-UPZNKPYU.js";
|
|
8
12
|
import {
|
|
9
|
-
Box,
|
|
10
13
|
useFunkitTranslation
|
|
11
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-STLOQEN7.js";
|
|
12
15
|
import {
|
|
13
16
|
logger
|
|
14
17
|
} from "./chunk-AHYOV7AV.js";
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* verified on-chain (owner = the Fun deployer).
|
|
16
16
|
*/
|
|
17
17
|
import { type Address } from 'viem';
|
|
18
|
-
import type { FunkitCheckoutActionParams } from '../providers/FunkitCheckoutContext/types';
|
|
18
|
+
import type { FunkitCheckoutActionParams, TokenInfo, WalletWithdrawalConfig } from '../providers/FunkitCheckoutContext/types';
|
|
19
19
|
/** Mallard deposit contract to credit a Mallard (perps) account. */
|
|
20
20
|
export declare const MALLARD_DEPOSIT_ADDRESS: `0x${string}`;
|
|
21
21
|
/** VaultDepositooor on Zorro chain. */
|
|
@@ -47,3 +47,45 @@ export interface MallardDepositActionsConfig {
|
|
|
47
47
|
* ```
|
|
48
48
|
*/
|
|
49
49
|
export declare function createMallardDepositActions(config: MallardDepositActionsConfig): () => Promise<FunkitCheckoutActionParams[]>;
|
|
50
|
+
/** USDG (the perps/spot collateral token) on the Robinhood chain. */
|
|
51
|
+
export declare const MALLARD_USDG_ADDRESS: `0x${string}`;
|
|
52
|
+
/** USDG logo served from the Fun CDN. */
|
|
53
|
+
export declare const MALLARD_USDG_ICON_SRC = "https://sdk-cdn.fun.xyz/images/usdg.svg";
|
|
54
|
+
export interface MallardWithdrawalConfig {
|
|
55
|
+
/**
|
|
56
|
+
* Source token to withdraw. Defaults to USDG ({@link MALLARD_USDG_ADDRESS})
|
|
57
|
+
* on the Robinhood chain.
|
|
58
|
+
*/
|
|
59
|
+
sourceTokenAddress?: Address;
|
|
60
|
+
/** Source chain id. Defaults to the Robinhood mainnet chain. */
|
|
61
|
+
sourceChainId?: number;
|
|
62
|
+
/** Symbol shown for the source token. Defaults to `'USDG'`. */
|
|
63
|
+
sourceTokenSymbol?: string;
|
|
64
|
+
/** Title shown in the withdrawal modal. Defaults to the localized "Withdraw". */
|
|
65
|
+
modalTitle?: string;
|
|
66
|
+
/** Disable the connected-wallet option for email-login users. */
|
|
67
|
+
disableConnectedWallet?: boolean;
|
|
68
|
+
/** Token logo (50px). Defaults to {@link MALLARD_USDG_ICON_SRC}. */
|
|
69
|
+
iconSrc?: string;
|
|
70
|
+
/** Default token to preselect in the receive-token dropdown. */
|
|
71
|
+
defaultReceiveToken?: string;
|
|
72
|
+
/** Minimum USD value required to withdraw, evaluated per receive-token. */
|
|
73
|
+
getMinWithdrawalUSD?: (asset: TokenInfo) => number;
|
|
74
|
+
/** Maximum USD value allowed for a single withdrawal. */
|
|
75
|
+
getMaxWithdrawalUSD?: (asset: TokenInfo) => number;
|
|
76
|
+
/** Async hook fired after the withdraw CTA but before any wallet signature. */
|
|
77
|
+
onBeforeSign?: () => Promise<void> | void;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* React entry point for Mallard withdrawals. Returns a
|
|
81
|
+
* {@link WalletWithdrawalConfig} (executing wallet = the connected wallet, via
|
|
82
|
+
* {@link createConnectedWalletWithdrawalClient}), or `null` until a config is
|
|
83
|
+
* passed and a wallet is connected. Balance isn't read here — the modal sources
|
|
84
|
+
* it from the checkout config's `withdrawalSourceTokenBalance`, like
|
|
85
|
+
* Lighter/Polymarket.
|
|
86
|
+
*
|
|
87
|
+
* ```tsx
|
|
88
|
+
* const mallard = useMallardWithdrawalConfig(isConnected ? {} : null)
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare function useMallardWithdrawalConfig(config: MallardWithdrawalConfig | null): WalletWithdrawalConfig | null;
|
package/dist/clients/mallard.js
CHANGED
|
@@ -1,13 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
useAccount,
|
|
4
|
+
useConfig
|
|
5
|
+
} from "./chunk-UPZNKPYU.js";
|
|
6
|
+
import {
|
|
7
|
+
useFunkitTranslation
|
|
8
|
+
} from "./chunk-STLOQEN7.js";
|
|
9
|
+
import {
|
|
10
|
+
logger
|
|
11
|
+
} from "./chunk-AHYOV7AV.js";
|
|
2
12
|
|
|
3
13
|
// src/clients/mallard.tsx
|
|
14
|
+
import { ROBINHOOD_MAINNET_CHAIN_ID } from "@funkit/chains";
|
|
4
15
|
import { VAULT_DEPOSITOR_ABI } from "@funkit/fun-relay";
|
|
16
|
+
import { useMemo } from "react";
|
|
5
17
|
import {
|
|
6
18
|
encodeFunctionData,
|
|
7
|
-
erc20Abi,
|
|
19
|
+
erc20Abi as erc20Abi2,
|
|
8
20
|
getAddress,
|
|
9
21
|
maxUint256
|
|
10
22
|
} from "viem";
|
|
23
|
+
|
|
24
|
+
// src/wagmi/actions.ts
|
|
25
|
+
import { erc20Abi, formatUnits } from "viem";
|
|
26
|
+
import {
|
|
27
|
+
getBalance as getBalanceCore,
|
|
28
|
+
multicall as multicallCore
|
|
29
|
+
} from "wagmi/actions";
|
|
30
|
+
import {
|
|
31
|
+
estimateGas,
|
|
32
|
+
getAccount,
|
|
33
|
+
getGasPrice,
|
|
34
|
+
getTransaction,
|
|
35
|
+
getWalletClient,
|
|
36
|
+
multicall,
|
|
37
|
+
readContract,
|
|
38
|
+
sendTransaction,
|
|
39
|
+
switchChain,
|
|
40
|
+
waitForTransactionReceipt
|
|
41
|
+
} from "wagmi/actions";
|
|
42
|
+
|
|
43
|
+
// src/clients/mallard.tsx
|
|
11
44
|
var MALLARD_DEPOSIT_ADDRESS = getAddress(
|
|
12
45
|
"0xb272c91D84d6538C8F31ab092A53Bfe8916B5449"
|
|
13
46
|
);
|
|
@@ -62,7 +95,7 @@ function createMallardDepositActions(config) {
|
|
|
62
95
|
// that's only needed for USDT-style tokens that require zeroing allowance first; USDG
|
|
63
96
|
// is standard ERC-20.
|
|
64
97
|
{
|
|
65
|
-
contractAbi:
|
|
98
|
+
contractAbi: erc20Abi2,
|
|
66
99
|
contractAddress: token,
|
|
67
100
|
functionName: "approve",
|
|
68
101
|
functionArgs: [vaultDepositorAddress, maxUint256]
|
|
@@ -78,9 +111,85 @@ function createMallardDepositActions(config) {
|
|
|
78
111
|
];
|
|
79
112
|
};
|
|
80
113
|
}
|
|
114
|
+
var MALLARD_USDG_ADDRESS = getAddress(
|
|
115
|
+
"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"
|
|
116
|
+
);
|
|
117
|
+
var MALLARD_USDG_ICON_SRC = "https://sdk-cdn.fun.xyz/images/usdg.svg";
|
|
118
|
+
function createConnectedWalletWithdrawalClient(config, ownerAddress, sourceChainId) {
|
|
119
|
+
const ensureOnChain = async (chainId) => {
|
|
120
|
+
if (getAccount(config).chainId !== chainId) {
|
|
121
|
+
await switchChain(config, { chainId });
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
return {
|
|
125
|
+
address: () => ownerAddress,
|
|
126
|
+
getChainId: async () => sourceChainId,
|
|
127
|
+
switchChain: async (chainId) => {
|
|
128
|
+
await ensureOnChain(chainId);
|
|
129
|
+
},
|
|
130
|
+
sendTransaction: async (chainId, transaction) => {
|
|
131
|
+
await ensureOnChain(chainId);
|
|
132
|
+
return sendTransaction(config, {
|
|
133
|
+
to: transaction.to,
|
|
134
|
+
data: transaction.data,
|
|
135
|
+
value: BigInt(transaction.value || "0"),
|
|
136
|
+
chainId
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
confirmTransaction: (txHash, chainId) => (
|
|
140
|
+
// wagmi-core's receipt (chain-formatter generics) is the same runtime
|
|
141
|
+
// shape as viem's `TransactionReceipt` but isn't structurally assignable
|
|
142
|
+
// to it; cast at this boundary. Using wagmi (not a viem publicClient) is
|
|
143
|
+
// deliberate — it reuses the connected wallet's configured transport
|
|
144
|
+
// instead of requiring a separate RPC endpoint.
|
|
145
|
+
waitForTransactionReceipt(config, {
|
|
146
|
+
hash: txHash,
|
|
147
|
+
chainId
|
|
148
|
+
})
|
|
149
|
+
)
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function useMallardWithdrawalConfig(config) {
|
|
153
|
+
const { t } = useFunkitTranslation();
|
|
154
|
+
const wagmiConfig = useConfig();
|
|
155
|
+
const { address } = useAccount();
|
|
156
|
+
const sourceChainId = config?.sourceChainId ?? ROBINHOOD_MAINNET_CHAIN_ID;
|
|
157
|
+
const sourceTokenAddress = config?.sourceTokenAddress ?? MALLARD_USDG_ADDRESS;
|
|
158
|
+
return useMemo(() => {
|
|
159
|
+
if (!config || !address) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
const wallet = createConnectedWalletWithdrawalClient(
|
|
163
|
+
wagmiConfig,
|
|
164
|
+
address,
|
|
165
|
+
sourceChainId
|
|
166
|
+
);
|
|
167
|
+
logger.info("mallard:withdrawal:configBuilt", {
|
|
168
|
+
sourceChainId,
|
|
169
|
+
sourceTokenAddress,
|
|
170
|
+
owner: address
|
|
171
|
+
});
|
|
172
|
+
return {
|
|
173
|
+
modalTitle: config.modalTitle ?? t("withdrawal.withdraw"),
|
|
174
|
+
disableConnectedWallet: config.disableConnectedWallet,
|
|
175
|
+
onBeforeSign: config.onBeforeSign,
|
|
176
|
+
wallet,
|
|
177
|
+
sourceChainId: sourceChainId.toString(),
|
|
178
|
+
sourceTokenSymbol: config.sourceTokenSymbol ?? "USDG",
|
|
179
|
+
defaultReceiveToken: config.defaultReceiveToken,
|
|
180
|
+
sourceTokenAddress,
|
|
181
|
+
iconSrc: config.iconSrc ?? MALLARD_USDG_ICON_SRC,
|
|
182
|
+
getMinWithdrawalUSD: config.getMinWithdrawalUSD,
|
|
183
|
+
getMaxWithdrawalUSD: config.getMaxWithdrawalUSD
|
|
184
|
+
};
|
|
185
|
+
}, [config, address, wagmiConfig, sourceChainId, sourceTokenAddress, t]);
|
|
186
|
+
}
|
|
81
187
|
export {
|
|
82
188
|
AMOUNT_PLACEHOLDER,
|
|
83
189
|
MALLARD_DEPOSIT_ADDRESS,
|
|
190
|
+
MALLARD_USDG_ADDRESS,
|
|
191
|
+
MALLARD_USDG_ICON_SRC,
|
|
84
192
|
VAULT_DEPOSITOR_ZORRO,
|
|
85
|
-
createMallardDepositActions
|
|
193
|
+
createMallardDepositActions,
|
|
194
|
+
useMallardWithdrawalConfig
|
|
86
195
|
};
|
|
@@ -16864,11 +16864,6 @@
|
|
|
16864
16864
|
width: auto !important;
|
|
16865
16865
|
}
|
|
16866
16866
|
|
|
16867
|
-
/* vanilla-extract-css-ns:src/components/FunInput/FunTextAreaInput.css.ts.vanilla.css?source=Ll8xcTl3czY1MCB7CiAgdHJhbnNpdGlvbjogYWxsIDE1MG1zIGN1YmljLWJlemllcigwLjMsIDAsIDAuMDYsIDEpOwp9 */
|
|
16868
|
-
[data-rk] ._1q9ws650 {
|
|
16869
|
-
transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
|
|
16870
|
-
}
|
|
16871
|
-
|
|
16872
16867
|
/* vanilla-extract-css-ns:src/css/touchableStyles.css.ts.vanilla.css?source=Ll83cmt1YmIzLC5fN3JrdWJiMzo6YWZ0ZXIgewogIC0tXzdya3ViYjA6IDE7CiAgLS1fN3JrdWJiMTogMTsKfQouXzdya3ViYjM6aG92ZXIgewogIHRyYW5zZm9ybTogc2NhbGUodmFyKC0tXzdya3ViYjApKTsKfQouXzdya3ViYjM6YWN0aXZlIHsKICB0cmFuc2Zvcm06IHNjYWxlKHZhcigtLV83cmt1YmIxKSk7Cn0KLl83cmt1YmIzOmFjdGl2ZTo6YWZ0ZXIgewogIGNvbnRlbnQ6ICIiOwogIGJvdHRvbTogLTFweDsKICBkaXNwbGF5OiBibG9jazsKICBsZWZ0OiAtMXB4OwogIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICByaWdodDogLTFweDsKICB0b3A6IC0xcHg7CiAgdHJhbnNmb3JtOiBzY2FsZShjYWxjKCgxIC8gdmFyKC0tXzdya3ViYjEpKSAqIHZhcigtLV83cmt1YmIwKSkpOwp9Ci5fN3JrdWJiNSwuXzdya3ViYjU6OmFmdGVyIHsKICAtLV83cmt1YmIwOiAxOwogIC0tXzdya3ViYjE6IDE7Cn0KLl83cmt1YmI1OmhvdmVyIHsKICBmaWx0ZXI6IGJyaWdodG5lc3MoMC44KTsKfQouXzdya3ViYjU6YWN0aXZlOjphZnRlciB7CiAgZmlsdGVyOiBicmlnaHRuZXNzKDAuOCk7Cn0KLl83cmt1YmI2LC5fN3JrdWJiNjo6YWZ0ZXIgewogIC0tXzdya3ViYjA6IDEuMDI1Owp9Ci5fN3JrdWJiNywuXzdya3ViYjc6OmFmdGVyIHsKICAtLV83cmt1YmIwOiAxLjE7Cn0KLl83cmt1YmI4LC5fN3JrdWJiODo6YWZ0ZXIgewogIC0tXzdya3ViYjE6IDAuOTU7Cn0KLl83cmt1YmI5LC5fN3JrdWJiOTo6YWZ0ZXIgewogIC0tXzdya3ViYjE6IDAuOTsKfQ */
|
|
16873
16868
|
[data-rk] ._7rkubb3,
|
|
16874
16869
|
[data-rk] ._7rkubb3::after {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
PolymarketDepositAccountDropdown
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-4IWQ2UT5.js";
|
|
5
5
|
import "../chunk-ZEXZQOAO.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-VT3ERWXE.js";
|
|
7
|
+
import "../chunk-LUHEVXPD.js";
|
|
8
|
+
import "../chunk-UPZNKPYU.js";
|
|
9
|
+
import "../chunk-STLOQEN7.js";
|
|
10
|
+
import "../chunk-F4SCUKY6.js";
|
|
11
|
+
import "../chunk-O5CTDT3L.js";
|
|
10
12
|
import "../chunk-AHYOV7AV.js";
|
|
11
13
|
export {
|
|
12
14
|
PolymarketDepositAccountDropdown
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
POLYMARKET_PREDICTIONS_ROUTING_ID,
|
|
5
5
|
createPolymarketDepositConfig,
|
|
6
6
|
createPredictionsGenerateActionParams
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-F4SCUKY6.js";
|
|
8
|
+
import "../chunk-O5CTDT3L.js";
|
|
9
9
|
import "../chunk-AHYOV7AV.js";
|
|
10
10
|
export {
|
|
11
11
|
POLYMARKET_PERPS_ROUTING_ID,
|
|
@@ -16864,11 +16864,6 @@
|
|
|
16864
16864
|
width: auto !important;
|
|
16865
16865
|
}
|
|
16866
16866
|
|
|
16867
|
-
/* vanilla-extract-css-ns:src/components/FunInput/FunTextAreaInput.css.ts.vanilla.css?source=Ll8xcTl3czY1MCB7CiAgdHJhbnNpdGlvbjogYWxsIDE1MG1zIGN1YmljLWJlemllcigwLjMsIDAsIDAuMDYsIDEpOwp9 */
|
|
16868
|
-
[data-rk] ._1q9ws650 {
|
|
16869
|
-
transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
|
|
16870
|
-
}
|
|
16871
|
-
|
|
16872
16867
|
/* vanilla-extract-css-ns:src/css/touchableStyles.css.ts.vanilla.css?source=Ll83cmt1YmIzLC5fN3JrdWJiMzo6YWZ0ZXIgewogIC0tXzdya3ViYjA6IDE7CiAgLS1fN3JrdWJiMTogMTsKfQouXzdya3ViYjM6aG92ZXIgewogIHRyYW5zZm9ybTogc2NhbGUodmFyKC0tXzdya3ViYjApKTsKfQouXzdya3ViYjM6YWN0aXZlIHsKICB0cmFuc2Zvcm06IHNjYWxlKHZhcigtLV83cmt1YmIxKSk7Cn0KLl83cmt1YmIzOmFjdGl2ZTo6YWZ0ZXIgewogIGNvbnRlbnQ6ICIiOwogIGJvdHRvbTogLTFweDsKICBkaXNwbGF5OiBibG9jazsKICBsZWZ0OiAtMXB4OwogIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICByaWdodDogLTFweDsKICB0b3A6IC0xcHg7CiAgdHJhbnNmb3JtOiBzY2FsZShjYWxjKCgxIC8gdmFyKC0tXzdya3ViYjEpKSAqIHZhcigtLV83cmt1YmIwKSkpOwp9Ci5fN3JrdWJiNSwuXzdya3ViYjU6OmFmdGVyIHsKICAtLV83cmt1YmIwOiAxOwogIC0tXzdya3ViYjE6IDE7Cn0KLl83cmt1YmI1OmhvdmVyIHsKICBmaWx0ZXI6IGJyaWdodG5lc3MoMC44KTsKfQouXzdya3ViYjU6YWN0aXZlOjphZnRlciB7CiAgZmlsdGVyOiBicmlnaHRuZXNzKDAuOCk7Cn0KLl83cmt1YmI2LC5fN3JrdWJiNjo6YWZ0ZXIgewogIC0tXzdya3ViYjA6IDEuMDI1Owp9Ci5fN3JrdWJiNywuXzdya3ViYjc6OmFmdGVyIHsKICAtLV83cmt1YmIwOiAxLjE7Cn0KLl83cmt1YmI4LC5fN3JrdWJiODo6YWZ0ZXIgewogIC0tXzdya3ViYjE6IDAuOTU7Cn0KLl83cmt1YmI5LC5fN3JrdWJiOTo6YWZ0ZXIgewogIC0tXzdya3ViYjE6IDAuOTsKfQ */
|
|
16873
16868
|
[data-rk] ._7rkubb3,
|
|
16874
16869
|
[data-rk] ._7rkubb3::after {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
PolymarketDepositAccountDropdown
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-4IWQ2UT5.js";
|
|
5
5
|
import "../chunk-ZEXZQOAO.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-VT3ERWXE.js";
|
|
7
|
+
import "../chunk-LUHEVXPD.js";
|
|
8
|
+
import "../chunk-UPZNKPYU.js";
|
|
9
|
+
import "../chunk-STLOQEN7.js";
|
|
8
10
|
import {
|
|
9
11
|
POLYMARKET_PERPS_ROUTING_ID,
|
|
10
12
|
POLYMARKET_PREDICTIONS_ROUTING_ID,
|
|
11
13
|
createPolymarketDepositConfig,
|
|
12
14
|
createPredictionsGenerateActionParams
|
|
13
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-F4SCUKY6.js";
|
|
14
16
|
import {
|
|
15
17
|
AMOUNT_PLACEHOLDER,
|
|
16
18
|
COLLATERAL_ONRAMP_ABI,
|
|
@@ -21,7 +23,7 @@ import {
|
|
|
21
23
|
VAULT_DEPOSITOR_POLYGON,
|
|
22
24
|
createPerpsGenerateActionParams,
|
|
23
25
|
createPolymarketWithdrawalConfig
|
|
24
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-O5CTDT3L.js";
|
|
25
27
|
import "../chunk-AHYOV7AV.js";
|
|
26
28
|
export {
|
|
27
29
|
AMOUNT_PLACEHOLDER,
|
|
@@ -4,7 +4,6 @@ interface FunCheckoutHistoryContentProps {
|
|
|
4
4
|
depositAddress: `0x${string}`;
|
|
5
5
|
currentPage: HistoryContentPages;
|
|
6
6
|
onHelp: () => void;
|
|
7
|
-
onBackFromHelpPage: () => void;
|
|
8
7
|
onClose: (opt?: {
|
|
9
8
|
isNewDeposit?: boolean;
|
|
10
9
|
}) => void;
|
|
@@ -13,5 +12,5 @@ interface FunCheckoutHistoryContentProps {
|
|
|
13
12
|
bottomBarId: string;
|
|
14
13
|
isActiveCheckout: boolean;
|
|
15
14
|
}
|
|
16
|
-
export declare function FunCheckoutHistoryContent({ bottomBarId, currentPage, depositAddress, isActiveCheckout, onAnimationComplete,
|
|
15
|
+
export declare function FunCheckoutHistoryContent({ bottomBarId, currentPage, depositAddress, isActiveCheckout, onAnimationComplete, onClose, onHelp, }: FunCheckoutHistoryContentProps): React.JSX.Element;
|
|
17
16
|
export {};
|
|
@@ -11,6 +11,7 @@ interface PaymentAmountSummaryProps {
|
|
|
11
11
|
directExecutionType?: DirectExecutionType | null;
|
|
12
12
|
/** Mode-aware display amounts from QuoteBuilder.getDisplayAmounts() */
|
|
13
13
|
displayAmounts?: QuoteDisplayAmounts | null;
|
|
14
|
+
isDirectTransfer?: boolean;
|
|
14
15
|
}
|
|
15
|
-
export declare function PaymentAmountSummary({ isLoading, targetChainId: originalChainId, quote, checkoutItem, directExecutionType, displayAmounts, }: PaymentAmountSummaryProps): React.JSX.Element;
|
|
16
|
+
export declare function PaymentAmountSummary({ isLoading, targetChainId: originalChainId, quote, checkoutItem, directExecutionType, displayAmounts, isDirectTransfer, }: PaymentAmountSummaryProps): React.JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -33,6 +33,27 @@ export interface HistoricalCheckoutItem extends Pick<FunkitActiveCheckoutItem, H
|
|
|
33
33
|
};
|
|
34
34
|
isWithdrawal?: boolean;
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Build the checkout config for a deposit re-started from history (the
|
|
38
|
+
* "New deposit" CTA). Serialized history can't carry closures, so every
|
|
39
|
+
* function-valued field is only restorable from the live config:
|
|
40
|
+
* - candidates' per-route `generateActionsParams` (and `finalizedToken`) are
|
|
41
|
+
* stripped on serialize, so the still-active checkout takes the
|
|
42
|
+
* function-bearing candidates from `liveConfig` — otherwise a destination
|
|
43
|
+
* switch would re-bind `dynamicRoutingId` without its post-action; a
|
|
44
|
+
* non-active historical checkout has no live closures, so it keeps the
|
|
45
|
+
* stripped candidates;
|
|
46
|
+
* - `modalTitle` is restored whenever a live config exists (falling back to the
|
|
47
|
+
* serializable value) so validation passes;
|
|
48
|
+
* - the remaining live-only closures (`getMinDepositUSD`,
|
|
49
|
+
* `generateActionsParams`, `polymarketPerpsTransfer`, `resolveHealthFactor`)
|
|
50
|
+
* are carried forward only when re-starting the still-active checkout.
|
|
51
|
+
*/
|
|
52
|
+
export declare function createNewCheckoutConfig({ serializedConfig, liveConfig, isActiveCheckout, }: {
|
|
53
|
+
serializedConfig: ServerCheckoutConfig;
|
|
54
|
+
liveConfig: FunkitCheckoutConfig | undefined;
|
|
55
|
+
isActiveCheckout: boolean;
|
|
56
|
+
}): FunkitCheckoutConfig;
|
|
36
57
|
/**
|
|
37
58
|
* Sanitizes checkoutItem to generate a clientMetadata object to be saved in backend.
|
|
38
59
|
* Ensures that no react components get sent to backend and the object isn't too big as well.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DynamicTargetAssetCandidate } from '../providers/FunkitCheckoutContext';
|
|
2
|
+
export declare function isXStockTargetAsset(asset: DynamicTargetAssetCandidate | undefined): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Strip the trailing display qualifier from a Nado ticker, e.g.
|
|
5
|
+
* "SPYx (Spot)" → "SPYx", to recover the symbol the xStocks API expects.
|
|
6
|
+
*
|
|
7
|
+
* todo: we should have a displaySymbol vs tokenSymbol property on the DynamicTargetAssetCandidate
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseXstocksSymbolFromTicker(ticker: string): string;
|
|
@@ -19,7 +19,6 @@ export declare enum CheckoutModalEvent {
|
|
|
19
19
|
NAVIGATE_KYC_IFRAME = "fc::navigate::kyc_iframe",
|
|
20
20
|
NAVIGATE_CREATE_FIAT_ACCOUNT = "fc::navigate::create_fiat_account",
|
|
21
21
|
NAVIGATE_LOADING_ACCOUNT = "fc::navigate::loading_account",
|
|
22
|
-
NAVIGATE_CHECKOUT_HELP = "fc::navigate::checkout_help",
|
|
23
22
|
NAVIGATE_SELECT_BROKERAGE = "fc::navigate::select_brokerage",
|
|
24
23
|
NAVIGATE_CONNECT_EXCHANGE = "fc::navigate::connect_exchange",
|
|
25
24
|
NAVIGATE_BROKERAGE_TWO_FA = "fc::navigate::brokerage_two_fa",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads one ERC-20 holding (balance + best-effort USD price) on-chain.
|
|
3
|
+
*
|
|
4
|
+
* - For tokens the wallet-assets API doesn't index, so they still appear as a
|
|
5
|
+
* payable source. Caller owns customer/flow gating.
|
|
6
|
+
* - Fails soft: a read failure drops the row, a price failure keeps it price-less
|
|
7
|
+
* — a flaky RPC never blocks the list.
|
|
8
|
+
*/
|
|
9
|
+
import { type Address } from 'viem';
|
|
10
|
+
import type { AssetHoldingsItem } from '../domains/wallet';
|
|
11
|
+
export type GetAssetHoldingsFromRpcParams = {
|
|
12
|
+
/** Chain to read on, as a string chain id (e.g. "57073"). */
|
|
13
|
+
chainId: string | undefined;
|
|
14
|
+
/** ERC-20 token address to read the balance of. */
|
|
15
|
+
tokenAddress: Address | undefined;
|
|
16
|
+
/** Holder address whose balance to read. */
|
|
17
|
+
walletAddress: Address | undefined;
|
|
18
|
+
/** Symbol to label the holding with — `symbol()` is never read on-chain. */
|
|
19
|
+
symbolHint?: string;
|
|
20
|
+
iconSrc?: string;
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare function useGetAssetHoldingsFromRpc({ chainId, tokenAddress, walletAddress, symbolHint, iconSrc, enabled, }: GetAssetHoldingsFromRpcParams): import("@tanstack/react-query").UseQueryResult<AssetHoldingsItem | null, Error>;
|