@drift-labs/sdk 2.102.0-beta.0 → 2.102.0-beta.2
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/browser/adminClient.d.ts +2 -2
- package/lib/browser/adminClient.js +4 -6
- package/lib/browser/constants/perpMarkets.js +1 -1
- package/lib/browser/constants/spotMarkets.js +10 -0
- package/lib/node/adminClient.d.ts +2 -2
- package/lib/node/adminClient.js +4 -6
- package/lib/node/constants/perpMarkets.js +1 -1
- package/lib/node/constants/spotMarkets.js +10 -0
- package/package.json +1 -1
- package/src/adminClient.ts +7 -6
- package/src/constants/perpMarkets.ts +1 -1
- package/src/constants/spotMarkets.ts +11 -0
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.102.0-beta.
|
|
1
|
+
2.102.0-beta.2
|
|
@@ -193,8 +193,8 @@ export declare class AdminClient extends DriftClient {
|
|
|
193
193
|
getUpdatePerpMarketFuelIx(perpMarketIndex: number, fuelBoostTaker?: number, fuelBoostMaker?: number, fuelBoostPosition?: number): Promise<TransactionInstruction>;
|
|
194
194
|
initUserFuel(user: PublicKey, authority: PublicKey, fuelBonusDeposits?: number, fuelBonusBorrows?: number, fuelBonusTaker?: number, fuelBonusMaker?: number, fuelBonusInsurance?: number): Promise<TransactionSignature>;
|
|
195
195
|
getInitUserFuelIx(user: PublicKey, authority: PublicKey, fuelBonusDeposits?: number, fuelBonusBorrows?: number, fuelBonusTaker?: number, fuelBonusMaker?: number, fuelBonusInsurance?: number): Promise<TransactionInstruction>;
|
|
196
|
-
initializePythPullOracle(feedId: string): Promise<TransactionSignature>;
|
|
197
|
-
getInitializePythPullOracleIx(feedId: string): Promise<TransactionInstruction>;
|
|
196
|
+
initializePythPullOracle(feedId: string, isAdmin?: boolean): Promise<TransactionSignature>;
|
|
197
|
+
getInitializePythPullOracleIx(feedId: string, isAdmin?: boolean): Promise<TransactionInstruction>;
|
|
198
198
|
initializeHighLeverageModeConfig(maxUsers: number): Promise<TransactionSignature>;
|
|
199
199
|
getInitializeHighLeverageModeConfigIx(maxUsers: number): Promise<TransactionInstruction>;
|
|
200
200
|
updateUpdateHighLeverageModeConfig(maxUsers: number, reduceOnly: boolean): Promise<TransactionSignature>;
|
|
@@ -1766,19 +1766,17 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
1766
1766
|
},
|
|
1767
1767
|
});
|
|
1768
1768
|
}
|
|
1769
|
-
async initializePythPullOracle(feedId) {
|
|
1770
|
-
const initializePythPullOracleIx = await this.getInitializePythPullOracleIx(feedId);
|
|
1769
|
+
async initializePythPullOracle(feedId, isAdmin = false) {
|
|
1770
|
+
const initializePythPullOracleIx = await this.getInitializePythPullOracleIx(feedId, isAdmin);
|
|
1771
1771
|
const tx = await this.buildTransaction(initializePythPullOracleIx);
|
|
1772
1772
|
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
1773
1773
|
return txSig;
|
|
1774
1774
|
}
|
|
1775
|
-
async getInitializePythPullOracleIx(feedId) {
|
|
1775
|
+
async getInitializePythPullOracleIx(feedId, isAdmin = false) {
|
|
1776
1776
|
const feedIdBuffer = (0, pythPullOracleUtils_1.getFeedIdUint8Array)(feedId);
|
|
1777
1777
|
return await this.program.instruction.initializePythPullOracle(feedIdBuffer, {
|
|
1778
1778
|
accounts: {
|
|
1779
|
-
admin: this.
|
|
1780
|
-
? this.getStateAccount().admin
|
|
1781
|
-
: this.wallet.publicKey,
|
|
1779
|
+
admin: isAdmin ? this.getStateAccount().admin : this.wallet.publicKey,
|
|
1782
1780
|
state: await this.getStatePublicKey(),
|
|
1783
1781
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
1784
1782
|
priceFeed: (0, pda_1.getPythPullOraclePublicKey)(this.program.programId, feedIdBuffer),
|
|
@@ -921,7 +921,7 @@ exports.MainnetPerpMarkets = [
|
|
|
921
921
|
symbol: 'PNUT-PERP',
|
|
922
922
|
baseAssetSymbol: 'PNUT',
|
|
923
923
|
marketIndex: 55,
|
|
924
|
-
oracle: new web3_js_1.PublicKey('
|
|
924
|
+
oracle: new web3_js_1.PublicKey('5AcetMtdRHxkse2ny44NcRdsysnXu9deW7Yy5Y63qAHE'),
|
|
925
925
|
launchTs: 1731443152000,
|
|
926
926
|
oracleSource: __1.OracleSource.PYTH_PULL,
|
|
927
927
|
pythFeedId: '0x116da895807f81f6b5c5f01b109376e7f6834dc8b51365ab7cdfa66634340e54',
|
|
@@ -365,6 +365,16 @@ exports.MainnetSpotMarkets = [
|
|
|
365
365
|
precisionExp: numericConstants_1.EIGHT,
|
|
366
366
|
pythFeedId: '0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
|
|
367
367
|
},
|
|
368
|
+
{
|
|
369
|
+
symbol: 'USDS',
|
|
370
|
+
marketIndex: 28,
|
|
371
|
+
oracle: new web3_js_1.PublicKey('7pT9mxKXyvfaZKeKy1oe2oV2K1RFtF7tPEJHUY3h2vVV'),
|
|
372
|
+
oracleSource: __1.OracleSource.PYTH_PULL,
|
|
373
|
+
mint: new web3_js_1.PublicKey('USDSwr9ApdHk5bvJKMjzff41FfuX8bSxdKcR81vTwcA'),
|
|
374
|
+
precision: new __1.BN(10).pow(numericConstants_1.SIX),
|
|
375
|
+
precisionExp: numericConstants_1.SIX,
|
|
376
|
+
pythFeedId: '0x77f0971af11cc8bac224917275c1bf55f2319ed5c654a1ca955c82fa2d297ea1',
|
|
377
|
+
},
|
|
368
378
|
];
|
|
369
379
|
exports.SpotMarkets = {
|
|
370
380
|
devnet: exports.DevnetSpotMarkets,
|
|
@@ -193,8 +193,8 @@ export declare class AdminClient extends DriftClient {
|
|
|
193
193
|
getUpdatePerpMarketFuelIx(perpMarketIndex: number, fuelBoostTaker?: number, fuelBoostMaker?: number, fuelBoostPosition?: number): Promise<TransactionInstruction>;
|
|
194
194
|
initUserFuel(user: PublicKey, authority: PublicKey, fuelBonusDeposits?: number, fuelBonusBorrows?: number, fuelBonusTaker?: number, fuelBonusMaker?: number, fuelBonusInsurance?: number): Promise<TransactionSignature>;
|
|
195
195
|
getInitUserFuelIx(user: PublicKey, authority: PublicKey, fuelBonusDeposits?: number, fuelBonusBorrows?: number, fuelBonusTaker?: number, fuelBonusMaker?: number, fuelBonusInsurance?: number): Promise<TransactionInstruction>;
|
|
196
|
-
initializePythPullOracle(feedId: string): Promise<TransactionSignature>;
|
|
197
|
-
getInitializePythPullOracleIx(feedId: string): Promise<TransactionInstruction>;
|
|
196
|
+
initializePythPullOracle(feedId: string, isAdmin?: boolean): Promise<TransactionSignature>;
|
|
197
|
+
getInitializePythPullOracleIx(feedId: string, isAdmin?: boolean): Promise<TransactionInstruction>;
|
|
198
198
|
initializeHighLeverageModeConfig(maxUsers: number): Promise<TransactionSignature>;
|
|
199
199
|
getInitializeHighLeverageModeConfigIx(maxUsers: number): Promise<TransactionInstruction>;
|
|
200
200
|
updateUpdateHighLeverageModeConfig(maxUsers: number, reduceOnly: boolean): Promise<TransactionSignature>;
|
package/lib/node/adminClient.js
CHANGED
|
@@ -1766,19 +1766,17 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
1766
1766
|
},
|
|
1767
1767
|
});
|
|
1768
1768
|
}
|
|
1769
|
-
async initializePythPullOracle(feedId) {
|
|
1770
|
-
const initializePythPullOracleIx = await this.getInitializePythPullOracleIx(feedId);
|
|
1769
|
+
async initializePythPullOracle(feedId, isAdmin = false) {
|
|
1770
|
+
const initializePythPullOracleIx = await this.getInitializePythPullOracleIx(feedId, isAdmin);
|
|
1771
1771
|
const tx = await this.buildTransaction(initializePythPullOracleIx);
|
|
1772
1772
|
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
1773
1773
|
return txSig;
|
|
1774
1774
|
}
|
|
1775
|
-
async getInitializePythPullOracleIx(feedId) {
|
|
1775
|
+
async getInitializePythPullOracleIx(feedId, isAdmin = false) {
|
|
1776
1776
|
const feedIdBuffer = (0, pythPullOracleUtils_1.getFeedIdUint8Array)(feedId);
|
|
1777
1777
|
return await this.program.instruction.initializePythPullOracle(feedIdBuffer, {
|
|
1778
1778
|
accounts: {
|
|
1779
|
-
admin: this.
|
|
1780
|
-
? this.getStateAccount().admin
|
|
1781
|
-
: this.wallet.publicKey,
|
|
1779
|
+
admin: isAdmin ? this.getStateAccount().admin : this.wallet.publicKey,
|
|
1782
1780
|
state: await this.getStatePublicKey(),
|
|
1783
1781
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
1784
1782
|
priceFeed: (0, pda_1.getPythPullOraclePublicKey)(this.program.programId, feedIdBuffer),
|
|
@@ -921,7 +921,7 @@ exports.MainnetPerpMarkets = [
|
|
|
921
921
|
symbol: 'PNUT-PERP',
|
|
922
922
|
baseAssetSymbol: 'PNUT',
|
|
923
923
|
marketIndex: 55,
|
|
924
|
-
oracle: new web3_js_1.PublicKey('
|
|
924
|
+
oracle: new web3_js_1.PublicKey('5AcetMtdRHxkse2ny44NcRdsysnXu9deW7Yy5Y63qAHE'),
|
|
925
925
|
launchTs: 1731443152000,
|
|
926
926
|
oracleSource: __1.OracleSource.PYTH_PULL,
|
|
927
927
|
pythFeedId: '0x116da895807f81f6b5c5f01b109376e7f6834dc8b51365ab7cdfa66634340e54',
|
|
@@ -365,6 +365,16 @@ exports.MainnetSpotMarkets = [
|
|
|
365
365
|
precisionExp: numericConstants_1.EIGHT,
|
|
366
366
|
pythFeedId: '0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
|
|
367
367
|
},
|
|
368
|
+
{
|
|
369
|
+
symbol: 'USDS',
|
|
370
|
+
marketIndex: 28,
|
|
371
|
+
oracle: new web3_js_1.PublicKey('7pT9mxKXyvfaZKeKy1oe2oV2K1RFtF7tPEJHUY3h2vVV'),
|
|
372
|
+
oracleSource: __1.OracleSource.PYTH_PULL,
|
|
373
|
+
mint: new web3_js_1.PublicKey('USDSwr9ApdHk5bvJKMjzff41FfuX8bSxdKcR81vTwcA'),
|
|
374
|
+
precision: new __1.BN(10).pow(numericConstants_1.SIX),
|
|
375
|
+
precisionExp: numericConstants_1.SIX,
|
|
376
|
+
pythFeedId: '0x77f0971af11cc8bac224917275c1bf55f2319ed5c654a1ca955c82fa2d297ea1',
|
|
377
|
+
},
|
|
368
378
|
];
|
|
369
379
|
exports.SpotMarkets = {
|
|
370
380
|
devnet: exports.DevnetSpotMarkets,
|
package/package.json
CHANGED
package/src/adminClient.ts
CHANGED
|
@@ -3859,10 +3859,12 @@ export class AdminClient extends DriftClient {
|
|
|
3859
3859
|
}
|
|
3860
3860
|
|
|
3861
3861
|
public async initializePythPullOracle(
|
|
3862
|
-
feedId: string
|
|
3862
|
+
feedId: string,
|
|
3863
|
+
isAdmin = false
|
|
3863
3864
|
): Promise<TransactionSignature> {
|
|
3864
3865
|
const initializePythPullOracleIx = await this.getInitializePythPullOracleIx(
|
|
3865
|
-
feedId
|
|
3866
|
+
feedId,
|
|
3867
|
+
isAdmin
|
|
3866
3868
|
);
|
|
3867
3869
|
const tx = await this.buildTransaction(initializePythPullOracleIx);
|
|
3868
3870
|
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
@@ -3871,16 +3873,15 @@ export class AdminClient extends DriftClient {
|
|
|
3871
3873
|
}
|
|
3872
3874
|
|
|
3873
3875
|
public async getInitializePythPullOracleIx(
|
|
3874
|
-
feedId: string
|
|
3876
|
+
feedId: string,
|
|
3877
|
+
isAdmin = false
|
|
3875
3878
|
): Promise<TransactionInstruction> {
|
|
3876
3879
|
const feedIdBuffer = getFeedIdUint8Array(feedId);
|
|
3877
3880
|
return await this.program.instruction.initializePythPullOracle(
|
|
3878
3881
|
feedIdBuffer,
|
|
3879
3882
|
{
|
|
3880
3883
|
accounts: {
|
|
3881
|
-
admin: this.
|
|
3882
|
-
? this.getStateAccount().admin
|
|
3883
|
-
: this.wallet.publicKey,
|
|
3884
|
+
admin: isAdmin ? this.getStateAccount().admin : this.wallet.publicKey,
|
|
3884
3885
|
state: await this.getStatePublicKey(),
|
|
3885
3886
|
systemProgram: SystemProgram.programId,
|
|
3886
3887
|
priceFeed: getPythPullOraclePublicKey(
|
|
@@ -1002,7 +1002,7 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
|
|
|
1002
1002
|
symbol: 'PNUT-PERP',
|
|
1003
1003
|
baseAssetSymbol: 'PNUT',
|
|
1004
1004
|
marketIndex: 55,
|
|
1005
|
-
oracle: new PublicKey('
|
|
1005
|
+
oracle: new PublicKey('5AcetMtdRHxkse2ny44NcRdsysnXu9deW7Yy5Y63qAHE'),
|
|
1006
1006
|
launchTs: 1731443152000,
|
|
1007
1007
|
oracleSource: OracleSource.PYTH_PULL,
|
|
1008
1008
|
pythFeedId:
|
|
@@ -450,6 +450,17 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
|
|
|
450
450
|
pythFeedId:
|
|
451
451
|
'0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
|
|
452
452
|
},
|
|
453
|
+
{
|
|
454
|
+
symbol: 'USDS',
|
|
455
|
+
marketIndex: 28,
|
|
456
|
+
oracle: new PublicKey('7pT9mxKXyvfaZKeKy1oe2oV2K1RFtF7tPEJHUY3h2vVV'),
|
|
457
|
+
oracleSource: OracleSource.PYTH_PULL,
|
|
458
|
+
mint: new PublicKey('USDSwr9ApdHk5bvJKMjzff41FfuX8bSxdKcR81vTwcA'),
|
|
459
|
+
precision: new BN(10).pow(SIX),
|
|
460
|
+
precisionExp: SIX,
|
|
461
|
+
pythFeedId:
|
|
462
|
+
'0x77f0971af11cc8bac224917275c1bf55f2319ed5c654a1ca955c82fa2d297ea1',
|
|
463
|
+
},
|
|
453
464
|
];
|
|
454
465
|
|
|
455
466
|
export const SpotMarkets: { [key in DriftEnv]: SpotMarketConfig[] } = {
|