@symmetry-hq/temp-v3-sdk 0.0.40 → 0.0.42

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.
@@ -1,6 +1,6 @@
1
1
  import { Connection, PublicKey, TransactionInstruction, TransactionSignature } from '@solana/web3.js';
2
2
  import { getJupTokenLedgerAndSwapInstructions } from './jup';
3
- import { Basket, FormattedAccumulatedFees, FormattedAddTokenSettings, FormattedAsset, FormattedAutomationSettings, FormattedBasket, FormattedCreatorSettings, FormattedCustomRebalanceSettings, FormattedDepositsSettings, FormattedFeeSettings, FormattedForceRebalanceSettings, FormattedLookupTables, FormattedLpSettings, FormattedMakeDirectSwapSettings, FormattedManagersSettings, FormattedMetadataSettings, FormattedOracle, FormattedOracleAggregator, FormattedOracleSettings, FormattedScheduleSettings, FormattedUpdateWeightsSettings } from './layouts/basket';
3
+ import { Basket, FormattedAccumulatedFees, FormattedAddTokenSettings, FormattedAsset, FormattedAutomationSettings, FormattedBasket, FormattedCreatorSettings, FormattedCustomRebalanceSettings, FormattedDepositsSettings, FormattedFeeSettings, FormattedForceRebalanceSettings, FormattedLookupTables, FormattedLpSettings, FormattedMakeDirectSwapSettings, FormattedManagersSettings, FormattedMetadataSettings, FormattedOracle, FormattedOracleAggregator, FormattedOracleSettings, FormattedScheduleSettings, FormattedUpdateWeightsSettings, WithdrawBasketFees } from './layouts/basket';
4
4
  import { FormattedGlobalConfig, GlobalConfig } from './layouts/config';
5
5
  import { AddOrEditTokenInput, EditAddTokenSettings, EditAutomationSettings, EditCreatorSettings, EditCustomRebalanceSettings, EditDepositsSettings, EditFeeSettings, EditForceRebalanceSettings, EditLpSettings, EditMakeDirectSwapSettings, EditManagerSettings, EditMetadataSettings, EditScheduleSettings, EditUpdateWeightsSettings, FormattedBounty, FormattedBountySchedule, FormattedIntent, FormattedIntentStatus, FormattedTaskType, Intent, MakeDirectSwapInput, OracleInput, Settings, TaskContext, TaskType, UpdateWeightsInput } from './layouts/intents/intent';
6
6
  import { FormattedOraclePrice, FormattedRebalanceAction, FormattedRebalanceIntent, FormattedRebalanceType, FormattedTaskCompletion, FormattedTokenAuction, RebalanceIntent } from './layouts/intents/rebalanceIntent';
@@ -8,34 +8,197 @@ import { FormattedOracleType } from './layouts/oracle';
8
8
  import { BasketFilter } from './states/basket';
9
9
  import { IntentFilter } from './states/intents/intent';
10
10
  import { RebalanceIntentFilter } from './states/intents/rebalanceIntent';
11
+ import { WithdrawBasketFeesFilter } from './states/withdrawBasketFees';
11
12
  import { BasketCreationTx, TxPayloadBatchSequence, VersionedTxs, Wallet } from './txUtils';
