@drift-labs/sdk 2.99.0-beta.1 → 2.99.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/driftClient.d.ts +2 -0
- package/lib/browser/driftClient.js +14 -0
- package/lib/browser/idl/drift.json +48 -1
- package/lib/browser/types.d.ts +1 -1
- package/lib/node/driftClient.d.ts +2 -0
- package/lib/node/driftClient.js +14 -0
- package/lib/node/idl/drift.json +48 -1
- package/lib/node/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/driftClient.ts +32 -0
- package/src/idl/drift.json +21 -0
- package/src/types.ts +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.99.0-beta.
|
|
1
|
+
2.99.0-beta.2
|
|
@@ -499,6 +499,8 @@ export declare class DriftClient {
|
|
|
499
499
|
getUpdateUserIdleIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
|
|
500
500
|
updateUserFuelBonus(userAccountPublicKey: PublicKey, user: UserAccount, userAuthority: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
|
|
501
501
|
getUpdateUserFuelBonusIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, userAuthority: PublicKey): Promise<TransactionInstruction>;
|
|
502
|
+
updateUserStatsReferrerStatus(userAuthority: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
|
|
503
|
+
getUpdateUserStatsReferrerStatusIx(userAuthority: PublicKey): Promise<TransactionInstruction>;
|
|
502
504
|
updateUserStatsReferrerInfo(userStatsAccountPublicKey: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
|
|
503
505
|
getUpdateUserStatsReferrerInfoIx(userStatsAccountPublicKey: PublicKey): Promise<TransactionInstruction>;
|
|
504
506
|
updateUserOpenOrdersCount(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams, fillerPublicKey?: PublicKey): Promise<TransactionSignature>;
|
|
@@ -2797,6 +2797,20 @@ class DriftClient {
|
|
|
2797
2797
|
remainingAccounts,
|
|
2798
2798
|
});
|
|
2799
2799
|
}
|
|
2800
|
+
async updateUserStatsReferrerStatus(userAuthority, txParams) {
|
|
2801
|
+
const { txSig } = await this.sendTransaction(await this.buildTransaction(await this.getUpdateUserStatsReferrerStatusIx(userAuthority), txParams), [], this.opts);
|
|
2802
|
+
return txSig;
|
|
2803
|
+
}
|
|
2804
|
+
async getUpdateUserStatsReferrerStatusIx(userAuthority) {
|
|
2805
|
+
const userStatsAccountPublicKey = (0, pda_1.getUserStatsAccountPublicKey)(this.program.programId, userAuthority);
|
|
2806
|
+
return await this.program.instruction.updateStatsReferrerStatus({
|
|
2807
|
+
accounts: {
|
|
2808
|
+
state: await this.getStatePublicKey(),
|
|
2809
|
+
userStats: userStatsAccountPublicKey,
|
|
2810
|
+
authority: this.wallet.publicKey,
|
|
2811
|
+
},
|
|
2812
|
+
});
|
|
2813
|
+
}
|
|
2800
2814
|
async updateUserStatsReferrerInfo(userStatsAccountPublicKey, txParams) {
|
|
2801
2815
|
const { txSig } = await this.sendTransaction(await this.buildTransaction(await this.getUpdateUserStatsReferrerInfoIx(userStatsAccountPublicKey), txParams), [], this.opts);
|
|
2802
2816
|
return txSig;
|
|
@@ -1751,6 +1751,27 @@
|
|
|
1751
1751
|
],
|
|
1752
1752
|
"args": []
|
|
1753
1753
|
},
|
|
1754
|
+
{
|
|
1755
|
+
"name": "updateUserStatsReferrerStatus",
|
|
1756
|
+
"accounts": [
|
|
1757
|
+
{
|
|
1758
|
+
"name": "state",
|
|
1759
|
+
"isMut": false,
|
|
1760
|
+
"isSigner": false
|
|
1761
|
+
},
|
|
1762
|
+
{
|
|
1763
|
+
"name": "authority",
|
|
1764
|
+
"isMut": false,
|
|
1765
|
+
"isSigner": true
|
|
1766
|
+
},
|
|
1767
|
+
{
|
|
1768
|
+
"name": "userStats",
|
|
1769
|
+
"isMut": true,
|
|
1770
|
+
"isSigner": false
|
|
1771
|
+
}
|
|
1772
|
+
],
|
|
1773
|
+
"args": []
|
|
1774
|
+
},
|
|
1754
1775
|
{
|
|
1755
1776
|
"name": "updateUserOpenOrdersCount",
|
|
1756
1777
|
"accounts": [
|
|
@@ -10692,7 +10713,10 @@
|
|
|
10692
10713
|
"name": "PlaceAndMake"
|
|
10693
10714
|
},
|
|
10694
10715
|
{
|
|
10695
|
-
"name": "PlaceAndTake"
|
|
10716
|
+
"name": "PlaceAndTake",
|
|
10717
|
+
"fields": [
|
|
10718
|
+
"bool"
|
|
10719
|
+
]
|
|
10696
10720
|
},
|
|
10697
10721
|
{
|
|
10698
10722
|
"name": "Liquidation"
|
|
@@ -10888,6 +10912,9 @@
|
|
|
10888
10912
|
},
|
|
10889
10913
|
{
|
|
10890
10914
|
"name": "Liquidation"
|
|
10915
|
+
},
|
|
10916
|
+
{
|
|
10917
|
+
"name": "AmmImmediateFill"
|
|
10891
10918
|
}
|
|
10892
10919
|
]
|
|
10893
10920
|
}
|
|
@@ -11030,6 +11057,23 @@
|
|
|
11030
11057
|
]
|
|
11031
11058
|
}
|
|
11032
11059
|
},
|
|
11060
|
+
{
|
|
11061
|
+
"name": "AMMAvailability",
|
|
11062
|
+
"type": {
|
|
11063
|
+
"kind": "enum",
|
|
11064
|
+
"variants": [
|
|
11065
|
+
{
|
|
11066
|
+
"name": "Immediate"
|
|
11067
|
+
},
|
|
11068
|
+
{
|
|
11069
|
+
"name": "AfterMinDuration"
|
|
11070
|
+
},
|
|
11071
|
+
{
|
|
11072
|
+
"name": "Unavailable"
|
|
11073
|
+
}
|
|
11074
|
+
]
|
|
11075
|
+
}
|
|
11076
|
+
},
|
|
11033
11077
|
{
|
|
11034
11078
|
"name": "SettlePnlMode",
|
|
11035
11079
|
"type": {
|
|
@@ -11120,6 +11164,9 @@
|
|
|
11120
11164
|
},
|
|
11121
11165
|
{
|
|
11122
11166
|
"name": "SettlePnlPaused"
|
|
11167
|
+
},
|
|
11168
|
+
{
|
|
11169
|
+
"name": "AmmImmediateFillPaused"
|
|
11123
11170
|
}
|
|
11124
11171
|
]
|
|
11125
11172
|
}
|
package/lib/browser/types.d.ts
CHANGED
|
@@ -983,7 +983,7 @@ export type UserStatsAccount = {
|
|
|
983
983
|
current_epoch_referrer_reward: BN;
|
|
984
984
|
};
|
|
985
985
|
referrer: PublicKey;
|
|
986
|
-
referrerStatus:
|
|
986
|
+
referrerStatus: number;
|
|
987
987
|
authority: PublicKey;
|
|
988
988
|
ifStakedQuoteAssetAmount: BN;
|
|
989
989
|
lastFuelIfBonusUpdateTs: number;
|
|
@@ -499,6 +499,8 @@ export declare class DriftClient {
|
|
|
499
499
|
getUpdateUserIdleIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
|
|
500
500
|
updateUserFuelBonus(userAccountPublicKey: PublicKey, user: UserAccount, userAuthority: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
|
|
501
501
|
getUpdateUserFuelBonusIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, userAuthority: PublicKey): Promise<TransactionInstruction>;
|
|
502
|
+
updateUserStatsReferrerStatus(userAuthority: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
|
|
503
|
+
getUpdateUserStatsReferrerStatusIx(userAuthority: PublicKey): Promise<TransactionInstruction>;
|
|
502
504
|
updateUserStatsReferrerInfo(userStatsAccountPublicKey: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
|
|
503
505
|
getUpdateUserStatsReferrerInfoIx(userStatsAccountPublicKey: PublicKey): Promise<TransactionInstruction>;
|
|
504
506
|
updateUserOpenOrdersCount(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams, fillerPublicKey?: PublicKey): Promise<TransactionSignature>;
|
package/lib/node/driftClient.js
CHANGED
|
@@ -2797,6 +2797,20 @@ class DriftClient {
|
|
|
2797
2797
|
remainingAccounts,
|
|
2798
2798
|
});
|
|
2799
2799
|
}
|
|
2800
|
+
async updateUserStatsReferrerStatus(userAuthority, txParams) {
|
|
2801
|
+
const { txSig } = await this.sendTransaction(await this.buildTransaction(await this.getUpdateUserStatsReferrerStatusIx(userAuthority), txParams), [], this.opts);
|
|
2802
|
+
return txSig;
|
|
2803
|
+
}
|
|
2804
|
+
async getUpdateUserStatsReferrerStatusIx(userAuthority) {
|
|
2805
|
+
const userStatsAccountPublicKey = (0, pda_1.getUserStatsAccountPublicKey)(this.program.programId, userAuthority);
|
|
2806
|
+
return await this.program.instruction.updateStatsReferrerStatus({
|
|
2807
|
+
accounts: {
|
|
2808
|
+
state: await this.getStatePublicKey(),
|
|
2809
|
+
userStats: userStatsAccountPublicKey,
|
|
2810
|
+
authority: this.wallet.publicKey,
|
|
2811
|
+
},
|
|
2812
|
+
});
|
|
2813
|
+
}
|
|
2800
2814
|
async updateUserStatsReferrerInfo(userStatsAccountPublicKey, txParams) {
|
|
2801
2815
|
const { txSig } = await this.sendTransaction(await this.buildTransaction(await this.getUpdateUserStatsReferrerInfoIx(userStatsAccountPublicKey), txParams), [], this.opts);
|
|
2802
2816
|
return txSig;
|
package/lib/node/idl/drift.json
CHANGED
|
@@ -1751,6 +1751,27 @@
|
|
|
1751
1751
|
],
|
|
1752
1752
|
"args": []
|
|
1753
1753
|
},
|
|
1754
|
+
{
|
|
1755
|
+
"name": "updateUserStatsReferrerStatus",
|
|
1756
|
+
"accounts": [
|
|
1757
|
+
{
|
|
1758
|
+
"name": "state",
|
|
1759
|
+
"isMut": false,
|
|
1760
|
+
"isSigner": false
|
|
1761
|
+
},
|
|
1762
|
+
{
|
|
1763
|
+
"name": "authority",
|
|
1764
|
+
"isMut": false,
|
|
1765
|
+
"isSigner": true
|
|
1766
|
+
},
|
|
1767
|
+
{
|
|
1768
|
+
"name": "userStats",
|
|
1769
|
+
"isMut": true,
|
|
1770
|
+
"isSigner": false
|
|
1771
|
+
}
|
|
1772
|
+
],
|
|
1773
|
+
"args": []
|
|
1774
|
+
},
|
|
1754
1775
|
{
|
|
1755
1776
|
"name": "updateUserOpenOrdersCount",
|
|
1756
1777
|
"accounts": [
|
|
@@ -10692,7 +10713,10 @@
|
|
|
10692
10713
|
"name": "PlaceAndMake"
|
|
10693
10714
|
},
|
|
10694
10715
|
{
|
|
10695
|
-
"name": "PlaceAndTake"
|
|
10716
|
+
"name": "PlaceAndTake",
|
|
10717
|
+
"fields": [
|
|
10718
|
+
"bool"
|
|
10719
|
+
]
|
|
10696
10720
|
},
|
|
10697
10721
|
{
|
|
10698
10722
|
"name": "Liquidation"
|
|
@@ -10888,6 +10912,9 @@
|
|
|
10888
10912
|
},
|
|
10889
10913
|
{
|
|
10890
10914
|
"name": "Liquidation"
|
|
10915
|
+
},
|
|
10916
|
+
{
|
|
10917
|
+
"name": "AmmImmediateFill"
|
|
10891
10918
|
}
|
|
10892
10919
|
]
|
|
10893
10920
|
}
|
|
@@ -11030,6 +11057,23 @@
|
|
|
11030
11057
|
]
|
|
11031
11058
|
}
|
|
11032
11059
|
},
|
|
11060
|
+
{
|
|
11061
|
+
"name": "AMMAvailability",
|
|
11062
|
+
"type": {
|
|
11063
|
+
"kind": "enum",
|
|
11064
|
+
"variants": [
|
|
11065
|
+
{
|
|
11066
|
+
"name": "Immediate"
|
|
11067
|
+
},
|
|
11068
|
+
{
|
|
11069
|
+
"name": "AfterMinDuration"
|
|
11070
|
+
},
|
|
11071
|
+
{
|
|
11072
|
+
"name": "Unavailable"
|
|
11073
|
+
}
|
|
11074
|
+
]
|
|
11075
|
+
}
|
|
11076
|
+
},
|
|
11033
11077
|
{
|
|
11034
11078
|
"name": "SettlePnlMode",
|
|
11035
11079
|
"type": {
|
|
@@ -11120,6 +11164,9 @@
|
|
|
11120
11164
|
},
|
|
11121
11165
|
{
|
|
11122
11166
|
"name": "SettlePnlPaused"
|
|
11167
|
+
},
|
|
11168
|
+
{
|
|
11169
|
+
"name": "AmmImmediateFillPaused"
|
|
11123
11170
|
}
|
|
11124
11171
|
]
|
|
11125
11172
|
}
|
package/lib/node/types.d.ts
CHANGED
|
@@ -983,7 +983,7 @@ export type UserStatsAccount = {
|
|
|
983
983
|
current_epoch_referrer_reward: BN;
|
|
984
984
|
};
|
|
985
985
|
referrer: PublicKey;
|
|
986
|
-
referrerStatus:
|
|
986
|
+
referrerStatus: number;
|
|
987
987
|
authority: PublicKey;
|
|
988
988
|
ifStakedQuoteAssetAmount: BN;
|
|
989
989
|
lastFuelIfBonusUpdateTs: number;
|
package/package.json
CHANGED
package/src/driftClient.ts
CHANGED
|
@@ -5096,6 +5096,38 @@ export class DriftClient {
|
|
|
5096
5096
|
});
|
|
5097
5097
|
}
|
|
5098
5098
|
|
|
5099
|
+
public async updateUserStatsReferrerStatus(
|
|
5100
|
+
userAuthority: PublicKey,
|
|
5101
|
+
txParams?: TxParams
|
|
5102
|
+
): Promise<TransactionSignature> {
|
|
5103
|
+
const { txSig } = await this.sendTransaction(
|
|
5104
|
+
await this.buildTransaction(
|
|
5105
|
+
await this.getUpdateUserStatsReferrerStatusIx(userAuthority),
|
|
5106
|
+
txParams
|
|
5107
|
+
),
|
|
5108
|
+
[],
|
|
5109
|
+
this.opts
|
|
5110
|
+
);
|
|
5111
|
+
return txSig;
|
|
5112
|
+
}
|
|
5113
|
+
|
|
5114
|
+
public async getUpdateUserStatsReferrerStatusIx(
|
|
5115
|
+
userAuthority: PublicKey
|
|
5116
|
+
): Promise<TransactionInstruction> {
|
|
5117
|
+
const userStatsAccountPublicKey = getUserStatsAccountPublicKey(
|
|
5118
|
+
this.program.programId,
|
|
5119
|
+
userAuthority
|
|
5120
|
+
);
|
|
5121
|
+
|
|
5122
|
+
return await this.program.instruction.updateStatsReferrerStatus({
|
|
5123
|
+
accounts: {
|
|
5124
|
+
state: await this.getStatePublicKey(),
|
|
5125
|
+
userStats: userStatsAccountPublicKey,
|
|
5126
|
+
authority: this.wallet.publicKey,
|
|
5127
|
+
},
|
|
5128
|
+
});
|
|
5129
|
+
}
|
|
5130
|
+
|
|
5099
5131
|
public async updateUserStatsReferrerInfo(
|
|
5100
5132
|
userStatsAccountPublicKey: PublicKey,
|
|
5101
5133
|
txParams?: TxParams
|
package/src/idl/drift.json
CHANGED
|
@@ -1751,6 +1751,27 @@
|
|
|
1751
1751
|
],
|
|
1752
1752
|
"args": []
|
|
1753
1753
|
},
|
|
1754
|
+
{
|
|
1755
|
+
"name": "updateUserStatsReferrerStatus",
|
|
1756
|
+
"accounts": [
|
|
1757
|
+
{
|
|
1758
|
+
"name": "state",
|
|
1759
|
+
"isMut": false,
|
|
1760
|
+
"isSigner": false
|
|
1761
|
+
},
|
|
1762
|
+
{
|
|
1763
|
+
"name": "authority",
|
|
1764
|
+
"isMut": false,
|
|
1765
|
+
"isSigner": true
|
|
1766
|
+
},
|
|
1767
|
+
{
|
|
1768
|
+
"name": "userStats",
|
|
1769
|
+
"isMut": true,
|
|
1770
|
+
"isSigner": false
|
|
1771
|
+
}
|
|
1772
|
+
],
|
|
1773
|
+
"args": []
|
|
1774
|
+
},
|
|
1754
1775
|
{
|
|
1755
1776
|
"name": "updateUserOpenOrdersCount",
|
|
1756
1777
|
"accounts": [
|
package/src/types.ts
CHANGED