@funkit/connect 9.22.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.
- package/CHANGELOG.md +49 -0
- package/dist/clients/{chunk-KSSSSWR6.js → chunk-2LMREKV6.js} +1 -1
- package/dist/clients/{chunk-NCCAYPLO.js → chunk-4M57JDJK.js} +1 -1
- package/dist/clients/{chunk-ZMVXBMON.js → chunk-GCIUIPM7.js} +1 -1
- package/dist/clients/{chunk-OWXKWC7I.js → chunk-H3CKQIYI.js} +10 -10
- package/dist/clients/{chunk-4752IYY6.js → chunk-KWIR3HO4.js} +1 -1
- package/dist/clients/fanatics.css +2 -2
- package/dist/clients/fanatics.js +3 -3
- package/dist/clients/lighter.css +2 -2
- package/dist/clients/lighter.js +5 -3
- package/dist/clients/mallard.d.ts +49 -0
- package/dist/clients/mallard.js +86 -0
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +91 -91
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +6 -6
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +2 -2
- package/dist/clients/polymarket/index.css +91 -91
- package/dist/clients/polymarket/index.js +6 -6
- package/dist/clients/polymarket/polymarket.js +1 -1
- package/dist/clients/rolly.js +1 -14
- package/dist/components/Box/Box.d.ts +21 -21
- package/dist/components/Icons/New/ArrowCircleUpRightIcon.d.ts +4 -0
- package/dist/consts/customers.d.ts +2 -0
- package/dist/css/sprinkles.css.d.ts +21 -21
- package/dist/domains/asset.d.ts +2 -2
- package/dist/domains/clientMetadata.d.ts +6 -1
- package/dist/domains/swapped.d.ts +10 -1
- package/dist/hooks/queries/useRecentCheckouts.d.ts +4 -2
- package/dist/hooks/queries/useRecentDeposits.d.ts +4 -9
- package/dist/hooks/track/CheckoutModalEvent.d.ts +1 -0
- package/dist/hooks/useEffectEvent.d.ts +1 -3
- package/dist/hooks/usePaymentMethodTabs.d.ts +5 -0
- package/dist/hooks/usePaymentSources.d.ts +1 -1
- package/dist/hooks/useTokenTransferConfig.d.ts +7 -0
- package/dist/index.css +32 -32
- package/dist/index.js +1412 -1465
- package/dist/interfaces/identity.d.ts +7 -0
- package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +3 -1
- package/dist/modals/CheckoutModal/SelectAsset/SelectAsset.d.ts +1 -1
- package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +2 -2
- package/dist/modals/CheckoutModal/Withdrawal/WithdrawalComplete.d.ts +14 -0
- package/dist/modals/CheckoutModal/Withdrawal/WithdrawalEnterAmount.d.ts +15 -0
- package/dist/modals/CheckoutModal/stepTransition.d.ts +6 -0
- package/dist/modals/CheckoutModal/stepTransition.track.d.ts +1 -1
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +31 -0
- package/dist/providers/FunkitCheckoutContext/types.d.ts +2 -28
- package/dist/providers/FunkitConfigContext.d.ts +2 -0
- package/dist/providers/SwappedProvider.d.ts +2 -2
- package/dist/utils/checkout.d.ts +2 -20
- package/dist/utils/customer.d.ts +13 -1
- package/dist/utils/tokenTransfer/disabledList.d.ts +1 -14
- package/dist/utils/tokenTransfer/types.d.ts +5 -30
- package/dist/wallets/walletConnectors/index.js +12 -12
- package/package.json +4 -4
- package/dist/clients/nado.d.ts +0 -78
- package/dist/clients/nado.js +0 -107
- /package/dist/clients/{chunk-52NKHZS2.js → chunk-OG254LB3.js} +0 -0
- /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
|
+
};
|