@drift-labs/sdk 2.99.0-beta.0 → 2.99.0-beta.1
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/driftClient.js +6 -3
- package/lib/node/driftClient.js +6 -3
- package/package.json +1 -1
- package/src/driftClient.ts +7 -3
- package/src/idl/drift.json +27 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.99.0-beta.
|
|
1
|
+
2.99.0-beta.1
|
|
@@ -3739,6 +3739,7 @@ class DriftClient {
|
|
|
3739
3739
|
writableSpotMarketIndexes: [marketIndex],
|
|
3740
3740
|
});
|
|
3741
3741
|
const spotMarket = this.getSpotMarketAccount(marketIndex);
|
|
3742
|
+
const tokenProgramId = this.getTokenProgramForSpotMarket(spotMarket);
|
|
3742
3743
|
this.addTokenMintToRemainingAccounts(spotMarket, remainingAccounts);
|
|
3743
3744
|
return await this.program.instruction.resolveSpotBankruptcy(marketIndex, {
|
|
3744
3745
|
accounts: {
|
|
@@ -3751,7 +3752,7 @@ class DriftClient {
|
|
|
3751
3752
|
spotMarketVault: spotMarket.vault,
|
|
3752
3753
|
insuranceFundVault: spotMarket.insuranceFund.vault,
|
|
3753
3754
|
driftSigner: this.getSignerPublicKey(),
|
|
3754
|
-
tokenProgram:
|
|
3755
|
+
tokenProgram: tokenProgramId,
|
|
3755
3756
|
},
|
|
3756
3757
|
remainingAccounts: remainingAccounts,
|
|
3757
3758
|
});
|
|
@@ -4071,6 +4072,7 @@ class DriftClient {
|
|
|
4071
4072
|
}
|
|
4072
4073
|
async getSettleRevenueToInsuranceFundIx(spotMarketIndex) {
|
|
4073
4074
|
const spotMarketAccount = this.getSpotMarketAccount(spotMarketIndex);
|
|
4075
|
+
const tokenProgramId = this.getTokenProgramForSpotMarket(spotMarketAccount);
|
|
4074
4076
|
const remainingAccounts = [];
|
|
4075
4077
|
this.addTokenMintToRemainingAccounts(spotMarketAccount, remainingAccounts);
|
|
4076
4078
|
const ix = await this.program.instruction.settleRevenueToInsuranceFund(spotMarketIndex, {
|
|
@@ -4080,7 +4082,7 @@ class DriftClient {
|
|
|
4080
4082
|
spotMarketVault: spotMarketAccount.vault,
|
|
4081
4083
|
driftSigner: this.getSignerPublicKey(),
|
|
4082
4084
|
insuranceFundVault: spotMarketAccount.insuranceFund.vault,
|
|
4083
|
-
tokenProgram:
|
|
4085
|
+
tokenProgram: tokenProgramId,
|
|
4084
4086
|
},
|
|
4085
4087
|
remainingAccounts,
|
|
4086
4088
|
});
|
|
@@ -4098,6 +4100,7 @@ class DriftClient {
|
|
|
4098
4100
|
writableSpotMarketIndexes: [spotMarketIndex],
|
|
4099
4101
|
});
|
|
4100
4102
|
const spotMarket = this.getSpotMarketAccount(spotMarketIndex);
|
|
4103
|
+
const tokenProgramId = this.getTokenProgramForSpotMarket(spotMarket);
|
|
4101
4104
|
return await this.program.instruction.resolvePerpPnlDeficit(spotMarketIndex, perpMarketIndex, {
|
|
4102
4105
|
accounts: {
|
|
4103
4106
|
state: await this.getStatePublicKey(),
|
|
@@ -4105,7 +4108,7 @@ class DriftClient {
|
|
|
4105
4108
|
spotMarketVault: spotMarket.vault,
|
|
4106
4109
|
insuranceFundVault: spotMarket.insuranceFund.vault,
|
|
4107
4110
|
driftSigner: this.getSignerPublicKey(),
|
|
4108
|
-
tokenProgram:
|
|
4111
|
+
tokenProgram: tokenProgramId,
|
|
4109
4112
|
},
|
|
4110
4113
|
remainingAccounts: remainingAccounts,
|
|
4111
4114
|
});
|
package/lib/node/driftClient.js
CHANGED
|
@@ -3739,6 +3739,7 @@ class DriftClient {
|
|
|
3739
3739
|
writableSpotMarketIndexes: [marketIndex],
|
|
3740
3740
|
});
|
|
3741
3741
|
const spotMarket = this.getSpotMarketAccount(marketIndex);
|
|
3742
|
+
const tokenProgramId = this.getTokenProgramForSpotMarket(spotMarket);
|
|
3742
3743
|
this.addTokenMintToRemainingAccounts(spotMarket, remainingAccounts);
|
|
3743
3744
|
return await this.program.instruction.resolveSpotBankruptcy(marketIndex, {
|
|
3744
3745
|
accounts: {
|
|
@@ -3751,7 +3752,7 @@ class DriftClient {
|
|
|
3751
3752
|
spotMarketVault: spotMarket.vault,
|
|
3752
3753
|
insuranceFundVault: spotMarket.insuranceFund.vault,
|
|
3753
3754
|
driftSigner: this.getSignerPublicKey(),
|
|
3754
|
-
tokenProgram:
|
|
3755
|
+
tokenProgram: tokenProgramId,
|
|
3755
3756
|
},
|
|
3756
3757
|
remainingAccounts: remainingAccounts,
|
|
3757
3758
|
});
|
|
@@ -4071,6 +4072,7 @@ class DriftClient {
|
|
|
4071
4072
|
}
|
|
4072
4073
|
async getSettleRevenueToInsuranceFundIx(spotMarketIndex) {
|
|
4073
4074
|
const spotMarketAccount = this.getSpotMarketAccount(spotMarketIndex);
|
|
4075
|
+
const tokenProgramId = this.getTokenProgramForSpotMarket(spotMarketAccount);
|
|
4074
4076
|
const remainingAccounts = [];
|
|
4075
4077
|
this.addTokenMintToRemainingAccounts(spotMarketAccount, remainingAccounts);
|
|
4076
4078
|
const ix = await this.program.instruction.settleRevenueToInsuranceFund(spotMarketIndex, {
|
|
@@ -4080,7 +4082,7 @@ class DriftClient {
|
|
|
4080
4082
|
spotMarketVault: spotMarketAccount.vault,
|
|
4081
4083
|
driftSigner: this.getSignerPublicKey(),
|
|
4082
4084
|
insuranceFundVault: spotMarketAccount.insuranceFund.vault,
|
|
4083
|
-
tokenProgram:
|
|
4085
|
+
tokenProgram: tokenProgramId,
|
|
4084
4086
|
},
|
|
4085
4087
|
remainingAccounts,
|
|
4086
4088
|
});
|
|
@@ -4098,6 +4100,7 @@ class DriftClient {
|
|
|
4098
4100
|
writableSpotMarketIndexes: [spotMarketIndex],
|
|
4099
4101
|
});
|
|
4100
4102
|
const spotMarket = this.getSpotMarketAccount(spotMarketIndex);
|
|
4103
|
+
const tokenProgramId = this.getTokenProgramForSpotMarket(spotMarket);
|
|
4101
4104
|
return await this.program.instruction.resolvePerpPnlDeficit(spotMarketIndex, perpMarketIndex, {
|
|
4102
4105
|
accounts: {
|
|
4103
4106
|
state: await this.getStatePublicKey(),
|
|
@@ -4105,7 +4108,7 @@ class DriftClient {
|
|
|
4105
4108
|
spotMarketVault: spotMarket.vault,
|
|
4106
4109
|
insuranceFundVault: spotMarket.insuranceFund.vault,
|
|
4107
4110
|
driftSigner: this.getSignerPublicKey(),
|
|
4108
|
-
tokenProgram:
|
|
4111
|
+
tokenProgram: tokenProgramId,
|
|
4109
4112
|
},
|
|
4110
4113
|
remainingAccounts: remainingAccounts,
|
|
4111
4114
|
});
|
package/package.json
CHANGED
package/src/driftClient.ts
CHANGED
|
@@ -7143,6 +7143,7 @@ export class DriftClient {
|
|
|
7143
7143
|
});
|
|
7144
7144
|
|
|
7145
7145
|
const spotMarket = this.getSpotMarketAccount(marketIndex);
|
|
7146
|
+
const tokenProgramId = this.getTokenProgramForSpotMarket(spotMarket);
|
|
7146
7147
|
|
|
7147
7148
|
this.addTokenMintToRemainingAccounts(spotMarket, remainingAccounts);
|
|
7148
7149
|
|
|
@@ -7157,7 +7158,7 @@ export class DriftClient {
|
|
|
7157
7158
|
spotMarketVault: spotMarket.vault,
|
|
7158
7159
|
insuranceFundVault: spotMarket.insuranceFund.vault,
|
|
7159
7160
|
driftSigner: this.getSignerPublicKey(),
|
|
7160
|
-
tokenProgram:
|
|
7161
|
+
tokenProgram: tokenProgramId,
|
|
7161
7162
|
},
|
|
7162
7163
|
remainingAccounts: remainingAccounts,
|
|
7163
7164
|
});
|
|
@@ -7791,6 +7792,8 @@ export class DriftClient {
|
|
|
7791
7792
|
spotMarketIndex: number
|
|
7792
7793
|
): Promise<TransactionInstruction> {
|
|
7793
7794
|
const spotMarketAccount = this.getSpotMarketAccount(spotMarketIndex);
|
|
7795
|
+
const tokenProgramId = this.getTokenProgramForSpotMarket(spotMarketAccount);
|
|
7796
|
+
|
|
7794
7797
|
const remainingAccounts = [];
|
|
7795
7798
|
this.addTokenMintToRemainingAccounts(spotMarketAccount, remainingAccounts);
|
|
7796
7799
|
const ix = await this.program.instruction.settleRevenueToInsuranceFund(
|
|
@@ -7802,7 +7805,7 @@ export class DriftClient {
|
|
|
7802
7805
|
spotMarketVault: spotMarketAccount.vault,
|
|
7803
7806
|
driftSigner: this.getSignerPublicKey(),
|
|
7804
7807
|
insuranceFundVault: spotMarketAccount.insuranceFund.vault,
|
|
7805
|
-
tokenProgram:
|
|
7808
|
+
tokenProgram: tokenProgramId,
|
|
7806
7809
|
},
|
|
7807
7810
|
remainingAccounts,
|
|
7808
7811
|
}
|
|
@@ -7838,6 +7841,7 @@ export class DriftClient {
|
|
|
7838
7841
|
});
|
|
7839
7842
|
|
|
7840
7843
|
const spotMarket = this.getSpotMarketAccount(spotMarketIndex);
|
|
7844
|
+
const tokenProgramId = this.getTokenProgramForSpotMarket(spotMarket);
|
|
7841
7845
|
|
|
7842
7846
|
return await this.program.instruction.resolvePerpPnlDeficit(
|
|
7843
7847
|
spotMarketIndex,
|
|
@@ -7849,7 +7853,7 @@ export class DriftClient {
|
|
|
7849
7853
|
spotMarketVault: spotMarket.vault,
|
|
7850
7854
|
insuranceFundVault: spotMarket.insuranceFund.vault,
|
|
7851
7855
|
driftSigner: this.getSignerPublicKey(),
|
|
7852
|
-
tokenProgram:
|
|
7856
|
+
tokenProgram: tokenProgramId,
|
|
7853
7857
|
},
|
|
7854
7858
|
remainingAccounts: remainingAccounts,
|
|
7855
7859
|
}
|
package/src/idl/drift.json
CHANGED
|
@@ -10692,7 +10692,10 @@
|
|
|
10692
10692
|
"name": "PlaceAndMake"
|
|
10693
10693
|
},
|
|
10694
10694
|
{
|
|
10695
|
-
"name": "PlaceAndTake"
|
|
10695
|
+
"name": "PlaceAndTake",
|
|
10696
|
+
"fields": [
|
|
10697
|
+
"bool"
|
|
10698
|
+
]
|
|
10696
10699
|
},
|
|
10697
10700
|
{
|
|
10698
10701
|
"name": "Liquidation"
|
|
@@ -10888,6 +10891,9 @@
|
|
|
10888
10891
|
},
|
|
10889
10892
|
{
|
|
10890
10893
|
"name": "Liquidation"
|
|
10894
|
+
},
|
|
10895
|
+
{
|
|
10896
|
+
"name": "AmmImmediateFill"
|
|
10891
10897
|
}
|
|
10892
10898
|
]
|
|
10893
10899
|
}
|
|
@@ -11030,6 +11036,23 @@
|
|
|
11030
11036
|
]
|
|
11031
11037
|
}
|
|
11032
11038
|
},
|
|
11039
|
+
{
|
|
11040
|
+
"name": "AMMAvailability",
|
|
11041
|
+
"type": {
|
|
11042
|
+
"kind": "enum",
|
|
11043
|
+
"variants": [
|
|
11044
|
+
{
|
|
11045
|
+
"name": "Immediate"
|
|
11046
|
+
},
|
|
11047
|
+
{
|
|
11048
|
+
"name": "AfterMinDuration"
|
|
11049
|
+
},
|
|
11050
|
+
{
|
|
11051
|
+
"name": "Unavailable"
|
|
11052
|
+
}
|
|
11053
|
+
]
|
|
11054
|
+
}
|
|
11055
|
+
},
|
|
11033
11056
|
{
|
|
11034
11057
|
"name": "SettlePnlMode",
|
|
11035
11058
|
"type": {
|
|
@@ -11120,6 +11143,9 @@
|
|
|
11120
11143
|
},
|
|
11121
11144
|
{
|
|
11122
11145
|
"name": "SettlePnlPaused"
|
|
11146
|
+
},
|
|
11147
|
+
{
|
|
11148
|
+
"name": "AmmImmediateFillPaused"
|
|
11123
11149
|
}
|
|
11124
11150
|
]
|
|
11125
11151
|
}
|