From b331cfb369a82eebbd515f02b386efca5303f0a4 Mon Sep 17 00:00:00 2001 From: Rudy Date: Thu, 13 Feb 2025 01:47:01 +0800 Subject: [PATCH] add cpmm close wsol option --- package.json | 2 +- src/cpmm/harvestLockLiquidity.ts | 3 +++ src/cpmm/withdraw.ts | 3 +++ yarn.lock | 8 ++++---- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 11b1fba..a5cb41a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Raydium SDK V2 demo.", "license": "GPL-3.0", "dependencies": { - "@raydium-io/raydium-sdk-v2": "0.1.111-alpha", + "@raydium-io/raydium-sdk-v2": "0.1.113-alpha", "@solana/spl-token": "^0.4.6", "@solana/web3.js": "^1.95.3", "@triton-one/yellowstone-grpc": "^1.2.0", diff --git a/src/cpmm/harvestLockLiquidity.ts b/src/cpmm/harvestLockLiquidity.ts index 90fcdf9..0653152 100644 --- a/src/cpmm/harvestLockLiquidity.ts +++ b/src/cpmm/harvestLockLiquidity.ts @@ -25,6 +25,9 @@ export const harvestLockLiquidity = async () => { nftMint: new PublicKey('CgkdQL6eRN1nxG2AmC8NFG5iboXuKtSjT4pShnspomZy'), // locked nft mint lpFeeAmount: new BN(99999999), txVersion, + + // closeWsol: false, // default if true, if you want use wsol, you need set false + // optional: add transfer sol to tip account instruction. e.g sent tip to jito // txTipConfig: { // address: new PublicKey('96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5'), diff --git a/src/cpmm/withdraw.ts b/src/cpmm/withdraw.ts index 1a4944a..bb68021 100644 --- a/src/cpmm/withdraw.ts +++ b/src/cpmm/withdraw.ts @@ -31,6 +31,9 @@ export const withdraw = async () => { lpAmount, txVersion, slippage, + + // closeWsol: false, // default if true, if you want use wsol, you need set false + // optional: set up priority fee here // computeBudgetConfig: { // units: 600000, diff --git a/yarn.lock b/yarn.lock index e1f559b..594d40b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -278,10 +278,10 @@ resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== -"@raydium-io/raydium-sdk-v2@0.1.111-alpha": - version "0.1.111-alpha" - resolved "https://registry.yarnpkg.com/@raydium-io/raydium-sdk-v2/-/raydium-sdk-v2-0.1.111-alpha.tgz#622fd832ffacdc0dc9b6c4b9f70b7412ca986753" - integrity sha512-mIvwClYgiBgKsYWgM6sFWXpwxYeWhXvZpSOPA6+o0xuRSEBo2hmpuy98DdWOkSZwoUUg1oTKSdRGepBwtpZqQw== +"@raydium-io/raydium-sdk-v2@0.1.113-alpha": + version "0.1.113-alpha" + resolved "https://registry.yarnpkg.com/@raydium-io/raydium-sdk-v2/-/raydium-sdk-v2-0.1.113-alpha.tgz#c7f7afd5bc8653b2023b6bd4689a19a918cca9b1" + integrity sha512-IS41t4gar6NXva7EMw4q0QmPHhWg1hxNRffYd49YdVYeDcfPEyyG7RYkpWm6fp0FdkdyAfYo0XjV8DcFlgXVDw== dependencies: "@solana/buffer-layout" "^4.0.1" "@solana/spl-token" "^0.4.8"