@symmetry-hq/temp-v3-sdk 0.0.39 → 0.0.41

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.
@@ -20,3 +20,4 @@ export declare const MAX_SUPPORTED_TOKENS_PER_BASKET: number;
20
20
  export declare const MAX_ORACLES_PER_TOKEN: number;
21
21
  export declare const MAX_EXTRA_DATA_PER_ORACLE: number;
22
22
  export declare const LUT_EXTEND_BATCH_SIZE = 20;
23
+ export declare const UPDATE_TOKEN_PRICES_MAX_ACCOUNTS = 50;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LUT_EXTEND_BATCH_SIZE = exports.MAX_EXTRA_DATA_PER_ORACLE = exports.MAX_ORACLES_PER_TOKEN = exports.MAX_SUPPORTED_TOKENS_PER_BASKET = exports.USDC_DECIMALS = exports.WSOL_DECIMALS = exports.HUNDRED_PERCENT_BPS = exports.X64 = exports.MAX_TRANSFER_TOKENS = exports.MAX_MANAGERS_PER_BASKET = exports.INTENT_TASK_DATA_SIZE = exports.PYTHNET_CUSTODY_PRICE_USDC_ACCOUNT = exports.PYTHNET_CUSTODY_PRICE_WSOL_ACCOUNT = exports.MINTS = exports.RENT_SYSVAR_ID = exports.ADDRESS_LOOKUP_TABLE_PROGRAM_ID = exports.METADATA_PROGRAM_ID = exports.BASKETS_V3_PROGRAM_ID = exports.PRIORITY_FEE = exports.COMPUTE_UNITS = void 0;
6
+ exports.UPDATE_TOKEN_PRICES_MAX_ACCOUNTS = exports.LUT_EXTEND_BATCH_SIZE = exports.MAX_EXTRA_DATA_PER_ORACLE = exports.MAX_ORACLES_PER_TOKEN = exports.MAX_SUPPORTED_TOKENS_PER_BASKET = exports.USDC_DECIMALS = exports.WSOL_DECIMALS = exports.HUNDRED_PERCENT_BPS = exports.X64 = exports.MAX_TRANSFER_TOKENS = exports.MAX_MANAGERS_PER_BASKET = exports.INTENT_TASK_DATA_SIZE = exports.PYTHNET_CUSTODY_PRICE_USDC_ACCOUNT = exports.PYTHNET_CUSTODY_PRICE_WSOL_ACCOUNT = exports.MINTS = exports.RENT_SYSVAR_ID = exports.ADDRESS_LOOKUP_TABLE_PROGRAM_ID = exports.METADATA_PROGRAM_ID = exports.BASKETS_V3_PROGRAM_ID = exports.PRIORITY_FEE = exports.COMPUTE_UNITS = void 0;
7
7
  const web3_js_1 = require("@solana/web3.js");
8
8
  const decimal_js_1 = __importDefault(require("decimal.js"));
9
9
  exports.COMPUTE_UNITS = 1000000;
@@ -35,3 +35,4 @@ exports.MAX_SUPPORTED_TOKENS_PER_BASKET = 100;
35
35
  exports.MAX_ORACLES_PER_TOKEN = 4;
36
36
  exports.MAX_EXTRA_DATA_PER_ORACLE = 4;
37
37
  exports.LUT_EXTEND_BATCH_SIZE = 20;
38
+ exports.UPDATE_TOKEN_PRICES_MAX_ACCOUNTS = 50;
@@ -11,30 +11,142 @@ import { RebalanceIntentFilter } from './states/intents/rebalanceIntent';
11
11
  import { BasketCreationTx, TxPayloadBatchSequence, VersionedTxs, Wallet } from './txUtils';
