@symmetry-hq/sdk 1.0.1

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.
Files changed (121) hide show
  1. package/dist/src/constants.d.ts +23 -0
  2. package/dist/src/constants.js +38 -0
  3. package/dist/src/index.d.ts +804 -0
  4. package/dist/src/index.js +2097 -0
  5. package/dist/src/instructions/automation/auction.d.ts +6 -0
  6. package/dist/src/instructions/automation/auction.js +40 -0
  7. package/dist/src/instructions/automation/claimBounty.d.ts +12 -0
  8. package/dist/src/instructions/automation/claimBounty.js +44 -0
  9. package/dist/src/instructions/automation/flashSwap.d.ts +21 -0
  10. package/dist/src/instructions/automation/flashSwap.js +74 -0
  11. package/dist/src/instructions/automation/priceUpdate.d.ts +19 -0
  12. package/dist/src/instructions/automation/priceUpdate.js +89 -0
  13. package/dist/src/instructions/automation/rebalanceIntent.d.ts +32 -0
  14. package/dist/src/instructions/automation/rebalanceIntent.js +117 -0
  15. package/dist/src/instructions/automation/rebalanceSwap.d.ts +11 -0
  16. package/dist/src/instructions/automation/rebalanceSwap.js +42 -0
  17. package/dist/src/instructions/management/addBounty.d.ts +7 -0
  18. package/dist/src/instructions/management/addBounty.js +41 -0
  19. package/dist/src/instructions/management/admin.d.ts +9 -0
  20. package/dist/src/instructions/management/admin.js +53 -0
  21. package/dist/src/instructions/management/claimFees.d.ts +15 -0
  22. package/dist/src/instructions/management/claimFees.js +95 -0
  23. package/dist/src/instructions/management/createBasket.d.ts +21 -0
  24. package/dist/src/instructions/management/createBasket.js +98 -0
  25. package/dist/src/instructions/management/edit.d.ts +51 -0
  26. package/dist/src/instructions/management/edit.js +477 -0
  27. package/dist/src/instructions/management/luts.d.ts +30 -0
  28. package/dist/src/instructions/management/luts.js +99 -0
  29. package/dist/src/instructions/pda.d.ts +25 -0
  30. package/dist/src/instructions/pda.js +128 -0
  31. package/dist/src/instructions/user/deposit.d.ts +20 -0
  32. package/dist/src/instructions/user/deposit.js +100 -0
  33. package/dist/src/instructions/user/withdraw.d.ts +8 -0
  34. package/dist/src/instructions/user/withdraw.js +36 -0
  35. package/dist/src/jup.d.ts +49 -0
  36. package/dist/src/jup.js +80 -0
  37. package/dist/src/keeperMonitor.d.ts +52 -0
  38. package/dist/src/keeperMonitor.js +624 -0
  39. package/dist/src/layouts/basket.d.ts +191 -0
  40. package/dist/src/layouts/basket.js +51 -0
  41. package/dist/src/layouts/config.d.ts +281 -0
  42. package/dist/src/layouts/config.js +237 -0
  43. package/dist/src/layouts/fraction.d.ts +20 -0
  44. package/dist/src/layouts/fraction.js +164 -0
  45. package/dist/src/layouts/intents/bounty.d.ts +18 -0
  46. package/dist/src/layouts/intents/bounty.js +19 -0
  47. package/dist/src/layouts/intents/intent.d.ts +209 -0
  48. package/dist/src/layouts/intents/intent.js +97 -0
  49. package/dist/src/layouts/intents/rebalanceIntent.d.ts +212 -0
  50. package/dist/src/layouts/intents/rebalanceIntent.js +94 -0
  51. package/dist/src/layouts/lookupTable.d.ts +7 -0
  52. package/dist/src/layouts/lookupTable.js +10 -0
  53. package/dist/src/layouts/oracle.d.ts +63 -0
  54. package/dist/src/layouts/oracle.js +96 -0
  55. package/dist/src/states/basket.d.ts +14 -0
  56. package/dist/src/states/basket.js +479 -0
  57. package/dist/src/states/config.d.ts +3 -0
  58. package/dist/src/states/config.js +71 -0
  59. package/dist/src/states/intents/intent.d.ts +10 -0
  60. package/dist/src/states/intents/intent.js +316 -0
  61. package/dist/src/states/intents/rebalanceIntent.d.ts +42 -0
  62. package/dist/src/states/intents/rebalanceIntent.js +680 -0
  63. package/dist/src/states/oracles/constants.d.ts +9 -0
  64. package/dist/src/states/oracles/constants.js +15 -0
  65. package/dist/src/states/oracles/oracle.d.ts +24 -0
  66. package/dist/src/states/oracles/oracle.js +168 -0
  67. package/dist/src/states/oracles/pythOracle.d.ts +132 -0
  68. package/dist/src/states/oracles/pythOracle.js +609 -0
  69. package/dist/src/states/oracles/raydiumClmmOracle.d.ts +184 -0
  70. package/dist/src/states/oracles/raydiumClmmOracle.js +843 -0
  71. package/dist/src/states/oracles/raydiumCpmmOracle.d.ts +120 -0
  72. package/dist/src/states/oracles/raydiumCpmmOracle.js +540 -0
  73. package/dist/src/states/oracles/switchboardOracle.d.ts +0 -0
  74. package/dist/src/states/oracles/switchboardOracle.js +1 -0
  75. package/dist/src/states/withdrawBasketFees.d.ts +10 -0
  76. package/dist/src/states/withdrawBasketFees.js +154 -0
  77. package/dist/src/txUtils.d.ts +65 -0
  78. package/dist/src/txUtils.js +306 -0
  79. package/dist/test.d.ts +1 -0
  80. package/dist/test.js +561 -0
  81. package/package.json +31 -0
  82. package/src/constants.ts +40 -0
  83. package/src/index.ts +2431 -0
  84. package/src/instructions/automation/auction.ts +55 -0
  85. package/src/instructions/automation/claimBounty.ts +69 -0
  86. package/src/instructions/automation/flashSwap.ts +104 -0
  87. package/src/instructions/automation/priceUpdate.ts +117 -0
  88. package/src/instructions/automation/rebalanceIntent.ts +181 -0
  89. package/src/instructions/management/addBounty.ts +55 -0
  90. package/src/instructions/management/admin.ts +72 -0
  91. package/src/instructions/management/claimFees.ts +129 -0
  92. package/src/instructions/management/createBasket.ts +138 -0
  93. package/src/instructions/management/edit.ts +602 -0
  94. package/src/instructions/management/luts.ts +157 -0
  95. package/src/instructions/pda.ts +151 -0
  96. package/src/instructions/user/deposit.ts +143 -0
  97. package/src/instructions/user/withdraw.ts +53 -0
  98. package/src/jup.ts +113 -0
  99. package/src/keeperMonitor.ts +585 -0
  100. package/src/layouts/basket.ts +233 -0
  101. package/src/layouts/config.ts +576 -0
  102. package/src/layouts/fraction.ts +164 -0
  103. package/src/layouts/intents/bounty.ts +35 -0
  104. package/src/layouts/intents/intent.ts +324 -0
  105. package/src/layouts/intents/rebalanceIntent.ts +306 -0
  106. package/src/layouts/lookupTable.ts +14 -0
  107. package/src/layouts/oracle.ts +157 -0
  108. package/src/states/basket.ts +527 -0
  109. package/src/states/config.ts +62 -0
  110. package/src/states/intents/intent.ts +311 -0
  111. package/src/states/intents/rebalanceIntent.ts +751 -0
  112. package/src/states/oracles/constants.ts +13 -0
  113. package/src/states/oracles/oracle.ts +212 -0
  114. package/src/states/oracles/pythOracle.ts +874 -0
  115. package/src/states/oracles/raydiumClmmOracle.ts +1193 -0
  116. package/src/states/oracles/raydiumCpmmOracle.ts +784 -0
  117. package/src/states/oracles/switchboardOracle.ts +0 -0
  118. package/src/states/withdrawBasketFees.ts +160 -0
  119. package/src/txUtils.ts +424 -0
  120. package/test.ts +609 -0
  121. package/tsconfig.json +101 -0
