@drift-labs/sdk 2.97.0-beta.30 → 2.97.0-beta.31
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/user.js +1 -1
- package/lib/node/user.js +1 -1
- package/package.json +1 -1
- package/src/user.ts +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.97.0-beta.
|
|
1
|
+
2.97.0-beta.31
|
package/lib/browser/user.js
CHANGED
|
@@ -543,7 +543,7 @@ class User {
|
|
|
543
543
|
*/
|
|
544
544
|
getUnrealizedFundingPNL(marketIndex) {
|
|
545
545
|
return this.getUserAccount()
|
|
546
|
-
.perpPositions.filter((pos) => marketIndex ? pos.marketIndex === marketIndex : true)
|
|
546
|
+
.perpPositions.filter((pos) => marketIndex !== undefined ? pos.marketIndex === marketIndex : true)
|
|
547
547
|
.reduce((pnl, perpPosition) => {
|
|
548
548
|
const market = this.driftClient.getPerpMarketAccount(perpPosition.marketIndex);
|
|
549
549
|
return pnl.add((0, _1.calculatePositionFundingPNL)(market, perpPosition));
|
package/lib/node/user.js
CHANGED
|
@@ -543,7 +543,7 @@ class User {
|
|
|
543
543
|
*/
|
|
544
544
|
getUnrealizedFundingPNL(marketIndex) {
|
|
545
545
|
return this.getUserAccount()
|
|
546
|
-
.perpPositions.filter((pos) => marketIndex ? pos.marketIndex === marketIndex : true)
|
|
546
|
+
.perpPositions.filter((pos) => marketIndex !== undefined ? pos.marketIndex === marketIndex : true)
|
|
547
547
|
.reduce((pnl, perpPosition) => {
|
|
548
548
|
const market = this.driftClient.getPerpMarketAccount(perpPosition.marketIndex);
|
|
549
549
|
return pnl.add((0, _1.calculatePositionFundingPNL)(market, perpPosition));
|
package/package.json
CHANGED
package/src/user.ts
CHANGED
|
@@ -895,7 +895,7 @@ export class User {
|
|
|
895
895
|
public getUnrealizedFundingPNL(marketIndex?: number): BN {
|
|
896
896
|
return this.getUserAccount()
|
|
897
897
|
.perpPositions.filter((pos) =>
|
|
898
|
-
marketIndex ? pos.marketIndex === marketIndex : true
|
|
898
|
+
marketIndex !== undefined ? pos.marketIndex === marketIndex : true
|
|
899
899
|
)
|
|
900
900
|
.reduce((pnl, perpPosition) => {
|
|
901
901
|
const market = this.driftClient.getPerpMarketAccount(
|