From afec1c4f3bf598a49de879bf82a75e31527fbfd1 Mon Sep 17 00:00:00 2001 From: jaredvu Date: Thu, 16 May 2024 13:56:15 -0700 Subject: [PATCH] expose marketId --- build.gradle.kts | 2 +- .../exchange.dydx.abacus/calculator/AccountCalculator.kt | 1 + src/commonMain/kotlin/exchange.dydx.abacus/output/Account.kt | 4 ++++ v4_abacus.podspec | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d89f62ead..b5c9cfab5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,7 +51,7 @@ allprojects { } group = "exchange.dydx.abacus" -version = "1.7.19" +version = "1.7.20" repositories { google() diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/calculator/AccountCalculator.kt b/src/commonMain/kotlin/exchange.dydx.abacus/calculator/AccountCalculator.kt index 0d6d5401a..d9c128523 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/calculator/AccountCalculator.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/calculator/AccountCalculator.kt @@ -180,6 +180,7 @@ class AccountCalculator(val parser: ParserProtocol, private val useParentSubacco val modifiedPendingPosition = mutableMapOf() modifiedPendingPosition.safeSet("assetId", assetId) + modifiedPendingPosition.safeSet("marketId", marketId) modifiedPendingPosition.safeSet( "firstOrderId", parser.value(pending, "firstOrderId"), diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/output/Account.kt b/src/commonMain/kotlin/exchange.dydx.abacus/output/Account.kt index 4b2a450d7..b2b14c481 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/output/Account.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/output/Account.kt @@ -477,6 +477,7 @@ data class SubaccountPosition( @Serializable data class SubaccountPendingPosition( val assetId: String, + val marketId: String, val firstOrderId: String, val orderCount: Int, val freeCollateral: TradeStatesWithDoubleValues?, @@ -492,6 +493,7 @@ data class SubaccountPendingPosition( Logger.d { "creating Account Pending Position\n" } data?.let { val assetId = parser.asString(data["assetId"]) ?: return null + val marketId = parser.asString(data["marketId"]) ?: return null val firstOrderId = parser.asString(data["firstOrderId"]) ?: return null val orderCount = parser.asInt(data["orderCount"]) ?: return null val freeCollateral = TradeStatesWithDoubleValues.create( @@ -511,6 +513,7 @@ data class SubaccountPendingPosition( ) return if (existing?.assetId != assetId || + existing.marketId != marketId || existing.firstOrderId != firstOrderId || existing.orderCount != orderCount || existing.freeCollateral !== freeCollateral || @@ -519,6 +522,7 @@ data class SubaccountPendingPosition( ) { SubaccountPendingPosition( assetId, + marketId, firstOrderId, orderCount, freeCollateral, diff --git a/v4_abacus.podspec b/v4_abacus.podspec index 8a843c550..c0360d4e6 100644 --- a/v4_abacus.podspec +++ b/v4_abacus.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'v4_abacus' - spec.version = '1.7.19' + spec.version = '1.7.20' spec.homepage = 'https://github.com/dydxprotocol/v4-abacus' spec.source = { :http=> ''} spec.authors = ''