12
12
  export declare class SymmetryCore {
13
13
  private sdkParams;
14
+ /**
15
+ * Initializes the SymmetryCore SDK.
16
+ * @param params {connection: Connection, network: "devnet" | "mainnet", priorityFee?: number} - The parameters for the SDK.
17
+ * @param params.connection - The connection to the Solana network.
18
+ * @param params.network - The network to use (devnet or mainnet).
19
+ * @param params.priorityFee - Optional. The priority fee to use for the transactions. Defaults to PRIORITY_FEE.
20
+ */
14
21
  constructor(params: {
15
22
  connection: Connection;
16
23
  network: "devnet" | "mainnet";
17
24
  priorityFee?: number;
18
25
  });
26
+ /**
27
+ * Fetches the global config account.
28
+ * @returns {Promise<GlobalConfig>} The global config.
29
+ */
19
30
  fetchGlobalConfig(): Promise<GlobalConfig>;
31
+ /**
32
+ * Fetches a basket by its public key.
33
+ * @param {string} basketPubkey - The public key of the basket.
34
+ * @returns {Promise<Basket>} The basket.
35
+ */
20
36
  fetchBasket(basketPubkey: string): Promise<Basket>;
37
+ /**
38
+ * Fetches multiple baskets by their public keys.
39
+ * @param {string[]} basketPubkeys - The public keys of the baskets.
40
+ * @returns {Promise<Map<string, Basket>>} A map of basket public keys to baskets.
41
+ */
21
42
  fetchMultipleBaskets(basketPubkeys: string[]): Promise<Map<string, Basket>>;
43
+ /**
44
+ * Fetches all baskets.
45
+ * @param {BasketFilter} basketFilter - Optional. The filter to apply to the baskets.
46
+ * @param {"creator" | "host" | "manager"} basketFilter.type - The type of the basket filter ("creator", "host", "manager").
47
+ * @param {string} basketFilter.pubkey - The public key of the basket filter.
48
+ * @returns {Promise<Basket[]>} The baskets.
49
+ */
22
50
  fetchAllBaskets(basketFilter?: BasketFilter): Promise<Basket[]>;
51
+ /**
52
+ * Fetches all baskets created by a given public key.
53
+ * @param {string} creatorPubkey - The public key of the creator.
54
+ * @returns {Promise<Basket[]>} The baskets.
55
+ */
23
56
  fetchCreatedBaskets(creatorPubkey: string): Promise<Basket[]>;
57
+ /**
58
+ * Fetches all baskets hosted by a given public key.
59
+ * @param {string} hostPubkey - The public key of the host.
60
+ * @returns {Promise<Basket[]>} The baskets.
61
+ */
24
62
  fetchHostedBaskets(hostPubkey: string): Promise<Basket[]>;
63
+ /**
64
+ * Fetches all baskets managed by a given public key.
65
+ * @param {string} managerPubkey - The public key of the manager.
66
+ * @returns {Promise<Basket[]>} The baskets.
67
+ */
25
68
  fetchManagedBaskets(managerPubkey: string): Promise<Basket[]>;
69
+ /**
70
+ * Derives baskets by their mints.
71
+ * @param {string[]} mints - The mint public keys of the baskets.
72
+ * @returns {Promise<Map<string, string>>} A map of basket mint public keys to basket public keys.
73
+ */
26
74
  deriveBasketsByMints(mints: string[]): Promise<Map<string, string>>;
75
+ /**
76
+ * Fetches baskets by their mint public keys.
77
+ * @param {string[]} mints - The mint public keys of the baskets.
78
+ * @returns {Promise<Map<string, Basket>>} A map of basket mint public keys to baskets.
79
+ */
27
80
  fetchBasketsFromMints(mints: string[]): Promise<Map<string, Basket>>;
81
+ /**
82
+ * Loads the price of a basket.
83
+ * @param {Basket} basket - The basket.
84
+ * @returns {Promise<Basket>} The basket with the price.
85
+ */
28
86
  loadBasketPrice(basket: Basket): Promise<Basket>;
87
+ /**
88
+ * Fetches an intent by its public key.
89
+ * @param {string} intentPubkey - The public key of the intent.
90
+ * @returns {Promise<Intent>} The intent.
91
+ */
29
92
  fetchIntent(intentPubkey: string): Promise<Intent>;
93
+ /**
94
+ * Fetches multiple intents by their public keys.
95
+ * @param {string[]} intentPubkeys - The public keys of the intents.
96
+ * @returns {Promise<Map<string, Intent>>} A map of intent public keys to intents.
97
+ */
30
98
  fetchMultipleIntents(intentPubkeys: string[]): Promise<Map<string, Intent>>;
99
+ /**
100
+ * Fetches all intents.
101
+ * @param {IntentFilter} filter - Optional. The filter to apply to the intents.
102
+ * @param {"creator" | "host" | "manager" | "basket" | "owner"} filter.type - The type of the intent filter ("creator", "host", "manager", "basket", "owner").
103
+ * @param {string} filter.pubkey - The public key of the intent filter.
104
+ * @returns {Promise<Intent[]>} The intents.
105
+ */
31
106
  fetchAllIntents(filter?: IntentFilter): Promise<Intent[]>;
107
+ /**
108
+ * Fetches all intents created by a given public key.
109
+ * @param {string} creatorPubkey - The public key of the creator.
110
+ * @returns {Promise<Intent[]>} The intents.
111
+ */
32
112
  fetchCreatedIntents(creatorPubkey: string): Promise<Intent[]>;
113
+ /**
114
+ * Fetches all intents for a given basket.
115
+ * @param {string} basketPubkey - The public key of the basket.
116
+ * @returns {Promise<Intent[]>} The intents.
117
+ */
33
118
  fetchBasketIntents(basketPubkey: string): Promise<Intent[]>;
119
+ /**
120
+ * Fetches a rebalance intent by its public key.
121
+ * @param {string} rebalanceIntentPubkey - The public key of the rebalance intent.
122
+ * @returns {Promise<RebalanceIntent>} The rebalance intent.
123
+ */
34
124
  fetchRebalanceIntent(rebalanceIntentPubkey: string): Promise<RebalanceIntent>;
125
+ /**
126
+ * Fetches multiple rebalance intents by their public keys.
127
+ * @param {string[]} rebalanceIntentPubkeys - The public keys of the rebalance intents.
128
+ * @returns {Promise<Map<string, RebalanceIntent>>} A map of rebalance intent public keys to rebalance intents.
129
+ */
35
130
  fetchMultipleRebalanceIntents(rebalanceIntentPubkeys: string[]): Promise<Map<string, RebalanceIntent>>;
131
+ /**
132
+ * Fetches all rebalance intents.
133
+ * @param {RebalanceIntentFilter} filter - Optional. The filter to apply to the rebalance intents.
134
+ * @param {"owner" | "basket"} filter.type - The type of the rebalance intent filter ("owner", "basket").
135
+ * @param {string} filter.pubkey - The public key of the rebalance intent filter.
136
+ * @returns {Promise<RebalanceIntent[]>} The rebalance intents.
137
+ */
36
138
  fetchAllRebalanceIntents(filter?: RebalanceIntentFilter): Promise<RebalanceIntent[]>;
139
+ /**
140
+ * Fetches all rebalance intents for a given owner.
141
+ * @param {string} ownerPubkey - The public key of the owner.
142
+ * @returns {Promise<RebalanceIntent[]>} The rebalance intents.
143
+ */
37
144
  fetchOwnerRebalanceIntents(ownerPubkey: string): Promise<RebalanceIntent[]>;
145
+ /**
146
+ * Fetches all rebalance intents for a given basket.
147
+ * @param {string} basketPubkey - The public key of the basket.
148
+ * @returns {Promise<RebalanceIntent[]>} The rebalance intents.
149
+ */
38
150
  fetchBasketRebalanceIntents(basketPubkey: string): Promise<RebalanceIntent[]>;
39
151
  createGlobalConfigTx(params: {
40
152
  signer: PublicKey;
@@ -43,6 +155,22 @@ export declare class SymmetryCore {
43
155
  signer: PublicKey;
44
156
  config: GlobalConfig;
45
157
  }): Promise<TxPayloadBatchSequence>;
158
+ /**
159
+ * Creates a basket.
160
+ * @param {Object} params - The parameters for the basket creation.
161
+ * @param {string} params.creator - The public key of the creator.
162
+ * @param {string} params.start_price - The start price of the basket.
163
+ * @param {string} params.name - The name of the basket.
164
+ * @param {string} params.symbol - The symbol of the basket.
165
+ * @param {string} params.metadata_uri - The metadata URI of the basket.
166
+ * @param {Object} params.host_platform_params - Optional. The host platform parameters.
167
+ * @param {string} params.host_platform_params.host_pubkey - The public key of the host.
168
+ * @param {number} params.host_platform_params.host_deposit_fee_bps - The host deposit fee in basis points.
169
+ * @param {number} params.host_platform_params.host_withdraw_fee_bps - The host withdrawal fee in basis points.
170
+ * @param {number} params.host_platform_params.host_management_fee_bps - The host management fee in basis points.
171
+ * @param {number} params.host_platform_params.host_performance_fee_bps - The host performance fee in basis points.
172
+ * @returns {Promise<BasketCreationTx>} The basket creation transaction.
173
+ */
46
174
  createBasketTx(params: {
47
175
  creator: string;
48
176
  start_price: string;
@@ -57,22 +185,130 @@ export declare class SymmetryCore {
57
185
  host_performance_fee_bps: number;
58
186
  };
59
187
  }): Promise<BasketCreationTx>;
188
+ /**
189
+ * Changes the creator of a basket.
190
+ * @param {TaskContext} context - The context of the task.
191
+ * @param {EditCreatorSettings} settings - The settings for the creator edit.
192
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
193
+ */
60
194
  editCreatorTx(context: TaskContext, settings: EditCreatorSettings): Promise<TxPayloadBatchSequence>;
195
+ /**
196
+ * Creates an edit manager settings intent for a basket.
197
+ * @param {TaskContext} context - The context of the task.
198
+ * @param {EditManagerSettings} settings - The settings for the manager edit.
199
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
200
+ */
61
201
  editManagersTx(context: TaskContext, settings: EditManagerSettings): Promise<TxPayloadBatchSequence>;
202
+ /**
203
+ * Creates an edit schedule settings intent for a basket.
204
+ * @param {TaskContext} context - The context of the task.
205
+ * @param {EditScheduleSettings} settings - The settings for the schedule edit.
206
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
207
+ */
62
208
  editScheduleTx(context: TaskContext, settings: EditScheduleSettings): Promise<TxPayloadBatchSequence>;
209
+ /**
210
+ * Creates an edit fees settings intent for a basket.
211
+ * @param {TaskContext} context - The context of the task.
212
+ * @param {EditFeeSettings} settings - The settings for the fee edit.
213
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
214
+ */
63
215
  editFeesTx(context: TaskContext, settings: EditFeeSettings): Promise<TxPayloadBatchSequence>;
216
+ /**
217
+ * Creates an edit automation settings intent for a basket.
218
+ * @param {TaskContext} context - The context of the task.
219
+ * @param {EditAutomationSettings} settings - The settings for the automation edit.
220
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
221
+ */
64
222
  editAutomationTx(context: TaskContext, settings: EditAutomationSettings): Promise<TxPayloadBatchSequence>;
223
+ /**
224
+ * Creates an edit LP settings intent for a basket.
225
+ * @param {TaskContext} context - The context of the task.
226
+ * @param {EditLpSettings} settings - The settings for the LP edit.
227
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
228
+ */
65
229
  editLpTx(context: TaskContext, settings: EditLpSettings): Promise<TxPayloadBatchSequence>;
230
+ /**
231
+ * Creates an edit metadata settings intent for a basket.
232
+ * @param {TaskContext} context - The context of the task.
233
+ * @param {EditMetadataSettings} settings - The settings for the metadata edit.
234
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
235
+ */
66
236
  editMetadataTx(context: TaskContext, settings: EditMetadataSettings): Promise<TxPayloadBatchSequence>;
237
+ /**
238
+ * Creates an edit deposits settings intent for a basket.
239
+ * @param {TaskContext} context - The context of the task.
240
+ * @param {EditDepositsSettings} settings - The settings for the deposits edit.
241
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
242
+ */
67
243
  editDepositsTx(context: TaskContext, settings: EditDepositsSettings): Promise<TxPayloadBatchSequence>;
244
+ /**
245
+ * Creates an edit force rebalance settings intent for a basket.
246
+ * @param {TaskContext} context - The context of the task.
247
+ * @param {EditForceRebalanceSettings} settings - The settings for the force rebalance edit.
248
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
249
+ */
68
250
  editForceRebalanceTx(context: TaskContext, settings: EditForceRebalanceSettings): Promise<TxPayloadBatchSequence>;
251
+ /**
252
+ * Creates an edit custom rebalance settings intent for a basket.
253
+ * @param {TaskContext} context - The context of the task.
254
+ * @param {EditCustomRebalanceSettings} settings - The settings for the custom rebalance edit.
255
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
256
+ */
69
257
  editCustomRebalanceTx(context: TaskContext, settings: EditCustomRebalanceSettings): Promise<TxPayloadBatchSequence>;
258
+ /**
259
+ * Creates an edit add token delay intent for a basket.
260
+ * @param {TaskContext} context - The context of the task.
261
+ * @param {EditAddTokenSettings} settings - The settings for the add token delay edit.
262
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
263
+ */
70
264
  editAddTokenDelayTx(context: TaskContext, settings: EditAddTokenSettings): Promise<TxPayloadBatchSequence>;
265
+ /**
266
+ * Creates an edit update weights delay intent for a basket.
267
+ * @param {TaskContext} context - The context of the task.
268
+ * @param {EditUpdateWeightsSettings} settings - The settings for the update weights delay edit.
269
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
270
+ */
71
271
  editUpdateWeightsDelayTx(context: TaskContext, settings: EditUpdateWeightsSettings): Promise<TxPayloadBatchSequence>;
272
+ /**
273
+ * Creates an edit swap delay intent for a basket.
274
+ * @param {TaskContext} context - The context of the task.
275
+ * @param {EditMakeDirectSwapSettings} settings - The settings for the make direct swap delay edit.
276
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
277
+ */
72
278
  editSwapDelayTx(context: TaskContext, settings: EditMakeDirectSwapSettings): Promise<TxPayloadBatchSequence>;
279
+ /**
280
+ * Creates an add or edit token intent for a basket.
281
+ * @param {TaskContext} context - The context of the task.
282
+ * @param {AddOrEditTokenInput} settings - The settings for the add or edit token.
283
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
284
+ */
73
285
  addOrEditTokenTx(context: TaskContext, settings: AddOrEditTokenInput): Promise<TxPayloadBatchSequence>;
286
+ /**
287
+ * Creates a update weights intent for a basket.
288
+ * @param {TaskContext} context - The context of the task.
289
+ * @param {UpdateWeightsInput} settings - The settings for the update weights.
290
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
291
+ */
74
292
  updateWeightsTx(context: TaskContext, settings: UpdateWeightsInput): Promise<TxPayloadBatchSequence>;
293
+ /**
294
+ * Creates a direct swap intent for a basket.
295
+ * @param {TaskContext} context - The context of the task.
296
+ * @param {MakeDirectSwapInput} settings - The settings for the make direct swap.
297
+ * @param {TransactionInstruction} jup_swap_ix - Optional. The JUP swap instruction.
298
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
299
+ */
75
300
  makeDirectSwapTx(context: TaskContext, settings: MakeDirectSwapInput, jup_swap_ix?: TransactionInstruction): Promise<TxPayloadBatchSequence>;
301
+ /**
302
+ * Creates basket intent account.
303
+ * @param {Object} params - The parameters for the basket intent.
304
+ * @param {TaskContext} params.context - The context of the task.
305
+ * @param {TaskType} params.type - The type of the task.
306
+ * @param {Settings} params.settings - The settings for the task.
307
+ * @param {number} params.min_bounty_per_task - Optional. The minimum bounty per task.
308
+ * @param {number} params.max_bounty_per_task - Optional. The maximum bounty per task.
309
+ * @param {TransactionInstruction} params.jup_swap_ix - Optional. The JUP swap instruction (for MakeDirectSwap task).
310
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
311
+ */
76
312
  openBasketIntentTx(params: {
77
313
  context: TaskContext;
78
314
  type: TaskType;
@@ -81,18 +317,68 @@ export declare class SymmetryCore {
81
317
  max_bounty_per_task?: number;
82
318
  jup_swap_ix?: TransactionInstruction;
83
319
  }): Promise<TxPayloadBatchSequence>;
320
+ /**
321
+ * Executes a basket intent. Basket intent will be executed immediately.
322
+ * @param {Object} params - The parameters for the basket intent.
323
+ * @param {string} params.keeper - The public key of the keeper.
324
+ * @param {string} params.intent - The public key of the intent.
325
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
326
+ */
84
327
  executeBasketIntentTx(params: {
85
328
  keeper: string;
86
329
  intent: string;
87
330
  }): Promise<TxPayloadBatchSequence>;
331
+ /**
332
+ * Cancels a basket intent. Basket intent account will get closed.
333
+ * @param {Object} params - The parameters for the basket intent.
334
+ * @param {string} params.keeper - The public key of the keeper.
335
+ * @param {string} params.intent - The public key of the intent.
336
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
337
+ */
88
338
  cancelBasketIntentTx(params: {
89
339
  keeper: string;
90
340
  intent: string;
91
341
  }): Promise<TxPayloadBatchSequence>;
342
+ /**
343
+ * Cancels a rebalance intent. Rebalance intent status will be set to AuctionFinished.
344
+ * @param {Object} params - The parameters for the rebalance intent.
345
+ * @param {string} params.keeper - The public key of the keeper.
346
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent.
347
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
348
+ */
92
349
  cancelRebalanceIntentTx(params: {
93
350
  keeper: string;
94
351
  rebalance_intent: string;
95
352
  }): Promise<TxPayloadBatchSequence>;
353
+ /**
354
+ * Creates a rebalance intent for a user to deposit tokens into a basket.
355
+ *
356
+ * Batch layout:
357
+ *
358
+ * batch 0:
359
+ * * tx0: [create, resize, init rebalance intent],
360
+ *
361
+ * batch 1:
362
+ * * tx0: [deposit tokens ix],
363
+ * * tx1: [deposit tokens ix],
364
+ * * ...
365
+ *
366
+ * batch 2:
367
+ * * tx0: [lock deposits ix, start price updates ix],
368
+ *
369
+ * @param {Object} params - The parameters for the basket purchase.
370
+ * @param {string} params.buyer - The public key of the buyer.
371
+ * @param {string} params.basket_mint - The mint public key of the basket.
372
+ * @param {{mint: string, amount: number}[]} params.contributions - The contributions to the basket.
373
+ * @param {string} params.contributions[].mint - The mint public key of the contribution.
374
+ * @param {number} params.contributions[].amount - The amount of the contribution.
375
+ * @param {number} params.rebalance_slippage_bps - Optional. The rebalance slippage in basis points.
376
+ * @param {number} params.per_trade_rebalance_slippage_bps - Optional. The per trade rebalance slippage in basis points.
377
+ * @param {number} params.execution_start_time - Optional. The execution start time.
378
+ * @param {number} params.min_bounty_amount - Optional. The minimum bounty amount.
379
+ * @param {number} params.max_bounty_amount - Optional. The maximum bounty amount.
380
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
381
+ */
96
382
  buyBasketTx(params: {
97
383
  buyer: string;
98
384
  basket_mint: string;
@@ -106,6 +392,20 @@ export declare class SymmetryCore {
106
392
  min_bounty_amount?: number;
107
393
  max_bounty_amount?: number;
108
394
  }): Promise<TxPayloadBatchSequence>;
395
+ /**
396
+ * Creates a rebalance intent for a user to withdraw tokens from a basket.
397
+ * @param {{Object}} params - The parameters for the basket sale.
398
+ * @param {string} params.seller - The public key of the seller.
399
+ * @param {string} params.basket_mint - The mint public key of the basket.
400
+ * @param {number} params.withdraw_amount - The amount of the withdrawal.
401
+ * @param {string[]} params.keep_tokens - The token mints to skip rebalancing (will directly be sent to the user without being rebalanced).
402
+ * @param {number} params.rebalance_slippage_bps - Optional. The rebalance slippage in basis points.
403
+ * @param {number} params.per_trade_rebalance_slippage_bps - Optional. The per trade rebalance slippage in basis points.
404
+ * @param {number} params.execution_start_time - Optional. The execution start time.
405
+ * @param {number} params.min_bounty_amount - Optional. The minimum bounty amount.
406
+ * @param {number} params.max_bounty_amount - Optional. The maximum bounty amount.
407
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
408
+ */
109
409
  sellBasketTx(params: {
110
410
  seller: string;
111
411
  basket_mint: string;
@@ -117,6 +417,18 @@ export declare class SymmetryCore {
117
417
  min_bounty_amount?: number;
118
418
  max_bounty_amount?: number;
119
419
  }): Promise<TxPayloadBatchSequence>;
420
+ /**
421
+ * Creates a rebalance intent for a basket rebalance.
422
+ * @param {Object} params - The parameters for the basket rebalance.
423
+ * @param {string} params.keeper - The public key of the keeper.
424
+ * @param {string} params.basket_mint - The basket token mint public key.
425
+ * @param {number} params.rebalance_slippage_bps - Optional. The rebalance slippage in basis points.
426
+ * @param {number} params.per_trade_rebalance_slippage_bps - Optional. The per trade rebalance slippage in basis points.
427
+ * @param {number} params.execution_start_time - Optional. The execution start time.
428
+ * @param {number} params.min_bounty_amount - Optional. The minimum bounty amount.
429
+ * @param {number} params.max_bounty_amount - Optional. The maximum bounty amount.
430
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
431
+ */
120
432
  rebalanceBasketTx(params: {
121
433
  keeper: string;
122
434
  basket_mint: string;
@@ -126,16 +438,129 @@ export declare class SymmetryCore {
126
438
  min_bounty_amount?: number;
127
439
  max_bounty_amount?: number;
128
440
  }): Promise<TxPayloadBatchSequence>;
441
+ /**
442
+ * Marks the start of price updates for a rebalance intent. Keepers will be able to
443
+ *
444
+ * update token prices for the rebalance intent after priceUpdateDelayAfterCreation seconds.
445
+ *
446
+ * @param {Object} params - The parameters for the start price updates.
447
+ * @param {string} params.keeper - The public key of the keeper.
448
+ * @param {string} params.basket - The public key of the basket.
449
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent.
450
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
451
+ */
129
452
  startPriceUpdatesTx(params: {
130
453
  keeper: string;
131
454
  basket: string;
132
455
  rebalance_intent: string;
133
456
  }): Promise<TxPayloadBatchSequence>;
457
+ /**
458
+ * Build update token prices transactions.
459
+ *
460
+ * For pyth oracle accounts, fetches feed IDs, builds vaa [create init encode], [write verify],
461
+ *
462
+ * [update feed], [close vaa] instructions. For all tokens, builds [update token prices] instructions.
463
+ *
464
+ * returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
465
+ *
466
+ * Batch layout:
467
+ *
468
+ * batch 0:
469
+ * * tx0: [vaa0CreateIx, vaa0InitIx, vaa0WriteIx],
470
+ * * tx1: [vaa1CreateIx, vaa1InitIx, vaa1WriteIx],
471
+ * * ...
472
+ *
473
+ * batch 1:
474
+ * * tx0: [vaa0WriteVerifyIx, vaa0VerifyIx],
475
+ * * tx1: [vaa1WriteVerifyIx, vaa1VerifyIx],
476
+ * * ...
477
+ *
478
+ * batch 2:
479
+ * * tx0: [updateFeed0Ix],
480
+ * * tx1: [updateFeed1Ix],
481
+ * * ...
482
+ *
483
+ * batch 3:
484
+ * * tx0: [updateTokenPricesIx(max 10 tokens)],
485
+ * * tx1: [updateTokenPricesIx(max 10 tokens)],
486
+ * * ...
487
+ * * txLast: [closeVaa0Ix, closeVaa1Ix, ...]
488
+ *
489
+ * @param {Object} params - The parameters for the update token prices.
490
+ * @param {string} params.keeper - The public key of the keeper.
491
+ * @param {string} params.basket - The public key of the basket.
492
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent.
493
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
494
+ */
134
495
  updateTokenPricesTx(params: {
135
496
  keeper: string;
136
497
  basket: string;
137
498
  rebalance_intent: string;
138
499
  }): Promise<TxPayloadBatchSequence>;
500
+ /**
501
+ * Build Pyth price feed update transactions from on-chain price account pubkeys.
502
+ * Fetches feed IDs from accounts, builds update instructions, and returns
503
+ * TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
504
+ *
505
+ * Batch layout:
506
+ *
507
+ * batch 0:
508
+ * * tx0: [vaa0CreateIx, vaa0InitIx, vaa0WriteIx],
509
+ * * tx1: [vaa1CreateIx, vaa1InitIx, vaa1WriteIx],
510
+ * * ...
511
+ *
512
+ * batch 1:
513
+ * * tx0: [vaa0WriteVerifyIx, vaa0VerifyIx],
514
+ * * tx1: [vaa1WriteVerifyIx, vaa1VerifyIx],
515
+ * * ...
516
+ *
517
+ * batch 2:
518
+ * * tx0: [updateFeed0Ix],
519
+ * * tx1: [updateFeed1Ix],
520
+ * * ...
521
+ *
522
+ * batch 3:
523
+ * * txLast: [closeVaa0Ix, closeVaa1Ix, ...]
524
+ *
525
+ */
526
+ updatePythPriceFeedsTx(params: {
527
+ keeper: string;
528
+ accounts: string[];
529
+ }): Promise<TxPayloadBatchSequence>;
530
+ /**
531
+ * Build flash swap transactions (Rebalance or MakeDirectSwap).
532
+ *
533
+ * Withdraws amount_out tokens(mint_out) from basket, deposits amount_in tokens(mint_in) to basket.
534
+ *
535
+ * If jup_swap_ix is provided, uses it to swap amount_out tokens(mint_out) for amount_in tokens(mint_in).
536
+ *
537
+ * returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
538
+ *
539
+ * Batch layout: batch 0: tx: 0:
540
+ * * create associated token account_mint_out
541
+ * * create associated token account_mint_in
542
+ * * jup_token_ledger_ix
543
+ * * flash withdraw
544
+ * * jup_swap_ix
545
+ * * flash deposit
546
+ * * set compute unit limit
547
+ * * set compute unit price
548
+ *
549
+ * @param {Object} params - The parameters for the flash swap.
550
+ * @param {string} params.keeper - The public key of the keeper.
551
+ * @param {string} params.basket - The public key of the basket.
552
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent (for Rebalance).
553
+ * @param {string} params.intent - The public key of the intent (for MakeDirectSwap).
554
+ * @param {string} params.mint_in - The mint of the input token (deposited to basket).
555
+ * @param {string} params.mint_out - The mint of the output token (withdrawn from basket).
556
+ * @param {number} params.amount_in - The amount of the input token (deposited to basket).
557
+ * @param {number} params.amount_out - The amount of the output token (withdrawn from basket).
558
+ * @param {"exact_in" | "exact_out" | "ioc"} params.mode - The mode of the flash swap.
559
+ * @param {TransactionInstruction} params.jup_token_ledger_ix - The jup token ledger ix.
560
+ * @param {TransactionInstruction} params.jup_swap_ix - The jup swap ix.
561
+ * @param {PublicKey[]} params.jup_address_lookup_table_addresses - The jup address lookup table addresses.
562
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
563
+ */
139
564
  flashSwapTx(params: {
140
565
  keeper: string;
141
566
  basket: string;
@@ -150,27 +575,104 @@ export declare class SymmetryCore {
150
575
  jup_swap_ix?: TransactionInstruction;
151
576
  jup_address_lookup_table_addresses?: PublicKey[];
152
577
  }): Promise<TxPayloadBatchSequence>;
578
+ /**
579
+ * Mints basket tokens for a user. Executable when the rebalance intent has finished its auctions.
580
+ *
581
+ * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
582
+ *
583
+ * @param {Object} params - The parameters for the mint.
584
+ * @param {string} params.keeper - The public key of the keeper.
585
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent.
586
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
587
+ */
153
588
  mintTx(params: {
154
589
  keeper: string;
155
590
  rebalance_intent: string;
156
591
  }): Promise<TxPayloadBatchSequence>;
592
+ /**
593
+ * Redeems tokens from the rebalance intent with Withdraw status.
594
+ *
595
+ * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
596
+ *
597
+ * @param {Object} params - The parameters for the redeem tokens.
598
+ * @param {string} params.keeper - The public key of the keeper.
599
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent.
600
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
601
+ */
157
602
  redeemTokensTx(params: {
158
603
  keeper: string;
159
604
  rebalance_intent: string;
160
605
  }): Promise<TxPayloadBatchSequence>;
606
+ /**
607
+ * Claims the bounty to keepers who have completed tasks for rebalance intent.
608
+ *
609
+ * Executebale when the rebalance intent has finished its auctions.
610
+ *
611
+ * For Withdraw status rebalance intent, tokens have to be redeemed first.
612
+ *
613
+ * Closes the rebalance intent if all keepers have claimed the bounty.
614
+ *
615
+ * @param {Object} params - The parameters for the claim bounty.
616
+ * @param {string} params.keeper - The public key of the keeper.
617
+ * @param {string} params.rebalance_intent - The public key of the rebalance intent.
618
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
619
+ */
161
620
  claimBountyTx(params: {
162
621
  keeper: string;
163
622
  rebalance_intent: string;
164
623
  }): Promise<TxPayloadBatchSequence>;
624
+ /**
625
+ * Adds bounty for automation to basket.
626
+ * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
627
+ *
628
+ * @param {Object} params - The parameters for the add bounty.
629
+ * @param {string} params.keeper - The public key of the keeper.
630
+ * @param {string} params.basket - The public key of the basket.
631
+ * @param {number} params.amount - The amount of the bounty.
632
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
633
+ */
165
634
  addBountyTx(params: {
166
635
  keeper: string;
167
636
  basket: string;
168
637
  amount: number;
169
638
  }): Promise<TxPayloadBatchSequence>;
639
+ /**
640
+ * Claims fees from the basket for host, creator, managers or symmetry fees collector.
641
+ * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
642
+ *
643
+ * @param {Object} params - The parameters for the claim basket fees.
644
+ * @param {string} params.claimer - The public key of the claimer.
645
+ * @param {string} params.basket - The public key of the basket.
646
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
647
+ */
170
648
  claimBasketFeesTx(params: {
171
649
  claimer: string;
172
650
  basket: string;
173
651
  }): Promise<TxPayloadBatchSequence>;
652
+ /**
653
+ * Rewrites lookup tables for the basket. (Used when the basket lookup tables are full)
654
+ *
655
+ * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
656
+ *
657
+ * Batch layout:
658
+ *
659
+ * batch 0:
660
+ * * tx0: [create temp lookup tables],
661
+ *
662
+ * batch 1:
663
+ * * tx0: [extend temp lookup tables (with oracles of active tokens)],
664
+ * * tx1: [extend temp lookup tables (with oracles of active tokens)],
665
+ * * ...
666
+ *
667
+ * batch 2:
668
+ * * tx0: [overwrite lookup tables with temp, deactivate old lookup tables],
669
+ *
670
+ * @param {Object} params - The parameters for the rewrite lookup tables.
671
+ * @param {string} params.signer - The public key of the signer.
672
+ * @param {string} params.basket_mint - The mint of the basket.
673
+ * @param {string[]} params.additional_accounts - The additional accounts.
674
+ * @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
675
+ */
174
676
  rewriteLookupTablesTx(params: {
175
677
  signer: string;
176
678
  basket_mint: string;
@@ -185,6 +687,7 @@ export declare class SymmetryCore {
185
687
  wallet: Wallet;
186
688
  }): Promise<TransactionSignature[][]>;
187
689
  }
690
+ export { BasketCreationTx, TxPayloadBatchSequence, VersionedTxs, };
188
691
  export { GlobalConfig, Basket, BasketFilter, Intent, IntentFilter, RebalanceIntent, RebalanceIntentFilter };
189
692
  export { FormattedGlobalConfig, FormattedIntentStatus, FormattedTaskType, FormattedBounty, FormattedBountySchedule, FormattedIntent, };
190
693
  export { FormattedRebalanceType, FormattedRebalanceAction, FormattedOraclePrice, FormattedTokenAuction, FormattedTaskCompletion, FormattedRebalanceIntent, };