12
13
  export declare class SymmetryCore {
13
14
  private sdkParams;
15
+ /**
16
+ * Initializes the SymmetryCore SDK.
17
+ * @param params {connection: Connection, network: "devnet" | "mainnet", priorityFee?: number} - The parameters for the SDK.
18
+ * @param params.connection - The connection to the Solana network.
19
+ * @param params.network - The network to use (devnet or mainnet).
20
+ * @param params.priorityFee - Optional. The priority fee to use for the transactions. Defaults to PRIORITY_FEE.
21
+ */
14
22
  constructor(params: {
15
23
  connection: Connection;
16
24
  network: "devnet" | "mainnet";
17
25
  priorityFee?: number;
18
26
  });
27
+ /**
28
+ * Fetches the global config account.
29
+ * @returns {Promise<GlobalConfig>} The global config.
30
+ */
19
31
  fetchGlobalConfig(): Promise<GlobalConfig>;
32
+ /**
33
+ * Fetches a basket by its public key.
34
+ * @param {string} basketPubkey - The public key of the basket.
35
+ * @returns {Promise<Basket>} The basket.
36
+ */
20
37
  fetchBasket(basketPubkey: string): Promise<Basket>;
38
+ /**
39
+ * Fetches multiple baskets by their public keys.
40
+ * @param {string[]} basketPubkeys - The public keys of the baskets.
41
+ * @returns {Promise<Map<string, Basket>>} A map of basket public keys to baskets.
42
+ */
21
43
  fetchMultipleBaskets(basketPubkeys: string[]): Promise<Map<string, Basket>>;
44
+ /**
45
+ * Fetches all baskets.
46
+ * @param {BasketFilter} basketFilter - Optional. The filter to apply to the baskets.
47
+ * @param {"creator" | "host" | "manager"} basketFilter.type - The type of the basket filter ("creator", "host", "manager").
48
+ * @param {string} basketFilter.pubkey - The public key of the basket filter.
49
+ * @returns {Promise<Basket[]>} The baskets.
50
+ */
22
51
  fetchAllBaskets(basketFilter?: BasketFilter): Promise<Basket[]>;
52
+ /**
53
+ * Fetches all baskets created by a given public key.
54
+ * @param {string} creatorPubkey - The public key of the creator.
55
+ * @returns {Promise<Basket[]>} The baskets.
56
+ */
23
57
  fetchCreatedBaskets(creatorPubkey: string): Promise<Basket[]>;
58
+ /**
59
+ * Fetches all baskets hosted by a given public key.
60
+ * @param {string} hostPubkey - The public key of the host.
61
+ * @returns {Promise<Basket[]>} The baskets.
62
+ */
24
63
  fetchHostedBaskets(hostPubkey: string): Promise<Basket[]>;
64
+ /**
65
+ * Fetches all baskets managed by a given public key.
66
+ * @param {string} managerPubkey - The public key of the manager.
67
+ * @returns {Promise<Basket[]>} The baskets.
68
+ */
25
69
  fetchManagedBaskets(managerPubkey: string): Promise<Basket[]>;
70
+ /**
71
+ * Derives baskets by their mints.
72
+ * @param {string[]} mints - The mint public keys of the baskets.
73
+ * @returns {Promise<Map<string, string>>} A map of basket mint public keys to basket public keys.
74
+ */
26
75
  deriveBasketsByMints(mints: string[]): Promise<Map<string, string>>;
76
+ /**
77
+ * Fetches baskets by their mint public keys.
78
+ * @param {string[]} mints - The mint public keys of the baskets.
79
+ * @returns {Promise<Map<string, Basket>>} A map of basket mint public keys to baskets.
80
+ */
27
81
  fetchBasketsFromMints(mints: string[]): Promise<Map<string, Basket>>;
82
+ /**
83
+ * Loads the price of a basket.
84
+ * @param {Basket} basket - The basket.
85
+ * @returns {Promise<Basket>} The basket with the price.
86
+ */
28
87
  loadBasketPrice(basket: Basket): Promise<Basket>;
88
+ /**
89
+ * Fetches an intent by its public key.
90
+ * @param {string} intentPubkey - The public key of the intent.
91
+ * @returns {Promise<Intent>} The intent.
92
+ */
29
93
  fetchIntent(intentPubkey: string): Promise<Intent>;
94
+ /**
95
+ * Fetches multiple intents by their public keys.
96
+ * @param {string[]} intentPubkeys - The public keys of the intents.
97
+ * @returns {Promise<Map<string, Intent>>} A map of intent public keys to intents.
98
+ */
30
99
  fetchMultipleIntents(intentPubkeys: string[]): Promise<Map<string, Intent>>;
100
+ /**
101
+ * Fetches all intents.
102
+ * @param {IntentFilter} filter - Optional. The filter to apply to the intents.
103
+ * @param {"creator" | "host" | "manager" | "basket" | "owner"} filter.type - The type of the intent filter ("creator", "host", "manager", "basket", "owner").
104
+ * @param {string} filter.pubkey - The public key of the intent filter.
105
+ * @returns {Promise<Intent[]>} The intents.
106
+ */
31
107
  fetchAllIntents(filter?: IntentFilter): Promise<Intent[]>;
108
+ /**
109
+ * Fetches all intents created by a given public key.
110
+ * @param {string} creatorPubkey - The public key of the creator.
111
+ * @returns {Promise<Intent[]>} The intents.
112
+ */
32
113
  fetchCreatedIntents(creatorPubkey: string): Promise<Intent[]>;
114
+ /**
115
+ * Fetches all intents for a given basket.
116
+ * @param {string} basketPubkey - The public key of the basket.
117
+ * @returns {Promise<Intent[]>} The intents.
118
+ */
33
119
  fetchBasketIntents(basketPubkey: string): Promise<Intent[]>;
120
+ /**
121
+ * Fetches a rebalance intent by its public key.
122
+ * @param {string} rebalanceIntentPubkey - The public key of the rebalance intent.
123
+ * @returns {Promise<RebalanceIntent>} The rebalance intent.
124
+ */
34
125
  fetchRebalanceIntent(rebalanceIntentPubkey: string): Promise<RebalanceIntent>;
126
+ /**
127
+ * Fetches multiple rebalance intents by their public keys.
128
+ * @param {string[]} rebalanceIntentPubkeys - The public keys of the rebalance intents.
129
+ * @returns {Promise<Map<string, RebalanceIntent>>} A map of rebalance intent public keys to rebalance intents.
130
+ */
35
131
  fetchMultipleRebalanceIntents(rebalanceIntentPubkeys: string[]): Promise<Map<string, RebalanceIntent>>;
132
+ /**
133
+ * Fetches all rebalance intents.
134
+ * @param {RebalanceIntentFilter} filter - Optional. The filter to apply to the rebalance intents.
135
+ * @param {"owner" | "basket"} filter.type - The type of the rebalance intent filter ("owner", "basket").
136
+ * @param {string} filter.pubkey - The public key of the rebalance intent filter.
137
+ * @returns {Promise<RebalanceIntent[]>} The rebalance intents.
138
+ */
36
139
  fetchAllRebalanceIntents(filter?: RebalanceIntentFilter): Promise<RebalanceIntent[]>;
140
+ /**
141
+ * Fetches all rebalance intents for a given owner.
142
+ * @param {string} ownerPubkey - The public key of the owner.
143
+ * @returns {Promise<RebalanceIntent[]>} The rebalance intents.
144
+ */
37
145
  fetchOwnerRebalanceIntents(ownerPubkey: string): Promise<RebalanceIntent[]>;
146
+ /**
147
+ * Fetches all rebalance intents for a given basket.
148
+ * @param {string} basketPubkey - The public key of the basket.
149
+ * @returns {Promise<RebalanceIntent[]>} The rebalance intents.
150
+ */
38
151
  fetchBasketRebalanceIntents(basketPubkey: string): Promise<RebalanceIntent[]>;
152
+ /**
153
+ * Fetches a WithdrawBasketFees account by its public key.
154
+ * @param {string} withdrawBasketFeesPubkey - The public key of the WithdrawBasketFees account.
155
+ * @returns {Promise<WithdrawBasketFees>} The WithdrawBasketFees account.
156
+ */
157
+ fetchWithdrawBasketFees(withdrawBasketFeesPubkey: string): Promise<WithdrawBasketFees>;
158
+ /**
159
+ * Fetches multiple WithdrawBasketFees accounts by their public keys.
160
+ * @param {string[]} withdrawBasketFeesPubkeys - The public keys of the WithdrawBasketFees accounts.
161
+ * @returns {Promise<Map<string, WithdrawBasketFees>>} A map of WithdrawBasketFees public keys to WithdrawBasketFees accounts.
162
+ */
163
+ fetchMultipleWithdrawBasketFees(withdrawBasketFeesPubkeys: string[]): Promise<Map<string, WithdrawBasketFees>>;
164
+ /**
165
+ * Fetches all WithdrawBasketFees accounts with optional filter.
166
+ * @param {WithdrawBasketFeesFilter} filter - Optional. The filter to apply to the WithdrawBasketFees accounts.
167
+ * @param {"basket" | "manager" | "creator" | "host" | "symmetry"} filter.type - The type of the filter.
168
+ * @param {string} filter.pubkey - The public key to filter by.
169
+ * @returns {Promise<WithdrawBasketFees[]>} The WithdrawBasketFees accounts.
170
+ */
171
+ fetchAllWithdrawBasketFees(filter?: WithdrawBasketFeesFilter): Promise<WithdrawBasketFees[]>;
172
+ /**
173
+ * Fetches all WithdrawBasketFees accounts for a given basket.
174
+ * @param {string} basketPubkey - The public key of the basket.
175
+ * @returns {Promise<WithdrawBasketFees[]>} The WithdrawBasketFees accounts.
176
+ */
177
+ fetchBasketWithdrawBasketFees(basketPubkey: string): Promise<WithdrawBasketFees[]>;
178
+ /**
179
+ * Fetches all WithdrawBasketFees accounts for a given manager.
180
+ * @param {string} managerPubkey - The public key of the manager.
181
+ * @returns {Promise<WithdrawBasketFees[]>} The WithdrawBasketFees accounts.
182
+ */
183
+ fetchManagerWithdrawBasketFees(managerPubkey: string): Promise<WithdrawBasketFees[]>;
184
+ /**
185
+ * Fetches all WithdrawBasketFees accounts for a given creator.
186
+ * @param {string} creatorPubkey - The public key of the creator.
187
+ * @returns {Promise<WithdrawBasketFees[]>} The WithdrawBasketFees accounts.
188
+ */
189
+ fetchCreatorWithdrawBasketFees(creatorPubkey: string): Promise<WithdrawBasketFees[]>;
190
+ /**
191
+ * Fetches all WithdrawBasketFees accounts for a given host.
192
+ * @param {string} hostPubkey - The public key of the host.
193
+ * @returns {Promise<WithdrawBasketFees[]>} The WithdrawBasketFees accounts.
194
+ */
195
+ fetchHostWithdrawBasketFees(hostPubkey: string): Promise<WithdrawBasketFees[]>;
196
+ /**
197
+ * Fetches all WithdrawBasketFees accounts for a given symmetry fee collector.
198
+ * @param {string} symmetryPubkey - The public key of the symmetry fee collector.
199
+ * @returns {Promise<WithdrawBasketFees[]>} The WithdrawBasketFees accounts.
200
+ */
201
+ fetchSymmetryWithdrawBasketFees(symmetryPubkey: string): Promise<WithdrawBasketFees[]>;
39
202
  createGlobalConfigTx(params: {
40
203
  signer: PublicKey;
41
204
  }): Promise<TxPayloadBatchSequence>;
@@ -43,6 +206,22 @@ export declare class SymmetryCore {
43
206
  signer: PublicKey;
44
207
  config: GlobalConfig;
45
208
  }): Promise<TxPayloadBatchSequence>;
