| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- export const addLiquidity = async (position, symbol, maxUsdValue) => {
- // https://discord.com/api/webhooks/1457714616636280978/YFMGaZEj2gJwUjINpFfJIkagG1I3SLZRwz9bGpc2OlGFWBVa88r73cMIkBpX3iGpSIjV discord 通知
- fetch('http://91.108.80.73/api/lp-copy', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': 'Basic YWRtaW46YzU4ODk5Njc='
- },
- body: JSON.stringify({
- positionAddress: position.positionAddress,
- maxUsdValue: maxUsdValue || 1,
- }),
- })
- .then((res) => res.json())
- .then((data) => {
- if (data.success) {
- console.log('快速复制成功')
- // discord 通知
- fetch('https://discord.com/api/webhooks/1457714616636280978/YFMGaZEj2gJwUjINpFfJIkagG1I3SLZRwz9bGpc2OlGFWBVa88r73cMIkBpX3iGpSIjV', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- content: `${symbol} 复制流动性成功: https://www.byreal.io/en/portfolio?userAddress=${position.walletAddress}&tab=current&positionAddress=${position.positionAddress}`,
- }),
- })
- } else {
- // discord 通知
- fetch('https://discord.com/api/webhooks/1457714616636280978/YFMGaZEj2gJwUjINpFfJIkagG1I3SLZRwz9bGpc2OlGFWBVa88r73cMIkBpX3iGpSIjV', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- content: `${symbol} 复制流动性失败: https://www.byreal.io/en/portfolio?userAddress=${position.walletAddress}&tab=current&positionAddress=${position.positionAddress}`,
- }),
- })
- }
- })
- .catch((err) => {
- console.error('Error quick copying:', err)
- // discord 通知
- fetch('https://discord.com/api/webhooks/1457714616636280978/YFMGaZEj2gJwUjINpFfJIkagG1I3SLZRwz9bGpc2OlGFWBVa88r73cMIkBpX3iGpSIjV', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- content: `${symbol} 复制流动性失败: https://www.byreal.io/en/portfolio?userAddress=${position.walletAddress}&tab=current&positionAddress=${position.positionAddress}, ${err.message}`,
- }),
- })
- })
- }
|