@funkit/connect 9.3.2 → 9.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/{chunk-MXNOQTKX.js → chunk-BSF2AKBC.js} +16 -0
  3. package/dist/{chunk-AGBRSMZ7.js → chunk-DBRUJYOQ.js} +12 -1
  4. package/dist/{chunk-RHUOOPDI.js → chunk-IZC4ZKKQ.js} +12 -1
  5. package/dist/clients/fanatics.css +5263 -4393
  6. package/dist/clients/fanatics.js +2 -2
  7. package/dist/clients/polymarket.d.ts +5 -1
  8. package/dist/clients/polymarket.js +11 -15
  9. package/dist/components/Box/Box.d.ts +40 -40
  10. package/dist/components/Dropdown/BaseDropdown.css.d.ts +2 -0
  11. package/dist/components/Dropdown/BaseDropdown.d.ts +49 -6
  12. package/dist/components/FunCheckoutBlocked/FunCheckoutBlocked.d.ts +2 -2
  13. package/dist/components/FunInput/FunInput.css.d.ts +1 -0
  14. package/dist/components/Tabs/Tabs.d.ts +1 -0
  15. package/dist/components/Tabs/tabs.css.d.ts +1 -1
  16. package/dist/config/getDefaultConfig.d.ts +1 -1
  17. package/dist/css/sprinkles.css.d.ts +108 -40
  18. package/dist/hooks/useMainnetEnsAvatar.d.ts +1 -1
  19. package/dist/hooks/useScrollDivider.d.ts +10 -2
  20. package/dist/index.css +5321 -4400
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.js +863 -570
  23. package/dist/modals/CheckoutModal/CheckoutBlockedReason.d.ts +1 -0
  24. package/dist/modals/CheckoutModal/useCheckoutBlocked.d.ts +18 -0
  25. package/dist/providers/FunkitCheckoutContext/types.d.ts +5 -0
  26. package/dist/providers/FunkitThemeProvider.d.ts +102 -0
  27. package/dist/providers/GeneralWalletProvider.d.ts +5 -5
  28. package/dist/themes/baseTheme.js +1 -1
  29. package/dist/themes/darkTheme.js +2 -2
  30. package/dist/themes/lightTheme.js +2 -2
  31. package/dist/utils/checkout.d.ts +1 -1
  32. package/dist/wallets/walletConnectors/index.js +45 -45
  33. package/package.json +5 -5
@@ -10,11 +10,15 @@
10
10
  */
11
11
  import type { Address } from 'viem';
12
12
  import type { CustomWithdrawalConfig } from '../providers/FunkitCheckoutContext/types';
13
- export declare const PMCT_WITHDRAW_ACTION_TYPE = "PMCT_WITHDRAW";
13
+ export declare const POLYGON_PMCT: Address;
14
14
  export interface PolymarketWithdrawalCallbackConfig {
15
15
  userId: string;
16
16
  modalTitle?: string;
17
17
  disableConnectedWallet?: boolean;
18
+ sourceTokenSymbol?: string;
19
+ defaultReceiveToken?: string;
20
+ sourceTokenAddress?: Address;
21
+ iconSrc?: string;
18
22
  /**
19
23
  * Execute the ERC-20 transfer of PMCT from the user's proxy to the UDA.
20
24
  * Called after the UDA address is generated.
@@ -279,6 +279,7 @@ function generateClientMetadataForTokenTransfer() {
279
279
  // src/clients/polymarket.tsx
280
280
  var PMCT_WITHDRAW_ACTION_TYPE = "PMCT_WITHDRAW";
281
281
  var POLYGON_USDCE = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174";
282
+ var POLYGON_PMCT = "0x546b3142b3711c7169485DD8BCD02817cCd2aE23";
282
283
  function createPolymarketWithdrawalCallback(config) {
283
284
  const { userId, sendPmctTransfer } = config;
284
285
  return async (param) => {
@@ -299,11 +300,8 @@ function createPolymarketWithdrawalCallback(config) {
299
300
  clientMetadata: {
300
301
  ...generateClientMetadataForTokenTransfer(),
301
302
  isWithdrawal: true
302
- }
303
- // TODO: add this actionType back
304
- // we need a backend release to pass the actual actionType for it.
305
- // otherwise the current checkout will fail due to UDA creation
306
- // actionType: PMCT_WITHDRAW_ACTION_TYPE,
303
+ },
304
+ actionType: PMCT_WITHDRAW_ACTION_TYPE
307
305
  });
308
306
  const udaAddress = transferInit.depositAddr;
309
307
  logger.info("polymarket:withdrawal:udaGenerated", { udaAddress });
@@ -327,19 +325,17 @@ function createPolymarketWithdrawalCallback(config) {
327
325
  function createPolymarketWithdrawalConfig(config) {
328
326
  return {
329
327
  modalTitle: config.modalTitle ?? "Withdraw",
330
- sourceChainId: polygon.id.toString(),
331
- sourceTokenSymbol: "PMCT",
332
- defaultReceiveToken: "USDC",
333
- // TODO: PMCT is not deployed yet. we need to update this later
334
- sourceTokenAddress: POLYGON_USDCE,
335
- iconSrc: "https://sdk-cdn.fun.xyz/images/pmct.png",
336
328
  disableConnectedWallet: config.disableConnectedWallet,
337
- // sending $3 is enough to trigger Fun's UDA flow
338
- getMinWithdrawalUSD: () => 3,
339
- withdrawCallback: createPolymarketWithdrawalCallback(config)
329
+ withdrawCallback: createPolymarketWithdrawalCallback(config),
330
+ sourceChainId: polygon.id.toString(),
331
+ sourceTokenSymbol: config.sourceTokenSymbol ?? "USDC",
332
+ defaultReceiveToken: config.defaultReceiveToken ?? "USDC",
333
+ sourceTokenAddress: config.sourceTokenAddress ?? POLYGON_USDCE,
334
+ iconSrc: config.iconSrc ?? "https://sdk-cdn.fun.xyz/images/usdc.svg",
335
+ getMinWithdrawalUSD: () => 3
340
336
  };
341
337
  }
342
338
  export {
343
- PMCT_WITHDRAW_ACTION_TYPE,
339
+ POLYGON_PMCT,
344
340
  createPolymarketWithdrawalConfig
345
341
  };