@@ -103,14 +103,14 @@ func OpenNewPositionAndAddLiquidity(tickLower,
103103func OpenNewPositionAndAddLiquidityIx (tickLower ,
104104 tickUpper int32 , client rpc.Client , tokenAMax ,
105105 tokenBMax uint64 , liquidity bin.Uint128 ,
106- tokenA , tokenB , tokenVault0 , tokenVault1 , poolStateAddress solana.PublicKey , wallet solana.PrivateKey ) ([]solana.Instruction , error ) {
106+ tokenA , tokenB , tokenVault0 , tokenVault1 , poolStateAddress , nftMint solana.PublicKey , wallet solana.PrivateKey ) ([]solana.Instruction , error ) {
107107 owner := wallet
108108 amm_v32 .ProgramID = RAYDIUM_PROGRAM_ID
109- nftMint := solana .NewWallet ()
109+ // nftMint := solana.NewWallet()
110110 protocolPosition , _ := GetProtocolPositionAddress (poolStateAddress , tickLower , tickUpper )
111- personalPosition , _ := GetPersonalPositionAddress (nftMint . PublicKey () )
112- metadataAccount , _ := GetNFTMetadaAddress (nftMint . PublicKey () )
113- positionNFTAccount , _ := GetPositionNFTAccount (owner .PublicKey (), nftMint . PublicKey () )
111+ personalPosition , _ := GetPersonalPositionAddress (nftMint )
112+ metadataAccount , _ := GetNFTMetadaAddress (nftMint )
113+ positionNFTAccount , _ := GetPositionNFTAccount (owner .PublicKey (), nftMint )
114114 // TickArrayLowerStartIndex -39600
115115 ktas := GetTickArrays (& client , poolStateAddress )
116116 ktaLower := GetTickArray (tickLower , ktas )
@@ -125,7 +125,7 @@ func OpenNewPositionAndAddLiquidityIx(tickLower,
125125 tokenBMax ,
126126 owner .PublicKey (),
127127 owner .PublicKey (),
128- nftMint . PublicKey () ,
128+ nftMint ,
129129 positionNFTAccount , // ata pda
130130 metadataAccount , //pda
131131 poolStateAddress ,
@@ -143,5 +143,5 @@ func OpenNewPositionAndAddLiquidityIx(tickLower,
143143 solana .SPLAssociatedTokenAccountProgramID , // const
144144 METAPLEX , // const
145145 ).Build ()
146- return []solana.Instruction {i1 }, nil
147- }
146+ return []solana.Instruction {i1 }, nil
147+ }
0 commit comments