@funkit/connect 9.19.1 → 9.21.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 +59 -0
- package/dist/{chunk-PFIXC5YK.js → chunk-36KVHK22.js} +5 -2
- package/dist/{chunk-6K4U3Z4Z.js → chunk-4YEAUICE.js} +5 -0
- package/dist/{chunk-NBECXHBY.js → chunk-67BKQQNG.js} +5 -2
- package/dist/clients/argentWallet-2WSTOUAO.js +7 -0
- package/dist/clients/bifrostWallet-5NQVDZ5P.js +7 -0
- package/dist/clients/bitgetWallet-CBQAJOIK.js +7 -0
- package/dist/clients/bitskiWallet-OLIYN3IU.js +7 -0
- package/dist/clients/bitverseWallet-AQMAJ2NN.js +7 -0
- package/dist/clients/bloomWallet-MJRQJYSG.js +7 -0
- package/dist/clients/braveWallet-T76TVZA6.js +7 -0
- package/dist/clients/bybitWallet-GOPAS32Q.js +7 -0
- package/dist/clients/chunk-4752IYY6.js +94 -0
- package/dist/clients/chunk-52NKHZS2.js +69 -0
- package/dist/clients/chunk-KSSSSWR6.js +54 -0
- package/dist/clients/{polymarket.js → chunk-MOUTRRN3.js} +12 -4
- package/dist/clients/chunk-MRBN4XCA.js +96 -0
- package/dist/clients/chunk-NCCAYPLO.js +230 -0
- package/dist/clients/chunk-OWXKWC7I.js +2382 -0
- package/dist/clients/chunk-ZMVXBMON.js +186 -0
- package/dist/clients/clvWallet-VVMLP7BK.js +7 -0
- package/dist/clients/coin98Wallet-I5CP5KYZ.js +7 -0
- package/dist/clients/coinbaseWallet-ICYEIYQD.js +7 -0
- package/dist/clients/coreWallet-RFVUHOVE.js +7 -0
- package/dist/clients/dawnWallet-QBFTQLS4.js +7 -0
- package/dist/clients/desigWallet-IBKYOHSY.js +7 -0
- package/dist/clients/enkryptWallet-ZVUZMI7H.js +7 -0
- package/dist/clients/fanatics.css +2891 -2702
- package/dist/clients/fanatics.js +43 -84
- package/dist/clients/foxWallet-I7D5KIW4.js +7 -0
- package/dist/clients/frameWallet-UDD4OVZX.js +7 -0
- package/dist/clients/frontierWallet-5QV7ZACT.js +7 -0
- package/dist/clients/gateWallet-CJNGQQCV.js +7 -0
- package/dist/clients/imTokenWallet-UPA7ADZ2.js +7 -0
- package/dist/clients/injectedWallet-OIRJSVBZ.js +7 -0
- package/dist/clients/kresusWallet-7ROCNWAU.js +7 -0
- package/dist/clients/ledgerWallet-3FCEIKPD.js +7 -0
- package/dist/clients/lighter.css +2891 -2702
- package/dist/clients/lighter.js +9 -179
- package/dist/clients/metaMaskWallet-RMHEKBDR.js +7 -0
- package/dist/clients/mewWallet-ANFGVCZT.js +7 -0
- package/dist/clients/nado.d.ts +78 -0
- package/dist/clients/nado.js +107 -0
- package/dist/clients/oktoWallet-Q5XCEOTD.js +7 -0
- package/dist/clients/okxWallet-GJMKZIND.js +7 -0
- package/dist/clients/omniWallet-YH4FEL6J.js +7 -0
- package/dist/clients/oneInchWallet-4S73ZPPN.js +7 -0
- package/dist/clients/oneKeyWallet-YVJDPHJS.js +7 -0
- package/dist/clients/phantomWallet-LZDJJ5XR.js +7 -0
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +17485 -0
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.d.ts +30 -0
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +14 -0
- package/dist/clients/polymarket/createPolymarketDepositConfig.d.ts +54 -0
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +15 -0
- package/dist/clients/polymarket/index.css +17485 -0
- package/dist/clients/polymarket/index.d.ts +8 -0
- package/dist/clients/polymarket/index.js +42 -0
- package/dist/clients/{polymarket.d.ts → polymarket/polymarket.d.ts} +59 -2
- package/dist/clients/polymarket/polymarket.js +24 -0
- package/dist/clients/polymarket/usePolymarketAccountBalances.d.ts +66 -0
- package/dist/clients/polymarket/usePolymarketAccountBalances.js +12 -0
- package/dist/clients/rabbyWallet-TYX2JDHU.js +7 -0
- package/dist/clients/rainbowWallet-MFJQCICF.js +7 -0
- package/dist/clients/ramperWallet-Q2XAH4WA.js +7 -0
- package/dist/clients/rolly.d.ts +2 -0
- package/dist/clients/rolly.js +6 -2
- package/dist/clients/roninWallet-SAB5ESVK.js +7 -0
- package/dist/clients/safeWallet-Y3VPODK2.js +7 -0
- package/dist/clients/safeheronWallet-MCFXLKO5.js +7 -0
- package/dist/clients/safepalWallet-7YULGM2L.js +7 -0
- package/dist/clients/subWallet-5WUZ4IIO.js +7 -0
- package/dist/clients/tahoWallet-U2VWWO76.js +7 -0
- package/dist/clients/talismanWallet-ZYTPIANG.js +7 -0
- package/dist/clients/tokenPocketWallet-FLFG3JUQ.js +7 -0
- package/dist/clients/tokenaryWallet-S3JS2IGK.js +7 -0
- package/dist/clients/trustWallet-2N5TZJGC.js +7 -0
- package/dist/clients/uniswapWallet-NJQBP5VM.js +7 -0
- package/dist/clients/walletConnectWallet-E4OQJ4DC.js +7 -0
- package/dist/clients/xdefiWallet-ZKBEFEOH.js +7 -0
- package/dist/clients/zealWallet-7VO3C4PM.js +7 -0
- package/dist/clients/zerionWallet-SEPREHKH.js +7 -0
- package/dist/components/Box/Box.d.ts +21 -21
- package/dist/components/Dropdown/AccountSelectDropdown.d.ts +45 -0
- package/dist/components/Dropdown/BaseDropdownItem.d.ts +3 -1
- package/dist/components/FreeUsdcBanner/FreeUsdcBanner.css.d.ts +15 -0
- package/dist/components/FreeUsdcBanner/FreeUsdcBanner.d.ts +5 -5
- package/dist/components/FunButton/FunButton.css.d.ts +1 -0
- package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
- package/dist/components/ModalHeightAnimationLayer/ModalHeightAnimationLayer.d.ts +8 -0
- package/dist/css/sprinkles.css.d.ts +33 -21
- package/dist/domains/aave.d.ts +28 -0
- package/dist/domains/dynamicRouting.d.ts +13 -1
- package/dist/domains/quote.d.ts +2 -2
- package/dist/hooks/track/CheckoutModalEvent.d.ts +1 -0
- package/dist/hooks/useExchangeOptions.d.ts +11 -2
- package/dist/hooks/useTokenAndChainDropdown.d.ts +1 -1
- package/dist/index.css +4289 -2860
- package/dist/index.js +4434 -3375
- package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +2 -1
- package/dist/modals/CheckoutModal/InputAmount/aaveClient.d.ts +3 -7
- package/dist/modals/CheckoutModal/InputAmount/useAaveNativeSupply.d.ts +2 -19
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +1 -1
- package/dist/modals/CheckoutModal/SourceChange/useSourceChangeLayout.d.ts +10 -0
- package/dist/modals/CheckoutModal/stepTransition.d.ts +27 -1
- package/dist/modals/PolymarketPerpsTransfer/DirectionSwapButton.d.ts +17 -0
- package/dist/modals/PolymarketPerpsTransfer/PerpsTransferBottomBar.d.ts +11 -0
- package/dist/modals/PolymarketPerpsTransfer/PerpsTransferRows.d.ts +10 -0
- package/dist/modals/PolymarketPerpsTransfer/PerpsTransferStep.d.ts +11 -0
- package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsTransferScreen.d.ts +52 -0
- package/dist/modals/PolymarketPerpsTransfer/TransferActionButton.d.ts +34 -0
- package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.css.d.ts +13 -0
- package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.d.ts +27 -0
- package/dist/modals/PolymarketPerpsTransfer/usePerpsTransferForm.d.ts +66 -0
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +7 -0
- package/dist/providers/FunkitCheckoutContext/index.d.ts +10 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +63 -3
- package/dist/providers/FunkitConfigContext.d.ts +13 -2
- package/dist/providers/FunkitQuoteContext.d.ts +16 -0
- package/dist/providers/FunkitThemeProvider.d.ts +18 -0
- package/dist/themes/baseTheme.d.ts +3 -1
- package/dist/themes/baseTheme.js +1 -1
- package/dist/themes/darkTheme.js +2 -2
- package/dist/themes/lightTheme.js +2 -2
- package/dist/utils/freeUsdcBanner.d.ts +3 -0
- package/dist/utils/tokenMath.d.ts +6 -0
- package/dist/wallets/walletConnectors/index.js +42 -42
- package/package.json +7 -6
- package/dist/clients/chunk-TFZV2HO4.js +0 -290
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SourceChangeTopComponentProps } from '../../modals/CheckoutModal/stepTransition';
|
|
3
|
+
import { type PolymarketAccount } from './createPolymarketDepositConfig';
|
|
4
|
+
/** The account fields the picker needs: address + its live balance getter. */
|
|
5
|
+
export type PolymarketAccountDisplay = Pick<PolymarketAccount, 'address' | 'getBalanceUsd'>;
|
|
6
|
+
export interface PolymarketDepositAccountDropdownProps extends Partial<SourceChangeTopComponentProps> {
|
|
7
|
+
/** Predictions account (the user's predictions proxy). */
|
|
8
|
+
predictions: PolymarketAccountDisplay;
|
|
9
|
+
/** Perps account. */
|
|
10
|
+
perps: PolymarketAccountDisplay;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Polymarket "Deposit to" account picker, shown on top of the source-change
|
|
14
|
+
* screen via `uiCustomizations.sourceChangeScreen.customTopComponent`. Lets the
|
|
15
|
+
* user pick which account to deposit into (Predictions / Perps); the "Transfer
|
|
16
|
+
* between accounts" action navigates the checkout modal to the perps transfer
|
|
17
|
+
* step (`FunCheckoutStep.PERPS_TRANSFER`) via the modal's own step transition,
|
|
18
|
+
* so it animates and supports Back like any other step.
|
|
19
|
+
*
|
|
20
|
+
* Balances are live: predictions reads the pUSD balance of the predictions
|
|
21
|
+
* proxy; perps reads the perps account value, minting a perps proxy (one-time
|
|
22
|
+
* wallet signature) on first use. They load through {@link usePolymarketAccountBalances}
|
|
23
|
+
* — a shared cache keyed by address — so the balance the picker fetches is the
|
|
24
|
+
* same one the transfer step reads on navigation (no reload flash).
|
|
25
|
+
*
|
|
26
|
+
* The integrator supplies the predictions and perps accounts (address + live
|
|
27
|
+
* balance getter). Selecting one points the checkout at it; "Transfer between
|
|
28
|
+
* accounts" opens the perps transfer step.
|
|
29
|
+
*/
|
|
30
|
+
export declare function PolymarketDepositAccountDropdown({ onStepChange, modalState, dynamicRoutingId, applyDynamicTargetAssetCandidate, predictions, perps, }: PolymarketDepositAccountDropdownProps): React.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
PolymarketDepositAccountDropdown
|
|
4
|
+
} from "../chunk-OWXKWC7I.js";
|
|
5
|
+
import "../chunk-MRBN4XCA.js";
|
|
6
|
+
import "../chunk-KSSSSWR6.js";
|
|
7
|
+
import "../chunk-ZMVXBMON.js";
|
|
8
|
+
import "../chunk-52NKHZS2.js";
|
|
9
|
+
import "../chunk-4752IYY6.js";
|
|
10
|
+
import "../chunk-MOUTRRN3.js";
|
|
11
|
+
import "../chunk-UUHGOBKZ.js";
|
|
12
|
+
export {
|
|
13
|
+
PolymarketDepositAccountDropdown
|
|
14
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { FunkitCheckoutActionParams, FunkitCheckoutConfig, PolymarketTransferAccount } from '../../providers/FunkitCheckoutContext/types';
|
|
2
|
+
import { type PolymarketPerpsDepositConfig } from './polymarket';
|
|
3
|
+
/**
|
|
4
|
+
* Routing ids that select the deposit destination. The deposit dropdown writes
|
|
5
|
+
* the chosen id to `config.dynamicRoutingId`; the combined
|
|
6
|
+
* {@link createPolymarketDepositConfig} reads it to build the right deposit
|
|
7
|
+
* (predictions vs perps) within a single checkout.
|
|
8
|
+
*/
|
|
9
|
+
export declare const POLYMARKET_PREDICTIONS_ROUTING_ID = "POLYMARKET_PREDICTIONS";
|
|
10
|
+
export declare const POLYMARKET_PERPS_ROUTING_ID = "POLYMARKET_PERPS";
|
|
11
|
+
/**
|
|
12
|
+
* Builds the `generateActionsParams` for a Polymarket *Predictions* deposit:
|
|
13
|
+
* wrap USDC.e → pUSD into the predictions proxy via the CollateralOnramp,
|
|
14
|
+
* mediated by the VaultDepositor so it composes with EXACT_INPUT quoting (the
|
|
15
|
+
* VaultDepositor pulls msg.sender's full balance and substitutes
|
|
16
|
+
* AMOUNT_PLACEHOLDER at exec time).
|
|
17
|
+
*/
|
|
18
|
+
export declare function createPredictionsGenerateActionParams(config: PolymarketPerpsDepositConfig): () => Promise<FunkitCheckoutActionParams[]>;
|
|
19
|
+
/**
|
|
20
|
+
* A Polymarket account in the deposit picker / transfer step — the same
|
|
21
|
+
* integrator-owned shape the transfer step consumes (address, min-topup,
|
|
22
|
+
* transfer, live balance getter; see {@link PolymarketTransferAccount}).
|
|
23
|
+
* Both accounts share it, so each transfer direction is symmetrical.
|
|
24
|
+
*/
|
|
25
|
+
export type PolymarketAccount = PolymarketTransferAccount;
|
|
26
|
+
export interface CreatePolymarketDepositConfigParams {
|
|
27
|
+
/** Predictions account (the user's predictions proxy). */
|
|
28
|
+
predictions: PolymarketAccount;
|
|
29
|
+
/** Perps account. */
|
|
30
|
+
perps: PolymarketAccount;
|
|
31
|
+
/** Optional subtitle under the modal title, e.g. a balance line. */
|
|
32
|
+
modalTitleMeta?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Optional per-destination modal title overrides. When omitted, the title
|
|
35
|
+
* follows the selected destination: "Deposit (Predictions)" /
|
|
36
|
+
* "Deposit (Perps)".
|
|
37
|
+
*/
|
|
38
|
+
modalTitles?: {
|
|
39
|
+
predictions?: string;
|
|
40
|
+
perps?: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Account preselected in the "Deposit to" dropdown when the modal opens.
|
|
44
|
+
* The user can still switch via the dropdown. Defaults to `'predictions'`.
|
|
45
|
+
*/
|
|
46
|
+
defaultAccount?: 'predictions' | 'perps';
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Builds the entire Polymarket deposit checkout config from the two accounts.
|
|
50
|
+
* The "Deposit to" dropdown switches `dynamicRoutingId`; modal title, min
|
|
51
|
+
* deposit, recipient and on-chain deposit actions are derived per account.
|
|
52
|
+
* Integrators call this and render {@link PolymarketDepositAccountDropdown}.
|
|
53
|
+
*/
|
|
54
|
+
export declare function createPolymarketDepositConfig({ predictions, perps, modalTitleMeta, modalTitles, defaultAccount, }: CreatePolymarketDepositConfigParams): FunkitCheckoutConfig;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
POLYMARKET_PERPS_ROUTING_ID,
|
|
4
|
+
POLYMARKET_PREDICTIONS_ROUTING_ID,
|
|
5
|
+
createPolymarketDepositConfig,
|
|
6
|
+
createPredictionsGenerateActionParams
|
|
7
|
+
} from "../chunk-4752IYY6.js";
|
|
8
|
+
import "../chunk-MOUTRRN3.js";
|
|
9
|
+
import "../chunk-UUHGOBKZ.js";
|
|
10
|
+
export {
|
|
11
|
+
POLYMARKET_PERPS_ROUTING_ID,
|
|
12
|
+
POLYMARKET_PREDICTIONS_ROUTING_ID,
|
|
13
|
+
createPolymarketDepositConfig,
|
|
14
|
+
createPredictionsGenerateActionParams
|
|
15
|
+
};
|