Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v.1.7.20: expose marketId in SubaccountPendingPosition #362

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ allprojects {
}

group = "exchange.dydx.abacus"
version = "1.7.19"
version = "1.7.20"

repositories {
google()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ class AccountCalculator(val parser: ParserProtocol, private val useParentSubacco

val modifiedPendingPosition = mutableMapOf<String, Any>()
modifiedPendingPosition.safeSet("assetId", assetId)
modifiedPendingPosition.safeSet("marketId", marketId)
modifiedPendingPosition.safeSet(
"firstOrderId",
parser.value(pending, "firstOrderId"),
Expand Down
4 changes: 4 additions & 0 deletions src/commonMain/kotlin/exchange.dydx.abacus/output/Account.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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?,
Expand All @@ -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(
Expand All @@ -511,6 +513,7 @@ data class SubaccountPendingPosition(
)

return if (existing?.assetId != assetId ||
existing.marketId != marketId ||
existing.firstOrderId != firstOrderId ||
existing.orderCount != orderCount ||
existing.freeCollateral !== freeCollateral ||
Expand All @@ -519,6 +522,7 @@ data class SubaccountPendingPosition(
) {
SubaccountPendingPosition(
assetId,
marketId,
firstOrderId,
orderCount,
freeCollateral,
Expand Down
2 changes: 1 addition & 1 deletion v4_abacus.podspec
Original file line number Diff line number Diff line change
@@ -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 = ''
Expand Down
Loading