@crypticdot/defituna-client 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -997,21 +997,22 @@ var TunaInstruction = /* @__PURE__ */ ((TunaInstruction2) => {
997
997
  TunaInstruction2[TunaInstruction2["RebalanceTunaLpPositionOrca"] = 36] = "RebalanceTunaLpPositionOrca";
998
998
  TunaInstruction2[TunaInstruction2["RepayBadDebt"] = 37] = "RepayBadDebt";
999
999
  TunaInstruction2[TunaInstruction2["RepayTunaLpPositionDebt"] = 38] = "RepayTunaLpPositionDebt";
1000
- TunaInstruction2[TunaInstruction2["SetAdminAuthority"] = 39] = "SetAdminAuthority";
1001
- TunaInstruction2[TunaInstruction2["SetDefaultMaxPercentageOfLeftovers"] = 40] = "SetDefaultMaxPercentageOfLeftovers";
1002
- TunaInstruction2[TunaInstruction2["SetDefaultMaxSwapSlippage"] = 41] = "SetDefaultMaxSwapSlippage";
1003
- TunaInstruction2[TunaInstruction2["SetDefaultOraclePriceDeviationThreshold"] = 42] = "SetDefaultOraclePriceDeviationThreshold";
1004
- TunaInstruction2[TunaInstruction2["SetFeeRecipient"] = 43] = "SetFeeRecipient";
1005
- TunaInstruction2[TunaInstruction2["SetLiquidatorAuthority"] = 44] = "SetLiquidatorAuthority";
1006
- TunaInstruction2[TunaInstruction2["SetOwnerAuthority"] = 45] = "SetOwnerAuthority";
1007
- TunaInstruction2[TunaInstruction2["SetSuspendedState"] = 46] = "SetSuspendedState";
1008
- TunaInstruction2[TunaInstruction2["SetTunaLpPositionFlags"] = 47] = "SetTunaLpPositionFlags";
1009
- TunaInstruction2[TunaInstruction2["SetTunaLpPositionLimitOrders"] = 48] = "SetTunaLpPositionLimitOrders";
1010
- TunaInstruction2[TunaInstruction2["SetTunaLpPositionRebalanceThreshold"] = 49] = "SetTunaLpPositionRebalanceThreshold";
1011
- TunaInstruction2[TunaInstruction2["SetTunaSpotPositionLimitOrders"] = 50] = "SetTunaSpotPositionLimitOrders";
1012
- TunaInstruction2[TunaInstruction2["UpdateMarket"] = 51] = "UpdateMarket";
1013
- TunaInstruction2[TunaInstruction2["UpdateVault"] = 52] = "UpdateVault";
1014
- TunaInstruction2[TunaInstruction2["Withdraw"] = 53] = "Withdraw";
1000
+ TunaInstruction2[TunaInstruction2["ResetTunaSpotPosition"] = 39] = "ResetTunaSpotPosition";
1001
+ TunaInstruction2[TunaInstruction2["SetAdminAuthority"] = 40] = "SetAdminAuthority";
1002
+ TunaInstruction2[TunaInstruction2["SetDefaultMaxPercentageOfLeftovers"] = 41] = "SetDefaultMaxPercentageOfLeftovers";
1003
+ TunaInstruction2[TunaInstruction2["SetDefaultMaxSwapSlippage"] = 42] = "SetDefaultMaxSwapSlippage";
1004
+ TunaInstruction2[TunaInstruction2["SetDefaultOraclePriceDeviationThreshold"] = 43] = "SetDefaultOraclePriceDeviationThreshold";
1005
+ TunaInstruction2[TunaInstruction2["SetFeeRecipient"] = 44] = "SetFeeRecipient";
1006
+ TunaInstruction2[TunaInstruction2["SetLiquidatorAuthority"] = 45] = "SetLiquidatorAuthority";
1007
+ TunaInstruction2[TunaInstruction2["SetOwnerAuthority"] = 46] = "SetOwnerAuthority";
1008
+ TunaInstruction2[TunaInstruction2["SetSuspendedState"] = 47] = "SetSuspendedState";
1009
+ TunaInstruction2[TunaInstruction2["SetTunaLpPositionFlags"] = 48] = "SetTunaLpPositionFlags";
1010
+ TunaInstruction2[TunaInstruction2["SetTunaLpPositionLimitOrders"] = 49] = "SetTunaLpPositionLimitOrders";
1011
+ TunaInstruction2[TunaInstruction2["SetTunaLpPositionRebalanceThreshold"] = 50] = "SetTunaLpPositionRebalanceThreshold";
1012
+ TunaInstruction2[TunaInstruction2["SetTunaSpotPositionLimitOrders"] = 51] = "SetTunaSpotPositionLimitOrders";
1013
+ TunaInstruction2[TunaInstruction2["UpdateMarket"] = 52] = "UpdateMarket";
1014
+ TunaInstruction2[TunaInstruction2["UpdateVault"] = 53] = "UpdateVault";
1015
+ TunaInstruction2[TunaInstruction2["Withdraw"] = 54] = "Withdraw";
1015
1016
  return TunaInstruction2;
1016
1017
  })(TunaInstruction || {});
1017
1018
  function identifyTunaInstruction(instruction) {
@@ -1367,6 +1368,15 @@ function identifyTunaInstruction(instruction) {
1367
1368
  )) {
1368
1369
  return 38 /* RepayTunaLpPositionDebt */;
1369
1370
  }
