@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,477 @@
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.editPrivateBasketSettingsIx = editPrivateBasketSettingsIx;
7
+ exports.createEditBasketIntentIx = createEditBasketIntentIx;
8
+ exports.executeEditBasketIntentIx = executeEditBasketIntentIx;
9
+ exports.cancelIntentIx = cancelIntentIx;
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 config_1 = require("../../layouts/config");
15
+ const oracle_1 = require("../../layouts/oracle");
16
+ const pda_1 = require("../pda");
17
+ const intent_1 = require("../../layouts/intents/intent");
18
+ const decimal_js_1 = __importDefault(require("decimal.js"));
19
+ const fraction_1 = require("../../layouts/fraction");
20
+ const basket_1 = require("../../states/basket");
21
+ const EDIT_PRIVATE_BASKET_SETTINGS_DISCRIMINATOR = Buffer.from([202, 54, 138, 17, 3, 104, 128, 229]);
22
+ const CREATE_EDIT_BASKET_INTENT_DISCRIMINATOR = Buffer.from([82, 150, 58, 227, 153, 129, 20, 30]);
23
+ const EDIT_BASKET_DISCRIMINATOR = Buffer.from([156, 31, 4, 39, 248, 29, 55, 220]);
24
+ const CANCEL_INTENT_DISCRIMINATOR = Buffer.from([181, 103, 27, 100, 84, 89, 70, 236]);
25
+ function editPrivateBasketSettingsIx(params) {
26
+ let metadataAccount = (0, pda_1.getMetadataAccount)(params.mint);
27
+ let globalConfig = (0, pda_1.getGlobalConfigPda)();
28
+ let managerSettingsBuffer = Buffer.alloc(config_1.ManagerSettingsLayout.span);
29
+ config_1.ManagerSettingsLayout.encode(params.managerSettingsBytes, managerSettingsBuffer);
30
+ let authorityBitmasksBuffer = Buffer.alloc(config_1.AuthorityBitmasksLayout.span);
31
+ config_1.AuthorityBitmasksLayout.encode(params.authorityBitmasks, authorityBitmasksBuffer);
32
+ let feeSettingsBuffer = Buffer.alloc(config_1.FeeSettingsLayout.span);
33
+ config_1.FeeSettingsLayout.encode(params.feeSettingsBytes, feeSettingsBuffer);
34
+ let scheduleSettingsBuffer = Buffer.alloc(config_1.ScheduleSettingsLayout.span);
35
+ config_1.ScheduleSettingsLayout.encode(params.scheduleBytes, scheduleSettingsBuffer);
36
+ let automationSettingsBuffer = Buffer.alloc(config_1.AutomationSettingsLayout.span);
37
+ config_1.AutomationSettingsLayout.encode(params.automationSettingsBytes, automationSettingsBuffer);
38
+ let lpSettingsBuffer = Buffer.alloc(config_1.LpSettingsLayout.span);
39
+ config_1.LpSettingsLayout.encode(params.lpSettingsBytes, lpSettingsBuffer);
40
+ const data = Buffer.concat([
41
+ EDIT_PRIVATE_BASKET_SETTINGS_DISCRIMINATOR,
42
+ Buffer.from([params.basketType]),
43
+ managerSettingsBuffer,
44
+ authorityBitmasksBuffer,
45
+ feeSettingsBuffer,
46
+ scheduleSettingsBuffer,
47
+ automationSettingsBuffer,
48
+ lpSettingsBuffer,
49
+ (0, pda_1.serializeString)(params.metadataParams.name),
50
+ (0, pda_1.serializeString)(params.metadataParams.symbol),
51
+ (0, pda_1.serializeString)(params.metadataParams.uri),
52
+ Buffer.from([params.depositsAreAllowed]),
53
+ Buffer.from([params.forceRebalanceIsAllowed]),
54
+ Buffer.from([params.customRebalanceIsAllowed]),
55
+ ]);
56
+ const keys = [
57
+ { pubkey: params.creator, isSigner: true, isWritable: true },
58
+ { pubkey: params.basket, isSigner: false, isWritable: true },
59
+ { pubkey: metadataAccount, isSigner: false, isWritable: true },
60
+ { pubkey: globalConfig, isSigner: false, isWritable: false },
61
+ { pubkey: constants_1.METADATA_PROGRAM_ID, isSigner: false, isWritable: false }
62
+ ];
63
+ return new web3_js_1.TransactionInstruction({
64
+ keys,
65
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
66
+ data
67
+ });
68
+ }
69
+ function createEditBasketIntentIx(params) {
70
+ var _a, _b, _c;
71
+ const { manager, basket, intent, intentSeedArray, editType, editData, activationTimestamp, expirationTimestamp, minBounty, maxBounty, tokenProgram, } = params;
72
+ let globalConfig = (0, pda_1.getGlobalConfigPda)();
73
+ let bountyVault = (0, pda_1.getBountyVaultPda)();
74
+ let bountyMint = basket.settings.bountyMint;
75
+ let managerBountyATA = (0, pda_1.getAta)(manager, bountyMint);
76
+ let bountyVaultATA = (0, pda_1.getAta)(bountyVault, bountyMint);
77
+ const intentSeedArrayBuf = Buffer.from(intentSeedArray);
78
+ const editTypeBuf = Buffer.from([editType]);
79
+ let editDataBuf = Buffer.alloc(260);
80
+ let additionalAccounts = [];
81
+ switch (editType) {
82
+ case intent_1.TaskType.EditCreator: // 1
83
+ let creatorSettings = editData;
84
+ let editCreator = {
85
+ creator: new web3_js_1.PublicKey(creatorSettings.creator),
86
+ };
87
+ config_1.EditCreatorLayout.encode(editCreator, editDataBuf);
88
+ break;
89
+ case intent_1.TaskType.EditManagerSettings: // 2
90
+ let managerSettings = editData;
91
+ let managersWeights = managerSettings.managers.map((manager) => manager.fee_split_weight_bps);
92
+ let managers = managerSettings.managers.map((manager) => new web3_js_1.PublicKey(manager.pubkey));
93
+ while (managers.length < config_1.MAX_MANAGERS_PER_BASKET) {
94
+ managers.push(web3_js_1.PublicKey.default);
95
+ managersWeights.push(0);
96
+ }
97
+ let startIndex = 0;
98
+ for (let i = 0; i < config_1.MAX_MANAGERS_PER_BASKET; i++) {
99
+ editDataBuf.writeUInt16LE(managersWeights[i], startIndex);
100
+ if (!managers[i].equals(web3_js_1.PublicKey.default)) {
101
+ additionalAccounts.push({
102
+ pubkey: managers[i],
103
+ isWritable: true,
104
+ isSigner: false
105
+ });
106
+ }
107
+ startIndex += 2;
108
+ }
109
+ let authorityBitmasks = {
110
+ scheduleAuthorityBitmask: 0,
111
+ feesAuthorityBitmask: 0,
112
+ managersAuthorityBitmask: 0,
113
+ automationAuthorityBitmask: 0,
114
+ lpAuthorityBitmask: 0,
115
+ metadataAuthorityBitmask: 0,
116
+ depositsAuthorityBitmask: 0,
117
+ forceRebalanceAuthorityBitmask: 0,
118
+ customRebalanceAuthorityBitmask: 0,
119
+ addTokenIntentAuthorityBitmask: 0,
120
+ updateWeightsIntentAuthorityBitmask: 0,
121
+ makeDirectSwapIntentAuthorityBitmask: 0,
122
+ extraData: 0,
123
+ extraData1: 0,
124
+ extraData2: 0,
125
+ };
126
+ for (let i = 0; i < managerSettings.managers.length; i++) {
127
+ let bitPow = (2 ** i);
128
+ authorityBitmasks.managersAuthorityBitmask |= managerSettings.managers[i].authorities.managers ? bitPow : 0;
129
+ authorityBitmasks.feesAuthorityBitmask |= managerSettings.managers[i].authorities.fees ? bitPow : 0;
130
+ authorityBitmasks.scheduleAuthorityBitmask |= managerSettings.managers[i].authorities.schedule ? bitPow : 0;
131
+ authorityBitmasks.automationAuthorityBitmask |= managerSettings.managers[i].authorities.automation ? bitPow : 0;
132
+ authorityBitmasks.lpAuthorityBitmask |= managerSettings.managers[i].authorities.lp ? bitPow : 0;
133
+ authorityBitmasks.metadataAuthorityBitmask |= managerSettings.managers[i].authorities.metadata ? bitPow : 0;
134
+ authorityBitmasks.depositsAuthorityBitmask |= managerSettings.managers[i].authorities.deposits ? bitPow : 0;
135
+ authorityBitmasks.forceRebalanceAuthorityBitmask |= managerSettings.managers[i].authorities.force_rebalance ? bitPow : 0;
136
+ authorityBitmasks.customRebalanceAuthorityBitmask |= managerSettings.managers[i].authorities.custom_rebalance ? bitPow : 0;
137
+ authorityBitmasks.addTokenIntentAuthorityBitmask |= managerSettings.managers[i].authorities.add_token ? bitPow : 0;
138
+ authorityBitmasks.updateWeightsIntentAuthorityBitmask |= managerSettings.managers[i].authorities.update_weights ? bitPow : 0;
139
+ authorityBitmasks.makeDirectSwapIntentAuthorityBitmask |= managerSettings.managers[i].authorities.make_direct_swap ? bitPow : 0;
140
+ }
141
+ let authorityBitmasksBuffer = Buffer.alloc(config_1.AuthorityBitmasksLayout.span);
142
+ config_1.AuthorityBitmasksLayout.encode(authorityBitmasks, authorityBitmasksBuffer);
143
+ editDataBuf.set(authorityBitmasksBuffer, startIndex);
144
+ startIndex += config_1.AuthorityBitmasksLayout.span;
145
+ let modificationDelayBN = new bn_js_1.default(managerSettings.modification_delay);
146
+ editDataBuf.writeBigUint64LE(BigInt(modificationDelayBN.toString()), startIndex);
147
+ startIndex += 8;
148
+ break;
149
+ case intent_1.TaskType.EditFeeSettings: // 3
150
+ let feeSettings = editData;
151
+ let editFeeSettings = {
152
+ hostDepositFeeBps: 0,
153
+ hostWithdrawFeeBps: 0,
154
+ hostManagementFeeBps: 0,
155
+ hostPerformanceFeeBps: 0,
156
+ creatorDepositFeeBps: feeSettings.creator_deposit_fee_bps,
157
+ creatorWithdrawFeeBps: feeSettings.creator_withdraw_fee_bps,
158
+ creatorManagementFeeBps: feeSettings.creator_management_fee_bps,
159
+ creatorPerformanceFeeBps: feeSettings.creator_performance_fee_bps,
160
+ managersDepositFeeBps: feeSettings.managers_deposit_fee_bps,
161
+ managersWithdrawFeeBps: feeSettings.managers_withdraw_fee_bps,
162
+ managersManagementFeeBps: feeSettings.managers_management_fee_bps,
163
+ managersPerformanceFeeBps: feeSettings.managers_performance_fee_bps,
164
+ basketDepositFeeBps: feeSettings.basket_deposit_fee_bps,
165
+ basketWithdrawFeeBps: feeSettings.basket_withdraw_fee_bps,
166
+ extraData: new Array(32).fill(0),
167
+ modificationDelay: new bn_js_1.default(feeSettings.modification_delay),
168
+ };
169
+ config_1.FeeSettingsLayout.encode(editFeeSettings, editDataBuf);
170
+ break;
171
+ case intent_1.TaskType.EditScheduleSettings: // 4
172
+ let scheduleSettings = editData;
173
+ let editScheduleSettings = {
174
+ cycleStartTime: new bn_js_1.default(scheduleSettings.cycle_start_time),
175
+ cycleDuration: new bn_js_1.default(scheduleSettings.cycle_duration),
176
+ depositsStart: new bn_js_1.default(scheduleSettings.deposits_start),
177
+ depositsEnd: new bn_js_1.default(scheduleSettings.deposits_end),
178
+ automationStart: new bn_js_1.default(scheduleSettings.automation_start),
179
+ automationEnd: new bn_js_1.default(scheduleSettings.automation_end),
180
+ managementStart: new bn_js_1.default(scheduleSettings.management_start),
181
+ managementEnd: new bn_js_1.default(scheduleSettings.management_end),
182
+ modificationDelay: new bn_js_1.default(scheduleSettings.modification_delay),
183
+ };
184
+ config_1.ScheduleSettingsLayout.encode(editScheduleSettings, editDataBuf);
185
+ break;
186
+ case intent_1.TaskType.EditAutomationSettings: // 5
187
+ let automationSettings = editData;
188
+ let editAutomationSettings = {
189
+ allowAutomation: automationSettings.enabled ? 1 : 0,
190
+ rebalanceSlippageThresholdBps: automationSettings.rebalance_slippage_threshold_bps,
191
+ perTradeRebalanceSlippageThresholdBps: automationSettings.per_trade_rebalance_slippage_threshold_bps,
192
+ rebalanceActivationThresholdAbsBps: automationSettings.rebalance_activation_threshold_abs_bps,
193
+ rebalanceActivationThresholdRelBps: automationSettings.rebalance_activation_threshold_rel_bps,
194
+ rebalanceActivationCooldown: new bn_js_1.default(automationSettings.rebalance_activation_cooldown),
195
+ extraData: new Array(4).fill(web3_js_1.PublicKey.default),
196
+ modificationDelay: new bn_js_1.default(automationSettings.modification_delay),
197
+ };
198
+ config_1.AutomationSettingsLayout.encode(editAutomationSettings, editDataBuf);
199
+ break;
200
+ case intent_1.TaskType.EditLpSettings: // 6
201
+ let lpSettings = editData;
202
+ let editLpSettings = {
203
+ allowLp: lpSettings.enabled ? 1 : 0,
204
+ lpThresholdBps: lpSettings.lp_threshold_bps,
205
+ extraData: new Array(32).fill(0),
206
+ modificationDelay: new bn_js_1.default(lpSettings.modification_delay),
207
+ };
208
+ config_1.LpSettingsLayout.encode(editLpSettings, editDataBuf);
209
+ break;
210
+ case intent_1.TaskType.EditMetadataSettings: // 7
211
+ let metadataSettings = editData;
212
+ let editMetadataSettings = {
213
+ symbolLength: metadataSettings.symbol.length,
214
+ symbol: metadataSettings.symbol.split('').map((char) => char.charCodeAt(0)),
215
+ nameLength: metadataSettings.name.length,
216
+ name: metadataSettings.name.split('').map((char) => char.charCodeAt(0)),
217
+ uriLength: metadataSettings.uri.length,
218
+ uri: metadataSettings.uri.split('').map((char) => char.charCodeAt(0)),
219
+ modificationDelay: new bn_js_1.default(metadataSettings.modification_delay),
220
+ };
221
+ config_1.MetadataSettingsLayout.encode(editMetadataSettings, editDataBuf);
222
+ break;
223
+ case intent_1.TaskType.EditDepositsSettings: // 8
224
+ let depositsSettings = editData;
225
+ let editDepositsSettings = depositsSettings.enabled ? 1 : 0;
226
+ editDataBuf[0] = editDepositsSettings;
227
+ break;
228
+ case intent_1.TaskType.EditForceRebalanceSettings: // 9
229
+ let forceRebalanceSettings = editData;
230
+ let editForceRebalanceSettings = forceRebalanceSettings.enabled ? 1 : 0;
231
+ let editForceRebalanceModificationDelayBN = new bn_js_1.default(forceRebalanceSettings.modification_delay);
232
+ editDataBuf[0] = editForceRebalanceSettings;
233
+ editDataBuf.writeBigUint64LE(BigInt(editForceRebalanceModificationDelayBN.toString()), 1);
234
+ break;
235
+ case intent_1.TaskType.EditCustomRebalanceSettings: // 10
236
+ let customRebalanceSettings = editData;
237
+ let editCustomRebalanceSettings = customRebalanceSettings.enabled ? 1 : 0;
238
+ let editCustomRebalanceModificationDelayBN = new bn_js_1.default(customRebalanceSettings.modification_delay);
239
+ editDataBuf[0] = editCustomRebalanceSettings;
240
+ editDataBuf.writeBigUint64LE(BigInt(editCustomRebalanceModificationDelayBN.toString()), 1);
241
+ break;
242
+ case intent_1.TaskType.EditAddTokenDelay: // 11 - 101
243
+ let addTokenDelay = editData;
244
+ let editAddTokenDelay = {
245
+ modificationDelay: new bn_js_1.default(addTokenDelay.modification_delay),
246
+ };
247
+ config_1.EditAddTokenDelayLayout.encode(editAddTokenDelay, editDataBuf);
248
+ break;
249
+ case intent_1.TaskType.EditUpdateWeightsDelay: // 12 - 102
250
+ let updateWeightsDelay = editData;
251
+ let editUpdateWeightsDelay = {
252
+ modificationDelay: new bn_js_1.default(updateWeightsDelay.modification_delay),
253
+ };
254
+ config_1.EditUpdateWeightsDelayLayout.encode(editUpdateWeightsDelay, editDataBuf);
255
+ break;
256
+ case intent_1.TaskType.EditMakeDirectSwapDelay: // 13 - 103
257
+ let makeDirectSwapDelay = editData;
258
+ let editMakeDirectSwapDelay = {
259
+ modificationDelay: new bn_js_1.default(makeDirectSwapDelay.modification_delay),
260
+ };
261
+ config_1.EditMakeDirectSwapDelayLayout.encode(editMakeDirectSwapDelay, editDataBuf);
262
+ break;
263
+ case intent_1.TaskType.AddToken: // 14 - 201
264
+ let addTokenData = editData;
265
+ let oracleDatas = [];
266
+ for (let i = 0; i < addTokenData.oracles.length; i++) {
267
+ let oracleData = {
268
+ oracleSettings: {
269
+ oracleType: (_b = (_a = [...oracle_1.ORACLE_TYPES_STRINGS.entries()].find(([, name]) => name === addTokenData.oracles[i].oracle_type)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : 255,
270
+ numRequiredAccounts: 0,
271
+ weight: addTokenData.oracles[i].weight,
272
+ isRequired: addTokenData.oracles[i].is_required ? 1 : 0,
273
+ confThreshBps: addTokenData.oracles[i].conf_thresh_bps,
274
+ volatilityThreshBps: addTokenData.oracles[i].volatility_thresh_bps,
275
+ maxSlippageBps: addTokenData.oracles[i].max_slippage_bps,
276
+ minLiquidity: new bn_js_1.default(addTokenData.oracles[i].min_liquidity),
277
+ stalenessThresh: new bn_js_1.default(addTokenData.oracles[i].staleness_thresh),
278
+ stalenessConfRateBps: addTokenData.oracles[i].staleness_conf_rate_bps,
279
+ tokenDecimals: addTokenData.oracles[i].token_decimals,
280
+ twapSecondsAgo: new bn_js_1.default(addTokenData.oracles[i].twap_seconds_ago),
281
+ twapSecondarySecondsAgo: new bn_js_1.default(addTokenData.oracles[i].twap_secondary_seconds_ago),
282
+ quote: oracle_1.Quote.Wsol,
283
+ side: oracle_1.Side.Base,
284
+ },
285
+ accountsToLoadLutIds: new Array(oracle_1.MAX_ACCOUNTS_PER_ORACLE).fill(0),
286
+ accountsToLoadLutIndices: new Array(oracle_1.MAX_ACCOUNTS_PER_ORACLE).fill(0),
287
+ };
288
+ oracleDatas.push(oracleData);
289
+ }
290
+ while (oracleDatas.length < constants_1.MAX_ORACLES_PER_TOKEN) {
291
+ oracleDatas.push({
292
+ oracleSettings: oracle_1.DEFAULT_ORACLE_SETTINGS,
293
+ accountsToLoadLutIds: new Array(oracle_1.MAX_ACCOUNTS_PER_ORACLE).fill(0),
294
+ accountsToLoadLutIndices: new Array(oracle_1.MAX_ACCOUNTS_PER_ORACLE).fill(0),
295
+ });
296
+ }
297
+ let oracleAggregator = {
298
+ numOracles: addTokenData.oracles.length,
299
+ minOraclesThresh: addTokenData.min_oracles_thresh,
300
+ oracles: oracleDatas,
301
+ minConfBps: addTokenData.min_conf_bps,
302
+ confThreshBps: addTokenData.conf_thresh_bps,
303
+ confMultiplier: (0, fraction_1.decimalToFraction)(new decimal_js_1.default(addTokenData.conf_multiplier)),
304
+ };
305
+ oracle_1.OracleAggregatorLayout.encode(oracleAggregator, editDataBuf);
306
+ editDataBuf.writeUInt8(addTokenData.active ? 1 : 0, oracle_1.OracleAggregatorLayout.getSpan());
307
+ additionalAccounts.push({
308
+ pubkey: new web3_js_1.PublicKey(addTokenData.token_mint),
309
+ isWritable: false,
310
+ isSigner: false
311
+ });
312
+ additionalAccounts.push({
313
+ pubkey: (0, pda_1.getAta)(basket.ownAddress, new web3_js_1.PublicKey(addTokenData.token_mint), tokenProgram),
314
+ isWritable: true,
315
+ isSigner: false
316
+ });
317
+ additionalAccounts.push({
318
+ pubkey: basket.lookupTables.active[0],
319
+ isWritable: true,
320
+ isSigner: false
321
+ });
322
+ additionalAccounts.push({
323
+ pubkey: basket.lookupTables.active[1],
324
+ isWritable: true,
325
+ isSigner: false
326
+ });
327
+ for (let i = 0; i < addTokenData.oracles.length; i++) {
328
+ additionalAccounts.push({
329
+ pubkey: new web3_js_1.PublicKey(addTokenData.oracles[i].account),
330
+ isWritable: false,
331
+ isSigner: false
332
+ });
333
+ }
334
+ additionalAccounts.push({
335
+ pubkey: constants_1.ADDRESS_LOOKUP_TABLE_PROGRAM_ID,
336
+ isWritable: false,
337
+ isSigner: false
338
+ });
339
+ break;
340
+ case intent_1.TaskType.UpdateWeights: { // 15 - 202
341
+ const updateWeightsData = editData;
342
+ const weights = updateWeightsData.token_weights.slice(0, constants_1.MAX_SUPPORTED_TOKENS_PER_BASKET);
343
+ while (weights.length < constants_1.MAX_SUPPORTED_TOKENS_PER_BASKET)
344
+ weights.push({ mint: '', weight_bps: 0 });
345
+ let tokenMintsHash = (_c = updateWeightsData.token_mints_hash) !== null && _c !== void 0 ? _c : (0, basket_1.computeTokenMintsHash)(basket.composition.slice(0, basket.numTokens)
346
+ .filter((asset) => asset.active === 1)
347
+ .map((asset) => asset.mint.toBase58()));
348
+ let updateWeights = {
349
+ tokenWeights: weights.map((weight) => weight.weight_bps),
350
+ tokenMintsHash: tokenMintsHash,
351
+ };
352
+ config_1.UpdateWeightsLayout.encode(updateWeights, editDataBuf);
353
+ break;
354
+ }
355
+ case intent_1.TaskType.MakeDirectSwap: // 16 - 203
356
+ let makeDirectSwapData = editData;
357
+ let makeDirectSwap = {
358
+ fromTokenMint: new web3_js_1.PublicKey(makeDirectSwapData.from_token_mint),
359
+ toTokenMint: new web3_js_1.PublicKey(makeDirectSwapData.to_token_mint),
360
+ amountFrom: new bn_js_1.default(makeDirectSwapData.amount_from),
361
+ amountTo: new bn_js_1.default(makeDirectSwapData.amount_to),
362
+ };
363
+ config_1.MakeDirectSwapLayout.encode(makeDirectSwap, editDataBuf);
364
+ break;
365
+ default:
366
+ break;
367
+ }
368
+ const activationTimestampBuf = Buffer.from(activationTimestamp.toArray("le", 8));
369
+ const expirationTimestampBuf = Buffer.from(expirationTimestamp.toArray("le", 8));
370
+ const minBountyBuf = Buffer.from(minBounty.toArray("le", 8));
371
+ const maxBountyBuf = Buffer.from(maxBounty.toArray("le", 8));
372
+ const data = Buffer.concat([
373
+ CREATE_EDIT_BASKET_INTENT_DISCRIMINATOR,
374
+ intentSeedArrayBuf,
375
+ editTypeBuf,
376
+ editDataBuf,
377
+ activationTimestampBuf,
378
+ expirationTimestampBuf,
379
+ minBountyBuf,
380
+ maxBountyBuf,
381
+ ]);
382
+ const keys = [
383
+ { pubkey: manager, isSigner: true, isWritable: true },
384
+ { pubkey: basket.ownAddress, isSigner: false, isWritable: true },
385
+ { pubkey: intent, isSigner: false, isWritable: true },
386
+ { pubkey: globalConfig, isSigner: false, isWritable: false },
387
+ { pubkey: bountyMint, isSigner: false, isWritable: false },
388
+ { pubkey: managerBountyATA, isSigner: false, isWritable: true },
389
+ { pubkey: bountyVault, isSigner: false, isWritable: true },
390
+ { pubkey: bountyVaultATA, isSigner: false, isWritable: true },
391
+ { pubkey: web3_js_1.SystemProgram.programId, isSigner: false, isWritable: false },
392
+ { pubkey: spl_token_1.TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
393
+ { pubkey: spl_token_1.TOKEN_2022_PROGRAM_ID, isSigner: false, isWritable: false },
394
+ { pubkey: spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
395
+ ];
396
+ keys.push(...additionalAccounts);
397
+ return new web3_js_1.TransactionInstruction({
398
+ keys,
399
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
400
+ data,
401
+ });
402
+ }
403
+ function executeEditBasketIntentIx(params) {
404
+ const { keeper, basket, basketMint, bountyMint, manager, editType, intent, } = params;
405
+ let metadataAccount = null;
406
+ if (editType === intent_1.TaskType.EditMetadataSettings) {
407
+ if (!basketMint) {
408
+ throw new Error("basketMint is required for EditMetadataSettings");
409
+ }
410
+ metadataAccount = (0, pda_1.getMetadataAccount)(basketMint);
411
+ }
412
+ let globalConfig = (0, pda_1.getGlobalConfigPda)();
413
+ let bountyVault = (0, pda_1.getBountyVaultPda)();
414
+ let keeperBountyATA = (0, pda_1.getAta)(keeper, bountyMint);
415
+ let managerBountyATA = (0, pda_1.getAta)(manager, bountyMint);
416
+ let bountyVaultATA = (0, pda_1.getAta)(bountyVault, bountyMint);
417
+ // discriminator
418
+ const data = EDIT_BASKET_DISCRIMINATOR;
419
+ // accounts
420
+ const keys = [
421
+ { pubkey: keeper, isSigner: true, isWritable: true },
422
+ { pubkey: basket, isSigner: false, isWritable: true },
423
+ { pubkey: intent, isSigner: false, isWritable: true },
424
+ { pubkey: globalConfig, isSigner: false, isWritable: false },
425
+ { pubkey: bountyMint, isSigner: false, isWritable: false },
426
+ { pubkey: keeperBountyATA, isSigner: false, isWritable: true },
427
+ { pubkey: manager, isSigner: false, isWritable: true },
428
+ { pubkey: managerBountyATA, isSigner: false, isWritable: true },
429
+ { pubkey: bountyVault, isSigner: false, isWritable: true },
430
+ { pubkey: bountyVaultATA, isSigner: false, isWritable: true },
431
+ { pubkey: web3_js_1.SystemProgram.programId, isSigner: false, isWritable: false },
432
+ { pubkey: spl_token_1.TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
433
+ { pubkey: spl_token_1.TOKEN_2022_PROGRAM_ID, isSigner: false, isWritable: false },
434
+ { pubkey: spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
435
+ ];
436
+ // remaining accounts
437
+ if (editType === intent_1.TaskType.EditMetadataSettings) {
438
+ keys.push({ pubkey: basket, isSigner: false, isWritable: false });
439
+ keys.push({ pubkey: metadataAccount, isSigner: false, isWritable: true });
440
+ keys.push({ pubkey: constants_1.METADATA_PROGRAM_ID, isSigner: false, isWritable: false });
441
+ }
442
+ ;
443
+ return new web3_js_1.TransactionInstruction({
444
+ keys,
445
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
446
+ data,
447
+ });
448
+ }
449
+ function cancelIntentIx(params) {
450
+ const { keeper, basket, intent, editType, bountyMint, manager } = params;
451
+ const globalConfig = (0, pda_1.getGlobalConfigPda)();
452
+ const bountyVault = (0, pda_1.getBountyVaultPda)();
453
+ const keeperBountyATA = (0, pda_1.getAta)(keeper, bountyMint);
454
+ const managerBountyATA = (0, pda_1.getAta)(manager, bountyMint);
455
+ const bountyVaultATA = (0, pda_1.getAta)(bountyVault, bountyMint);
456
+ const keys = [
457
+ { pubkey: keeper, isSigner: true, isWritable: true },
458
+ { pubkey: basket, isSigner: false, isWritable: true },
459
+ { pubkey: intent, isSigner: false, isWritable: true },
460
+ { pubkey: globalConfig, isSigner: false, isWritable: false },
461
+ { pubkey: bountyMint, isSigner: false, isWritable: false },
462
+ { pubkey: keeperBountyATA, isSigner: false, isWritable: true },
463
+ { pubkey: manager, isSigner: false, isWritable: true },
464
+ { pubkey: managerBountyATA, isSigner: false, isWritable: true },
465
+ { pubkey: bountyVault, isSigner: false, isWritable: true },
466
+ { pubkey: bountyVaultATA, isSigner: false, isWritable: true },
467
+ { pubkey: web3_js_1.SystemProgram.programId, isSigner: false, isWritable: false },
468
+ { pubkey: spl_token_1.TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
469
+ { pubkey: spl_token_1.TOKEN_2022_PROGRAM_ID, isSigner: false, isWritable: false },
470
+ { pubkey: spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
471
+ ];
472
+ return new web3_js_1.TransactionInstruction({
473
+ keys,
474
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
475
+ data: CANCEL_INTENT_DISCRIMINATOR,
476
+ });
477
+ }
@@ -0,0 +1,30 @@
1
+ import { PublicKey, TransactionInstruction } from '@solana/web3.js';
2
+ export declare function createBasketLookupTablesInstruction(params: {
3
+ signer: PublicKey;
4
+ basket: PublicKey;
5
+ oldTempLookupTable0: PublicKey;
6
+ oldTempLookupTable1: PublicKey;
7
+ newTempLookupTable0: PublicKey;
8
+ newTempLookupTable1: PublicKey;
9
+ slot: number;
10
+ }): TransactionInstruction;
11
+ export declare function extendBasketLookupTablesIx(params: {
12
+ signer: PublicKey;
13
+ basket: PublicKey;
14
+ tempLookupTable0: PublicKey;
15
+ tempLookupTable1: PublicKey;
16
+ additionalAccounts: PublicKey[];
17
+ }): TransactionInstruction;
18
+ export declare function overwriteBasketLookupTablesIx(params: {
19
+ signer: PublicKey;
20
+ basket: PublicKey;
21
+ tempLookupTable0: PublicKey;
22
+ tempLookupTable1: PublicKey;
23
+ activeLookupTable0: PublicKey;
24
+ activeLookupTable1: PublicKey;
25
+ }): TransactionInstruction;
26
+ export declare function closeDeactivatedLookupTableIx(params: {
27
+ rentPayer: PublicKey;
28
+ basket: PublicKey;
29
+ lookupTable: PublicKey;
30
+ }): TransactionInstruction;
@@ -0,0 +1,99 @@
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.createBasketLookupTablesInstruction = createBasketLookupTablesInstruction;
7
+ exports.extendBasketLookupTablesIx = extendBasketLookupTablesIx;
8
+ exports.overwriteBasketLookupTablesIx = overwriteBasketLookupTablesIx;
9
+ exports.closeDeactivatedLookupTableIx = closeDeactivatedLookupTableIx;
10
+ const bn_js_1 = __importDefault(require("bn.js"));
11
+ const web3_js_1 = require("@solana/web3.js");
12
+ const constants_1 = require("../../constants");
13
+ const pda_1 = require("../pda");
14
+ const CREATE_BASKET_LOOKUP_TABLES_DISCRIMINATOR = Buffer.from([227, 98, 152, 128, 87, 46, 244, 99]);
15
+ const EXTEND_BASKET_LOOKUP_TABLES_DISCRIMINATOR = Buffer.from([98, 129, 153, 127, 181, 160, 117, 74]);
16
+ const OVERWRITE_BASKET_LOOKUP_TABLES_DISCRIMINATOR = Buffer.from([197, 116, 189, 147, 222, 188, 6, 165]);
17
+ const CLOSE_DEACTIVATED_LOOKUP_TABLE_DISCRIMINATOR = Buffer.from([19, 4, 214, 20, 26, 43, 71, 233]);
18
+ function createBasketLookupTablesInstruction(params) {
19
+ const { signer, basket, oldTempLookupTable0, oldTempLookupTable1, newTempLookupTable0, newTempLookupTable1, slot, } = params;
20
+ const globalConfig = (0, pda_1.getGlobalConfigPda)();
21
+ const hasOldTemp = !oldTempLookupTable0.equals(web3_js_1.PublicKey.default)
22
+ && !oldTempLookupTable1.equals(web3_js_1.PublicKey.default);
23
+ const data = Buffer.concat([
24
+ CREATE_BASKET_LOOKUP_TABLES_DISCRIMINATOR,
25
+ Buffer.from(new bn_js_1.default(slot).toArray("le", 8)),
26
+ ]);
27
+ const keys = [
28
+ { pubkey: signer, isSigner: true, isWritable: true },
29
+ { pubkey: basket, isSigner: false, isWritable: true },
30
+ { pubkey: globalConfig, isSigner: false, isWritable: false },
31
+ { pubkey: hasOldTemp ? oldTempLookupTable0 : constants_1.PYTHNET_CUSTODY_PRICE_USDC_ACCOUNT, isSigner: false, isWritable: true },
32
+ { pubkey: hasOldTemp ? oldTempLookupTable1 : constants_1.PYTHNET_CUSTODY_PRICE_WSOL_ACCOUNT, isSigner: false, isWritable: true },
33
+ { pubkey: newTempLookupTable0, isSigner: false, isWritable: true },
34
+ { pubkey: newTempLookupTable1, isSigner: false, isWritable: true },
35
+ ];
36
+ if (hasOldTemp) {
37
+ keys.push({ pubkey: (0, pda_1.getLookupTableInfoAccount)(oldTempLookupTable0), isSigner: false, isWritable: true }, { pubkey: (0, pda_1.getLookupTableInfoAccount)(oldTempLookupTable1), isSigner: false, isWritable: true });
38
+ }
39
+ else {
40
+ keys.push({ pubkey: constants_1.BASKETS_V3_PROGRAM_ID, isSigner: false, isWritable: false }, { pubkey: constants_1.BASKETS_V3_PROGRAM_ID, isSigner: false, isWritable: false });
41
+ }
42
+ keys.push({ pubkey: constants_1.ADDRESS_LOOKUP_TABLE_PROGRAM_ID, isSigner: false, isWritable: false }, { pubkey: web3_js_1.SystemProgram.programId, isSigner: false, isWritable: false });
43
+ return new web3_js_1.TransactionInstruction({
44
+ keys,
45
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
46
+ data,
47
+ });
48
+ }
49
+ function extendBasketLookupTablesIx(params) {
50
+ const keys = [
51
+ { pubkey: params.signer, isWritable: true, isSigner: true },
52
+ { pubkey: params.basket, isWritable: true, isSigner: false },
53
+ { pubkey: params.tempLookupTable0, isWritable: true, isSigner: false },
54
+ { pubkey: params.tempLookupTable1, isWritable: true, isSigner: false },
55
+ { pubkey: constants_1.ADDRESS_LOOKUP_TABLE_PROGRAM_ID, isWritable: false, isSigner: false },
56
+ { pubkey: web3_js_1.SystemProgram.programId, isWritable: false, isSigner: false },
57
+ ...params.additionalAccounts.map(pubkey => ({ pubkey, isWritable: false, isSigner: false })),
58
+ ];
59
+ return new web3_js_1.TransactionInstruction({
60
+ keys,
61
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
62
+ data: EXTEND_BASKET_LOOKUP_TABLES_DISCRIMINATOR,
63
+ });
64
+ }
65
+ function overwriteBasketLookupTablesIx(params) {
66
+ const keys = [
67
+ { pubkey: params.signer, isWritable: true, isSigner: true },
68
+ { pubkey: params.basket, isWritable: true, isSigner: false },
69
+ { pubkey: params.tempLookupTable0, isWritable: true, isSigner: false },
70
+ { pubkey: params.tempLookupTable1, isWritable: true, isSigner: false },
71
+ { pubkey: params.activeLookupTable0, isWritable: true, isSigner: false },
72
+ { pubkey: params.activeLookupTable1, isWritable: true, isSigner: false },
73
+ { pubkey: (0, pda_1.getLookupTableInfoAccount)(params.activeLookupTable0), isWritable: true, isSigner: false },
74
+ { pubkey: (0, pda_1.getLookupTableInfoAccount)(params.activeLookupTable1), isWritable: true, isSigner: false },
75
+ { pubkey: constants_1.ADDRESS_LOOKUP_TABLE_PROGRAM_ID, isWritable: false, isSigner: false },
76
+ { pubkey: web3_js_1.SystemProgram.programId, isWritable: false, isSigner: false },
77
+ ];
78
+ return new web3_js_1.TransactionInstruction({
79
+ keys,
80
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
81
+ data: OVERWRITE_BASKET_LOOKUP_TABLES_DISCRIMINATOR,
82
+ });
83
+ }
84
+ function closeDeactivatedLookupTableIx(params) {
85
+ let lookupTableInfo = (0, pda_1.getLookupTableInfoAccount)(params.lookupTable);
86
+ const keys = [
87
+ { pubkey: params.rentPayer, isWritable: true, isSigner: false },
88
+ { pubkey: params.basket, isWritable: true, isSigner: false },
89
+ { pubkey: params.lookupTable, isWritable: true, isSigner: false },
90
+ { pubkey: lookupTableInfo, isWritable: true, isSigner: false },
91
+ { pubkey: constants_1.ADDRESS_LOOKUP_TABLE_PROGRAM_ID, isWritable: false, isSigner: false },
92
+ { pubkey: web3_js_1.SystemProgram.programId, isWritable: false, isSigner: false },
93
+ ];
94
+ return new web3_js_1.TransactionInstruction({
95
+ keys,
96
+ programId: constants_1.BASKETS_V3_PROGRAM_ID,
97
+ data: CLOSE_DEACTIVATED_LOOKUP_TABLE_DISCRIMINATOR,
98
+ });
99
+ }
@@ -0,0 +1,25 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ export declare const GLOBAL_CONFIG_SEED: Buffer;
3
+ export declare const BASKET_FEES_SEED: Buffer;
4
+ export declare const WITHDRAW_BASKET_FEES_SEED: Buffer;
5
+ export declare const BASKET_SEED: Buffer;
6
+ export declare const MINT_SEED: Buffer;
7
+ export declare const RENT_PAYER_SEED: Buffer;
8
+ export declare const BOUNTY_VAULT_SEED: Buffer;
9
+ export declare const REBALANCE_INTENT_SEED: Buffer;
10
+ export declare const TOKEN_METADATA_PROGRAM_ID: PublicKey;
11
+ export declare function serializeString(input: string): Uint8Array;
12
+ export declare function getRandomSeed(): number[];
13
+ export declare function getBasketTokenMintPda(basketId: number): PublicKey;
14
+ export declare function getBasketState(mint: PublicKey): PublicKey;
15
+ export declare function getBountyVaultPda(): PublicKey;
16
+ export declare function getBasketFeesPda(basket: PublicKey): PublicKey;
17
+ export declare function getWithdrawBasketFeesPda(basket: PublicKey, feeType: number): PublicKey;
18
+ export declare function getGlobalConfigPda(): PublicKey;
19
+ export declare function getRentPayerPda(): PublicKey;
20
+ export declare function getIntentPda(basket: PublicKey, intentSeedArray: Uint8Array, editType: number): PublicKey;
21
+ export declare function getRebalanceIntentPda(basket: PublicKey, owner: PublicKey): PublicKey;
22
+ export declare function getMetadataAccount(tokenMint: PublicKey): PublicKey;
23
+ export declare function getLookupTableAccount(creator: PublicKey, slot: number): PublicKey;
24
+ export declare function getLookupTableInfoAccount(lookupTable: PublicKey): PublicKey;
25
+ export declare function getAta(wallet: PublicKey, tokenMint: PublicKey, tokenProgram?: PublicKey): PublicKey;