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

Add interface to refresh vault account balance #697

Merged
merged 2 commits into from
Oct 2, 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 @@ -52,7 +52,7 @@ allprojects {
}

group = "exchange.dydx.abacus"
version = "1.12.13"
version = "1.12.14"

repositories {
google()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ interface AsyncAbacusStateManagerProtocol {
fun getChainById(chainId: String): TransferChainInfo?

fun registerPushNotification(token: String, languageCode: String?)
fun refreshVaultAccount()
}

@JsExport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,4 +685,8 @@ class AsyncAbacusStateManagerV2(
pushNotificationLanguageCode = languageCode
adaptor?.registerPushNotification(token, languageCode)
}

override fun refreshVaultAccount() {
adaptor?.refreshVaultAccount()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,10 @@ internal class StateManagerAdaptorV2(
accounts.registerPushNotification(token, languageCode)
}

internal fun refreshVaultAccount() {
vault.refreshVaultAccount()
}

private fun updateRestriction(indexerRestriction: UsageRestriction?) {
restriction = indexerRestriction ?: accounts.addressRestriction ?: UsageRestriction.noRestriction
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ internal class VaultSupervisor(
}
}

fun refreshVaultAccount() {
if (accountAddress != null && validatorConnected) {
stopPollingValidatorData()
startPollingValidatorData(accountAddress)
}
}

override fun didSetIndexerConnected(indexerConnected: Boolean) {
super.didSetIndexerConnected(indexerConnected)

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.12.13'
spec.version = '1.12.14'
spec.homepage = 'https://github.com/dydxprotocol/v4-abacus'
spec.source = { :http=> ''}
spec.authors = ''
Expand Down