@reflectmoney/stable.ts 2.8.3 → 2.9.0
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 -3
- package/dist/stablecoins/UsdcPlusStablecoin.js +22 -47
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
import { type MarketType, type MarketTypeArgs } from ".";
|
|
10
|
+
export type MarketIdentifier = {
|
|
11
|
+
marketType: MarketType;
|
|
12
|
+
marketIndex: number;
|
|
13
|
+
};
|
|
14
|
+
export type MarketIdentifierArgs = {
|
|
15
|
+
marketType: MarketTypeArgs;
|
|
16
|
+
marketIndex: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function getMarketIdentifierEncoder(): FixedSizeEncoder<MarketIdentifierArgs>;
|
|
19
|
+
export declare function getMarketIdentifierDecoder(): FixedSizeDecoder<MarketIdentifier>;
|
|
20
|
+
export declare function getMarketIdentifierCodec(): FixedSizeCodec<MarketIdentifierArgs, MarketIdentifier>;
|
|
@@ -0,0 +1,29 @@
|
|
|
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.getMarketIdentifierEncoder = getMarketIdentifierEncoder;
|
|
11
|
+
exports.getMarketIdentifierDecoder = getMarketIdentifierDecoder;
|
|
12
|
+
exports.getMarketIdentifierCodec = getMarketIdentifierCodec;
|
|
13
|
+
const kit_1 = require("@solana/kit");
|
|
14
|
+
const _1 = require(".");
|
|
15
|
+
function getMarketIdentifierEncoder() {
|
|
16
|
+
return (0, kit_1.getStructEncoder)([
|
|
17
|
+
["marketType", (0, _1.getMarketTypeEncoder)()],
|
|
18
|
+
["marketIndex", (0, kit_1.getU16Encoder)()],
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
function getMarketIdentifierDecoder() {
|
|
22
|
+
return (0, kit_1.getStructDecoder)([
|
|
23
|
+
["marketType", (0, _1.getMarketTypeDecoder)()],
|
|
24
|
+
["marketIndex", (0, kit_1.getU16Decoder)()],
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
function getMarketIdentifierCodec() {
|
|
28
|
+
return (0, kit_1.combineCodec)(getMarketIdentifierEncoder(), getMarketIdentifierDecoder());
|
|
29
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 MarketStatus {
|
|
10
|
+
Initialized = 0,
|
|
11
|
+
Active = 1,
|
|
12
|
+
FundingPaused = 2,
|
|
13
|
+
AmmPaused = 3,
|
|
14
|
+
FillPaused = 4,
|
|
15
|
+
WithdrawPaused = 5,
|
|
16
|
+
ReduceOnly = 6,
|
|
17
|
+
Settlement = 7,
|
|
18
|
+
Delisted = 8
|
|
19
|
+
}
|
|
20
|
+
export type MarketStatusArgs = MarketStatus;
|
|
21
|
+
export declare function getMarketStatusEncoder(): FixedSizeEncoder<MarketStatusArgs>;
|
|
22
|
+
export declare function getMarketStatusDecoder(): FixedSizeDecoder<MarketStatus>;
|
|
23
|
+
export declare function getMarketStatusCodec(): FixedSizeCodec<MarketStatusArgs, MarketStatus>;
|
|
@@ -0,0 +1,35 @@
|
|
|
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.MarketStatus = void 0;
|
|
11
|
+
exports.getMarketStatusEncoder = getMarketStatusEncoder;
|
|
12
|
+
exports.getMarketStatusDecoder = getMarketStatusDecoder;
|
|
13
|
+
exports.getMarketStatusCodec = getMarketStatusCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var MarketStatus;
|
|
16
|
+
(function (MarketStatus) {
|
|
17
|
+
MarketStatus[MarketStatus["Initialized"] = 0] = "Initialized";
|
|
18
|
+
MarketStatus[MarketStatus["Active"] = 1] = "Active";
|
|
19
|
+
MarketStatus[MarketStatus["FundingPaused"] = 2] = "FundingPaused";
|
|
20
|
+
MarketStatus[MarketStatus["AmmPaused"] = 3] = "AmmPaused";
|
|
21
|
+
MarketStatus[MarketStatus["FillPaused"] = 4] = "FillPaused";
|
|
22
|
+
MarketStatus[MarketStatus["WithdrawPaused"] = 5] = "WithdrawPaused";
|
|
23
|
+
MarketStatus[MarketStatus["ReduceOnly"] = 6] = "ReduceOnly";
|
|
24
|
+
MarketStatus[MarketStatus["Settlement"] = 7] = "Settlement";
|
|
25
|
+
MarketStatus[MarketStatus["Delisted"] = 8] = "Delisted";
|
|
26
|
+
})(MarketStatus || (exports.MarketStatus = MarketStatus = {}));
|
|
27
|
+
function getMarketStatusEncoder() {
|
|
28
|
+
return (0, kit_1.getEnumEncoder)(MarketStatus);
|
|
29
|
+
}
|
|
30
|
+
function getMarketStatusDecoder() {
|
|
31
|
+
return (0, kit_1.getEnumDecoder)(MarketStatus);
|
|
32
|
+
}
|
|
33
|
+
function getMarketStatusCodec() {
|
|
34
|
+
return (0, kit_1.combineCodec)(getMarketStatusEncoder(), getMarketStatusDecoder());
|
|
35
|
+
}
|
|
@@ -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 MarketType {
|
|
10
|
+
Spot = 0,
|
|
11
|
+
Perp = 1
|
|
12
|
+
}
|
|
13
|
+
export type MarketTypeArgs = MarketType;
|
|
14
|
+
export declare function getMarketTypeEncoder(): FixedSizeEncoder<MarketTypeArgs>;
|
|
15
|
+
export declare function getMarketTypeDecoder(): FixedSizeDecoder<MarketType>;
|
|
16
|
+
export declare function getMarketTypeCodec(): FixedSizeCodec<MarketTypeArgs, MarketType>;
|
|
@@ -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.MarketType = void 0;
|
|
11
|
+
exports.getMarketTypeEncoder = getMarketTypeEncoder;
|
|
12
|
+
exports.getMarketTypeDecoder = getMarketTypeDecoder;
|
|
13
|
+
exports.getMarketTypeCodec = getMarketTypeCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var MarketType;
|
|
16
|
+
(function (MarketType) {
|
|
17
|
+
MarketType[MarketType["Spot"] = 0] = "Spot";
|
|
18
|
+
MarketType[MarketType["Perp"] = 1] = "Perp";
|
|
19
|
+
})(MarketType || (exports.MarketType = MarketType = {}));
|
|
20
|
+
function getMarketTypeEncoder() {
|
|
21
|
+
return (0, kit_1.getEnumEncoder)(MarketType);
|
|
22
|
+
}
|
|
23
|
+
function getMarketTypeDecoder() {
|
|
24
|
+
return (0, kit_1.getEnumDecoder)(MarketType);
|
|
25
|
+
}
|
|
26
|
+
function getMarketTypeCodec() {
|
|
27
|
+
return (0, kit_1.combineCodec)(getMarketTypeEncoder(), getMarketTypeDecoder());
|
|
28
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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 Codec, type Decoder, type Encoder, type GetDiscriminatedUnionVariant, type GetDiscriminatedUnionVariantContent } from "@solana/kit";
|
|
9
|
+
export type ModifyOrderId = {
|
|
10
|
+
__kind: "UserOrderId";
|
|
11
|
+
fields: readonly [number];
|
|
12
|
+
} | {
|
|
13
|
+
__kind: "OrderId";
|
|
14
|
+
fields: readonly [number];
|
|
15
|
+
};
|
|
16
|
+
export type ModifyOrderIdArgs = ModifyOrderId;
|
|
17
|
+
export declare function getModifyOrderIdEncoder(): Encoder<ModifyOrderIdArgs>;
|
|
18
|
+
export declare function getModifyOrderIdDecoder(): Decoder<ModifyOrderId>;
|
|
19
|
+
export declare function getModifyOrderIdCodec(): Codec<ModifyOrderIdArgs, ModifyOrderId>;
|
|
20
|
+
export declare function modifyOrderId(kind: "UserOrderId", data: GetDiscriminatedUnionVariantContent<ModifyOrderIdArgs, "__kind", "UserOrderId">["fields"]): GetDiscriminatedUnionVariant<ModifyOrderIdArgs, "__kind", "UserOrderId">;
|
|
21
|
+
export declare function modifyOrderId(kind: "OrderId", data: GetDiscriminatedUnionVariantContent<ModifyOrderIdArgs, "__kind", "OrderId">["fields"]): GetDiscriminatedUnionVariant<ModifyOrderIdArgs, "__kind", "OrderId">;
|
|
22
|
+
export declare function isModifyOrderId<K extends ModifyOrderId["__kind"]>(kind: K, value: ModifyOrderId): value is ModifyOrderId & {
|
|
23
|
+
__kind: K;
|
|
24
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
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.getModifyOrderIdEncoder = getModifyOrderIdEncoder;
|
|
11
|
+
exports.getModifyOrderIdDecoder = getModifyOrderIdDecoder;
|
|
12
|
+
exports.getModifyOrderIdCodec = getModifyOrderIdCodec;
|
|
13
|
+
exports.modifyOrderId = modifyOrderId;
|
|
14
|
+
exports.isModifyOrderId = isModifyOrderId;
|
|
15
|
+
const kit_1 = require("@solana/kit");
|
|
16
|
+
function getModifyOrderIdEncoder() {
|
|
17
|
+
return (0, kit_1.getDiscriminatedUnionEncoder)([
|
|
18
|
+
[
|
|
19
|
+
"UserOrderId",
|
|
20
|
+
(0, kit_1.getStructEncoder)([["fields", (0, kit_1.getTupleEncoder)([(0, kit_1.getU8Encoder)()])]]),
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"OrderId",
|
|
24
|
+
(0, kit_1.getStructEncoder)([["fields", (0, kit_1.getTupleEncoder)([(0, kit_1.getU32Encoder)()])]]),
|
|
25
|
+
],
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
function getModifyOrderIdDecoder() {
|
|
29
|
+
return (0, kit_1.getDiscriminatedUnionDecoder)([
|
|
30
|
+
[
|
|
31
|
+
"UserOrderId",
|
|
32
|
+
(0, kit_1.getStructDecoder)([["fields", (0, kit_1.getTupleDecoder)([(0, kit_1.getU8Decoder)()])]]),
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"OrderId",
|
|
36
|
+
(0, kit_1.getStructDecoder)([["fields", (0, kit_1.getTupleDecoder)([(0, kit_1.getU32Decoder)()])]]),
|
|
37
|
+
],
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
function getModifyOrderIdCodec() {
|
|
41
|
+
return (0, kit_1.combineCodec)(getModifyOrderIdEncoder(), getModifyOrderIdDecoder());
|
|
42
|
+
}
|
|
43
|
+
function modifyOrderId(kind, data) {
|
|
44
|
+
return Array.isArray(data)
|
|
45
|
+
? { __kind: kind, fields: data }
|
|
46
|
+
: Object.assign({ __kind: kind }, (data !== null && data !== void 0 ? data : {}));
|
|
47
|
+
}
|
|
48
|
+
function isModifyOrderId(kind, value) {
|
|
49
|
+
return value.__kind === kind;
|
|
50
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 Codec, type Decoder, type Encoder, type Option, type OptionOrNullable } from "@solana/kit";
|
|
9
|
+
import { type OrderTriggerCondition, type OrderTriggerConditionArgs, type PositionDirection, type PositionDirectionArgs, type PostOnlyParam, type PostOnlyParamArgs } from ".";
|
|
10
|
+
export type ModifyOrderParams = {
|
|
11
|
+
direction: Option<PositionDirection>;
|
|
12
|
+
baseAssetAmount: Option<bigint>;
|
|
13
|
+
price: Option<bigint>;
|
|
14
|
+
reduceOnly: Option<boolean>;
|
|
15
|
+
postOnly: Option<PostOnlyParam>;
|
|
16
|
+
bitFlags: Option<number>;
|
|
17
|
+
maxTs: Option<bigint>;
|
|
18
|
+
triggerPrice: Option<bigint>;
|
|
19
|
+
triggerCondition: Option<OrderTriggerCondition>;
|
|
20
|
+
oraclePriceOffset: Option<number>;
|
|
21
|
+
auctionDuration: Option<number>;
|
|
22
|
+
auctionStartPrice: Option<bigint>;
|
|
23
|
+
auctionEndPrice: Option<bigint>;
|
|
24
|
+
policy: Option<number>;
|
|
25
|
+
};
|
|
26
|
+
export type ModifyOrderParamsArgs = {
|
|
27
|
+
direction: OptionOrNullable<PositionDirectionArgs>;
|
|
28
|
+
baseAssetAmount: OptionOrNullable<number | bigint>;
|
|
29
|
+
price: OptionOrNullable<number | bigint>;
|
|
30
|
+
reduceOnly: OptionOrNullable<boolean>;
|
|
31
|
+
postOnly: OptionOrNullable<PostOnlyParamArgs>;
|
|
32
|
+
bitFlags: OptionOrNullable<number>;
|
|
33
|
+
maxTs: OptionOrNullable<number | bigint>;
|
|
34
|
+
triggerPrice: OptionOrNullable<number | bigint>;
|
|
35
|
+
triggerCondition: OptionOrNullable<OrderTriggerConditionArgs>;
|
|
36
|
+
oraclePriceOffset: OptionOrNullable<number>;
|
|
37
|
+
auctionDuration: OptionOrNullable<number>;
|
|
38
|
+
auctionStartPrice: OptionOrNullable<number | bigint>;
|
|
39
|
+
auctionEndPrice: OptionOrNullable<number | bigint>;
|
|
40
|
+
policy: OptionOrNullable<number>;
|
|
41
|
+
};
|
|
42
|
+
export declare function getModifyOrderParamsEncoder(): Encoder<ModifyOrderParamsArgs>;
|
|
43
|
+
export declare function getModifyOrderParamsDecoder(): Decoder<ModifyOrderParams>;
|
|
44
|
+
export declare function getModifyOrderParamsCodec(): Codec<ModifyOrderParamsArgs, ModifyOrderParams>;
|
|
@@ -0,0 +1,53 @@
|
|
|
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.getModifyOrderParamsEncoder = getModifyOrderParamsEncoder;
|
|
11
|
+
exports.getModifyOrderParamsDecoder = getModifyOrderParamsDecoder;
|
|
12
|
+
exports.getModifyOrderParamsCodec = getModifyOrderParamsCodec;
|
|
13
|
+
const kit_1 = require("@solana/kit");
|
|
14
|
+
const _1 = require(".");
|
|
15
|
+
function getModifyOrderParamsEncoder() {
|
|
16
|
+
return (0, kit_1.getStructEncoder)([
|
|
17
|
+
["direction", (0, kit_1.getOptionEncoder)((0, _1.getPositionDirectionEncoder)())],
|
|
18
|
+
["baseAssetAmount", (0, kit_1.getOptionEncoder)((0, kit_1.getU64Encoder)())],
|
|
19
|
+
["price", (0, kit_1.getOptionEncoder)((0, kit_1.getU64Encoder)())],
|
|
20
|
+
["reduceOnly", (0, kit_1.getOptionEncoder)((0, kit_1.getBooleanEncoder)())],
|
|
21
|
+
["postOnly", (0, kit_1.getOptionEncoder)((0, _1.getPostOnlyParamEncoder)())],
|
|
22
|
+
["bitFlags", (0, kit_1.getOptionEncoder)((0, kit_1.getU8Encoder)())],
|
|
23
|
+
["maxTs", (0, kit_1.getOptionEncoder)((0, kit_1.getI64Encoder)())],
|
|
24
|
+
["triggerPrice", (0, kit_1.getOptionEncoder)((0, kit_1.getU64Encoder)())],
|
|
25
|
+
["triggerCondition", (0, kit_1.getOptionEncoder)((0, _1.getOrderTriggerConditionEncoder)())],
|
|
26
|
+
["oraclePriceOffset", (0, kit_1.getOptionEncoder)((0, kit_1.getI32Encoder)())],
|
|
27
|
+
["auctionDuration", (0, kit_1.getOptionEncoder)((0, kit_1.getU8Encoder)())],
|
|
28
|
+
["auctionStartPrice", (0, kit_1.getOptionEncoder)((0, kit_1.getI64Encoder)())],
|
|
29
|
+
["auctionEndPrice", (0, kit_1.getOptionEncoder)((0, kit_1.getI64Encoder)())],
|
|
30
|
+
["policy", (0, kit_1.getOptionEncoder)((0, kit_1.getU8Encoder)())],
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
function getModifyOrderParamsDecoder() {
|
|
34
|
+
return (0, kit_1.getStructDecoder)([
|
|
35
|
+
["direction", (0, kit_1.getOptionDecoder)((0, _1.getPositionDirectionDecoder)())],
|
|
36
|
+
["baseAssetAmount", (0, kit_1.getOptionDecoder)((0, kit_1.getU64Decoder)())],
|
|
37
|
+
["price", (0, kit_1.getOptionDecoder)((0, kit_1.getU64Decoder)())],
|
|
38
|
+
["reduceOnly", (0, kit_1.getOptionDecoder)((0, kit_1.getBooleanDecoder)())],
|
|
39
|
+
["postOnly", (0, kit_1.getOptionDecoder)((0, _1.getPostOnlyParamDecoder)())],
|
|
40
|
+
["bitFlags", (0, kit_1.getOptionDecoder)((0, kit_1.getU8Decoder)())],
|
|
41
|
+
["maxTs", (0, kit_1.getOptionDecoder)((0, kit_1.getI64Decoder)())],
|
|
42
|
+
["triggerPrice", (0, kit_1.getOptionDecoder)((0, kit_1.getU64Decoder)())],
|
|
43
|
+
["triggerCondition", (0, kit_1.getOptionDecoder)((0, _1.getOrderTriggerConditionDecoder)())],
|
|
44
|
+
["oraclePriceOffset", (0, kit_1.getOptionDecoder)((0, kit_1.getI32Decoder)())],
|
|
45
|
+
["auctionDuration", (0, kit_1.getOptionDecoder)((0, kit_1.getU8Decoder)())],
|
|
46
|
+
["auctionStartPrice", (0, kit_1.getOptionDecoder)((0, kit_1.getI64Decoder)())],
|
|
47
|
+
["auctionEndPrice", (0, kit_1.getOptionDecoder)((0, kit_1.getI64Decoder)())],
|
|
48
|
+
["policy", (0, kit_1.getOptionDecoder)((0, kit_1.getU8Decoder)())],
|
|
49
|
+
]);
|
|
50
|
+
}
|
|
51
|
+
function getModifyOrderParamsCodec() {
|
|
52
|
+
return (0, kit_1.combineCodec)(getModifyOrderParamsEncoder(), getModifyOrderParamsDecoder());
|
|
53
|
+
}
|
|
@@ -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 ModifyOrderPolicy {
|
|
10
|
+
MustModify = 0,
|
|
11
|
+
ExcludePreviousFill = 1
|
|
12
|
+
}
|
|
13
|
+
export type ModifyOrderPolicyArgs = ModifyOrderPolicy;
|
|
14
|
+
export declare function getModifyOrderPolicyEncoder(): FixedSizeEncoder<ModifyOrderPolicyArgs>;
|
|
15
|
+
export declare function getModifyOrderPolicyDecoder(): FixedSizeDecoder<ModifyOrderPolicy>;
|
|
16
|
+
export declare function getModifyOrderPolicyCodec(): FixedSizeCodec<ModifyOrderPolicyArgs, ModifyOrderPolicy>;
|
|
@@ -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.ModifyOrderPolicy = void 0;
|
|
11
|
+
exports.getModifyOrderPolicyEncoder = getModifyOrderPolicyEncoder;
|
|
12
|
+
exports.getModifyOrderPolicyDecoder = getModifyOrderPolicyDecoder;
|
|
13
|
+
exports.getModifyOrderPolicyCodec = getModifyOrderPolicyCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var ModifyOrderPolicy;
|
|
16
|
+
(function (ModifyOrderPolicy) {
|
|
17
|
+
ModifyOrderPolicy[ModifyOrderPolicy["MustModify"] = 0] = "MustModify";
|
|
18
|
+
ModifyOrderPolicy[ModifyOrderPolicy["ExcludePreviousFill"] = 1] = "ExcludePreviousFill";
|
|
19
|
+
})(ModifyOrderPolicy || (exports.ModifyOrderPolicy = ModifyOrderPolicy = {}));
|
|
20
|
+
function getModifyOrderPolicyEncoder() {
|
|
21
|
+
return (0, kit_1.getEnumEncoder)(ModifyOrderPolicy);
|
|
22
|
+
}
|
|
23
|
+
function getModifyOrderPolicyDecoder() {
|
|
24
|
+
return (0, kit_1.getEnumDecoder)(ModifyOrderPolicy);
|
|
25
|
+
}
|
|
26
|
+
function getModifyOrderPolicyCodec() {
|
|
27
|
+
return (0, kit_1.combineCodec)(getModifyOrderPolicyEncoder(), getModifyOrderPolicyDecoder());
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
import { type PriceDivergenceGuardRails, type PriceDivergenceGuardRailsArgs, type ValidityGuardRails, type ValidityGuardRailsArgs } from ".";
|
|
10
|
+
export type OracleGuardRails = {
|
|
11
|
+
priceDivergence: PriceDivergenceGuardRails;
|
|
12
|
+
validity: ValidityGuardRails;
|
|
13
|
+
};
|
|
14
|
+
export type OracleGuardRailsArgs = {
|
|
15
|
+
priceDivergence: PriceDivergenceGuardRailsArgs;
|
|
16
|
+
validity: ValidityGuardRailsArgs;
|
|
17
|
+
};
|
|
18
|
+
export declare function getOracleGuardRailsEncoder(): FixedSizeEncoder<OracleGuardRailsArgs>;
|
|
19
|
+
export declare function getOracleGuardRailsDecoder(): FixedSizeDecoder<OracleGuardRails>;
|
|
20
|
+
export declare function getOracleGuardRailsCodec(): FixedSizeCodec<OracleGuardRailsArgs, OracleGuardRails>;
|
|
@@ -0,0 +1,29 @@
|
|
|
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.getOracleGuardRailsEncoder = getOracleGuardRailsEncoder;
|
|
11
|
+
exports.getOracleGuardRailsDecoder = getOracleGuardRailsDecoder;
|
|
12
|
+
exports.getOracleGuardRailsCodec = getOracleGuardRailsCodec;
|
|
13
|
+
const kit_1 = require("@solana/kit");
|
|
14
|
+
const _1 = require(".");
|
|
15
|
+
function getOracleGuardRailsEncoder() {
|
|
16
|
+
return (0, kit_1.getStructEncoder)([
|
|
17
|
+
["priceDivergence", (0, _1.getPriceDivergenceGuardRailsEncoder)()],
|
|
18
|
+
["validity", (0, _1.getValidityGuardRailsEncoder)()],
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
function getOracleGuardRailsDecoder() {
|
|
22
|
+
return (0, kit_1.getStructDecoder)([
|
|
23
|
+
["priceDivergence", (0, _1.getPriceDivergenceGuardRailsDecoder)()],
|
|
24
|
+
["validity", (0, _1.getValidityGuardRailsDecoder)()],
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
function getOracleGuardRailsCodec() {
|
|
28
|
+
return (0, kit_1.combineCodec)(getOracleGuardRailsEncoder(), getOracleGuardRailsDecoder());
|
|
29
|
+
}
|
|
@@ -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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
+
export declare enum OracleSource {
|
|
10
|
+
Pyth = 0,
|
|
11
|
+
Switchboard = 1,
|
|
12
|
+
QuoteAsset = 2,
|
|
13
|
+
Pyth1K = 3,
|
|
14
|
+
Pyth1M = 4,
|
|
15
|
+
PythStableCoin = 5,
|
|
16
|
+
Prelaunch = 6,
|
|
17
|
+
PythPull = 7,
|
|
18
|
+
Pyth1KPull = 8,
|
|
19
|
+
Pyth1MPull = 9,
|
|
20
|
+
PythStableCoinPull = 10,
|
|
21
|
+
SwitchboardOnDemand = 11,
|
|
22
|
+
PythLazer = 12,
|
|
23
|
+
PythLazer1K = 13,
|
|
24
|
+
PythLazer1M = 14,
|
|
25
|
+
PythLazerStableCoin = 15
|
|
26
|
+
}
|
|
27
|
+
export type OracleSourceArgs = OracleSource;
|
|
28
|
+
export declare function getOracleSourceEncoder(): FixedSizeEncoder<OracleSourceArgs>;
|
|
29
|
+
export declare function getOracleSourceDecoder(): FixedSizeDecoder<OracleSource>;
|
|
30
|
+
export declare function getOracleSourceCodec(): FixedSizeCodec<OracleSourceArgs, OracleSource>;
|
|
@@ -0,0 +1,42 @@
|
|
|
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.OracleSource = void 0;
|
|
11
|
+
exports.getOracleSourceEncoder = getOracleSourceEncoder;
|
|
12
|
+
exports.getOracleSourceDecoder = getOracleSourceDecoder;
|
|
13
|
+
exports.getOracleSourceCodec = getOracleSourceCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var OracleSource;
|
|
16
|
+
(function (OracleSource) {
|
|
17
|
+
OracleSource[OracleSource["Pyth"] = 0] = "Pyth";
|
|
18
|
+
OracleSource[OracleSource["Switchboard"] = 1] = "Switchboard";
|
|
19
|
+
OracleSource[OracleSource["QuoteAsset"] = 2] = "QuoteAsset";
|
|
20
|
+
OracleSource[OracleSource["Pyth1K"] = 3] = "Pyth1K";
|
|
21
|
+
OracleSource[OracleSource["Pyth1M"] = 4] = "Pyth1M";
|
|
22
|
+
OracleSource[OracleSource["PythStableCoin"] = 5] = "PythStableCoin";
|
|
23
|
+
OracleSource[OracleSource["Prelaunch"] = 6] = "Prelaunch";
|
|
24
|
+
OracleSource[OracleSource["PythPull"] = 7] = "PythPull";
|
|
25
|
+
OracleSource[OracleSource["Pyth1KPull"] = 8] = "Pyth1KPull";
|
|
26
|
+
OracleSource[OracleSource["Pyth1MPull"] = 9] = "Pyth1MPull";
|
|
27
|
+
OracleSource[OracleSource["PythStableCoinPull"] = 10] = "PythStableCoinPull";
|
|
28
|
+
OracleSource[OracleSource["SwitchboardOnDemand"] = 11] = "SwitchboardOnDemand";
|
|
29
|
+
OracleSource[OracleSource["PythLazer"] = 12] = "PythLazer";
|
|
30
|
+
OracleSource[OracleSource["PythLazer1K"] = 13] = "PythLazer1K";
|
|
31
|
+
OracleSource[OracleSource["PythLazer1M"] = 14] = "PythLazer1M";
|
|
32
|
+
OracleSource[OracleSource["PythLazerStableCoin"] = 15] = "PythLazerStableCoin";
|
|
33
|
+
})(OracleSource || (exports.OracleSource = OracleSource = {}));
|
|
34
|
+
function getOracleSourceEncoder() {
|
|
35
|
+
return (0, kit_1.getEnumEncoder)(OracleSource);
|
|
36
|
+
}
|
|
37
|
+
function getOracleSourceDecoder() {
|
|
38
|
+
return (0, kit_1.getEnumDecoder)(OracleSource);
|
|
39
|
+
}
|
|
40
|
+
function getOracleSourceCodec() {
|
|
41
|
+
return (0, kit_1.combineCodec)(getOracleSourceEncoder(), getOracleSourceDecoder());
|
|
42
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 Codec, type Decoder, type Encoder, type GetDiscriminatedUnionVariant, type GetDiscriminatedUnionVariantContent } from "@solana/kit";
|
|
9
|
+
export type OracleValidity = {
|
|
10
|
+
__kind: "NonPositive";
|
|
11
|
+
} | {
|
|
12
|
+
__kind: "TooVolatile";
|
|
13
|
+
} | {
|
|
14
|
+
__kind: "TooUncertain";
|
|
15
|
+
} | {
|
|
16
|
+
__kind: "StaleForMargin";
|
|
17
|
+
} | {
|
|
18
|
+
__kind: "InsufficientDataPoints";
|
|
19
|
+
} | {
|
|
20
|
+
__kind: "StaleForAMM";
|
|
21
|
+
immediate: boolean;
|
|
22
|
+
lowRisk: boolean;
|
|
23
|
+
} | {
|
|
24
|
+
__kind: "Valid";
|
|
25
|
+
};
|
|
26
|
+
export type OracleValidityArgs = OracleValidity;
|
|
27
|
+
export declare function getOracleValidityEncoder(): Encoder<OracleValidityArgs>;
|
|
28
|
+
export declare function getOracleValidityDecoder(): Decoder<OracleValidity>;
|
|
29
|
+
export declare function getOracleValidityCodec(): Codec<OracleValidityArgs, OracleValidity>;
|
|
30
|
+
export declare function oracleValidity(kind: "NonPositive"): GetDiscriminatedUnionVariant<OracleValidityArgs, "__kind", "NonPositive">;
|
|
31
|
+
export declare function oracleValidity(kind: "TooVolatile"): GetDiscriminatedUnionVariant<OracleValidityArgs, "__kind", "TooVolatile">;
|
|
32
|
+
export declare function oracleValidity(kind: "TooUncertain"): GetDiscriminatedUnionVariant<OracleValidityArgs, "__kind", "TooUncertain">;
|
|
33
|
+
export declare function oracleValidity(kind: "StaleForMargin"): GetDiscriminatedUnionVariant<OracleValidityArgs, "__kind", "StaleForMargin">;
|
|
34
|
+
export declare function oracleValidity(kind: "InsufficientDataPoints"): GetDiscriminatedUnionVariant<OracleValidityArgs, "__kind", "InsufficientDataPoints">;
|
|
35
|
+
export declare function oracleValidity(kind: "StaleForAMM", data: GetDiscriminatedUnionVariantContent<OracleValidityArgs, "__kind", "StaleForAMM">): GetDiscriminatedUnionVariant<OracleValidityArgs, "__kind", "StaleForAMM">;
|
|
36
|
+
export declare function oracleValidity(kind: "Valid"): GetDiscriminatedUnionVariant<OracleValidityArgs, "__kind", "Valid">;
|
|
37
|
+
export declare function isOracleValidity<K extends OracleValidity["__kind"]>(kind: K, value: OracleValidity): value is OracleValidity & {
|
|
38
|
+
__kind: K;
|
|
39
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
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.getOracleValidityEncoder = getOracleValidityEncoder;
|
|
11
|
+
exports.getOracleValidityDecoder = getOracleValidityDecoder;
|
|
12
|
+
exports.getOracleValidityCodec = getOracleValidityCodec;
|
|
13
|
+
exports.oracleValidity = oracleValidity;
|
|
14
|
+
exports.isOracleValidity = isOracleValidity;
|
|
15
|
+
const kit_1 = require("@solana/kit");
|
|
16
|
+
function getOracleValidityEncoder() {
|
|
17
|
+
return (0, kit_1.getDiscriminatedUnionEncoder)([
|
|
18
|
+
["NonPositive", (0, kit_1.getUnitEncoder)()],
|
|
19
|
+
["TooVolatile", (0, kit_1.getUnitEncoder)()],
|
|
20
|
+
["TooUncertain", (0, kit_1.getUnitEncoder)()],
|
|
21
|
+
["StaleForMargin", (0, kit_1.getUnitEncoder)()],
|
|
22
|
+
["InsufficientDataPoints", (0, kit_1.getUnitEncoder)()],
|
|
23
|
+
[
|
|
24
|
+
"StaleForAMM",
|
|
25
|
+
(0, kit_1.getStructEncoder)([
|
|
26
|
+
["immediate", (0, kit_1.getBooleanEncoder)()],
|
|
27
|
+
["lowRisk", (0, kit_1.getBooleanEncoder)()],
|
|
28
|
+
]),
|
|
29
|
+
],
|
|
30
|
+
["Valid", (0, kit_1.getUnitEncoder)()],
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
function getOracleValidityDecoder() {
|
|
34
|
+
return (0, kit_1.getDiscriminatedUnionDecoder)([
|
|
35
|
+
["NonPositive", (0, kit_1.getUnitDecoder)()],
|
|
36
|
+
["TooVolatile", (0, kit_1.getUnitDecoder)()],
|
|
37
|
+
["TooUncertain", (0, kit_1.getUnitDecoder)()],
|
|
38
|
+
["StaleForMargin", (0, kit_1.getUnitDecoder)()],
|
|
39
|
+
["InsufficientDataPoints", (0, kit_1.getUnitDecoder)()],
|
|
40
|
+
[
|
|
41
|
+
"StaleForAMM",
|
|
42
|
+
(0, kit_1.getStructDecoder)([
|
|
43
|
+
["immediate", (0, kit_1.getBooleanDecoder)()],
|
|
44
|
+
["lowRisk", (0, kit_1.getBooleanDecoder)()],
|
|
45
|
+
]),
|
|
46
|
+
],
|
|
47
|
+
["Valid", (0, kit_1.getUnitDecoder)()],
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
function getOracleValidityCodec() {
|
|
51
|
+
return (0, kit_1.combineCodec)(getOracleValidityEncoder(), getOracleValidityDecoder());
|
|
52
|
+
}
|
|
53
|
+
function oracleValidity(kind, data) {
|
|
54
|
+
return Array.isArray(data)
|
|
55
|
+
? { __kind: kind, fields: data }
|
|
56
|
+
: Object.assign({ __kind: kind }, (data !== null && data !== void 0 ? data : {}));
|
|
57
|
+
}
|
|
58
|
+
function isOracleValidity(kind, value) {
|
|
59
|
+
return value.__kind === kind;
|
|
60
|
+
}
|