209
+ /**
210
+ * Creates a basket.
211
+ * @param {Object} params - The parameters for the basket creation.
212
+ * @param {string} params.creator - The public key of the creator.
213
+ * @param {string} params.start_price - The start price of the basket.
214
+ * @param {string} params.name - The name of the basket.
215
+ * @param {string} params.symbol - The symbol of the basket.
216
+ * @param {string} params.metadata_uri - The metadata URI of the basket.
217
+ * @param {Object} params.host_platform_params - Optional. The host platform parameters.
218
+ * @param {string} params.host_platform_params.host_pubkey - The public key of the host.
219
+ * @param {number} params.host_platform_params.host_deposit_fee_bps - The host deposit fee in basis points.
220
+ * @param {number} params.host_platform_params.host_withdraw_fee_bps - The host withdrawal fee in basis points.
221
+ * @param {number} params.host_platform_params.host_management_fee_bps - The host management fee in basis points.
222
+ * @param {number} params.host_platform_params.host_performance_fee_bps - The host performance fee in basis points.
223
+ * @returns {Promise<BasketCreationTx>} The basket creation transaction.
224
+ */
46
225
  createBasketTx(params: {
47
226
  creator: string;
48
227
  start_price: string;
@@ -57,22 +236,130 @@ export declare class SymmetryCore {
57
236
  host_performance_fee_bps: number;
58
237
  };
59
238
  }): Promise<BasketCreationTx>;
