@xitadel-fi/sdk 0.1.5 → 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,10 +567,8 @@ class XitadelProgram {
567
567
  payer: signer,
568
568
  recentSlot: await this.program.provider.connection.getSlot(),
569
569
  });
570
- const addresses = [
571
- signer,
570
+ const allAddresses = [
572
571
  lttConfigPda,
573
- lpAuthority,
574
572
  poolAuthority,
575
573
  pool,
576
574
  poolb,
@@ -596,18 +594,23 @@ class XitadelProgram {
596
594
  web3_js_2.SystemProgram.programId,
597
595
  collateralVaultAta,
598
596
  spl_token_1.TOKEN_PROGRAM_ID,
599
- spl_token_1.TOKEN_PROGRAM_ID,
600
597
  spl_token_1.TOKEN_2022_PROGRAM_ID,
601
598
  eventAuthority,
602
599
  params.cpAmmProgramId,
603
600
  web3_js_1.SYSVAR_RENT_PUBKEY,
604
601
  ];
605
- const extendLookupTableIx = web3_js_1.AddressLookupTableProgram.extendLookupTable({
606
- payer: signer,
607
- authority: signer,
608
- lookupTable: lookupTableAddress,
609
- addresses,
610
- });
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
+ }
611
614
  instructions.push(await this.program.methods
612
615
  .activateLtt()
613
616
  .accountsPartial({
@@ -649,7 +652,7 @@ class XitadelProgram {
649
652
  return {
650
653
  activateLttIx: instructions,
651
654
  createLookupTableIx,
652
- extendLookupTableIx,
655
+ extendLookupTableIx: extendLookupTableIxs,
653
656
  lookupTableAddress,
654
657
  };
655
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.5",
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",