@drift-labs/sdk 2.72.0-beta.2 → 2.72.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/lib/adminClient.d.ts +1 -0
- package/lib/adminClient.js +11 -0
- package/lib/constants/perpMarkets.js +10 -0
- package/lib/idl/drift.json +36 -0
- package/package.json +1 -1
- package/src/adminClient.ts +23 -0
- package/src/constants/perpMarkets.ts +10 -0
- package/src/idl/drift.json +36 -0
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.72.0-beta.
|
|
1
|
+
2.72.0-beta.3
|
package/lib/adminClient.d.ts
CHANGED
|
@@ -84,4 +84,5 @@ export declare class AdminClient extends DriftClient {
|
|
|
84
84
|
updateProtocolIfSharesTransferConfig(whitelistedSigners?: PublicKey[], maxTransferPerEpoch?: BN): Promise<TransactionSignature>;
|
|
85
85
|
initializePrelaunchOracle(perpMarketIndex: number, price?: BN, maxPrice?: BN): Promise<TransactionSignature>;
|
|
86
86
|
updatePrelaunchOracleParams(perpMarketIndex: number, price?: BN, maxPrice?: BN): Promise<TransactionSignature>;
|
|
87
|
+
deletePrelaunchOracle(perpMarketIndex: number): Promise<TransactionSignature>;
|
|
87
88
|
}
|
package/lib/adminClient.js
CHANGED
|
@@ -967,6 +967,17 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
967
967
|
admin: this.wallet.publicKey,
|
|
968
968
|
state: await this.getStatePublicKey(),
|
|
969
969
|
prelaunchOracle: await (0, pda_1.getPrelaunchOraclePublicKey)(this.program.programId, perpMarketIndex),
|
|
970
|
+
perpMarket: await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex),
|
|
971
|
+
},
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
async deletePrelaunchOracle(perpMarketIndex) {
|
|
975
|
+
return await this.program.rpc.deletePrelaunchOracle(perpMarketIndex, {
|
|
976
|
+
accounts: {
|
|
977
|
+
admin: this.wallet.publicKey,
|
|
978
|
+
state: await this.getStatePublicKey(),
|
|
979
|
+
prelaunchOracle: await (0, pda_1.getPrelaunchOraclePublicKey)(this.program.programId, perpMarketIndex),
|
|
980
|
+
perpMarket: await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex),
|
|
970
981
|
},
|
|
971
982
|
});
|
|
972
983
|
}
|
|
@@ -516,6 +516,16 @@ exports.MainnetPerpMarkets = [
|
|
|
516
516
|
launchTs: 1709136669000,
|
|
517
517
|
oracleSource: __1.OracleSource.PYTH,
|
|
518
518
|
},
|
|
519
|
+
{
|
|
520
|
+
fullName: 'Wormhole',
|
|
521
|
+
category: ['Bridge'],
|
|
522
|
+
symbol: 'W-PERP',
|
|
523
|
+
baseAssetSymbol: 'W',
|
|
524
|
+
marketIndex: 27,
|
|
525
|
+
oracle: new web3_js_1.PublicKey('GU6CA7a2KCyhpfqZNb36UAfc9uzKBM8jHjGdt245QhYX'),
|
|
526
|
+
launchTs: 1710418343000,
|
|
527
|
+
oracleSource: __1.OracleSource.Prelaunch,
|
|
528
|
+
},
|
|
519
529
|
];
|
|
520
530
|
exports.PerpMarkets = {
|
|
521
531
|
devnet: exports.DevnetPerpMarkets,
|
package/lib/idl/drift.json
CHANGED
|
@@ -4993,6 +4993,11 @@
|
|
|
4993
4993
|
"isMut": true,
|
|
4994
4994
|
"isSigner": false
|
|
4995
4995
|
},
|
|
4996
|
+
{
|
|
4997
|
+
"name": "perpMarket",
|
|
4998
|
+
"isMut": true,
|
|
4999
|
+
"isSigner": false
|
|
5000
|
+
},
|
|
4996
5001
|
{
|
|
4997
5002
|
"name": "state",
|
|
4998
5003
|
"isMut": false,
|
|
@@ -5007,6 +5012,37 @@
|
|
|
5007
5012
|
}
|
|
5008
5013
|
}
|
|
5009
5014
|
]
|
|
5015
|
+
},
|
|
5016
|
+
{
|
|
5017
|
+
"name": "deletePrelaunchOracle",
|
|
5018
|
+
"accounts": [
|
|
5019
|
+
{
|
|
5020
|
+
"name": "admin",
|
|
5021
|
+
"isMut": true,
|
|
5022
|
+
"isSigner": true
|
|
5023
|
+
},
|
|
5024
|
+
{
|
|
5025
|
+
"name": "prelaunchOracle",
|
|
5026
|
+
"isMut": true,
|
|
5027
|
+
"isSigner": false
|
|
5028
|
+
},
|
|
5029
|
+
{
|
|
5030
|
+
"name": "perpMarket",
|
|
5031
|
+
"isMut": false,
|
|
5032
|
+
"isSigner": false
|
|
5033
|
+
},
|
|
5034
|
+
{
|
|
5035
|
+
"name": "state",
|
|
5036
|
+
"isMut": false,
|
|
5037
|
+
"isSigner": false
|
|
5038
|
+
}
|
|
5039
|
+
],
|
|
5040
|
+
"args": [
|
|
5041
|
+
{
|
|
5042
|
+
"name": "perpMarketIndex",
|
|
5043
|
+
"type": "u16"
|
|
5044
|
+
}
|
|
5045
|
+
]
|
|
5010
5046
|
}
|
|
5011
5047
|
],
|
|
5012
5048
|
"accounts": [
|
package/package.json
CHANGED
package/src/adminClient.ts
CHANGED
|
@@ -1864,6 +1864,29 @@ export class AdminClient extends DriftClient {
|
|
|
1864
1864
|
this.program.programId,
|
|
1865
1865
|
perpMarketIndex
|
|
1866
1866
|
),
|
|
1867
|
+
perpMarket: await getPerpMarketPublicKey(
|
|
1868
|
+
this.program.programId,
|
|
1869
|
+
perpMarketIndex
|
|
1870
|
+
),
|
|
1871
|
+
},
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
public async deletePrelaunchOracle(
|
|
1876
|
+
perpMarketIndex: number
|
|
1877
|
+
): Promise<TransactionSignature> {
|
|
1878
|
+
return await this.program.rpc.deletePrelaunchOracle(perpMarketIndex, {
|
|
1879
|
+
accounts: {
|
|
1880
|
+
admin: this.wallet.publicKey,
|
|
1881
|
+
state: await this.getStatePublicKey(),
|
|
1882
|
+
prelaunchOracle: await getPrelaunchOraclePublicKey(
|
|
1883
|
+
this.program.programId,
|
|
1884
|
+
perpMarketIndex
|
|
1885
|
+
),
|
|
1886
|
+
perpMarket: await getPerpMarketPublicKey(
|
|
1887
|
+
this.program.programId,
|
|
1888
|
+
perpMarketIndex
|
|
1889
|
+
),
|
|
1867
1890
|
},
|
|
1868
1891
|
});
|
|
1869
1892
|
}
|
|
@@ -527,6 +527,16 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
|
|
|
527
527
|
launchTs: 1709136669000,
|
|
528
528
|
oracleSource: OracleSource.PYTH,
|
|
529
529
|
},
|
|
530
|
+
{
|
|
531
|
+
fullName: 'Wormhole',
|
|
532
|
+
category: ['Bridge'],
|
|
533
|
+
symbol: 'W-PERP',
|
|
534
|
+
baseAssetSymbol: 'W',
|
|
535
|
+
marketIndex: 27,
|
|
536
|
+
oracle: new PublicKey('GU6CA7a2KCyhpfqZNb36UAfc9uzKBM8jHjGdt245QhYX'),
|
|
537
|
+
launchTs: 1710418343000,
|
|
538
|
+
oracleSource: OracleSource.Prelaunch,
|
|
539
|
+
},
|
|
530
540
|
];
|
|
531
541
|
|
|
532
542
|
export const PerpMarkets: { [key in DriftEnv]: PerpMarketConfig[] } = {
|
package/src/idl/drift.json
CHANGED
|
@@ -4993,6 +4993,11 @@
|
|
|
4993
4993
|
"isMut": true,
|
|
4994
4994
|
"isSigner": false
|
|
4995
4995
|
},
|
|
4996
|
+
{
|
|
4997
|
+
"name": "perpMarket",
|
|
4998
|
+
"isMut": true,
|
|
4999
|
+
"isSigner": false
|
|
5000
|
+
},
|
|
4996
5001
|
{
|
|
4997
5002
|
"name": "state",
|
|
4998
5003
|
"isMut": false,
|
|
@@ -5007,6 +5012,37 @@
|
|
|
5007
5012
|
}
|
|
5008
5013
|
}
|
|
5009
5014
|
]
|
|
5015
|
+
},
|
|
5016
|
+
{
|
|
5017
|
+
"name": "deletePrelaunchOracle",
|
|
5018
|
+
"accounts": [
|
|
5019
|
+
{
|
|
5020
|
+
"name": "admin",
|
|
5021
|
+
"isMut": true,
|
|
5022
|
+
"isSigner": true
|
|
5023
|
+
},
|
|
5024
|
+
{
|
|
5025
|
+
"name": "prelaunchOracle",
|
|
5026
|
+
"isMut": true,
|
|
5027
|
+
"isSigner": false
|
|
5028
|
+
},
|
|
5029
|
+
{
|
|
5030
|
+
"name": "perpMarket",
|
|
5031
|
+
"isMut": false,
|
|
5032
|
+
"isSigner": false
|
|
5033
|
+
},
|
|
5034
|
+
{
|
|
5035
|
+
"name": "state",
|
|
5036
|
+
"isMut": false,
|
|
5037
|
+
"isSigner": false
|
|
5038
|
+
}
|
|
5039
|
+
],
|
|
5040
|
+
"args": [
|
|
5041
|
+
{
|
|
5042
|
+
"name": "perpMarketIndex",
|
|
5043
|
+
"type": "u16"
|
|
5044
|
+
}
|
|
5045
|
+
]
|
|
5010
5046
|
}
|
|
5011
5047
|
],
|
|
5012
5048
|
"accounts": [
|