239
+ /**
240
+ * Changes the creator of a basket.
241
+ * @param {TaskContext} context - The context of the task.
242
+ * @param {EditCreatorSettings} settings - The settings for the creator edit.
243
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
244
+ */
60
245
  editCreatorTx(context: TaskContext, settings: EditCreatorSettings): Promise<TxPayloadBatchSequence>;
246
+ /**
247
+ * Creates an edit manager settings intent for a basket.
248
+ * @param {TaskContext} context - The context of the task.
249
+ * @param {EditManagerSettings} settings - The settings for the manager edit.
250
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
251
+ */
61
252
  editManagersTx(context: TaskContext, settings: EditManagerSettings): Promise<TxPayloadBatchSequence>;
253
+ /**
254
+ * Creates an edit schedule settings intent for a basket.
255
+ * @param {TaskContext} context - The context of the task.
256
+ * @param {EditScheduleSettings} settings - The settings for the schedule edit.
257
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
258
+ */
62
259
  editScheduleTx(context: TaskContext, settings: EditScheduleSettings): Promise<TxPayloadBatchSequence>;
260
+ /**
261
+ * Creates an edit fees settings intent for a basket.
262
+ * @param {TaskContext} context - The context of the task.
263
+ * @param {EditFeeSettings} settings - The settings for the fee edit.
264
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
265
+ */
63
266
  editFeesTx(context: TaskContext, settings: EditFeeSettings): Promise<TxPayloadBatchSequence>;
267
+ /**
268
+ * Creates an edit automation settings intent for a basket.
269
+ * @param {TaskContext} context - The context of the task.
270
+ * @param {EditAutomationSettings} settings - The settings for the automation edit.
271
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
272
+ */
64
273
  editAutomationTx(context: TaskContext, settings: EditAutomationSettings): Promise<TxPayloadBatchSequence>;
274
+ /**
275
+ * Creates an edit LP settings intent for a basket.
276
+ * @param {TaskContext} context - The context of the task.
277
+ * @param {EditLpSettings} settings - The settings for the LP edit.
278
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
279
+ */
65
280
  editLpTx(context: TaskContext, settings: EditLpSettings): Promise<TxPayloadBatchSequence>;
281
+ /**
282
+ * Creates an edit metadata settings intent for a basket.
283
+ * @param {TaskContext} context - The context of the task.
284
+ * @param {EditMetadataSettings} settings - The settings for the metadata edit.
285
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
286
+ */
66
287
  editMetadataTx(context: TaskContext, settings: EditMetadataSettings): Promise<TxPayloadBatchSequence>;
288
+ /**
289
+ * Creates an edit deposits settings intent for a basket.
290
+ * @param {TaskContext} context - The context of the task.
291
+ * @param {EditDepositsSettings} settings - The settings for the deposits edit.
292
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
293
+ */
67
294
  editDepositsTx(context: TaskContext, settings: EditDepositsSettings): Promise<TxPayloadBatchSequence>;
295
+ /**
296
+ * Creates an edit force rebalance settings intent for a basket.
297
+ * @param {TaskContext} context - The context of the task.
298
+ * @param {EditForceRebalanceSettings} settings - The settings for the force rebalance edit.
299
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
300
+ */
68
301
  editForceRebalanceTx(context: TaskContext, settings: EditForceRebalanceSettings): Promise<TxPayloadBatchSequence>;
302
+ /**
303
+ * Creates an edit custom rebalance settings intent for a basket.
304
+ * @param {TaskContext} context - The context of the task.
305
+ * @param {EditCustomRebalanceSettings} settings - The settings for the custom rebalance edit.
306
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
307
+ */
69
308
  editCustomRebalanceTx(context: TaskContext, settings: EditCustomRebalanceSettings): Promise<TxPayloadBatchSequence>;
309
+ /**
310
+ * Creates an edit add token delay intent for a basket.
311
+ * @param {TaskContext} context - The context of the task.
312
+ * @param {EditAddTokenSettings} settings - The settings for the add token delay edit.
313
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
314
+ */
70
315
  editAddTokenDelayTx(context: TaskContext, settings: EditAddTokenSettings): Promise<TxPayloadBatchSequence>;
316
+ /**
317
+ * Creates an edit update weights delay intent for a basket.
318
+ * @param {TaskContext} context - The context of the task.
319
+ * @param {EditUpdateWeightsSettings} settings - The settings for the update weights delay edit.
320
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
321
+ */
71
322
  editUpdateWeightsDelayTx(context: TaskContext, settings: EditUpdateWeightsSettings): Promise<TxPayloadBatchSequence>;
323
+ /**
324
+ * Creates an edit swap delay intent for a basket.
325
+ * @param {TaskContext} context - The context of the task.
326
+ * @param {EditMakeDirectSwapSettings} settings - The settings for the make direct swap delay edit.
327
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
328
+ */
72
329
  editSwapDelayTx(context: TaskContext, settings: EditMakeDirectSwapSettings): Promise<TxPayloadBatchSequence>;
