@xitadel-fi/sdk 0.1.6 → 0.1.8

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.
@@ -400,7 +400,7 @@ export declare class XitadelProgram {
400
400
  }): Promise<{
401
401
  activateLttIx: TransactionInstruction[];
402
402
  createLookupTableIx: TransactionInstruction;
403
- extendLookupTableIx: TransactionInstruction;
403
+ extendLookupTableIx: TransactionInstruction[];
404
404
  lookupTableAddress: PublicKey;
405
405
  }>;
406
406
  /**
@@ -567,11 +567,10 @@ class XitadelProgram {
567
567
  payer: signer,
568
568
  recentSlot: await this.program.provider.connection.getSlot(),
569
569
  });
570
- const addresses = [
570
+ const allAddresses = [
571
571
  lttConfigPda,
572
572
  poolAuthority,
573
573
  pool,
574
- poolb,
575
574
  lpMint,
576
575
  ammConfig,
577
576
  ammConfigB,
@@ -584,8 +583,6 @@ class XitadelProgram {
584
583
  stableVaultAtaB,
585
584
  payerLttTokenAccount,
586
585
  payerStableCoinTokenAccount,
587
- positionNftMintKeypair.publicKey,
588
- positionNftMintKeypairB.publicKey,
589
586
  positionNftAccount,
590
587
  positionNftAccountB,
591
588
  position,
@@ -594,18 +591,24 @@ class XitadelProgram {
594
591
  web3_js_2.SystemProgram.programId,
595
592
  collateralVaultAta,
596
593
  spl_token_1.TOKEN_PROGRAM_ID,
597
- spl_token_1.TOKEN_PROGRAM_ID,
598
594
  spl_token_1.TOKEN_2022_PROGRAM_ID,
599
595
  eventAuthority,
600
596
  params.cpAmmProgramId,
597
+ poolb,
601
598
  web3_js_1.SYSVAR_RENT_PUBKEY,
602
599
  ];
603
- const extendLookupTableIx = web3_js_1.AddressLookupTableProgram.extendLookupTable({
604
- payer: signer,
605
- authority: signer,
606
- lookupTable: lookupTableAddress,
607
- addresses,
608
- });
600
+ const uniqueAddressesStr = new Set(allAddresses.map(a => a.toBase58()));
601
+ const uniqueAddresses = Array.from(uniqueAddressesStr).map(a => new web3_js_1.PublicKey(a));
602
+ const extendLookupTableIxs = [];
603
+ const chunkSize = 15;
604
+ for (let i = 0; i < uniqueAddresses.length; i += chunkSize) {
605
+ extendLookupTableIxs.push(web3_js_1.AddressLookupTableProgram.extendLookupTable({
606
+ payer: signer,
607
+ authority: signer,
608
+ lookupTable: lookupTableAddress,
609
+ addresses: uniqueAddresses.slice(i, i + chunkSize),
610
+ }));
611
+ }
609
612
  instructions.push(await this.program.methods
610
613
  .activateLtt()
611
614
  .accountsPartial({
@@ -647,7 +650,7 @@ class XitadelProgram {
647
650
  return {
648
651
  activateLttIx: instructions,
649
652
  createLookupTableIx,
650
- extendLookupTableIx,
653
+ extendLookupTableIx: extendLookupTableIxs,
651
654
  lookupTableAddress,
652
655
  };
653
656
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@xitadel-fi/sdk",
4
- "version": "0.1.6",
4
+ "version": "0.1.8",
5
5
  "description": "SDK for interacting with the Xitadel program",
6
6
  "main": "dist/sdk/src/index.js",
7
7
  "types": "dist/sdk/src/index.d.ts",