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