@drift-labs/sdk 2.97.0-beta.12 → 2.97.0-beta.14
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/VERSION +1 -1
- package/lib/constants/perpMarkets.js +2 -2
- package/lib/driftClient.d.ts +2 -1
- package/lib/driftClient.js +4 -0
- package/lib/types.d.ts +5 -0
- package/package.json +1 -1
- package/src/constants/perpMarkets.ts +2 -2
- package/src/driftClient.ts +8 -0
- package/src/types.ts +6 -0
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.97.0-beta.
|
|
1
|
+
2.97.0-beta.14
|
|
@@ -659,9 +659,9 @@ exports.MainnetPerpMarkets = [
|
|
|
659
659
|
symbol: 'CLOUD-PERP',
|
|
660
660
|
baseAssetSymbol: 'CLOUD',
|
|
661
661
|
marketIndex: 31,
|
|
662
|
-
oracle: new web3_js_1.PublicKey('
|
|
662
|
+
oracle: new web3_js_1.PublicKey('FNFejcXENaPgKaCTfstew9vSSvdQPnXjGTkJjUnnYvHU'),
|
|
663
663
|
launchTs: 1717597648000,
|
|
664
|
-
oracleSource: __1.OracleSource.
|
|
664
|
+
oracleSource: __1.OracleSource.SWITCHBOARD_ON_DEMAND,
|
|
665
665
|
},
|
|
666
666
|
{
|
|
667
667
|
fullName: 'IO',
|
package/lib/driftClient.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as anchor from '@coral-xyz/anchor';
|
|
5
5
|
import { AnchorProvider, BN, Program, ProgramAccount } from '@coral-xyz/anchor';
|
|
6
6
|
import { Idl as Idl30, Program as Program30 } from '@coral-xyz/anchor-30';
|
|
7
|
-
import { DriftClientMetricsEvents, IWallet, MakerInfo, MappedRecord, MarketType, ModifyOrderPolicy, OpenbookV2FulfillmentConfigAccount, OptionalOrderParams, Order, OrderParams, OrderTriggerCondition, PerpMarketAccount, PerpMarketExtendedInfo, PhoenixV1FulfillmentConfigAccount, PlaceAndTakeOrderSuccessCondition, PositionDirection, ReferrerInfo, ReferrerNameAccount, SerumV3FulfillmentConfigAccount, SettlePnlMode, SignedTxData, SpotMarketAccount, SpotPosition, StateAccount, SwapReduceOnly, SwiftOrderParamsMessage, SwiftServerMessage, TakerInfo, TxParams, UserAccount, UserStatsAccount } from './types';
|
|
7
|
+
import { DriftClientMetricsEvents, HighLeverageModeConfig, IWallet, MakerInfo, MappedRecord, MarketType, ModifyOrderPolicy, OpenbookV2FulfillmentConfigAccount, OptionalOrderParams, Order, OrderParams, OrderTriggerCondition, PerpMarketAccount, PerpMarketExtendedInfo, PhoenixV1FulfillmentConfigAccount, PlaceAndTakeOrderSuccessCondition, PositionDirection, ReferrerInfo, ReferrerNameAccount, SerumV3FulfillmentConfigAccount, SettlePnlMode, SignedTxData, SpotMarketAccount, SpotPosition, StateAccount, SwapReduceOnly, SwiftOrderParamsMessage, SwiftServerMessage, TakerInfo, TxParams, UserAccount, UserStatsAccount } from './types';
|
|
8
8
|
import { AccountMeta, AddressLookupTableAccount, BlockhashWithExpiryBlockHeight, ConfirmOptions, Connection, Keypair, PublicKey, Signer, Transaction, TransactionInstruction, TransactionSignature, TransactionVersion, VersionedTransaction } from '@solana/web3.js';
|
|
9
9
|
import { TokenFaucet } from './tokenFaucet';
|
|
10
10
|
import { EventEmitter } from 'events';
|
|
@@ -793,6 +793,7 @@ export declare class DriftClient {
|
|
|
793
793
|
getEnableHighLeverageModeIx(subAccountId: number): Promise<anchor.web3.TransactionInstruction>;
|
|
794
794
|
disableUserHighLeverageMode(user: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
|
|
795
795
|
getDisableHighLeverageModeIx(user: PublicKey): Promise<anchor.web3.TransactionInstruction>;
|
|
796
|
+
fetchHighLeverageModeConfig(): Promise<HighLeverageModeConfig>;
|
|
796
797
|
private handleSignedTransaction;
|
|
797
798
|
private handlePreSignedTransaction;
|
|
798
799
|
private isVersionedTransaction;
|
package/lib/driftClient.js
CHANGED
|
@@ -4284,6 +4284,10 @@ class DriftClient {
|
|
|
4284
4284
|
});
|
|
4285
4285
|
return ix;
|
|
4286
4286
|
}
|
|
4287
|
+
async fetchHighLeverageModeConfig() {
|
|
4288
|
+
const config = await this.program.account.highLeverageModeConfig.fetch((0, pda_1.getHighLeverageModeConfigPublicKey)(this.program.programId));
|
|
4289
|
+
return config;
|
|
4290
|
+
}
|
|
4287
4291
|
handleSignedTransaction(signedTxs) {
|
|
4288
4292
|
if (this.enableMetricsEvents && this.metricsEventEmitter) {
|
|
4289
4293
|
this.metricsEventEmitter.emit('txSigned', signedTxs);
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -728,9 +728,9 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
|
|
|
728
728
|
symbol: 'CLOUD-PERP',
|
|
729
729
|
baseAssetSymbol: 'CLOUD',
|
|
730
730
|
marketIndex: 31,
|
|
731
|
-
oracle: new PublicKey('
|
|
731
|
+
oracle: new PublicKey('FNFejcXENaPgKaCTfstew9vSSvdQPnXjGTkJjUnnYvHU'),
|
|
732
732
|
launchTs: 1717597648000,
|
|
733
|
-
oracleSource: OracleSource.
|
|
733
|
+
oracleSource: OracleSource.SWITCHBOARD_ON_DEMAND,
|
|
734
734
|
},
|
|
735
735
|
{
|
|
736
736
|
fullName: 'IO',
|
package/src/driftClient.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
} from '@solana/spl-token';
|
|
20
20
|
import {
|
|
21
21
|
DriftClientMetricsEvents,
|
|
22
|
+
HighLeverageModeConfig,
|
|
22
23
|
isVariant,
|
|
23
24
|
IWallet,
|
|
24
25
|
MakerInfo,
|
|
@@ -8170,6 +8171,13 @@ export class DriftClient {
|
|
|
8170
8171
|
return ix;
|
|
8171
8172
|
}
|
|
8172
8173
|
|
|
8174
|
+
public async fetchHighLeverageModeConfig(): Promise<HighLeverageModeConfig> {
|
|
8175
|
+
const config = await this.program.account.highLeverageModeConfig.fetch(
|
|
8176
|
+
getHighLeverageModeConfigPublicKey(this.program.programId)
|
|
8177
|
+
);
|
|
8178
|
+
return config as HighLeverageModeConfig;
|
|
8179
|
+
}
|
|
8180
|
+
|
|
8173
8181
|
private handleSignedTransaction(signedTxs: SignedTxData[]) {
|
|
8174
8182
|
if (this.enableMetricsEvents && this.metricsEventEmitter) {
|
|
8175
8183
|
this.metricsEventEmitter.emit('txSigned', signedTxs);
|
package/src/types.ts
CHANGED