@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.
- package/dist/sdk/src/program.d.ts +1 -1
- package/dist/sdk/src/program.js +14 -11
- package/package.json +1 -1
|
@@ -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
|
/**
|
package/dist/sdk/src/program.js
CHANGED
|
@@ -567,10 +567,8 @@ class XitadelProgram {
|
|
|
567
567
|
payer: signer,
|
|
568
568
|
recentSlot: await this.program.provider.connection.getSlot(),
|
|
569
569
|
});
|
|
570
|
-
const
|
|
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
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
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
|
}
|