@crypticdot/defituna-client 3.2.6 → 3.2.7
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.d.mts +51 -158
- package/dist/index.d.ts +51 -158
- package/dist/index.js +672 -851
- package/dist/index.mjs +515 -696
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -993,28 +993,27 @@ var TunaInstruction = /* @__PURE__ */ ((TunaInstruction2) => {
|
|
|
993
993
|
TunaInstruction2[TunaInstruction2["OpenLendingPosition"] = 32] = "OpenLendingPosition";
|
|
994
994
|
TunaInstruction2[TunaInstruction2["OpenTunaLpPositionFusion"] = 33] = "OpenTunaLpPositionFusion";
|
|
995
995
|
TunaInstruction2[TunaInstruction2["OpenTunaLpPositionOrca"] = 34] = "OpenTunaLpPositionOrca";
|
|
996
|
-
TunaInstruction2[TunaInstruction2["
|
|
997
|
-
TunaInstruction2[TunaInstruction2["
|
|
998
|
-
TunaInstruction2[TunaInstruction2["
|
|
999
|
-
TunaInstruction2[TunaInstruction2["
|
|
1000
|
-
TunaInstruction2[TunaInstruction2["
|
|
1001
|
-
TunaInstruction2[TunaInstruction2["
|
|
1002
|
-
TunaInstruction2[TunaInstruction2["
|
|
1003
|
-
TunaInstruction2[TunaInstruction2["
|
|
1004
|
-
TunaInstruction2[TunaInstruction2["
|
|
1005
|
-
TunaInstruction2[TunaInstruction2["
|
|
1006
|
-
TunaInstruction2[TunaInstruction2["
|
|
1007
|
-
TunaInstruction2[TunaInstruction2["
|
|
1008
|
-
TunaInstruction2[TunaInstruction2["
|
|
1009
|
-
TunaInstruction2[TunaInstruction2["
|
|
1010
|
-
TunaInstruction2[TunaInstruction2["
|
|
1011
|
-
TunaInstruction2[TunaInstruction2["
|
|
1012
|
-
TunaInstruction2[TunaInstruction2["
|
|
1013
|
-
TunaInstruction2[TunaInstruction2["
|
|
1014
|
-
TunaInstruction2[TunaInstruction2["
|
|
1015
|
-
TunaInstruction2[TunaInstruction2["
|
|
1016
|
-
TunaInstruction2[TunaInstruction2["
|
|
1017
|
-
TunaInstruction2[TunaInstruction2["Withdraw"] = 56] = "Withdraw";
|
|
996
|
+
TunaInstruction2[TunaInstruction2["OpenTunaSpotPosition"] = 35] = "OpenTunaSpotPosition";
|
|
997
|
+
TunaInstruction2[TunaInstruction2["RebalanceTunaLpPositionFusion"] = 36] = "RebalanceTunaLpPositionFusion";
|
|
998
|
+
TunaInstruction2[TunaInstruction2["RebalanceTunaLpPositionOrca"] = 37] = "RebalanceTunaLpPositionOrca";
|
|
999
|
+
TunaInstruction2[TunaInstruction2["RepayBadDebt"] = 38] = "RepayBadDebt";
|
|
1000
|
+
TunaInstruction2[TunaInstruction2["RepayTunaLpPositionDebt"] = 39] = "RepayTunaLpPositionDebt";
|
|
1001
|
+
TunaInstruction2[TunaInstruction2["ResetTunaSpotPosition"] = 40] = "ResetTunaSpotPosition";
|
|
1002
|
+
TunaInstruction2[TunaInstruction2["SetAdminAuthority"] = 41] = "SetAdminAuthority";
|
|
1003
|
+
TunaInstruction2[TunaInstruction2["SetDefaultMaxPercentageOfLeftovers"] = 42] = "SetDefaultMaxPercentageOfLeftovers";
|
|
1004
|
+
TunaInstruction2[TunaInstruction2["SetDefaultMaxSwapSlippage"] = 43] = "SetDefaultMaxSwapSlippage";
|
|
1005
|
+
TunaInstruction2[TunaInstruction2["SetDefaultOraclePriceDeviationThreshold"] = 44] = "SetDefaultOraclePriceDeviationThreshold";
|
|
1006
|
+
TunaInstruction2[TunaInstruction2["SetFeeRecipient"] = 45] = "SetFeeRecipient";
|
|
1007
|
+
TunaInstruction2[TunaInstruction2["SetLiquidatorAuthority"] = 46] = "SetLiquidatorAuthority";
|
|
1008
|
+
TunaInstruction2[TunaInstruction2["SetOwnerAuthority"] = 47] = "SetOwnerAuthority";
|
|
1009
|
+
TunaInstruction2[TunaInstruction2["SetSuspendedState"] = 48] = "SetSuspendedState";
|
|
1010
|
+
TunaInstruction2[TunaInstruction2["SetTunaLpPositionFlags"] = 49] = "SetTunaLpPositionFlags";
|
|
1011
|
+
TunaInstruction2[TunaInstruction2["SetTunaLpPositionLimitOrders"] = 50] = "SetTunaLpPositionLimitOrders";
|
|
1012
|
+
TunaInstruction2[TunaInstruction2["SetTunaLpPositionRebalanceThreshold"] = 51] = "SetTunaLpPositionRebalanceThreshold";
|
|
1013
|
+
TunaInstruction2[TunaInstruction2["SetTunaSpotPositionLimitOrders"] = 52] = "SetTunaSpotPositionLimitOrders";
|
|
1014
|
+
TunaInstruction2[TunaInstruction2["UpdateMarket"] = 53] = "UpdateMarket";
|
|
1015
|
+
TunaInstruction2[TunaInstruction2["UpdateVault"] = 54] = "UpdateVault";
|
|
1016
|
+
TunaInstruction2[TunaInstruction2["Withdraw"] = 55] = "Withdraw";
|
|
1018
1017
|
return TunaInstruction2;
|
|
1019
1018
|
})(TunaInstruction || {});
|
|
1020
1019
|
function identifyTunaInstruction(instruction) {
|
|
@@ -1337,20 +1336,11 @@ function identifyTunaInstruction(instruction) {
|
|
|
1337
1336
|
if (containsBytes(
|
|
1338
1337
|
data,
|
|
1339
1338
|
fixEncoderSize7(getBytesEncoder7(), 8).encode(
|
|
1340
|
-
new Uint8Array([
|
|
1339
|
+
new Uint8Array([87, 208, 173, 48, 231, 62, 210, 220])
|
|
1341
1340
|
),
|
|
1342
1341
|
0
|
|
1343
1342
|
)) {
|
|
1344
|
-
return 35 /*
|
|
1345
|
-
}
|
|
1346
|
-
if (containsBytes(
|
|
1347
|
-
data,
|
|
1348
|
-
fixEncoderSize7(getBytesEncoder7(), 8).encode(
|
|
1349
|
-
new Uint8Array([90, 70, 21, 186, 147, 80, 191, 94])
|
|
1350
|
-
),
|
|
1351
|
-
0
|
|
1352
|
-
)) {
|
|
1353
|
-
return 36 /* OpenTunaSpotPositionOrca */;
|
|
1343
|
+
return 35 /* OpenTunaSpotPosition */;
|
|
1354
1344
|
}
|
|
1355
1345
|
if (containsBytes(
|
|
1356
1346
|
data,
|
|
@@ -1359,7 +1349,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1359
1349
|
),
|
|
1360
1350
|
0
|
|
1361
1351
|
)) {
|
|
1362
|
-
return
|
|
1352
|
+
return 36 /* RebalanceTunaLpPositionFusion */;
|
|
1363
1353
|
}
|
|
1364
1354
|
if (containsBytes(
|
|
1365
1355
|
data,
|
|
@@ -1368,7 +1358,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1368
1358
|
),
|
|
1369
1359
|
0
|
|
1370
1360
|
)) {
|
|
1371
|
-
return
|
|
1361
|
+
return 37 /* RebalanceTunaLpPositionOrca */;
|
|
1372
1362
|
}
|
|
1373
1363
|
if (containsBytes(
|
|
1374
1364
|
data,
|
|
@@ -1377,7 +1367,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1377
1367
|
),
|
|
1378
1368
|
0
|
|
1379
1369
|
)) {
|
|
1380
|
-
return
|
|
1370
|
+
return 38 /* RepayBadDebt */;
|
|
1381
1371
|
}
|
|
1382
1372
|
if (containsBytes(
|
|
1383
1373
|
data,
|
|
@@ -1386,7 +1376,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1386
1376
|
),
|
|
1387
1377
|
0
|
|
1388
1378
|
)) {
|
|
1389
|
-
return
|
|
1379
|
+
return 39 /* RepayTunaLpPositionDebt */;
|
|
1390
1380
|
}
|
|
1391
1381
|
if (containsBytes(
|
|
1392
1382
|
data,
|
|
@@ -1395,7 +1385,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1395
1385
|
),
|
|
1396
1386
|
0
|
|
1397
1387
|
)) {
|
|
1398
|
-
return
|
|
1388
|
+
return 40 /* ResetTunaSpotPosition */;
|
|
1399
1389
|
}
|
|
1400
1390
|
if (containsBytes(
|
|
1401
1391
|
data,
|
|
@@ -1404,7 +1394,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1404
1394
|
),
|
|
1405
1395
|
0
|
|
1406
1396
|
)) {
|
|
1407
|
-
return
|
|
1397
|
+
return 41 /* SetAdminAuthority */;
|
|
1408
1398
|
}
|
|
1409
1399
|
if (containsBytes(
|
|
1410
1400
|
data,
|
|
@@ -1413,7 +1403,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1413
1403
|
),
|
|
1414
1404
|
0
|
|
1415
1405
|
)) {
|
|
1416
|
-
return
|
|
1406
|
+
return 42 /* SetDefaultMaxPercentageOfLeftovers */;
|
|
1417
1407
|
}
|
|
1418
1408
|
if (containsBytes(
|
|
1419
1409
|
data,
|
|
@@ -1422,7 +1412,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1422
1412
|
),
|
|
1423
1413
|
0
|
|
1424
1414
|
)) {
|
|
1425
|
-
return
|
|
1415
|
+
return 43 /* SetDefaultMaxSwapSlippage */;
|
|
1426
1416
|
}
|
|
1427
1417
|
if (containsBytes(
|
|
1428
1418
|
data,
|
|
@@ -1431,7 +1421,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1431
1421
|
),
|
|
1432
1422
|
0
|
|
1433
1423
|
)) {
|
|
1434
|
-
return
|
|
1424
|
+
return 44 /* SetDefaultOraclePriceDeviationThreshold */;
|
|
1435
1425
|
}
|
|
1436
1426
|
if (containsBytes(
|
|
1437
1427
|
data,
|
|
@@ -1440,7 +1430,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1440
1430
|
),
|
|
1441
1431
|
0
|
|
1442
1432
|
)) {
|
|
1443
|
-
return
|
|
1433
|
+
return 45 /* SetFeeRecipient */;
|
|
1444
1434
|
}
|
|
1445
1435
|
if (containsBytes(
|
|
1446
1436
|
data,
|
|
@@ -1449,7 +1439,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1449
1439
|
),
|
|
1450
1440
|
0
|
|
1451
1441
|
)) {
|
|
1452
|
-
return
|
|
1442
|
+
return 46 /* SetLiquidatorAuthority */;
|
|
1453
1443
|
}
|
|
1454
1444
|
if (containsBytes(
|
|
1455
1445
|
data,
|
|
@@ -1458,7 +1448,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1458
1448
|
),
|
|
1459
1449
|
0
|
|
1460
1450
|
)) {
|
|
1461
|
-
return
|
|
1451
|
+
return 47 /* SetOwnerAuthority */;
|
|
1462
1452
|
}
|
|
1463
1453
|
if (containsBytes(
|
|
1464
1454
|
data,
|
|
@@ -1467,7 +1457,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1467
1457
|
),
|
|
1468
1458
|
0
|
|
1469
1459
|
)) {
|
|
1470
|
-
return
|
|
1460
|
+
return 48 /* SetSuspendedState */;
|
|
1471
1461
|
}
|
|
1472
1462
|
if (containsBytes(
|
|
1473
1463
|
data,
|
|
@@ -1476,7 +1466,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1476
1466
|
),
|
|
1477
1467
|
0
|
|
1478
1468
|
)) {
|
|
1479
|
-
return
|
|
1469
|
+
return 49 /* SetTunaLpPositionFlags */;
|
|
1480
1470
|
}
|
|
1481
1471
|
if (containsBytes(
|
|
1482
1472
|
data,
|
|
@@ -1485,7 +1475,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1485
1475
|
),
|
|
1486
1476
|
0
|
|
1487
1477
|
)) {
|
|
1488
|
-
return
|
|
1478
|
+
return 50 /* SetTunaLpPositionLimitOrders */;
|
|
1489
1479
|
}
|
|
1490
1480
|
if (containsBytes(
|
|
1491
1481
|
data,
|
|
@@ -1494,7 +1484,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1494
1484
|
),
|
|
1495
1485
|
0
|
|
1496
1486
|
)) {
|
|
1497
|
-
return
|
|
1487
|
+
return 51 /* SetTunaLpPositionRebalanceThreshold */;
|
|
1498
1488
|
}
|
|
1499
1489
|
if (containsBytes(
|
|
1500
1490
|
data,
|
|
@@ -1503,7 +1493,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1503
1493
|
),
|
|
1504
1494
|
0
|
|
1505
1495
|
)) {
|
|
1506
|
-
return
|
|
1496
|
+
return 52 /* SetTunaSpotPositionLimitOrders */;
|
|
1507
1497
|
}
|
|
1508
1498
|
if (containsBytes(
|
|
1509
1499
|
data,
|
|
@@ -1512,7 +1502,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1512
1502
|
),
|
|
1513
1503
|
0
|
|
1514
1504
|
)) {
|
|
1515
|
-
return
|
|
1505
|
+
return 53 /* UpdateMarket */;
|
|
1516
1506
|
}
|
|
1517
1507
|
if (containsBytes(
|
|
1518
1508
|
data,
|
|
@@ -1521,7 +1511,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1521
1511
|
),
|
|
1522
1512
|
0
|
|
1523
1513
|
)) {
|
|
1524
|
-
return
|
|
1514
|
+
return 54 /* UpdateVault */;
|
|
1525
1515
|
}
|
|
1526
1516
|
if (containsBytes(
|
|
1527
1517
|
data,
|
|
@@ -1530,7 +1520,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1530
1520
|
),
|
|
1531
1521
|
0
|
|
1532
1522
|
)) {
|
|
1533
|
-
return
|
|
1523
|
+
return 55 /* Withdraw */;
|
|
1534
1524
|
}
|
|
1535
1525
|
throw new Error(
|
|
1536
1526
|
"The provided instruction could not be identified as a tuna instruction."
|
|
@@ -1605,6 +1595,7 @@ var TUNA_ERROR__INCORRECT_SWAP_INPUT_AMOUNT = 6063;
|
|
|
1605
1595
|
var TUNA_ERROR__INSUFFICIENT_SWAP_OUTPUT_AMOUNT = 6064;
|
|
1606
1596
|
var TUNA_ERROR__ACCOUNT_NOT_INITIALIZED = 6065;
|
|
1607
1597
|
var TUNA_ERROR__INVALID_ACCOUNT_DISCRIMINATOR = 6066;
|
|
1598
|
+
var TUNA_ERROR__INVALID_POOL = 6067;
|
|
1608
1599
|
var tunaErrorMessages;
|
|
1609
1600
|
if (process.env.NODE_ENV !== "production") {
|
|
1610
1601
|
tunaErrorMessages = {
|
|
@@ -1621,6 +1612,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
1621
1612
|
[TUNA_ERROR__INVALID_INSTRUCTION_ARGUMENTS]: `Invalid instruction arguments`,
|
|
1622
1613
|
[TUNA_ERROR__INVALID_JUPITER_ROUTE]: `Invalid jupiter route data`,
|
|
1623
1614
|
[TUNA_ERROR__INVALID_MARKET_MAKER]: `Invalid market maker`,
|
|
1615
|
+
[TUNA_ERROR__INVALID_POOL]: `Invalid Fusion or Orca pool`,
|
|
1624
1616
|
[TUNA_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH]: `Invalid number of remaining accounts`,
|
|
1625
1617
|
[TUNA_ERROR__INVALID_SQRT_PRICE_LIMIT_DIRECTION]: `Provided SqrtPriceLimit not in the same direction as the swap.`,
|
|
1626
1618
|
[TUNA_ERROR__INVALID_TICK_ARRAY_SEQUENCE]: `Invalid tick array sequence provided for instruction`,
|
|
@@ -7827,7 +7819,7 @@ function parseOpenTunaLpPositionOrcaInstruction(instruction) {
|
|
|
7827
7819
|
};
|
|
7828
7820
|
}
|
|
7829
7821
|
|
|
7830
|
-
// src/generated/instructions/
|
|
7822
|
+
// src/generated/instructions/openTunaSpotPosition.ts
|
|
7831
7823
|
import {
|
|
7832
7824
|
combineCodec as combineCodec48,
|
|
7833
7825
|
fixDecoderSize as fixDecoderSize42,
|
|
@@ -7838,22 +7830,22 @@ import {
|
|
|
7838
7830
|
getStructEncoder as getStructEncoder44,
|
|
7839
7831
|
transformEncoder as transformEncoder42
|
|
7840
7832
|
} from "@solana/kit";
|
|
7841
|
-
var
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7833
|
+
var OPEN_TUNA_SPOT_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
7834
|
+
87,
|
|
7835
|
+
208,
|
|
7836
|
+
173,
|
|
7837
|
+
48,
|
|
7838
|
+
231,
|
|
7839
|
+
62,
|
|
7840
|
+
210,
|
|
7841
|
+
220
|
|
7850
7842
|
]);
|
|
7851
|
-
function
|
|
7843
|
+
function getOpenTunaSpotPositionDiscriminatorBytes() {
|
|
7852
7844
|
return fixEncoderSize43(getBytesEncoder43(), 8).encode(
|
|
7853
|
-
|
|
7845
|
+
OPEN_TUNA_SPOT_POSITION_DISCRIMINATOR
|
|
7854
7846
|
);
|
|
7855
7847
|
}
|
|
7856
|
-
function
|
|
7848
|
+
function getOpenTunaSpotPositionInstructionDataEncoder() {
|
|
7857
7849
|
return transformEncoder42(
|
|
7858
7850
|
getStructEncoder44([
|
|
7859
7851
|
["discriminator", fixEncoderSize43(getBytesEncoder43(), 8)],
|
|
@@ -7862,24 +7854,24 @@ function getOpenTunaSpotPositionFusionInstructionDataEncoder() {
|
|
|
7862
7854
|
]),
|
|
7863
7855
|
(value) => ({
|
|
7864
7856
|
...value,
|
|
7865
|
-
discriminator:
|
|
7857
|
+
discriminator: OPEN_TUNA_SPOT_POSITION_DISCRIMINATOR
|
|
7866
7858
|
})
|
|
7867
7859
|
);
|
|
7868
7860
|
}
|
|
7869
|
-
function
|
|
7861
|
+
function getOpenTunaSpotPositionInstructionDataDecoder() {
|
|
7870
7862
|
return getStructDecoder44([
|
|
7871
7863
|
["discriminator", fixDecoderSize42(getBytesDecoder42(), 8)],
|
|
7872
7864
|
["positionToken", getPoolTokenDecoder()],
|
|
7873
7865
|
["collateralToken", getPoolTokenDecoder()]
|
|
7874
7866
|
]);
|
|
7875
7867
|
}
|
|
7876
|
-
function
|
|
7868
|
+
function getOpenTunaSpotPositionInstructionDataCodec() {
|
|
7877
7869
|
return combineCodec48(
|
|
7878
|
-
|
|
7879
|
-
|
|
7870
|
+
getOpenTunaSpotPositionInstructionDataEncoder(),
|
|
7871
|
+
getOpenTunaSpotPositionInstructionDataDecoder()
|
|
7880
7872
|
);
|
|
7881
7873
|
}
|
|
7882
|
-
function
|
|
7874
|
+
function getOpenTunaSpotPositionInstruction(input, config) {
|
|
7883
7875
|
const programAddress = config?.programAddress ?? TUNA_PROGRAM_ADDRESS;
|
|
7884
7876
|
const originalAccounts = {
|
|
7885
7877
|
authority: { value: input.authority ?? null, isWritable: true },
|
|
@@ -7896,7 +7888,7 @@ function getOpenTunaSpotPositionFusionInstruction(input, config) {
|
|
|
7896
7888
|
value: input.tunaPositionAtaB ?? null,
|
|
7897
7889
|
isWritable: true
|
|
7898
7890
|
},
|
|
7899
|
-
|
|
7891
|
+
pool: { value: input.pool ?? null, isWritable: false },
|
|
7900
7892
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
7901
7893
|
associatedTokenProgram: {
|
|
7902
7894
|
value: input.associatedTokenProgram ?? null,
|
|
@@ -7919,18 +7911,18 @@ function getOpenTunaSpotPositionFusionInstruction(input, config) {
|
|
|
7919
7911
|
getAccountMeta(accounts.tunaPosition),
|
|
7920
7912
|
getAccountMeta(accounts.tunaPositionAtaA),
|
|
7921
7913
|
getAccountMeta(accounts.tunaPositionAtaB),
|
|
7922
|
-
getAccountMeta(accounts.
|
|
7914
|
+
getAccountMeta(accounts.pool),
|
|
7923
7915
|
getAccountMeta(accounts.systemProgram),
|
|
7924
7916
|
getAccountMeta(accounts.associatedTokenProgram)
|
|
7925
7917
|
],
|
|
7926
7918
|
programAddress,
|
|
7927
|
-
data:
|
|
7919
|
+
data: getOpenTunaSpotPositionInstructionDataEncoder().encode(
|
|
7928
7920
|
args
|
|
7929
7921
|
)
|
|
7930
7922
|
};
|
|
7931
7923
|
return instruction;
|
|
7932
7924
|
}
|
|
7933
|
-
function
|
|
7925
|
+
function parseOpenTunaSpotPositionInstruction(instruction) {
|
|
7934
7926
|
if (instruction.accounts.length < 11) {
|
|
7935
7927
|
throw new Error("Not enough accounts");
|
|
7936
7928
|
}
|
|
@@ -7951,17 +7943,17 @@ function parseOpenTunaSpotPositionFusionInstruction(instruction) {
|
|
|
7951
7943
|
tunaPosition: getNextAccount(),
|
|
7952
7944
|
tunaPositionAtaA: getNextAccount(),
|
|
7953
7945
|
tunaPositionAtaB: getNextAccount(),
|
|
7954
|
-
|
|
7946
|
+
pool: getNextAccount(),
|
|
7955
7947
|
systemProgram: getNextAccount(),
|
|
7956
7948
|
associatedTokenProgram: getNextAccount()
|
|
7957
7949
|
},
|
|
7958
|
-
data:
|
|
7950
|
+
data: getOpenTunaSpotPositionInstructionDataDecoder().decode(
|
|
7959
7951
|
instruction.data
|
|
7960
7952
|
)
|
|
7961
7953
|
};
|
|
7962
7954
|
}
|
|
7963
7955
|
|
|
7964
|
-
// src/generated/instructions/
|
|
7956
|
+
// src/generated/instructions/rebalanceTunaLpPositionFusion.ts
|
|
7965
7957
|
import {
|
|
7966
7958
|
combineCodec as combineCodec49,
|
|
7967
7959
|
fixDecoderSize as fixDecoderSize43,
|
|
@@ -7972,140 +7964,6 @@ import {
|
|
|
7972
7964
|
getStructEncoder as getStructEncoder45,
|
|
7973
7965
|
transformEncoder as transformEncoder43
|
|
7974
7966
|
} from "@solana/kit";
|
|
7975
|
-
var OPEN_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
7976
|
-
90,
|
|
7977
|
-
70,
|
|
7978
|
-
21,
|
|
7979
|
-
186,
|
|
7980
|
-
147,
|
|
7981
|
-
80,
|
|
7982
|
-
191,
|
|
7983
|
-
94
|
|
7984
|
-
]);
|
|
7985
|
-
function getOpenTunaSpotPositionOrcaDiscriminatorBytes() {
|
|
7986
|
-
return fixEncoderSize44(getBytesEncoder44(), 8).encode(
|
|
7987
|
-
OPEN_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR
|
|
7988
|
-
);
|
|
7989
|
-
}
|
|
7990
|
-
function getOpenTunaSpotPositionOrcaInstructionDataEncoder() {
|
|
7991
|
-
return transformEncoder43(
|
|
7992
|
-
getStructEncoder45([
|
|
7993
|
-
["discriminator", fixEncoderSize44(getBytesEncoder44(), 8)],
|
|
7994
|
-
["positionToken", getPoolTokenEncoder()],
|
|
7995
|
-
["collateralToken", getPoolTokenEncoder()]
|
|
7996
|
-
]),
|
|
7997
|
-
(value) => ({
|
|
7998
|
-
...value,
|
|
7999
|
-
discriminator: OPEN_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR
|
|
8000
|
-
})
|
|
8001
|
-
);
|
|
8002
|
-
}
|
|
8003
|
-
function getOpenTunaSpotPositionOrcaInstructionDataDecoder() {
|
|
8004
|
-
return getStructDecoder45([
|
|
8005
|
-
["discriminator", fixDecoderSize43(getBytesDecoder43(), 8)],
|
|
8006
|
-
["positionToken", getPoolTokenDecoder()],
|
|
8007
|
-
["collateralToken", getPoolTokenDecoder()]
|
|
8008
|
-
]);
|
|
8009
|
-
}
|
|
8010
|
-
function getOpenTunaSpotPositionOrcaInstructionDataCodec() {
|
|
8011
|
-
return combineCodec49(
|
|
8012
|
-
getOpenTunaSpotPositionOrcaInstructionDataEncoder(),
|
|
8013
|
-
getOpenTunaSpotPositionOrcaInstructionDataDecoder()
|
|
8014
|
-
);
|
|
8015
|
-
}
|
|
8016
|
-
function getOpenTunaSpotPositionOrcaInstruction(input, config) {
|
|
8017
|
-
const programAddress = config?.programAddress ?? TUNA_PROGRAM_ADDRESS;
|
|
8018
|
-
const originalAccounts = {
|
|
8019
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
8020
|
-
mintA: { value: input.mintA ?? null, isWritable: false },
|
|
8021
|
-
mintB: { value: input.mintB ?? null, isWritable: false },
|
|
8022
|
-
tokenProgramA: { value: input.tokenProgramA ?? null, isWritable: false },
|
|
8023
|
-
tokenProgramB: { value: input.tokenProgramB ?? null, isWritable: false },
|
|
8024
|
-
tunaPosition: { value: input.tunaPosition ?? null, isWritable: true },
|
|
8025
|
-
tunaPositionAtaA: {
|
|
8026
|
-
value: input.tunaPositionAtaA ?? null,
|
|
8027
|
-
isWritable: true
|
|
8028
|
-
},
|
|
8029
|
-
tunaPositionAtaB: {
|
|
8030
|
-
value: input.tunaPositionAtaB ?? null,
|
|
8031
|
-
isWritable: true
|
|
8032
|
-
},
|
|
8033
|
-
whirlpool: { value: input.whirlpool ?? null, isWritable: true },
|
|
8034
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
8035
|
-
associatedTokenProgram: {
|
|
8036
|
-
value: input.associatedTokenProgram ?? null,
|
|
8037
|
-
isWritable: false
|
|
8038
|
-
}
|
|
8039
|
-
};
|
|
8040
|
-
const accounts = originalAccounts;
|
|
8041
|
-
const args = { ...input };
|
|
8042
|
-
if (!accounts.systemProgram.value) {
|
|
8043
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
8044
|
-
}
|
|
8045
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
8046
|
-
const instruction = {
|
|
8047
|
-
accounts: [
|
|
8048
|
-
getAccountMeta(accounts.authority),
|
|
8049
|
-
getAccountMeta(accounts.mintA),
|
|
8050
|
-
getAccountMeta(accounts.mintB),
|
|
8051
|
-
getAccountMeta(accounts.tokenProgramA),
|
|
8052
|
-
getAccountMeta(accounts.tokenProgramB),
|
|
8053
|
-
getAccountMeta(accounts.tunaPosition),
|
|
8054
|
-
getAccountMeta(accounts.tunaPositionAtaA),
|
|
8055
|
-
getAccountMeta(accounts.tunaPositionAtaB),
|
|
8056
|
-
getAccountMeta(accounts.whirlpool),
|
|
8057
|
-
getAccountMeta(accounts.systemProgram),
|
|
8058
|
-
getAccountMeta(accounts.associatedTokenProgram)
|
|
8059
|
-
],
|
|
8060
|
-
programAddress,
|
|
8061
|
-
data: getOpenTunaSpotPositionOrcaInstructionDataEncoder().encode(
|
|
8062
|
-
args
|
|
8063
|
-
)
|
|
8064
|
-
};
|
|
8065
|
-
return instruction;
|
|
8066
|
-
}
|
|
8067
|
-
function parseOpenTunaSpotPositionOrcaInstruction(instruction) {
|
|
8068
|
-
if (instruction.accounts.length < 11) {
|
|
8069
|
-
throw new Error("Not enough accounts");
|
|
8070
|
-
}
|
|
8071
|
-
let accountIndex = 0;
|
|
8072
|
-
const getNextAccount = () => {
|
|
8073
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
8074
|
-
accountIndex += 1;
|
|
8075
|
-
return accountMeta;
|
|
8076
|
-
};
|
|
8077
|
-
return {
|
|
8078
|
-
programAddress: instruction.programAddress,
|
|
8079
|
-
accounts: {
|
|
8080
|
-
authority: getNextAccount(),
|
|
8081
|
-
mintA: getNextAccount(),
|
|
8082
|
-
mintB: getNextAccount(),
|
|
8083
|
-
tokenProgramA: getNextAccount(),
|
|
8084
|
-
tokenProgramB: getNextAccount(),
|
|
8085
|
-
tunaPosition: getNextAccount(),
|
|
8086
|
-
tunaPositionAtaA: getNextAccount(),
|
|
8087
|
-
tunaPositionAtaB: getNextAccount(),
|
|
8088
|
-
whirlpool: getNextAccount(),
|
|
8089
|
-
systemProgram: getNextAccount(),
|
|
8090
|
-
associatedTokenProgram: getNextAccount()
|
|
8091
|
-
},
|
|
8092
|
-
data: getOpenTunaSpotPositionOrcaInstructionDataDecoder().decode(
|
|
8093
|
-
instruction.data
|
|
8094
|
-
)
|
|
8095
|
-
};
|
|
8096
|
-
}
|
|
8097
|
-
|
|
8098
|
-
// src/generated/instructions/rebalanceTunaLpPositionFusion.ts
|
|
8099
|
-
import {
|
|
8100
|
-
combineCodec as combineCodec50,
|
|
8101
|
-
fixDecoderSize as fixDecoderSize44,
|
|
8102
|
-
fixEncoderSize as fixEncoderSize45,
|
|
8103
|
-
getBytesDecoder as getBytesDecoder44,
|
|
8104
|
-
getBytesEncoder as getBytesEncoder45,
|
|
8105
|
-
getStructDecoder as getStructDecoder46,
|
|
8106
|
-
getStructEncoder as getStructEncoder46,
|
|
8107
|
-
transformEncoder as transformEncoder44
|
|
8108
|
-
} from "@solana/kit";
|
|
8109
7967
|
var REBALANCE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([
|
|
8110
7968
|
190,
|
|
8111
7969
|
86,
|
|
@@ -8117,14 +7975,14 @@ var REBALANCE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([
|
|
|
8117
7975
|
51
|
|
8118
7976
|
]);
|
|
8119
7977
|
function getRebalanceTunaLpPositionFusionDiscriminatorBytes() {
|
|
8120
|
-
return
|
|
7978
|
+
return fixEncoderSize44(getBytesEncoder44(), 8).encode(
|
|
8121
7979
|
REBALANCE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR
|
|
8122
7980
|
);
|
|
8123
7981
|
}
|
|
8124
7982
|
function getRebalanceTunaLpPositionFusionInstructionDataEncoder() {
|
|
8125
|
-
return
|
|
8126
|
-
|
|
8127
|
-
["discriminator",
|
|
7983
|
+
return transformEncoder43(
|
|
7984
|
+
getStructEncoder45([
|
|
7985
|
+
["discriminator", fixEncoderSize44(getBytesEncoder44(), 8)],
|
|
8128
7986
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
8129
7987
|
]),
|
|
8130
7988
|
(value) => ({
|
|
@@ -8134,13 +7992,13 @@ function getRebalanceTunaLpPositionFusionInstructionDataEncoder() {
|
|
|
8134
7992
|
);
|
|
8135
7993
|
}
|
|
8136
7994
|
function getRebalanceTunaLpPositionFusionInstructionDataDecoder() {
|
|
8137
|
-
return
|
|
8138
|
-
["discriminator",
|
|
7995
|
+
return getStructDecoder45([
|
|
7996
|
+
["discriminator", fixDecoderSize43(getBytesDecoder43(), 8)],
|
|
8139
7997
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
8140
7998
|
]);
|
|
8141
7999
|
}
|
|
8142
8000
|
function getRebalanceTunaLpPositionFusionInstructionDataCodec() {
|
|
8143
|
-
return
|
|
8001
|
+
return combineCodec49(
|
|
8144
8002
|
getRebalanceTunaLpPositionFusionInstructionDataEncoder(),
|
|
8145
8003
|
getRebalanceTunaLpPositionFusionInstructionDataDecoder()
|
|
8146
8004
|
);
|
|
@@ -8268,14 +8126,14 @@ function parseRebalanceTunaLpPositionFusionInstruction(instruction) {
|
|
|
8268
8126
|
|
|
8269
8127
|
// src/generated/instructions/rebalanceTunaLpPositionOrca.ts
|
|
8270
8128
|
import {
|
|
8271
|
-
combineCodec as
|
|
8272
|
-
fixDecoderSize as
|
|
8273
|
-
fixEncoderSize as
|
|
8274
|
-
getBytesDecoder as
|
|
8275
|
-
getBytesEncoder as
|
|
8276
|
-
getStructDecoder as
|
|
8277
|
-
getStructEncoder as
|
|
8278
|
-
transformEncoder as
|
|
8129
|
+
combineCodec as combineCodec50,
|
|
8130
|
+
fixDecoderSize as fixDecoderSize44,
|
|
8131
|
+
fixEncoderSize as fixEncoderSize45,
|
|
8132
|
+
getBytesDecoder as getBytesDecoder44,
|
|
8133
|
+
getBytesEncoder as getBytesEncoder45,
|
|
8134
|
+
getStructDecoder as getStructDecoder46,
|
|
8135
|
+
getStructEncoder as getStructEncoder46,
|
|
8136
|
+
transformEncoder as transformEncoder44
|
|
8279
8137
|
} from "@solana/kit";
|
|
8280
8138
|
var REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
8281
8139
|
124,
|
|
@@ -8288,14 +8146,14 @@ var REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
|
8288
8146
|
231
|
|
8289
8147
|
]);
|
|
8290
8148
|
function getRebalanceTunaLpPositionOrcaDiscriminatorBytes() {
|
|
8291
|
-
return
|
|
8149
|
+
return fixEncoderSize45(getBytesEncoder45(), 8).encode(
|
|
8292
8150
|
REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR
|
|
8293
8151
|
);
|
|
8294
8152
|
}
|
|
8295
8153
|
function getRebalanceTunaLpPositionOrcaInstructionDataEncoder() {
|
|
8296
|
-
return
|
|
8297
|
-
|
|
8298
|
-
["discriminator",
|
|
8154
|
+
return transformEncoder44(
|
|
8155
|
+
getStructEncoder46([
|
|
8156
|
+
["discriminator", fixEncoderSize45(getBytesEncoder45(), 8)],
|
|
8299
8157
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
8300
8158
|
]),
|
|
8301
8159
|
(value) => ({
|
|
@@ -8305,13 +8163,13 @@ function getRebalanceTunaLpPositionOrcaInstructionDataEncoder() {
|
|
|
8305
8163
|
);
|
|
8306
8164
|
}
|
|
8307
8165
|
function getRebalanceTunaLpPositionOrcaInstructionDataDecoder() {
|
|
8308
|
-
return
|
|
8309
|
-
["discriminator",
|
|
8166
|
+
return getStructDecoder46([
|
|
8167
|
+
["discriminator", fixDecoderSize44(getBytesDecoder44(), 8)],
|
|
8310
8168
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
8311
8169
|
]);
|
|
8312
8170
|
}
|
|
8313
8171
|
function getRebalanceTunaLpPositionOrcaInstructionDataCodec() {
|
|
8314
|
-
return
|
|
8172
|
+
return combineCodec50(
|
|
8315
8173
|
getRebalanceTunaLpPositionOrcaInstructionDataEncoder(),
|
|
8316
8174
|
getRebalanceTunaLpPositionOrcaInstructionDataDecoder()
|
|
8317
8175
|
);
|
|
@@ -8445,16 +8303,16 @@ function parseRebalanceTunaLpPositionOrcaInstruction(instruction) {
|
|
|
8445
8303
|
|
|
8446
8304
|
// src/generated/instructions/repayBadDebt.ts
|
|
8447
8305
|
import {
|
|
8448
|
-
combineCodec as
|
|
8449
|
-
fixDecoderSize as
|
|
8450
|
-
fixEncoderSize as
|
|
8451
|
-
getBytesDecoder as
|
|
8452
|
-
getBytesEncoder as
|
|
8453
|
-
getStructDecoder as
|
|
8454
|
-
getStructEncoder as
|
|
8306
|
+
combineCodec as combineCodec51,
|
|
8307
|
+
fixDecoderSize as fixDecoderSize45,
|
|
8308
|
+
fixEncoderSize as fixEncoderSize46,
|
|
8309
|
+
getBytesDecoder as getBytesDecoder45,
|
|
8310
|
+
getBytesEncoder as getBytesEncoder46,
|
|
8311
|
+
getStructDecoder as getStructDecoder47,
|
|
8312
|
+
getStructEncoder as getStructEncoder47,
|
|
8455
8313
|
getU64Decoder as getU64Decoder24,
|
|
8456
8314
|
getU64Encoder as getU64Encoder24,
|
|
8457
|
-
transformEncoder as
|
|
8315
|
+
transformEncoder as transformEncoder45
|
|
8458
8316
|
} from "@solana/kit";
|
|
8459
8317
|
var REPAY_BAD_DEBT_DISCRIMINATOR = new Uint8Array([
|
|
8460
8318
|
112,
|
|
@@ -8467,14 +8325,14 @@ var REPAY_BAD_DEBT_DISCRIMINATOR = new Uint8Array([
|
|
|
8467
8325
|
34
|
|
8468
8326
|
]);
|
|
8469
8327
|
function getRepayBadDebtDiscriminatorBytes() {
|
|
8470
|
-
return
|
|
8328
|
+
return fixEncoderSize46(getBytesEncoder46(), 8).encode(
|
|
8471
8329
|
REPAY_BAD_DEBT_DISCRIMINATOR
|
|
8472
8330
|
);
|
|
8473
8331
|
}
|
|
8474
8332
|
function getRepayBadDebtInstructionDataEncoder() {
|
|
8475
|
-
return
|
|
8476
|
-
|
|
8477
|
-
["discriminator",
|
|
8333
|
+
return transformEncoder45(
|
|
8334
|
+
getStructEncoder47([
|
|
8335
|
+
["discriminator", fixEncoderSize46(getBytesEncoder46(), 8)],
|
|
8478
8336
|
["funds", getU64Encoder24()],
|
|
8479
8337
|
["shares", getU64Encoder24()]
|
|
8480
8338
|
]),
|
|
@@ -8482,14 +8340,14 @@ function getRepayBadDebtInstructionDataEncoder() {
|
|
|
8482
8340
|
);
|
|
8483
8341
|
}
|
|
8484
8342
|
function getRepayBadDebtInstructionDataDecoder() {
|
|
8485
|
-
return
|
|
8486
|
-
["discriminator",
|
|
8343
|
+
return getStructDecoder47([
|
|
8344
|
+
["discriminator", fixDecoderSize45(getBytesDecoder45(), 8)],
|
|
8487
8345
|
["funds", getU64Decoder24()],
|
|
8488
8346
|
["shares", getU64Decoder24()]
|
|
8489
8347
|
]);
|
|
8490
8348
|
}
|
|
8491
8349
|
function getRepayBadDebtInstructionDataCodec() {
|
|
8492
|
-
return
|
|
8350
|
+
return combineCodec51(
|
|
8493
8351
|
getRepayBadDebtInstructionDataEncoder(),
|
|
8494
8352
|
getRepayBadDebtInstructionDataDecoder()
|
|
8495
8353
|
);
|
|
@@ -8558,16 +8416,16 @@ function parseRepayBadDebtInstruction(instruction) {
|
|
|
8558
8416
|
|
|
8559
8417
|
// src/generated/instructions/repayTunaLpPositionDebt.ts
|
|
8560
8418
|
import {
|
|
8561
|
-
combineCodec as
|
|
8562
|
-
fixDecoderSize as
|
|
8563
|
-
fixEncoderSize as
|
|
8564
|
-
getBytesDecoder as
|
|
8565
|
-
getBytesEncoder as
|
|
8566
|
-
getStructDecoder as
|
|
8567
|
-
getStructEncoder as
|
|
8419
|
+
combineCodec as combineCodec52,
|
|
8420
|
+
fixDecoderSize as fixDecoderSize46,
|
|
8421
|
+
fixEncoderSize as fixEncoderSize47,
|
|
8422
|
+
getBytesDecoder as getBytesDecoder46,
|
|
8423
|
+
getBytesEncoder as getBytesEncoder47,
|
|
8424
|
+
getStructDecoder as getStructDecoder48,
|
|
8425
|
+
getStructEncoder as getStructEncoder48,
|
|
8568
8426
|
getU64Decoder as getU64Decoder25,
|
|
8569
8427
|
getU64Encoder as getU64Encoder25,
|
|
8570
|
-
transformEncoder as
|
|
8428
|
+
transformEncoder as transformEncoder46
|
|
8571
8429
|
} from "@solana/kit";
|
|
8572
8430
|
var REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR = new Uint8Array([
|
|
8573
8431
|
79,
|
|
@@ -8580,14 +8438,14 @@ var REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR = new Uint8Array([
|
|
|
8580
8438
|
8
|
|
8581
8439
|
]);
|
|
8582
8440
|
function getRepayTunaLpPositionDebtDiscriminatorBytes() {
|
|
8583
|
-
return
|
|
8441
|
+
return fixEncoderSize47(getBytesEncoder47(), 8).encode(
|
|
8584
8442
|
REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR
|
|
8585
8443
|
);
|
|
8586
8444
|
}
|
|
8587
8445
|
function getRepayTunaLpPositionDebtInstructionDataEncoder() {
|
|
8588
|
-
return
|
|
8589
|
-
|
|
8590
|
-
["discriminator",
|
|
8446
|
+
return transformEncoder46(
|
|
8447
|
+
getStructEncoder48([
|
|
8448
|
+
["discriminator", fixEncoderSize47(getBytesEncoder47(), 8)],
|
|
8591
8449
|
["collateralFundsA", getU64Encoder25()],
|
|
8592
8450
|
["collateralFundsB", getU64Encoder25()]
|
|
8593
8451
|
]),
|
|
@@ -8598,14 +8456,14 @@ function getRepayTunaLpPositionDebtInstructionDataEncoder() {
|
|
|
8598
8456
|
);
|
|
8599
8457
|
}
|
|
8600
8458
|
function getRepayTunaLpPositionDebtInstructionDataDecoder() {
|
|
8601
|
-
return
|
|
8602
|
-
["discriminator",
|
|
8459
|
+
return getStructDecoder48([
|
|
8460
|
+
["discriminator", fixDecoderSize46(getBytesDecoder46(), 8)],
|
|
8603
8461
|
["collateralFundsA", getU64Decoder25()],
|
|
8604
8462
|
["collateralFundsB", getU64Decoder25()]
|
|
8605
8463
|
]);
|
|
8606
8464
|
}
|
|
8607
8465
|
function getRepayTunaLpPositionDebtInstructionDataCodec() {
|
|
8608
|
-
return
|
|
8466
|
+
return combineCodec52(
|
|
8609
8467
|
getRepayTunaLpPositionDebtInstructionDataEncoder(),
|
|
8610
8468
|
getRepayTunaLpPositionDebtInstructionDataDecoder()
|
|
8611
8469
|
);
|
|
@@ -8709,14 +8567,14 @@ function parseRepayTunaLpPositionDebtInstruction(instruction) {
|
|
|
8709
8567
|
|
|
8710
8568
|
// src/generated/instructions/resetTunaSpotPosition.ts
|
|
8711
8569
|
import {
|
|
8712
|
-
combineCodec as
|
|
8713
|
-
fixDecoderSize as
|
|
8714
|
-
fixEncoderSize as
|
|
8715
|
-
getBytesDecoder as
|
|
8716
|
-
getBytesEncoder as
|
|
8717
|
-
getStructDecoder as
|
|
8718
|
-
getStructEncoder as
|
|
8719
|
-
transformEncoder as
|
|
8570
|
+
combineCodec as combineCodec53,
|
|
8571
|
+
fixDecoderSize as fixDecoderSize47,
|
|
8572
|
+
fixEncoderSize as fixEncoderSize48,
|
|
8573
|
+
getBytesDecoder as getBytesDecoder47,
|
|
8574
|
+
getBytesEncoder as getBytesEncoder48,
|
|
8575
|
+
getStructDecoder as getStructDecoder49,
|
|
8576
|
+
getStructEncoder as getStructEncoder49,
|
|
8577
|
+
transformEncoder as transformEncoder47
|
|
8720
8578
|
} from "@solana/kit";
|
|
8721
8579
|
var RESET_TUNA_SPOT_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
8722
8580
|
194,
|
|
@@ -8729,14 +8587,14 @@ var RESET_TUNA_SPOT_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
|
8729
8587
|
127
|
|
8730
8588
|
]);
|
|
8731
8589
|
function getResetTunaSpotPositionDiscriminatorBytes() {
|
|
8732
|
-
return
|
|
8590
|
+
return fixEncoderSize48(getBytesEncoder48(), 8).encode(
|
|
8733
8591
|
RESET_TUNA_SPOT_POSITION_DISCRIMINATOR
|
|
8734
8592
|
);
|
|
8735
8593
|
}
|
|
8736
8594
|
function getResetTunaSpotPositionInstructionDataEncoder() {
|
|
8737
|
-
return
|
|
8738
|
-
|
|
8739
|
-
["discriminator",
|
|
8595
|
+
return transformEncoder47(
|
|
8596
|
+
getStructEncoder49([
|
|
8597
|
+
["discriminator", fixEncoderSize48(getBytesEncoder48(), 8)],
|
|
8740
8598
|
["positionToken", getPoolTokenEncoder()],
|
|
8741
8599
|
["collateralToken", getPoolTokenEncoder()]
|
|
8742
8600
|
]),
|
|
@@ -8747,14 +8605,14 @@ function getResetTunaSpotPositionInstructionDataEncoder() {
|
|
|
8747
8605
|
);
|
|
8748
8606
|
}
|
|
8749
8607
|
function getResetTunaSpotPositionInstructionDataDecoder() {
|
|
8750
|
-
return
|
|
8751
|
-
["discriminator",
|
|
8608
|
+
return getStructDecoder49([
|
|
8609
|
+
["discriminator", fixDecoderSize47(getBytesDecoder47(), 8)],
|
|
8752
8610
|
["positionToken", getPoolTokenDecoder()],
|
|
8753
8611
|
["collateralToken", getPoolTokenDecoder()]
|
|
8754
8612
|
]);
|
|
8755
8613
|
}
|
|
8756
8614
|
function getResetTunaSpotPositionInstructionDataCodec() {
|
|
8757
|
-
return
|
|
8615
|
+
return combineCodec53(
|
|
8758
8616
|
getResetTunaSpotPositionInstructionDataEncoder(),
|
|
8759
8617
|
getResetTunaSpotPositionInstructionDataDecoder()
|
|
8760
8618
|
);
|
|
@@ -8822,16 +8680,16 @@ function parseResetTunaSpotPositionInstruction(instruction) {
|
|
|
8822
8680
|
|
|
8823
8681
|
// src/generated/instructions/setAdminAuthority.ts
|
|
8824
8682
|
import {
|
|
8825
|
-
combineCodec as
|
|
8826
|
-
fixDecoderSize as
|
|
8827
|
-
fixEncoderSize as
|
|
8683
|
+
combineCodec as combineCodec54,
|
|
8684
|
+
fixDecoderSize as fixDecoderSize48,
|
|
8685
|
+
fixEncoderSize as fixEncoderSize49,
|
|
8828
8686
|
getAddressDecoder as getAddressDecoder10,
|
|
8829
8687
|
getAddressEncoder as getAddressEncoder10,
|
|
8830
|
-
getBytesDecoder as
|
|
8831
|
-
getBytesEncoder as
|
|
8832
|
-
getStructDecoder as
|
|
8833
|
-
getStructEncoder as
|
|
8834
|
-
transformEncoder as
|
|
8688
|
+
getBytesDecoder as getBytesDecoder48,
|
|
8689
|
+
getBytesEncoder as getBytesEncoder49,
|
|
8690
|
+
getStructDecoder as getStructDecoder50,
|
|
8691
|
+
getStructEncoder as getStructEncoder50,
|
|
8692
|
+
transformEncoder as transformEncoder48
|
|
8835
8693
|
} from "@solana/kit";
|
|
8836
8694
|
var SET_ADMIN_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
8837
8695
|
72,
|
|
@@ -8844,27 +8702,27 @@ var SET_ADMIN_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
8844
8702
|
174
|
|
8845
8703
|
]);
|
|
8846
8704
|
function getSetAdminAuthorityDiscriminatorBytes() {
|
|
8847
|
-
return
|
|
8705
|
+
return fixEncoderSize49(getBytesEncoder49(), 8).encode(
|
|
8848
8706
|
SET_ADMIN_AUTHORITY_DISCRIMINATOR
|
|
8849
8707
|
);
|
|
8850
8708
|
}
|
|
8851
8709
|
function getSetAdminAuthorityInstructionDataEncoder() {
|
|
8852
|
-
return
|
|
8853
|
-
|
|
8854
|
-
["discriminator",
|
|
8710
|
+
return transformEncoder48(
|
|
8711
|
+
getStructEncoder50([
|
|
8712
|
+
["discriminator", fixEncoderSize49(getBytesEncoder49(), 8)],
|
|
8855
8713
|
["adminAuthority", getAddressEncoder10()]
|
|
8856
8714
|
]),
|
|
8857
8715
|
(value) => ({ ...value, discriminator: SET_ADMIN_AUTHORITY_DISCRIMINATOR })
|
|
8858
8716
|
);
|
|
8859
8717
|
}
|
|
8860
8718
|
function getSetAdminAuthorityInstructionDataDecoder() {
|
|
8861
|
-
return
|
|
8862
|
-
["discriminator",
|
|
8719
|
+
return getStructDecoder50([
|
|
8720
|
+
["discriminator", fixDecoderSize48(getBytesDecoder48(), 8)],
|
|
8863
8721
|
["adminAuthority", getAddressDecoder10()]
|
|
8864
8722
|
]);
|
|
8865
8723
|
}
|
|
8866
8724
|
function getSetAdminAuthorityInstructionDataCodec() {
|
|
8867
|
-
return
|
|
8725
|
+
return combineCodec54(
|
|
8868
8726
|
getSetAdminAuthorityInstructionDataEncoder(),
|
|
8869
8727
|
getSetAdminAuthorityInstructionDataDecoder()
|
|
8870
8728
|
);
|
|
@@ -8912,27 +8770,27 @@ function parseSetAdminAuthorityInstruction(instruction) {
|
|
|
8912
8770
|
|
|
8913
8771
|
// src/generated/instructions/setDefaultMaxPercentageOfLeftovers.ts
|
|
8914
8772
|
import {
|
|
8915
|
-
combineCodec as
|
|
8916
|
-
fixDecoderSize as
|
|
8917
|
-
fixEncoderSize as
|
|
8918
|
-
getBytesDecoder as
|
|
8919
|
-
getBytesEncoder as
|
|
8920
|
-
getStructDecoder as
|
|
8921
|
-
getStructEncoder as
|
|
8773
|
+
combineCodec as combineCodec55,
|
|
8774
|
+
fixDecoderSize as fixDecoderSize49,
|
|
8775
|
+
fixEncoderSize as fixEncoderSize50,
|
|
8776
|
+
getBytesDecoder as getBytesDecoder49,
|
|
8777
|
+
getBytesEncoder as getBytesEncoder50,
|
|
8778
|
+
getStructDecoder as getStructDecoder51,
|
|
8779
|
+
getStructEncoder as getStructEncoder51,
|
|
8922
8780
|
getU32Decoder as getU32Decoder22,
|
|
8923
8781
|
getU32Encoder as getU32Encoder22,
|
|
8924
|
-
transformEncoder as
|
|
8782
|
+
transformEncoder as transformEncoder49
|
|
8925
8783
|
} from "@solana/kit";
|
|
8926
8784
|
var SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR = new Uint8Array([37, 179, 107, 65, 203, 141, 183, 27]);
|
|
8927
8785
|
function getSetDefaultMaxPercentageOfLeftoversDiscriminatorBytes() {
|
|
8928
|
-
return
|
|
8786
|
+
return fixEncoderSize50(getBytesEncoder50(), 8).encode(
|
|
8929
8787
|
SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR
|
|
8930
8788
|
);
|
|
8931
8789
|
}
|
|
8932
8790
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder() {
|
|
8933
|
-
return
|
|
8934
|
-
|
|
8935
|
-
["discriminator",
|
|
8791
|
+
return transformEncoder49(
|
|
8792
|
+
getStructEncoder51([
|
|
8793
|
+
["discriminator", fixEncoderSize50(getBytesEncoder50(), 8)],
|
|
8936
8794
|
["maxPercentageOfLeftovers", getU32Encoder22()]
|
|
8937
8795
|
]),
|
|
8938
8796
|
(value) => ({
|
|
@@ -8942,13 +8800,13 @@ function getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder() {
|
|
|
8942
8800
|
);
|
|
8943
8801
|
}
|
|
8944
8802
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder() {
|
|
8945
|
-
return
|
|
8946
|
-
["discriminator",
|
|
8803
|
+
return getStructDecoder51([
|
|
8804
|
+
["discriminator", fixDecoderSize49(getBytesDecoder49(), 8)],
|
|
8947
8805
|
["maxPercentageOfLeftovers", getU32Decoder22()]
|
|
8948
8806
|
]);
|
|
8949
8807
|
}
|
|
8950
8808
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataCodec() {
|
|
8951
|
-
return
|
|
8809
|
+
return combineCodec55(
|
|
8952
8810
|
getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder(),
|
|
8953
8811
|
getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder()
|
|
8954
8812
|
);
|
|
@@ -8998,16 +8856,16 @@ function parseSetDefaultMaxPercentageOfLeftoversInstruction(instruction) {
|
|
|
8998
8856
|
|
|
8999
8857
|
// src/generated/instructions/setDefaultMaxSwapSlippage.ts
|
|
9000
8858
|
import {
|
|
9001
|
-
combineCodec as
|
|
9002
|
-
fixDecoderSize as
|
|
9003
|
-
fixEncoderSize as
|
|
9004
|
-
getBytesDecoder as
|
|
9005
|
-
getBytesEncoder as
|
|
9006
|
-
getStructDecoder as
|
|
9007
|
-
getStructEncoder as
|
|
8859
|
+
combineCodec as combineCodec56,
|
|
8860
|
+
fixDecoderSize as fixDecoderSize50,
|
|
8861
|
+
fixEncoderSize as fixEncoderSize51,
|
|
8862
|
+
getBytesDecoder as getBytesDecoder50,
|
|
8863
|
+
getBytesEncoder as getBytesEncoder51,
|
|
8864
|
+
getStructDecoder as getStructDecoder52,
|
|
8865
|
+
getStructEncoder as getStructEncoder52,
|
|
9008
8866
|
getU32Decoder as getU32Decoder23,
|
|
9009
8867
|
getU32Encoder as getU32Encoder23,
|
|
9010
|
-
transformEncoder as
|
|
8868
|
+
transformEncoder as transformEncoder50
|
|
9011
8869
|
} from "@solana/kit";
|
|
9012
8870
|
var SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR = new Uint8Array([
|
|
9013
8871
|
122,
|
|
@@ -9020,14 +8878,14 @@ var SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR = new Uint8Array([
|
|
|
9020
8878
|
181
|
|
9021
8879
|
]);
|
|
9022
8880
|
function getSetDefaultMaxSwapSlippageDiscriminatorBytes() {
|
|
9023
|
-
return
|
|
8881
|
+
return fixEncoderSize51(getBytesEncoder51(), 8).encode(
|
|
9024
8882
|
SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR
|
|
9025
8883
|
);
|
|
9026
8884
|
}
|
|
9027
8885
|
function getSetDefaultMaxSwapSlippageInstructionDataEncoder() {
|
|
9028
|
-
return
|
|
9029
|
-
|
|
9030
|
-
["discriminator",
|
|
8886
|
+
return transformEncoder50(
|
|
8887
|
+
getStructEncoder52([
|
|
8888
|
+
["discriminator", fixEncoderSize51(getBytesEncoder51(), 8)],
|
|
9031
8889
|
["maxSwapSlippage", getU32Encoder23()]
|
|
9032
8890
|
]),
|
|
9033
8891
|
(value) => ({
|
|
@@ -9037,13 +8895,13 @@ function getSetDefaultMaxSwapSlippageInstructionDataEncoder() {
|
|
|
9037
8895
|
);
|
|
9038
8896
|
}
|
|
9039
8897
|
function getSetDefaultMaxSwapSlippageInstructionDataDecoder() {
|
|
9040
|
-
return
|
|
9041
|
-
["discriminator",
|
|
8898
|
+
return getStructDecoder52([
|
|
8899
|
+
["discriminator", fixDecoderSize50(getBytesDecoder50(), 8)],
|
|
9042
8900
|
["maxSwapSlippage", getU32Decoder23()]
|
|
9043
8901
|
]);
|
|
9044
8902
|
}
|
|
9045
8903
|
function getSetDefaultMaxSwapSlippageInstructionDataCodec() {
|
|
9046
|
-
return
|
|
8904
|
+
return combineCodec56(
|
|
9047
8905
|
getSetDefaultMaxSwapSlippageInstructionDataEncoder(),
|
|
9048
8906
|
getSetDefaultMaxSwapSlippageInstructionDataDecoder()
|
|
9049
8907
|
);
|
|
@@ -9093,27 +8951,27 @@ function parseSetDefaultMaxSwapSlippageInstruction(instruction) {
|
|
|
9093
8951
|
|
|
9094
8952
|
// src/generated/instructions/setDefaultOraclePriceDeviationThreshold.ts
|
|
9095
8953
|
import {
|
|
9096
|
-
combineCodec as
|
|
9097
|
-
fixDecoderSize as
|
|
9098
|
-
fixEncoderSize as
|
|
9099
|
-
getBytesDecoder as
|
|
9100
|
-
getBytesEncoder as
|
|
9101
|
-
getStructDecoder as
|
|
9102
|
-
getStructEncoder as
|
|
8954
|
+
combineCodec as combineCodec57,
|
|
8955
|
+
fixDecoderSize as fixDecoderSize51,
|
|
8956
|
+
fixEncoderSize as fixEncoderSize52,
|
|
8957
|
+
getBytesDecoder as getBytesDecoder51,
|
|
8958
|
+
getBytesEncoder as getBytesEncoder52,
|
|
8959
|
+
getStructDecoder as getStructDecoder53,
|
|
8960
|
+
getStructEncoder as getStructEncoder53,
|
|
9103
8961
|
getU32Decoder as getU32Decoder24,
|
|
9104
8962
|
getU32Encoder as getU32Encoder24,
|
|
9105
|
-
transformEncoder as
|
|
8963
|
+
transformEncoder as transformEncoder51
|
|
9106
8964
|
} from "@solana/kit";
|
|
9107
8965
|
var SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR = new Uint8Array([142, 158, 143, 67, 206, 91, 139, 120]);
|
|
9108
8966
|
function getSetDefaultOraclePriceDeviationThresholdDiscriminatorBytes() {
|
|
9109
|
-
return
|
|
8967
|
+
return fixEncoderSize52(getBytesEncoder52(), 8).encode(
|
|
9110
8968
|
SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR
|
|
9111
8969
|
);
|
|
9112
8970
|
}
|
|
9113
8971
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder() {
|
|
9114
|
-
return
|
|
9115
|
-
|
|
9116
|
-
["discriminator",
|
|
8972
|
+
return transformEncoder51(
|
|
8973
|
+
getStructEncoder53([
|
|
8974
|
+
["discriminator", fixEncoderSize52(getBytesEncoder52(), 8)],
|
|
9117
8975
|
["oraclePriceDeviationThreshold", getU32Encoder24()]
|
|
9118
8976
|
]),
|
|
9119
8977
|
(value) => ({
|
|
@@ -9123,13 +8981,13 @@ function getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder() {
|
|
|
9123
8981
|
);
|
|
9124
8982
|
}
|
|
9125
8983
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder() {
|
|
9126
|
-
return
|
|
9127
|
-
["discriminator",
|
|
8984
|
+
return getStructDecoder53([
|
|
8985
|
+
["discriminator", fixDecoderSize51(getBytesDecoder51(), 8)],
|
|
9128
8986
|
["oraclePriceDeviationThreshold", getU32Decoder24()]
|
|
9129
8987
|
]);
|
|
9130
8988
|
}
|
|
9131
8989
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataCodec() {
|
|
9132
|
-
return
|
|
8990
|
+
return combineCodec57(
|
|
9133
8991
|
getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder(),
|
|
9134
8992
|
getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder()
|
|
9135
8993
|
);
|
|
@@ -9179,16 +9037,16 @@ function parseSetDefaultOraclePriceDeviationThresholdInstruction(instruction) {
|
|
|
9179
9037
|
|
|
9180
9038
|
// src/generated/instructions/setFeeRecipient.ts
|
|
9181
9039
|
import {
|
|
9182
|
-
combineCodec as
|
|
9183
|
-
fixDecoderSize as
|
|
9184
|
-
fixEncoderSize as
|
|
9040
|
+
combineCodec as combineCodec58,
|
|
9041
|
+
fixDecoderSize as fixDecoderSize52,
|
|
9042
|
+
fixEncoderSize as fixEncoderSize53,
|
|
9185
9043
|
getAddressDecoder as getAddressDecoder11,
|
|
9186
9044
|
getAddressEncoder as getAddressEncoder11,
|
|
9187
|
-
getBytesDecoder as
|
|
9188
|
-
getBytesEncoder as
|
|
9189
|
-
getStructDecoder as
|
|
9190
|
-
getStructEncoder as
|
|
9191
|
-
transformEncoder as
|
|
9045
|
+
getBytesDecoder as getBytesDecoder52,
|
|
9046
|
+
getBytesEncoder as getBytesEncoder53,
|
|
9047
|
+
getStructDecoder as getStructDecoder54,
|
|
9048
|
+
getStructEncoder as getStructEncoder54,
|
|
9049
|
+
transformEncoder as transformEncoder52
|
|
9192
9050
|
} from "@solana/kit";
|
|
9193
9051
|
var SET_FEE_RECIPIENT_DISCRIMINATOR = new Uint8Array([
|
|
9194
9052
|
227,
|
|
@@ -9201,27 +9059,27 @@ var SET_FEE_RECIPIENT_DISCRIMINATOR = new Uint8Array([
|
|
|
9201
9059
|
66
|
|
9202
9060
|
]);
|
|
9203
9061
|
function getSetFeeRecipientDiscriminatorBytes() {
|
|
9204
|
-
return
|
|
9062
|
+
return fixEncoderSize53(getBytesEncoder53(), 8).encode(
|
|
9205
9063
|
SET_FEE_RECIPIENT_DISCRIMINATOR
|
|
9206
9064
|
);
|
|
9207
9065
|
}
|
|
9208
9066
|
function getSetFeeRecipientInstructionDataEncoder() {
|
|
9209
|
-
return
|
|
9210
|
-
|
|
9211
|
-
["discriminator",
|
|
9067
|
+
return transformEncoder52(
|
|
9068
|
+
getStructEncoder54([
|
|
9069
|
+
["discriminator", fixEncoderSize53(getBytesEncoder53(), 8)],
|
|
9212
9070
|
["feeRecipient", getAddressEncoder11()]
|
|
9213
9071
|
]),
|
|
9214
9072
|
(value) => ({ ...value, discriminator: SET_FEE_RECIPIENT_DISCRIMINATOR })
|
|
9215
9073
|
);
|
|
9216
9074
|
}
|
|
9217
9075
|
function getSetFeeRecipientInstructionDataDecoder() {
|
|
9218
|
-
return
|
|
9219
|
-
["discriminator",
|
|
9076
|
+
return getStructDecoder54([
|
|
9077
|
+
["discriminator", fixDecoderSize52(getBytesDecoder52(), 8)],
|
|
9220
9078
|
["feeRecipient", getAddressDecoder11()]
|
|
9221
9079
|
]);
|
|
9222
9080
|
}
|
|
9223
9081
|
function getSetFeeRecipientInstructionDataCodec() {
|
|
9224
|
-
return
|
|
9082
|
+
return combineCodec58(
|
|
9225
9083
|
getSetFeeRecipientInstructionDataEncoder(),
|
|
9226
9084
|
getSetFeeRecipientInstructionDataDecoder()
|
|
9227
9085
|
);
|
|
@@ -9269,16 +9127,16 @@ function parseSetFeeRecipientInstruction(instruction) {
|
|
|
9269
9127
|
|
|
9270
9128
|
// src/generated/instructions/setLiquidatorAuthority.ts
|
|
9271
9129
|
import {
|
|
9272
|
-
combineCodec as
|
|
9273
|
-
fixDecoderSize as
|
|
9274
|
-
fixEncoderSize as
|
|
9130
|
+
combineCodec as combineCodec59,
|
|
9131
|
+
fixDecoderSize as fixDecoderSize53,
|
|
9132
|
+
fixEncoderSize as fixEncoderSize54,
|
|
9275
9133
|
getAddressDecoder as getAddressDecoder12,
|
|
9276
9134
|
getAddressEncoder as getAddressEncoder12,
|
|
9277
|
-
getBytesDecoder as
|
|
9278
|
-
getBytesEncoder as
|
|
9279
|
-
getStructDecoder as
|
|
9280
|
-
getStructEncoder as
|
|
9281
|
-
transformEncoder as
|
|
9135
|
+
getBytesDecoder as getBytesDecoder53,
|
|
9136
|
+
getBytesEncoder as getBytesEncoder54,
|
|
9137
|
+
getStructDecoder as getStructDecoder55,
|
|
9138
|
+
getStructEncoder as getStructEncoder55,
|
|
9139
|
+
transformEncoder as transformEncoder53
|
|
9282
9140
|
} from "@solana/kit";
|
|
9283
9141
|
var SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
9284
9142
|
246,
|
|
@@ -9291,14 +9149,14 @@ var SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
9291
9149
|
143
|
|
9292
9150
|
]);
|
|
9293
9151
|
function getSetLiquidatorAuthorityDiscriminatorBytes() {
|
|
9294
|
-
return
|
|
9152
|
+
return fixEncoderSize54(getBytesEncoder54(), 8).encode(
|
|
9295
9153
|
SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR
|
|
9296
9154
|
);
|
|
9297
9155
|
}
|
|
9298
9156
|
function getSetLiquidatorAuthorityInstructionDataEncoder() {
|
|
9299
|
-
return
|
|
9300
|
-
|
|
9301
|
-
["discriminator",
|
|
9157
|
+
return transformEncoder53(
|
|
9158
|
+
getStructEncoder55([
|
|
9159
|
+
["discriminator", fixEncoderSize54(getBytesEncoder54(), 8)],
|
|
9302
9160
|
["liquidatorAuthority", getAddressEncoder12()]
|
|
9303
9161
|
]),
|
|
9304
9162
|
(value) => ({
|
|
@@ -9308,13 +9166,13 @@ function getSetLiquidatorAuthorityInstructionDataEncoder() {
|
|
|
9308
9166
|
);
|
|
9309
9167
|
}
|
|
9310
9168
|
function getSetLiquidatorAuthorityInstructionDataDecoder() {
|
|
9311
|
-
return
|
|
9312
|
-
["discriminator",
|
|
9169
|
+
return getStructDecoder55([
|
|
9170
|
+
["discriminator", fixDecoderSize53(getBytesDecoder53(), 8)],
|
|
9313
9171
|
["liquidatorAuthority", getAddressDecoder12()]
|
|
9314
9172
|
]);
|
|
9315
9173
|
}
|
|
9316
9174
|
function getSetLiquidatorAuthorityInstructionDataCodec() {
|
|
9317
|
-
return
|
|
9175
|
+
return combineCodec59(
|
|
9318
9176
|
getSetLiquidatorAuthorityInstructionDataEncoder(),
|
|
9319
9177
|
getSetLiquidatorAuthorityInstructionDataDecoder()
|
|
9320
9178
|
);
|
|
@@ -9364,16 +9222,16 @@ function parseSetLiquidatorAuthorityInstruction(instruction) {
|
|
|
9364
9222
|
|
|
9365
9223
|
// src/generated/instructions/setOwnerAuthority.ts
|
|
9366
9224
|
import {
|
|
9367
|
-
combineCodec as
|
|
9368
|
-
fixDecoderSize as
|
|
9369
|
-
fixEncoderSize as
|
|
9225
|
+
combineCodec as combineCodec60,
|
|
9226
|
+
fixDecoderSize as fixDecoderSize54,
|
|
9227
|
+
fixEncoderSize as fixEncoderSize55,
|
|
9370
9228
|
getAddressDecoder as getAddressDecoder13,
|
|
9371
9229
|
getAddressEncoder as getAddressEncoder13,
|
|
9372
|
-
getBytesDecoder as
|
|
9373
|
-
getBytesEncoder as
|
|
9374
|
-
getStructDecoder as
|
|
9375
|
-
getStructEncoder as
|
|
9376
|
-
transformEncoder as
|
|
9230
|
+
getBytesDecoder as getBytesDecoder54,
|
|
9231
|
+
getBytesEncoder as getBytesEncoder55,
|
|
9232
|
+
getStructDecoder as getStructDecoder56,
|
|
9233
|
+
getStructEncoder as getStructEncoder56,
|
|
9234
|
+
transformEncoder as transformEncoder54
|
|
9377
9235
|
} from "@solana/kit";
|
|
9378
9236
|
var SET_OWNER_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
9379
9237
|
128,
|
|
@@ -9386,27 +9244,27 @@ var SET_OWNER_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
9386
9244
|
117
|
|
9387
9245
|
]);
|
|
9388
9246
|
function getSetOwnerAuthorityDiscriminatorBytes() {
|
|
9389
|
-
return
|
|
9247
|
+
return fixEncoderSize55(getBytesEncoder55(), 8).encode(
|
|
9390
9248
|
SET_OWNER_AUTHORITY_DISCRIMINATOR
|
|
9391
9249
|
);
|
|
9392
9250
|
}
|
|
9393
9251
|
function getSetOwnerAuthorityInstructionDataEncoder() {
|
|
9394
|
-
return
|
|
9395
|
-
|
|
9396
|
-
["discriminator",
|
|
9252
|
+
return transformEncoder54(
|
|
9253
|
+
getStructEncoder56([
|
|
9254
|
+
["discriminator", fixEncoderSize55(getBytesEncoder55(), 8)],
|
|
9397
9255
|
["ownerAuthority", getAddressEncoder13()]
|
|
9398
9256
|
]),
|
|
9399
9257
|
(value) => ({ ...value, discriminator: SET_OWNER_AUTHORITY_DISCRIMINATOR })
|
|
9400
9258
|
);
|
|
9401
9259
|
}
|
|
9402
9260
|
function getSetOwnerAuthorityInstructionDataDecoder() {
|
|
9403
|
-
return
|
|
9404
|
-
["discriminator",
|
|
9261
|
+
return getStructDecoder56([
|
|
9262
|
+
["discriminator", fixDecoderSize54(getBytesDecoder54(), 8)],
|
|
9405
9263
|
["ownerAuthority", getAddressDecoder13()]
|
|
9406
9264
|
]);
|
|
9407
9265
|
}
|
|
9408
9266
|
function getSetOwnerAuthorityInstructionDataCodec() {
|
|
9409
|
-
return
|
|
9267
|
+
return combineCodec60(
|
|
9410
9268
|
getSetOwnerAuthorityInstructionDataEncoder(),
|
|
9411
9269
|
getSetOwnerAuthorityInstructionDataDecoder()
|
|
9412
9270
|
);
|
|
@@ -9454,16 +9312,16 @@ function parseSetOwnerAuthorityInstruction(instruction) {
|
|
|
9454
9312
|
|
|
9455
9313
|
// src/generated/instructions/setSuspendedState.ts
|
|
9456
9314
|
import {
|
|
9457
|
-
combineCodec as
|
|
9458
|
-
fixDecoderSize as
|
|
9459
|
-
fixEncoderSize as
|
|
9315
|
+
combineCodec as combineCodec61,
|
|
9316
|
+
fixDecoderSize as fixDecoderSize55,
|
|
9317
|
+
fixEncoderSize as fixEncoderSize56,
|
|
9460
9318
|
getBooleanDecoder as getBooleanDecoder7,
|
|
9461
9319
|
getBooleanEncoder as getBooleanEncoder7,
|
|
9462
|
-
getBytesDecoder as
|
|
9463
|
-
getBytesEncoder as
|
|
9464
|
-
getStructDecoder as
|
|
9465
|
-
getStructEncoder as
|
|
9466
|
-
transformEncoder as
|
|
9320
|
+
getBytesDecoder as getBytesDecoder55,
|
|
9321
|
+
getBytesEncoder as getBytesEncoder56,
|
|
9322
|
+
getStructDecoder as getStructDecoder57,
|
|
9323
|
+
getStructEncoder as getStructEncoder57,
|
|
9324
|
+
transformEncoder as transformEncoder55
|
|
9467
9325
|
} from "@solana/kit";
|
|
9468
9326
|
var SET_SUSPENDED_STATE_DISCRIMINATOR = new Uint8Array([
|
|
9469
9327
|
145,
|
|
@@ -9476,14 +9334,14 @@ var SET_SUSPENDED_STATE_DISCRIMINATOR = new Uint8Array([
|
|
|
9476
9334
|
32
|
|
9477
9335
|
]);
|
|
9478
9336
|
function getSetSuspendedStateDiscriminatorBytes() {
|
|
9479
|
-
return
|
|
9337
|
+
return fixEncoderSize56(getBytesEncoder56(), 8).encode(
|
|
9480
9338
|
SET_SUSPENDED_STATE_DISCRIMINATOR
|
|
9481
9339
|
);
|
|
9482
9340
|
}
|
|
9483
9341
|
function getSetSuspendedStateInstructionDataEncoder() {
|
|
9484
|
-
return
|
|
9485
|
-
|
|
9486
|
-
["discriminator",
|
|
9342
|
+
return transformEncoder55(
|
|
9343
|
+
getStructEncoder57([
|
|
9344
|
+
["discriminator", fixEncoderSize56(getBytesEncoder56(), 8)],
|
|
9487
9345
|
["suspendLendingDeposits", getBooleanEncoder7()],
|
|
9488
9346
|
["suspendLendingWithdrawals", getBooleanEncoder7()],
|
|
9489
9347
|
["suspendAddLiquidity", getBooleanEncoder7()],
|
|
@@ -9493,8 +9351,8 @@ function getSetSuspendedStateInstructionDataEncoder() {
|
|
|
9493
9351
|
);
|
|
9494
9352
|
}
|
|
9495
9353
|
function getSetSuspendedStateInstructionDataDecoder() {
|
|
9496
|
-
return
|
|
9497
|
-
["discriminator",
|
|
9354
|
+
return getStructDecoder57([
|
|
9355
|
+
["discriminator", fixDecoderSize55(getBytesDecoder55(), 8)],
|
|
9498
9356
|
["suspendLendingDeposits", getBooleanDecoder7()],
|
|
9499
9357
|
["suspendLendingWithdrawals", getBooleanDecoder7()],
|
|
9500
9358
|
["suspendAddLiquidity", getBooleanDecoder7()],
|
|
@@ -9502,7 +9360,7 @@ function getSetSuspendedStateInstructionDataDecoder() {
|
|
|
9502
9360
|
]);
|
|
9503
9361
|
}
|
|
9504
9362
|
function getSetSuspendedStateInstructionDataCodec() {
|
|
9505
|
-
return
|
|
9363
|
+
return combineCodec61(
|
|
9506
9364
|
getSetSuspendedStateInstructionDataEncoder(),
|
|
9507
9365
|
getSetSuspendedStateInstructionDataDecoder()
|
|
9508
9366
|
);
|
|
@@ -9550,16 +9408,16 @@ function parseSetSuspendedStateInstruction(instruction) {
|
|
|
9550
9408
|
|
|
9551
9409
|
// src/generated/instructions/setTunaLpPositionFlags.ts
|
|
9552
9410
|
import {
|
|
9553
|
-
combineCodec as
|
|
9554
|
-
fixDecoderSize as
|
|
9555
|
-
fixEncoderSize as
|
|
9556
|
-
getBytesDecoder as
|
|
9557
|
-
getBytesEncoder as
|
|
9558
|
-
getStructDecoder as
|
|
9559
|
-
getStructEncoder as
|
|
9411
|
+
combineCodec as combineCodec62,
|
|
9412
|
+
fixDecoderSize as fixDecoderSize56,
|
|
9413
|
+
fixEncoderSize as fixEncoderSize57,
|
|
9414
|
+
getBytesDecoder as getBytesDecoder56,
|
|
9415
|
+
getBytesEncoder as getBytesEncoder57,
|
|
9416
|
+
getStructDecoder as getStructDecoder58,
|
|
9417
|
+
getStructEncoder as getStructEncoder58,
|
|
9560
9418
|
getU32Decoder as getU32Decoder25,
|
|
9561
9419
|
getU32Encoder as getU32Encoder25,
|
|
9562
|
-
transformEncoder as
|
|
9420
|
+
transformEncoder as transformEncoder56
|
|
9563
9421
|
} from "@solana/kit";
|
|
9564
9422
|
var SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR = new Uint8Array([
|
|
9565
9423
|
110,
|
|
@@ -9572,14 +9430,14 @@ var SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR = new Uint8Array([
|
|
|
9572
9430
|
57
|
|
9573
9431
|
]);
|
|
9574
9432
|
function getSetTunaLpPositionFlagsDiscriminatorBytes() {
|
|
9575
|
-
return
|
|
9433
|
+
return fixEncoderSize57(getBytesEncoder57(), 8).encode(
|
|
9576
9434
|
SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR
|
|
9577
9435
|
);
|
|
9578
9436
|
}
|
|
9579
9437
|
function getSetTunaLpPositionFlagsInstructionDataEncoder() {
|
|
9580
|
-
return
|
|
9581
|
-
|
|
9582
|
-
["discriminator",
|
|
9438
|
+
return transformEncoder56(
|
|
9439
|
+
getStructEncoder58([
|
|
9440
|
+
["discriminator", fixEncoderSize57(getBytesEncoder57(), 8)],
|
|
9583
9441
|
["flags", getU32Encoder25()]
|
|
9584
9442
|
]),
|
|
9585
9443
|
(value) => ({
|
|
@@ -9589,13 +9447,13 @@ function getSetTunaLpPositionFlagsInstructionDataEncoder() {
|
|
|
9589
9447
|
);
|
|
9590
9448
|
}
|
|
9591
9449
|
function getSetTunaLpPositionFlagsInstructionDataDecoder() {
|
|
9592
|
-
return
|
|
9593
|
-
["discriminator",
|
|
9450
|
+
return getStructDecoder58([
|
|
9451
|
+
["discriminator", fixDecoderSize56(getBytesDecoder56(), 8)],
|
|
9594
9452
|
["flags", getU32Decoder25()]
|
|
9595
9453
|
]);
|
|
9596
9454
|
}
|
|
9597
9455
|
function getSetTunaLpPositionFlagsInstructionDataCodec() {
|
|
9598
|
-
return
|
|
9456
|
+
return combineCodec62(
|
|
9599
9457
|
getSetTunaLpPositionFlagsInstructionDataEncoder(),
|
|
9600
9458
|
getSetTunaLpPositionFlagsInstructionDataDecoder()
|
|
9601
9459
|
);
|
|
@@ -9645,18 +9503,18 @@ function parseSetTunaLpPositionFlagsInstruction(instruction) {
|
|
|
9645
9503
|
|
|
9646
9504
|
// src/generated/instructions/setTunaLpPositionLimitOrders.ts
|
|
9647
9505
|
import {
|
|
9648
|
-
combineCodec as
|
|
9649
|
-
fixDecoderSize as
|
|
9650
|
-
fixEncoderSize as
|
|
9651
|
-
getBytesDecoder as
|
|
9652
|
-
getBytesEncoder as
|
|
9653
|
-
getStructDecoder as
|
|
9654
|
-
getStructEncoder as
|
|
9506
|
+
combineCodec as combineCodec63,
|
|
9507
|
+
fixDecoderSize as fixDecoderSize57,
|
|
9508
|
+
fixEncoderSize as fixEncoderSize58,
|
|
9509
|
+
getBytesDecoder as getBytesDecoder57,
|
|
9510
|
+
getBytesEncoder as getBytesEncoder58,
|
|
9511
|
+
getStructDecoder as getStructDecoder59,
|
|
9512
|
+
getStructEncoder as getStructEncoder59,
|
|
9655
9513
|
getU128Decoder as getU128Decoder7,
|
|
9656
9514
|
getU128Encoder as getU128Encoder7,
|
|
9657
9515
|
getU8Decoder as getU8Decoder5,
|
|
9658
9516
|
getU8Encoder as getU8Encoder5,
|
|
9659
|
-
transformEncoder as
|
|
9517
|
+
transformEncoder as transformEncoder57
|
|
9660
9518
|
} from "@solana/kit";
|
|
9661
9519
|
var SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array([
|
|
9662
9520
|
65,
|
|
@@ -9669,14 +9527,14 @@ var SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array([
|
|
|
9669
9527
|
255
|
|
9670
9528
|
]);
|
|
9671
9529
|
function getSetTunaLpPositionLimitOrdersDiscriminatorBytes() {
|
|
9672
|
-
return
|
|
9530
|
+
return fixEncoderSize58(getBytesEncoder58(), 8).encode(
|
|
9673
9531
|
SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR
|
|
9674
9532
|
);
|
|
9675
9533
|
}
|
|
9676
9534
|
function getSetTunaLpPositionLimitOrdersInstructionDataEncoder() {
|
|
9677
|
-
return
|
|
9678
|
-
|
|
9679
|
-
["discriminator",
|
|
9535
|
+
return transformEncoder57(
|
|
9536
|
+
getStructEncoder59([
|
|
9537
|
+
["discriminator", fixEncoderSize58(getBytesEncoder58(), 8)],
|
|
9680
9538
|
["lowerLimitOrderSqrtPrice", getU128Encoder7()],
|
|
9681
9539
|
["upperLimitOrderSqrtPrice", getU128Encoder7()],
|
|
9682
9540
|
["swapToTokenOnLimitOrder", getU8Encoder5()]
|
|
@@ -9688,15 +9546,15 @@ function getSetTunaLpPositionLimitOrdersInstructionDataEncoder() {
|
|
|
9688
9546
|
);
|
|
9689
9547
|
}
|
|
9690
9548
|
function getSetTunaLpPositionLimitOrdersInstructionDataDecoder() {
|
|
9691
|
-
return
|
|
9692
|
-
["discriminator",
|
|
9549
|
+
return getStructDecoder59([
|
|
9550
|
+
["discriminator", fixDecoderSize57(getBytesDecoder57(), 8)],
|
|
9693
9551
|
["lowerLimitOrderSqrtPrice", getU128Decoder7()],
|
|
9694
9552
|
["upperLimitOrderSqrtPrice", getU128Decoder7()],
|
|
9695
9553
|
["swapToTokenOnLimitOrder", getU8Decoder5()]
|
|
9696
9554
|
]);
|
|
9697
9555
|
}
|
|
9698
9556
|
function getSetTunaLpPositionLimitOrdersInstructionDataCodec() {
|
|
9699
|
-
return
|
|
9557
|
+
return combineCodec63(
|
|
9700
9558
|
getSetTunaLpPositionLimitOrdersInstructionDataEncoder(),
|
|
9701
9559
|
getSetTunaLpPositionLimitOrdersInstructionDataDecoder()
|
|
9702
9560
|
);
|
|
@@ -9746,27 +9604,27 @@ function parseSetTunaLpPositionLimitOrdersInstruction(instruction) {
|
|
|
9746
9604
|
|
|
9747
9605
|
// src/generated/instructions/setTunaLpPositionRebalanceThreshold.ts
|
|
9748
9606
|
import {
|
|
9749
|
-
combineCodec as
|
|
9750
|
-
fixDecoderSize as
|
|
9751
|
-
fixEncoderSize as
|
|
9752
|
-
getBytesDecoder as
|
|
9753
|
-
getBytesEncoder as
|
|
9754
|
-
getStructDecoder as
|
|
9755
|
-
getStructEncoder as
|
|
9607
|
+
combineCodec as combineCodec64,
|
|
9608
|
+
fixDecoderSize as fixDecoderSize58,
|
|
9609
|
+
fixEncoderSize as fixEncoderSize59,
|
|
9610
|
+
getBytesDecoder as getBytesDecoder58,
|
|
9611
|
+
getBytesEncoder as getBytesEncoder59,
|
|
9612
|
+
getStructDecoder as getStructDecoder60,
|
|
9613
|
+
getStructEncoder as getStructEncoder60,
|
|
9756
9614
|
getU32Decoder as getU32Decoder26,
|
|
9757
9615
|
getU32Encoder as getU32Encoder26,
|
|
9758
|
-
transformEncoder as
|
|
9616
|
+
transformEncoder as transformEncoder58
|
|
9759
9617
|
} from "@solana/kit";
|
|
9760
9618
|
var SET_TUNA_LP_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR = new Uint8Array([244, 174, 185, 58, 90, 150, 162, 51]);
|
|
9761
9619
|
function getSetTunaLpPositionRebalanceThresholdDiscriminatorBytes() {
|
|
9762
|
-
return
|
|
9620
|
+
return fixEncoderSize59(getBytesEncoder59(), 8).encode(
|
|
9763
9621
|
SET_TUNA_LP_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR
|
|
9764
9622
|
);
|
|
9765
9623
|
}
|
|
9766
9624
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder() {
|
|
9767
|
-
return
|
|
9768
|
-
|
|
9769
|
-
["discriminator",
|
|
9625
|
+
return transformEncoder58(
|
|
9626
|
+
getStructEncoder60([
|
|
9627
|
+
["discriminator", fixEncoderSize59(getBytesEncoder59(), 8)],
|
|
9770
9628
|
["rebalanceThresholdTicks", getU32Encoder26()]
|
|
9771
9629
|
]),
|
|
9772
9630
|
(value) => ({
|
|
@@ -9776,13 +9634,13 @@ function getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder() {
|
|
|
9776
9634
|
);
|
|
9777
9635
|
}
|
|
9778
9636
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataDecoder() {
|
|
9779
|
-
return
|
|
9780
|
-
["discriminator",
|
|
9637
|
+
return getStructDecoder60([
|
|
9638
|
+
["discriminator", fixDecoderSize58(getBytesDecoder58(), 8)],
|
|
9781
9639
|
["rebalanceThresholdTicks", getU32Decoder26()]
|
|
9782
9640
|
]);
|
|
9783
9641
|
}
|
|
9784
9642
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataCodec() {
|
|
9785
|
-
return
|
|
9643
|
+
return combineCodec64(
|
|
9786
9644
|
getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder(),
|
|
9787
9645
|
getSetTunaLpPositionRebalanceThresholdInstructionDataDecoder()
|
|
9788
9646
|
);
|
|
@@ -9832,29 +9690,29 @@ function parseSetTunaLpPositionRebalanceThresholdInstruction(instruction) {
|
|
|
9832
9690
|
|
|
9833
9691
|
// src/generated/instructions/setTunaSpotPositionLimitOrders.ts
|
|
9834
9692
|
import {
|
|
9835
|
-
combineCodec as
|
|
9836
|
-
fixDecoderSize as
|
|
9837
|
-
fixEncoderSize as
|
|
9838
|
-
getBytesDecoder as
|
|
9839
|
-
getBytesEncoder as
|
|
9840
|
-
getStructDecoder as
|
|
9841
|
-
getStructEncoder as
|
|
9693
|
+
combineCodec as combineCodec65,
|
|
9694
|
+
fixDecoderSize as fixDecoderSize59,
|
|
9695
|
+
fixEncoderSize as fixEncoderSize60,
|
|
9696
|
+
getBytesDecoder as getBytesDecoder59,
|
|
9697
|
+
getBytesEncoder as getBytesEncoder60,
|
|
9698
|
+
getStructDecoder as getStructDecoder61,
|
|
9699
|
+
getStructEncoder as getStructEncoder61,
|
|
9842
9700
|
getU128Decoder as getU128Decoder8,
|
|
9843
9701
|
getU128Encoder as getU128Encoder8,
|
|
9844
|
-
transformEncoder as
|
|
9702
|
+
transformEncoder as transformEncoder59
|
|
9845
9703
|
} from "@solana/kit";
|
|
9846
9704
|
var SET_TUNA_SPOT_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array(
|
|
9847
9705
|
[10, 180, 19, 205, 169, 133, 52, 118]
|
|
9848
9706
|
);
|
|
9849
9707
|
function getSetTunaSpotPositionLimitOrdersDiscriminatorBytes() {
|
|
9850
|
-
return
|
|
9708
|
+
return fixEncoderSize60(getBytesEncoder60(), 8).encode(
|
|
9851
9709
|
SET_TUNA_SPOT_POSITION_LIMIT_ORDERS_DISCRIMINATOR
|
|
9852
9710
|
);
|
|
9853
9711
|
}
|
|
9854
9712
|
function getSetTunaSpotPositionLimitOrdersInstructionDataEncoder() {
|
|
9855
|
-
return
|
|
9856
|
-
|
|
9857
|
-
["discriminator",
|
|
9713
|
+
return transformEncoder59(
|
|
9714
|
+
getStructEncoder61([
|
|
9715
|
+
["discriminator", fixEncoderSize60(getBytesEncoder60(), 8)],
|
|
9858
9716
|
["lowerLimitOrderSqrtPrice", getU128Encoder8()],
|
|
9859
9717
|
["upperLimitOrderSqrtPrice", getU128Encoder8()]
|
|
9860
9718
|
]),
|
|
@@ -9865,14 +9723,14 @@ function getSetTunaSpotPositionLimitOrdersInstructionDataEncoder() {
|
|
|
9865
9723
|
);
|
|
9866
9724
|
}
|
|
9867
9725
|
function getSetTunaSpotPositionLimitOrdersInstructionDataDecoder() {
|
|
9868
|
-
return
|
|
9869
|
-
["discriminator",
|
|
9726
|
+
return getStructDecoder61([
|
|
9727
|
+
["discriminator", fixDecoderSize59(getBytesDecoder59(), 8)],
|
|
9870
9728
|
["lowerLimitOrderSqrtPrice", getU128Decoder8()],
|
|
9871
9729
|
["upperLimitOrderSqrtPrice", getU128Decoder8()]
|
|
9872
9730
|
]);
|
|
9873
9731
|
}
|
|
9874
9732
|
function getSetTunaSpotPositionLimitOrdersInstructionDataCodec() {
|
|
9875
|
-
return
|
|
9733
|
+
return combineCodec65(
|
|
9876
9734
|
getSetTunaSpotPositionLimitOrdersInstructionDataEncoder(),
|
|
9877
9735
|
getSetTunaSpotPositionLimitOrdersInstructionDataDecoder()
|
|
9878
9736
|
);
|
|
@@ -9922,24 +9780,24 @@ function parseSetTunaSpotPositionLimitOrdersInstruction(instruction) {
|
|
|
9922
9780
|
|
|
9923
9781
|
// src/generated/instructions/updateMarket.ts
|
|
9924
9782
|
import {
|
|
9925
|
-
combineCodec as
|
|
9926
|
-
fixDecoderSize as
|
|
9927
|
-
fixEncoderSize as
|
|
9783
|
+
combineCodec as combineCodec66,
|
|
9784
|
+
fixDecoderSize as fixDecoderSize60,
|
|
9785
|
+
fixEncoderSize as fixEncoderSize61,
|
|
9928
9786
|
getAddressDecoder as getAddressDecoder14,
|
|
9929
9787
|
getAddressEncoder as getAddressEncoder14,
|
|
9930
9788
|
getBooleanDecoder as getBooleanDecoder8,
|
|
9931
9789
|
getBooleanEncoder as getBooleanEncoder8,
|
|
9932
|
-
getBytesDecoder as
|
|
9933
|
-
getBytesEncoder as
|
|
9934
|
-
getStructDecoder as
|
|
9935
|
-
getStructEncoder as
|
|
9790
|
+
getBytesDecoder as getBytesDecoder60,
|
|
9791
|
+
getBytesEncoder as getBytesEncoder61,
|
|
9792
|
+
getStructDecoder as getStructDecoder62,
|
|
9793
|
+
getStructEncoder as getStructEncoder62,
|
|
9936
9794
|
getU16Decoder as getU16Decoder8,
|
|
9937
9795
|
getU16Encoder as getU16Encoder8,
|
|
9938
9796
|
getU32Decoder as getU32Decoder27,
|
|
9939
9797
|
getU32Encoder as getU32Encoder27,
|
|
9940
9798
|
getU64Decoder as getU64Decoder26,
|
|
9941
9799
|
getU64Encoder as getU64Encoder26,
|
|
9942
|
-
transformEncoder as
|
|
9800
|
+
transformEncoder as transformEncoder60
|
|
9943
9801
|
} from "@solana/kit";
|
|
9944
9802
|
var UPDATE_MARKET_DISCRIMINATOR = new Uint8Array([
|
|
9945
9803
|
153,
|
|
@@ -9952,14 +9810,14 @@ var UPDATE_MARKET_DISCRIMINATOR = new Uint8Array([
|
|
|
9952
9810
|
217
|
|
9953
9811
|
]);
|
|
9954
9812
|
function getUpdateMarketDiscriminatorBytes() {
|
|
9955
|
-
return
|
|
9813
|
+
return fixEncoderSize61(getBytesEncoder61(), 8).encode(
|
|
9956
9814
|
UPDATE_MARKET_DISCRIMINATOR
|
|
9957
9815
|
);
|
|
9958
9816
|
}
|
|
9959
9817
|
function getUpdateMarketInstructionDataEncoder() {
|
|
9960
|
-
return
|
|
9961
|
-
|
|
9962
|
-
["discriminator",
|
|
9818
|
+
return transformEncoder60(
|
|
9819
|
+
getStructEncoder62([
|
|
9820
|
+
["discriminator", fixEncoderSize61(getBytesEncoder61(), 8)],
|
|
9963
9821
|
["addressLookupTable", getAddressEncoder14()],
|
|
9964
9822
|
["maxLeverage", getU32Encoder27()],
|
|
9965
9823
|
["protocolFee", getU16Encoder8()],
|
|
@@ -9980,8 +9838,8 @@ function getUpdateMarketInstructionDataEncoder() {
|
|
|
9980
9838
|
);
|
|
9981
9839
|
}
|
|
9982
9840
|
function getUpdateMarketInstructionDataDecoder() {
|
|
9983
|
-
return
|
|
9984
|
-
["discriminator",
|
|
9841
|
+
return getStructDecoder62([
|
|
9842
|
+
["discriminator", fixDecoderSize60(getBytesDecoder60(), 8)],
|
|
9985
9843
|
["addressLookupTable", getAddressDecoder14()],
|
|
9986
9844
|
["maxLeverage", getU32Decoder27()],
|
|
9987
9845
|
["protocolFee", getU16Decoder8()],
|
|
@@ -10000,7 +9858,7 @@ function getUpdateMarketInstructionDataDecoder() {
|
|
|
10000
9858
|
]);
|
|
10001
9859
|
}
|
|
10002
9860
|
function getUpdateMarketInstructionDataCodec() {
|
|
10003
|
-
return
|
|
9861
|
+
return combineCodec66(
|
|
10004
9862
|
getUpdateMarketInstructionDataEncoder(),
|
|
10005
9863
|
getUpdateMarketInstructionDataDecoder()
|
|
10006
9864
|
);
|
|
@@ -10051,18 +9909,18 @@ function parseUpdateMarketInstruction(instruction) {
|
|
|
10051
9909
|
|
|
10052
9910
|
// src/generated/instructions/updateVault.ts
|
|
10053
9911
|
import {
|
|
10054
|
-
combineCodec as
|
|
10055
|
-
fixDecoderSize as
|
|
10056
|
-
fixEncoderSize as
|
|
9912
|
+
combineCodec as combineCodec67,
|
|
9913
|
+
fixDecoderSize as fixDecoderSize61,
|
|
9914
|
+
fixEncoderSize as fixEncoderSize62,
|
|
10057
9915
|
getAddressDecoder as getAddressDecoder15,
|
|
10058
9916
|
getAddressEncoder as getAddressEncoder15,
|
|
10059
|
-
getBytesDecoder as
|
|
10060
|
-
getBytesEncoder as
|
|
10061
|
-
getStructDecoder as
|
|
10062
|
-
getStructEncoder as
|
|
9917
|
+
getBytesDecoder as getBytesDecoder61,
|
|
9918
|
+
getBytesEncoder as getBytesEncoder62,
|
|
9919
|
+
getStructDecoder as getStructDecoder63,
|
|
9920
|
+
getStructEncoder as getStructEncoder63,
|
|
10063
9921
|
getU64Decoder as getU64Decoder27,
|
|
10064
9922
|
getU64Encoder as getU64Encoder27,
|
|
10065
|
-
transformEncoder as
|
|
9923
|
+
transformEncoder as transformEncoder61
|
|
10066
9924
|
} from "@solana/kit";
|
|
10067
9925
|
var UPDATE_VAULT_DISCRIMINATOR = new Uint8Array([
|
|
10068
9926
|
67,
|
|
@@ -10075,14 +9933,14 @@ var UPDATE_VAULT_DISCRIMINATOR = new Uint8Array([
|
|
|
10075
9933
|
60
|
|
10076
9934
|
]);
|
|
10077
9935
|
function getUpdateVaultDiscriminatorBytes() {
|
|
10078
|
-
return
|
|
9936
|
+
return fixEncoderSize62(getBytesEncoder62(), 8).encode(
|
|
10079
9937
|
UPDATE_VAULT_DISCRIMINATOR
|
|
10080
9938
|
);
|
|
10081
9939
|
}
|
|
10082
9940
|
function getUpdateVaultInstructionDataEncoder() {
|
|
10083
|
-
return
|
|
10084
|
-
|
|
10085
|
-
["discriminator",
|
|
9941
|
+
return transformEncoder61(
|
|
9942
|
+
getStructEncoder63([
|
|
9943
|
+
["discriminator", fixEncoderSize62(getBytesEncoder62(), 8)],
|
|
10086
9944
|
["interestRate", getU64Encoder27()],
|
|
10087
9945
|
["supplyLimit", getU64Encoder27()],
|
|
10088
9946
|
["pythOraclePriceUpdate", getAddressEncoder15()],
|
|
@@ -10092,8 +9950,8 @@ function getUpdateVaultInstructionDataEncoder() {
|
|
|
10092
9950
|
);
|
|
10093
9951
|
}
|
|
10094
9952
|
function getUpdateVaultInstructionDataDecoder() {
|
|
10095
|
-
return
|
|
10096
|
-
["discriminator",
|
|
9953
|
+
return getStructDecoder63([
|
|
9954
|
+
["discriminator", fixDecoderSize61(getBytesDecoder61(), 8)],
|
|
10097
9955
|
["interestRate", getU64Decoder27()],
|
|
10098
9956
|
["supplyLimit", getU64Decoder27()],
|
|
10099
9957
|
["pythOraclePriceUpdate", getAddressDecoder15()],
|
|
@@ -10101,7 +9959,7 @@ function getUpdateVaultInstructionDataDecoder() {
|
|
|
10101
9959
|
]);
|
|
10102
9960
|
}
|
|
10103
9961
|
function getUpdateVaultInstructionDataCodec() {
|
|
10104
|
-
return
|
|
9962
|
+
return combineCodec67(
|
|
10105
9963
|
getUpdateVaultInstructionDataEncoder(),
|
|
10106
9964
|
getUpdateVaultInstructionDataDecoder()
|
|
10107
9965
|
);
|
|
@@ -10152,16 +10010,16 @@ function parseUpdateVaultInstruction(instruction) {
|
|
|
10152
10010
|
|
|
10153
10011
|
// src/generated/instructions/withdraw.ts
|
|
10154
10012
|
import {
|
|
10155
|
-
combineCodec as
|
|
10156
|
-
fixDecoderSize as
|
|
10157
|
-
fixEncoderSize as
|
|
10158
|
-
getBytesDecoder as
|
|
10159
|
-
getBytesEncoder as
|
|
10160
|
-
getStructDecoder as
|
|
10161
|
-
getStructEncoder as
|
|
10013
|
+
combineCodec as combineCodec68,
|
|
10014
|
+
fixDecoderSize as fixDecoderSize62,
|
|
10015
|
+
fixEncoderSize as fixEncoderSize63,
|
|
10016
|
+
getBytesDecoder as getBytesDecoder62,
|
|
10017
|
+
getBytesEncoder as getBytesEncoder63,
|
|
10018
|
+
getStructDecoder as getStructDecoder64,
|
|
10019
|
+
getStructEncoder as getStructEncoder64,
|
|
10162
10020
|
getU64Decoder as getU64Decoder28,
|
|
10163
10021
|
getU64Encoder as getU64Encoder28,
|
|
10164
|
-
transformEncoder as
|
|
10022
|
+
transformEncoder as transformEncoder62
|
|
10165
10023
|
} from "@solana/kit";
|
|
10166
10024
|
var WITHDRAW_DISCRIMINATOR = new Uint8Array([
|
|
10167
10025
|
183,
|
|
@@ -10174,12 +10032,12 @@ var WITHDRAW_DISCRIMINATOR = new Uint8Array([
|
|
|
10174
10032
|
34
|
|
10175
10033
|
]);
|
|
10176
10034
|
function getWithdrawDiscriminatorBytes() {
|
|
10177
|
-
return
|
|
10035
|
+
return fixEncoderSize63(getBytesEncoder63(), 8).encode(WITHDRAW_DISCRIMINATOR);
|
|
10178
10036
|
}
|
|
10179
10037
|
function getWithdrawInstructionDataEncoder() {
|
|
10180
|
-
return
|
|
10181
|
-
|
|
10182
|
-
["discriminator",
|
|
10038
|
+
return transformEncoder62(
|
|
10039
|
+
getStructEncoder64([
|
|
10040
|
+
["discriminator", fixEncoderSize63(getBytesEncoder63(), 8)],
|
|
10183
10041
|
["funds", getU64Encoder28()],
|
|
10184
10042
|
["shares", getU64Encoder28()]
|
|
10185
10043
|
]),
|
|
@@ -10187,14 +10045,14 @@ function getWithdrawInstructionDataEncoder() {
|
|
|
10187
10045
|
);
|
|
10188
10046
|
}
|
|
10189
10047
|
function getWithdrawInstructionDataDecoder() {
|
|
10190
|
-
return
|
|
10191
|
-
["discriminator",
|
|
10048
|
+
return getStructDecoder64([
|
|
10049
|
+
["discriminator", fixDecoderSize62(getBytesDecoder62(), 8)],
|
|
10192
10050
|
["funds", getU64Decoder28()],
|
|
10193
10051
|
["shares", getU64Decoder28()]
|
|
10194
10052
|
]);
|
|
10195
10053
|
}
|
|
10196
10054
|
function getWithdrawInstructionDataCodec() {
|
|
10197
|
-
return
|
|
10055
|
+
return combineCodec68(
|
|
10198
10056
|
getWithdrawInstructionDataEncoder(),
|
|
10199
10057
|
getWithdrawInstructionDataDecoder()
|
|
10200
10058
|
);
|
|
@@ -12917,21 +12775,21 @@ import { fetchFusionPool as fetchFusionPool2 } from "@crypticdot/fusionamm-clien
|
|
|
12917
12775
|
import {
|
|
12918
12776
|
assertAccountExists as assertAccountExists7,
|
|
12919
12777
|
assertAccountsExist as assertAccountsExist8,
|
|
12920
|
-
combineCodec as
|
|
12778
|
+
combineCodec as combineCodec69,
|
|
12921
12779
|
decodeAccount as decodeAccount7,
|
|
12922
12780
|
fetchEncodedAccount as fetchEncodedAccount7,
|
|
12923
12781
|
fetchEncodedAccounts as fetchEncodedAccounts7,
|
|
12924
|
-
fixDecoderSize as
|
|
12925
|
-
fixEncoderSize as
|
|
12782
|
+
fixDecoderSize as fixDecoderSize63,
|
|
12783
|
+
fixEncoderSize as fixEncoderSize64,
|
|
12926
12784
|
getAddressDecoder as getAddressDecoder16,
|
|
12927
12785
|
getAddressEncoder as getAddressEncoder20,
|
|
12928
|
-
getBytesDecoder as
|
|
12929
|
-
getBytesEncoder as
|
|
12930
|
-
getStructDecoder as
|
|
12931
|
-
getStructEncoder as
|
|
12786
|
+
getBytesDecoder as getBytesDecoder63,
|
|
12787
|
+
getBytesEncoder as getBytesEncoder64,
|
|
12788
|
+
getStructDecoder as getStructDecoder65,
|
|
12789
|
+
getStructEncoder as getStructEncoder65,
|
|
12932
12790
|
getU64Decoder as getU64Decoder29,
|
|
12933
12791
|
getU64Encoder as getU64Encoder29,
|
|
12934
|
-
transformEncoder as
|
|
12792
|
+
transformEncoder as transformEncoder63
|
|
12935
12793
|
} from "@solana/kit";
|
|
12936
12794
|
import {
|
|
12937
12795
|
isProgramError as isProgramError2
|
|
@@ -12990,10 +12848,10 @@ import {
|
|
|
12990
12848
|
import {
|
|
12991
12849
|
combineCodec as combineCodec510,
|
|
12992
12850
|
fixDecoderSize as fixDecoderSize510,
|
|
12993
|
-
fixEncoderSize as
|
|
12851
|
+
fixEncoderSize as fixEncoderSize65,
|
|
12994
12852
|
getAddressEncoder as getAddressEncoder32,
|
|
12995
12853
|
getBytesDecoder as getBytesDecoder510,
|
|
12996
|
-
getBytesEncoder as
|
|
12854
|
+
getBytesEncoder as getBytesEncoder65,
|
|
12997
12855
|
getProgramDerivedAddress as getProgramDerivedAddress22,
|
|
12998
12856
|
getStructDecoder as getStructDecoder510,
|
|
12999
12857
|
getStructEncoder as getStructEncoder510,
|
|
@@ -13001,17 +12859,17 @@ import {
|
|
|
13001
12859
|
} from "@solana/kit";
|
|
13002
12860
|
import {
|
|
13003
12861
|
combineCodec as combineCodec610,
|
|
13004
|
-
fixDecoderSize as
|
|
12862
|
+
fixDecoderSize as fixDecoderSize64,
|
|
13005
12863
|
fixEncoderSize as fixEncoderSize72,
|
|
13006
12864
|
getAddressEncoder as getAddressEncoder42,
|
|
13007
|
-
getBytesDecoder as
|
|
12865
|
+
getBytesDecoder as getBytesDecoder64,
|
|
13008
12866
|
getBytesEncoder as getBytesEncoder72,
|
|
13009
12867
|
getProgramDerivedAddress as getProgramDerivedAddress3,
|
|
13010
|
-
getStructDecoder as
|
|
13011
|
-
getStructEncoder as
|
|
12868
|
+
getStructDecoder as getStructDecoder66,
|
|
12869
|
+
getStructEncoder as getStructEncoder66,
|
|
13012
12870
|
getU8Decoder as getU8Decoder42,
|
|
13013
12871
|
getU8Encoder as getU8Encoder42,
|
|
13014
|
-
transformEncoder as
|
|
12872
|
+
transformEncoder as transformEncoder64
|
|
13015
12873
|
} from "@solana/kit";
|
|
13016
12874
|
import {
|
|
13017
12875
|
combineCodec as combineCodec72,
|
|
@@ -13566,7 +13424,7 @@ async function increaseTunaSpotPositionJupiterInstructions(rpc, authority, poolA
|
|
|
13566
13424
|
]);
|
|
13567
13425
|
let collateralToken;
|
|
13568
13426
|
if (openArgs != void 0) {
|
|
13569
|
-
const openIx =
|
|
13427
|
+
const openIx = await openTunaSpotPositionInstruction(authority, mintA, mintB, poolAddress, openArgs);
|
|
13570
13428
|
instructions.push(openIx);
|
|
13571
13429
|
collateralToken = openArgs.collateralToken;
|
|
13572
13430
|
} else {
|
|
@@ -15685,25 +15543,38 @@ async function openAndIncreaseTunaSpotPositionOrcaInstruction(authority, tunaCon
|
|
|
15685
15543
|
return ix;
|
|
15686
15544
|
}
|
|
15687
15545
|
|
|
15688
|
-
// src/txbuilder/
|
|
15689
|
-
import {
|
|
15546
|
+
// src/txbuilder/openTunaSpotPosition.ts
|
|
15547
|
+
import { FUSIONAMM_PROGRAM_ADDRESS as FUSIONAMM_PROGRAM_ADDRESS14, getFusionPoolDecoder } from "@crypticdot/fusionamm-client";
|
|
15548
|
+
import { getWhirlpoolDecoder, WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS14 } from "@orca-so/whirlpools-client";
|
|
15549
|
+
import {
|
|
15550
|
+
decodeAccount as decodeAccount8,
|
|
15551
|
+
fetchEncodedAccount as fetchEncodedAccount8
|
|
15552
|
+
} from "@solana/kit";
|
|
15690
15553
|
import {
|
|
15691
15554
|
ASSOCIATED_TOKEN_PROGRAM_ADDRESS as ASSOCIATED_TOKEN_PROGRAM_ADDRESS7,
|
|
15692
15555
|
fetchAllMaybeMint as fetchAllMaybeMint26,
|
|
15693
15556
|
findAssociatedTokenPda as findAssociatedTokenPda33
|
|
15694
15557
|
} from "@solana-program/token-2022";
|
|
15695
15558
|
import assert26 from "assert";
|
|
15696
|
-
async function
|
|
15697
|
-
const
|
|
15698
|
-
|
|
15699
|
-
|
|
15559
|
+
async function openTunaSpotPositionInstructions(rpc, authority, poolAddress, args) {
|
|
15560
|
+
const poolAccount = await fetchEncodedAccount8(rpc, poolAddress);
|
|
15561
|
+
assert26(poolAccount.exists, "Pool account not found");
|
|
15562
|
+
let pool;
|
|
15563
|
+
if (poolAccount.programAddress == FUSIONAMM_PROGRAM_ADDRESS14) {
|
|
15564
|
+
pool = decodeAccount8(poolAccount, getFusionPoolDecoder());
|
|
15565
|
+
} else if (poolAccount.programAddress == WHIRLPOOL_PROGRAM_ADDRESS14) {
|
|
15566
|
+
pool = decodeAccount8(poolAccount, getWhirlpoolDecoder());
|
|
15567
|
+
} else {
|
|
15568
|
+
throw new Error("Incorrect Fusion or Orca pool account");
|
|
15569
|
+
}
|
|
15570
|
+
const [mintA, mintB] = await fetchAllMaybeMint26(rpc, [pool.data.tokenMintA, pool.data.tokenMintB]);
|
|
15700
15571
|
assert26(mintA.exists, "Token A account not found");
|
|
15701
15572
|
assert26(mintB.exists, "Token B account not found");
|
|
15702
|
-
const ix = await
|
|
15573
|
+
const ix = await openTunaSpotPositionInstruction(authority, mintA, mintB, poolAddress, args);
|
|
15703
15574
|
return [ix];
|
|
15704
15575
|
}
|
|
15705
|
-
async function
|
|
15706
|
-
const tunaPositionAddress = (await getTunaSpotPositionAddress(authority.address,
|
|
15576
|
+
async function openTunaSpotPositionInstruction(authority, mintA, mintB, poolAddress, args) {
|
|
15577
|
+
const tunaPositionAddress = (await getTunaSpotPositionAddress(authority.address, poolAddress))[0];
|
|
15707
15578
|
const tunaPositionAtaA = (await findAssociatedTokenPda33({
|
|
15708
15579
|
owner: tunaPositionAddress,
|
|
15709
15580
|
mint: mintA.address,
|
|
@@ -15714,7 +15585,7 @@ async function openTunaSpotPositionFusionInstruction(authority, mintA, mintB, fu
|
|
|
15714
15585
|
mint: mintB.address,
|
|
15715
15586
|
tokenProgram: mintB.programAddress
|
|
15716
15587
|
}))[0];
|
|
15717
|
-
return
|
|
15588
|
+
return getOpenTunaSpotPositionInstruction({
|
|
15718
15589
|
authority,
|
|
15719
15590
|
mintA: mintA.address,
|
|
15720
15591
|
mintB: mintB.address,
|
|
@@ -15723,65 +15594,21 @@ async function openTunaSpotPositionFusionInstruction(authority, mintA, mintB, fu
|
|
|
15723
15594
|
tunaPosition: tunaPositionAddress,
|
|
15724
15595
|
tunaPositionAtaA,
|
|
15725
15596
|
tunaPositionAtaB,
|
|
15726
|
-
|
|
15597
|
+
pool: poolAddress,
|
|
15727
15598
|
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ADDRESS7,
|
|
15728
15599
|
...args
|
|
15729
15600
|
});
|
|
15730
15601
|
}
|
|
15731
15602
|
|
|
15732
|
-
// src/txbuilder/openTunaSpotPositionOrca.ts
|
|
15733
|
-
import { fetchMaybeWhirlpool as fetchMaybeWhirlpool10 } from "@orca-so/whirlpools-client";
|
|
15734
|
-
import {
|
|
15735
|
-
ASSOCIATED_TOKEN_PROGRAM_ADDRESS as ASSOCIATED_TOKEN_PROGRAM_ADDRESS8,
|
|
15736
|
-
fetchAllMaybeMint as fetchAllMaybeMint27,
|
|
15737
|
-
findAssociatedTokenPda as findAssociatedTokenPda34
|
|
15738
|
-
} from "@solana-program/token-2022";
|
|
15739
|
-
import assert27 from "assert";
|
|
15740
|
-
async function openTunaSpotPositionOrcaInstructions(rpc, authority, whirlpoolAddress, args) {
|
|
15741
|
-
const whirlpool = await fetchMaybeWhirlpool10(rpc, whirlpoolAddress);
|
|
15742
|
-
if (!whirlpool.exists) throw new Error("Whirlpool account not found");
|
|
15743
|
-
const [mintA, mintB] = await fetchAllMaybeMint27(rpc, [whirlpool.data.tokenMintA, whirlpool.data.tokenMintB]);
|
|
15744
|
-
assert27(mintA.exists, "Token A account not found");
|
|
15745
|
-
assert27(mintB.exists, "Token B account not found");
|
|
15746
|
-
const ix = await openTunaSpotPositionOrcaInstruction(authority, mintA, mintB, whirlpoolAddress, args);
|
|
15747
|
-
return [ix];
|
|
15748
|
-
}
|
|
15749
|
-
async function openTunaSpotPositionOrcaInstruction(authority, mintA, mintB, whirlpoolAddress, args) {
|
|
15750
|
-
const tunaPositionAddress = (await getTunaSpotPositionAddress(authority.address, whirlpoolAddress))[0];
|
|
15751
|
-
const tunaPositionAtaA = (await findAssociatedTokenPda34({
|
|
15752
|
-
owner: tunaPositionAddress,
|
|
15753
|
-
mint: mintA.address,
|
|
15754
|
-
tokenProgram: mintA.programAddress
|
|
15755
|
-
}))[0];
|
|
15756
|
-
const tunaPositionAtaB = (await findAssociatedTokenPda34({
|
|
15757
|
-
owner: tunaPositionAddress,
|
|
15758
|
-
mint: mintB.address,
|
|
15759
|
-
tokenProgram: mintB.programAddress
|
|
15760
|
-
}))[0];
|
|
15761
|
-
return getOpenTunaSpotPositionOrcaInstruction({
|
|
15762
|
-
authority,
|
|
15763
|
-
mintA: mintA.address,
|
|
15764
|
-
mintB: mintB.address,
|
|
15765
|
-
tokenProgramA: mintA.programAddress,
|
|
15766
|
-
tokenProgramB: mintB.programAddress,
|
|
15767
|
-
tunaPosition: tunaPositionAddress,
|
|
15768
|
-
tunaPositionAtaA,
|
|
15769
|
-
tunaPositionAtaB,
|
|
15770
|
-
whirlpool: whirlpoolAddress,
|
|
15771
|
-
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ADDRESS8,
|
|
15772
|
-
...args
|
|
15773
|
-
});
|
|
15774
|
-
}
|
|
15775
|
-
|
|
15776
15603
|
// src/txbuilder/decreaseTunaLpPositionOrca.ts
|
|
15777
15604
|
import {
|
|
15778
15605
|
fetchAllTickArray as fetchAllTickArray2,
|
|
15779
|
-
fetchMaybeWhirlpool as
|
|
15606
|
+
fetchMaybeWhirlpool as fetchMaybeWhirlpool10,
|
|
15780
15607
|
fetchPosition as fetchPosition3,
|
|
15781
15608
|
getOracleAddress as getOracleAddress10,
|
|
15782
15609
|
getPositionAddress as getPositionAddress17,
|
|
15783
15610
|
getTickArrayAddress as getTickArrayAddress8,
|
|
15784
|
-
WHIRLPOOL_PROGRAM_ADDRESS as
|
|
15611
|
+
WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS15
|
|
15785
15612
|
} from "@orca-so/whirlpools-client";
|
|
15786
15613
|
import { collectRewardsQuote as collectRewardsQuote2, getTickArrayStartTickIndex as getTickArrayStartTickIndex8, getTickIndexInArray as getTickIndexInArray2 } from "@orca-so/whirlpools-core";
|
|
15787
15614
|
import {
|
|
@@ -15790,29 +15617,29 @@ import {
|
|
|
15790
15617
|
} from "@solana/kit";
|
|
15791
15618
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS24 } from "@solana-program/memo";
|
|
15792
15619
|
import {
|
|
15793
|
-
fetchAllMaybeMint as
|
|
15794
|
-
findAssociatedTokenPda as
|
|
15620
|
+
fetchAllMaybeMint as fetchAllMaybeMint27,
|
|
15621
|
+
findAssociatedTokenPda as findAssociatedTokenPda34,
|
|
15795
15622
|
TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS17
|
|
15796
15623
|
} from "@solana-program/token-2022";
|
|
15797
|
-
import
|
|
15624
|
+
import assert27 from "assert";
|
|
15798
15625
|
async function decreaseTunaLpPositionOrcaInstructions(rpc, authority, positionMint, args, createInstructions, cleanupInstructions) {
|
|
15799
15626
|
const tunaPosition = await fetchMaybeTunaLpPosition(rpc, (await getTunaLpPositionAddress(positionMint))[0]);
|
|
15800
15627
|
if (!tunaPosition.exists) throw new Error("Tuna position account not found");
|
|
15801
15628
|
const orcaPosition = await fetchPosition3(rpc, (await getPositionAddress17(positionMint))[0]);
|
|
15802
|
-
const whirlpool = await
|
|
15629
|
+
const whirlpool = await fetchMaybeWhirlpool10(rpc, tunaPosition.data.pool);
|
|
15803
15630
|
if (!whirlpool.exists) throw new Error("Whirlpool account not found");
|
|
15804
15631
|
const [vaultA, vaultB] = await fetchAllVault(rpc, [
|
|
15805
15632
|
(await getLendingVaultAddress(whirlpool.data.tokenMintA))[0],
|
|
15806
15633
|
(await getLendingVaultAddress(whirlpool.data.tokenMintB))[0]
|
|
15807
15634
|
]);
|
|
15808
|
-
const [mintA, mintB, ...rewardMints] = await
|
|
15635
|
+
const [mintA, mintB, ...rewardMints] = await fetchAllMaybeMint27(rpc, [
|
|
15809
15636
|
whirlpool.data.tokenMintA,
|
|
15810
15637
|
whirlpool.data.tokenMintB,
|
|
15811
15638
|
...whirlpool.data.rewardInfos.map((x) => x.mint).filter((x) => x !== DEFAULT_ADDRESS)
|
|
15812
15639
|
]);
|
|
15813
15640
|
const allMints = [mintA, mintB, ...rewardMints];
|
|
15814
|
-
|
|
15815
|
-
|
|
15641
|
+
assert27(mintA.exists, "Token A account not found");
|
|
15642
|
+
assert27(mintB.exists, "Token B account not found");
|
|
15816
15643
|
assertAccountsExist9(rewardMints);
|
|
15817
15644
|
const lowerTickArrayStartIndex = getTickArrayStartTickIndex8(
|
|
15818
15645
|
tunaPosition.data.tickLowerIndex,
|
|
@@ -15853,7 +15680,7 @@ async function decreaseTunaLpPositionOrcaInstructions(rpc, authority, positionMi
|
|
|
15853
15680
|
}
|
|
15854
15681
|
for (const mintAddress of requiredMints) {
|
|
15855
15682
|
const mint = allMints.find((mint2) => mint2.address == mintAddress);
|
|
15856
|
-
|
|
15683
|
+
assert27(mint && mint.exists);
|
|
15857
15684
|
const ixs = await getCreateAtaInstructions(rpc, authority, mint.address, authority.address, mint.programAddress);
|
|
15858
15685
|
createInstructions.push(...ixs.init);
|
|
15859
15686
|
internalCleanupInstructions.push(...ixs.cleanup);
|
|
@@ -15881,37 +15708,37 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
15881
15708
|
const marketAddress = (await getMarketAddress(whirlpool.address))[0];
|
|
15882
15709
|
const orcaPositionAddress = (await getPositionAddress17(positionMint))[0];
|
|
15883
15710
|
const orcaOracleAddress = (await getOracleAddress10(whirlpool.address))[0];
|
|
15884
|
-
const tunaPositionAta = (await
|
|
15711
|
+
const tunaPositionAta = (await findAssociatedTokenPda34({
|
|
15885
15712
|
owner: tunaPosition.address,
|
|
15886
15713
|
mint: positionMint,
|
|
15887
15714
|
tokenProgram: TOKEN_2022_PROGRAM_ADDRESS17
|
|
15888
15715
|
}))[0];
|
|
15889
|
-
const tunaPositionOwnerAtaA = (await
|
|
15716
|
+
const tunaPositionOwnerAtaA = (await findAssociatedTokenPda34({
|
|
15890
15717
|
owner: authority.address,
|
|
15891
15718
|
mint: mintA.address,
|
|
15892
15719
|
tokenProgram: mintA.programAddress
|
|
15893
15720
|
}))[0];
|
|
15894
|
-
const tunaPositionOwnerAtaB = (await
|
|
15721
|
+
const tunaPositionOwnerAtaB = (await findAssociatedTokenPda34({
|
|
15895
15722
|
owner: authority.address,
|
|
15896
15723
|
mint: mintB.address,
|
|
15897
15724
|
tokenProgram: mintB.programAddress
|
|
15898
15725
|
}))[0];
|
|
15899
|
-
const tunaPositionAtaA = (await
|
|
15726
|
+
const tunaPositionAtaA = (await findAssociatedTokenPda34({
|
|
15900
15727
|
owner: tunaPosition.address,
|
|
15901
15728
|
mint: mintA.address,
|
|
15902
15729
|
tokenProgram: mintA.programAddress
|
|
15903
15730
|
}))[0];
|
|
15904
|
-
const tunaPositionAtaB = (await
|
|
15731
|
+
const tunaPositionAtaB = (await findAssociatedTokenPda34({
|
|
15905
15732
|
owner: tunaPosition.address,
|
|
15906
15733
|
mint: mintB.address,
|
|
15907
15734
|
tokenProgram: mintB.programAddress
|
|
15908
15735
|
}))[0];
|
|
15909
|
-
const vaultAAta = (await
|
|
15736
|
+
const vaultAAta = (await findAssociatedTokenPda34({
|
|
15910
15737
|
owner: vaultA.address,
|
|
15911
15738
|
mint: mintA.address,
|
|
15912
15739
|
tokenProgram: mintA.programAddress
|
|
15913
15740
|
}))[0];
|
|
15914
|
-
const vaultBAta = (await
|
|
15741
|
+
const vaultBAta = (await findAssociatedTokenPda34({
|
|
15915
15742
|
owner: vaultB.address,
|
|
15916
15743
|
mint: mintB.address,
|
|
15917
15744
|
tokenProgram: mintB.programAddress
|
|
@@ -15940,8 +15767,8 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
15940
15767
|
for (const rewardIndex of rewardIndicesToClaim) {
|
|
15941
15768
|
const rewardInfo = whirlpool.data.rewardInfos[rewardIndex];
|
|
15942
15769
|
const rewardMint = rewardMints.find((mint) => mint.address == rewardInfo.mint);
|
|
15943
|
-
|
|
15944
|
-
const ownerAta = await
|
|
15770
|
+
assert27(rewardMint, "Reward mint not found in the provided reward mint accounts");
|
|
15771
|
+
const ownerAta = await findAssociatedTokenPda34({
|
|
15945
15772
|
owner: authority.address,
|
|
15946
15773
|
mint: rewardMint.address,
|
|
15947
15774
|
tokenProgram: rewardMint.programAddress
|
|
@@ -15984,7 +15811,7 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
15984
15811
|
orcaPosition: orcaPositionAddress,
|
|
15985
15812
|
tunaPosition: tunaPosition.address,
|
|
15986
15813
|
whirlpool: whirlpool.address,
|
|
15987
|
-
whirlpoolProgram:
|
|
15814
|
+
whirlpoolProgram: WHIRLPOOL_PROGRAM_ADDRESS15,
|
|
15988
15815
|
tokenProgramA: mintA.programAddress,
|
|
15989
15816
|
tokenProgramB: mintB.programAddress,
|
|
15990
15817
|
memoProgram: MEMO_PROGRAM_ADDRESS24,
|
|
@@ -15997,8 +15824,8 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
15997
15824
|
|
|
15998
15825
|
// src/txbuilder/decreaseTunaLpPositionFusion.ts
|
|
15999
15826
|
import {
|
|
16000
|
-
fetchMaybeFusionPool as
|
|
16001
|
-
FUSIONAMM_PROGRAM_ADDRESS as
|
|
15827
|
+
fetchMaybeFusionPool as fetchMaybeFusionPool10,
|
|
15828
|
+
FUSIONAMM_PROGRAM_ADDRESS as FUSIONAMM_PROGRAM_ADDRESS15,
|
|
16002
15829
|
getPositionAddress as getPositionAddress18
|
|
16003
15830
|
} from "@crypticdot/fusionamm-client";
|
|
16004
15831
|
import {
|
|
@@ -16006,23 +15833,23 @@ import {
|
|
|
16006
15833
|
} from "@solana/kit";
|
|
16007
15834
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS25 } from "@solana-program/memo";
|
|
16008
15835
|
import {
|
|
16009
|
-
fetchAllMaybeMint as
|
|
16010
|
-
findAssociatedTokenPda as
|
|
15836
|
+
fetchAllMaybeMint as fetchAllMaybeMint28,
|
|
15837
|
+
findAssociatedTokenPda as findAssociatedTokenPda35,
|
|
16011
15838
|
TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS18
|
|
16012
15839
|
} from "@solana-program/token-2022";
|
|
16013
|
-
import
|
|
15840
|
+
import assert28 from "assert";
|
|
16014
15841
|
async function decreaseTunaLpPositionFusionInstructions(rpc, authority, positionMint, args, createInstructions, cleanupInstructions) {
|
|
16015
15842
|
const tunaPosition = await fetchMaybeTunaLpPosition(rpc, (await getTunaLpPositionAddress(positionMint))[0]);
|
|
16016
15843
|
if (!tunaPosition.exists) throw new Error("Tuna position account not found");
|
|
16017
|
-
const fusionPool = await
|
|
15844
|
+
const fusionPool = await fetchMaybeFusionPool10(rpc, tunaPosition.data.pool);
|
|
16018
15845
|
if (!fusionPool.exists) throw new Error("FusionPool account not found");
|
|
16019
15846
|
const [vaultA, vaultB] = await fetchAllVault(rpc, [
|
|
16020
15847
|
(await getLendingVaultAddress(fusionPool.data.tokenMintA))[0],
|
|
16021
15848
|
(await getLendingVaultAddress(fusionPool.data.tokenMintB))[0]
|
|
16022
15849
|
]);
|
|
16023
|
-
const [mintA, mintB] = await
|
|
16024
|
-
|
|
16025
|
-
|
|
15850
|
+
const [mintA, mintB] = await fetchAllMaybeMint28(rpc, [fusionPool.data.tokenMintA, fusionPool.data.tokenMintB]);
|
|
15851
|
+
assert28(mintA.exists, "Token A account not found");
|
|
15852
|
+
assert28(mintB.exists, "Token B account not found");
|
|
16026
15853
|
const instructions = [];
|
|
16027
15854
|
if (!createInstructions) createInstructions = instructions;
|
|
16028
15855
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
@@ -16063,37 +15890,37 @@ async function decreaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16063
15890
|
const tunaConfig = (await getTunaConfigAddress())[0];
|
|
16064
15891
|
const marketAddress = (await getMarketAddress(fusionPool.address))[0];
|
|
16065
15892
|
const fusionPositionAddress = (await getPositionAddress18(positionMint))[0];
|
|
16066
|
-
const tunaPositionAta = (await
|
|
15893
|
+
const tunaPositionAta = (await findAssociatedTokenPda35({
|
|
16067
15894
|
owner: tunaPosition.address,
|
|
16068
15895
|
mint: positionMint,
|
|
16069
15896
|
tokenProgram: TOKEN_2022_PROGRAM_ADDRESS18
|
|
16070
15897
|
}))[0];
|
|
16071
|
-
const tunaPositionOwnerAtaA = (await
|
|
15898
|
+
const tunaPositionOwnerAtaA = (await findAssociatedTokenPda35({
|
|
16072
15899
|
owner: authority.address,
|
|
16073
15900
|
mint: mintA.address,
|
|
16074
15901
|
tokenProgram: mintA.programAddress
|
|
16075
15902
|
}))[0];
|
|
16076
|
-
const tunaPositionOwnerAtaB = (await
|
|
15903
|
+
const tunaPositionOwnerAtaB = (await findAssociatedTokenPda35({
|
|
16077
15904
|
owner: authority.address,
|
|
16078
15905
|
mint: mintB.address,
|
|
16079
15906
|
tokenProgram: mintB.programAddress
|
|
16080
15907
|
}))[0];
|
|
16081
|
-
const tunaPositionAtaA = (await
|
|
15908
|
+
const tunaPositionAtaA = (await findAssociatedTokenPda35({
|
|
16082
15909
|
owner: tunaPosition.address,
|
|
16083
15910
|
mint: mintA.address,
|
|
16084
15911
|
tokenProgram: mintA.programAddress
|
|
16085
15912
|
}))[0];
|
|
16086
|
-
const tunaPositionAtaB = (await
|
|
15913
|
+
const tunaPositionAtaB = (await findAssociatedTokenPda35({
|
|
16087
15914
|
owner: tunaPosition.address,
|
|
16088
15915
|
mint: mintB.address,
|
|
16089
15916
|
tokenProgram: mintB.programAddress
|
|
16090
15917
|
}))[0];
|
|
16091
|
-
const vaultAAta = (await
|
|
15918
|
+
const vaultAAta = (await findAssociatedTokenPda35({
|
|
16092
15919
|
owner: vaultA.address,
|
|
16093
15920
|
mint: mintA.address,
|
|
16094
15921
|
tokenProgram: mintA.programAddress
|
|
16095
15922
|
}))[0];
|
|
16096
|
-
const vaultBAta = (await
|
|
15923
|
+
const vaultBAta = (await findAssociatedTokenPda35({
|
|
16097
15924
|
owner: vaultB.address,
|
|
16098
15925
|
mint: mintB.address,
|
|
16099
15926
|
tokenProgram: mintB.programAddress
|
|
@@ -16147,7 +15974,7 @@ async function decreaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16147
15974
|
fusionPosition: fusionPositionAddress,
|
|
16148
15975
|
tunaPosition: tunaPosition.address,
|
|
16149
15976
|
fusionPool: fusionPool.address,
|
|
16150
|
-
fusionammProgram:
|
|
15977
|
+
fusionammProgram: FUSIONAMM_PROGRAM_ADDRESS15,
|
|
16151
15978
|
tokenProgramA: mintA.programAddress,
|
|
16152
15979
|
tokenProgramB: mintB.programAddress,
|
|
16153
15980
|
memoProgram: MEMO_PROGRAM_ADDRESS25,
|
|
@@ -16160,18 +15987,18 @@ async function decreaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16160
15987
|
|
|
16161
15988
|
// src/txbuilder/repayBadDebt.ts
|
|
16162
15989
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS26 } from "@solana-program/memo";
|
|
16163
|
-
import { fetchMaybeMint as fetchMaybeMint2, findAssociatedTokenPda as
|
|
15990
|
+
import { fetchMaybeMint as fetchMaybeMint2, findAssociatedTokenPda as findAssociatedTokenPda36 } from "@solana-program/token-2022";
|
|
16164
15991
|
async function repayBadDebtInstruction(rpc, authority, mintAddress, funds, shares) {
|
|
16165
15992
|
const mint = await fetchMaybeMint2(rpc, mintAddress);
|
|
16166
15993
|
if (!mint.exists) throw new Error("Mint account not found");
|
|
16167
15994
|
const tunaConfig = (await getTunaConfigAddress())[0];
|
|
16168
15995
|
const vault = (await getLendingVaultAddress(mint.address))[0];
|
|
16169
|
-
const vaultAta = (await
|
|
15996
|
+
const vaultAta = (await findAssociatedTokenPda36({
|
|
16170
15997
|
owner: vault,
|
|
16171
15998
|
mint: mint.address,
|
|
16172
15999
|
tokenProgram: mint.programAddress
|
|
16173
16000
|
}))[0];
|
|
16174
|
-
const authorityAta = (await
|
|
16001
|
+
const authorityAta = (await findAssociatedTokenPda36({
|
|
16175
16002
|
owner: authority.address,
|
|
16176
16003
|
mint: mint.address,
|
|
16177
16004
|
tokenProgram: mint.programAddress
|
|
@@ -16216,20 +16043,20 @@ async function setTunaSpotPositionLimitOrdersInstruction(authority, poolAddress,
|
|
|
16216
16043
|
}
|
|
16217
16044
|
|
|
16218
16045
|
// src/txbuilder/resetTunaSpotPosition.ts
|
|
16219
|
-
import { fetchAllMaybeMint as
|
|
16220
|
-
import
|
|
16046
|
+
import { fetchAllMaybeMint as fetchAllMaybeMint29, findAssociatedTokenPda as findAssociatedTokenPda37 } from "@solana-program/token-2022";
|
|
16047
|
+
import assert29 from "assert";
|
|
16221
16048
|
async function resetTunaSpotPositionInstruction(rpc, authority, poolAddress, args) {
|
|
16222
16049
|
const tunaPositionAddress = (await getTunaSpotPositionAddress(authority.address, poolAddress))[0];
|
|
16223
16050
|
const tunaPosition = await fetchTunaSpotPosition(rpc, tunaPositionAddress);
|
|
16224
|
-
const [mintA, mintB] = await
|
|
16225
|
-
|
|
16226
|
-
|
|
16227
|
-
const tunaPositionAtaA = (await
|
|
16051
|
+
const [mintA, mintB] = await fetchAllMaybeMint29(rpc, [tunaPosition.data.mintA, tunaPosition.data.mintB]);
|
|
16052
|
+
assert29(mintA.exists, "Token A not found");
|
|
16053
|
+
assert29(mintB.exists, "Token B not found");
|
|
16054
|
+
const tunaPositionAtaA = (await findAssociatedTokenPda37({
|
|
16228
16055
|
owner: tunaPositionAddress,
|
|
16229
16056
|
mint: mintA.address,
|
|
16230
16057
|
tokenProgram: mintA.programAddress
|
|
16231
16058
|
}))[0];
|
|
16232
|
-
const tunaPositionAtaB = (await
|
|
16059
|
+
const tunaPositionAtaB = (await findAssociatedTokenPda37({
|
|
16233
16060
|
owner: tunaPositionAddress,
|
|
16234
16061
|
mint: mintB.address,
|
|
16235
16062
|
tokenProgram: mintB.programAddress
|
|
@@ -16271,7 +16098,7 @@ async function updateVaultInstruction(authority, mint, args) {
|
|
|
16271
16098
|
|
|
16272
16099
|
// src/txbuilder/withdraw.ts
|
|
16273
16100
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS27 } from "@solana-program/memo";
|
|
16274
|
-
import { fetchMaybeMint as fetchMaybeMint3, findAssociatedTokenPda as
|
|
16101
|
+
import { fetchMaybeMint as fetchMaybeMint3, findAssociatedTokenPda as findAssociatedTokenPda38 } from "@solana-program/token-2022";
|
|
16275
16102
|
async function withdrawInstructions(rpc, authority, mintAddress, funds, shares) {
|
|
16276
16103
|
const instructions = [];
|
|
16277
16104
|
const mint = await fetchMaybeMint3(rpc, mintAddress);
|
|
@@ -16293,12 +16120,12 @@ async function withdrawInstruction(authority, mint, funds, shares) {
|
|
|
16293
16120
|
const tunaConfig = (await getTunaConfigAddress())[0];
|
|
16294
16121
|
const lendingPosition = (await getLendingPositionAddress(authority.address, mint.address))[0];
|
|
16295
16122
|
const vault = (await getLendingVaultAddress(mint.address))[0];
|
|
16296
|
-
const vaultAta = (await
|
|
16123
|
+
const vaultAta = (await findAssociatedTokenPda38({
|
|
16297
16124
|
owner: vault,
|
|
16298
16125
|
mint: mint.address,
|
|
16299
16126
|
tokenProgram: mint.programAddress
|
|
16300
16127
|
}))[0];
|
|
16301
|
-
const authorityAta = (await
|
|
16128
|
+
const authorityAta = (await findAssociatedTokenPda38({
|
|
16302
16129
|
owner: authority.address,
|
|
16303
16130
|
mint: mint.address,
|
|
16304
16131
|
tokenProgram: mint.programAddress
|
|
@@ -16319,8 +16146,8 @@ async function withdrawInstruction(authority, mint, funds, shares) {
|
|
|
16319
16146
|
}
|
|
16320
16147
|
|
|
16321
16148
|
// src/txbuilder/createMarketLookupTable.ts
|
|
16322
|
-
import { fetchFusionPool as fetchFusionPool4, FP_NFT_UPDATE_AUTH as FP_NFT_UPDATE_AUTH3, FUSIONAMM_PROGRAM_ADDRESS as
|
|
16323
|
-
import { fetchWhirlpool as fetchWhirlpool4, getOracleAddress as getOracleAddress11, WHIRLPOOL_PROGRAM_ADDRESS as
|
|
16149
|
+
import { fetchFusionPool as fetchFusionPool4, FP_NFT_UPDATE_AUTH as FP_NFT_UPDATE_AUTH3, FUSIONAMM_PROGRAM_ADDRESS as FUSIONAMM_PROGRAM_ADDRESS16 } from "@crypticdot/fusionamm-client";
|
|
16150
|
+
import { fetchWhirlpool as fetchWhirlpool4, getOracleAddress as getOracleAddress11, WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS16 } from "@orca-so/whirlpools-client";
|
|
16324
16151
|
import {
|
|
16325
16152
|
address as address3
|
|
16326
16153
|
} from "@solana/kit";
|
|
@@ -16329,9 +16156,9 @@ import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS28 } from "@solana-program/
|
|
|
16329
16156
|
import { SYSTEM_PROGRAM_ADDRESS } from "@solana-program/system";
|
|
16330
16157
|
import { TOKEN_PROGRAM_ADDRESS as TOKEN_PROGRAM_ADDRESS2 } from "@solana-program/token";
|
|
16331
16158
|
import {
|
|
16332
|
-
ASSOCIATED_TOKEN_PROGRAM_ADDRESS as
|
|
16159
|
+
ASSOCIATED_TOKEN_PROGRAM_ADDRESS as ASSOCIATED_TOKEN_PROGRAM_ADDRESS8,
|
|
16333
16160
|
fetchMint,
|
|
16334
|
-
findAssociatedTokenPda as
|
|
16161
|
+
findAssociatedTokenPda as findAssociatedTokenPda39,
|
|
16335
16162
|
TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS19
|
|
16336
16163
|
} from "@solana-program/token-2022";
|
|
16337
16164
|
async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
@@ -16342,12 +16169,12 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
|
16342
16169
|
const pool = marketMaker == 0 /* Orca */ ? await fetchWhirlpool4(rpc, poolAddress) : await fetchFusionPool4(rpc, poolAddress);
|
|
16343
16170
|
const mintA = await fetchMint(rpc, pool.data.tokenMintA);
|
|
16344
16171
|
const mintB = await fetchMint(rpc, pool.data.tokenMintB);
|
|
16345
|
-
const feeRecipientAtaA = (await
|
|
16172
|
+
const feeRecipientAtaA = (await findAssociatedTokenPda39({
|
|
16346
16173
|
owner: tunaConfig.data.feeRecipient,
|
|
16347
16174
|
mint: mintA.address,
|
|
16348
16175
|
tokenProgram: mintA.programAddress
|
|
16349
16176
|
}))[0];
|
|
16350
|
-
const feeRecipientAtaB = (await
|
|
16177
|
+
const feeRecipientAtaB = (await findAssociatedTokenPda39({
|
|
16351
16178
|
owner: tunaConfig.data.feeRecipient,
|
|
16352
16179
|
mint: mintB.address,
|
|
16353
16180
|
tokenProgram: mintB.programAddress
|
|
@@ -16356,12 +16183,12 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
|
16356
16183
|
(await getLendingVaultAddress(mintA.address))[0],
|
|
16357
16184
|
(await getLendingVaultAddress(mintB.address))[0]
|
|
16358
16185
|
]);
|
|
16359
|
-
const vaultAAta = (await
|
|
16186
|
+
const vaultAAta = (await findAssociatedTokenPda39({
|
|
16360
16187
|
owner: vaultA.address,
|
|
16361
16188
|
mint: mintA.address,
|
|
16362
16189
|
tokenProgram: mintA.programAddress
|
|
16363
16190
|
}))[0];
|
|
16364
|
-
const vaultBAta = (await
|
|
16191
|
+
const vaultBAta = (await findAssociatedTokenPda39({
|
|
16365
16192
|
owner: vaultB.address,
|
|
16366
16193
|
mint: mintB.address,
|
|
16367
16194
|
tokenProgram: mintB.programAddress
|
|
@@ -16369,7 +16196,7 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
|
16369
16196
|
const addresses = [
|
|
16370
16197
|
SYSTEM_PROGRAM_ADDRESS,
|
|
16371
16198
|
address3("SysvarRent111111111111111111111111111111111"),
|
|
16372
|
-
|
|
16199
|
+
ASSOCIATED_TOKEN_PROGRAM_ADDRESS8,
|
|
16373
16200
|
TOKEN_PROGRAM_ADDRESS2,
|
|
16374
16201
|
TOKEN_2022_PROGRAM_ADDRESS19,
|
|
16375
16202
|
NATIVE_MINT,
|
|
@@ -16392,7 +16219,7 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
|
16392
16219
|
if (vaultA.data.pythOraclePriceUpdate != DEFAULT_ADDRESS) addresses.push(vaultA.data.pythOraclePriceUpdate);
|
|
16393
16220
|
if (vaultB.data.pythOraclePriceUpdate != DEFAULT_ADDRESS) addresses.push(vaultB.data.pythOraclePriceUpdate);
|
|
16394
16221
|
if (marketMaker == 0 /* Orca */) {
|
|
16395
|
-
addresses.push(
|
|
16222
|
+
addresses.push(WHIRLPOOL_PROGRAM_ADDRESS16);
|
|
16396
16223
|
addresses.push(WP_NFT_UPDATE_AUTH);
|
|
16397
16224
|
addresses.push(orcaOracleAddress);
|
|
16398
16225
|
const whirlpool = pool;
|
|
@@ -16404,7 +16231,7 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
|
16404
16231
|
}
|
|
16405
16232
|
}
|
|
16406
16233
|
} else {
|
|
16407
|
-
addresses.push(
|
|
16234
|
+
addresses.push(FUSIONAMM_PROGRAM_ADDRESS16);
|
|
16408
16235
|
addresses.push(FP_NFT_UPDATE_AUTH3);
|
|
16409
16236
|
}
|
|
16410
16237
|
return addresses;
|
|
@@ -16429,16 +16256,16 @@ async function extendAddressLookupTableForMarketInstructions(rpc, poolAddress, m
|
|
|
16429
16256
|
|
|
16430
16257
|
// src/txbuilder/repayTunaLpPositionDebt.ts
|
|
16431
16258
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS29 } from "@solana-program/memo";
|
|
16432
|
-
import { fetchAllMaybeMint as
|
|
16433
|
-
import
|
|
16259
|
+
import { fetchAllMaybeMint as fetchAllMaybeMint30, findAssociatedTokenPda as findAssociatedTokenPda40 } from "@solana-program/token-2022";
|
|
16260
|
+
import assert30 from "assert";
|
|
16434
16261
|
async function repayTunaLpPositionDebtInstructions(rpc, authority, positionMint, collateralA, collateralB, createInstructions, cleanupInstructions) {
|
|
16435
16262
|
const instructions = [];
|
|
16436
16263
|
if (!createInstructions) createInstructions = instructions;
|
|
16437
16264
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
16438
16265
|
const tunaPosition = await fetchTunaLpPosition(rpc, (await getTunaLpPositionAddress(positionMint))[0]);
|
|
16439
|
-
const [mintA, mintB] = await
|
|
16440
|
-
|
|
16441
|
-
|
|
16266
|
+
const [mintA, mintB] = await fetchAllMaybeMint30(rpc, [tunaPosition.data.mintA, tunaPosition.data.mintB]);
|
|
16267
|
+
assert30(mintA.exists, "Token A not found");
|
|
16268
|
+
assert30(mintB.exists, "Token B not found");
|
|
16442
16269
|
const marketAddress = (await getMarketAddress(tunaPosition.data.pool))[0];
|
|
16443
16270
|
const createUserAtaAInstructions = await getCreateAtaInstructions(
|
|
16444
16271
|
rpc,
|
|
@@ -16474,34 +16301,34 @@ async function repayTunaLpPositionDebtInstructions(rpc, authority, positionMint,
|
|
|
16474
16301
|
}
|
|
16475
16302
|
async function repayTunaLpPositionDebtInstruction(authority, positionMint, mintA, mintB, marketAddress, collateralA, collateralB) {
|
|
16476
16303
|
const tunaPositionAddress = (await getTunaLpPositionAddress(positionMint))[0];
|
|
16477
|
-
const tunaPositionOwnerAtaA = (await
|
|
16304
|
+
const tunaPositionOwnerAtaA = (await findAssociatedTokenPda40({
|
|
16478
16305
|
owner: authority.address,
|
|
16479
16306
|
mint: mintA.address,
|
|
16480
16307
|
tokenProgram: mintA.programAddress
|
|
16481
16308
|
}))[0];
|
|
16482
|
-
const tunaPositionOwnerAtaB = (await
|
|
16309
|
+
const tunaPositionOwnerAtaB = (await findAssociatedTokenPda40({
|
|
16483
16310
|
owner: authority.address,
|
|
16484
16311
|
mint: mintB.address,
|
|
16485
16312
|
tokenProgram: mintB.programAddress
|
|
16486
16313
|
}))[0];
|
|
16487
|
-
const tunaPositionAtaA = (await
|
|
16314
|
+
const tunaPositionAtaA = (await findAssociatedTokenPda40({
|
|
16488
16315
|
owner: tunaPositionAddress,
|
|
16489
16316
|
mint: mintA.address,
|
|
16490
16317
|
tokenProgram: mintA.programAddress
|
|
16491
16318
|
}))[0];
|
|
16492
|
-
const tunaPositionAtaB = (await
|
|
16319
|
+
const tunaPositionAtaB = (await findAssociatedTokenPda40({
|
|
16493
16320
|
owner: tunaPositionAddress,
|
|
16494
16321
|
mint: mintB.address,
|
|
16495
16322
|
tokenProgram: mintB.programAddress
|
|
16496
16323
|
}))[0];
|
|
16497
16324
|
const vaultAAddress = (await getLendingVaultAddress(mintA.address))[0];
|
|
16498
|
-
const vaultAAta = (await
|
|
16325
|
+
const vaultAAta = (await findAssociatedTokenPda40({
|
|
16499
16326
|
owner: vaultAAddress,
|
|
16500
16327
|
mint: mintA.address,
|
|
16501
16328
|
tokenProgram: mintA.programAddress
|
|
16502
16329
|
}))[0];
|
|
16503
16330
|
const vaultBAddress = (await getLendingVaultAddress(mintB.address))[0];
|
|
16504
|
-
const vaultBAta = (await
|
|
16331
|
+
const vaultBAta = (await findAssociatedTokenPda40({
|
|
16505
16332
|
owner: vaultBAddress,
|
|
16506
16333
|
mint: mintB.address,
|
|
16507
16334
|
tokenProgram: mintB.programAddress
|
|
@@ -16531,12 +16358,12 @@ async function repayTunaLpPositionDebtInstruction(authority, positionMint, mintA
|
|
|
16531
16358
|
// src/txbuilder/rebalanceTunaLpPositionOrca.ts
|
|
16532
16359
|
import {
|
|
16533
16360
|
fetchAllMaybeTickArray as fetchAllMaybeTickArray4,
|
|
16534
|
-
fetchMaybeWhirlpool as
|
|
16361
|
+
fetchMaybeWhirlpool as fetchMaybeWhirlpool11,
|
|
16535
16362
|
getDynamicTickArrayMinSize as getDynamicTickArrayMinSize2,
|
|
16536
16363
|
getInitializeDynamicTickArrayInstruction as getInitializeDynamicTickArrayInstruction3,
|
|
16537
16364
|
getOracleAddress as getOracleAddress12,
|
|
16538
16365
|
getPositionAddress as getPositionAddress19,
|
|
16539
|
-
WHIRLPOOL_PROGRAM_ADDRESS as
|
|
16366
|
+
WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS17
|
|
16540
16367
|
} from "@orca-so/whirlpools-client";
|
|
16541
16368
|
import {
|
|
16542
16369
|
AccountRole as AccountRole25,
|
|
@@ -16545,26 +16372,26 @@ import {
|
|
|
16545
16372
|
import { fetchSysvarRent as fetchSysvarRent3 } from "@solana/sysvars";
|
|
16546
16373
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS30 } from "@solana-program/memo";
|
|
16547
16374
|
import {
|
|
16548
|
-
fetchAllMaybeMint as
|
|
16549
|
-
findAssociatedTokenPda as
|
|
16375
|
+
fetchAllMaybeMint as fetchAllMaybeMint31,
|
|
16376
|
+
findAssociatedTokenPda as findAssociatedTokenPda41,
|
|
16550
16377
|
TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS20
|
|
16551
16378
|
} from "@solana-program/token-2022";
|
|
16552
|
-
import
|
|
16379
|
+
import assert31 from "assert";
|
|
16553
16380
|
async function rebalanceTunaLpPositionOrcaInstructions(rpc, authority, positionMint, createInstructions, cleanupInstructions) {
|
|
16554
16381
|
const rent = await fetchSysvarRent3(rpc);
|
|
16555
16382
|
let nonRefundableRent = 0n;
|
|
16556
16383
|
const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
|
|
16557
16384
|
const tunaPosition = await fetchMaybeTunaLpPosition(rpc, (await getTunaLpPositionAddress(positionMint))[0]);
|
|
16558
16385
|
if (!tunaPosition.exists) throw new Error("Tuna position account not found");
|
|
16559
|
-
const whirlpool = await
|
|
16386
|
+
const whirlpool = await fetchMaybeWhirlpool11(rpc, tunaPosition.data.pool);
|
|
16560
16387
|
if (!whirlpool.exists) throw new Error("Whirlpool account not found");
|
|
16561
16388
|
const [vaultA, vaultB] = await fetchAllVault(rpc, [
|
|
16562
16389
|
(await getLendingVaultAddress(whirlpool.data.tokenMintA))[0],
|
|
16563
16390
|
(await getLendingVaultAddress(whirlpool.data.tokenMintB))[0]
|
|
16564
16391
|
]);
|
|
16565
|
-
const [mintA, mintB] = await
|
|
16566
|
-
|
|
16567
|
-
|
|
16392
|
+
const [mintA, mintB] = await fetchAllMaybeMint31(rpc, [whirlpool.data.tokenMintA, whirlpool.data.tokenMintB]);
|
|
16393
|
+
assert31(mintA.exists, "Token A account not found");
|
|
16394
|
+
assert31(mintB.exists, "Token B account not found");
|
|
16568
16395
|
const instructions = [];
|
|
16569
16396
|
if (!createInstructions) createInstructions = instructions;
|
|
16570
16397
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
@@ -16636,27 +16463,27 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
16636
16463
|
const marketAddress = (await getMarketAddress(whirlpool.address))[0];
|
|
16637
16464
|
const orcaPositionAddress = (await getPositionAddress19(positionMint))[0];
|
|
16638
16465
|
const orcaOracleAddress = (await getOracleAddress12(whirlpool.address))[0];
|
|
16639
|
-
const tunaPositionAta = (await
|
|
16466
|
+
const tunaPositionAta = (await findAssociatedTokenPda41({
|
|
16640
16467
|
owner: tunaPosition.address,
|
|
16641
16468
|
mint: positionMint,
|
|
16642
16469
|
tokenProgram: TOKEN_2022_PROGRAM_ADDRESS20
|
|
16643
16470
|
}))[0];
|
|
16644
|
-
const tunaPositionAtaA = (await
|
|
16471
|
+
const tunaPositionAtaA = (await findAssociatedTokenPda41({
|
|
16645
16472
|
owner: tunaPosition.address,
|
|
16646
16473
|
mint: mintA.address,
|
|
16647
16474
|
tokenProgram: mintA.programAddress
|
|
16648
16475
|
}))[0];
|
|
16649
|
-
const tunaPositionAtaB = (await
|
|
16476
|
+
const tunaPositionAtaB = (await findAssociatedTokenPda41({
|
|
16650
16477
|
owner: tunaPosition.address,
|
|
16651
16478
|
mint: mintB.address,
|
|
16652
16479
|
tokenProgram: mintB.programAddress
|
|
16653
16480
|
}))[0];
|
|
16654
|
-
const feeRecipientAtaA = (await
|
|
16481
|
+
const feeRecipientAtaA = (await findAssociatedTokenPda41({
|
|
16655
16482
|
owner: tunaConfig.data.feeRecipient,
|
|
16656
16483
|
mint: mintA.address,
|
|
16657
16484
|
tokenProgram: mintA.programAddress
|
|
16658
16485
|
}))[0];
|
|
16659
|
-
const feeRecipientAtaB = (await
|
|
16486
|
+
const feeRecipientAtaB = (await findAssociatedTokenPda41({
|
|
16660
16487
|
owner: tunaConfig.data.feeRecipient,
|
|
16661
16488
|
mint: mintB.address,
|
|
16662
16489
|
tokenProgram: mintB.programAddress
|
|
@@ -16715,7 +16542,7 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
16715
16542
|
feeRecipientAtaA,
|
|
16716
16543
|
feeRecipientAtaB,
|
|
16717
16544
|
whirlpool: whirlpool.address,
|
|
16718
|
-
whirlpoolProgram:
|
|
16545
|
+
whirlpoolProgram: WHIRLPOOL_PROGRAM_ADDRESS17,
|
|
16719
16546
|
tokenProgramA: mintA.programAddress,
|
|
16720
16547
|
tokenProgramB: mintB.programAddress,
|
|
16721
16548
|
memoProgram: MEMO_PROGRAM_ADDRESS30,
|
|
@@ -16728,8 +16555,8 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
16728
16555
|
// src/txbuilder/rebalanceTunaLpPositionFusion.ts
|
|
16729
16556
|
import {
|
|
16730
16557
|
fetchAllMaybeTickArray as fetchAllMaybeTickArray5,
|
|
16731
|
-
fetchMaybeFusionPool as
|
|
16732
|
-
FUSIONAMM_PROGRAM_ADDRESS as
|
|
16558
|
+
fetchMaybeFusionPool as fetchMaybeFusionPool11,
|
|
16559
|
+
FUSIONAMM_PROGRAM_ADDRESS as FUSIONAMM_PROGRAM_ADDRESS17,
|
|
16733
16560
|
getInitializeTickArrayInstruction as getInitializeTickArrayInstruction3,
|
|
16734
16561
|
getPositionAddress as getPositionAddress20,
|
|
16735
16562
|
getTickArraySize as getTickArraySize2
|
|
@@ -16741,26 +16568,26 @@ import {
|
|
|
16741
16568
|
import { fetchSysvarRent as fetchSysvarRent4 } from "@solana/sysvars";
|
|
16742
16569
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS31 } from "@solana-program/memo";
|
|
16743
16570
|
import {
|
|
16744
|
-
fetchAllMaybeMint as
|
|
16745
|
-
findAssociatedTokenPda as
|
|
16571
|
+
fetchAllMaybeMint as fetchAllMaybeMint32,
|
|
16572
|
+
findAssociatedTokenPda as findAssociatedTokenPda42,
|
|
16746
16573
|
TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS21
|
|
16747
16574
|
} from "@solana-program/token-2022";
|
|
16748
|
-
import
|
|
16575
|
+
import assert32 from "assert";
|
|
16749
16576
|
async function rebalanceTunaLpPositionFusionInstructions(rpc, authority, positionMint, createInstructions, cleanupInstructions) {
|
|
16750
16577
|
const rent = await fetchSysvarRent4(rpc);
|
|
16751
16578
|
let nonRefundableRent = 0n;
|
|
16752
16579
|
const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
|
|
16753
16580
|
const tunaPosition = await fetchMaybeTunaLpPosition(rpc, (await getTunaLpPositionAddress(positionMint))[0]);
|
|
16754
16581
|
if (!tunaPosition.exists) throw new Error("Tuna position account not found");
|
|
16755
|
-
const fusionPool = await
|
|
16582
|
+
const fusionPool = await fetchMaybeFusionPool11(rpc, tunaPosition.data.pool);
|
|
16756
16583
|
if (!fusionPool.exists) throw new Error("FusionPool account not found");
|
|
16757
16584
|
const [vaultA, vaultB] = await fetchAllVault(rpc, [
|
|
16758
16585
|
(await getLendingVaultAddress(fusionPool.data.tokenMintA))[0],
|
|
16759
16586
|
(await getLendingVaultAddress(fusionPool.data.tokenMintB))[0]
|
|
16760
16587
|
]);
|
|
16761
|
-
const [mintA, mintB] = await
|
|
16762
|
-
|
|
16763
|
-
|
|
16588
|
+
const [mintA, mintB] = await fetchAllMaybeMint32(rpc, [fusionPool.data.tokenMintA, fusionPool.data.tokenMintB]);
|
|
16589
|
+
assert32(mintA.exists, "Token A account not found");
|
|
16590
|
+
assert32(mintB.exists, "Token B account not found");
|
|
16764
16591
|
const instructions = [];
|
|
16765
16592
|
if (!createInstructions) createInstructions = instructions;
|
|
16766
16593
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
@@ -16827,27 +16654,27 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16827
16654
|
const positionMint = tunaPosition.data.positionMint;
|
|
16828
16655
|
const marketAddress = (await getMarketAddress(fusionPool.address))[0];
|
|
16829
16656
|
const fusionPositionAddress = (await getPositionAddress20(positionMint))[0];
|
|
16830
|
-
const tunaPositionAta = (await
|
|
16657
|
+
const tunaPositionAta = (await findAssociatedTokenPda42({
|
|
16831
16658
|
owner: tunaPosition.address,
|
|
16832
16659
|
mint: positionMint,
|
|
16833
16660
|
tokenProgram: TOKEN_2022_PROGRAM_ADDRESS21
|
|
16834
16661
|
}))[0];
|
|
16835
|
-
const tunaPositionAtaA = (await
|
|
16662
|
+
const tunaPositionAtaA = (await findAssociatedTokenPda42({
|
|
16836
16663
|
owner: tunaPosition.address,
|
|
16837
16664
|
mint: mintA.address,
|
|
16838
16665
|
tokenProgram: mintA.programAddress
|
|
16839
16666
|
}))[0];
|
|
16840
|
-
const tunaPositionAtaB = (await
|
|
16667
|
+
const tunaPositionAtaB = (await findAssociatedTokenPda42({
|
|
16841
16668
|
owner: tunaPosition.address,
|
|
16842
16669
|
mint: mintB.address,
|
|
16843
16670
|
tokenProgram: mintB.programAddress
|
|
16844
16671
|
}))[0];
|
|
16845
|
-
const feeRecipientAtaA = (await
|
|
16672
|
+
const feeRecipientAtaA = (await findAssociatedTokenPda42({
|
|
16846
16673
|
owner: tunaConfig.data.feeRecipient,
|
|
16847
16674
|
mint: mintA.address,
|
|
16848
16675
|
tokenProgram: mintA.programAddress
|
|
16849
16676
|
}))[0];
|
|
16850
|
-
const feeRecipientAtaB = (await
|
|
16677
|
+
const feeRecipientAtaB = (await findAssociatedTokenPda42({
|
|
16851
16678
|
owner: tunaConfig.data.feeRecipient,
|
|
16852
16679
|
mint: mintB.address,
|
|
16853
16680
|
tokenProgram: mintB.programAddress
|
|
@@ -16904,7 +16731,7 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16904
16731
|
feeRecipientAtaA,
|
|
16905
16732
|
feeRecipientAtaB,
|
|
16906
16733
|
fusionPool: fusionPool.address,
|
|
16907
|
-
fusionammProgram:
|
|
16734
|
+
fusionammProgram: FUSIONAMM_PROGRAM_ADDRESS17,
|
|
16908
16735
|
tokenProgramA: mintA.programAddress,
|
|
16909
16736
|
tokenProgramB: mintB.programAddress,
|
|
16910
16737
|
memoProgram: MEMO_PROGRAM_ADDRESS31,
|
|
@@ -16973,8 +16800,7 @@ export {
|
|
|
16973
16800
|
OPEN_LENDING_POSITION_DISCRIMINATOR,
|
|
16974
16801
|
OPEN_TUNA_LP_POSITION_FUSION_DISCRIMINATOR,
|
|
16975
16802
|
OPEN_TUNA_LP_POSITION_ORCA_DISCRIMINATOR,
|
|
16976
|
-
|
|
16977
|
-
OPEN_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR,
|
|
16803
|
+
OPEN_TUNA_SPOT_POSITION_DISCRIMINATOR,
|
|
16978
16804
|
OrcaUtils,
|
|
16979
16805
|
PoolToken,
|
|
16980
16806
|
REBALANCE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR,
|
|
@@ -17008,6 +16834,7 @@ export {
|
|
|
17008
16834
|
TUNA_ERROR__INVALID_INSTRUCTION_ARGUMENTS,
|
|
17009
16835
|
TUNA_ERROR__INVALID_JUPITER_ROUTE,
|
|
17010
16836
|
TUNA_ERROR__INVALID_MARKET_MAKER,
|
|
16837
|
+
TUNA_ERROR__INVALID_POOL,
|
|
17011
16838
|
TUNA_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH,
|
|
17012
16839
|
TUNA_ERROR__INVALID_SQRT_PRICE_LIMIT_DIRECTION,
|
|
17013
16840
|
TUNA_ERROR__INVALID_TICK_ARRAY_SEQUENCE,
|
|
@@ -17349,16 +17176,11 @@ export {
|
|
|
17349
17176
|
getOpenTunaLpPositionOrcaInstructionDataCodec,
|
|
17350
17177
|
getOpenTunaLpPositionOrcaInstructionDataDecoder,
|
|
17351
17178
|
getOpenTunaLpPositionOrcaInstructionDataEncoder,
|
|
17352
|
-
|
|
17353
|
-
|
|
17354
|
-
|
|
17355
|
-
|
|
17356
|
-
|
|
17357
|
-
getOpenTunaSpotPositionOrcaDiscriminatorBytes,
|
|
17358
|
-
getOpenTunaSpotPositionOrcaInstruction,
|
|
17359
|
-
getOpenTunaSpotPositionOrcaInstructionDataCodec,
|
|
17360
|
-
getOpenTunaSpotPositionOrcaInstructionDataDecoder,
|
|
17361
|
-
getOpenTunaSpotPositionOrcaInstructionDataEncoder,
|
|
17179
|
+
getOpenTunaSpotPositionDiscriminatorBytes,
|
|
17180
|
+
getOpenTunaSpotPositionInstruction,
|
|
17181
|
+
getOpenTunaSpotPositionInstructionDataCodec,
|
|
17182
|
+
getOpenTunaSpotPositionInstructionDataDecoder,
|
|
17183
|
+
getOpenTunaSpotPositionInstructionDataEncoder,
|
|
17362
17184
|
getPoolTokenCodec,
|
|
17363
17185
|
getPoolTokenDecoder,
|
|
17364
17186
|
getPoolTokenEncoder,
|
|
@@ -17532,10 +17354,8 @@ export {
|
|
|
17532
17354
|
openLendingPositionInstruction,
|
|
17533
17355
|
openTunaLpPositionFusionInstruction,
|
|
17534
17356
|
openTunaLpPositionOrcaInstruction,
|
|
17535
|
-
|
|
17536
|
-
|
|
17537
|
-
openTunaSpotPositionOrcaInstruction,
|
|
17538
|
-
openTunaSpotPositionOrcaInstructions,
|
|
17357
|
+
openTunaSpotPositionInstruction,
|
|
17358
|
+
openTunaSpotPositionInstructions,
|
|
17539
17359
|
parseCloseActiveTunaSpotPositionFusionInstruction,
|
|
17540
17360
|
parseCloseActiveTunaSpotPositionOrcaInstruction,
|
|
17541
17361
|
parseCloseTunaLpPositionFusionInstruction,
|
|
@@ -17571,8 +17391,7 @@ export {
|
|
|
17571
17391
|
parseOpenLendingPositionInstruction,
|
|
17572
17392
|
parseOpenTunaLpPositionFusionInstruction,
|
|
17573
17393
|
parseOpenTunaLpPositionOrcaInstruction,
|
|
17574
|
-
|
|
17575
|
-
parseOpenTunaSpotPositionOrcaInstruction,
|
|
17394
|
+
parseOpenTunaSpotPositionInstruction,
|
|
17576
17395
|
parseRebalanceTunaLpPositionFusionInstruction,
|
|
17577
17396
|
parseRebalanceTunaLpPositionOrcaInstruction,
|
|
17578
17397
|
parseRepayBadDebtInstruction,
|