addLiquidity

nonpayable

Input should be passed in JSON format - Ex: { "tokenX": "0x...", "tokenY": "0x...", "binStep": "0", "amountX": "0", "amountY": "0", "amountXMin": "0", "amountYMin": "0", "activeIdDesired": "0", "idSlippage": "0", "deltaIds": ["0"], "distributionX": ["0"], "distributionY": ["0"], "to": "0x...", "refundTo": "0x...", "deadline": "0" }

Use this function in your app

const response = await fetch('https://api.thirdweb.com/v1/contracts/write', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-secret-key': '<YOUR_SECRET_KEY>' }, body: JSON.stringify({ calls: [ { contractAddress: "0x18556DA13313f3532c54711497A8FedAC273220E", method: "function addLiquidity((address tokenX, address tokenY, uint256 binStep, uint256 amountX, uint256 amountY, uint256 amountXMin, uint256 amountYMin, uint256 activeIdDesired, uint256 idSlippage, int256[] deltaIds, uint256[] distributionX, uint256[] distributionY, address to, address refundTo, uint256 deadline) liquidityParameters) returns (uint256 amountXAdded, uint256 amountYAdded, uint256 amountXLeft, uint256 amountYLeft, uint256[] depositIds, uint256[] liquidityMinted)", params: [liquidityParameters] } ], chainId: 43114, from: "<YOUR_WALLET_ADDRESS>" }) }); const data = await response.json();