@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.
- package/CHANGELOG.md +32 -0
- package/dist/{chunk-MXNOQTKX.js → chunk-BSF2AKBC.js} +16 -0
- package/dist/{chunk-AGBRSMZ7.js → chunk-DBRUJYOQ.js} +12 -1
- package/dist/{chunk-RHUOOPDI.js → chunk-IZC4ZKKQ.js} +12 -1
- package/dist/clients/fanatics.css +5263 -4393
- package/dist/clients/fanatics.js +2 -2
- package/dist/clients/polymarket.d.ts +5 -1
- package/dist/clients/polymarket.js +11 -15
- package/dist/components/Box/Box.d.ts +40 -40
- package/dist/components/Dropdown/BaseDropdown.css.d.ts +2 -0
- package/dist/components/Dropdown/BaseDropdown.d.ts +49 -6
- package/dist/components/FunCheckoutBlocked/FunCheckoutBlocked.d.ts +2 -2
- package/dist/components/FunInput/FunInput.css.d.ts +1 -0
- package/dist/components/Tabs/Tabs.d.ts +1 -0
- package/dist/components/Tabs/tabs.css.d.ts +1 -1
- package/dist/config/getDefaultConfig.d.ts +1 -1
- package/dist/css/sprinkles.css.d.ts +108 -40
- package/dist/hooks/useMainnetEnsAvatar.d.ts +1 -1
- package/dist/hooks/useScrollDivider.d.ts +10 -2
- package/dist/index.css +5321 -4400
- package/dist/index.d.ts +1 -0
- package/dist/index.js +863 -570
- package/dist/modals/CheckoutModal/CheckoutBlockedReason.d.ts +1 -0
- package/dist/modals/CheckoutModal/useCheckoutBlocked.d.ts +18 -0
- package/dist/providers/FunkitCheckoutContext/types.d.ts +5 -0
- package/dist/providers/FunkitThemeProvider.d.ts +102 -0
- package/dist/providers/GeneralWalletProvider.d.ts +5 -5
- package/dist/themes/baseTheme.js +1 -1
- package/dist/themes/darkTheme.js +2 -2
- package/dist/themes/lightTheme.js +2 -2
- package/dist/utils/checkout.d.ts +1 -1
- package/dist/wallets/walletConnectors/index.js +45 -45
- 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
|
|
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
|
-
|
|
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
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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
|
-
|
|
339
|
+
POLYGON_PMCT,
|
|
344
340
|
createPolymarketWithdrawalConfig
|
|
345
341
|
};
|