@lavarage/sdk 6.3.0 → 6.3.2

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/index.ts CHANGED
@@ -20,7 +20,7 @@ async function getTokenAccountOrCreateIfNotExists(lavarageProgram: Program<Lavar
20
20
  const associatedTokenAddress = getAssociatedTokenAddressSync(tokenAddress, ownerPublicKey, true, tokenProgram, ASSOCIATED_TOKEN_PROGRAM_ID)
21
21
 
22
22
  try {
23
- const tokenAccount = await getAccount(lavarageProgram.provider.connection, associatedTokenAddress, 'finalized')
23
+ const tokenAccount = await getAccount(lavarageProgram.provider.connection, associatedTokenAddress, 'finalized', tokenProgram)
24
24
  return { account: tokenAccount, instruction: null }
25
25
  }
26
26
  catch (error) {
@@ -350,13 +350,13 @@ export const openTradeV2 = async (lavarageProgram: Program<LavarageV2>, offer: P
350
350
  systemProgram: SystemProgram.programId,
351
351
  clock: SYSVAR_CLOCK_PUBKEY,
352
352
  randomAccountAsId: randomSeed.publicKey.toBase58(),
353
- feeTokenAccount: getAssociatedTokenAddressSync(quoteToken, new PublicKey('6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF')),
353
+ feeTokenAccount: getAssociatedTokenAddressSync(quoteToken, new PublicKey('6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF'), true, quoteTokenProgram),
354
354
  toTokenAccount: getAssociatedTokenAddressSync(quoteToken, lavarageProgram.provider.publicKey!, true, quoteTokenProgram),
355
- tokenProgram: tokenProgram!,
356
- fromTokenAccount: getAssociatedTokenAddressSync(quoteToken, offer.account.nodeWallet, true, tokenProgram),
355
+ tokenProgram: quoteTokenProgram!,
356
+ fromTokenAccount: getAssociatedTokenAddressSync(quoteToken, offer.account.nodeWallet, true, quoteTokenProgram),
357
357
  })
358
358
  .remainingAccounts(partnerFeeRecipient && partnerFeeMarkupAsPkey ? [{
359
- pubkey: partnerFeeRecipient,
359
+ pubkey: getAssociatedTokenAddressSync(quoteToken, partnerFeeRecipient, false, quoteTokenProgram),
360
360
  isSigner: false,
361
361
  isWritable: true,
362
362
  }, {
@@ -417,7 +417,7 @@ export const createTpDelegate = async (lavarageProgram: Program<Lavarage> | Prog
417
417
  delegatedAccount: position.publicKey,
418
418
  systemProgram: SystemProgram.programId,
419
419
  }).remainingAccounts(partnerFeeRecipient ? [{
420
- pubkey: quoteToken.toBase58() == 'So11111111111111111111111111111111111111112' ? partnerFeeRecipient : getAssociatedTokenAddressSync(quoteToken, partnerFeeRecipient, true),
420
+ pubkey: quoteToken.toBase58() == 'So11111111111111111111111111111111111111112' ? partnerFeeRecipient : getAssociatedTokenAddressSync(quoteToken, partnerFeeRecipient, false),
421
421
  isSigner: false,
422
422
  isWritable: true,
423
423
  }] : [])
@@ -460,7 +460,7 @@ export const modifyTpDelegate = async (lavarageProgram: Program<Lavarage> | Prog
460
460
  delegatedAccount: position.publicKey,
461
461
  systemProgram: SystemProgram.programId,
462
462
  }).remainingAccounts(partnerFeeRecipient ? [{
463
- pubkey: quoteToken.toBase58() == 'So11111111111111111111111111111111111111112' ? partnerFeeRecipient : getAssociatedTokenAddressSync(quoteToken, partnerFeeRecipient, true),
463
+ pubkey: quoteToken.toBase58() == 'So11111111111111111111111111111111111111112' ? partnerFeeRecipient : getAssociatedTokenAddressSync(quoteToken, partnerFeeRecipient, false),
464
464
  isSigner: false,
465
465
  isWritable: true,
466
466
  }] : [])
@@ -871,7 +871,7 @@ export const closeTradeV2 = async (lavarageProgram: Program<LavarageV2>, positio
871
871
  mint: quoteToken,
872
872
  })
873
873
  .remainingAccounts(partnerFeeRecipient && partnerFeeMarkupAsPkey ? [{
874
- pubkey: partnerFeeRecipient,
874
+ pubkey: getAssociatedTokenAddressSync(quoteToken, partnerFeeRecipient, false, quoteTokenProgram),
875
875
  isSigner: false,
876
876
  isWritable: true,
877
877
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lavarage/sdk",
3
- "version": "6.3.0",
3
+ "version": "6.3.2",
4
4
  "description": "Lavarage SDK",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",