@funkit/connect 9.23.0 → 9.23.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 (42) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/clients/{chunk-KSSSSWR6.js → chunk-2LMREKV6.js} +1 -1
  3. package/dist/clients/{chunk-NCCAYPLO.js → chunk-4M57JDJK.js} +1 -1
  4. package/dist/clients/{chunk-ZMVXBMON.js → chunk-GCIUIPM7.js} +1 -1
  5. package/dist/clients/{chunk-OWXKWC7I.js → chunk-H3CKQIYI.js} +10 -10
  6. package/dist/clients/{chunk-4752IYY6.js → chunk-KWIR3HO4.js} +1 -1
  7. package/dist/clients/fanatics.css +2 -2
  8. package/dist/clients/fanatics.js +3 -3
  9. package/dist/clients/lighter.css +2 -2
  10. package/dist/clients/lighter.js +5 -3
  11. package/dist/clients/mallard.d.ts +49 -0
  12. package/dist/clients/mallard.js +86 -0
  13. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +91 -91
  14. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +6 -6
  15. package/dist/clients/polymarket/createPolymarketDepositConfig.js +2 -2
  16. package/dist/clients/polymarket/index.css +91 -91
  17. package/dist/clients/polymarket/index.js +6 -6
  18. package/dist/clients/polymarket/polymarket.js +1 -1
  19. package/dist/clients/rolly.js +1 -14
  20. package/dist/components/Box/Box.d.ts +21 -21
  21. package/dist/consts/customers.d.ts +2 -0
  22. package/dist/css/sprinkles.css.d.ts +21 -21
  23. package/dist/domains/asset.d.ts +2 -2
  24. package/dist/domains/clientMetadata.d.ts +6 -1
  25. package/dist/hooks/useTokenTransferConfig.d.ts +7 -0
  26. package/dist/index.css +32 -32
  27. package/dist/index.js +216 -295
  28. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +3 -1
  29. package/dist/modals/CheckoutModal/SelectAsset/SelectAsset.d.ts +1 -1
  30. package/dist/modals/CheckoutModal/Withdrawal/WithdrawalComplete.d.ts +14 -0
  31. package/dist/modals/CheckoutModal/Withdrawal/WithdrawalEnterAmount.d.ts +15 -0
  32. package/dist/modals/CheckoutModal/stepTransition.d.ts +6 -0
  33. package/dist/modals/CheckoutModal/stepTransition.track.d.ts +1 -1
  34. package/dist/providers/FunkitCheckoutContext/types.d.ts +2 -28
  35. package/dist/utils/tokenTransfer/disabledList.d.ts +1 -14
  36. package/dist/utils/tokenTransfer/types.d.ts +5 -30
  37. package/dist/wallets/walletConnectors/index.js +32 -32
  38. package/package.json +4 -4
  39. package/dist/clients/nado.d.ts +0 -78
  40. package/dist/clients/nado.js +0 -107
  41. /package/dist/clients/{chunk-52NKHZS2.js → chunk-OG254LB3.js} +0 -0
  42. /package/dist/clients/{chunk-MOUTRRN3.js → chunk-S7FRYR55.js} +0 -0
@@ -0,0 +1,86 @@
1
+ "use client";
2
+
3
+ // src/clients/mallard.tsx
4
+ import { VAULT_DEPOSITOR_ABI } from "@funkit/fun-relay";
5
+ import {
6
+ encodeFunctionData,
7
+ erc20Abi,
8
+ getAddress,
9
+ maxUint256
10
+ } from "viem";
11
+ var MALLARD_DEPOSIT_ADDRESS = getAddress(
12
+ "0xb272c91D84d6538C8F31ab092A53Bfe8916B5449"
13
+ );
14
+ var VAULT_DEPOSITOR_ZORRO = getAddress(
15
+ "0xec70919c52e56a197d2e13b78cb8511db54f3ca2"
16
+ );
17
+ var AMOUNT_PLACEHOLDER = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffdeadbeefn;
18
+ var MALLARD_PRIMARY_ACCOUNT_INDEX = 0;
19
+ var MALLARD_ANYONE_CAN_EXECUTE_CANCEL = true;
20
+ var MALLARD_DEPOSIT_ABI = [
21
+ {
22
+ name: "initiateDepositReturnToOwner",
23
+ type: "function",
24
+ stateMutability: "nonpayable",
25
+ inputs: [
26
+ { name: "owner", type: "address" },
27
+ { name: "accountIndex", type: "uint16" },
28
+ { name: "token", type: "address" },
29
+ { name: "amount", type: "uint256" },
30
+ { name: "anyoneCanExecuteCancel", type: "bool" }
31
+ ],
32
+ outputs: []
33
+ }
34
+ ];
35
+ function createMallardDepositActions(config) {
36
+ const {
37
+ recipientAddress,
38
+ tokenAddress,
39
+ vaultDepositorAddress = VAULT_DEPOSITOR_ZORRO,
40
+ depositAddress = MALLARD_DEPOSIT_ADDRESS
41
+ } = config;
42
+ return async () => {
43
+ if (!recipientAddress) {
44
+ throw new Error(
45
+ "Please connect your wallet before starting a Mallard deposit"
46
+ );
47
+ }
48
+ const token = getAddress(tokenAddress);
49
+ const depositCalldata = encodeFunctionData({
50
+ abi: MALLARD_DEPOSIT_ABI,
51
+ functionName: "initiateDepositReturnToOwner",
52
+ args: [
53
+ getAddress(recipientAddress),
54
+ MALLARD_PRIMARY_ACCOUNT_INDEX,
55
+ token,
56
+ AMOUNT_PLACEHOLDER,
57
+ MALLARD_ANYONE_CAN_EXECUTE_CANCEL
58
+ ]
59
+ });
60
+ return [
61
+ // Step 1: Approve token to VaultDepositooor (infinite). No approve-to-0 reset —
62
+ // that's only needed for USDT-style tokens that require zeroing allowance first; USDG
63
+ // is standard ERC-20.
64
+ {
65
+ contractAbi: erc20Abi,
66
+ contractAddress: token,
67
+ functionName: "approve",
68
+ functionArgs: [vaultDepositorAddress, maxUint256]
69
+ },
70
+ // Step 2: VaultDepositooor pulls token, swaps placeholder, forwards to
71
+ // Mallard.initiateDepositReturnToOwner → credits the recipient's Mallard account
72
+ {
73
+ contractAbi: VAULT_DEPOSITOR_ABI,
74
+ contractAddress: vaultDepositorAddress,
75
+ functionName: "deposit",
76
+ functionArgs: [token, depositAddress, depositCalldata, 0n]
77
+ }
78
+ ];
79
+ };
80
+ }
81
+ export {
82
+ AMOUNT_PLACEHOLDER,
83
+ MALLARD_DEPOSIT_ADDRESS,
84
+ VAULT_DEPOSITOR_ZORRO,
85
+ createMallardDepositActions
86
+ };