@xitadel-fi/sdk 0.1.6 → 0.1.7

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,7 +567,7 @@ 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,
@@ -594,18 +594,23 @@ class XitadelProgram {
594
594
  web3_js_2.SystemProgram.programId,
595
595
  collateralVaultAta,
596
596
  spl_token_1.TOKEN_PROGRAM_ID,
597
- spl_token_1.TOKEN_PROGRAM_ID,
598
597
  spl_token_1.TOKEN_2022_PROGRAM_ID,
599
598
  eventAuthority,
600
599
  params.cpAmmProgramId,
601
600
  web3_js_1.SYSVAR_RENT_PUBKEY,
602
601
  ];
603
- const extendLookupTableIx = web3_js_1.AddressLookupTableProgram.extendLookupTable({
604
- payer: signer,
605
- authority: signer,
606
- lookupTable: lookupTableAddress,
607
- addresses,
608
- });
602
+ const uniqueAddressesStr = new Set(allAddresses.map((a) => a.toBase58()));
603
+ const uniqueAddresses = Array.from(uniqueAddressesStr).map((a) => new web3_js_1.PublicKey(a));
604
+ const extendLookupTableIxs = [];
605
+ const chunkSize = 20;
606
+ for (let i = 0; i < uniqueAddresses.length; i += chunkSize) {
607
+ extendLookupTableIxs.push(web3_js_1.AddressLookupTableProgram.extendLookupTable({
608
+ payer: signer,
609
+ authority: signer,
610
+ lookupTable: lookupTableAddress,
611
+ addresses: uniqueAddresses.slice(i, i + chunkSize),
612
+ }));
613
+ }
609
614
  instructions.push(await this.program.methods
610
615
  .activateLtt()
611
616
  .accountsPartial({
@@ -647,7 +652,7 @@ class XitadelProgram {
647
652
  return {
648
653
  activateLttIx: instructions,
649
654
  createLookupTableIx,
650
- extendLookupTableIx,
655
+ extendLookupTableIx: extendLookupTableIxs,
651
656
  lookupTableAddress,
652
657
  };
653
658
  }
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.7",
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",