@reflectmoney/stable.ts 2.8.4 → 2.9.1
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/helpers/drift/accounts/index.d.ts +10 -0
- package/dist/helpers/drift/accounts/index.js +26 -0
- package/dist/helpers/drift/accounts/spotMarket.d.ts +541 -0
- package/dist/helpers/drift/accounts/spotMarket.js +213 -0
- package/dist/helpers/drift/accounts/user.d.ts +193 -0
- package/dist/helpers/drift/accounts/user.js +147 -0
- package/dist/helpers/drift/accounts/userStats.d.ts +165 -0
- package/dist/helpers/drift/accounts/userStats.js +137 -0
- package/dist/helpers/drift/index.d.ts +10 -0
- package/dist/helpers/drift/index.js +26 -0
- package/dist/helpers/drift/mappers.d.ts +14 -0
- package/dist/helpers/drift/mappers.js +137 -0
- package/dist/helpers/drift/types/aMM.d.ts +656 -0
- package/dist/helpers/drift/types/aMM.js +199 -0
- package/dist/helpers/drift/types/addAmmConstituentMappingDatum.d.ts +21 -0
- package/dist/helpers/drift/types/addAmmConstituentMappingDatum.js +30 -0
- package/dist/helpers/drift/types/ammCacheFixed.d.ts +17 -0
- package/dist/helpers/drift/types/ammCacheFixed.js +30 -0
- package/dist/helpers/drift/types/ammConstituentDatum.d.ts +27 -0
- package/dist/helpers/drift/types/ammConstituentDatum.js +34 -0
- package/dist/helpers/drift/types/ammConstituentMappingFixed.d.ts +18 -0
- package/dist/helpers/drift/types/ammConstituentMappingFixed.js +32 -0
- package/dist/helpers/drift/types/assetTier.d.ts +19 -0
- package/dist/helpers/drift/types/assetTier.js +31 -0
- package/dist/helpers/drift/types/assetType.d.ts +16 -0
- package/dist/helpers/drift/types/assetType.js +28 -0
- package/dist/helpers/drift/types/builderInfo.d.ts +17 -0
- package/dist/helpers/drift/types/builderInfo.js +30 -0
- package/dist/helpers/drift/types/cacheInfo.d.ts +59 -0
- package/dist/helpers/drift/types/cacheInfo.js +66 -0
- package/dist/helpers/drift/types/constituentCorrelationsFixed.d.ts +19 -0
- package/dist/helpers/drift/types/constituentCorrelationsFixed.js +32 -0
- package/dist/helpers/drift/types/constituentLpOperation.d.ts +17 -0
- package/dist/helpers/drift/types/constituentLpOperation.js +29 -0
- package/dist/helpers/drift/types/constituentSpotBalance.d.ts +48 -0
- package/dist/helpers/drift/types/constituentSpotBalance.js +35 -0
- package/dist/helpers/drift/types/constituentStatus.d.ts +16 -0
- package/dist/helpers/drift/types/constituentStatus.js +28 -0
- package/dist/helpers/drift/types/constituentTargetBaseFixed.d.ts +19 -0
- package/dist/helpers/drift/types/constituentTargetBaseFixed.js +32 -0
- package/dist/helpers/drift/types/contractTier.d.ts +20 -0
- package/dist/helpers/drift/types/contractTier.js +32 -0
- package/dist/helpers/drift/types/contractType.d.ts +17 -0
- package/dist/helpers/drift/types/contractType.js +29 -0
- package/dist/helpers/drift/types/depositDirection.d.ts +16 -0
- package/dist/helpers/drift/types/depositDirection.js +28 -0
- package/dist/helpers/drift/types/depositExplanation.d.ts +19 -0
- package/dist/helpers/drift/types/depositExplanation.js +31 -0
- package/dist/helpers/drift/types/driftAction.d.ts +29 -0
- package/dist/helpers/drift/types/driftAction.js +41 -0
- package/dist/helpers/drift/types/exchangeStatus.d.ts +22 -0
- package/dist/helpers/drift/types/exchangeStatus.js +34 -0
- package/dist/helpers/drift/types/featureBitFlags.d.ts +18 -0
- package/dist/helpers/drift/types/featureBitFlags.js +30 -0
- package/dist/helpers/drift/types/feeStructure.d.ts +24 -0
- package/dist/helpers/drift/types/feeStructure.js +33 -0
- package/dist/helpers/drift/types/feeTier.d.ts +22 -0
- package/dist/helpers/drift/types/feeTier.js +40 -0
- package/dist/helpers/drift/types/fillMode.d.ts +29 -0
- package/dist/helpers/drift/types/fillMode.js +52 -0
- package/dist/helpers/drift/types/fuelOverflowStatus.d.ts +15 -0
- package/dist/helpers/drift/types/fuelOverflowStatus.js +27 -0
- package/dist/helpers/drift/types/historicalIndexData.d.ts +35 -0
- package/dist/helpers/drift/types/historicalIndexData.js +34 -0
- package/dist/helpers/drift/types/historicalOracleData.d.ts +39 -0
- package/dist/helpers/drift/types/historicalOracleData.js +36 -0
- package/dist/helpers/drift/types/ifRebalanceConfigParams.d.ts +31 -0
- package/dist/helpers/drift/types/ifRebalanceConfigParams.js +40 -0
- package/dist/helpers/drift/types/index.d.ts +114 -0
- package/dist/helpers/drift/types/index.js +130 -0
- package/dist/helpers/drift/types/insuranceClaim.d.ts +63 -0
- package/dist/helpers/drift/types/insuranceClaim.js +34 -0
- package/dist/helpers/drift/types/insuranceFund.d.ts +33 -0
- package/dist/helpers/drift/types/insuranceFund.js +42 -0
- package/dist/helpers/drift/types/insuranceFundOperation.d.ts +18 -0
- package/dist/helpers/drift/types/insuranceFundOperation.js +30 -0
- package/dist/helpers/drift/types/lPAction.d.ts +18 -0
- package/dist/helpers/drift/types/lPAction.js +30 -0
- package/dist/helpers/drift/types/liquidateBorrowForPerpPnlRecord.d.ts +27 -0
- package/dist/helpers/drift/types/liquidateBorrowForPerpPnlRecord.js +36 -0
- package/dist/helpers/drift/types/liquidatePerpPnlForDepositRecord.d.ts +27 -0
- package/dist/helpers/drift/types/liquidatePerpPnlForDepositRecord.js +36 -0
- package/dist/helpers/drift/types/liquidatePerpRecord.d.ts +41 -0
- package/dist/helpers/drift/types/liquidatePerpRecord.js +44 -0
- package/dist/helpers/drift/types/liquidateSpotRecord.d.ts +33 -0
- package/dist/helpers/drift/types/liquidateSpotRecord.js +38 -0
- package/dist/helpers/drift/types/liquidationBitFlag.d.ts +15 -0
- package/dist/helpers/drift/types/liquidationBitFlag.js +27 -0
- package/dist/helpers/drift/types/liquidationMultiplierType.d.ts +16 -0
- package/dist/helpers/drift/types/liquidationMultiplierType.js +28 -0
- package/dist/helpers/drift/types/liquidationType.d.ts +20 -0
- package/dist/helpers/drift/types/liquidationType.js +32 -0
- package/dist/helpers/drift/types/logMode.d.ts +19 -0
- package/dist/helpers/drift/types/logMode.js +31 -0
- package/dist/helpers/drift/types/lpPoolFeatureBitFlags.d.ts +17 -0
- package/dist/helpers/drift/types/lpPoolFeatureBitFlags.js +29 -0
- package/dist/helpers/drift/types/lpStatus.d.ts +17 -0
- package/dist/helpers/drift/types/lpStatus.js +29 -0
- package/dist/helpers/drift/types/marginCalculationMode.d.ts +29 -0
- package/dist/helpers/drift/types/marginCalculationMode.js +55 -0
- package/dist/helpers/drift/types/marginMode.d.ts +17 -0
- package/dist/helpers/drift/types/marginMode.js +29 -0
- package/dist/helpers/drift/types/marginRequirementType.d.ts +17 -0
- package/dist/helpers/drift/types/marginRequirementType.js +29 -0
- package/dist/helpers/drift/types/marketIdentifier.d.ts +20 -0
- package/dist/helpers/drift/types/marketIdentifier.js +29 -0
- package/dist/helpers/drift/types/marketStatus.d.ts +23 -0
- package/dist/helpers/drift/types/marketStatus.js +35 -0
- package/dist/helpers/drift/types/marketType.d.ts +16 -0
- package/dist/helpers/drift/types/marketType.js +28 -0
- package/dist/helpers/drift/types/modifyOrderId.d.ts +24 -0
- package/dist/helpers/drift/types/modifyOrderId.js +50 -0
- package/dist/helpers/drift/types/modifyOrderParams.d.ts +44 -0
- package/dist/helpers/drift/types/modifyOrderParams.js +53 -0
- package/dist/helpers/drift/types/modifyOrderPolicy.d.ts +16 -0
- package/dist/helpers/drift/types/modifyOrderPolicy.js +28 -0
- package/dist/helpers/drift/types/oracleGuardRails.d.ts +20 -0
- package/dist/helpers/drift/types/oracleGuardRails.js +29 -0
- package/dist/helpers/drift/types/oracleSource.d.ts +30 -0
- package/dist/helpers/drift/types/oracleSource.js +42 -0
- package/dist/helpers/drift/types/oracleValidity.d.ts +39 -0
- package/dist/helpers/drift/types/oracleValidity.js +60 -0
- package/dist/helpers/drift/types/order.d.ts +178 -0
- package/dist/helpers/drift/types/order.js +77 -0
- package/dist/helpers/drift/types/orderAction.d.ts +19 -0
- package/dist/helpers/drift/types/orderAction.js +31 -0
- package/dist/helpers/drift/types/orderActionExplanation.d.ts +35 -0
- package/dist/helpers/drift/types/orderActionExplanation.js +47 -0
- package/dist/helpers/drift/types/orderBitFlag.d.ts +20 -0
- package/dist/helpers/drift/types/orderBitFlag.js +32 -0
- package/dist/helpers/drift/types/orderFillerRewardStructure.d.ts +21 -0
- package/dist/helpers/drift/types/orderFillerRewardStructure.js +30 -0
- package/dist/helpers/drift/types/orderParams.d.ts +50 -0
- package/dist/helpers/drift/types/orderParams.js +59 -0
- package/dist/helpers/drift/types/orderParamsBitFlag.d.ts +16 -0
- package/dist/helpers/drift/types/orderParamsBitFlag.js +28 -0
- package/dist/helpers/drift/types/orderStatus.d.ts +18 -0
- package/dist/helpers/drift/types/orderStatus.js +30 -0
- package/dist/helpers/drift/types/orderTriggerCondition.d.ts +18 -0
- package/dist/helpers/drift/types/orderTriggerCondition.js +30 -0
- package/dist/helpers/drift/types/orderType.d.ts +19 -0
- package/dist/helpers/drift/types/orderType.js +31 -0
- package/dist/helpers/drift/types/perpBankruptcyRecord.d.ts +27 -0
- package/dist/helpers/drift/types/perpBankruptcyRecord.js +36 -0
- package/dist/helpers/drift/types/perpFulfillmentMethod.d.ts +30 -0
- package/dist/helpers/drift/types/perpFulfillmentMethod.js +72 -0
- package/dist/helpers/drift/types/perpLpOperation.d.ts +16 -0
- package/dist/helpers/drift/types/perpLpOperation.js +28 -0
- package/dist/helpers/drift/types/perpOperation.d.ts +22 -0
- package/dist/helpers/drift/types/perpOperation.js +34 -0
- package/dist/helpers/drift/types/perpPosition.d.ts +149 -0
- package/dist/helpers/drift/types/perpPosition.js +56 -0
- package/dist/helpers/drift/types/placeAndTakeOrderSuccessCondition.d.ts +16 -0
- package/dist/helpers/drift/types/placeAndTakeOrderSuccessCondition.js +28 -0
- package/dist/helpers/drift/types/poolBalance.d.ts +33 -0
- package/dist/helpers/drift/types/poolBalance.js +30 -0
- package/dist/helpers/drift/types/positionDirection.d.ts +16 -0
- package/dist/helpers/drift/types/positionDirection.js +28 -0
- package/dist/helpers/drift/types/positionFlag.d.ts +17 -0
- package/dist/helpers/drift/types/positionFlag.js +29 -0
- package/dist/helpers/drift/types/positionUpdateType.d.ts +19 -0
- package/dist/helpers/drift/types/positionUpdateType.js +31 -0
- package/dist/helpers/drift/types/postOnlyParam.d.ts +18 -0
- package/dist/helpers/drift/types/postOnlyParam.js +30 -0
- package/dist/helpers/drift/types/prelaunchOracleParams.d.ts +21 -0
- package/dist/helpers/drift/types/prelaunchOracleParams.js +30 -0
- package/dist/helpers/drift/types/priceDivergenceGuardRails.d.ts +19 -0
- package/dist/helpers/drift/types/priceDivergenceGuardRails.js +28 -0
- package/dist/helpers/drift/types/referrerStatus.d.ts +17 -0
- package/dist/helpers/drift/types/referrerStatus.js +29 -0
- package/dist/helpers/drift/types/revenueShareEscrowFixed.d.ts +21 -0
- package/dist/helpers/drift/types/revenueShareEscrowFixed.js +38 -0
- package/dist/helpers/drift/types/revenueShareOrder.d.ts +80 -0
- package/dist/helpers/drift/types/revenueShareOrder.js +45 -0
- package/dist/helpers/drift/types/revenueShareOrderBitFlag.d.ts +18 -0
- package/dist/helpers/drift/types/revenueShareOrderBitFlag.js +30 -0
- package/dist/helpers/drift/types/settlePnlExplanation.d.ts +16 -0
- package/dist/helpers/drift/types/settlePnlExplanation.js +28 -0
- package/dist/helpers/drift/types/settlePnlMode.d.ts +16 -0
- package/dist/helpers/drift/types/settlePnlMode.js +28 -0
- package/dist/helpers/drift/types/settlementDirection.d.ts +17 -0
- package/dist/helpers/drift/types/settlementDirection.js +29 -0
- package/dist/helpers/drift/types/signatureVerificationError.d.ts +26 -0
- package/dist/helpers/drift/types/signatureVerificationError.js +38 -0
- package/dist/helpers/drift/types/signedMsgOrderId.d.ts +23 -0
- package/dist/helpers/drift/types/signedMsgOrderId.js +32 -0
- package/dist/helpers/drift/types/signedMsgOrderParamsDelegateMessage.d.ts +36 -0
- package/dist/helpers/drift/types/signedMsgOrderParamsDelegateMessage.js +57 -0
- package/dist/helpers/drift/types/signedMsgOrderParamsMessage.d.ts +36 -0
- package/dist/helpers/drift/types/signedMsgOrderParamsMessage.js +57 -0
- package/dist/helpers/drift/types/signedMsgTriggerOrderParams.d.ts +19 -0
- package/dist/helpers/drift/types/signedMsgTriggerOrderParams.js +28 -0
- package/dist/helpers/drift/types/signedMsgUserOrdersFixed.d.ts +17 -0
- package/dist/helpers/drift/types/signedMsgUserOrdersFixed.js +30 -0
- package/dist/helpers/drift/types/spotBalanceType.d.ts +16 -0
- package/dist/helpers/drift/types/spotBalanceType.js +28 -0
- package/dist/helpers/drift/types/spotBankruptcyRecord.d.ts +23 -0
- package/dist/helpers/drift/types/spotBankruptcyRecord.js +32 -0
- package/dist/helpers/drift/types/spotFulfillmentConfigStatus.d.ts +16 -0
- package/dist/helpers/drift/types/spotFulfillmentConfigStatus.js +28 -0
- package/dist/helpers/drift/types/spotFulfillmentMethod.d.ts +23 -0
- package/dist/helpers/drift/types/spotFulfillmentMethod.js +48 -0
- package/dist/helpers/drift/types/spotFulfillmentType.d.ts +18 -0
- package/dist/helpers/drift/types/spotFulfillmentType.js +30 -0
- package/dist/helpers/drift/types/spotOperation.d.ts +19 -0
- package/dist/helpers/drift/types/spotOperation.js +31 -0
- package/dist/helpers/drift/types/spotPosition.d.ts +72 -0
- package/dist/helpers/drift/types/spotPosition.js +41 -0
- package/dist/helpers/drift/types/stakeAction.d.ts +21 -0
- package/dist/helpers/drift/types/stakeAction.js +33 -0
- package/dist/helpers/drift/types/swapDirection.d.ts +16 -0
- package/dist/helpers/drift/types/swapDirection.js +28 -0
- package/dist/helpers/drift/types/swapReduceOnly.d.ts +16 -0
- package/dist/helpers/drift/types/swapReduceOnly.js +28 -0
- package/dist/helpers/drift/types/targetsDatum.d.ts +25 -0
- package/dist/helpers/drift/types/targetsDatum.js +34 -0
- package/dist/helpers/drift/types/tokenProgramFlag.d.ts +16 -0
- package/dist/helpers/drift/types/tokenProgramFlag.js +28 -0
- package/dist/helpers/drift/types/twapPeriod.d.ts +16 -0
- package/dist/helpers/drift/types/twapPeriod.js +28 -0
- package/dist/helpers/drift/types/userFees.d.ts +75 -0
- package/dist/helpers/drift/types/userFees.js +36 -0
- package/dist/helpers/drift/types/userStatsPausedOperations.d.ts +17 -0
- package/dist/helpers/drift/types/userStatsPausedOperations.js +29 -0
- package/dist/helpers/drift/types/userStatus.d.ts +19 -0
- package/dist/helpers/drift/types/userStatus.js +31 -0
- package/dist/helpers/drift/types/validityGuardRails.d.ts +23 -0
- package/dist/helpers/drift/types/validityGuardRails.js +32 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +17 -0
- package/dist/stablecoins/UsdcPlusStablecoin.d.ts +2 -1
- package/dist/stablecoins/UsdcPlusStablecoin.js +19 -23
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
+
export declare enum OrderStatus {
|
|
10
|
+
Init = 0,
|
|
11
|
+
Open = 1,
|
|
12
|
+
Filled = 2,
|
|
13
|
+
Canceled = 3
|
|
14
|
+
}
|
|
15
|
+
export type OrderStatusArgs = OrderStatus;
|
|
16
|
+
export declare function getOrderStatusEncoder(): FixedSizeEncoder<OrderStatusArgs>;
|
|
17
|
+
export declare function getOrderStatusDecoder(): FixedSizeDecoder<OrderStatus>;
|
|
18
|
+
export declare function getOrderStatusCodec(): FixedSizeCodec<OrderStatusArgs, OrderStatus>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.OrderStatus = void 0;
|
|
11
|
+
exports.getOrderStatusEncoder = getOrderStatusEncoder;
|
|
12
|
+
exports.getOrderStatusDecoder = getOrderStatusDecoder;
|
|
13
|
+
exports.getOrderStatusCodec = getOrderStatusCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var OrderStatus;
|
|
16
|
+
(function (OrderStatus) {
|
|
17
|
+
OrderStatus[OrderStatus["Init"] = 0] = "Init";
|
|
18
|
+
OrderStatus[OrderStatus["Open"] = 1] = "Open";
|
|
19
|
+
OrderStatus[OrderStatus["Filled"] = 2] = "Filled";
|
|
20
|
+
OrderStatus[OrderStatus["Canceled"] = 3] = "Canceled";
|
|
21
|
+
})(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
|
|
22
|
+
function getOrderStatusEncoder() {
|
|
23
|
+
return (0, kit_1.getEnumEncoder)(OrderStatus);
|
|
24
|
+
}
|
|
25
|
+
function getOrderStatusDecoder() {
|
|
26
|
+
return (0, kit_1.getEnumDecoder)(OrderStatus);
|
|
27
|
+
}
|
|
28
|
+
function getOrderStatusCodec() {
|
|
29
|
+
return (0, kit_1.combineCodec)(getOrderStatusEncoder(), getOrderStatusDecoder());
|
|
30
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
+
export declare enum OrderTriggerCondition {
|
|
10
|
+
Above = 0,
|
|
11
|
+
Below = 1,
|
|
12
|
+
TriggeredAbove = 2,
|
|
13
|
+
TriggeredBelow = 3
|
|
14
|
+
}
|
|
15
|
+
export type OrderTriggerConditionArgs = OrderTriggerCondition;
|
|
16
|
+
export declare function getOrderTriggerConditionEncoder(): FixedSizeEncoder<OrderTriggerConditionArgs>;
|
|
17
|
+
export declare function getOrderTriggerConditionDecoder(): FixedSizeDecoder<OrderTriggerCondition>;
|
|
18
|
+
export declare function getOrderTriggerConditionCodec(): FixedSizeCodec<OrderTriggerConditionArgs, OrderTriggerCondition>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.OrderTriggerCondition = void 0;
|
|
11
|
+
exports.getOrderTriggerConditionEncoder = getOrderTriggerConditionEncoder;
|
|
12
|
+
exports.getOrderTriggerConditionDecoder = getOrderTriggerConditionDecoder;
|
|
13
|
+
exports.getOrderTriggerConditionCodec = getOrderTriggerConditionCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var OrderTriggerCondition;
|
|
16
|
+
(function (OrderTriggerCondition) {
|
|
17
|
+
OrderTriggerCondition[OrderTriggerCondition["Above"] = 0] = "Above";
|
|
18
|
+
OrderTriggerCondition[OrderTriggerCondition["Below"] = 1] = "Below";
|
|
19
|
+
OrderTriggerCondition[OrderTriggerCondition["TriggeredAbove"] = 2] = "TriggeredAbove";
|
|
20
|
+
OrderTriggerCondition[OrderTriggerCondition["TriggeredBelow"] = 3] = "TriggeredBelow";
|
|
21
|
+
})(OrderTriggerCondition || (exports.OrderTriggerCondition = OrderTriggerCondition = {}));
|
|
22
|
+
function getOrderTriggerConditionEncoder() {
|
|
23
|
+
return (0, kit_1.getEnumEncoder)(OrderTriggerCondition);
|
|
24
|
+
}
|
|
25
|
+
function getOrderTriggerConditionDecoder() {
|
|
26
|
+
return (0, kit_1.getEnumDecoder)(OrderTriggerCondition);
|
|
27
|
+
}
|
|
28
|
+
function getOrderTriggerConditionCodec() {
|
|
29
|
+
return (0, kit_1.combineCodec)(getOrderTriggerConditionEncoder(), getOrderTriggerConditionDecoder());
|
|
30
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
+
export declare enum OrderType {
|
|
10
|
+
Market = 0,
|
|
11
|
+
Limit = 1,
|
|
12
|
+
TriggerMarket = 2,
|
|
13
|
+
TriggerLimit = 3,
|
|
14
|
+
Oracle = 4
|
|
15
|
+
}
|
|
16
|
+
export type OrderTypeArgs = OrderType;
|
|
17
|
+
export declare function getOrderTypeEncoder(): FixedSizeEncoder<OrderTypeArgs>;
|
|
18
|
+
export declare function getOrderTypeDecoder(): FixedSizeDecoder<OrderType>;
|
|
19
|
+
export declare function getOrderTypeCodec(): FixedSizeCodec<OrderTypeArgs, OrderType>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.OrderType = void 0;
|
|
11
|
+
exports.getOrderTypeEncoder = getOrderTypeEncoder;
|
|
12
|
+
exports.getOrderTypeDecoder = getOrderTypeDecoder;
|
|
13
|
+
exports.getOrderTypeCodec = getOrderTypeCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var OrderType;
|
|
16
|
+
(function (OrderType) {
|
|
17
|
+
OrderType[OrderType["Market"] = 0] = "Market";
|
|
18
|
+
OrderType[OrderType["Limit"] = 1] = "Limit";
|
|
19
|
+
OrderType[OrderType["TriggerMarket"] = 2] = "TriggerMarket";
|
|
20
|
+
OrderType[OrderType["TriggerLimit"] = 3] = "TriggerLimit";
|
|
21
|
+
OrderType[OrderType["Oracle"] = 4] = "Oracle";
|
|
22
|
+
})(OrderType || (exports.OrderType = OrderType = {}));
|
|
23
|
+
function getOrderTypeEncoder() {
|
|
24
|
+
return (0, kit_1.getEnumEncoder)(OrderType);
|
|
25
|
+
}
|
|
26
|
+
function getOrderTypeDecoder() {
|
|
27
|
+
return (0, kit_1.getEnumDecoder)(OrderType);
|
|
28
|
+
}
|
|
29
|
+
function getOrderTypeCodec() {
|
|
30
|
+
return (0, kit_1.combineCodec)(getOrderTypeEncoder(), getOrderTypeDecoder());
|
|
31
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Address, type Codec, type Decoder, type Encoder, type Option, type OptionOrNullable } from "@solana/kit";
|
|
9
|
+
export type PerpBankruptcyRecord = {
|
|
10
|
+
marketIndex: number;
|
|
11
|
+
pnl: bigint;
|
|
12
|
+
ifPayment: bigint;
|
|
13
|
+
clawbackUser: Option<Address>;
|
|
14
|
+
clawbackUserPayment: Option<bigint>;
|
|
15
|
+
cumulativeFundingRateDelta: bigint;
|
|
16
|
+
};
|
|
17
|
+
export type PerpBankruptcyRecordArgs = {
|
|
18
|
+
marketIndex: number;
|
|
19
|
+
pnl: number | bigint;
|
|
20
|
+
ifPayment: number | bigint;
|
|
21
|
+
clawbackUser: OptionOrNullable<Address>;
|
|
22
|
+
clawbackUserPayment: OptionOrNullable<number | bigint>;
|
|
23
|
+
cumulativeFundingRateDelta: number | bigint;
|
|
24
|
+
};
|
|
25
|
+
export declare function getPerpBankruptcyRecordEncoder(): Encoder<PerpBankruptcyRecordArgs>;
|
|
26
|
+
export declare function getPerpBankruptcyRecordDecoder(): Decoder<PerpBankruptcyRecord>;
|
|
27
|
+
export declare function getPerpBankruptcyRecordCodec(): Codec<PerpBankruptcyRecordArgs, PerpBankruptcyRecord>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getPerpBankruptcyRecordEncoder = getPerpBankruptcyRecordEncoder;
|
|
11
|
+
exports.getPerpBankruptcyRecordDecoder = getPerpBankruptcyRecordDecoder;
|
|
12
|
+
exports.getPerpBankruptcyRecordCodec = getPerpBankruptcyRecordCodec;
|
|
13
|
+
const kit_1 = require("@solana/kit");
|
|
14
|
+
function getPerpBankruptcyRecordEncoder() {
|
|
15
|
+
return (0, kit_1.getStructEncoder)([
|
|
16
|
+
["marketIndex", (0, kit_1.getU16Encoder)()],
|
|
17
|
+
["pnl", (0, kit_1.getI128Encoder)()],
|
|
18
|
+
["ifPayment", (0, kit_1.getU128Encoder)()],
|
|
19
|
+
["clawbackUser", (0, kit_1.getOptionEncoder)((0, kit_1.getAddressEncoder)())],
|
|
20
|
+
["clawbackUserPayment", (0, kit_1.getOptionEncoder)((0, kit_1.getU128Encoder)())],
|
|
21
|
+
["cumulativeFundingRateDelta", (0, kit_1.getI128Encoder)()],
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
function getPerpBankruptcyRecordDecoder() {
|
|
25
|
+
return (0, kit_1.getStructDecoder)([
|
|
26
|
+
["marketIndex", (0, kit_1.getU16Decoder)()],
|
|
27
|
+
["pnl", (0, kit_1.getI128Decoder)()],
|
|
28
|
+
["ifPayment", (0, kit_1.getU128Decoder)()],
|
|
29
|
+
["clawbackUser", (0, kit_1.getOptionDecoder)((0, kit_1.getAddressDecoder)())],
|
|
30
|
+
["clawbackUserPayment", (0, kit_1.getOptionDecoder)((0, kit_1.getU128Decoder)())],
|
|
31
|
+
["cumulativeFundingRateDelta", (0, kit_1.getI128Decoder)()],
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
function getPerpBankruptcyRecordCodec() {
|
|
35
|
+
return (0, kit_1.combineCodec)(getPerpBankruptcyRecordEncoder(), getPerpBankruptcyRecordDecoder());
|
|
36
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Address, type Codec, type Decoder, type Encoder, type GetDiscriminatedUnionVariant, type GetDiscriminatedUnionVariantContent, type Option, type OptionOrNullable } from "@solana/kit";
|
|
9
|
+
export type PerpFulfillmentMethod = {
|
|
10
|
+
__kind: "AMM";
|
|
11
|
+
fields: readonly [Option<bigint>];
|
|
12
|
+
} | {
|
|
13
|
+
__kind: "Match";
|
|
14
|
+
fields: readonly [Address, number, bigint];
|
|
15
|
+
};
|
|
16
|
+
export type PerpFulfillmentMethodArgs = {
|
|
17
|
+
__kind: "AMM";
|
|
18
|
+
fields: readonly [OptionOrNullable<number | bigint>];
|
|
19
|
+
} | {
|
|
20
|
+
__kind: "Match";
|
|
21
|
+
fields: readonly [Address, number, number | bigint];
|
|
22
|
+
};
|
|
23
|
+
export declare function getPerpFulfillmentMethodEncoder(): Encoder<PerpFulfillmentMethodArgs>;
|
|
24
|
+
export declare function getPerpFulfillmentMethodDecoder(): Decoder<PerpFulfillmentMethod>;
|
|
25
|
+
export declare function getPerpFulfillmentMethodCodec(): Codec<PerpFulfillmentMethodArgs, PerpFulfillmentMethod>;
|
|
26
|
+
export declare function perpFulfillmentMethod(kind: "AMM", data: GetDiscriminatedUnionVariantContent<PerpFulfillmentMethodArgs, "__kind", "AMM">["fields"]): GetDiscriminatedUnionVariant<PerpFulfillmentMethodArgs, "__kind", "AMM">;
|
|
27
|
+
export declare function perpFulfillmentMethod(kind: "Match", data: GetDiscriminatedUnionVariantContent<PerpFulfillmentMethodArgs, "__kind", "Match">["fields"]): GetDiscriminatedUnionVariant<PerpFulfillmentMethodArgs, "__kind", "Match">;
|
|
28
|
+
export declare function isPerpFulfillmentMethod<K extends PerpFulfillmentMethod["__kind"]>(kind: K, value: PerpFulfillmentMethod): value is PerpFulfillmentMethod & {
|
|
29
|
+
__kind: K;
|
|
30
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getPerpFulfillmentMethodEncoder = getPerpFulfillmentMethodEncoder;
|
|
11
|
+
exports.getPerpFulfillmentMethodDecoder = getPerpFulfillmentMethodDecoder;
|
|
12
|
+
exports.getPerpFulfillmentMethodCodec = getPerpFulfillmentMethodCodec;
|
|
13
|
+
exports.perpFulfillmentMethod = perpFulfillmentMethod;
|
|
14
|
+
exports.isPerpFulfillmentMethod = isPerpFulfillmentMethod;
|
|
15
|
+
const kit_1 = require("@solana/kit");
|
|
16
|
+
function getPerpFulfillmentMethodEncoder() {
|
|
17
|
+
return (0, kit_1.getDiscriminatedUnionEncoder)([
|
|
18
|
+
[
|
|
19
|
+
"AMM",
|
|
20
|
+
(0, kit_1.getStructEncoder)([
|
|
21
|
+
["fields", (0, kit_1.getTupleEncoder)([(0, kit_1.getOptionEncoder)((0, kit_1.getU64Encoder)())])],
|
|
22
|
+
]),
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"Match",
|
|
26
|
+
(0, kit_1.getStructEncoder)([
|
|
27
|
+
[
|
|
28
|
+
"fields",
|
|
29
|
+
(0, kit_1.getTupleEncoder)([
|
|
30
|
+
(0, kit_1.getAddressEncoder)(),
|
|
31
|
+
(0, kit_1.getU16Encoder)(),
|
|
32
|
+
(0, kit_1.getU64Encoder)(),
|
|
33
|
+
]),
|
|
34
|
+
],
|
|
35
|
+
]),
|
|
36
|
+
],
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
function getPerpFulfillmentMethodDecoder() {
|
|
40
|
+
return (0, kit_1.getDiscriminatedUnionDecoder)([
|
|
41
|
+
[
|
|
42
|
+
"AMM",
|
|
43
|
+
(0, kit_1.getStructDecoder)([
|
|
44
|
+
["fields", (0, kit_1.getTupleDecoder)([(0, kit_1.getOptionDecoder)((0, kit_1.getU64Decoder)())])],
|
|
45
|
+
]),
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"Match",
|
|
49
|
+
(0, kit_1.getStructDecoder)([
|
|
50
|
+
[
|
|
51
|
+
"fields",
|
|
52
|
+
(0, kit_1.getTupleDecoder)([
|
|
53
|
+
(0, kit_1.getAddressDecoder)(),
|
|
54
|
+
(0, kit_1.getU16Decoder)(),
|
|
55
|
+
(0, kit_1.getU64Decoder)(),
|
|
56
|
+
]),
|
|
57
|
+
],
|
|
58
|
+
]),
|
|
59
|
+
],
|
|
60
|
+
]);
|
|
61
|
+
}
|
|
62
|
+
function getPerpFulfillmentMethodCodec() {
|
|
63
|
+
return (0, kit_1.combineCodec)(getPerpFulfillmentMethodEncoder(), getPerpFulfillmentMethodDecoder());
|
|
64
|
+
}
|
|
65
|
+
function perpFulfillmentMethod(kind, data) {
|
|
66
|
+
return Array.isArray(data)
|
|
67
|
+
? { __kind: kind, fields: data }
|
|
68
|
+
: Object.assign({ __kind: kind }, (data !== null && data !== void 0 ? data : {}));
|
|
69
|
+
}
|
|
70
|
+
function isPerpFulfillmentMethod(kind, value) {
|
|
71
|
+
return value.__kind === kind;
|
|
72
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
+
export declare enum PerpLpOperation {
|
|
10
|
+
TrackAmmRevenue = 0,
|
|
11
|
+
SettleQuoteOwed = 1
|
|
12
|
+
}
|
|
13
|
+
export type PerpLpOperationArgs = PerpLpOperation;
|
|
14
|
+
export declare function getPerpLpOperationEncoder(): FixedSizeEncoder<PerpLpOperationArgs>;
|
|
15
|
+
export declare function getPerpLpOperationDecoder(): FixedSizeDecoder<PerpLpOperation>;
|
|
16
|
+
export declare function getPerpLpOperationCodec(): FixedSizeCodec<PerpLpOperationArgs, PerpLpOperation>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.PerpLpOperation = void 0;
|
|
11
|
+
exports.getPerpLpOperationEncoder = getPerpLpOperationEncoder;
|
|
12
|
+
exports.getPerpLpOperationDecoder = getPerpLpOperationDecoder;
|
|
13
|
+
exports.getPerpLpOperationCodec = getPerpLpOperationCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var PerpLpOperation;
|
|
16
|
+
(function (PerpLpOperation) {
|
|
17
|
+
PerpLpOperation[PerpLpOperation["TrackAmmRevenue"] = 0] = "TrackAmmRevenue";
|
|
18
|
+
PerpLpOperation[PerpLpOperation["SettleQuoteOwed"] = 1] = "SettleQuoteOwed";
|
|
19
|
+
})(PerpLpOperation || (exports.PerpLpOperation = PerpLpOperation = {}));
|
|
20
|
+
function getPerpLpOperationEncoder() {
|
|
21
|
+
return (0, kit_1.getEnumEncoder)(PerpLpOperation);
|
|
22
|
+
}
|
|
23
|
+
function getPerpLpOperationDecoder() {
|
|
24
|
+
return (0, kit_1.getEnumDecoder)(PerpLpOperation);
|
|
25
|
+
}
|
|
26
|
+
function getPerpLpOperationCodec() {
|
|
27
|
+
return (0, kit_1.combineCodec)(getPerpLpOperationEncoder(), getPerpLpOperationDecoder());
|
|
28
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
+
export declare enum PerpOperation {
|
|
10
|
+
UpdateFunding = 0,
|
|
11
|
+
AmmFill = 1,
|
|
12
|
+
Fill = 2,
|
|
13
|
+
SettlePnl = 3,
|
|
14
|
+
SettlePnlWithPosition = 4,
|
|
15
|
+
Liquidation = 5,
|
|
16
|
+
AmmImmediateFill = 6,
|
|
17
|
+
SettleRevPool = 7
|
|
18
|
+
}
|
|
19
|
+
export type PerpOperationArgs = PerpOperation;
|
|
20
|
+
export declare function getPerpOperationEncoder(): FixedSizeEncoder<PerpOperationArgs>;
|
|
21
|
+
export declare function getPerpOperationDecoder(): FixedSizeDecoder<PerpOperation>;
|
|
22
|
+
export declare function getPerpOperationCodec(): FixedSizeCodec<PerpOperationArgs, PerpOperation>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.PerpOperation = void 0;
|
|
11
|
+
exports.getPerpOperationEncoder = getPerpOperationEncoder;
|
|
12
|
+
exports.getPerpOperationDecoder = getPerpOperationDecoder;
|
|
13
|
+
exports.getPerpOperationCodec = getPerpOperationCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var PerpOperation;
|
|
16
|
+
(function (PerpOperation) {
|
|
17
|
+
PerpOperation[PerpOperation["UpdateFunding"] = 0] = "UpdateFunding";
|
|
18
|
+
PerpOperation[PerpOperation["AmmFill"] = 1] = "AmmFill";
|
|
19
|
+
PerpOperation[PerpOperation["Fill"] = 2] = "Fill";
|
|
20
|
+
PerpOperation[PerpOperation["SettlePnl"] = 3] = "SettlePnl";
|
|
21
|
+
PerpOperation[PerpOperation["SettlePnlWithPosition"] = 4] = "SettlePnlWithPosition";
|
|
22
|
+
PerpOperation[PerpOperation["Liquidation"] = 5] = "Liquidation";
|
|
23
|
+
PerpOperation[PerpOperation["AmmImmediateFill"] = 6] = "AmmImmediateFill";
|
|
24
|
+
PerpOperation[PerpOperation["SettleRevPool"] = 7] = "SettleRevPool";
|
|
25
|
+
})(PerpOperation || (exports.PerpOperation = PerpOperation = {}));
|
|
26
|
+
function getPerpOperationEncoder() {
|
|
27
|
+
return (0, kit_1.getEnumEncoder)(PerpOperation);
|
|
28
|
+
}
|
|
29
|
+
function getPerpOperationDecoder() {
|
|
30
|
+
return (0, kit_1.getEnumDecoder)(PerpOperation);
|
|
31
|
+
}
|
|
32
|
+
function getPerpOperationCodec() {
|
|
33
|
+
return (0, kit_1.combineCodec)(getPerpOperationEncoder(), getPerpOperationDecoder());
|
|
34
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array } from "@solana/kit";
|
|
9
|
+
export type PerpPosition = {
|
|
10
|
+
/**
|
|
11
|
+
* The perp market's last cumulative funding rate. Used to calculate the funding payment owed to user
|
|
12
|
+
* precision: FUNDING_RATE_PRECISION
|
|
13
|
+
*/
|
|
14
|
+
lastCumulativeFundingRate: bigint;
|
|
15
|
+
/**
|
|
16
|
+
* the size of the users perp position
|
|
17
|
+
* precision: BASE_PRECISION
|
|
18
|
+
*/
|
|
19
|
+
baseAssetAmount: bigint;
|
|
20
|
+
/**
|
|
21
|
+
* Used to calculate the users pnl. Upon entry, is equal to base_asset_amount * avg entry price - fees
|
|
22
|
+
* Updated when the user open/closes position or settles pnl. Includes fees/funding
|
|
23
|
+
* precision: QUOTE_PRECISION
|
|
24
|
+
*/
|
|
25
|
+
quoteAssetAmount: bigint;
|
|
26
|
+
/**
|
|
27
|
+
* The amount of quote the user would need to exit their position at to break even
|
|
28
|
+
* Updated when the user open/closes position or settles pnl. Includes fees/funding
|
|
29
|
+
* precision: QUOTE_PRECISION
|
|
30
|
+
*/
|
|
31
|
+
quoteBreakEvenAmount: bigint;
|
|
32
|
+
/**
|
|
33
|
+
* The amount quote the user entered the position with. Equal to base asset amount * avg entry price
|
|
34
|
+
* Updated when the user open/closes position. Excludes fees/funding
|
|
35
|
+
* precision: QUOTE_PRECISION
|
|
36
|
+
*/
|
|
37
|
+
quoteEntryAmount: bigint;
|
|
38
|
+
/**
|
|
39
|
+
* The amount of non reduce only trigger orders the user has open
|
|
40
|
+
* precision: BASE_PRECISION
|
|
41
|
+
*/
|
|
42
|
+
openBids: bigint;
|
|
43
|
+
/**
|
|
44
|
+
* The amount of non reduce only trigger orders the user has open
|
|
45
|
+
* precision: BASE_PRECISION
|
|
46
|
+
*/
|
|
47
|
+
openAsks: bigint;
|
|
48
|
+
/**
|
|
49
|
+
* The amount of pnl settled in this market since opening the position
|
|
50
|
+
* precision: QUOTE_PRECISION
|
|
51
|
+
*/
|
|
52
|
+
settledPnl: bigint;
|
|
53
|
+
/**
|
|
54
|
+
* The number of lp (liquidity provider) shares the user has in this perp market
|
|
55
|
+
* LP shares allow users to provide liquidity via the AMM
|
|
56
|
+
* precision: BASE_PRECISION
|
|
57
|
+
*/
|
|
58
|
+
lpShares: bigint;
|
|
59
|
+
/**
|
|
60
|
+
* The scaled balance of the isolated position
|
|
61
|
+
* precision: SPOT_BALANCE_PRECISION
|
|
62
|
+
*/
|
|
63
|
+
isolatedPositionScaledBalance: bigint;
|
|
64
|
+
/**
|
|
65
|
+
* The last quote asset amount per lp the amm had
|
|
66
|
+
* Used to settle the users lp position
|
|
67
|
+
* precision: QUOTE_PRECISION
|
|
68
|
+
*/
|
|
69
|
+
lastQuoteAssetAmountPerLp: bigint;
|
|
70
|
+
padding: ReadonlyUint8Array;
|
|
71
|
+
maxMarginRatio: number;
|
|
72
|
+
/** The market index for the perp market */
|
|
73
|
+
marketIndex: number;
|
|
74
|
+
/** The number of open orders */
|
|
75
|
+
openOrders: number;
|
|
76
|
+
positionFlag: number;
|
|
77
|
+
};
|
|
78
|
+
export type PerpPositionArgs = {
|
|
79
|
+
/**
|
|
80
|
+
* The perp market's last cumulative funding rate. Used to calculate the funding payment owed to user
|
|
81
|
+
* precision: FUNDING_RATE_PRECISION
|
|
82
|
+
*/
|
|
83
|
+
lastCumulativeFundingRate: number | bigint;
|
|
84
|
+
/**
|
|
85
|
+
* the size of the users perp position
|
|
86
|
+
* precision: BASE_PRECISION
|
|
87
|
+
*/
|
|
88
|
+
baseAssetAmount: number | bigint;
|
|
89
|
+
/**
|
|
90
|
+
* Used to calculate the users pnl. Upon entry, is equal to base_asset_amount * avg entry price - fees
|
|
91
|
+
* Updated when the user open/closes position or settles pnl. Includes fees/funding
|
|
92
|
+
* precision: QUOTE_PRECISION
|
|
93
|
+
*/
|
|
94
|
+
quoteAssetAmount: number | bigint;
|
|
95
|
+
/**
|
|
96
|
+
* The amount of quote the user would need to exit their position at to break even
|
|
97
|
+
* Updated when the user open/closes position or settles pnl. Includes fees/funding
|
|
98
|
+
* precision: QUOTE_PRECISION
|
|
99
|
+
*/
|
|
100
|
+
quoteBreakEvenAmount: number | bigint;
|
|
101
|
+
/**
|
|
102
|
+
* The amount quote the user entered the position with. Equal to base asset amount * avg entry price
|
|
103
|
+
* Updated when the user open/closes position. Excludes fees/funding
|
|
104
|
+
* precision: QUOTE_PRECISION
|
|
105
|
+
*/
|
|
106
|
+
quoteEntryAmount: number | bigint;
|
|
107
|
+
/**
|
|
108
|
+
* The amount of non reduce only trigger orders the user has open
|
|
109
|
+
* precision: BASE_PRECISION
|
|
110
|
+
*/
|
|
111
|
+
openBids: number | bigint;
|
|
112
|
+
/**
|
|
113
|
+
* The amount of non reduce only trigger orders the user has open
|
|
114
|
+
* precision: BASE_PRECISION
|
|
115
|
+
*/
|
|
116
|
+
openAsks: number | bigint;
|
|
117
|
+
/**
|
|
118
|
+
* The amount of pnl settled in this market since opening the position
|
|
119
|
+
* precision: QUOTE_PRECISION
|
|
120
|
+
*/
|
|
121
|
+
settledPnl: number | bigint;
|
|
122
|
+
/**
|
|
123
|
+
* The number of lp (liquidity provider) shares the user has in this perp market
|
|
124
|
+
* LP shares allow users to provide liquidity via the AMM
|
|
125
|
+
* precision: BASE_PRECISION
|
|
126
|
+
*/
|
|
127
|
+
lpShares: number | bigint;
|
|
128
|
+
/**
|
|
129
|
+
* The scaled balance of the isolated position
|
|
130
|
+
* precision: SPOT_BALANCE_PRECISION
|
|
131
|
+
*/
|
|
132
|
+
isolatedPositionScaledBalance: number | bigint;
|
|
133
|
+
/**
|
|
134
|
+
* The last quote asset amount per lp the amm had
|
|
135
|
+
* Used to settle the users lp position
|
|
136
|
+
* precision: QUOTE_PRECISION
|
|
137
|
+
*/
|
|
138
|
+
lastQuoteAssetAmountPerLp: number | bigint;
|
|
139
|
+
padding: ReadonlyUint8Array;
|
|
140
|
+
maxMarginRatio: number;
|
|
141
|
+
/** The market index for the perp market */
|
|
142
|
+
marketIndex: number;
|
|
143
|
+
/** The number of open orders */
|
|
144
|
+
openOrders: number;
|
|
145
|
+
positionFlag: number;
|
|
146
|
+
};
|
|
147
|
+
export declare function getPerpPositionEncoder(): FixedSizeEncoder<PerpPositionArgs>;
|
|
148
|
+
export declare function getPerpPositionDecoder(): FixedSizeDecoder<PerpPosition>;
|
|
149
|
+
export declare function getPerpPositionCodec(): FixedSizeCodec<PerpPositionArgs, PerpPosition>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getPerpPositionEncoder = getPerpPositionEncoder;
|
|
11
|
+
exports.getPerpPositionDecoder = getPerpPositionDecoder;
|
|
12
|
+
exports.getPerpPositionCodec = getPerpPositionCodec;
|
|
13
|
+
const kit_1 = require("@solana/kit");
|
|
14
|
+
function getPerpPositionEncoder() {
|
|
15
|
+
return (0, kit_1.getStructEncoder)([
|
|
16
|
+
["lastCumulativeFundingRate", (0, kit_1.getI64Encoder)()],
|
|
17
|
+
["baseAssetAmount", (0, kit_1.getI64Encoder)()],
|
|
18
|
+
["quoteAssetAmount", (0, kit_1.getI64Encoder)()],
|
|
19
|
+
["quoteBreakEvenAmount", (0, kit_1.getI64Encoder)()],
|
|
20
|
+
["quoteEntryAmount", (0, kit_1.getI64Encoder)()],
|
|
21
|
+
["openBids", (0, kit_1.getI64Encoder)()],
|
|
22
|
+
["openAsks", (0, kit_1.getI64Encoder)()],
|
|
23
|
+
["settledPnl", (0, kit_1.getI64Encoder)()],
|
|
24
|
+
["lpShares", (0, kit_1.getU64Encoder)()],
|
|
25
|
+
["isolatedPositionScaledBalance", (0, kit_1.getU64Encoder)()],
|
|
26
|
+
["lastQuoteAssetAmountPerLp", (0, kit_1.getI64Encoder)()],
|
|
27
|
+
["padding", (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 2)],
|
|
28
|
+
["maxMarginRatio", (0, kit_1.getU16Encoder)()],
|
|
29
|
+
["marketIndex", (0, kit_1.getU16Encoder)()],
|
|
30
|
+
["openOrders", (0, kit_1.getU8Encoder)()],
|
|
31
|
+
["positionFlag", (0, kit_1.getU8Encoder)()],
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
function getPerpPositionDecoder() {
|
|
35
|
+
return (0, kit_1.getStructDecoder)([
|
|
36
|
+
["lastCumulativeFundingRate", (0, kit_1.getI64Decoder)()],
|
|
37
|
+
["baseAssetAmount", (0, kit_1.getI64Decoder)()],
|
|
38
|
+
["quoteAssetAmount", (0, kit_1.getI64Decoder)()],
|
|
39
|
+
["quoteBreakEvenAmount", (0, kit_1.getI64Decoder)()],
|
|
40
|
+
["quoteEntryAmount", (0, kit_1.getI64Decoder)()],
|
|
41
|
+
["openBids", (0, kit_1.getI64Decoder)()],
|
|
42
|
+
["openAsks", (0, kit_1.getI64Decoder)()],
|
|
43
|
+
["settledPnl", (0, kit_1.getI64Decoder)()],
|
|
44
|
+
["lpShares", (0, kit_1.getU64Decoder)()],
|
|
45
|
+
["isolatedPositionScaledBalance", (0, kit_1.getU64Decoder)()],
|
|
46
|
+
["lastQuoteAssetAmountPerLp", (0, kit_1.getI64Decoder)()],
|
|
47
|
+
["padding", (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 2)],
|
|
48
|
+
["maxMarginRatio", (0, kit_1.getU16Decoder)()],
|
|
49
|
+
["marketIndex", (0, kit_1.getU16Decoder)()],
|
|
50
|
+
["openOrders", (0, kit_1.getU8Decoder)()],
|
|
51
|
+
["positionFlag", (0, kit_1.getU8Decoder)()],
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
function getPerpPositionCodec() {
|
|
55
|
+
return (0, kit_1.combineCodec)(getPerpPositionEncoder(), getPerpPositionDecoder());
|
|
56
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
+
export declare enum PlaceAndTakeOrderSuccessCondition {
|
|
10
|
+
PartialFill = 0,
|
|
11
|
+
FullFill = 1
|
|
12
|
+
}
|
|
13
|
+
export type PlaceAndTakeOrderSuccessConditionArgs = PlaceAndTakeOrderSuccessCondition;
|
|
14
|
+
export declare function getPlaceAndTakeOrderSuccessConditionEncoder(): FixedSizeEncoder<PlaceAndTakeOrderSuccessConditionArgs>;
|
|
15
|
+
export declare function getPlaceAndTakeOrderSuccessConditionDecoder(): FixedSizeDecoder<PlaceAndTakeOrderSuccessCondition>;
|
|
16
|
+
export declare function getPlaceAndTakeOrderSuccessConditionCodec(): FixedSizeCodec<PlaceAndTakeOrderSuccessConditionArgs, PlaceAndTakeOrderSuccessCondition>;
|