@drift-labs/sdk 2.94.0-beta.4 → 2.94.0-beta.6
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/spotMarkets.js +1 -0
- package/lib/driftClient.js +4 -21
- package/package.json +1 -1
- package/src/constants/spotMarkets.ts +3 -0
- package/src/driftClient.ts +4 -23
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.94.0-beta.
|
|
1
|
+
2.94.0-beta.6
|
|
@@ -71,6 +71,7 @@ exports.MainnetSpotMarkets = [
|
|
|
71
71
|
precisionExp: numericConstants_1.LAMPORTS_EXP,
|
|
72
72
|
serumMarket: new web3_js_1.PublicKey('8BnEgHoWFysVcuFFX7QztDmzuH8r5ZFvyP3sYwn1XTh6'),
|
|
73
73
|
phoenixMarket: new web3_js_1.PublicKey('4DoNfFBfF7UokCC2FQzriy7yHK6DY6NVdYpuekQ5pRgg'),
|
|
74
|
+
openbookMarket: new web3_js_1.PublicKey('AFgkED1FUVfBe2trPUDqSqK9QKd4stJrfzq5q1RwAFTa'),
|
|
74
75
|
pythFeedId: '0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d',
|
|
75
76
|
},
|
|
76
77
|
{
|
package/lib/driftClient.js
CHANGED
|
@@ -1720,28 +1720,11 @@ class DriftClient {
|
|
|
1720
1720
|
return txSig;
|
|
1721
1721
|
}
|
|
1722
1722
|
async getSettleExpiredMarketIx(marketIndex) {
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
marketAccountInfos.push({
|
|
1728
|
-
pubkey: market.pubkey,
|
|
1729
|
-
isWritable: true,
|
|
1730
|
-
isSigner: false,
|
|
1731
|
-
});
|
|
1732
|
-
oracleAccountInfos.push({
|
|
1733
|
-
pubkey: market.amm.oracle,
|
|
1734
|
-
isWritable: false,
|
|
1735
|
-
isSigner: false,
|
|
1736
|
-
});
|
|
1737
|
-
spotMarketAccountInfos.push({
|
|
1738
|
-
pubkey: this.getSpotMarketAccount(numericConstants_1.QUOTE_SPOT_MARKET_INDEX).pubkey,
|
|
1739
|
-
isSigner: false,
|
|
1740
|
-
isWritable: true,
|
|
1723
|
+
const remainingAccounts = this.getRemainingAccounts({
|
|
1724
|
+
userAccounts: [],
|
|
1725
|
+
writablePerpMarketIndexes: [marketIndex],
|
|
1726
|
+
writableSpotMarketIndexes: [numericConstants_1.QUOTE_SPOT_MARKET_INDEX],
|
|
1741
1727
|
});
|
|
1742
|
-
const remainingAccounts = oracleAccountInfos
|
|
1743
|
-
.concat(spotMarketAccountInfos)
|
|
1744
|
-
.concat(marketAccountInfos);
|
|
1745
1728
|
return await this.program.instruction.settleExpiredMarket(marketIndex, {
|
|
1746
1729
|
accounts: {
|
|
1747
1730
|
state: await this.getStatePublicKey(),
|
package/package.json
CHANGED
|
@@ -105,6 +105,9 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
|
|
|
105
105
|
phoenixMarket: new PublicKey(
|
|
106
106
|
'4DoNfFBfF7UokCC2FQzriy7yHK6DY6NVdYpuekQ5pRgg'
|
|
107
107
|
),
|
|
108
|
+
openbookMarket: new PublicKey(
|
|
109
|
+
'AFgkED1FUVfBe2trPUDqSqK9QKd4stJrfzq5q1RwAFTa'
|
|
110
|
+
),
|
|
108
111
|
pythFeedId:
|
|
109
112
|
'0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d',
|
|
110
113
|
},
|
package/src/driftClient.ts
CHANGED
|
@@ -3216,31 +3216,12 @@ export class DriftClient {
|
|
|
3216
3216
|
public async getSettleExpiredMarketIx(
|
|
3217
3217
|
marketIndex: number
|
|
3218
3218
|
): Promise<TransactionInstruction> {
|
|
3219
|
-
const
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
marketAccountInfos.push({
|
|
3224
|
-
pubkey: market.pubkey,
|
|
3225
|
-
isWritable: true,
|
|
3226
|
-
isSigner: false,
|
|
3227
|
-
});
|
|
3228
|
-
oracleAccountInfos.push({
|
|
3229
|
-
pubkey: market.amm.oracle,
|
|
3230
|
-
isWritable: false,
|
|
3231
|
-
isSigner: false,
|
|
3232
|
-
});
|
|
3233
|
-
|
|
3234
|
-
spotMarketAccountInfos.push({
|
|
3235
|
-
pubkey: this.getSpotMarketAccount(QUOTE_SPOT_MARKET_INDEX).pubkey,
|
|
3236
|
-
isSigner: false,
|
|
3237
|
-
isWritable: true,
|
|
3219
|
+
const remainingAccounts = this.getRemainingAccounts({
|
|
3220
|
+
userAccounts: [],
|
|
3221
|
+
writablePerpMarketIndexes: [marketIndex],
|
|
3222
|
+
writableSpotMarketIndexes: [QUOTE_SPOT_MARKET_INDEX],
|
|
3238
3223
|
});
|
|
3239
3224
|
|
|
3240
|
-
const remainingAccounts = oracleAccountInfos
|
|
3241
|
-
.concat(spotMarketAccountInfos)
|
|
3242
|
-
.concat(marketAccountInfos);
|
|
3243
|
-
|
|
3244
3225
|
return await this.program.instruction.settleExpiredMarket(marketIndex, {
|
|
3245
3226
|
accounts: {
|
|
3246
3227
|
state: await this.getStatePublicKey(),
|