@funkit/connect 10.1.0-next.0 → 10.1.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 +8 -1
- package/dist/clients/{chunk-ETB2YYFT.js → chunk-2NBYHUIW.js} +1 -1
- package/dist/clients/{chunk-JNZY3GAA.js → chunk-E3USJY7A.js} +1 -1
- package/dist/clients/{chunk-HD4Y4NKC.js → chunk-ZAXSDMDU.js} +2 -2
- package/dist/clients/fanatics.css +1 -1
- package/dist/clients/fanatics.js +2 -2
- package/dist/clients/lighter.css +11 -11
- package/dist/clients/lighter.js +3 -3
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +11 -11
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +3 -3
- package/dist/clients/polymarket/index.css +11 -11
- package/dist/clients/polymarket/index.js +3 -3
- package/dist/index.css +11 -11
- package/dist/index.js +73 -86
- package/dist/utils/checkout.d.ts +1 -1
- package/dist/wallets/walletConnectors/index.js +46 -46
- package/package.json +4 -4
- package/dist/clients/chunk-42XZD2Y3.js +0 -1112
- package/dist/clients/chunk-5UIZBNLC.js +0 -1175
- package/dist/clients/chunk-BO7AZVPG.js +0 -1112
- package/dist/clients/chunk-BUCJRBW7.js +0 -1472
- package/dist/clients/chunk-ME4OAQIY.js +0 -696
- package/dist/clients/chunk-PEVDOGEA.js +0 -109
- package/dist/clients/chunk-QIWGVVAW.js +0 -1113
- package/dist/clients/chunk-VJZW3MA3.js +0 -94
- package/dist/clients/chunk-WEETVC7U.js +0 -1113
- package/dist/clients/chunk-Y2KXVS36.js +0 -230
- package/dist/clients/polymarket/usePolymarketAccountBalances.d.ts +0 -66
- package/dist/hooks/useIsTokenWhitelisted.d.ts +0 -30
- package/dist/modals/CheckoutModal/buildRelayChains.d.ts +0 -12
- package/dist/providers/FunkitFlagsProvider.d.ts +0 -26
- package/dist/utils/flags/config.d.ts +0 -333
- package/dist/utils/flags/endpoint.d.ts +0 -22
- package/dist/utils/flags/hash.d.ts +0 -13
- package/dist/utils/flags/impl.d.ts +0 -10
- package/dist/utils/flags/types.d.ts +0 -49
- package/dist/wallets/walletConnectors/chunk-2VP2F6EK.js +0 -70
- package/dist/wallets/walletConnectors/chunk-4T6ZSRJF.js +0 -69
- package/dist/wallets/walletConnectors/chunk-6BW3HLBG.js +0 -96
- package/dist/wallets/walletConnectors/chunk-CCQV2ZET.js +0 -218
- package/dist/wallets/walletConnectors/chunk-CPI4TD43.js +0 -99
- package/dist/wallets/walletConnectors/chunk-F5XEEVG6.js +0 -98
- package/dist/wallets/walletConnectors/chunk-HNRB7KJU.js +0 -92
- package/dist/wallets/walletConnectors/chunk-HTHAK6XB.js +0 -93
- package/dist/wallets/walletConnectors/chunk-MIQTHJ6X.js +0 -66
- package/dist/wallets/walletConnectors/chunk-RB3HR4R2.js +0 -95
- package/dist/wallets/walletConnectors/chunk-RVOY537T.js +0 -100
- package/dist/wallets/walletConnectors/chunk-STVVP43G.js +0 -94
- package/dist/wallets/walletConnectors/chunk-UK7C2JXW.js +0 -87
- package/dist/wallets/walletConnectors/chunk-VAPGUPHO.js +0 -92
- package/dist/wallets/walletConnectors/chunk-VTM6EECM.js +0 -110
- package/dist/wallets/walletConnectors/chunk-X6CGV36L.js +0 -103
- package/dist/wallets/walletConnectors/chunk-YEZM4CK4.js +0 -96
- package/dist/wallets/walletConnectors/chunk-ZNX4EMPB.js +0 -106
- /package/dist/clients/{chunk-HMP3LHMW.js → chunk-LUHEVXPD.js} +0 -0
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
AMOUNT_PLACEHOLDER,
|
|
4
|
-
COLLATERAL_ONRAMP_ABI,
|
|
5
|
-
COLLATERAL_ONRAMP_ADDRESS,
|
|
6
|
-
POLYGON_USDCE,
|
|
7
|
-
PUSD_TOKEN,
|
|
8
|
-
VAULT_DEPOSITOR_ABI,
|
|
9
|
-
VAULT_DEPOSITOR_POLYGON,
|
|
10
|
-
createPerpsGenerateActionParams
|
|
11
|
-
} from "./chunk-ME4OAQIY.js";
|
|
12
|
-
|
|
13
|
-
// src/clients/polymarket/createPolymarketDepositConfig.ts
|
|
14
|
-
import { encodeFunctionData, erc20Abi, maxUint256 } from "viem";
|
|
15
|
-
import { polygon } from "viem/chains";
|
|
16
|
-
var POLYMARKET_PREDICTIONS_ROUTING_ID = "POLYMARKET_PREDICTIONS";
|
|
17
|
-
var POLYMARKET_PERPS_ROUTING_ID = "POLYMARKET_PERPS";
|
|
18
|
-
function createPredictionsGenerateActionParams(config) {
|
|
19
|
-
const { recipientAddress } = config;
|
|
20
|
-
return async () => {
|
|
21
|
-
const wrapUsdceToPusd = encodeFunctionData({
|
|
22
|
-
abi: COLLATERAL_ONRAMP_ABI,
|
|
23
|
-
functionName: "wrap",
|
|
24
|
-
args: [POLYGON_USDCE, recipientAddress, AMOUNT_PLACEHOLDER]
|
|
25
|
-
});
|
|
26
|
-
return [
|
|
27
|
-
// Approve USDC.e to the VaultDepositor (infinite).
|
|
28
|
-
{
|
|
29
|
-
contractAbi: erc20Abi,
|
|
30
|
-
contractAddress: POLYGON_USDCE,
|
|
31
|
-
functionName: "approve",
|
|
32
|
-
functionArgs: [VAULT_DEPOSITOR_POLYGON, maxUint256]
|
|
33
|
-
},
|
|
34
|
-
// VaultDepositor pulls the USDC.e and forwards to CollateralOnramp.wrap,
|
|
35
|
-
// minting pUSD to the predictions proxy.
|
|
36
|
-
{
|
|
37
|
-
contractAbi: VAULT_DEPOSITOR_ABI,
|
|
38
|
-
contractAddress: VAULT_DEPOSITOR_POLYGON,
|
|
39
|
-
functionName: "deposit",
|
|
40
|
-
functionArgs: [
|
|
41
|
-
POLYGON_USDCE,
|
|
42
|
-
COLLATERAL_ONRAMP_ADDRESS,
|
|
43
|
-
wrapUsdceToPusd,
|
|
44
|
-
0n
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
];
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
var PERPS_MIN_DEPOSIT_USD = 10;
|
|
51
|
-
function createPolymarketDepositConfig({
|
|
52
|
-
predictions,
|
|
53
|
-
perps,
|
|
54
|
-
modalTitleMeta,
|
|
55
|
-
modalTitles,
|
|
56
|
-
defaultAccount = "predictions"
|
|
57
|
-
}) {
|
|
58
|
-
const isPerpsRoute = (routingId) => routingId === POLYMARKET_PERPS_ROUTING_ID;
|
|
59
|
-
const defaultsToPerps = defaultAccount === "perps";
|
|
60
|
-
return {
|
|
61
|
-
targetChain: polygon.id.toString(),
|
|
62
|
-
targetAsset: POLYGON_USDCE,
|
|
63
|
-
targetAssetAmount: 0,
|
|
64
|
-
targetAssetTicker: PUSD_TOKEN.symbol,
|
|
65
|
-
checkoutItemTitle: PUSD_TOKEN.symbol,
|
|
66
|
-
iconSrc: PUSD_TOKEN.iconSrc,
|
|
67
|
-
modalTitleMeta,
|
|
68
|
-
// The preselected destination (the "Deposit to" dropdown derives its
|
|
69
|
-
// selection from `dynamicRoutingId`, so both fields must agree).
|
|
70
|
-
dynamicRoutingId: defaultsToPerps ? POLYMARKET_PERPS_ROUTING_ID : POLYMARKET_PREDICTIONS_ROUTING_ID,
|
|
71
|
-
customRecipient: defaultsToPerps ? perps.address : predictions.address,
|
|
72
|
-
modalTitle: ({ dynamicRoutingId }) => isPerpsRoute(dynamicRoutingId) ? modalTitles?.perps ?? "Deposit (Perps)" : modalTitles?.predictions ?? "Deposit (Predictions)",
|
|
73
|
-
getMinDepositUSD: ({ dynamicRoutingId }) => isPerpsRoute(dynamicRoutingId) ? PERPS_MIN_DEPOSIT_USD : 0,
|
|
74
|
-
generateActionsParams: (_targetAssetAmount, outputConfig) => isPerpsRoute(
|
|
75
|
-
outputConfig?.dynamicRoutingId
|
|
76
|
-
) ? createPerpsGenerateActionParams({ recipientAddress: perps.address })() : createPredictionsGenerateActionParams({
|
|
77
|
-
recipientAddress: predictions.address
|
|
78
|
-
})(),
|
|
79
|
-
// Both transfer directions are integrator-owned; the step picks the source
|
|
80
|
-
// account's transfer. The accounts already have exactly the handle shape
|
|
81
|
-
// the step consumes, so they pass through as-is.
|
|
82
|
-
polymarketPerpsTransfer: {
|
|
83
|
-
predictions,
|
|
84
|
-
perps
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export {
|
|
90
|
-
POLYMARKET_PREDICTIONS_ROUTING_ID,
|
|
91
|
-
POLYMARKET_PERPS_ROUTING_ID,
|
|
92
|
-
createPredictionsGenerateActionParams,
|
|
93
|
-
createPolymarketDepositConfig
|
|
94
|
-
};
|