330
+ /**
331
+ * Creates an add or edit token intent for a basket.
332
+ * @param {TaskContext} context - The context of the task.
333
+ * @param {AddOrEditTokenInput} settings - The settings for the add or edit token.
334
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
335
+ */
73
336
  addOrEditTokenTx(context: TaskContext, settings: AddOrEditTokenInput): Promise<TxPayloadBatchSequence>;
337
+ /**
338
+ * Creates a update weights intent for a basket.
339
+ * @param {TaskContext} context - The context of the task.
340
+ * @param {UpdateWeightsInput} settings - The settings for the update weights.
341
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
342
+ */
74
343
  updateWeightsTx(context: TaskContext, settings: UpdateWeightsInput): Promise<TxPayloadBatchSequence>;
344
+ /**
345
+ * Creates a direct swap intent for a basket.
346
+ * @param {TaskContext} context - The context of the task.
347
+ * @param {MakeDirectSwapInput} settings - The settings for the make direct swap.
348
+ * @param {TransactionInstruction} jup_swap_ix - Optional. The JUP swap instruction.
349
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
350
+ */
75
351
  makeDirectSwapTx(context: TaskContext, settings: MakeDirectSwapInput, jup_swap_ix?: TransactionInstruction): Promise<TxPayloadBatchSequence>;