@@ -0,0 +1,6 @@
1
+ import { PublicKey, TransactionInstruction } from '@solana/web3.js';
2
+ export declare function createAuctionIx(params: {
3
+ keeper: PublicKey;
4
+ basket: PublicKey;
5
+ bountyMint: PublicKey;
6
+ }): TransactionInstruction;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createAuctionIx = createAuctionIx;
4
+ const spl_token_1 = require("@solana/spl-token");
5
+ const web3_js_1 = require("@solana/web3.js");
6
+ const constants_1 = require("../../constants");
7
+ const web3_js_2 = require("@solana/web3.js");
8
+ const pda_1 = require("../pda");
9
+ const CREATE_AUCTION_DISCRIMINATOR = Buffer.from([50, 37, 7, 103, 80, 100, 162, 13]);
10
+ function createAuctionIx(params) {
11
+ const { keeper, basket, bountyMint } = params;
12
+ let bountyVault = (0, pda_1.getBountyVaultPda)();
13
+ let bountyVaultAta = (0, pda_1.getAta)(bountyMint, bountyVault);
14
+ let rebalanceIntent = (0, pda_1.getRebalanceIntentPda)(basket, basket);
15
+ let rentPayerPda = (0, pda_1.getRentPayerPda)();
16
+ let globalConfig = (0, pda_1.getGlobalConfigPda)();
17
+ let keeperBountyATA = (0, pda_1.getAta)(keeper, bountyMint);
18
+ const data = CREATE_AUCTION_DISCRIMINATOR;
19
+ const keys = [
20
+ { pubkey: keeper, isWritable: true, isSigner: true },
21
+ { pubkey: basket, isWritable: true, isSigner: false },
22
+ { pubkey: rebalanceIntent, isWritable: true, isSigner: false },
23
+ { pubkey: rentPayerPda, isWritable: true, isSigner: false },
24
+ { pubkey: globalConfig, isWritable: false, isSigner: false },
25
+ { pubkey: bountyMint, isWritable: false, isSigner: false },
26
+ { pubkey: keeperBountyATA, isWritable: true, isSigner: false },
27
+ { pubkey: bountyVault, isWritable: true, isSigner: false },
28
+ { pubkey: bountyVaultAta, isWritable: true, isSigner: false },
29
+ { pubkey: web3_js_2.SystemProgram.programId, isWritable: false, isSigner: false },
30
+ { pubkey: spl_token_1.TOKEN_PROGRAM_ID, isWritable: false, isSigner: false },
31
+ { pubkey: spl_token_1.TOKEN_2022_PROGRAM_ID, isWritable: false, isSigner: false },
32
+ { pubkey: spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, isWritable: false, isSigner: false },
33
+ { pubkey: rebalanceIntent, isWritable: true, isSigner: false }
34
+ ];
35
+ return new web3_js_1.TransactionInstruction({
36
+ keys,
37
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
38
+ data,
39
+ });
40
+ }
@@ -0,0 +1,12 @@
1
+ import { TransactionInstruction } from "@solana/web3.js";
2
+ import { PublicKey } from "@solana/web3.js";
3
+ export declare const CLAIM_BOUNTY_HANDLER_DISCRIMINATOR: Buffer;
4
+ export declare function claimBountyIx(params: {
5
+ keeper: PublicKey;
6
+ basket: PublicKey;
7
+ intent: PublicKey;
8
+ bountyMint: PublicKey;
9
+ bountyDepositor: PublicKey;
10
+ rentPayer: PublicKey;
11
+ keepers: PublicKey[];
12
+ }): TransactionInstruction;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CLAIM_BOUNTY_HANDLER_DISCRIMINATOR = void 0;
4
+ exports.claimBountyIx = claimBountyIx;
5
+ const spl_token_1 = require("@solana/spl-token");
6
+ const web3_js_1 = require("@solana/web3.js");
7
+ const pda_1 = require("../pda");
8
+ const constants_1 = require("../../constants");
9
+ exports.CLAIM_BOUNTY_HANDLER_DISCRIMINATOR = Buffer.from([13, 252, 98, 119, 169, 40, 250, 254]);
10
+ function claimBountyIx(params) {
11
+ const { keeper, basket, intent, bountyMint, bountyDepositor, rentPayer, keepers } = params;
12
+ let bountyVault = (0, pda_1.getBountyVaultPda)();
13
+ let globalConfig = (0, pda_1.getGlobalConfigPda)();
14
+ let keeperBountyAta = (0, pda_1.getAta)(keeper, bountyMint);
15
+ let basketBountyAta = (0, pda_1.getAta)(basket, bountyMint);
16
+ let bountyVaultAta = (0, pda_1.getAta)(bountyVault, bountyMint);
17
+ let bountyDepositorAta = (0, pda_1.getAta)(bountyDepositor, bountyMint);
18
+ const data = exports.CLAIM_BOUNTY_HANDLER_DISCRIMINATOR;
19
+ const keys = [
20
+ { pubkey: keeper, isSigner: true, isWritable: true },
21
+ { pubkey: basket, isSigner: false, isWritable: true },
22
+ { pubkey: intent, isSigner: false, isWritable: true },
23
+ { pubkey: bountyMint, isSigner: false, isWritable: false },
24
+ { pubkey: keeperBountyAta, isSigner: false, isWritable: true },
25
+ { pubkey: basketBountyAta, isSigner: false, isWritable: true },
26
+ { pubkey: bountyVault, isSigner: false, isWritable: true },
27
+ { pubkey: bountyVaultAta, isSigner: false, isWritable: true },
28
+ { pubkey: bountyDepositorAta, isSigner: false, isWritable: true },
29
+ { pubkey: rentPayer, isSigner: false, isWritable: true },
30
+ { pubkey: globalConfig, isSigner: false, isWritable: false },
31
+ { pubkey: web3_js_1.SystemProgram.programId, isSigner: false, isWritable: false },
32
+ { pubkey: spl_token_1.TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
33
+ ];
34
+ keepers.forEach((keeperPubkey) => {
35
+ keys.push({ pubkey: keeperPubkey, isWritable: true, isSigner: false });
36
+ const remKeeperATA = (0, pda_1.getAta)(keeperPubkey, bountyMint);
37
+ keys.push({ pubkey: remKeeperATA, isWritable: true, isSigner: false });
38
+ });
39
+ return new web3_js_1.TransactionInstruction({
40
+ keys,
41
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
42
+ data,
43
+ });
44
+ }
@@ -0,0 +1,21 @@
1
+ import BN from 'bn.js';
2
+ import { PublicKey, TransactionInstruction } from '@solana/web3.js';
3
+ export declare function flashWithdrawIx(params: {
4
+ keeper: PublicKey;
5
+ basket: PublicKey;
6
+ rebalanceIntent?: PublicKey;
7
+ intent?: PublicKey;
8
+ mintIn: PublicKey;
9
+ mintOut: PublicKey;
10
+ amountIn: BN;
11
+ amountOut: BN;
12
+ mode?: number;
13
+ }): TransactionInstruction;
14
+ export declare function flashDepositIx(params: {
15
+ keeper: PublicKey;
16
+ basket: PublicKey;
17
+ rebalanceIntent?: PublicKey;
18
+ intent?: PublicKey;
19
+ mintIn: PublicKey;
20
+ mintOut: PublicKey;
21
+ }): TransactionInstruction;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flashWithdrawIx = flashWithdrawIx;
4
+ exports.flashDepositIx = flashDepositIx;
5
+ const spl_token_1 = require("@solana/spl-token");
6
+ const web3_js_1 = require("@solana/web3.js");
7
+ const constants_1 = require("../../constants");
8
+ const pda_1 = require("../pda");
9
+ const FLASH_WITHDRAW_DISCRIMINATOR = Buffer.from([164, 84, 46, 132, 94, 220, 214, 156]);
10
+ const FLASH_DEPOSIT_DISCRIMINATOR = Buffer.from([21, 4, 89, 84, 131, 84, 128, 21]);
11
+ function flashWithdrawIx(params) {
12
+ var _a, _b;
13
+ const { keeper, basket, mintIn, mintOut, amountIn, amountOut, mode } = params;
14
+ let keeperFromATA = (0, pda_1.getAta)(keeper, mintIn);
15
+ let keeperToATA = (0, pda_1.getAta)(keeper, mintOut);
16
+ let basketInATA = (0, pda_1.getAta)(basket, mintIn);
17
+ let basketOutATA = (0, pda_1.getAta)(basket, mintOut);
18
+ const keys = [
19
+ { pubkey: params.keeper, isWritable: true, isSigner: true },
20
+ { pubkey: params.basket, isWritable: true, isSigner: false },
21
+ { pubkey: (_a = params.rebalanceIntent) !== null && _a !== void 0 ? _a : constants_1.BASKETS_V3_PROGRAM_ID, isWritable: params.rebalanceIntent ? true : false, isSigner: false },
22
+ { pubkey: (_b = params.intent) !== null && _b !== void 0 ? _b : constants_1.BASKETS_V3_PROGRAM_ID, isWritable: params.intent ? true : false, isSigner: false },
23
+ { pubkey: params.mintIn, isWritable: false, isSigner: false },
24
+ { pubkey: params.mintOut, isWritable: false, isSigner: false },
25
+ { pubkey: keeperFromATA, isWritable: true, isSigner: false },
26
+ { pubkey: keeperToATA, isWritable: true, isSigner: false },
27
+ { pubkey: basketInATA, isWritable: true, isSigner: false },
28
+ { pubkey: basketOutATA, isWritable: true, isSigner: false },
29
+ { pubkey: (0, pda_1.getGlobalConfigPda)(), isWritable: false, isSigner: false },
30
+ { pubkey: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY, isWritable: false, isSigner: false },
31
+ { pubkey: spl_token_1.TOKEN_PROGRAM_ID, isWritable: false, isSigner: false },
32
+ { pubkey: spl_token_1.TOKEN_2022_PROGRAM_ID, isWritable: false, isSigner: false },
33
+ ];
34
+ const discriminator = FLASH_WITHDRAW_DISCRIMINATOR;
35
+ const amountInBuffer = Buffer.from(amountIn.toArray("le", 8));
36
+ const amountOutBuffer = Buffer.from(amountOut.toArray("le", 8));
37
+ const modeBuffer = Buffer.from([mode !== null && mode !== void 0 ? mode : 0]);
38
+ const data = Buffer.concat([discriminator, amountInBuffer, amountOutBuffer, modeBuffer]);
39
+ return new web3_js_1.TransactionInstruction({
40
+ keys,
41
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
42
+ data,
43
+ });
44
+ }
45
+ function flashDepositIx(params) {
46
+ const { keeper, basket, mintIn, mintOut } = params;
47
+ let keeperFromATA = (0, pda_1.getAta)(keeper, mintIn);
48
+ let keeperToATA = (0, pda_1.getAta)(keeper, mintOut);
49
+ let basketInATA = (0, pda_1.getAta)(basket, mintIn);
50
+ let basketOutATA = (0, pda_1.getAta)(basket, mintOut);
51
+ const keys = [
52
+ { pubkey: params.keeper, isWritable: true, isSigner: true },
53
+ { pubkey: params.basket, isWritable: true, isSigner: false },
54
+ { pubkey: params.rebalanceIntent ? params.rebalanceIntent : constants_1.BASKETS_V3_PROGRAM_ID, isWritable: params.rebalanceIntent ? true : false, isSigner: false },
55
+ { pubkey: params.intent ? params.intent : constants_1.BASKETS_V3_PROGRAM_ID, isWritable: params.intent ? true : false, isSigner: false },
56
+ { pubkey: params.mintIn, isWritable: false, isSigner: false },
57
+ { pubkey: params.mintOut, isWritable: false, isSigner: false },
58
+ { pubkey: keeperFromATA, isWritable: true, isSigner: false },
59
+ { pubkey: keeperToATA, isWritable: true, isSigner: false },
60
+ { pubkey: basketInATA, isWritable: true, isSigner: false },
61
+ { pubkey: basketOutATA, isWritable: true, isSigner: false },
62
+ { pubkey: (0, pda_1.getGlobalConfigPda)(), isWritable: false, isSigner: false },
63
+ { pubkey: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY, isWritable: false, isSigner: false },
64
+ { pubkey: spl_token_1.TOKEN_PROGRAM_ID, isWritable: false, isSigner: false },
65
+ { pubkey: spl_token_1.TOKEN_2022_PROGRAM_ID, isWritable: false, isSigner: false },
66
+ ];
67
+ const discriminator = FLASH_DEPOSIT_DISCRIMINATOR;
68
+ const data = Buffer.concat([discriminator]);
69
+ return new web3_js_1.TransactionInstruction({
70
+ keys,
71
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
72
+ data,
73
+ });
74
+ }
@@ -0,0 +1,19 @@
1
+ import { PublicKey, TransactionInstruction } from '@solana/web3.js';
2
+ import { OraclePriceOnChain } from '../../layouts/oracle';
3
+ export declare function updateTokenPricesIx(params: {
4
+ keeper: PublicKey;
5
+ basket: PublicKey;
6
+ rebalanceIntent: PublicKey;
7
+ basketRebalanceIntent?: PublicKey;
8
+ lookupTable0: PublicKey;
9
+ lookupTable1: PublicKey;
10
+ tokenIndices: number[];
11
+ additionalOracleAccounts: PublicKey[];
12
+ basketMint?: PublicKey;
13
+ }): TransactionInstruction;
14
+ export declare function updateTokenPricesCustomIx(params: {
15
+ manager: PublicKey;
16
+ basket: PublicKey;
17
+ tokenIndices: number[];
18
+ tokenPrices: OraclePriceOnChain[];
19
+ }): TransactionInstruction;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.updateTokenPricesIx = updateTokenPricesIx;
7
+ exports.updateTokenPricesCustomIx = updateTokenPricesCustomIx;
8
+ const web3_js_1 = require("@solana/web3.js");
9
+ const constants_1 = require("../../constants");
10
+ const oracle_1 = require("../../layouts/oracle");
11
+ const pda_1 = require("../pda");
12
+ const bn_js_1 = __importDefault(require("bn.js"));
13
+ const spl_token_1 = require("@solana/spl-token");
14
+ const UPDATE_TOKEN_PRICES_DISCRIMINATOR = Buffer.from([147, 87, 140, 33, 214, 189, 181, 242]);
15
+ const UPDATE_TOKEN_PRICES_CUSTOM_DISCRIMINATOR = Buffer.from([71, 100, 35, 136, 116, 239, 54, 126]);
16
+ function updateTokenPricesIx(params) {
17
+ var _a;
18
+ let globalConfig = (0, pda_1.getGlobalConfigPda)();
19
+ const tokenIndices = params.tokenIndices.slice(0, 20);
20
+ while (tokenIndices.length < 20) {
21
+ tokenIndices.push(0);
22
+ }
23
+ const data = Buffer.concat([
24
+ Buffer.from(UPDATE_TOKEN_PRICES_DISCRIMINATOR), // 8 bytes
25
+ Buffer.from(tokenIndices)
26
+ ]);
27
+ const keys = [
28
+ { pubkey: params.keeper, isSigner: true, isWritable: true },
29
+ { pubkey: params.basket, isSigner: false, isWritable: true },
30
+ { pubkey: params.rebalanceIntent, isSigner: false, isWritable: true },
31
+ { pubkey: globalConfig, isSigner: false, isWritable: false },
32
+ { pubkey: constants_1.PYTHNET_CUSTODY_PRICE_WSOL_ACCOUNT, isSigner: false, isWritable: true },
33
+ { pubkey: constants_1.PYTHNET_CUSTODY_PRICE_USDC_ACCOUNT, isSigner: false, isWritable: true },
34
+ { pubkey: params.lookupTable0, isSigner: false, isWritable: true },
35
+ { pubkey: params.lookupTable1, isSigner: false, isWritable: true },
36
+ { pubkey: (_a = params.basketRebalanceIntent) !== null && _a !== void 0 ? _a : constants_1.BASKETS_V3_PROGRAM_ID, isSigner: false, isWritable: params.basketRebalanceIntent ? true : false },
37
+ ];
38
+ // remaining accounts
39
+ keys.push(...params.additionalOracleAccounts.map((pubkey) => ({ pubkey, isSigner: false, isWritable: false })));
40
+ if (params.basketMint) {
41
+ let basketFeesWallet = (0, pda_1.getBasketFeesPda)(params.basket);
42
+ let basketFeesTokenAccount = (0, pda_1.getAta)(basketFeesWallet, params.basketMint);
43
+ keys.push({ pubkey: spl_token_1.TOKEN_PROGRAM_ID, isSigner: false, isWritable: false });
44
+ keys.push({ pubkey: params.basketMint, isSigner: false, isWritable: true });
45
+ keys.push({ pubkey: basketFeesTokenAccount, isSigner: false, isWritable: true });
46
+ }
47
+ return new web3_js_1.TransactionInstruction({
48
+ keys,
49
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
50
+ data
51
+ });
52
+ }
53
+ function updateTokenPricesCustomIx(params) {
54
+ const { manager, basket } = params;
55
+ const globalConfig = (0, pda_1.getGlobalConfigPda)();
56
+ const rebalanceIntent = (0, pda_1.getRebalanceIntentPda)(basket, manager);
57
+ const tokenIndices = params.tokenIndices.slice(0, 10);
58
+ while (tokenIndices.length < 10)
59
+ tokenIndices.push(0);
60
+ const tokenPrices = params.tokenPrices.slice(0, 10);
61
+ while (tokenPrices.length < 10) {
62
+ tokenPrices.push({
63
+ price: { high: new bn_js_1.default(0), low: new bn_js_1.default(0) },
64
+ conf: { high: new bn_js_1.default(0), low: new bn_js_1.default(0) },
65
+ updateTime: new bn_js_1.default(0),
66
+ });
67
+ }
68
+ const pricesBufs = tokenPrices.map((p) => {
69
+ const buf = Buffer.alloc(oracle_1.OraclePriceLayout.span);
70
+ oracle_1.OraclePriceLayout.encode(p, buf);
71
+ return buf;
72
+ });
73
+ const data = Buffer.concat([
74
+ Buffer.from(UPDATE_TOKEN_PRICES_CUSTOM_DISCRIMINATOR),
75
+ Buffer.from(tokenIndices),
76
+ ...pricesBufs,
77
+ ]);
78
+ const keys = [
79
+ { pubkey: manager, isSigner: true, isWritable: true },
80
+ { pubkey: basket, isSigner: false, isWritable: true },
81
+ { pubkey: rebalanceIntent, isSigner: false, isWritable: true },
82
+ { pubkey: globalConfig, isSigner: false, isWritable: false },
83
+ ];
84
+ return new web3_js_1.TransactionInstruction({
85
+ keys,
86
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
87
+ data,
88
+ });
89
+ }
@@ -0,0 +1,32 @@
1
+ import BN from 'bn.js';
2
+ import { PublicKey, TransactionInstruction } from '@solana/web3.js';
3
+ export declare function createRebalanceIntentIx(params: {
4
+ signer: PublicKey;
5
+ owner: PublicKey;
6
+ basket: PublicKey;
7
+ }): TransactionInstruction;
8
+ export declare function resizeRebalanceIntentIx(rebalanceIntent: PublicKey): TransactionInstruction;
9
+ export declare function initRebalanceIntentIx(params: {
10
+ signer: PublicKey;
11
+ owner: PublicKey;
12
+ basket: PublicKey;
13
+ basketTokenMint: PublicKey;
14
+ rebalanceIntentRentPayer: PublicKey;
15
+ bountyMint: PublicKey;
16
+ rebalanceType: number;
17
+ basketRebalanceIntent: PublicKey | undefined;
18
+ rebalanceSlippageBps: number;
19
+ perTradeRebalanceSlippageBps: number;
20
+ executionStartTime: number;
21
+ minBountyAmount: number;
22
+ maxBountyAmount: number;
23
+ withdrawParamsBurnAmount?: number;
24
+ withdrawParamsTokenMintsHash?: number[];
25
+ withdrawParamsKeepTokensBitmask?: BN;
26
+ withdrawParamsKeepAllTokens?: number;
27
+ }): TransactionInstruction;
28
+ export declare function cancelRebalanceIx(params: {
29
+ keeper: PublicKey;
30
+ basket: PublicKey;
31
+ rebalanceIntent: PublicKey;
32
+ }): TransactionInstruction;
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createRebalanceIntentIx = createRebalanceIntentIx;
7
+ exports.resizeRebalanceIntentIx = resizeRebalanceIntentIx;
8
+ exports.initRebalanceIntentIx = initRebalanceIntentIx;
9
+ exports.cancelRebalanceIx = cancelRebalanceIx;
10
+ const bn_js_1 = __importDefault(require("bn.js"));
11
+ const spl_token_1 = require("@solana/spl-token");
12
+ const web3_js_1 = require("@solana/web3.js");
13
+ const constants_1 = require("../../constants");
14
+ const pda_1 = require("../pda");
15
+ const CREATE_REBALANCE_INTENT_DISCRIMINATOR = Buffer.from([120, 80, 245, 123, 212, 149, 163, 47]);
16
+ const RESIZE_REBALANCE_INTENT_HANDLER = Buffer.from([71, 204, 243, 183, 209, 118, 111, 94]);
17
+ const INIT_REBALANCE_INTENT_DISCRIMINATOR = Buffer.from([127, 215, 41, 110, 244, 179, 131, 7]);
18
+ const CANCEL_REBALANCE_DISCRIMINATOR = Buffer.from([51, 236, 71, 57, 141, 130, 39, 151]);
19
+ function createRebalanceIntentIx(params) {
20
+ const { signer, owner, basket } = params;
21
+ const rebalanceIntent = (0, pda_1.getRebalanceIntentPda)(basket, owner);
22
+ const rentPayerPda = (0, pda_1.getRentPayerPda)();
23
+ const globalConfig = (0, pda_1.getGlobalConfigPda)();
24
+ const keys = [
25
+ { pubkey: signer, isSigner: true, isWritable: true },
26
+ { pubkey: owner, isSigner: false, isWritable: true },
27
+ { pubkey: basket, isSigner: false, isWritable: true },
28
+ { pubkey: rebalanceIntent, isSigner: false, isWritable: true },
29
+ { pubkey: rentPayerPda, isSigner: false, isWritable: true },
30
+ { pubkey: globalConfig, isSigner: false, isWritable: false },
31
+ { pubkey: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY, isSigner: false, isWritable: false },
32
+ { pubkey: web3_js_1.SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false },
33
+ { pubkey: web3_js_1.SystemProgram.programId, isSigner: false, isWritable: false },
34
+ ];
35
+ return new web3_js_1.TransactionInstruction({
36
+ keys,
37
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
38
+ data: CREATE_REBALANCE_INTENT_DISCRIMINATOR,
39
+ });
40
+ }
41
+ function resizeRebalanceIntentIx(rebalanceIntent) {
42
+ const data = RESIZE_REBALANCE_INTENT_HANDLER;
43
+ const keys = [
44
+ { pubkey: rebalanceIntent, isSigner: false, isWritable: true }
45
+ ];
46
+ return new web3_js_1.TransactionInstruction({
47
+ keys,
48
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
49
+ data
50
+ });
51
+ }
52
+ function initRebalanceIntentIx(params) {
53
+ const { signer, owner, basket, basketTokenMint, rebalanceIntentRentPayer, bountyMint, rebalanceType, rebalanceSlippageBps, perTradeRebalanceSlippageBps, executionStartTime, minBountyAmount, maxBountyAmount, withdrawParamsBurnAmount = 0, withdrawParamsTokenMintsHash = new Array(32).fill(0), withdrawParamsKeepTokensBitmask = new bn_js_1.default(0), withdrawParamsKeepAllTokens = 0, basketRebalanceIntent, } = params;
54
+ const rebalanceIntent = (0, pda_1.getRebalanceIntentPda)(basket, owner);
55
+ const rentPayerPda = (0, pda_1.getRentPayerPda)();
56
+ const globalConfig = (0, pda_1.getGlobalConfigPda)();
57
+ const bountyVault = (0, pda_1.getBountyVaultPda)();
58
+ const basketFeesPda = (0, pda_1.getBasketFeesPda)(basket);
59
+ const signerBasketAta = (0, pda_1.getAta)(signer, basketTokenMint);
60
+ const signerBountyAta = (0, pda_1.getAta)(signer, bountyMint);
61
+ const bountyVaultAta = (0, pda_1.getAta)(bountyVault, bountyMint);
62
+ const basketFeesAta = (0, pda_1.getAta)(basketFeesPda, basketTokenMint);
63
+ const data = Buffer.concat([
64
+ INIT_REBALANCE_INTENT_DISCRIMINATOR,
65
+ rebalanceIntentRentPayer.toBuffer(),
66
+ Buffer.from([rebalanceType]),
67
+ Buffer.from(new bn_js_1.default(rebalanceSlippageBps).toArray("le", 2)),
68
+ Buffer.from(new bn_js_1.default(perTradeRebalanceSlippageBps).toArray("le", 2)),
69
+ Buffer.from(new bn_js_1.default(executionStartTime).toArray("le", 8)),
70
+ Buffer.from(new bn_js_1.default(minBountyAmount).toArray("le", 8)),
71
+ Buffer.from(new bn_js_1.default(maxBountyAmount).toArray("le", 8)),
72
+ Buffer.from(new bn_js_1.default(withdrawParamsBurnAmount).toArray("le", 8)),
73
+ Buffer.from(withdrawParamsTokenMintsHash),
74
+ Buffer.from(withdrawParamsKeepTokensBitmask.toArray("le", 16)),
75
+ Buffer.from([withdrawParamsKeepAllTokens]),
76
+ ]);
77
+ const keys = [
78
+ { pubkey: signer, isSigner: true, isWritable: true },
79
+ { pubkey: owner, isSigner: false, isWritable: true },
80
+ { pubkey: basket, isSigner: false, isWritable: true },
81
+ { pubkey: rebalanceIntent, isSigner: false, isWritable: true },
82
+ { pubkey: rentPayerPda, isSigner: false, isWritable: true },
83
+ { pubkey: basketTokenMint, isSigner: false, isWritable: true },
84
+ { pubkey: signerBasketAta, isSigner: false, isWritable: true },
85
+ { pubkey: globalConfig, isSigner: false, isWritable: false },
86
+ { pubkey: bountyMint, isSigner: false, isWritable: false },
87
+ { pubkey: signerBountyAta, isSigner: false, isWritable: true },
88
+ { pubkey: bountyVault, isSigner: false, isWritable: true },
89
+ { pubkey: bountyVaultAta, isSigner: false, isWritable: true },
90
+ { pubkey: basketFeesPda, isSigner: false, isWritable: true },
91
+ { pubkey: basketFeesAta, isSigner: false, isWritable: true },
92
+ { pubkey: basketRebalanceIntent ? basketRebalanceIntent : constants_1.BASKETS_V3_PROGRAM_ID, isSigner: false, isWritable: basketRebalanceIntent ? true : false },
93
+ { pubkey: web3_js_1.SystemProgram.programId, isSigner: false, isWritable: false },
94
+ { pubkey: spl_token_1.TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
95
+ { pubkey: spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
96
+ ];
97
+ return new web3_js_1.TransactionInstruction({
98
+ keys,
99
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
100
+ data,
101
+ });
102
+ }
103
+ function cancelRebalanceIx(params) {
104
+ const { keeper, basket, rebalanceIntent } = params;
105
+ const globalConfig = (0, pda_1.getGlobalConfigPda)();
106
+ const keys = [
107
+ { pubkey: keeper, isSigner: true, isWritable: true },
108
+ { pubkey: basket, isSigner: false, isWritable: true },
109
+ { pubkey: rebalanceIntent, isSigner: false, isWritable: true },
110
+ { pubkey: globalConfig, isSigner: false, isWritable: false },
111
+ ];
112
+ return new web3_js_1.TransactionInstruction({
113
+ keys,
114
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
115
+ data: CANCEL_REBALANCE_DISCRIMINATOR,
116
+ });
117
+ }
@@ -0,0 +1,11 @@
1
+ import { BN } from '@coral-xyz/anchor';
2
+ import { PublicKey, TransactionInstruction } from '@solana/web3.js';
3
+ export declare function rebalanceSwapIx(params: {
4
+ keeper: PublicKey;
5
+ basket: PublicKey;
6
+ mintFrom: PublicKey;
7
+ mintTo: PublicKey;
8
+ amountIn: BN;
9
+ amountOut: BN;
10
+ mode: number;
11
+ }): TransactionInstruction;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rebalanceSwapIx = rebalanceSwapIx;
4
+ const spl_token_1 = require("@solana/spl-token");
5
+ const web3_js_1 = require("@solana/web3.js");
6
+ const constants_1 = require("../../constants");
7
+ const pda_1 = require("../pda");
8
+ const REBALANCE_SWAP_DISCRIMINATOR = Buffer.from([101, 122, 61, 201, 21, 165, 177, 213]);
9
+ function rebalanceSwapIx(params) {
10
+ const { keeper, basket, mintFrom, mintTo, amountIn, amountOut, mode } = params;
11
+ let rebalanceIntent = (0, pda_1.getRebalanceIntentPda)(basket, keeper); // TODO: incorrect. Pass intent as func param
12
+ let keeperFromATA = (0, pda_1.getAta)(keeper, mintFrom);
13
+ let keeperToATA = (0, pda_1.getAta)(keeper, mintTo);
14
+ let basketFromATA = (0, pda_1.getAta)(basket, mintFrom);
15
+ let basketToATA = (0, pda_1.getAta)(basket, mintTo);
16
+ const keys = [
17
+ { pubkey: params.keeper, isWritable: true, isSigner: true },
18
+ { pubkey: params.basket, isWritable: true, isSigner: false },
19
+ { pubkey: rebalanceIntent, isWritable: true, isSigner: false },
20
+ { pubkey: params.mintFrom, isWritable: false, isSigner: false },
21
+ { pubkey: params.mintTo, isWritable: false, isSigner: false },
22
+ { pubkey: keeperFromATA, isWritable: true, isSigner: false },
23
+ { pubkey: keeperToATA, isWritable: true, isSigner: false },
24
+ { pubkey: basketFromATA, isWritable: true, isSigner: false },
25
+ { pubkey: basketToATA, isWritable: true, isSigner: false },
26
+ { pubkey: (0, pda_1.getGlobalConfigPda)(), isWritable: false, isSigner: false },
27
+ { pubkey: web3_js_1.SystemProgram.programId, isWritable: false, isSigner: false },
28
+ { pubkey: spl_token_1.TOKEN_PROGRAM_ID, isWritable: false, isSigner: false },
29
+ { pubkey: spl_token_1.TOKEN_2022_PROGRAM_ID, isWritable: false, isSigner: false },
30
+ { pubkey: spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, isWritable: false, isSigner: false },
31
+ ];
32
+ const discriminator = REBALANCE_SWAP_DISCRIMINATOR;
33
+ const amountInBuffer = Buffer.from(amountIn.toArray("le", 8));
34
+ const amountOutBuffer = Buffer.from(amountOut.toArray("le", 8));
35
+ const modeBuffer = Buffer.from([mode]);
36
+ const data = Buffer.concat([discriminator, amountInBuffer, amountOutBuffer, modeBuffer]);
37
+ return new web3_js_1.TransactionInstruction({
38
+ keys,
39
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
40
+ data,
41
+ });
42
+ }
@@ -0,0 +1,7 @@
1
+ import { PublicKey, TransactionInstruction } from '@solana/web3.js';
2
+ export declare function addBountyIx(params: {
3
+ keeper: PublicKey;
4
+ basket: PublicKey;
5
+ bountyMint: PublicKey;
6
+ amount: number;
7
+ }): TransactionInstruction;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.addBountyIx = addBountyIx;
7
+ const bn_js_1 = __importDefault(require("bn.js"));
8
+ const spl_token_1 = require("@solana/spl-token");
9
+ const web3_js_1 = require("@solana/web3.js");
10
+ const constants_1 = require("../../constants");
11
+ const pda_1 = require("../pda");
12
+ const ADD_BOUNTY_DISCRIMINATOR = Buffer.from([84, 56, 167, 193, 17, 91, 42, 143,]);
13
+ function addBountyIx(params) {
14
+ const { keeper, basket, bountyMint, amount, } = params;
15
+ let bountyVault = (0, pda_1.getBountyVaultPda)();
16
+ let globalConfig = (0, pda_1.getGlobalConfigPda)();
17
+ let keeperBountyAta = (0, pda_1.getAta)(keeper, bountyMint);
18
+ let bountyVaultAta = (0, pda_1.getAta)(bountyVault, bountyMint);
19
+ const data = Buffer.concat([
20
+ ADD_BOUNTY_DISCRIMINATOR,
21
+ Buffer.from(new bn_js_1.default(amount).toArray("le", 8)), // u64 LE
22
+ ]);
23
+ const keys = [
24
+ { pubkey: keeper, isSigner: true, isWritable: true },
25
+ { pubkey: basket, isSigner: false, isWritable: true },
26
+ { pubkey: bountyMint, isSigner: false, isWritable: false },
27
+ { pubkey: keeperBountyAta, isSigner: false, isWritable: true },
28
+ { pubkey: bountyVault, isSigner: false, isWritable: true },
29
+ { pubkey: bountyVaultAta, isSigner: false, isWritable: true },
30
+ { pubkey: globalConfig, isSigner: false, isWritable: false },
31
+ { pubkey: web3_js_1.SystemProgram.programId, isSigner: false, isWritable: false },
32
+ { pubkey: spl_token_1.TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
33
+ { pubkey: spl_token_1.TOKEN_2022_PROGRAM_ID, isSigner: false, isWritable: false },
34
+ { pubkey: spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
35
+ ];
36
+ return new web3_js_1.TransactionInstruction({
37
+ keys,
38
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
39
+ data,
40
+ });
41
+ }
@@ -0,0 +1,9 @@
1
+ import { PublicKey, TransactionInstruction } from '@solana/web3.js';
2
+ import { GlobalConfig } from '../../layouts/config';
3
+ export declare function createGlobalConfigIx(params: {
4
+ admin: PublicKey;
5
+ }): TransactionInstruction;
6
+ export declare function editGlobalConfigIx(params: {
7
+ signer: PublicKey;
8
+ config: GlobalConfig;
9
+ }): TransactionInstruction;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createGlobalConfigIx = createGlobalConfigIx;
4
+ exports.editGlobalConfigIx = editGlobalConfigIx;
5
+ const web3_js_1 = require("@solana/web3.js");
6
+ const spl_token_1 = require("@solana/spl-token");
7
+ const constants_1 = require("../../constants");
8
+ const config_1 = require("../../layouts/config");
9
+ const pda_1 = require("../pda");
10
+ const CREATE_GLOBAL_CONFIG_DISCRIMINATOR = Buffer.from([62, 50, 47, 241, 153, 49, 252, 239]);
11
+ const EDIT_GLOBAL_CONFIG_DISCRIMINATOR = Buffer.from([209, 246, 241, 219, 204, 153, 103, 175]);
12
+ function createGlobalConfigIx(params) {
13
+ const { admin } = params;
14
+ let globalConfig = (0, pda_1.getGlobalConfigPda)();
15
+ const data = CREATE_GLOBAL_CONFIG_DISCRIMINATOR;
16
+ const keys = [
17
+ { pubkey: admin, isSigner: true, isWritable: true },
18
+ { pubkey: globalConfig, isSigner: false, isWritable: true },
19
+ { pubkey: web3_js_1.SystemProgram.programId, isSigner: false, isWritable: false },
20
+ { pubkey: web3_js_1.SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false },
21
+ ];
22
+ return new web3_js_1.TransactionInstruction({
23
+ keys,
24
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
25
+ data,
26
+ });
27
+ }
28
+ function editGlobalConfigIx(params) {
29
+ const discriminator = EDIT_GLOBAL_CONFIG_DISCRIMINATOR;
30
+ let globalConfig = (0, pda_1.getGlobalConfigPda)();
31
+ const buffer = Buffer.alloc(config_1.GlobalConfigLayout.span);
32
+ const len = config_1.GlobalConfigLayout.encode(params.config, buffer);
33
+ const data = Buffer.concat([discriminator, buffer.slice(0, len)]);
34
+ let bountyMint = params.config.bountyMint;
35
+ let bountyVault = (0, pda_1.getBountyVaultPda)();
36
+ let bountyVaultAta = (0, pda_1.getAta)(bountyVault, bountyMint);
37
+ const keys = [
38
+ { pubkey: params.signer, isSigner: true, isWritable: true },
39
+ { pubkey: globalConfig, isSigner: false, isWritable: true },
40
+ { pubkey: bountyMint, isSigner: false, isWritable: false },
41
+ { pubkey: bountyVault, isSigner: false, isWritable: false },
42
+ { pubkey: bountyVaultAta, isSigner: false, isWritable: true },
43
+ { pubkey: web3_js_1.SystemProgram.programId, isSigner: false, isWritable: false },
44
+ { pubkey: spl_token_1.TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
45
+ { pubkey: spl_token_1.TOKEN_2022_PROGRAM_ID, isSigner: false, isWritable: false },
46
+ { pubkey: spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
47
+ ];
48
+ return new web3_js_1.TransactionInstruction({
49
+ keys,
50
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
51
+ data,
52
+ });
53
+ }
@@ -0,0 +1,15 @@
1
+ import { PublicKey, TransactionInstruction } from '@solana/web3.js';
2
+ export declare function withdrawFeesIx(params: {
3
+ claimer: PublicKey;
4
+ basketTokenMint: PublicKey;
5
+ feeType: number;
6
+ }): TransactionInstruction;
7
+ export declare function claimFeeTokensFromBasketIx(params: {
8
+ signer: PublicKey;
9
+ basket: PublicKey;
10
+ withdrawBasketFees: PublicKey;
11
+ rentPayer: PublicKey;
12
+ owners: PublicKey[];
13
+ tokenMints: PublicKey[];
14
+ }): TransactionInstruction;
15
+ export declare function claimFeeTokensFromBasketIxs(signer: PublicKey, basket: PublicKey, withdrawBasketFees: PublicKey, rentPayer: PublicKey, owners: PublicKey[], tokenMints: PublicKey[]): TransactionInstruction[];