1371
+ if (containsBytes(
1372
+ data,
1373
+ fixEncoderSize7(getBytesEncoder7(), 8).encode(
1374
+ new Uint8Array([194, 68, 113, 71, 103, 77, 29, 127])
1375
+ ),
1376
+ 0
1377
+ )) {
1378
+ return 39 /* ResetTunaSpotPosition */;
1379
+ }
1370
1380
  if (containsBytes(
1371
1381
  data,
1372
1382
  fixEncoderSize7(getBytesEncoder7(), 8).encode(
@@ -1374,7 +1384,7 @@ function identifyTunaInstruction(instruction) {
1374
1384
  ),
1375
1385
  0
1376
1386
  )) {
1377
- return 39 /* SetAdminAuthority */;
1387
+ return 40 /* SetAdminAuthority */;
1378
1388
  }
1379
1389
  if (containsBytes(
1380
1390
  data,
@@ -1383,7 +1393,7 @@ function identifyTunaInstruction(instruction) {
1383
1393
  ),
1384
1394
  0
1385
1395
  )) {
1386
- return 40 /* SetDefaultMaxPercentageOfLeftovers */;
1396
+ return 41 /* SetDefaultMaxPercentageOfLeftovers */;
1387
1397
  }
1388
1398
  if (containsBytes(
1389
1399
  data,
@@ -1392,7 +1402,7 @@ function identifyTunaInstruction(instruction) {
1392
1402
  ),
1393
1403
  0
1394
1404
  )) {
1395
- return 41 /* SetDefaultMaxSwapSlippage */;
1405
+ return 42 /* SetDefaultMaxSwapSlippage */;
1396
1406
  }
1397
1407
  if (containsBytes(
1398
1408
  data,
@@ -1401,7 +1411,7 @@ function identifyTunaInstruction(instruction) {
1401
1411
  ),
1402
1412
  0
1403
1413
  )) {
1404
- return 42 /* SetDefaultOraclePriceDeviationThreshold */;
1414
+ return 43 /* SetDefaultOraclePriceDeviationThreshold */;
1405
1415
  }
1406
1416
  if (containsBytes(
1407
1417
  data,
@@ -1410,7 +1420,7 @@ function identifyTunaInstruction(instruction) {
1410
1420
  ),
1411
1421
  0
1412
1422
  )) {
1413
- return 43 /* SetFeeRecipient */;
1423
+ return 44 /* SetFeeRecipient */;
1414
1424
  }
1415
1425
  if (containsBytes(
1416
1426
  data,
@@ -1419,7 +1429,7 @@ function identifyTunaInstruction(instruction) {
1419
1429
  ),
1420
1430
  0
1421
1431
  )) {
1422
- return 44 /* SetLiquidatorAuthority */;
1432
+ return 45 /* SetLiquidatorAuthority */;
1423
1433
  }
1424
1434
  if (containsBytes(
1425
1435
  data,
@@ -1428,7 +1438,7 @@ function identifyTunaInstruction(instruction) {
1428
1438
  ),
1429
1439
  0
1430
1440
  )) {
1431
- return 45 /* SetOwnerAuthority */;
1441
+ return 46 /* SetOwnerAuthority */;
1432
1442
  }
1433
1443
  if (containsBytes(
1434
1444
  data,
@@ -1437,7 +1447,7 @@ function identifyTunaInstruction(instruction) {
1437
1447
  ),
1438
1448
  0
1439
1449
  )) {
1440
- return 46 /* SetSuspendedState */;
1450
+ return 47 /* SetSuspendedState */;
1441
1451
  }
1442
1452
  if (containsBytes(
1443
1453
  data,
@@ -1446,7 +1456,7 @@ function identifyTunaInstruction(instruction) {
1446
1456
  ),
1447
1457
  0
1448
1458
  )) {
1449
- return 47 /* SetTunaLpPositionFlags */;
1459
+ return 48 /* SetTunaLpPositionFlags */;
1450
1460
  }
1451
1461
  if (containsBytes(
1452
1462
  data,
@@ -1455,7 +1465,7 @@ function identifyTunaInstruction(instruction) {
1455
1465
  ),
1456
1466
  0
1457
1467
  )) {
1458
- return 48 /* SetTunaLpPositionLimitOrders */;
1468
+ return 49 /* SetTunaLpPositionLimitOrders */;
1459
1469
  }
1460
1470
  if (containsBytes(
1461
1471
  data,
@@ -1464,7 +1474,7 @@ function identifyTunaInstruction(instruction) {
1464
1474
  ),
1465
1475
  0
1466
1476
  )) {
1467
- return 49 /* SetTunaLpPositionRebalanceThreshold */;
1477
+ return 50 /* SetTunaLpPositionRebalanceThreshold */;
1468
1478
  }
1469
1479
  if (containsBytes(
1470
1480
  data,
@@ -1473,7 +1483,7 @@ function identifyTunaInstruction(instruction) {
1473
1483
  ),
1474
1484
  0
1475
1485
  )) {
1476
- return 50 /* SetTunaSpotPositionLimitOrders */;
1486
+ return 51 /* SetTunaSpotPositionLimitOrders */;
1477
1487
  }
1478
1488
  if (containsBytes(
1479
1489
  data,
@@ -1482,7 +1492,7 @@ function identifyTunaInstruction(instruction) {
1482
1492
  ),
1483
1493
  0
1484
1494
  )) {
1485
- return 51 /* UpdateMarket */;
1495
+ return 52 /* UpdateMarket */;
1486
1496
  }
1487
1497
  if (containsBytes(
1488
1498
  data,
@@ -1491,7 +1501,7 @@ function identifyTunaInstruction(instruction) {
1491
1501
  ),
1492
1502
  0
1493
1503
  )) {
1494
- return 52 /* UpdateVault */;
1504
+ return 53 /* UpdateVault */;
1495
1505
  }
1496
1506
  if (containsBytes(
1497
1507
  data,
@@ -1500,7 +1510,7 @@ function identifyTunaInstruction(instruction) {
1500
1510
  ),
1501
1511
  0
1502
1512
  )) {
1503
- return 53 /* Withdraw */;
1513
+ return 54 /* Withdraw */;
1504
1514
  }
1505
1515
  throw new Error(
1506
1516
  "The provided instruction could not be identified as a tuna instruction."
@@ -8279,19 +8289,138 @@ function parseRepayTunaLpPositionDebtInstruction(instruction) {
8279
8289
  };
8280
8290
  }
8281
8291
 
8282
- // src/generated/instructions/setAdminAuthority.ts
8292
+ // src/generated/instructions/resetTunaSpotPosition.ts
8283
8293
  import {
8284
8294
  combineCodec as combineCodec52,
8285
8295
  fixDecoderSize as fixDecoderSize46,
8286
8296
  fixEncoderSize as fixEncoderSize47,
8287
- getAddressDecoder as getAddressDecoder10,
8288
- getAddressEncoder as getAddressEncoder10,
8289
8297
  getBytesDecoder as getBytesDecoder46,
8290
8298
  getBytesEncoder as getBytesEncoder47,
8291
8299
  getStructDecoder as getStructDecoder48,
8292
8300
  getStructEncoder as getStructEncoder48,
8301
+ getU128Decoder as getU128Decoder11,
8302
+ getU128Encoder as getU128Encoder11,
8293
8303
  transformEncoder as transformEncoder46
8294
8304
  } from "@solana/kit";
8305
+ var RESET_TUNA_SPOT_POSITION_DISCRIMINATOR = new Uint8Array([
8306
+ 194,
8307
+ 68,
8308
+ 113,
8309
+ 71,
8310
+ 103,
8311
+ 77,
8312
+ 29,
8313
+ 127
8314
+ ]);
8315
+ function getResetTunaSpotPositionDiscriminatorBytes() {
8316
+ return fixEncoderSize47(getBytesEncoder47(), 8).encode(
8317
+ RESET_TUNA_SPOT_POSITION_DISCRIMINATOR
8318
+ );
8319
+ }
8320
+ function getResetTunaSpotPositionInstructionDataEncoder() {
8321
+ return transformEncoder46(
8322
+ getStructEncoder48([
8323
+ ["discriminator", fixEncoderSize47(getBytesEncoder47(), 8)],
8324
+ ["positionToken", getPoolTokenEncoder()],
8325
+ ["collateralToken", getPoolTokenEncoder()],
8326
+ ["lowerLimitOrderSqrtPrice", getU128Encoder11()],
8327
+ ["upperLimitOrderSqrtPrice", getU128Encoder11()]
8328
+ ]),
8329
+ (value) => ({
8330
+ ...value,
8331
+ discriminator: RESET_TUNA_SPOT_POSITION_DISCRIMINATOR
8332
+ })
8333
+ );
8334
+ }
8335
+ function getResetTunaSpotPositionInstructionDataDecoder() {
8336
+ return getStructDecoder48([
8337
+ ["discriminator", fixDecoderSize46(getBytesDecoder46(), 8)],
8338
+ ["positionToken", getPoolTokenDecoder()],
8339
+ ["collateralToken", getPoolTokenDecoder()],
8340
+ ["lowerLimitOrderSqrtPrice", getU128Decoder11()],
8341
+ ["upperLimitOrderSqrtPrice", getU128Decoder11()]
8342
+ ]);
8343
+ }
8344
+ function getResetTunaSpotPositionInstructionDataCodec() {
8345
+ return combineCodec52(
8346
+ getResetTunaSpotPositionInstructionDataEncoder(),
8347
+ getResetTunaSpotPositionInstructionDataDecoder()
8348
+ );
8349
+ }
8350
+ function getResetTunaSpotPositionInstruction(input, config) {
8351
+ const programAddress = config?.programAddress ?? TUNA_PROGRAM_ADDRESS;
8352
+ const originalAccounts = {
8353
+ authority: { value: input.authority ?? null, isWritable: false },
8354
+ mintA: { value: input.mintA ?? null, isWritable: false },
8355
+ mintB: { value: input.mintB ?? null, isWritable: false },
8356
+ tunaPosition: { value: input.tunaPosition ?? null, isWritable: true },
8357
+ tunaPositionAtaA: {
8358
+ value: input.tunaPositionAtaA ?? null,
8359
+ isWritable: true
8360
+ },
8361
+ tunaPositionAtaB: {
8362
+ value: input.tunaPositionAtaB ?? null,
8363
+ isWritable: true
8364
+ }
8365
+ };
8366
+ const accounts = originalAccounts;
8367
+ const args = { ...input };
8368
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
8369
+ const instruction = {
8370
+ accounts: [
8371
+ getAccountMeta(accounts.authority),
8372
+ getAccountMeta(accounts.mintA),
8373
+ getAccountMeta(accounts.mintB),
8374
+ getAccountMeta(accounts.tunaPosition),
8375
+ getAccountMeta(accounts.tunaPositionAtaA),
8376
+ getAccountMeta(accounts.tunaPositionAtaB)
8377
+ ],
8378
+ programAddress,
8379
+ data: getResetTunaSpotPositionInstructionDataEncoder().encode(
8380
+ args
8381
+ )
8382
+ };
8383
+ return instruction;
8384
+ }
8385
+ function parseResetTunaSpotPositionInstruction(instruction) {
8386
+ if (instruction.accounts.length < 6) {
8387
+ throw new Error("Not enough accounts");
8388
+ }
8389
+ let accountIndex = 0;
8390
+ const getNextAccount = () => {
8391
+ const accountMeta = instruction.accounts[accountIndex];
8392
+ accountIndex += 1;
8393
+ return accountMeta;
8394
+ };
8395
+ return {
8396
+ programAddress: instruction.programAddress,
8397
+ accounts: {
8398
+ authority: getNextAccount(),
8399
+ mintA: getNextAccount(),
8400
+ mintB: getNextAccount(),
8401
+ tunaPosition: getNextAccount(),
8402
+ tunaPositionAtaA: getNextAccount(),
8403
+ tunaPositionAtaB: getNextAccount()
8404
+ },
8405
+ data: getResetTunaSpotPositionInstructionDataDecoder().decode(
8406
+ instruction.data
8407
+ )
8408
+ };
8409
+ }
8410
+
8411
+ // src/generated/instructions/setAdminAuthority.ts
8412
+ import {
8413
+ combineCodec as combineCodec53,
8414
+ fixDecoderSize as fixDecoderSize47,
8415
+ fixEncoderSize as fixEncoderSize48,
8416
+ getAddressDecoder as getAddressDecoder10,
8417
+ getAddressEncoder as getAddressEncoder10,
8418
+ getBytesDecoder as getBytesDecoder47,
8419
+ getBytesEncoder as getBytesEncoder48,
8420
+ getStructDecoder as getStructDecoder49,
8421
+ getStructEncoder as getStructEncoder49,
8422
+ transformEncoder as transformEncoder47
8423
+ } from "@solana/kit";
8295
8424
  var SET_ADMIN_AUTHORITY_DISCRIMINATOR = new Uint8Array([
8296
8425
  72,
8297
8426
  49,
@@ -8303,27 +8432,27 @@ var SET_ADMIN_AUTHORITY_DISCRIMINATOR = new Uint8Array([
8303
8432
  174
8304
8433
  ]);
8305
8434
  function getSetAdminAuthorityDiscriminatorBytes() {
8306
- return fixEncoderSize47(getBytesEncoder47(), 8).encode(
8435
+ return fixEncoderSize48(getBytesEncoder48(), 8).encode(
8307
8436
  SET_ADMIN_AUTHORITY_DISCRIMINATOR
8308
8437
  );
8309
8438
  }
8310
8439
  function getSetAdminAuthorityInstructionDataEncoder() {
8311
- return transformEncoder46(
8312
- getStructEncoder48([
8313
- ["discriminator", fixEncoderSize47(getBytesEncoder47(), 8)],
8440
+ return transformEncoder47(
8441
+ getStructEncoder49([
8442
+ ["discriminator", fixEncoderSize48(getBytesEncoder48(), 8)],
8314
8443
  ["adminAuthority", getAddressEncoder10()]
8315
8444
  ]),
8316
8445
  (value) => ({ ...value, discriminator: SET_ADMIN_AUTHORITY_DISCRIMINATOR })
8317
8446
  );
8318
8447
  }
8319
8448
  function getSetAdminAuthorityInstructionDataDecoder() {
8320
- return getStructDecoder48([
8321
- ["discriminator", fixDecoderSize46(getBytesDecoder46(), 8)],
8449
+ return getStructDecoder49([
8450
+ ["discriminator", fixDecoderSize47(getBytesDecoder47(), 8)],
8322
8451
  ["adminAuthority", getAddressDecoder10()]
8323
8452
  ]);
8324
8453
  }
8325
8454
  function getSetAdminAuthorityInstructionDataCodec() {
8326
- return combineCodec52(
8455
+ return combineCodec53(
8327
8456
  getSetAdminAuthorityInstructionDataEncoder(),
8328
8457
  getSetAdminAuthorityInstructionDataDecoder()
8329
8458
  );
@@ -8371,27 +8500,27 @@ function parseSetAdminAuthorityInstruction(instruction) {
8371
8500
 
8372
8501
  // src/generated/instructions/setDefaultMaxPercentageOfLeftovers.ts
8373
8502
  import {
8374
- combineCodec as combineCodec53,
8375
- fixDecoderSize as fixDecoderSize47,
8376
- fixEncoderSize as fixEncoderSize48,
8377
- getBytesDecoder as getBytesDecoder47,
8378
- getBytesEncoder as getBytesEncoder48,
8379
- getStructDecoder as getStructDecoder49,
8380
- getStructEncoder as getStructEncoder49,
8503
+ combineCodec as combineCodec54,
8504
+ fixDecoderSize as fixDecoderSize48,
8505
+ fixEncoderSize as fixEncoderSize49,
8506
+ getBytesDecoder as getBytesDecoder48,
8507
+ getBytesEncoder as getBytesEncoder49,
8508
+ getStructDecoder as getStructDecoder50,
8509
+ getStructEncoder as getStructEncoder50,
8381
8510
  getU32Decoder as getU32Decoder28,
8382
8511
  getU32Encoder as getU32Encoder28,
8383
- transformEncoder as transformEncoder47
8512
+ transformEncoder as transformEncoder48
8384
8513
  } from "@solana/kit";
8385
8514
  var SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR = new Uint8Array([37, 179, 107, 65, 203, 141, 183, 27]);
8386
8515
  function getSetDefaultMaxPercentageOfLeftoversDiscriminatorBytes() {
8387
- return fixEncoderSize48(getBytesEncoder48(), 8).encode(
8516
+ return fixEncoderSize49(getBytesEncoder49(), 8).encode(
8388
8517
  SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR
8389
8518
  );
8390
8519
  }
8391
8520
  function getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder() {
8392
- return transformEncoder47(
8393
- getStructEncoder49([
8394
- ["discriminator", fixEncoderSize48(getBytesEncoder48(), 8)],
8521
+ return transformEncoder48(
8522
+ getStructEncoder50([
8523
+ ["discriminator", fixEncoderSize49(getBytesEncoder49(), 8)],
8395
8524
  ["maxPercentageOfLeftovers", getU32Encoder28()]
8396
8525
  ]),
8397
8526
  (value) => ({
@@ -8401,13 +8530,13 @@ function getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder() {
8401
8530
  );
8402
8531
  }
8403
8532
  function getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder() {
8404
- return getStructDecoder49([
8405
- ["discriminator", fixDecoderSize47(getBytesDecoder47(), 8)],
8533
+ return getStructDecoder50([
8534
+ ["discriminator", fixDecoderSize48(getBytesDecoder48(), 8)],
8406
8535
  ["maxPercentageOfLeftovers", getU32Decoder28()]
8407
8536
  ]);
8408
8537
  }
8409
8538
  function getSetDefaultMaxPercentageOfLeftoversInstructionDataCodec() {
8410
- return combineCodec53(
8539
+ return combineCodec54(
8411
8540
  getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder(),
8412
8541
  getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder()
8413
8542
  );
@@ -8457,16 +8586,16 @@ function parseSetDefaultMaxPercentageOfLeftoversInstruction(instruction) {
8457
8586
 
8458
8587
  // src/generated/instructions/setDefaultMaxSwapSlippage.ts
8459
8588
  import {
8460
- combineCodec as combineCodec54,
8461
- fixDecoderSize as fixDecoderSize48,
8462
- fixEncoderSize as fixEncoderSize49,
8463
- getBytesDecoder as getBytesDecoder48,
8464
- getBytesEncoder as getBytesEncoder49,
8465
- getStructDecoder as getStructDecoder50,
8466
- getStructEncoder as getStructEncoder50,
8589
+ combineCodec as combineCodec55,
8590
+ fixDecoderSize as fixDecoderSize49,
8591
+ fixEncoderSize as fixEncoderSize50,
8592
+ getBytesDecoder as getBytesDecoder49,
8593
+ getBytesEncoder as getBytesEncoder50,
8594
+ getStructDecoder as getStructDecoder51,
8595
+ getStructEncoder as getStructEncoder51,
8467
8596
  getU32Decoder as getU32Decoder29,
8468
8597
  getU32Encoder as getU32Encoder29,
8469
- transformEncoder as transformEncoder48
8598
+ transformEncoder as transformEncoder49
8470
8599
  } from "@solana/kit";
8471
8600
  var SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR = new Uint8Array([
8472
8601
  122,
@@ -8479,14 +8608,14 @@ var SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR = new Uint8Array([
8479
8608
  181
8480
8609
  ]);
8481
8610
  function getSetDefaultMaxSwapSlippageDiscriminatorBytes() {
8482
- return fixEncoderSize49(getBytesEncoder49(), 8).encode(
8611
+ return fixEncoderSize50(getBytesEncoder50(), 8).encode(
8483
8612
  SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR
8484
8613
  );
8485
8614
  }
8486
8615
  function getSetDefaultMaxSwapSlippageInstructionDataEncoder() {
8487
- return transformEncoder48(
8488
- getStructEncoder50([
8489
- ["discriminator", fixEncoderSize49(getBytesEncoder49(), 8)],
8616
+ return transformEncoder49(
8617
+ getStructEncoder51([
8618
+ ["discriminator", fixEncoderSize50(getBytesEncoder50(), 8)],
8490
8619
  ["maxSwapSlippage", getU32Encoder29()]
8491
8620
  ]),
8492
8621
  (value) => ({
@@ -8496,13 +8625,13 @@ function getSetDefaultMaxSwapSlippageInstructionDataEncoder() {
8496
8625
  );
8497
8626
  }
8498
8627
  function getSetDefaultMaxSwapSlippageInstructionDataDecoder() {
8499
- return getStructDecoder50([
8500
- ["discriminator", fixDecoderSize48(getBytesDecoder48(), 8)],
8628
+ return getStructDecoder51([
8629
+ ["discriminator", fixDecoderSize49(getBytesDecoder49(), 8)],
8501
8630
  ["maxSwapSlippage", getU32Decoder29()]
8502
8631
  ]);
8503
8632
  }
8504
8633
  function getSetDefaultMaxSwapSlippageInstructionDataCodec() {
8505
- return combineCodec54(
8634
+ return combineCodec55(
8506
8635
  getSetDefaultMaxSwapSlippageInstructionDataEncoder(),
8507
8636
  getSetDefaultMaxSwapSlippageInstructionDataDecoder()
8508
8637
  );
@@ -8552,27 +8681,27 @@ function parseSetDefaultMaxSwapSlippageInstruction(instruction) {
8552
8681
 
8553
8682
  // src/generated/instructions/setDefaultOraclePriceDeviationThreshold.ts
8554
8683
  import {
8555
- combineCodec as combineCodec55,
8556
- fixDecoderSize as fixDecoderSize49,
8557
- fixEncoderSize as fixEncoderSize50,
8558
- getBytesDecoder as getBytesDecoder49,
8559
- getBytesEncoder as getBytesEncoder50,
8560
- getStructDecoder as getStructDecoder51,
8561
- getStructEncoder as getStructEncoder51,
8684
+ combineCodec as combineCodec56,
8685
+ fixDecoderSize as fixDecoderSize50,
8686
+ fixEncoderSize as fixEncoderSize51,
8687
+ getBytesDecoder as getBytesDecoder50,
8688
+ getBytesEncoder as getBytesEncoder51,
8689
+ getStructDecoder as getStructDecoder52,
8690
+ getStructEncoder as getStructEncoder52,
8562
8691
  getU32Decoder as getU32Decoder30,
8563
8692
  getU32Encoder as getU32Encoder30,
8564
- transformEncoder as transformEncoder49
8693
+ transformEncoder as transformEncoder50
8565
8694
  } from "@solana/kit";
8566
8695
  var SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR = new Uint8Array([142, 158, 143, 67, 206, 91, 139, 120]);
8567
8696
  function getSetDefaultOraclePriceDeviationThresholdDiscriminatorBytes() {
8568
- return fixEncoderSize50(getBytesEncoder50(), 8).encode(
8697
+ return fixEncoderSize51(getBytesEncoder51(), 8).encode(
8569
8698
  SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR
8570
8699
  );
8571
8700
  }
8572
8701
  function getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder() {
8573
- return transformEncoder49(
8574
- getStructEncoder51([
8575
- ["discriminator", fixEncoderSize50(getBytesEncoder50(), 8)],
8702
+ return transformEncoder50(
8703
+ getStructEncoder52([
8704
+ ["discriminator", fixEncoderSize51(getBytesEncoder51(), 8)],
8576
8705
  ["oraclePriceDeviationThreshold", getU32Encoder30()]
8577
8706
  ]),
8578
8707
  (value) => ({
@@ -8582,13 +8711,13 @@ function getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder() {
8582
8711
  );
8583
8712
  }
8584
8713
  function getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder() {
8585
- return getStructDecoder51([
8586
- ["discriminator", fixDecoderSize49(getBytesDecoder49(), 8)],
8714
+ return getStructDecoder52([
8715
+ ["discriminator", fixDecoderSize50(getBytesDecoder50(), 8)],
8587
8716
  ["oraclePriceDeviationThreshold", getU32Decoder30()]
8588
8717
  ]);
8589
8718
  }
8590
8719
  function getSetDefaultOraclePriceDeviationThresholdInstructionDataCodec() {
8591
- return combineCodec55(
8720
+ return combineCodec56(
8592
8721
  getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder(),
8593
8722
  getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder()
8594
8723
  );
@@ -8638,16 +8767,16 @@ function parseSetDefaultOraclePriceDeviationThresholdInstruction(instruction) {
8638
8767
 
8639
8768
  // src/generated/instructions/setFeeRecipient.ts
8640
8769
  import {
8641
- combineCodec as combineCodec56,
8642
- fixDecoderSize as fixDecoderSize50,
8643
- fixEncoderSize as fixEncoderSize51,
8770
+ combineCodec as combineCodec57,
8771
+ fixDecoderSize as fixDecoderSize51,
8772
+ fixEncoderSize as fixEncoderSize52,
8644
8773
  getAddressDecoder as getAddressDecoder11,
8645
8774
  getAddressEncoder as getAddressEncoder11,
8646
- getBytesDecoder as getBytesDecoder50,
8647
- getBytesEncoder as getBytesEncoder51,
8648
- getStructDecoder as getStructDecoder52,
8649
- getStructEncoder as getStructEncoder52,
8650
- transformEncoder as transformEncoder50
8775
+ getBytesDecoder as getBytesDecoder51,
8776
+ getBytesEncoder as getBytesEncoder52,
8777
+ getStructDecoder as getStructDecoder53,
8778
+ getStructEncoder as getStructEncoder53,
8779
+ transformEncoder as transformEncoder51
8651
8780
  } from "@solana/kit";
8652
8781
  var SET_FEE_RECIPIENT_DISCRIMINATOR = new Uint8Array([
8653
8782
  227,
@@ -8660,27 +8789,27 @@ var SET_FEE_RECIPIENT_DISCRIMINATOR = new Uint8Array([
8660
8789
  66
8661
8790
  ]);
8662
8791
  function getSetFeeRecipientDiscriminatorBytes() {
8663
- return fixEncoderSize51(getBytesEncoder51(), 8).encode(
8792
+ return fixEncoderSize52(getBytesEncoder52(), 8).encode(
8664
8793
  SET_FEE_RECIPIENT_DISCRIMINATOR
8665
8794
  );
8666
8795
  }
8667
8796
  function getSetFeeRecipientInstructionDataEncoder() {
8668
- return transformEncoder50(
8669
- getStructEncoder52([
8670
- ["discriminator", fixEncoderSize51(getBytesEncoder51(), 8)],
8797
+ return transformEncoder51(
8798
+ getStructEncoder53([
8799
+ ["discriminator", fixEncoderSize52(getBytesEncoder52(), 8)],
8671
8800
  ["feeRecipient", getAddressEncoder11()]
8672
8801
  ]),
8673
8802
  (value) => ({ ...value, discriminator: SET_FEE_RECIPIENT_DISCRIMINATOR })
8674
8803
  );
8675
8804
  }
8676
8805
  function getSetFeeRecipientInstructionDataDecoder() {
8677
- return getStructDecoder52([
8678
- ["discriminator", fixDecoderSize50(getBytesDecoder50(), 8)],
8806
+ return getStructDecoder53([
8807
+ ["discriminator", fixDecoderSize51(getBytesDecoder51(), 8)],
8679
8808
  ["feeRecipient", getAddressDecoder11()]
8680
8809
  ]);
8681
8810
  }
8682
8811
  function getSetFeeRecipientInstructionDataCodec() {
8683
- return combineCodec56(
8812
+ return combineCodec57(
8684
8813
  getSetFeeRecipientInstructionDataEncoder(),
8685
8814
  getSetFeeRecipientInstructionDataDecoder()
8686
8815
  );
@@ -8728,16 +8857,16 @@ function parseSetFeeRecipientInstruction(instruction) {
8728
8857
 
8729
8858
  // src/generated/instructions/setLiquidatorAuthority.ts
8730
8859
  import {
8731
- combineCodec as combineCodec57,
8732
- fixDecoderSize as fixDecoderSize51,
8733
- fixEncoderSize as fixEncoderSize52,
8860
+ combineCodec as combineCodec58,
8861
+ fixDecoderSize as fixDecoderSize52,
8862
+ fixEncoderSize as fixEncoderSize53,
8734
8863
  getAddressDecoder as getAddressDecoder12,
8735
8864
  getAddressEncoder as getAddressEncoder12,
8736
- getBytesDecoder as getBytesDecoder51,
8737
- getBytesEncoder as getBytesEncoder52,
8738
- getStructDecoder as getStructDecoder53,
8739
- getStructEncoder as getStructEncoder53,
8740
- transformEncoder as transformEncoder51
8865
+ getBytesDecoder as getBytesDecoder52,
8866
+ getBytesEncoder as getBytesEncoder53,
8867
+ getStructDecoder as getStructDecoder54,
8868
+ getStructEncoder as getStructEncoder54,
8869
+ transformEncoder as transformEncoder52
8741
8870
  } from "@solana/kit";
8742
8871
  var SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR = new Uint8Array([
8743
8872
  246,
@@ -8750,14 +8879,14 @@ var SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR = new Uint8Array([
8750
8879
  143
8751
8880
  ]);
8752
8881
  function getSetLiquidatorAuthorityDiscriminatorBytes() {
8753
- return fixEncoderSize52(getBytesEncoder52(), 8).encode(
8882
+ return fixEncoderSize53(getBytesEncoder53(), 8).encode(
8754
8883
  SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR
8755
8884
  );
8756
8885
  }
8757
8886
  function getSetLiquidatorAuthorityInstructionDataEncoder() {
8758
- return transformEncoder51(
8759
- getStructEncoder53([
8760
- ["discriminator", fixEncoderSize52(getBytesEncoder52(), 8)],
8887
+ return transformEncoder52(
8888
+ getStructEncoder54([
8889
+ ["discriminator", fixEncoderSize53(getBytesEncoder53(), 8)],
8761
8890
  ["liquidatorAuthority", getAddressEncoder12()]
8762
8891
  ]),
8763
8892
  (value) => ({
@@ -8767,13 +8896,13 @@ function getSetLiquidatorAuthorityInstructionDataEncoder() {
8767
8896
  );
8768
8897
  }
8769
8898
  function getSetLiquidatorAuthorityInstructionDataDecoder() {
8770
- return getStructDecoder53([
8771
- ["discriminator", fixDecoderSize51(getBytesDecoder51(), 8)],
8899
+ return getStructDecoder54([
8900
+ ["discriminator", fixDecoderSize52(getBytesDecoder52(), 8)],
8772
8901
  ["liquidatorAuthority", getAddressDecoder12()]
8773
8902
  ]);
8774
8903
  }
8775
8904
  function getSetLiquidatorAuthorityInstructionDataCodec() {
8776
- return combineCodec57(
8905
+ return combineCodec58(
8777
8906
  getSetLiquidatorAuthorityInstructionDataEncoder(),
8778
8907
  getSetLiquidatorAuthorityInstructionDataDecoder()
8779
8908
  );
@@ -8823,16 +8952,16 @@ function parseSetLiquidatorAuthorityInstruction(instruction) {
8823
8952
 
8824
8953
  // src/generated/instructions/setOwnerAuthority.ts
8825
8954
  import {
8826
- combineCodec as combineCodec58,
8827
- fixDecoderSize as fixDecoderSize52,
8828
- fixEncoderSize as fixEncoderSize53,
8955
+ combineCodec as combineCodec59,
8956
+ fixDecoderSize as fixDecoderSize53,
8957
+ fixEncoderSize as fixEncoderSize54,
8829
8958
  getAddressDecoder as getAddressDecoder13,
8830
8959
  getAddressEncoder as getAddressEncoder13,
8831
- getBytesDecoder as getBytesDecoder52,
8832
- getBytesEncoder as getBytesEncoder53,
8833
- getStructDecoder as getStructDecoder54,
8834
- getStructEncoder as getStructEncoder54,
8835
- transformEncoder as transformEncoder52
8960
+ getBytesDecoder as getBytesDecoder53,
8961
+ getBytesEncoder as getBytesEncoder54,
8962
+ getStructDecoder as getStructDecoder55,
8963
+ getStructEncoder as getStructEncoder55,
8964
+ transformEncoder as transformEncoder53
8836
8965
  } from "@solana/kit";
8837
8966
  var SET_OWNER_AUTHORITY_DISCRIMINATOR = new Uint8Array([
8838
8967
  128,
@@ -8845,27 +8974,27 @@ var SET_OWNER_AUTHORITY_DISCRIMINATOR = new Uint8Array([
8845
8974
  117
8846
8975
  ]);
8847
8976
  function getSetOwnerAuthorityDiscriminatorBytes() {
8848
- return fixEncoderSize53(getBytesEncoder53(), 8).encode(
8977
+ return fixEncoderSize54(getBytesEncoder54(), 8).encode(
8849
8978
  SET_OWNER_AUTHORITY_DISCRIMINATOR
8850
8979
  );
8851
8980
  }
8852
8981
  function getSetOwnerAuthorityInstructionDataEncoder() {
8853
- return transformEncoder52(
8854
- getStructEncoder54([
8855
- ["discriminator", fixEncoderSize53(getBytesEncoder53(), 8)],
8982
+ return transformEncoder53(
8983
+ getStructEncoder55([
8984
+ ["discriminator", fixEncoderSize54(getBytesEncoder54(), 8)],
8856
8985
  ["ownerAuthority", getAddressEncoder13()]
8857
8986
  ]),
8858
8987
  (value) => ({ ...value, discriminator: SET_OWNER_AUTHORITY_DISCRIMINATOR })
8859
8988
  );
8860
8989
  }
8861
8990
  function getSetOwnerAuthorityInstructionDataDecoder() {
8862
- return getStructDecoder54([
8863
- ["discriminator", fixDecoderSize52(getBytesDecoder52(), 8)],
8991
+ return getStructDecoder55([
8992
+ ["discriminator", fixDecoderSize53(getBytesDecoder53(), 8)],
8864
8993
  ["ownerAuthority", getAddressDecoder13()]
8865
8994
  ]);
8866
8995
  }
8867
8996
  function getSetOwnerAuthorityInstructionDataCodec() {
8868
- return combineCodec58(
8997
+ return combineCodec59(
8869
8998
  getSetOwnerAuthorityInstructionDataEncoder(),
8870
8999
  getSetOwnerAuthorityInstructionDataDecoder()
8871
9000
  );
@@ -8913,16 +9042,16 @@ function parseSetOwnerAuthorityInstruction(instruction) {
8913
9042
 
8914
9043
  // src/generated/instructions/setSuspendedState.ts
8915
9044
  import {
8916
- combineCodec as combineCodec59,
8917
- fixDecoderSize as fixDecoderSize53,
8918
- fixEncoderSize as fixEncoderSize54,
9045
+ combineCodec as combineCodec60,
9046
+ fixDecoderSize as fixDecoderSize54,
9047
+ fixEncoderSize as fixEncoderSize55,
8919
9048
  getBooleanDecoder as getBooleanDecoder7,
8920
9049
  getBooleanEncoder as getBooleanEncoder7,
8921
- getBytesDecoder as getBytesDecoder53,
8922
- getBytesEncoder as getBytesEncoder54,
8923
- getStructDecoder as getStructDecoder55,
8924
- getStructEncoder as getStructEncoder55,
8925
- transformEncoder as transformEncoder53
9050
+ getBytesDecoder as getBytesDecoder54,
9051
+ getBytesEncoder as getBytesEncoder55,
9052
+ getStructDecoder as getStructDecoder56,
9053
+ getStructEncoder as getStructEncoder56,
9054
+ transformEncoder as transformEncoder54
8926
9055
  } from "@solana/kit";
8927
9056
  var SET_SUSPENDED_STATE_DISCRIMINATOR = new Uint8Array([
8928
9057
  145,
@@ -8935,14 +9064,14 @@ var SET_SUSPENDED_STATE_DISCRIMINATOR = new Uint8Array([
8935
9064
  32
8936
9065
  ]);
8937
9066
  function getSetSuspendedStateDiscriminatorBytes() {
8938
- return fixEncoderSize54(getBytesEncoder54(), 8).encode(
9067
+ return fixEncoderSize55(getBytesEncoder55(), 8).encode(
8939
9068
  SET_SUSPENDED_STATE_DISCRIMINATOR
8940
9069
  );
8941
9070
  }
8942
9071
  function getSetSuspendedStateInstructionDataEncoder() {
8943
- return transformEncoder53(
8944
- getStructEncoder55([
8945
- ["discriminator", fixEncoderSize54(getBytesEncoder54(), 8)],
9072
+ return transformEncoder54(
9073
+ getStructEncoder56([
9074
+ ["discriminator", fixEncoderSize55(getBytesEncoder55(), 8)],
8946
9075
  ["suspendLendingDeposits", getBooleanEncoder7()],
8947
9076
  ["suspendLendingWithdrawals", getBooleanEncoder7()],
8948
9077
  ["suspendAddLiquidity", getBooleanEncoder7()],
@@ -8952,8 +9081,8 @@ function getSetSuspendedStateInstructionDataEncoder() {
8952
9081
  );
8953
9082
  }
8954
9083
  function getSetSuspendedStateInstructionDataDecoder() {
8955
- return getStructDecoder55([
8956
- ["discriminator", fixDecoderSize53(getBytesDecoder53(), 8)],
9084
+ return getStructDecoder56([
9085
+ ["discriminator", fixDecoderSize54(getBytesDecoder54(), 8)],
8957
9086
  ["suspendLendingDeposits", getBooleanDecoder7()],
8958
9087
  ["suspendLendingWithdrawals", getBooleanDecoder7()],
8959
9088
  ["suspendAddLiquidity", getBooleanDecoder7()],
@@ -8961,7 +9090,7 @@ function getSetSuspendedStateInstructionDataDecoder() {
8961
9090
  ]);
8962
9091
  }
8963
9092
  function getSetSuspendedStateInstructionDataCodec() {
8964
- return combineCodec59(
9093
+ return combineCodec60(
8965
9094
  getSetSuspendedStateInstructionDataEncoder(),
8966
9095
  getSetSuspendedStateInstructionDataDecoder()
8967
9096
  );
@@ -9009,16 +9138,16 @@ function parseSetSuspendedStateInstruction(instruction) {
9009
9138
 
9010
9139
  // src/generated/instructions/setTunaLpPositionFlags.ts
9011
9140
  import {
9012
- combineCodec as combineCodec60,
9013
- fixDecoderSize as fixDecoderSize54,
9014
- fixEncoderSize as fixEncoderSize55,
9015
- getBytesDecoder as getBytesDecoder54,
9016
- getBytesEncoder as getBytesEncoder55,
9017
- getStructDecoder as getStructDecoder56,
9018
- getStructEncoder as getStructEncoder56,
9141
+ combineCodec as combineCodec61,
9142
+ fixDecoderSize as fixDecoderSize55,
9143
+ fixEncoderSize as fixEncoderSize56,
9144
+ getBytesDecoder as getBytesDecoder55,
9145
+ getBytesEncoder as getBytesEncoder56,
9146
+ getStructDecoder as getStructDecoder57,
9147
+ getStructEncoder as getStructEncoder57,
9019
9148
  getU32Decoder as getU32Decoder31,
9020
9149
  getU32Encoder as getU32Encoder31,
9021
- transformEncoder as transformEncoder54
9150
+ transformEncoder as transformEncoder55
9022
9151
  } from "@solana/kit";
9023
9152
  var SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR = new Uint8Array([
9024
9153
  110,
@@ -9031,14 +9160,14 @@ var SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR = new Uint8Array([
9031
9160
  57
9032
9161
  ]);
9033
9162
  function getSetTunaLpPositionFlagsDiscriminatorBytes() {
9034
- return fixEncoderSize55(getBytesEncoder55(), 8).encode(
9163
+ return fixEncoderSize56(getBytesEncoder56(), 8).encode(
9035
9164
  SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR
9036
9165
  );
9037
9166
  }
9038
9167
  function getSetTunaLpPositionFlagsInstructionDataEncoder() {
9039
- return transformEncoder54(
9040
- getStructEncoder56([
9041
- ["discriminator", fixEncoderSize55(getBytesEncoder55(), 8)],
9168
+ return transformEncoder55(
9169
+ getStructEncoder57([
9170
+ ["discriminator", fixEncoderSize56(getBytesEncoder56(), 8)],
9042
9171
  ["flags", getU32Encoder31()]
9043
9172
  ]),
9044
9173
  (value) => ({
@@ -9048,13 +9177,13 @@ function getSetTunaLpPositionFlagsInstructionDataEncoder() {
9048
9177
  );
9049
9178
  }
9050
9179
  function getSetTunaLpPositionFlagsInstructionDataDecoder() {
9051
- return getStructDecoder56([
9052
- ["discriminator", fixDecoderSize54(getBytesDecoder54(), 8)],
9180
+ return getStructDecoder57([
9181
+ ["discriminator", fixDecoderSize55(getBytesDecoder55(), 8)],
9053
9182
  ["flags", getU32Decoder31()]
9054
9183
  ]);
9055
9184
  }
9056
9185
  function getSetTunaLpPositionFlagsInstructionDataCodec() {
9057
- return combineCodec60(
9186
+ return combineCodec61(
9058
9187
  getSetTunaLpPositionFlagsInstructionDataEncoder(),
9059
9188
  getSetTunaLpPositionFlagsInstructionDataDecoder()
9060
9189
  );
@@ -9104,18 +9233,18 @@ function parseSetTunaLpPositionFlagsInstruction(instruction) {
9104
9233
 
9105
9234
  // src/generated/instructions/setTunaLpPositionLimitOrders.ts
9106
9235
  import {
9107
- combineCodec as combineCodec61,
9108
- fixDecoderSize as fixDecoderSize55,
9109
- fixEncoderSize as fixEncoderSize56,
9110
- getBytesDecoder as getBytesDecoder55,
9111
- getBytesEncoder as getBytesEncoder56,
9112
- getStructDecoder as getStructDecoder57,
9113
- getStructEncoder as getStructEncoder57,
9114
- getU128Decoder as getU128Decoder11,
9115
- getU128Encoder as getU128Encoder11,
9236
+ combineCodec as combineCodec62,
9237
+ fixDecoderSize as fixDecoderSize56,
9238
+ fixEncoderSize as fixEncoderSize57,
9239
+ getBytesDecoder as getBytesDecoder56,
9240
+ getBytesEncoder as getBytesEncoder57,
9241
+ getStructDecoder as getStructDecoder58,
9242
+ getStructEncoder as getStructEncoder58,
9243
+ getU128Decoder as getU128Decoder12,
9244
+ getU128Encoder as getU128Encoder12,
9116
9245
  getU8Decoder as getU8Decoder5,
9117
9246
  getU8Encoder as getU8Encoder5,
9118
- transformEncoder as transformEncoder55
9247
+ transformEncoder as transformEncoder56
9119
9248
  } from "@solana/kit";
9120
9249
  var SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array([
9121
9250
  65,
@@ -9128,16 +9257,16 @@ var SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array([
9128
9257
  255
9129
9258
  ]);
9130
9259
  function getSetTunaLpPositionLimitOrdersDiscriminatorBytes() {
9131
- return fixEncoderSize56(getBytesEncoder56(), 8).encode(
9260
+ return fixEncoderSize57(getBytesEncoder57(), 8).encode(
9132
9261
  SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR
9133
9262
  );
9134
9263
  }
9135
9264
  function getSetTunaLpPositionLimitOrdersInstructionDataEncoder() {
9136
- return transformEncoder55(
9137
- getStructEncoder57([
9138
- ["discriminator", fixEncoderSize56(getBytesEncoder56(), 8)],
9139
- ["lowerLimitOrderSqrtPrice", getU128Encoder11()],
9140
- ["upperLimitOrderSqrtPrice", getU128Encoder11()],
9265
+ return transformEncoder56(
9266
+ getStructEncoder58([
9267
+ ["discriminator", fixEncoderSize57(getBytesEncoder57(), 8)],
9268
+ ["lowerLimitOrderSqrtPrice", getU128Encoder12()],
9269
+ ["upperLimitOrderSqrtPrice", getU128Encoder12()],
9141
9270
  ["swapToTokenOnLimitOrder", getU8Encoder5()]
9142
9271
  ]),
9143
9272
  (value) => ({
@@ -9147,15 +9276,15 @@ function getSetTunaLpPositionLimitOrdersInstructionDataEncoder() {
9147
9276
  );
9148
9277
  }
9149
9278
  function getSetTunaLpPositionLimitOrdersInstructionDataDecoder() {
9150
- return getStructDecoder57([
9151
- ["discriminator", fixDecoderSize55(getBytesDecoder55(), 8)],
9152
- ["lowerLimitOrderSqrtPrice", getU128Decoder11()],
9153
- ["upperLimitOrderSqrtPrice", getU128Decoder11()],
9279
+ return getStructDecoder58([
9280
+ ["discriminator", fixDecoderSize56(getBytesDecoder56(), 8)],
9281
+ ["lowerLimitOrderSqrtPrice", getU128Decoder12()],
9282
+ ["upperLimitOrderSqrtPrice", getU128Decoder12()],
9154
9283
  ["swapToTokenOnLimitOrder", getU8Decoder5()]
9155
9284
  ]);
9156
9285
  }
9157
9286
  function getSetTunaLpPositionLimitOrdersInstructionDataCodec() {
9158
- return combineCodec61(
9287
+ return combineCodec62(
9159
9288
  getSetTunaLpPositionLimitOrdersInstructionDataEncoder(),
9160
9289
  getSetTunaLpPositionLimitOrdersInstructionDataDecoder()
9161
9290
  );
@@ -9205,27 +9334,27 @@ function parseSetTunaLpPositionLimitOrdersInstruction(instruction) {
9205
9334
 
9206
9335
  // src/generated/instructions/setTunaLpPositionRebalanceThreshold.ts
9207
9336
  import {
9208
- combineCodec as combineCodec62,
9209
- fixDecoderSize as fixDecoderSize56,
9210
- fixEncoderSize as fixEncoderSize57,
9211
- getBytesDecoder as getBytesDecoder56,
9212
- getBytesEncoder as getBytesEncoder57,
9213
- getStructDecoder as getStructDecoder58,
9214
- getStructEncoder as getStructEncoder58,
9337
+ combineCodec as combineCodec63,
9338
+ fixDecoderSize as fixDecoderSize57,
9339
+ fixEncoderSize as fixEncoderSize58,
9340
+ getBytesDecoder as getBytesDecoder57,
9341
+ getBytesEncoder as getBytesEncoder58,
9342
+ getStructDecoder as getStructDecoder59,
9343
+ getStructEncoder as getStructEncoder59,
9215
9344
  getU32Decoder as getU32Decoder32,
9216
9345
  getU32Encoder as getU32Encoder32,
9217
- transformEncoder as transformEncoder56
9346
+ transformEncoder as transformEncoder57
9218
9347
  } from "@solana/kit";
9219
9348
  var SET_TUNA_LP_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR = new Uint8Array([244, 174, 185, 58, 90, 150, 162, 51]);
9220
9349
  function getSetTunaLpPositionRebalanceThresholdDiscriminatorBytes() {
9221
- return fixEncoderSize57(getBytesEncoder57(), 8).encode(
9350
+ return fixEncoderSize58(getBytesEncoder58(), 8).encode(
9222
9351
  SET_TUNA_LP_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR
9223
9352
  );
9224
9353
  }
9225
9354
  function getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder() {
9226
- return transformEncoder56(
9227
- getStructEncoder58([
9228
- ["discriminator", fixEncoderSize57(getBytesEncoder57(), 8)],
9355
+ return transformEncoder57(
9356
+ getStructEncoder59([
9357
+ ["discriminator", fixEncoderSize58(getBytesEncoder58(), 8)],
9229
9358
  ["rebalanceThresholdTicks", getU32Encoder32()]
9230
9359
  ]),
9231
9360
  (value) => ({
@@ -9235,13 +9364,13 @@ function getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder() {
9235
9364
  );
9236
9365
  }
9237
9366
  function getSetTunaLpPositionRebalanceThresholdInstructionDataDecoder() {
9238
- return getStructDecoder58([
9239
- ["discriminator", fixDecoderSize56(getBytesDecoder56(), 8)],
9367
+ return getStructDecoder59([
9368
+ ["discriminator", fixDecoderSize57(getBytesDecoder57(), 8)],
9240
9369
  ["rebalanceThresholdTicks", getU32Decoder32()]
9241
9370
  ]);
9242
9371
  }
9243
9372
  function getSetTunaLpPositionRebalanceThresholdInstructionDataCodec() {
9244
- return combineCodec62(
9373
+ return combineCodec63(
9245
9374
  getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder(),
9246
9375
  getSetTunaLpPositionRebalanceThresholdInstructionDataDecoder()
9247
9376
  );
@@ -9291,31 +9420,31 @@ function parseSetTunaLpPositionRebalanceThresholdInstruction(instruction) {
9291
9420
 
9292
9421
  // src/generated/instructions/setTunaSpotPositionLimitOrders.ts
9293
9422
  import {
9294
- combineCodec as combineCodec63,
9295
- fixDecoderSize as fixDecoderSize57,
9296
- fixEncoderSize as fixEncoderSize58,
9297
- getBytesDecoder as getBytesDecoder57,
9298
- getBytesEncoder as getBytesEncoder58,
9299
- getStructDecoder as getStructDecoder59,
9300
- getStructEncoder as getStructEncoder59,
9301
- getU128Decoder as getU128Decoder12,
9302
- getU128Encoder as getU128Encoder12,
9303
- transformEncoder as transformEncoder57
9423
+ combineCodec as combineCodec64,
9424
+ fixDecoderSize as fixDecoderSize58,
9425
+ fixEncoderSize as fixEncoderSize59,
9426
+ getBytesDecoder as getBytesDecoder58,
9427
+ getBytesEncoder as getBytesEncoder59,
9428
+ getStructDecoder as getStructDecoder60,
9429
+ getStructEncoder as getStructEncoder60,
9430
+ getU128Decoder as getU128Decoder13,
9431
+ getU128Encoder as getU128Encoder13,
9432
+ transformEncoder as transformEncoder58
9304
9433
  } from "@solana/kit";
9305
9434
  var SET_TUNA_SPOT_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array(
9306
9435
  [10, 180, 19, 205, 169, 133, 52, 118]
9307
9436
  );
9308
9437
  function getSetTunaSpotPositionLimitOrdersDiscriminatorBytes() {
9309
- return fixEncoderSize58(getBytesEncoder58(), 8).encode(
9438
+ return fixEncoderSize59(getBytesEncoder59(), 8).encode(
9310
9439
  SET_TUNA_SPOT_POSITION_LIMIT_ORDERS_DISCRIMINATOR
9311
9440
  );
9312
9441
  }
9313
9442
  function getSetTunaSpotPositionLimitOrdersInstructionDataEncoder() {
9314
- return transformEncoder57(
9315
- getStructEncoder59([
9316
- ["discriminator", fixEncoderSize58(getBytesEncoder58(), 8)],
9317
- ["lowerLimitOrderSqrtPrice", getU128Encoder12()],
9318
- ["upperLimitOrderSqrtPrice", getU128Encoder12()]
9443
+ return transformEncoder58(
9444
+ getStructEncoder60([
9445
+ ["discriminator", fixEncoderSize59(getBytesEncoder59(), 8)],
9446
+ ["lowerLimitOrderSqrtPrice", getU128Encoder13()],
9447
+ ["upperLimitOrderSqrtPrice", getU128Encoder13()]
9319
9448
  ]),
9320
9449
  (value) => ({
9321
9450
  ...value,
@@ -9324,14 +9453,14 @@ function getSetTunaSpotPositionLimitOrdersInstructionDataEncoder() {
9324
9453
  );
9325
9454
  }
9326
9455
  function getSetTunaSpotPositionLimitOrdersInstructionDataDecoder() {
9327
- return getStructDecoder59([
9328
- ["discriminator", fixDecoderSize57(getBytesDecoder57(), 8)],
9329
- ["lowerLimitOrderSqrtPrice", getU128Decoder12()],
9330
- ["upperLimitOrderSqrtPrice", getU128Decoder12()]
9456
+ return getStructDecoder60([
9457
+ ["discriminator", fixDecoderSize58(getBytesDecoder58(), 8)],
9458
+ ["lowerLimitOrderSqrtPrice", getU128Decoder13()],
9459
+ ["upperLimitOrderSqrtPrice", getU128Decoder13()]
9331
9460
  ]);
9332
9461
  }
9333
9462
  function getSetTunaSpotPositionLimitOrdersInstructionDataCodec() {
9334
- return combineCodec63(
9463
+ return combineCodec64(
9335
9464
  getSetTunaSpotPositionLimitOrdersInstructionDataEncoder(),
9336
9465
  getSetTunaSpotPositionLimitOrdersInstructionDataDecoder()
9337
9466
  );
@@ -9381,24 +9510,24 @@ function parseSetTunaSpotPositionLimitOrdersInstruction(instruction) {
9381
9510
 
9382
9511
  // src/generated/instructions/updateMarket.ts
9383
9512
  import {
9384
- combineCodec as combineCodec64,
9385
- fixDecoderSize as fixDecoderSize58,
9386
- fixEncoderSize as fixEncoderSize59,
9513
+ combineCodec as combineCodec65,
9514
+ fixDecoderSize as fixDecoderSize59,
9515
+ fixEncoderSize as fixEncoderSize60,
9387
9516
  getAddressDecoder as getAddressDecoder14,
9388
9517
  getAddressEncoder as getAddressEncoder14,
9389
9518
  getBooleanDecoder as getBooleanDecoder8,
9390
9519
  getBooleanEncoder as getBooleanEncoder8,
9391
- getBytesDecoder as getBytesDecoder58,
9392
- getBytesEncoder as getBytesEncoder59,
9393
- getStructDecoder as getStructDecoder60,
9394
- getStructEncoder as getStructEncoder60,
9520
+ getBytesDecoder as getBytesDecoder59,
9521
+ getBytesEncoder as getBytesEncoder60,
9522
+ getStructDecoder as getStructDecoder61,
9523
+ getStructEncoder as getStructEncoder61,
9395
9524
  getU16Decoder as getU16Decoder8,
9396
9525
  getU16Encoder as getU16Encoder8,
9397
9526
  getU32Decoder as getU32Decoder33,
9398
9527
  getU32Encoder as getU32Encoder33,
9399
9528
  getU64Decoder as getU64Decoder21,
9400
9529
  getU64Encoder as getU64Encoder21,
9401
- transformEncoder as transformEncoder58
9530
+ transformEncoder as transformEncoder59
9402
9531
  } from "@solana/kit";
9403
9532
  var UPDATE_MARKET_DISCRIMINATOR = new Uint8Array([
9404
9533
  153,
@@ -9411,14 +9540,14 @@ var UPDATE_MARKET_DISCRIMINATOR = new Uint8Array([
9411
9540
  217
9412
9541
  ]);
9413
9542
  function getUpdateMarketDiscriminatorBytes() {
9414
- return fixEncoderSize59(getBytesEncoder59(), 8).encode(
9543
+ return fixEncoderSize60(getBytesEncoder60(), 8).encode(
9415
9544
  UPDATE_MARKET_DISCRIMINATOR
9416
9545
  );
9417
9546
  }
9418
9547
  function getUpdateMarketInstructionDataEncoder() {
9419
- return transformEncoder58(
9420
- getStructEncoder60([
9421
- ["discriminator", fixEncoderSize59(getBytesEncoder59(), 8)],
9548
+ return transformEncoder59(
9549
+ getStructEncoder61([
9550
+ ["discriminator", fixEncoderSize60(getBytesEncoder60(), 8)],
9422
9551
  ["addressLookupTable", getAddressEncoder14()],
9423
9552
  ["maxLeverage", getU32Encoder33()],
9424
9553
  ["protocolFee", getU16Encoder8()],
@@ -9437,8 +9566,8 @@ function getUpdateMarketInstructionDataEncoder() {
9437
9566
  );
9438
9567
  }
9439
9568
  function getUpdateMarketInstructionDataDecoder() {
9440
- return getStructDecoder60([
9441
- ["discriminator", fixDecoderSize58(getBytesDecoder58(), 8)],
9569
+ return getStructDecoder61([
9570
+ ["discriminator", fixDecoderSize59(getBytesDecoder59(), 8)],
9442
9571
  ["addressLookupTable", getAddressDecoder14()],
9443
9572
  ["maxLeverage", getU32Decoder33()],
9444
9573
  ["protocolFee", getU16Decoder8()],
@@ -9455,7 +9584,7 @@ function getUpdateMarketInstructionDataDecoder() {
9455
9584
  ]);
9456
9585
  }
9457
9586
  function getUpdateMarketInstructionDataCodec() {
9458
- return combineCodec64(
9587
+ return combineCodec65(
9459
9588
  getUpdateMarketInstructionDataEncoder(),
9460
9589
  getUpdateMarketInstructionDataDecoder()
9461
9590
  );
@@ -9506,18 +9635,18 @@ function parseUpdateMarketInstruction(instruction) {
9506
9635
 
9507
9636
  // src/generated/instructions/updateVault.ts
9508
9637
  import {
9509
- combineCodec as combineCodec65,
9510
- fixDecoderSize as fixDecoderSize59,
9511
- fixEncoderSize as fixEncoderSize60,
9638
+ combineCodec as combineCodec66,
9639
+ fixDecoderSize as fixDecoderSize60,
9640
+ fixEncoderSize as fixEncoderSize61,
9512
9641
  getAddressDecoder as getAddressDecoder15,
9513
9642
  getAddressEncoder as getAddressEncoder15,
9514
- getBytesDecoder as getBytesDecoder59,
9515
- getBytesEncoder as getBytesEncoder60,
9516
- getStructDecoder as getStructDecoder61,
9517
- getStructEncoder as getStructEncoder61,
9643
+ getBytesDecoder as getBytesDecoder60,
9644
+ getBytesEncoder as getBytesEncoder61,
9645
+ getStructDecoder as getStructDecoder62,
9646
+ getStructEncoder as getStructEncoder62,
9518
9647
  getU64Decoder as getU64Decoder22,
9519
9648
  getU64Encoder as getU64Encoder22,
9520
- transformEncoder as transformEncoder59
9649
+ transformEncoder as transformEncoder60
9521
9650
  } from "@solana/kit";
9522
9651
  var UPDATE_VAULT_DISCRIMINATOR = new Uint8Array([
9523
9652
  67,
@@ -9530,14 +9659,14 @@ var UPDATE_VAULT_DISCRIMINATOR = new Uint8Array([
9530
9659
  60
9531
9660
  ]);
9532
9661
  function getUpdateVaultDiscriminatorBytes() {
9533
- return fixEncoderSize60(getBytesEncoder60(), 8).encode(
9662
+ return fixEncoderSize61(getBytesEncoder61(), 8).encode(
9534
9663
  UPDATE_VAULT_DISCRIMINATOR
9535
9664
  );
9536
9665
  }
9537
9666
  function getUpdateVaultInstructionDataEncoder() {
9538
- return transformEncoder59(
9539
- getStructEncoder61([
9540
- ["discriminator", fixEncoderSize60(getBytesEncoder60(), 8)],
9667
+ return transformEncoder60(
9668
+ getStructEncoder62([
9669
+ ["discriminator", fixEncoderSize61(getBytesEncoder61(), 8)],
9541
9670
  ["interestRate", getU64Encoder22()],
9542
9671
  ["supplyLimit", getU64Encoder22()],
9543
9672
  ["pythOraclePriceUpdate", getAddressEncoder15()],
@@ -9547,8 +9676,8 @@ function getUpdateVaultInstructionDataEncoder() {
9547
9676
  );
9548
9677
  }
9549
9678
  function getUpdateVaultInstructionDataDecoder() {
9550
- return getStructDecoder61([
9551
- ["discriminator", fixDecoderSize59(getBytesDecoder59(), 8)],
9679
+ return getStructDecoder62([
9680
+ ["discriminator", fixDecoderSize60(getBytesDecoder60(), 8)],
9552
9681
  ["interestRate", getU64Decoder22()],
9553
9682
  ["supplyLimit", getU64Decoder22()],
9554
9683
  ["pythOraclePriceUpdate", getAddressDecoder15()],
@@ -9556,7 +9685,7 @@ function getUpdateVaultInstructionDataDecoder() {
9556
9685
  ]);
9557
9686
  }
9558
9687
  function getUpdateVaultInstructionDataCodec() {
9559
- return combineCodec65(
9688
+ return combineCodec66(
9560
9689
  getUpdateVaultInstructionDataEncoder(),
9561
9690
  getUpdateVaultInstructionDataDecoder()
9562
9691
  );
@@ -9607,16 +9736,16 @@ function parseUpdateVaultInstruction(instruction) {
9607
9736
 
9608
9737
  // src/generated/instructions/withdraw.ts
9609
9738
  import {
9610
- combineCodec as combineCodec66,
9611
- fixDecoderSize as fixDecoderSize60,
9612
- fixEncoderSize as fixEncoderSize61,
9613
- getBytesDecoder as getBytesDecoder60,
9614
- getBytesEncoder as getBytesEncoder61,
9615
- getStructDecoder as getStructDecoder62,
9616
- getStructEncoder as getStructEncoder62,
9739
+ combineCodec as combineCodec67,
9740
+ fixDecoderSize as fixDecoderSize61,
9741
+ fixEncoderSize as fixEncoderSize62,
9742
+ getBytesDecoder as getBytesDecoder61,
9743
+ getBytesEncoder as getBytesEncoder62,
9744
+ getStructDecoder as getStructDecoder63,
9745
+ getStructEncoder as getStructEncoder63,
9617
9746
  getU64Decoder as getU64Decoder23,
9618
9747
  getU64Encoder as getU64Encoder23,
9619
- transformEncoder as transformEncoder60
9748
+ transformEncoder as transformEncoder61
9620
9749
  } from "@solana/kit";
9621
9750
  var WITHDRAW_DISCRIMINATOR = new Uint8Array([
9622
9751
  183,
@@ -9629,12 +9758,12 @@ var WITHDRAW_DISCRIMINATOR = new Uint8Array([
9629
9758
  34
9630
9759
  ]);
9631
9760
  function getWithdrawDiscriminatorBytes() {
9632
- return fixEncoderSize61(getBytesEncoder61(), 8).encode(WITHDRAW_DISCRIMINATOR);
9761
+ return fixEncoderSize62(getBytesEncoder62(), 8).encode(WITHDRAW_DISCRIMINATOR);
9633
9762
  }
9634
9763
  function getWithdrawInstructionDataEncoder() {
9635
- return transformEncoder60(
9636
- getStructEncoder62([
9637
- ["discriminator", fixEncoderSize61(getBytesEncoder61(), 8)],
9764
+ return transformEncoder61(
9765
+ getStructEncoder63([
9766
+ ["discriminator", fixEncoderSize62(getBytesEncoder62(), 8)],
9638
9767
  ["funds", getU64Encoder23()],
9639
9768
  ["shares", getU64Encoder23()]
9640
9769
  ]),
@@ -9642,14 +9771,14 @@ function getWithdrawInstructionDataEncoder() {
9642
9771
  );
9643
9772
  }
9644
9773
  function getWithdrawInstructionDataDecoder() {
9645
- return getStructDecoder62([
9646
- ["discriminator", fixDecoderSize60(getBytesDecoder60(), 8)],
9774
+ return getStructDecoder63([
9775
+ ["discriminator", fixDecoderSize61(getBytesDecoder61(), 8)],
9647
9776
  ["funds", getU64Decoder23()],
9648
9777
  ["shares", getU64Decoder23()]
9649
9778
  ]);
9650
9779
  }
9651
9780
  function getWithdrawInstructionDataCodec() {
9652
- return combineCodec66(
9781
+ return combineCodec67(
9653
9782
  getWithdrawInstructionDataEncoder(),
9654
9783
  getWithdrawInstructionDataDecoder()
9655
9784
  );
@@ -9721,6 +9850,35 @@ function parseWithdrawInstruction(instruction) {
9721
9850
 
9722
9851
  // src/pda.ts
9723
9852
  import { getAddressEncoder as getAddressEncoder16, getProgramDerivedAddress } from "@solana/kit";
9853
+
9854
+ // src/consts.ts
9855
+ import { address } from "@solana/kit";
9856
+ var DEFAULT_ADDRESS = address("11111111111111111111111111111111");
9857
+ var HUNDRED_PERCENT = 1e6;
9858
+ var LEVERAGE_ONE = HUNDRED_PERCENT;
9859
+ var MAX_LEVERAGE = 11 * LEVERAGE_ONE;
9860
+ var MAX_PROTOCOL_FEE = HUNDRED_PERCENT / 100;
9861
+ var MAX_LIQUIDATION_FEE = HUNDRED_PERCENT / 5;
9862
+ var MAX_LIMIT_ORDER_EXECUTION_FEE = HUNDRED_PERCENT / 100;
9863
+ var DEFAULT_MAX_SWAP_SLIPPAGE = HUNDRED_PERCENT / 50;
9864
+ var MAX_LIQUIDATION_THRESHOLD = HUNDRED_PERCENT * 95 / 100;
9865
+ var NO_LOWER_LIMIT_ORDER = -2147483648;
9866
+ var NO_UPPER_LIMIT_ORDER = 2147483647;
9867
+ var COMPUTED_AMOUNT = 18446744073709551615n;
9868
+ var UNLIMITED_SUPPLY_LIMIT = 18446744073709551615n;
9869
+ var TUNA_POSITION_FLAGS_LOWER_LIMIT_ORDER_SWAP_TO_TOKEN_A = 1;
9870
+ var TUNA_POSITION_FLAGS_LOWER_LIMIT_ORDER_SWAP_TO_TOKEN_B = 1 << 1;
9871
+ var TUNA_POSITION_FLAGS_UPPER_LIMIT_ORDER_SWAP_TO_TOKEN_A = 1 << 2;
9872
+ var TUNA_POSITION_FLAGS_UPPER_LIMIT_ORDER_SWAP_TO_TOKEN_B = 1 << 3;
9873
+ var TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD = 1 << 4;
9874
+ var TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD_WITH_LEVERAGE = 1 << 5;
9875
+ var TUNA_POSITION_FLAGS_ALLOW_REBALANCING = 1 << 6;
9876
+ var WP_NFT_UPDATE_AUTH = address("3axbTs2z5GBy6usVbNVoqEgZMng3vZvMnAoX29BFfwhr");
9877
+ var DEFAULT_PUSH_ORACLE_PROGRAM_ID = address("pythWSnswVUd12oZpeFP8e9CVaEqJg25g1Vtc2biRsT");
9878
+ var MIN_SQRT_PRICE = 4295048016n;
9879
+ var MAX_SQRT_PRICE = 79226673515401279992447579055n;
9880
+
9881
+ // src/pda.ts
9724
9882
  async function getTunaConfigAddress() {
9725
9883
  return await getProgramDerivedAddress({
9726
9884
  programAddress: TUNA_PROGRAM_ADDRESS,
@@ -9757,6 +9915,24 @@ async function getTunaSpotPositionAddress(positionMint) {
9757
9915
  seeds: ["tuna_spot_position", getAddressEncoder16().encode(positionMint)]
9758
9916
  });
9759
9917
  }
9918
+ async function getPythPriceUpdateAccountAddress(shardId, priceFeedId) {
9919
+ if (typeof priceFeedId == "string") {
9920
+ if (priceFeedId.startsWith("0x")) {
9921
+ priceFeedId = Buffer.from(priceFeedId.slice(2), "hex");
9922
+ } else {
9923
+ priceFeedId = Buffer.from(priceFeedId, "hex");
9924
+ }
9925
+ }
9926
+ if (priceFeedId.length != 32) {
9927
+ throw new Error("Feed ID should be 32 bytes long");
9928
+ }
9929
+ const shardBuffer = Buffer.alloc(2);
9930
+ shardBuffer.writeUint16LE(shardId, 0);
9931
+ return await getProgramDerivedAddress({
9932
+ programAddress: DEFAULT_PUSH_ORACLE_PROGRAM_ID,
9933
+ seeds: [shardBuffer, priceFeedId]
9934
+ });
9935
+ }
9760
9936
 
9761
9937
  // src/gpa/tunaLpPosition.ts
9762
9938
  import {
@@ -10069,7 +10245,7 @@ var FusionUtils = class {
10069
10245
  };
10070
10246
 
10071
10247
  // src/utils/token.ts
10072
- import { address } from "@solana/kit";
10248
+ import { address as address2 } from "@solana/kit";
10073
10249
  import { getTransferSolInstruction } from "@solana-program/system";
10074
10250
  import { findAssociatedTokenPda, TOKEN_PROGRAM_ADDRESS } from "@solana-program/token";
10075
10251
  import {
@@ -10078,7 +10254,7 @@ import {
10078
10254
  getCreateAssociatedTokenIdempotentInstruction,
10079
10255
  getSyncNativeInstruction
10080
10256
  } from "@solana-program/token-2022";
10081
- var NATIVE_MINT = address("So11111111111111111111111111111111111111112");
10257
+ var NATIVE_MINT = address2("So11111111111111111111111111111111111111112");
10082
10258
  async function getCreateAtaInstruction(mint, owner, payer, tokenProgram = TOKEN_PROGRAM_ADDRESS) {
10083
10259
  const ata = (await findAssociatedTokenPda({
10084
10260
  mint,
@@ -10155,34 +10331,6 @@ import {
10155
10331
  tryGetTokenAFromLiquidity,
10156
10332
  tryGetTokenBFromLiquidity
10157
10333
  } from "@crypticdot/fusionamm-core";
10158
-
10159
- // src/consts.ts
10160
- import { address as address2 } from "@solana/kit";
10161
- var DEFAULT_ADDRESS = address2("11111111111111111111111111111111");
10162
- var HUNDRED_PERCENT = 1e6;
10163
- var LEVERAGE_ONE = HUNDRED_PERCENT;
10164
- var MAX_LEVERAGE = 11 * LEVERAGE_ONE;
10165
- var MAX_PROTOCOL_FEE = HUNDRED_PERCENT / 100;
10166
- var MAX_LIQUIDATION_FEE = HUNDRED_PERCENT / 5;
10167
- var MAX_LIMIT_ORDER_EXECUTION_FEE = HUNDRED_PERCENT / 100;
10168
- var DEFAULT_MAX_SWAP_SLIPPAGE = HUNDRED_PERCENT / 50;
10169
- var MAX_LIQUIDATION_THRESHOLD = HUNDRED_PERCENT * 95 / 100;
10170
- var NO_LOWER_LIMIT_ORDER = -2147483648;
10171
- var NO_UPPER_LIMIT_ORDER = 2147483647;
10172
- var COMPUTED_AMOUNT = 18446744073709551615n;
10173
- var UNLIMITED_SUPPLY_LIMIT = 18446744073709551615n;
10174
- var TUNA_POSITION_FLAGS_LOWER_LIMIT_ORDER_SWAP_TO_TOKEN_A = 1;
10175
- var TUNA_POSITION_FLAGS_LOWER_LIMIT_ORDER_SWAP_TO_TOKEN_B = 1 << 1;
10176
- var TUNA_POSITION_FLAGS_UPPER_LIMIT_ORDER_SWAP_TO_TOKEN_A = 1 << 2;
10177
- var TUNA_POSITION_FLAGS_UPPER_LIMIT_ORDER_SWAP_TO_TOKEN_B = 1 << 3;
10178
- var TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD = 1 << 4;
10179
- var TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD_WITH_LEVERAGE = 1 << 5;
10180
- var TUNA_POSITION_FLAGS_ALLOW_REBALANCING = 1 << 6;
10181
- var WP_NFT_UPDATE_AUTH = address2("3axbTs2z5GBy6usVbNVoqEgZMng3vZvMnAoX29BFfwhr");
10182
- var MIN_SQRT_PRICE = 4295048016n;
10183
- var MAX_SQRT_PRICE = 79226673515401279992447579055n;
10184
-
10185
- // src/utils/positionMath.ts
10186
10334
  var DEFAULT_MAX_AMOUNT_SLIPPAGE = HUNDRED_PERCENT / 2;
10187
10335
  function getLiquidityIncreaseQuote(args) {
10188
10336
  const { protocolFeeRate, protocolFeeRateOnCollateral, swapFeeRate, sqrtPrice, tickLowerIndex, tickUpperIndex } = args;
@@ -14688,6 +14836,56 @@ async function setTunaLpPositionLimitOrdersInstruction(authority, args, position
14688
14836
  });
14689
14837
  }
14690
14838
 
14839
+ // src/txbuilder/setTunaSpotPositionLimitOrders.ts
14840
+ async function setTunaSpotPositionLimitOrdersInstruction(authority, args, positionMint, tunaPositionAddress) {
14841
+ if (tunaPositionAddress === void 0) {
14842
+ if (positionMint === void 0) {
14843
+ throw new Error("At least one of 'positionMint' or 'tunaPositionAddress' must be provided.");
14844
+ }
14845
+ tunaPositionAddress = (await getTunaSpotPositionAddress(positionMint))[0];
14846
+ }
14847
+ return getSetTunaSpotPositionLimitOrdersInstruction({
14848
+ ...args,
14849
+ authority,
14850
+ tunaPosition: tunaPositionAddress
14851
+ });
14852
+ }
14853
+
14854
+ // src/txbuilder/resetTunaSpotPosition.ts
14855
+ import { fetchAllMaybeMint as fetchAllMaybeMint28, findAssociatedTokenPda as findAssociatedTokenPda36 } from "@solana-program/token-2022";
14856
+ import assert28 from "assert";
14857
+ async function resetTunaSpotPositionInstruction(rpc, authority, args, positionMint, tunaPositionAddress) {
14858
+ if (tunaPositionAddress === void 0) {
14859
+ if (positionMint === void 0) {
14860
+ throw new Error("At least one of 'positionMint' or 'tunaPositionAddress' must be provided.");
14861
+ }
14862
+ tunaPositionAddress = (await getTunaSpotPositionAddress(positionMint))[0];
14863
+ }
14864
+ const tunaPosition = await fetchTunaSpotPosition(rpc, tunaPositionAddress);
14865
+ const [mintA, mintB] = await fetchAllMaybeMint28(rpc, [tunaPosition.data.mintA, tunaPosition.data.mintB]);
14866
+ assert28(mintA.exists, "Token A not found");
14867
+ assert28(mintB.exists, "Token B not found");
14868
+ const tunaPositionAtaA = (await findAssociatedTokenPda36({
14869
+ owner: tunaPositionAddress,
14870
+ mint: mintA.address,
14871
+ tokenProgram: mintA.programAddress
14872
+ }))[0];
14873
+ const tunaPositionAtaB = (await findAssociatedTokenPda36({
14874
+ owner: tunaPositionAddress,
14875
+ mint: mintB.address,
14876
+ tokenProgram: mintB.programAddress
14877
+ }))[0];
14878
+ return getResetTunaSpotPositionInstruction({
14879
+ ...args,
14880
+ authority,
14881
+ mintA: tunaPosition.data.mintA,
14882
+ mintB: tunaPosition.data.mintB,
14883
+ tunaPositionAtaA,
14884
+ tunaPositionAtaB,
14885
+ tunaPosition: tunaPositionAddress
14886
+ });
14887
+ }
14888
+
14691
14889
  // src/txbuilder/updateMarket.ts
14692
14890
  async function updateMarketInstruction(authority, pool, args) {
14693
14891
  const tunaConfig = (await getTunaConfigAddress())[0];
@@ -14714,7 +14912,7 @@ async function updateVaultInstruction(authority, mint, args) {
14714
14912
 
14715
14913
  // src/txbuilder/withdraw.ts
14716
14914
  import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS25 } from "@solana-program/memo";
14717
- import { fetchMaybeMint as fetchMaybeMint3, findAssociatedTokenPda as findAssociatedTokenPda36 } from "@solana-program/token-2022";
14915
+ import { fetchMaybeMint as fetchMaybeMint3, findAssociatedTokenPda as findAssociatedTokenPda37 } from "@solana-program/token-2022";
14718
14916
  async function withdrawInstructions(rpc, authority, mintAddress, funds, shares) {
14719
14917
  const instructions = [];
14720
14918
  const mint = await fetchMaybeMint3(rpc, mintAddress);
@@ -14736,12 +14934,12 @@ async function withdrawInstruction(authority, mint, funds, shares) {
14736
14934
  const tunaConfig = (await getTunaConfigAddress())[0];
14737
14935
  const lendingPosition = (await getLendingPositionAddress(authority.address, mint.address))[0];
14738
14936
  const vault = (await getLendingVaultAddress(mint.address))[0];
14739
- const vaultAta = (await findAssociatedTokenPda36({
14937
+ const vaultAta = (await findAssociatedTokenPda37({
14740
14938
  owner: vault,
14741
14939
  mint: mint.address,
14742
14940
  tokenProgram: mint.programAddress
14743
14941
  }))[0];
14744
- const authorityAta = (await findAssociatedTokenPda36({
14942
+ const authorityAta = (await findAssociatedTokenPda37({
14745
14943
  owner: authority.address,
14746
14944
  mint: mint.address,
14747
14945
  tokenProgram: mint.programAddress
@@ -14773,7 +14971,7 @@ import { TOKEN_PROGRAM_ADDRESS as TOKEN_PROGRAM_ADDRESS2 } from "@solana-program
14773
14971
  import {
14774
14972
  ASSOCIATED_TOKEN_PROGRAM_ADDRESS as ASSOCIATED_TOKEN_PROGRAM_ADDRESS9,
14775
14973
  fetchMint,
14776
- findAssociatedTokenPda as findAssociatedTokenPda37,
14974
+ findAssociatedTokenPda as findAssociatedTokenPda38,
14777
14975
  TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS19
14778
14976
  } from "@solana-program/token-2022";
14779
14977
  async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
@@ -14784,12 +14982,12 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
14784
14982
  const pool = marketMaker == 0 /* Orca */ ? await fetchWhirlpool3(rpc, poolAddress) : await fetchFusionPool3(rpc, poolAddress);
14785
14983
  const mintA = await fetchMint(rpc, pool.data.tokenMintA);
14786
14984
  const mintB = await fetchMint(rpc, pool.data.tokenMintB);
14787
- const feeRecipientAtaA = (await findAssociatedTokenPda37({
14985
+ const feeRecipientAtaA = (await findAssociatedTokenPda38({
14788
14986
  owner: tunaConfig.data.feeRecipient,
14789
14987
  mint: mintA.address,
14790
14988
  tokenProgram: mintA.programAddress
14791
14989
  }))[0];
14792
- const feeRecipientAtaB = (await findAssociatedTokenPda37({
14990
+ const feeRecipientAtaB = (await findAssociatedTokenPda38({
14793
14991
  owner: tunaConfig.data.feeRecipient,
14794
14992
  mint: mintB.address,
14795
14993
  tokenProgram: mintB.programAddress
@@ -14798,12 +14996,12 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
14798
14996
  (await getLendingVaultAddress(mintA.address))[0],
14799
14997
  (await getLendingVaultAddress(mintB.address))[0]
14800
14998
  ]);
14801
- const vaultAAta = (await findAssociatedTokenPda37({
14999
+ const vaultAAta = (await findAssociatedTokenPda38({
14802
15000
  owner: vaultA.address,
14803
15001
  mint: mintA.address,
14804
15002
  tokenProgram: mintA.programAddress
14805
15003
  }))[0];
14806
- const vaultBAta = (await findAssociatedTokenPda37({
15004
+ const vaultBAta = (await findAssociatedTokenPda38({
14807
15005
  owner: vaultB.address,
14808
15006
  mint: mintB.address,
14809
15007
  tokenProgram: mintB.programAddress
@@ -14858,16 +15056,16 @@ async function createAddressLookupTableForMarketInstructions(rpc, poolAddress, m
14858
15056
 
14859
15057
  // src/txbuilder/repayTunaLpPositionDebt.ts
14860
15058
  import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS27 } from "@solana-program/memo";
14861
- import { fetchAllMaybeMint as fetchAllMaybeMint28, findAssociatedTokenPda as findAssociatedTokenPda38 } from "@solana-program/token-2022";
14862
- import assert28 from "assert";
15059
+ import { fetchAllMaybeMint as fetchAllMaybeMint29, findAssociatedTokenPda as findAssociatedTokenPda39 } from "@solana-program/token-2022";
15060
+ import assert29 from "assert";
14863
15061
  async function repayTunaLpPositionDebtInstructions(rpc, authority, positionMint, collateralA, collateralB, createInstructions, cleanupInstructions) {
14864
15062
  const instructions = [];
14865
15063
  if (!createInstructions) createInstructions = instructions;
14866
15064
  if (!cleanupInstructions) cleanupInstructions = instructions;
14867
15065
  const tunaPosition = await fetchTunaLpPosition(rpc, (await getTunaLpPositionAddress(positionMint))[0]);
14868
- const [mintA, mintB] = await fetchAllMaybeMint28(rpc, [tunaPosition.data.mintA, tunaPosition.data.mintB]);
14869
- assert28(mintA.exists, "Token A not found");
14870
- assert28(mintB.exists, "Token B not found");
15066
+ const [mintA, mintB] = await fetchAllMaybeMint29(rpc, [tunaPosition.data.mintA, tunaPosition.data.mintB]);
15067
+ assert29(mintA.exists, "Token A not found");
15068
+ assert29(mintB.exists, "Token B not found");
14871
15069
  const marketAddress = (await getMarketAddress(tunaPosition.data.pool))[0];
14872
15070
  const createUserAtaAInstructions = await getCreateAtaInstructions(
14873
15071
  rpc,
@@ -14903,34 +15101,34 @@ async function repayTunaLpPositionDebtInstructions(rpc, authority, positionMint,
14903
15101
  }
14904
15102
  async function repayTunaLpPositionDebtInstruction(authority, positionMint, mintA, mintB, marketAddress, collateralA, collateralB) {
14905
15103
  const tunaPositionAddress = (await getTunaLpPositionAddress(positionMint))[0];
14906
- const tunaPositionOwnerAtaA = (await findAssociatedTokenPda38({
15104
+ const tunaPositionOwnerAtaA = (await findAssociatedTokenPda39({
14907
15105
  owner: authority.address,
14908
15106
  mint: mintA.address,
14909
15107
  tokenProgram: mintA.programAddress
14910
15108
  }))[0];
14911
- const tunaPositionOwnerAtaB = (await findAssociatedTokenPda38({
15109
+ const tunaPositionOwnerAtaB = (await findAssociatedTokenPda39({
14912
15110
  owner: authority.address,
14913
15111
  mint: mintB.address,
14914
15112
  tokenProgram: mintB.programAddress
14915
15113
  }))[0];
14916
- const tunaPositionAtaA = (await findAssociatedTokenPda38({
15114
+ const tunaPositionAtaA = (await findAssociatedTokenPda39({
14917
15115
  owner: tunaPositionAddress,
14918
15116
  mint: mintA.address,
14919
15117
  tokenProgram: mintA.programAddress
14920
15118
  }))[0];
14921
- const tunaPositionAtaB = (await findAssociatedTokenPda38({
15119
+ const tunaPositionAtaB = (await findAssociatedTokenPda39({
14922
15120
  owner: tunaPositionAddress,
14923
15121
  mint: mintB.address,
14924
15122
  tokenProgram: mintB.programAddress
14925
15123
  }))[0];
14926
15124
  const vaultAAddress = (await getLendingVaultAddress(mintA.address))[0];
14927
- const vaultAAta = (await findAssociatedTokenPda38({
15125
+ const vaultAAta = (await findAssociatedTokenPda39({
14928
15126
  owner: vaultAAddress,
14929
15127
  mint: mintA.address,
14930
15128
  tokenProgram: mintA.programAddress
14931
15129
  }))[0];
14932
15130
  const vaultBAddress = (await getLendingVaultAddress(mintB.address))[0];
14933
- const vaultBAta = (await findAssociatedTokenPda38({
15131
+ const vaultBAta = (await findAssociatedTokenPda39({
14934
15132
  owner: vaultBAddress,
14935
15133
  mint: mintB.address,
14936
15134
  tokenProgram: mintB.programAddress
@@ -14974,11 +15172,11 @@ import {
14974
15172
  import { fetchSysvarRent as fetchSysvarRent3 } from "@solana/sysvars";
14975
15173
  import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS28 } from "@solana-program/memo";
14976
15174
  import {
14977
- fetchAllMaybeMint as fetchAllMaybeMint29,
14978
- findAssociatedTokenPda as findAssociatedTokenPda39,
15175
+ fetchAllMaybeMint as fetchAllMaybeMint30,
15176
+ findAssociatedTokenPda as findAssociatedTokenPda40,
14979
15177
  TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS20
14980
15178
  } from "@solana-program/token-2022";
14981
- import assert29 from "assert";
15179
+ import assert30 from "assert";
14982
15180
  async function rebalanceTunaLpPositionOrcaInstructions(rpc, authority, positionMint, createInstructions, cleanupInstructions) {
14983
15181
  const rent = await fetchSysvarRent3(rpc);
14984
15182
  let nonRefundableRent = 0n;
@@ -14991,9 +15189,9 @@ async function rebalanceTunaLpPositionOrcaInstructions(rpc, authority, positionM
14991
15189
  (await getLendingVaultAddress(whirlpool.data.tokenMintA))[0],
14992
15190
  (await getLendingVaultAddress(whirlpool.data.tokenMintB))[0]
14993
15191
  ]);
14994
- const [mintA, mintB] = await fetchAllMaybeMint29(rpc, [whirlpool.data.tokenMintA, whirlpool.data.tokenMintB]);
14995
- assert29(mintA.exists, "Token A account not found");
14996
- assert29(mintB.exists, "Token B account not found");
15192
+ const [mintA, mintB] = await fetchAllMaybeMint30(rpc, [whirlpool.data.tokenMintA, whirlpool.data.tokenMintB]);
15193
+ assert30(mintA.exists, "Token A account not found");
15194
+ assert30(mintB.exists, "Token B account not found");
14997
15195
  const instructions = [];
14998
15196
  if (!createInstructions) createInstructions = instructions;
14999
15197
  if (!cleanupInstructions) cleanupInstructions = instructions;
@@ -15065,27 +15263,27 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
15065
15263
  const marketAddress = (await getMarketAddress(whirlpool.address))[0];
15066
15264
  const orcaPositionAddress = (await getPositionAddress19(positionMint))[0];
15067
15265
  const orcaOracleAddress = (await getOracleAddress12(whirlpool.address))[0];
15068
- const tunaPositionAta = (await findAssociatedTokenPda39({
15266
+ const tunaPositionAta = (await findAssociatedTokenPda40({
15069
15267
  owner: tunaPosition.address,
15070
15268
  mint: positionMint,
15071
15269
  tokenProgram: TOKEN_2022_PROGRAM_ADDRESS20
15072
15270
  }))[0];
15073
- const tunaPositionAtaA = (await findAssociatedTokenPda39({
15271
+ const tunaPositionAtaA = (await findAssociatedTokenPda40({
15074
15272
  owner: tunaPosition.address,
15075
15273
  mint: mintA.address,
15076
15274
  tokenProgram: mintA.programAddress
15077
15275
  }))[0];
15078
- const tunaPositionAtaB = (await findAssociatedTokenPda39({
15276
+ const tunaPositionAtaB = (await findAssociatedTokenPda40({
15079
15277
  owner: tunaPosition.address,
15080
15278
  mint: mintB.address,
15081
15279
  tokenProgram: mintB.programAddress
15082
15280
  }))[0];
15083
- const feeRecipientAtaA = (await findAssociatedTokenPda39({
15281
+ const feeRecipientAtaA = (await findAssociatedTokenPda40({
15084
15282
  owner: tunaConfig.data.feeRecipient,
15085
15283
  mint: mintA.address,
15086
15284
  tokenProgram: mintA.programAddress
15087
15285
  }))[0];
15088
- const feeRecipientAtaB = (await findAssociatedTokenPda39({
15286
+ const feeRecipientAtaB = (await findAssociatedTokenPda40({
15089
15287
  owner: tunaConfig.data.feeRecipient,
15090
15288
  mint: mintB.address,
15091
15289
  tokenProgram: mintB.programAddress
@@ -15170,11 +15368,11 @@ import {
15170
15368
  import { fetchSysvarRent as fetchSysvarRent4 } from "@solana/sysvars";
15171
15369
  import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS29 } from "@solana-program/memo";
15172
15370
  import {
15173
- fetchAllMaybeMint as fetchAllMaybeMint30,
15174
- findAssociatedTokenPda as findAssociatedTokenPda40,
15371
+ fetchAllMaybeMint as fetchAllMaybeMint31,
15372
+ findAssociatedTokenPda as findAssociatedTokenPda41,
15175
15373
  TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS21
15176
15374
  } from "@solana-program/token-2022";
15177
- import assert30 from "assert";
15375
+ import assert31 from "assert";
15178
15376
  async function rebalanceTunaLpPositionFusionInstructions(rpc, authority, positionMint, createInstructions, cleanupInstructions) {
15179
15377
  const rent = await fetchSysvarRent4(rpc);
15180
15378
  let nonRefundableRent = 0n;
@@ -15187,9 +15385,9 @@ async function rebalanceTunaLpPositionFusionInstructions(rpc, authority, positio
15187
15385
  (await getLendingVaultAddress(fusionPool.data.tokenMintA))[0],
15188
15386
  (await getLendingVaultAddress(fusionPool.data.tokenMintB))[0]
15189
15387
  ]);
15190
- const [mintA, mintB] = await fetchAllMaybeMint30(rpc, [fusionPool.data.tokenMintA, fusionPool.data.tokenMintB]);
15191
- assert30(mintA.exists, "Token A account not found");
15192
- assert30(mintB.exists, "Token B account not found");
15388
+ const [mintA, mintB] = await fetchAllMaybeMint31(rpc, [fusionPool.data.tokenMintA, fusionPool.data.tokenMintB]);
15389
+ assert31(mintA.exists, "Token A account not found");
15390
+ assert31(mintB.exists, "Token B account not found");
15193
15391
  const instructions = [];
15194
15392
  if (!createInstructions) createInstructions = instructions;
15195
15393
  if (!cleanupInstructions) cleanupInstructions = instructions;
@@ -15256,27 +15454,27 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
15256
15454
  const positionMint = tunaPosition.data.positionMint;
15257
15455
  const marketAddress = (await getMarketAddress(fusionPool.address))[0];
15258
15456
  const fusionPositionAddress = (await getPositionAddress20(positionMint))[0];
15259
- const tunaPositionAta = (await findAssociatedTokenPda40({
15457
+ const tunaPositionAta = (await findAssociatedTokenPda41({
15260
15458
  owner: tunaPosition.address,
15261
15459
  mint: positionMint,
15262
15460
  tokenProgram: TOKEN_2022_PROGRAM_ADDRESS21
15263
15461
  }))[0];
15264
- const tunaPositionAtaA = (await findAssociatedTokenPda40({
15462
+ const tunaPositionAtaA = (await findAssociatedTokenPda41({
15265
15463
  owner: tunaPosition.address,
15266
15464
  mint: mintA.address,
15267
15465
  tokenProgram: mintA.programAddress
15268
15466
  }))[0];
15269
- const tunaPositionAtaB = (await findAssociatedTokenPda40({
15467
+ const tunaPositionAtaB = (await findAssociatedTokenPda41({
15270
15468
  owner: tunaPosition.address,
15271
15469
  mint: mintB.address,
15272
15470
  tokenProgram: mintB.programAddress
15273
15471
  }))[0];
15274
- const feeRecipientAtaA = (await findAssociatedTokenPda40({
15472
+ const feeRecipientAtaA = (await findAssociatedTokenPda41({
15275
15473
  owner: tunaConfig.data.feeRecipient,
15276
15474
  mint: mintA.address,
15277
15475
  tokenProgram: mintA.programAddress
15278
15476
  }))[0];
15279
- const feeRecipientAtaB = (await findAssociatedTokenPda40({
15477
+ const feeRecipientAtaB = (await findAssociatedTokenPda41({
15280
15478
  owner: tunaConfig.data.feeRecipient,
15281
15479
  mint: mintB.address,
15282
15480
  tokenProgram: mintB.programAddress
@@ -15365,6 +15563,7 @@ export {
15365
15563
  DEFAULT_ADDRESS,
15366
15564
  DEFAULT_MAX_AMOUNT_SLIPPAGE,
15367
15565
  DEFAULT_MAX_SWAP_SLIPPAGE,
15566
+ DEFAULT_PUSH_ORACLE_PROGRAM_ID,
15368
15567
  DEPOSIT_DISCRIMINATOR,
15369
15568
  FusionUtils,
15370
15569
  HUNDRED_PERCENT,
@@ -15405,6 +15604,7 @@ export {
15405
15604
  REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR,
15406
15605
  REPAY_BAD_DEBT_DISCRIMINATOR,
15407
15606
  REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR,
15607
+ RESET_TUNA_SPOT_POSITION_DISCRIMINATOR,
15408
15608
  SET_ADMIN_AUTHORITY_DISCRIMINATOR,
15409
15609
  SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR,
15410
15610
  SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR,
@@ -15766,6 +15966,7 @@ export {
15766
15966
  getPoolTokenCodec,
15767
15967
  getPoolTokenDecoder,
15768
15968
  getPoolTokenEncoder,
15969
+ getPythPriceUpdateAccountAddress,
15769
15970
  getRebalanceTunaLpPositionFusionDiscriminatorBytes,
15770
15971
  getRebalanceTunaLpPositionFusionInstruction,
15771
15972
  getRebalanceTunaLpPositionFusionInstructionDataCodec,
@@ -15792,6 +15993,11 @@ export {
15792
15993
  getRepayTunaLpPositionDebtInstructionDataCodec,
15793
15994
  getRepayTunaLpPositionDebtInstructionDataDecoder,
15794
15995
  getRepayTunaLpPositionDebtInstructionDataEncoder,
15996
+ getResetTunaSpotPositionDiscriminatorBytes,
15997
+ getResetTunaSpotPositionInstruction,
15998
+ getResetTunaSpotPositionInstructionDataCodec,
15999
+ getResetTunaSpotPositionInstructionDataDecoder,
16000
+ getResetTunaSpotPositionInstructionDataEncoder,
15795
16001
  getSetAdminAuthorityDiscriminatorBytes,
15796
16002
  getSetAdminAuthorityInstruction,
15797
16003
  getSetAdminAuthorityInstructionDataCodec,
@@ -15970,6 +16176,7 @@ export {
15970
16176
  parseRebalanceTunaLpPositionOrcaInstruction,
15971
16177
  parseRepayBadDebtInstruction,
15972
16178
  parseRepayTunaLpPositionDebtInstruction,
16179
+ parseResetTunaSpotPositionInstruction,
15973
16180
  parseSetAdminAuthorityInstruction,
15974
16181
  parseSetDefaultMaxPercentageOfLeftoversInstruction,
15975
16182
  parseSetDefaultMaxSwapSlippageInstruction,
@@ -15992,7 +16199,9 @@ export {
15992
16199
  repayBadDebtInstruction,
15993
16200
  repayTunaLpPositionDebtInstruction,
15994
16201
  repayTunaLpPositionDebtInstructions,
16202
+ resetTunaSpotPositionInstruction,
15995
16203
  setTunaLpPositionLimitOrdersInstruction,
16204
+ setTunaSpotPositionLimitOrdersInstruction,
15996
16205
  tunaLpPositionAuthorityFilter,
15997
16206
  tunaLpPositionMarketMakerFilter,
15998
16207
  tunaLpPositionMintAFilter,