352
+ /**
353
+ * Creates basket intent account.
354
+ * @param {Object} params - The parameters for the basket intent.
355
+ * @param {TaskContext} params.context - The context of the task.
356
+ * @param {TaskType} params.type - The type of the task.
357
+ * @param {Settings} params.settings - The settings for the task.
358
+ * @param {number} params.min_bounty_per_task - Optional. The minimum bounty per task.
359
+ * @param {number} params.max_bounty_per_task - Optional. The maximum bounty per task.
360
+ * @param {TransactionInstruction} params.jup_swap_ix - Optional. The JUP swap instruction (for MakeDirectSwap task).
361
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
362
+ */
76
363
  openBasketIntentTx(params: {
77
364
  context: TaskContext;
78
365
  type: TaskType;
@@ -81,18 +368,68 @@ export declare class SymmetryCore {
81
368
  max_bounty_per_task?: number;
82
369
  jup_swap_ix?: TransactionInstruction;
83
370
  }): Promise<TxPayloadBatchSequence>;
371
+ /**
372
+ * Executes a basket intent. Basket intent will be executed immediately.
373
+ * @param {Object} params - The parameters for the basket intent.
374
+ * @param {string} params.keeper - The public key of the keeper.
375
+ * @param {string} params.intent - The public key of the intent.
376
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
377
+ */
84
378
  executeBasketIntentTx(params: {
85
379
  keeper: string;
86
380
  intent: string;
87
381
  }): Promise<TxPayloadBatchSequence>;
382
+ /**
383
+ * Cancels a basket intent. Basket intent account will get closed.
384
+ * @param {Object} params - The parameters for the basket intent.
385
+ * @param {string} params.keeper - The public key of the keeper.
386
+ * @param {string} params.intent - The public key of the intent.
387
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
388
+ */
88
389
  cancelBasketIntentTx(params: {
89
390
  keeper: string;
90
391
  intent: string;
91
392
  }): Promise<TxPayloadBatchSequence>;
393
+ /**
394
+ * Cancels a rebalance intent. Rebalance intent status will be set to AuctionFinished.
395
+ * @param {Object} params - The parameters for the rebalance intent.
396
+ * @param {string} params.keeper - The public key of the keeper.
397
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent.
398
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
399
+ */
92
400
  cancelRebalanceIntentTx(params: {
93
401
  keeper: string;
94
402
  rebalance_intent: string;
95
403
  }): Promise<TxPayloadBatchSequence>;
404
+ /**
405
+ * Creates a rebalance intent for a user to deposit tokens into a basket.
406
+ *
407
+ * Batch layout:
408
+ *
409
+ * batch 0:
410
+ * * tx0: [create, resize, init rebalance intent],
411
+ *
412
+ * batch 1:
413
+ * * tx0: [deposit tokens ix],
414
+ * * tx1: [deposit tokens ix],
415
+ * * ...
416
+ *
417
+ * batch 2:
418
+ * * tx0: [lock deposits ix, start price updates ix],
419
+ *
420
+ * @param {Object} params - The parameters for the basket purchase.
421
+ * @param {string} params.buyer - The public key of the buyer.
422
+ * @param {string} params.basket_mint - The mint public key of the basket.
423
+ * @param {{mint: string, amount: number}[]} params.contributions - The contributions to the basket.
424
+ * @param {string} params.contributions[].mint - The mint public key of the contribution.
425
+ * @param {number} params.contributions[].amount - The amount of the contribution.
426
+ * @param {number} params.rebalance_slippage_bps - Optional. The rebalance slippage in basis points.
427
+ * @param {number} params.per_trade_rebalance_slippage_bps - Optional. The per trade rebalance slippage in basis points.
428
+ * @param {number} params.execution_start_time - Optional. The execution start time.
429
+ * @param {number} params.min_bounty_amount - Optional. The minimum bounty amount.
430
+ * @param {number} params.max_bounty_amount - Optional. The maximum bounty amount.
431
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
432
+ */
96
433
  buyBasketTx(params: {
97
434
  buyer: string;
98
435
  basket_mint: string;
@@ -106,6 +443,20 @@ export declare class SymmetryCore {
106
443
  min_bounty_amount?: number;
107
444
  max_bounty_amount?: number;
108
445
  }): Promise<TxPayloadBatchSequence>;
446
+ /**
447
+ * Creates a rebalance intent for a user to withdraw tokens from a basket.
448
+ * @param {{Object}} params - The parameters for the basket sale.
449
+ * @param {string} params.seller - The public key of the seller.
450
+ * @param {string} params.basket_mint - The mint public key of the basket.
451
+ * @param {number} params.withdraw_amount - The amount of the withdrawal.
452
+ * @param {string[]} params.keep_tokens - The token mints to skip rebalancing (will directly be sent to the user without being rebalanced).
453
+ * @param {number} params.rebalance_slippage_bps - Optional. The rebalance slippage in basis points.
454
+ * @param {number} params.per_trade_rebalance_slippage_bps - Optional. The per trade rebalance slippage in basis points.
455
+ * @param {number} params.execution_start_time - Optional. The execution start time.
456
+ * @param {number} params.min_bounty_amount - Optional. The minimum bounty amount.
457
+ * @param {number} params.max_bounty_amount - Optional. The maximum bounty amount.
458
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
459
+ */
109
460
  sellBasketTx(params: {
110
461
  seller: string;
111
462
  basket_mint: string;
@@ -117,6 +468,18 @@ export declare class SymmetryCore {
117
468
  min_bounty_amount?: number;
118
469
  max_bounty_amount?: number;
119
470
  }): Promise<TxPayloadBatchSequence>;
471
+ /**
472
+ * Creates a rebalance intent for a basket rebalance.
473
+ * @param {Object} params - The parameters for the basket rebalance.
474
+ * @param {string} params.keeper - The public key of the keeper.
475
+ * @param {string} params.basket_mint - The basket token mint public key.
476
+ * @param {number} params.rebalance_slippage_bps - Optional. The rebalance slippage in basis points.
477
+ * @param {number} params.per_trade_rebalance_slippage_bps - Optional. The per trade rebalance slippage in basis points.
478
+ * @param {number} params.execution_start_time - Optional. The execution start time.
479
+ * @param {number} params.min_bounty_amount - Optional. The minimum bounty amount.
480
+ * @param {number} params.max_bounty_amount - Optional. The maximum bounty amount.
481
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
482
+ */
120
483
  rebalanceBasketTx(params: {
121
484
  keeper: string;
122
485
  basket_mint: string;
@@ -126,6 +489,17 @@ export declare class SymmetryCore {
126
489
  min_bounty_amount?: number;
127
490
  max_bounty_amount?: number;
128
491
  }): Promise<TxPayloadBatchSequence>;
492
+ /**
493
+ * Marks the start of price updates for a rebalance intent. Keepers will be able to
494
+ *
495
+ * update token prices for the rebalance intent after priceUpdateDelayAfterCreation seconds.
496
+ *
497
+ * @param {Object} params - The parameters for the start price updates.
498
+ * @param {string} params.keeper - The public key of the keeper.
499
+ * @param {string} params.basket - The public key of the basket.
500
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent.
501
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
502
+ */
129
503
  startPriceUpdatesTx(params: {
130
504
  keeper: string;
131
505
  basket: string;
@@ -133,20 +507,111 @@ export declare class SymmetryCore {
133
507
  }): Promise<TxPayloadBatchSequence>;
134
508
  /**
135
509
  * Build update token prices transactions.
510
+ *
136
511
  * For pyth oracle accounts, fetches feed IDs, builds vaa [create init encode], [write verify],
512
+ *
137
513
  * [update feed], [close vaa] instructions. For all tokens, builds [update token prices] instructions.
138
- * and returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
514
+ *
515
+ * returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
516
+ *
139
517
  * Batch layout:
140
- * batch 0: [ [vaa1CreateInitEncodeIxs], [vaa2CreateInitEncodeIxs], ... ]
141
- * batch 1: [ [vaa1WriteVerifyIxs], [vaa2WriteVerifyIxs], ... ]
142
- * batch 2: [ [updateFeed1], [updateFeed2], ... ]
143
- * batch 3: [ [updateTokenPrices], [...], [closeVaa1Ix, closeVaa2Ix, ...]]
518
+ *
519
+ * batch 0:
520
+ * * tx0: [vaa0CreateIx, vaa0InitIx, vaa0WriteIx],
521
+ * * tx1: [vaa1CreateIx, vaa1InitIx, vaa1WriteIx],
522
+ * * ...
523
+ *
524
+ * batch 1:
525
+ * * tx0: [vaa0WriteVerifyIx, vaa0VerifyIx],
526
+ * * tx1: [vaa1WriteVerifyIx, vaa1VerifyIx],
527
+ * * ...
528
+ *
529
+ * batch 2:
530
+ * * tx0: [updateFeed0Ix],
531
+ * * tx1: [updateFeed1Ix],
532
+ * * ...
533
+ *
534
+ * batch 3:
535
+ * * tx0: [updateTokenPricesIx(max 10 tokens)],
536
+ * * tx1: [updateTokenPricesIx(max 10 tokens)],
537
+ * * ...
538
+ * * txLast: [closeVaa0Ix, closeVaa1Ix, ...]
539
+ *
540
+ * @param {Object} params - The parameters for the update token prices.
541
+ * @param {string} params.keeper - The public key of the keeper.
542
+ * @param {string} params.basket - The public key of the basket.
543
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent.
544
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
144
545
  */
145
546
  updateTokenPricesTx(params: {
146
547
  keeper: string;
147
548
  basket: string;
148
549
  rebalance_intent: string;
149
550
  }): Promise<TxPayloadBatchSequence>;
551
+ /**
552
+ * Build Pyth price feed update transactions from on-chain price account pubkeys.
553
+ * Fetches feed IDs from accounts, builds update instructions, and returns
554
+ * TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
555
+ *
556
+ * Batch layout:
557
+ *
558
+ * batch 0:
559
+ * * tx0: [vaa0CreateIx, vaa0InitIx, vaa0WriteIx],
560
+ * * tx1: [vaa1CreateIx, vaa1InitIx, vaa1WriteIx],
561
+ * * ...
562
+ *
563
+ * batch 1:
564
+ * * tx0: [vaa0WriteVerifyIx, vaa0VerifyIx],
565
+ * * tx1: [vaa1WriteVerifyIx, vaa1VerifyIx],
566
+ * * ...
567
+ *
568
+ * batch 2:
569
+ * * tx0: [updateFeed0Ix],
570
+ * * tx1: [updateFeed1Ix],
571
+ * * ...
572
+ *
573
+ * batch 3:
574
+ * * txLast: [closeVaa0Ix, closeVaa1Ix, ...]
575
+ *
576
+ */
577
+ updatePythPriceFeedsTx(params: {
578
+ keeper: string;
579
+ accounts: string[];
580
+ }): Promise<TxPayloadBatchSequence>;
581
+ /**
582
+ * Build flash swap transactions (Rebalance or MakeDirectSwap).
583
+ *
584
+ * Withdraws amount_out tokens(mint_out) from basket, deposits amount_in tokens(mint_in) to basket.
585
+ *
586
+ * If jup_swap_ix is provided, uses it to swap amount_out tokens(mint_out) for amount_in tokens(mint_in).
587
+ *
588
+ * returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
589
+ *
590
+ * Batch layout: batch 0: tx: 0:
591
+ * * create associated token account_mint_out
592
+ * * create associated token account_mint_in
593
+ * * jup_token_ledger_ix
594
+ * * flash withdraw
595
+ * * jup_swap_ix
596
+ * * flash deposit
597
+ * * set compute unit limit
598
+ * * set compute unit price
599
+ *
600
+ * @param {Object} params - The parameters for the flash swap.
601
+ * @param {string} params.keeper - The public key of the keeper.
602
+ * @param {string} params.basket - The public key of the basket.
603
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent (for Rebalance).
604
+ * @param {string} params.intent - The public key of the intent (for MakeDirectSwap).
605
+ * @param {string} params.mint_in - The mint of the input token (deposited to basket).
606
+ * @param {string} params.mint_out - The mint of the output token (withdrawn from basket).
607
+ * @param {number} params.amount_in - The amount of the input token (deposited to basket).
608
+ * @param {number} params.amount_out - The amount of the output token (withdrawn from basket).
609
+ * @param {"exact_in" | "exact_out" | "ioc"} params.mode - The mode of the flash swap.
610
+ * @param {TransactionInstruction} params.jup_token_ledger_ix - The jup token ledger ix.
611
+ * @param {TransactionInstruction} params.jup_swap_ix - The jup swap ix.
612
+ * @param {PublicKey[]} params.jup_address_lookup_table_addresses - The jup address lookup table addresses.
613
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
614
+ */
150
615
  flashSwapTx(params: {
151
616
  keeper: string;
152
617
  basket: string;
@@ -161,27 +626,139 @@ export declare class SymmetryCore {
161
626
  jup_swap_ix?: TransactionInstruction;
162
627
  jup_address_lookup_table_addresses?: PublicKey[];
163
628
  }): Promise<TxPayloadBatchSequence>;
629
+ /**
630
+ * Mints basket tokens for a user. Executable when the rebalance intent has finished its auctions.
631
+ *
632
+ * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
633
+ *
634
+ * @param {Object} params - The parameters for the mint.
635
+ * @param {string} params.keeper - The public key of the keeper.
636
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent.
637
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
638
+ */
164
639
  mintTx(params: {
165
640
  keeper: string;
166
641
  rebalance_intent: string;
167
642
  }): Promise<TxPayloadBatchSequence>;
643
+ /**
644
+ * Redeems tokens from the rebalance intent with Withdraw status.
645
+ *
646
+ * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
647
+ *
648
+ * @param {Object} params - The parameters for the redeem tokens.
649
+ * @param {string} params.keeper - The public key of the keeper.
650
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent.
651
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
652
+ */
168
653
  redeemTokensTx(params: {
169
654
  keeper: string;
170
655
  rebalance_intent: string;
171
656
  }): Promise<TxPayloadBatchSequence>;
657
+ /**
658
+ * Claims the bounty to keepers who have completed tasks for rebalance intent.
659
+ *
660
+ * Executebale when the rebalance intent has finished its auctions.
661
+ *
662
+ * For Withdraw status rebalance intent, tokens have to be redeemed first.
663
+ *
664
+ * Closes the rebalance intent if all keepers have claimed the bounty.
665
+ *
666
+ * @param {Object} params - The parameters for the claim bounty.
667
+ * @param {string} params.keeper - The public key of the keeper.
668
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent.
669
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
670
+ */
172
671
  claimBountyTx(params: {
173
672
  keeper: string;
174
673
  rebalance_intent: string;
175
674
  }): Promise<TxPayloadBatchSequence>;
675
+ /**
676
+ * Adds bounty for automation to basket.
677
+ * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
678
+ *
679
+ * @param {Object} params - The parameters for the add bounty.
680
+ * @param {string} params.keeper - The public key of the keeper.
681
+ * @param {string} params.basket - The public key of the basket.
682
+ * @param {number} params.amount - The amount of the bounty.
683
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
684
+ */
176
685
  addBountyTx(params: {
177
686
  keeper: string;
178
687
  basket: string;
179
688
  amount: number;
180
689
  }): Promise<TxPayloadBatchSequence>;
181
- claimBasketFeesTx(params: {
690
+ /**
691
+ * Withdraws fees from the basket, initializes WithdrawBasketFees accounts, and claims the fee tokens
692
+ * for all fee types that the claimer is authorized to claim (symmetry, creator, host, or manager fees).
693
+ *
694
+ * This function automatically determines which fee types the claimer can claim based on:
695
+ * - Symmetry fees: if claimer equals globalConfig.symmetryFeeCollector
696
+ * - Creator fees: if claimer equals basket.settings.creator
697
+ * - Host fees: if claimer equals basket.settings.host
698
+ * - Manager fees: if claimer is in basket.settings.managers.managers
699
+ *
700
+ * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
701
+ *
702
+ * Batch layout:
703
+ * - batch 0: One transaction per claimable fee type, each containing a withdrawFeesIx instruction.
704
+ * All transactions in this batch can run in parallel. These create and populate the WithdrawBasketFees accounts.
705
+ * - batch 1: Multiple transactions for claiming fee tokens, automatically batched based on account limits.
706
+ * All transactions in this batch can run in parallel. These transfer tokens from WithdrawBasketFees accounts to claimers.
707
+ *
708
+ * Note: If not all tokens are claimed in batch 1 (e.g., due to account limits or errors),
709
+ * use claimTokenFeesFromBasketTx to claim the remaining tokens.
710
+ *
711
+ * @param {Object} params - The parameters for withdrawing and claiming basket fees.
712
+ * @param {string} params.claimer - The public key of the claimer.
713
+ * @param {string} params.basket - The public key of the basket.
714
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
715
+ */
716
+ withdrawBasketFeesTx(params: {
182
717
  claimer: string;
183
718
  basket: string;
184
719
  }): Promise<TxPayloadBatchSequence>;
720
+ /**
721
+ * Claims fee tokens from a WithdrawBasketFees account.
722
+ *
723
+ * This function transfers accumulated fee tokens from the WithdrawBasketFees account
724
+ * to the claimers (owners) based on their weights. The tokens are automatically batched
725
+ * into multiple transactions if needed to respect Solana's account limit (30 accounts per transaction).
726
+ *
727
+ * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
728
+ *
729
+ * @param {Object} params - The parameters for claiming basket fees.
730
+ * @param {string} params.claimer - The public key of the claimer.
731
+ * @param {string} params.basket - The public key of the basket.
732
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
733
+ */
734
+ claimTokenFeesFromBasketTx(params: {
735
+ claimer: string;
736
+ withdrawBasketFees: string;
737
+ }): Promise<TxPayloadBatchSequence>;
738
+ /**
739
+ * Rewrites lookup tables for the basket. (Used when the basket lookup tables are full)
740
+ *
741
+ * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
742
+ *
743
+ * Batch layout:
744
+ *
745
+ * batch 0:
746
+ * * tx0: [create temp lookup tables],
747
+ *
748
+ * batch 1:
749
+ * * tx0: [extend temp lookup tables (with oracles of active tokens)],
750
+ * * tx1: [extend temp lookup tables (with oracles of active tokens)],
751
+ * * ...
752
+ *
753
+ * batch 2:
754
+ * * tx0: [overwrite lookup tables with temp, deactivate old lookup tables],
755
+ *
756
+ * @param {Object} params - The parameters for the rewrite lookup tables.
757
+ * @param {string} params.signer - The public key of the signer.
758
+ * @param {string} params.basket_mint - The mint of the basket.
759
+ * @param {string[]} params.additional_accounts - The additional accounts.
760
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
761
+ */
185
762
  rewriteLookupTablesTx(params: {
186
763
  signer: string;
187
764
  basket_mint: string;
@@ -196,6 +773,7 @@ export declare class SymmetryCore {
196
773
  wallet: Wallet;
197
774
  }): Promise<TransactionSignature[][]>;
198
775
  }
776
+ export { BasketCreationTx, TxPayloadBatchSequence, VersionedTxs, };
199
777
  export { GlobalConfig, Basket, BasketFilter, Intent, IntentFilter, RebalanceIntent, RebalanceIntentFilter };
200
778
  export { FormattedGlobalConfig, FormattedIntentStatus, FormattedTaskType, FormattedBounty, FormattedBountySchedule, FormattedIntent, };
201
779
  export { FormattedRebalanceType, FormattedRebalanceAction, FormattedOraclePrice, FormattedTokenAuction, FormattedTaskCompletion, FormattedRebalanceIntent, };