From 35f53bc6efb2c86850a1d71e4e12b90755ebc9bb Mon Sep 17 00:00:00 2001 From: Jeremy Lee <37092291+yogurtandjam@users.noreply.github.com> Date: Fri, 31 May 2024 11:19:46 -0400 Subject: [PATCH 1/6] feat: cosmos wallet connected (#404) --- build.gradle.kts | 2 +- .../state/manager/AsyncAbacusStateManager.kt | 9 +++++++++ .../state/manager/AsyncAbacusStateManagerProtocol.kt | 1 + .../state/manager/StateManagerAdaptor.kt | 2 ++ .../state/manager/V4StateManagerAdaptor.kt | 3 +++ .../state/v2/manager/AsyncAbacusStateManagerV2.kt | 9 +++++++++ .../state/v2/manager/StateManagerAdaptorV2.kt | 9 +++++++++ .../state/v2/supervisor/AccountSupervisor.kt | 2 ++ .../state/v2/supervisor/AccountsSupervisor.kt | 8 ++++++++ v4_abacus.podspec | 2 +- 10 files changed, 45 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c925cb25a..4533ddfbc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,7 +51,7 @@ allprojects { } group = "exchange.dydx.abacus" -version = "1.7.44" +version = "1.7.45" repositories { google() diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/AsyncAbacusStateManager.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/AsyncAbacusStateManager.kt index 10153a944..cb74c55be 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/AsyncAbacusStateManager.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/AsyncAbacusStateManager.kt @@ -114,6 +114,7 @@ class AsyncAbacusStateManager( value?.historicalPnlPeriod = historicalPnlPeriod value?.candlesResolution = candlesResolution value?.readyToConnect = readyToConnect + value?.cosmosWalletConnected = cosmosWalletConnected field = value } } @@ -144,6 +145,14 @@ class AsyncAbacusStateManager( } } + override var cosmosWalletConnected: Boolean? = false + set(value) { + field = value + ioImplementations.threading?.async(ThreadingType.abacus) { + adaptor?.cosmosWalletConnected = field + } + } + override var sourceAddress: String? = null set(value) { field = value diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/AsyncAbacusStateManagerProtocol.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/AsyncAbacusStateManagerProtocol.kt index 75b656adc..433f8fa12 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/AsyncAbacusStateManagerProtocol.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/AsyncAbacusStateManagerProtocol.kt @@ -96,6 +96,7 @@ interface AsyncAbacusStateManagerSingletonProtocol { var sourceAddress: String? var subaccountNumber: Int var market: String? + var cosmosWalletConnected: Boolean? } @JsExport diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt index 3b13608fb..bf177df31 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt @@ -195,6 +195,8 @@ open class StateManagerAdaptor( } } + var cosmosWalletConnected: Boolean? = false + private var accountAddressTimer: LocalTimerProtocol? = null set(value) { if (field !== value) { diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt index 9841162fe..0920ceaeb 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt @@ -477,6 +477,9 @@ class V4StateManagerAdaptor( } private fun pollNobleBalance() { + if (cosmosWalletConnected == true) { + return + } val timer = ioImplementations.timer ?: CoroutineTimer.instance nobleBalancesTimer = timer.schedule(0.0, nobleBalancePollingDuration) { if (validatorConnected && accountAddress != null) { diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/manager/AsyncAbacusStateManagerV2.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/manager/AsyncAbacusStateManagerV2.kt index 3c7f26d7e..c2c6087f6 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/manager/AsyncAbacusStateManagerV2.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/manager/AsyncAbacusStateManagerV2.kt @@ -136,6 +136,7 @@ class AsyncAbacusStateManagerV2( value?.historicalPnlPeriod = historicalPnlPeriod value?.candlesResolution = candlesResolution value?.readyToConnect = readyToConnect + value?.cosmosWalletConnected = cosmosWalletConnected field = value } } @@ -182,6 +183,14 @@ class AsyncAbacusStateManagerV2( } } + override var cosmosWalletConnected: Boolean? = false + set(value) { + field = value + ioImplementations.threading?.async(ThreadingType.abacus) { + adaptor?.cosmosWalletConnected = field + } + } + override var sourceAddress: String? = null set(value) { field = value diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/manager/StateManagerAdaptorV2.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/manager/StateManagerAdaptorV2.kt index dd01e261e..1cbb0483b 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/manager/StateManagerAdaptorV2.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/manager/StateManagerAdaptorV2.kt @@ -64,6 +64,7 @@ import exchange.dydx.abacus.state.v2.supervisor.commitClosePosition import exchange.dydx.abacus.state.v2.supervisor.commitPlaceOrder import exchange.dydx.abacus.state.v2.supervisor.commitTriggerOrders import exchange.dydx.abacus.state.v2.supervisor.connectedSubaccountNumber +import exchange.dydx.abacus.state.v2.supervisor.cosmosWalletConnected import exchange.dydx.abacus.state.v2.supervisor.depositPayload import exchange.dydx.abacus.state.v2.supervisor.faucet import exchange.dydx.abacus.state.v2.supervisor.marketId @@ -259,6 +260,14 @@ internal class StateManagerAdaptorV2( accounts.accountAddress = value } + internal var cosmosWalletConnected: Boolean? + get() { + return accounts.cosmosWalletConnected + } + set(value) { + accounts.cosmosWalletConnected = value + } + internal var sourceAddress: String? get() { return accounts.sourceAddress diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/AccountSupervisor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/AccountSupervisor.kt index 76041ee67..42468d7f1 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/AccountSupervisor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/AccountSupervisor.kt @@ -113,6 +113,8 @@ internal open class AccountSupervisor( } } + var cosmosWalletConnected: Boolean? = false + private var sourceAddressRestriction: Restriction? = null set(value) { if (field != value) { diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/AccountsSupervisor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/AccountsSupervisor.kt index 0f6244a18..7d94d9ab7 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/AccountsSupervisor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/AccountsSupervisor.kt @@ -208,6 +208,14 @@ internal var AccountsSupervisor.accountAddress: String? } } +internal var AccountsSupervisor.cosmosWalletConnected: Boolean? + get() { + return account?.cosmosWalletConnected + } + set(value) { + account?.cosmosWalletConnected = value + } + internal var AccountsSupervisor.sourceAddress: String? get() { return account?.sourceAddress diff --git a/v4_abacus.podspec b/v4_abacus.podspec index 2f4d0aeb1..7d5b3968f 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.43' + spec.version = '1.7.45' spec.homepage = 'https://github.com/dydxprotocol/v4-abacus' spec.source = { :http=> ''} spec.authors = '' From e6073d883a2ce7378eca01e4121a92be2595f586 Mon Sep 17 00:00:00 2001 From: John Huang Date: Fri, 31 May 2024 11:40:11 -0700 Subject: [PATCH 2/6] TRA-329 Added position leverage and position margin to receipt lines (#403) Co-authored-by: mobile-build-bot-git Co-authored-by: Rui <102453770+ruixhuang@users.noreply.github.com> Co-authored-by: Jared Vu --- .../state/model/TradingStateMachine.kt | 48 ++++++++++++++----- .../payload/v4/V4ParentSubaccountTests.kt | 17 ++++++- 2 files changed, 50 insertions(+), 15 deletions(-) diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine.kt index 25c710599..c08d384fa 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine.kt @@ -912,24 +912,46 @@ open class TradingStateMachine( "trade" -> { val trade = parser.asNativeMap(input["trade"]) ?: return null val type = parser.asString(trade["type"]) ?: return null + val isolatedMargin = parser.asString(trade["marginMode"]) == "ISOLATED" return when (type) { "MARKET", "STOP_MARKET", "TAKE_PROFIT_MARKET", "TRAILING_STOP" -> { - listOf( - ReceiptLine.BuyingPower.rawValue, - ReceiptLine.MarginUsage.rawValue, - ReceiptLine.ExpectedPrice.rawValue, - ReceiptLine.Fee.rawValue, - ReceiptLine.Reward.rawValue, - ) + if (isolatedMargin) { + listOf( + ReceiptLine.ExpectedPrice.rawValue, + ReceiptLine.LiquidationPrice.rawValue, + ReceiptLine.PositionMargin.rawValue, + ReceiptLine.PositionLeverage.rawValue, + ReceiptLine.Fee.rawValue, + ReceiptLine.Reward.rawValue, + ) + } else { + listOf( + ReceiptLine.BuyingPower.rawValue, + ReceiptLine.MarginUsage.rawValue, + ReceiptLine.ExpectedPrice.rawValue, + ReceiptLine.Fee.rawValue, + ReceiptLine.Reward.rawValue, + ) + } } else -> { - listOf( - ReceiptLine.BuyingPower.rawValue, - ReceiptLine.MarginUsage.rawValue, - ReceiptLine.Fee.rawValue, - ReceiptLine.Reward.rawValue, - ) + if (isolatedMargin) { + listOf( + ReceiptLine.LiquidationPrice.rawValue, + ReceiptLine.PositionMargin.rawValue, + ReceiptLine.PositionLeverage.rawValue, + ReceiptLine.Fee.rawValue, + ReceiptLine.Reward.rawValue, + ) + } else { + listOf( + ReceiptLine.BuyingPower.rawValue, + ReceiptLine.MarginUsage.rawValue, + ReceiptLine.Fee.rawValue, + ReceiptLine.Reward.rawValue, + ) + } } } } diff --git a/src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4ParentSubaccountTests.kt b/src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4ParentSubaccountTests.kt index 05ae61fe7..0f29a6531 100644 --- a/src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4ParentSubaccountTests.kt +++ b/src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4ParentSubaccountTests.kt @@ -284,7 +284,14 @@ class V4ParentSubaccountTests : V4BaseTests(true) { "options": { "needsMarginMode": false } - } + }, + "receiptLines": [ + "LIQUIDATION_PRICE", + "POSITION_MARGIN", + "POSITION_LEVERAGE", + "FEE", + "REWARD" + ] } } """.trimIndent(), @@ -303,7 +310,13 @@ class V4ParentSubaccountTests : V4BaseTests(true) { "options": { "needsMarginMode": false } - } + }, + "receiptLines": [ + "BUYING_POWER", + "MARGIN_USAGE", + "FEE", + "REWARD" + ] } } """.trimIndent(), From 3b249598cdad0b17d568352ca123fc531ed48545 Mon Sep 17 00:00:00 2001 From: Rui <102453770+ruixhuang@users.noreply.github.com> Date: Fri, 31 May 2024 11:41:03 -0700 Subject: [PATCH 3/6] Delete .github/workflows/bump_version.yml --- .github/workflows/bump_version.yml | 55 ------------------------------ 1 file changed, 55 deletions(-) delete mode 100644 .github/workflows/bump_version.yml diff --git a/.github/workflows/bump_version.yml b/.github/workflows/bump_version.yml deleted file mode 100644 index 05c9afce0..000000000 --- a/.github/workflows/bump_version.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Bump version on PR -on: - pull_request_target: - types: [opened, synchronize, reopened] - -permissions: - contents: write - -jobs: - update_version: - runs-on: macos-latest - steps: - - name: checkout - uses: actions/checkout@v4 - with: - # Fetch full depth, otherwise the last step overwrites the last commit's parent, essentially removing the graph. - fetch-depth: 0 - token: ${{ secrets.BOT_PAT }} - ref: ${{ github.head_ref }} - - - name: Run bump_version_gh_action.sh - id: bump-version - run: | - set +e - ./bump_version_gh_action.sh - echo "bump_version_ret=$?" >> $GITHUB_OUTPUT - env: - GITHUB_TOKEN: ${{ secrets.BOT_PAT }} - - - name: Import bot's GPG key for signing commits - id: import-gpg - uses: crazy-max/ghaction-import-gpg@v6 - with: - gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.BOT_GPG_PASSPHRASE }} - #git_config_global: true - git_user_signingkey: true - git_commit_gpgsign: true - - - name: Sign commit and push changes - run: | - if [[ "${{ steps.bump-version.outputs.bump_version_ret }}" == "0" ]]; then - git config --global user.email ${{ steps.import-gpg.outputs.name }} - git config --global user.name ${{ steps.import-gpg.outputs.email }} - - git commit -S -m "Bump version" build.gradle.kts - git push - fi - env: - # GITHUB_TOKEN: ${{ secrets.BOT_PAT }} - GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }} - GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }} - GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }} - GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }} - From 0d112a9ea02006f56ee445a9d07cd644b00e2e8d Mon Sep 17 00:00:00 2001 From: Rui <102453770+ruixhuang@users.noreply.github.com> Date: Fri, 31 May 2024 14:19:20 -0700 Subject: [PATCH 4/6] Move the file read/write to IO thread (#406) --- build.gradle.kts | 2 +- .../iOS/Pods/Pods.xcodeproj/project.pbxproj | 220 ++++++++++-------- ...os-frameworks-Debug-input-files.xcfilelist | 3 +- ...s-frameworks-Debug-output-files.xcfilelist | 3 +- ...-frameworks-Release-input-files.xcfilelist | 3 +- ...frameworks-Release-output-files.xcfilelist | 3 +- .../Pods-abacus.ios-frameworks.sh | 2 + .../Pods-abacus.ios.debug.xcconfig | 4 +- .../Pods-abacus.ios.release.xcconfig | 4 +- .../Pods-abacus.iosTests.debug.xcconfig | 4 +- .../Pods-abacus.iosTests.release.xcconfig | 4 +- .../abacus/abacus.debug.xcconfig | 1 + .../abacus/abacus.release.xcconfig | 1 + .../state/manager/AsyncAbacusStateManager.kt | 52 +++-- .../v2/manager/AsyncAbacusStateManagerV2.kt | 52 +++-- v4_abacus.podspec | 4 +- 16 files changed, 214 insertions(+), 148 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4533ddfbc..8b9421124 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,7 +51,7 @@ allprojects { } group = "exchange.dydx.abacus" -version = "1.7.45" +version = "1.7.46" repositories { google() diff --git a/integration/iOS/Pods/Pods.xcodeproj/project.pbxproj b/integration/iOS/Pods/Pods.xcodeproj/project.pbxproj index 38cf39861..9da55c9ba 100644 --- a/integration/iOS/Pods/Pods.xcodeproj/project.pbxproj +++ b/integration/iOS/Pods/Pods.xcodeproj/project.pbxproj @@ -9,9 +9,10 @@ /* Begin PBXAggregateTarget section */ 4084846DAF1774840D25DF1BF2460325 /* abacus */ = { isa = PBXAggregateTarget; - buildConfigurationList = B36D4FC54F44832C64D6BFCFC7EF4665 /* Build configuration list for PBXAggregateTarget "abacus" */; + buildConfigurationList = 127F9C06E33E9DC2AB3876F089264EB1 /* Build configuration list for PBXAggregateTarget "abacus" */; buildPhases = ( - 1403E0AEBF8A2087DF8CACA188B609E8 /* [CP-User] Build abacus */, + DB36ACE8A857E9B93C25EA309FF42C2A /* [CP-User] Build abacus */, + 903ECA29140368245E4B69BE2D0DBCA4 /* [CP] Copy dSYMs */, ); dependencies = ( ); @@ -142,26 +143,26 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 3E4D9EBB8F897D7BD1BB900F1CB03EFD /* PBXContainerItemProxy */ = { + 174DE097054DE7A0410C57AF4AEF5A1A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; remoteGlobalIDString = 469F25E790D19440507BF938A40578A7; remoteInfo = "Pods-abacus.ios"; }; - A9316E3AFEDA79C6BE2E70454904E23B /* PBXContainerItemProxy */ = { + 8437FCB39ECA4A44D93FCDCBF6066E92 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; - remoteGlobalIDString = 4084846DAF1774840D25DF1BF2460325; - remoteInfo = abacus; + remoteGlobalIDString = 99313990C1D76A6D1D017868B6975CC8; + remoteInfo = CryptoSwift; }; - D943F129042E36333E484FD2DF373D43 /* PBXContainerItemProxy */ = { + F8007D80E43B99904B0E4DD383211363 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; - remoteGlobalIDString = 99313990C1D76A6D1D017868B6975CC8; - remoteInfo = CryptoSwift; + remoteGlobalIDString = 4084846DAF1774840D25DF1BF2460325; + remoteInfo = abacus; }; /* End PBXContainerItemProxy section */ @@ -170,10 +171,10 @@ 0105D9F1362588440BA8D3158A228340 /* BlockMode.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BlockMode.swift; path = Sources/CryptoSwift/BlockMode/BlockMode.swift; sourceTree = ""; }; 01C66D92921215B5058ADA6FA1523E18 /* SHA2.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SHA2.swift; path = Sources/CryptoSwift/SHA2.swift; sourceTree = ""; }; 0449BE88D4D44409CCF0A74B34343D27 /* StreamDecryptor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = StreamDecryptor.swift; path = Sources/CryptoSwift/StreamDecryptor.swift; sourceTree = ""; }; - 059E5579F867BEB3F7E6DF13DEB1712B /* abacus.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = abacus.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 05F962230C27EB8320B3F9DACAB26666 /* Random.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Random.swift; path = Sources/CryptoSwift/CS_BigInt/Random.swift; sourceTree = ""; }; 068F760AEB5D19F06497CBD5A01D4B17 /* PBKDF1.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PBKDF1.swift; path = Sources/CryptoSwift/PKCS/PBKDF1.swift; sourceTree = ""; }; 0744F3E2DBB3A6893AC7B625FCBA2151 /* Generics.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Generics.swift; path = Sources/CryptoSwift/Generics.swift; sourceTree = ""; }; + 087E84600314FECE345137BBED3ABF4A /* abacus.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = abacus.debug.xcconfig; sourceTree = ""; }; 0A52523A80E0465BAEC42025DAD553B2 /* Pods-abacus.iosTests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-abacus.iosTests-Info.plist"; sourceTree = ""; }; 0D4EF333478AFFA4893B29F877CE2E3B /* Pods-abacus.iosTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-abacus.iosTests.modulemap"; sourceTree = ""; }; 0ECEA0D8830DCE37C7297C5F1342B08E /* Pods-abacus.ios.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-abacus.ios.release.xcconfig"; sourceTree = ""; }; @@ -184,6 +185,7 @@ 15A46B32EBC892483620A52F24AFC350 /* ECB.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ECB.swift; path = Sources/CryptoSwift/BlockMode/ECB.swift; sourceTree = ""; }; 161A656240E3B4B64ECE6858B65DC977 /* Pods-abacus.ios-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-abacus.ios-dummy.m"; sourceTree = ""; }; 186DE576AF9B0EC2149708CD77D2BC1F /* Shifts.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Shifts.swift; path = Sources/CryptoSwift/CS_BigInt/Shifts.swift; sourceTree = ""; }; + 194377B2DFD1180A2D72988CCD50F152 /* Abacus.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Abacus.framework; path = build/cocoapods/framework/Abacus.framework; sourceTree = ""; }; 1B6D2B0A7ACC4ACD9BC9FA5D52199C08 /* Cipher.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Cipher.swift; path = Sources/CryptoSwift/Cipher.swift; sourceTree = ""; }; 1C5732A96CD4AA2A534F0887522F1C39 /* CryptoSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = CryptoSwift.debug.xcconfig; sourceTree = ""; }; 1CF2318F38D1207A2F8BF92B7B8A294E /* Array+Extension.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Array+Extension.swift"; path = "Sources/CryptoSwift/Array+Extension.swift"; sourceTree = ""; }; @@ -195,7 +197,6 @@ 289CF4084C8BCFCA379CCF7847F8D1F8 /* Blowfish.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Blowfish.swift; path = Sources/CryptoSwift/Blowfish.swift; sourceTree = ""; }; 295A5EFDE6FBDDF94AEC568618EF25FE /* Hashable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Hashable.swift; path = Sources/CryptoSwift/CS_BigInt/Hashable.swift; sourceTree = ""; }; 2A89356D96E998228A503AA1A6E9C626 /* Int+Extension.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Int+Extension.swift"; path = "Sources/CryptoSwift/Int+Extension.swift"; sourceTree = ""; }; - 2B743EE4A0C2A395311B213324EB2342 /* abacus.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = abacus.release.xcconfig; sourceTree = ""; }; 311456A9BE6AD331F084E1FCE9FD2109 /* BigUInt.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BigUInt.swift; path = Sources/CryptoSwift/CS_BigInt/BigUInt.swift; sourceTree = ""; }; 322DD78557BFE4B398A18CBAA3C8A353 /* BlockEncryptor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BlockEncryptor.swift; path = Sources/CryptoSwift/BlockEncryptor.swift; sourceTree = ""; }; 33400747830CD0D31E461E6DE1F4500B /* String Conversion.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "String Conversion.swift"; path = "Sources/CryptoSwift/CS_BigInt/String Conversion.swift"; sourceTree = ""; }; @@ -207,16 +208,19 @@ 3E0AAD4392F812C1C216CCFB8F6C83F1 /* HMAC.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HMAC.swift; path = Sources/CryptoSwift/HMAC.swift; sourceTree = ""; }; 3EA11A675218D8EC495F817C58CD7850 /* RSA+Cipher.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "RSA+Cipher.swift"; path = "Sources/CryptoSwift/RSA/RSA+Cipher.swift"; sourceTree = ""; }; 4020CF7A5E8D043073442B14C262B52D /* CBCMAC.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CBCMAC.swift; path = Sources/CryptoSwift/CBCMAC.swift; sourceTree = ""; }; + 41730F22ADD1AE7FC7AB8FCAD4AB2CDA /* abacus.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = abacus.release.xcconfig; sourceTree = ""; }; 4557C8EB08F67FA9FE5EF603C935E183 /* Cryptor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Cryptor.swift; path = Sources/CryptoSwift/Cryptor.swift; sourceTree = ""; }; 466CB280E8CD811A98491B57B02D1B46 /* AES+Foundation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "AES+Foundation.swift"; path = "Sources/CryptoSwift/Foundation/AES+Foundation.swift"; sourceTree = ""; }; 47CAE619028B011ED98D7F74CF7215A1 /* Operators.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Operators.swift; path = Sources/CryptoSwift/Operators.swift; sourceTree = ""; }; 4B4AEBC4519953BDD492A3C4EB5E17A9 /* PKCS5.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PKCS5.swift; path = Sources/CryptoSwift/PKCS/PKCS5.swift; sourceTree = ""; }; 4FDF19080B2A0EC139694E150432A773 /* CFB.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CFB.swift; path = Sources/CryptoSwift/BlockMode/CFB.swift; sourceTree = ""; }; + 5087F83FBB81F03CA21A553057E81A9F /* abacus-copy-dsyms.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "abacus-copy-dsyms.sh"; sourceTree = ""; }; 54D5FEEA2249C6778EA73EC5F3C75044 /* ASN1Decoder.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ASN1Decoder.swift; path = Sources/CryptoSwift/ASN1/ASN1Decoder.swift; sourceTree = ""; }; 56CB7109CA84F00DCEB117080E3A0A6F /* Addition.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Addition.swift; path = Sources/CryptoSwift/CS_BigInt/Addition.swift; sourceTree = ""; }; 572CD7D8182D2BDB04D9B0AAB41FAAA2 /* Square Root.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Square Root.swift"; path = "Sources/CryptoSwift/CS_BigInt/Square Root.swift"; sourceTree = ""; }; 5825EF8E1C9D92AFC155A41AB00E7CDE /* CryptoSwift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "CryptoSwift-umbrella.h"; sourceTree = ""; }; 58D9EEC98E8673B039471D0E403B05CD /* PCBC.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PCBC.swift; path = Sources/CryptoSwift/BlockMode/PCBC.swift; sourceTree = ""; }; + 5ABBFD1A2A08C44870270007AE1EB5D4 /* abacus.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = abacus.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 5B30BDDC9AD9C2380BF6791299AE1FBE /* Subtraction.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Subtraction.swift; path = Sources/CryptoSwift/CS_BigInt/Subtraction.swift; sourceTree = ""; }; 5E828917FF2AA3CC6B23ECF8A598B684 /* CryptoSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = CryptoSwift.release.xcconfig; sourceTree = ""; }; 61300E9B71B8A176D5EAA3B605958848 /* AES.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AES.swift; path = Sources/CryptoSwift/AES.swift; sourceTree = ""; }; @@ -278,7 +282,6 @@ C74C33FAEC44BEBA526C5472D5CAFD19 /* GCD.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = GCD.swift; path = Sources/CryptoSwift/CS_BigInt/GCD.swift; sourceTree = ""; }; CAF7CB4BE35649AA1E76DE2396A37E0E /* Pods-abacus.ios-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-abacus.ios-acknowledgements.plist"; sourceTree = ""; }; CE3722C155F5908792FD682A1D84EC9C /* CryptoSwift-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "CryptoSwift-Info.plist"; sourceTree = ""; }; - CF5938B823263BBF080C9B21A3470789 /* abacus.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = abacus.debug.xcconfig; sourceTree = ""; }; CF791D3ED0FED5736405B0F135A4B7DA /* Signature.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Signature.swift; path = Sources/CryptoSwift/Signature.swift; sourceTree = ""; }; D0DF4F835FF3BD92DE8F28EF66D11155 /* Pods-abacus.ios-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-abacus.ios-frameworks.sh"; sourceTree = ""; }; D16CC219F5813A4740742BFCB5F17BB3 /* PKCS1v15.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PKCS1v15.swift; path = Sources/CryptoSwift/PKCS/PKCS1v15.swift; sourceTree = ""; }; @@ -338,30 +341,23 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 2D0B0EF6EDF07ED1C20291E5736D2CD7 /* Development Pods */ = { + 208518205B4C2F51FC3700B9883D08D7 /* Support Files */ = { isa = PBXGroup; children = ( - 62AAA19B1072508BA39B574A06434036 /* abacus */, + 5087F83FBB81F03CA21A553057E81A9F /* abacus-copy-dsyms.sh */, + 087E84600314FECE345137BBED3ABF4A /* abacus.debug.xcconfig */, + 41730F22ADD1AE7FC7AB8FCAD4AB2CDA /* abacus.release.xcconfig */, ); - name = "Development Pods"; - sourceTree = ""; - }; - 34798EDB6F1011D15814A373E88BB56F /* Pod */ = { - isa = PBXGroup; - children = ( - 059E5579F867BEB3F7E6DF13DEB1712B /* abacus.podspec */, - ); - name = Pod; + name = "Support Files"; + path = "integration/iOS/Pods/Target Support Files/abacus"; sourceTree = ""; }; - 471C85CB948067129D79803FD50B3454 /* Support Files */ = { + 33D1C287C8CC4BF36926F2A16F33E291 /* Frameworks */ = { isa = PBXGroup; children = ( - CF5938B823263BBF080C9B21A3470789 /* abacus.debug.xcconfig */, - 2B743EE4A0C2A395311B213324EB2342 /* abacus.release.xcconfig */, + 194377B2DFD1180A2D72988CCD50F152 /* Abacus.framework */, ); - name = "Support Files"; - path = "integration/iOS/Pods/Target Support Files/abacus"; + name = Frameworks; sourceTree = ""; }; 578452D2E740E91742655AC8F1636D1F /* iOS */ = { @@ -372,16 +368,6 @@ name = iOS; sourceTree = ""; }; - 62AAA19B1072508BA39B574A06434036 /* abacus */ = { - isa = PBXGroup; - children = ( - 34798EDB6F1011D15814A373E88BB56F /* Pod */, - 471C85CB948067129D79803FD50B3454 /* Support Files */, - ); - name = abacus; - path = ../../..; - sourceTree = ""; - }; 77BFA6027665EBACC42B94A7C2372871 /* Pods-abacus.iosTests */ = { isa = PBXGroup; children = ( @@ -398,6 +384,14 @@ path = "Target Support Files/Pods-abacus.iosTests"; sourceTree = ""; }; + 792A924F0CBCDCDB77BDB1651564E6F1 /* Pod */ = { + isa = PBXGroup; + children = ( + 5ABBFD1A2A08C44870270007AE1EB5D4 /* abacus.podspec */, + ); + name = Pod; + sourceTree = ""; + }; 7D94CDF401128D689D2B11EDCC7ECD3A /* Products */ = { isa = PBXGroup; children = ( @@ -527,6 +521,14 @@ path = CryptoSwift; sourceTree = ""; }; + A5DC2D324221A781AC0E7A1B4908E26D /* Development Pods */ = { + isa = PBXGroup; + children = ( + F896DEEFEA08BDAEEA48FBC9E29423FF /* abacus */, + ); + name = "Development Pods"; + sourceTree = ""; + }; B284BBC13E1216FA4484D74F45F3F36F /* Pods-abacus.ios */ = { isa = PBXGroup; children = ( @@ -557,7 +559,7 @@ isa = PBXGroup; children = ( 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, - 2D0B0EF6EDF07ED1C20291E5736D2CD7 /* Development Pods */, + A5DC2D324221A781AC0E7A1B4908E26D /* Development Pods */, D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */, DA389CCA0C382AECE0DD24ED555B7245 /* Pods */, 7D94CDF401128D689D2B11EDCC7ECD3A /* Products */, @@ -596,6 +598,17 @@ path = "../Target Support Files/CryptoSwift"; sourceTree = ""; }; + F896DEEFEA08BDAEEA48FBC9E29423FF /* abacus */ = { + isa = PBXGroup; + children = ( + 33D1C287C8CC4BF36926F2A16F33E291 /* Frameworks */, + 792A924F0CBCDCDB77BDB1651564E6F1 /* Pod */, + 208518205B4C2F51FC3700B9883D08D7 /* Support Files */, + ); + name = abacus; + path = ../../..; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -638,8 +651,8 @@ buildRules = ( ); dependencies = ( - 5A2D5CC658950E4A7AEC9150E168E04C /* PBXTargetDependency */, - CB00F4B79F2C6FE352C8E0E376CC0EE4 /* PBXTargetDependency */, + E8ABF0505B4018EE55DC64051C0E3170 /* PBXTargetDependency */, + CF848ADCA9D462971E67CA041BBB55DD /* PBXTargetDependency */, ); name = "Pods-abacus.ios"; productName = Pods_abacus_ios; @@ -658,7 +671,7 @@ buildRules = ( ); dependencies = ( - A5DD726974B98C309F8CC82EA812FDEF /* PBXTargetDependency */, + 1F67D19EAC36A41088EB458D7432B293 /* PBXTargetDependency */, ); name = "Pods-abacus.iosTests"; productName = Pods_abacus_iosTests; @@ -738,7 +751,24 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1403E0AEBF8A2087DF8CACA188B609E8 /* [CP-User] Build abacus */ = { + 903ECA29140368245E4B69BE2D0DBCA4 /* [CP] Copy dSYMs */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/abacus/abacus-copy-dsyms-input-files.xcfilelist", + ); + name = "[CP] Copy dSYMs"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/abacus/abacus-copy-dsyms-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/abacus/abacus-copy-dsyms.sh\"\n"; + showEnvVarsInLog = 0; + }; + DB36ACE8A857E9B93C25EA309FF42C2A /* [CP-User] Build abacus */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -888,23 +918,23 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 5A2D5CC658950E4A7AEC9150E168E04C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = CryptoSwift; - target = 99313990C1D76A6D1D017868B6975CC8 /* CryptoSwift */; - targetProxy = D943F129042E36333E484FD2DF373D43 /* PBXContainerItemProxy */; - }; - A5DD726974B98C309F8CC82EA812FDEF /* PBXTargetDependency */ = { + 1F67D19EAC36A41088EB458D7432B293 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "Pods-abacus.ios"; target = 469F25E790D19440507BF938A40578A7 /* Pods-abacus.ios */; - targetProxy = 3E4D9EBB8F897D7BD1BB900F1CB03EFD /* PBXContainerItemProxy */; + targetProxy = 174DE097054DE7A0410C57AF4AEF5A1A /* PBXContainerItemProxy */; }; - CB00F4B79F2C6FE352C8E0E376CC0EE4 /* PBXTargetDependency */ = { + CF848ADCA9D462971E67CA041BBB55DD /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = abacus; target = 4084846DAF1774840D25DF1BF2460325 /* abacus */; - targetProxy = A9316E3AFEDA79C6BE2E70454904E23B /* PBXContainerItemProxy */; + targetProxy = F8007D80E43B99904B0E4DD383211363 /* PBXContainerItemProxy */; + }; + E8ABF0505B4018EE55DC64051C0E3170 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = CryptoSwift; + target = 99313990C1D76A6D1D017868B6975CC8 /* CryptoSwift */; + targetProxy = 8437FCB39ECA4A44D93FCDCBF6066E92 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -946,23 +976,6 @@ }; name = Debug; }; - 22B0388248EDA44270493DDECC58CF78 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2B743EE4A0C2A395311B213324EB2342 /* abacus.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; 4C06C857647A16E5CF368D22DFA55BAF /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 0ECEA0D8830DCE37C7297C5F1342B08E /* Pods-abacus.ios.release.xcconfig */; @@ -1036,22 +1049,6 @@ }; name = Debug; }; - 5B331F72A7F4402311EBC4A06282E60D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CF5938B823263BBF080C9B21A3470789 /* abacus.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; 5D1E4AA7093DAD0F254B24C6406C303C /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7996373D44C9A5554EA9135984BC01DB /* Pods-abacus.iosTests.release.xcconfig */; @@ -1218,6 +1215,39 @@ }; name = Debug; }; + 96B05028328C5704FCE6A41A515364C0 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 087E84600314FECE345137BBED3ABF4A /* abacus.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B0264023D64B16BF2F6C8B4C076E862A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 41730F22ADD1AE7FC7AB8FCAD4AB2CDA /* abacus.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; F3A0E769E09875E7B65318E499E93FAC /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5E828917FF2AA3CC6B23ECF8A598B684 /* CryptoSwift.release.xcconfig */; @@ -1294,29 +1324,29 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 2ECD87CECC0DF0128DB6EE0BDC2D9E8A /* Build configuration list for PBXNativeTarget "CryptoSwift" */ = { + 127F9C06E33E9DC2AB3876F089264EB1 /* Build configuration list for PBXAggregateTarget "abacus" */ = { isa = XCConfigurationList; buildConfigurations = ( - 4F6792E687410AB2E5E862AE7B821068 /* Debug */, - F3A0E769E09875E7B65318E499E93FAC /* Release */, + 96B05028328C5704FCE6A41A515364C0 /* Debug */, + B0264023D64B16BF2F6C8B4C076E862A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { + 2ECD87CECC0DF0128DB6EE0BDC2D9E8A /* Build configuration list for PBXNativeTarget "CryptoSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( - 934ED2B84836A780113D1F63484628B2 /* Debug */, - 92486E5E72E54FAF60E1A7D022C21B10 /* Release */, + 4F6792E687410AB2E5E862AE7B821068 /* Debug */, + F3A0E769E09875E7B65318E499E93FAC /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - B36D4FC54F44832C64D6BFCFC7EF4665 /* Build configuration list for PBXAggregateTarget "abacus" */ = { + 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - 5B331F72A7F4402311EBC4A06282E60D /* Debug */, - 22B0388248EDA44270493DDECC58CF78 /* Release */, + 934ED2B84836A780113D1F63484628B2 /* Debug */, + 92486E5E72E54FAF60E1A7D022C21B10 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Debug-input-files.xcfilelist b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Debug-input-files.xcfilelist index 5a72e622a..fde154c0b 100644 --- a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Debug-input-files.xcfilelist +++ b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Debug-input-files.xcfilelist @@ -1,2 +1,3 @@ ${PODS_ROOT}/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks.sh -${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework \ No newline at end of file +${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework +${PODS_ROOT}/../../../build/cocoapods/framework/Abacus.framework \ No newline at end of file diff --git a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Debug-output-files.xcfilelist b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Debug-output-files.xcfilelist index 60ae66013..d4b327f7e 100644 --- a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Debug-output-files.xcfilelist +++ b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Debug-output-files.xcfilelist @@ -1 +1,2 @@ -${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CryptoSwift.framework \ No newline at end of file +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CryptoSwift.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Abacus.framework \ No newline at end of file diff --git a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Release-input-files.xcfilelist b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Release-input-files.xcfilelist index 5a72e622a..fde154c0b 100644 --- a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Release-input-files.xcfilelist +++ b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Release-input-files.xcfilelist @@ -1,2 +1,3 @@ ${PODS_ROOT}/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks.sh -${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework \ No newline at end of file +${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework +${PODS_ROOT}/../../../build/cocoapods/framework/Abacus.framework \ No newline at end of file diff --git a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Release-output-files.xcfilelist b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Release-output-files.xcfilelist index 60ae66013..d4b327f7e 100644 --- a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Release-output-files.xcfilelist +++ b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks-Release-output-files.xcfilelist @@ -1 +1,2 @@ -${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CryptoSwift.framework \ No newline at end of file +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CryptoSwift.framework +${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Abacus.framework \ No newline at end of file diff --git a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks.sh b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks.sh index 87d4632ad..91b03c4c7 100755 --- a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks.sh +++ b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks.sh @@ -177,9 +177,11 @@ code_sign_if_enabled() { if [[ "$CONFIGURATION" == "Debug" ]]; then install_framework "${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework" + install_framework "${PODS_ROOT}/../../../build/cocoapods/framework/Abacus.framework" fi if [[ "$CONFIGURATION" == "Release" ]]; then install_framework "${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework" + install_framework "${PODS_ROOT}/../../../build/cocoapods/framework/Abacus.framework" fi if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then wait diff --git a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios.debug.xcconfig b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios.debug.xcconfig index 465909b2f..bb1b3d88e 100644 --- a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios.debug.xcconfig +++ b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios.debug.xcconfig @@ -1,11 +1,11 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift" +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift" "${PODS_ROOT}/../../../build/cocoapods/framework" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift/CryptoSwift.framework/Headers" LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift -OTHER_LDFLAGS = $(inherited) -l"c++" -framework "CryptoSwift" +OTHER_LDFLAGS = $(inherited) -l"c++" -framework "Abacus" -framework "CryptoSwift" OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS PODS_BUILD_DIR = ${BUILD_DIR} PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) diff --git a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios.release.xcconfig b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios.release.xcconfig index 465909b2f..bb1b3d88e 100644 --- a/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios.release.xcconfig +++ b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios.release.xcconfig @@ -1,11 +1,11 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift" +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift" "${PODS_ROOT}/../../../build/cocoapods/framework" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift/CryptoSwift.framework/Headers" LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift -OTHER_LDFLAGS = $(inherited) -l"c++" -framework "CryptoSwift" +OTHER_LDFLAGS = $(inherited) -l"c++" -framework "Abacus" -framework "CryptoSwift" OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS PODS_BUILD_DIR = ${BUILD_DIR} PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) diff --git a/integration/iOS/Pods/Target Support Files/Pods-abacus.iosTests/Pods-abacus.iosTests.debug.xcconfig b/integration/iOS/Pods/Target Support Files/Pods-abacus.iosTests/Pods-abacus.iosTests.debug.xcconfig index 48b7be218..fca5da53c 100644 --- a/integration/iOS/Pods/Target Support Files/Pods-abacus.iosTests/Pods-abacus.iosTests.debug.xcconfig +++ b/integration/iOS/Pods/Target Support Files/Pods-abacus.iosTests/Pods-abacus.iosTests.debug.xcconfig @@ -1,8 +1,8 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift" +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift" "${PODS_ROOT}/../../../build/cocoapods/framework" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift/CryptoSwift.framework/Headers" -OTHER_LDFLAGS = $(inherited) -l"c++" -framework "CryptoSwift" +OTHER_LDFLAGS = $(inherited) -l"c++" -framework "Abacus" -framework "CryptoSwift" PODS_BUILD_DIR = ${BUILD_DIR} PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_PODFILE_DIR_PATH = ${SRCROOT}/. diff --git a/integration/iOS/Pods/Target Support Files/Pods-abacus.iosTests/Pods-abacus.iosTests.release.xcconfig b/integration/iOS/Pods/Target Support Files/Pods-abacus.iosTests/Pods-abacus.iosTests.release.xcconfig index 48b7be218..fca5da53c 100644 --- a/integration/iOS/Pods/Target Support Files/Pods-abacus.iosTests/Pods-abacus.iosTests.release.xcconfig +++ b/integration/iOS/Pods/Target Support Files/Pods-abacus.iosTests/Pods-abacus.iosTests.release.xcconfig @@ -1,8 +1,8 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift" +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift" "${PODS_ROOT}/../../../build/cocoapods/framework" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift/CryptoSwift.framework/Headers" -OTHER_LDFLAGS = $(inherited) -l"c++" -framework "CryptoSwift" +OTHER_LDFLAGS = $(inherited) -l"c++" -framework "Abacus" -framework "CryptoSwift" PODS_BUILD_DIR = ${BUILD_DIR} PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_PODFILE_DIR_PATH = ${SRCROOT}/. diff --git a/integration/iOS/Pods/Target Support Files/abacus/abacus.debug.xcconfig b/integration/iOS/Pods/Target Support Files/abacus/abacus.debug.xcconfig index 954328169..b7f6dcfae 100644 --- a/integration/iOS/Pods/Target Support Files/abacus/abacus.debug.xcconfig +++ b/integration/iOS/Pods/Target Support Files/abacus/abacus.debug.xcconfig @@ -1,5 +1,6 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/abacus +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../build/cocoapods/framework" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 KOTLIN_PROJECT_PATH = OTHER_LDFLAGS = $(inherited) -l"c++" diff --git a/integration/iOS/Pods/Target Support Files/abacus/abacus.release.xcconfig b/integration/iOS/Pods/Target Support Files/abacus/abacus.release.xcconfig index 954328169..b7f6dcfae 100644 --- a/integration/iOS/Pods/Target Support Files/abacus/abacus.release.xcconfig +++ b/integration/iOS/Pods/Target Support Files/abacus/abacus.release.xcconfig @@ -1,5 +1,6 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/abacus +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../build/cocoapods/framework" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 KOTLIN_PROJECT_PATH = OTHER_LDFLAGS = $(inherited) -l"c++" diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/AsyncAbacusStateManager.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/AsyncAbacusStateManager.kt index cb74c55be..bb27e6436 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/AsyncAbacusStateManager.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/AsyncAbacusStateManager.kt @@ -260,19 +260,27 @@ class AsyncAbacusStateManager( } private fun load(configFile: ConfigFile) { - val path = configFile.path - if (appConfigs.loadRemote) { - loadFromRemoteConfigFile(configFile) - val configFileUrl = "$deploymentUri$path" - ioImplementations.rest?.get(configFileUrl, null, callback = { response, httpCode, _ -> - if (success(httpCode) && response != null) { - if (parse(response, configFile)) { - writeToLocalFile(response, path) - } - } - }) - } else { - loadFromBundledLocalConfigFile(configFile) + ioImplementations.threading?.async(ThreadingType.network) { + val path = configFile.path + if (appConfigs.loadRemote) { + loadFromRemoteConfigFile(configFile) + val configFileUrl = "$deploymentUri$path" + ioImplementations.rest?.get( + configFileUrl, + null, + callback = { response, httpCode, _ -> + ioImplementations.threading?.async(ThreadingType.abacus) { + if (success(httpCode) && response != null) { + if (parse(response, configFile)) { + writeToLocalFile(response, path) + } + } + } + }, + ) + } else { + loadFromBundledLocalConfigFile(configFile) + } } } @@ -280,7 +288,9 @@ class AsyncAbacusStateManager( ioImplementations.fileSystem?.readCachedTextFile( configFile.path, )?.let { - parse(it, configFile) + ioImplementations.threading?.async(ThreadingType.abacus) { + parse(it, configFile) + } } } @@ -289,7 +299,9 @@ class AsyncAbacusStateManager( FileLocation.AppBundle, configFile.path, )?.let { - parse(it, configFile) + ioImplementations.threading?.async(ThreadingType.abacus) { + parse(it, configFile) + } } } @@ -309,10 +321,12 @@ class AsyncAbacusStateManager( } private fun writeToLocalFile(response: String, file: String) { - ioImplementations.fileSystem?.writeTextFile( - file, - response, - ) + ioImplementations.threading?.async(ThreadingType.network) { + ioImplementations.fileSystem?.writeTextFile( + file, + response, + ) + } } private fun parseDocumentation(response: String) { diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/manager/AsyncAbacusStateManagerV2.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/manager/AsyncAbacusStateManagerV2.kt index c2c6087f6..8f21a5b0d 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/manager/AsyncAbacusStateManagerV2.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/manager/AsyncAbacusStateManagerV2.kt @@ -282,19 +282,27 @@ class AsyncAbacusStateManagerV2( } private fun load(configFile: ConfigFile) { - val path = configFile.path - if (appConfigs.loadRemote) { - loadFromRemoteConfigFile(configFile) - val configFileUrl = "$deploymentUri$path" - ioImplementations.rest?.get(configFileUrl, null, callback = { response, httpCode, headers -> - if (success(httpCode) && response != null) { - if (parse(response, configFile)) { - writeToLocalFile(response, path) - } - } - }) - } else { - loadFromBundledLocalConfigFile(configFile) + ioImplementations.threading?.async(ThreadingType.network) { + val path = configFile.path + if (appConfigs.loadRemote) { + loadFromRemoteConfigFile(configFile) + val configFileUrl = "$deploymentUri$path" + ioImplementations.rest?.get( + configFileUrl, + null, + callback = { response, httpCode, headers -> + ioImplementations.threading?.async(ThreadingType.abacus) { + if (success(httpCode) && response != null) { + if (parse(response, configFile)) { + writeToLocalFile(response, path) + } + } + } + }, + ) + } else { + loadFromBundledLocalConfigFile(configFile) + } } } @@ -302,7 +310,9 @@ class AsyncAbacusStateManagerV2( ioImplementations.fileSystem?.readCachedTextFile( configFile.path, )?.let { - parse(it, configFile) + ioImplementations.threading?.async(ThreadingType.abacus) { + parse(it, configFile) + } } } @@ -311,7 +321,9 @@ class AsyncAbacusStateManagerV2( FileLocation.AppBundle, configFile.path, )?.let { - parse(it, configFile) + ioImplementations.threading?.async(ThreadingType.abacus) { + parse(it, configFile) + } } } @@ -331,10 +343,12 @@ class AsyncAbacusStateManagerV2( } private fun writeToLocalFile(response: String, file: String) { - ioImplementations.fileSystem?.writeTextFile( - file, - response, - ) + ioImplementations.threading?.async(ThreadingType.network) { + ioImplementations.fileSystem?.writeTextFile( + file, + response, + ) + } } private fun parseDocumentation(response: String) { diff --git a/v4_abacus.podspec b/v4_abacus.podspec index 7d5b3968f..316ebe75f 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.45' + spec.version = '1.7.46' spec.homepage = 'https://github.com/dydxprotocol/v4-abacus' spec.source = { :http=> ''} spec.authors = '' @@ -11,7 +11,7 @@ Pod::Spec.new do |spec| - if !Dir.exist?('build/cocoapods/framework/Abacus.framework') || Dir.empty?('build/cocoapods/framework/Abacus.framework') + if false raise " Kotlin framework 'Abacus' doesn't exist yet, so a proper Xcode project can't be generated. From 5f2e7e5852f93232e7f84deec29a949f96916403 Mon Sep 17 00:00:00 2001 From: Jared Vu Date: Fri, 31 May 2024 14:25:34 -0700 Subject: [PATCH 5/6] Jared/tra 313 position margin incorrect on adjust margin modal (#407) Co-authored-by: Rui <102453770+ruixhuang@users.noreply.github.com> --- .../calculator/AdjustIsolatedMarginInputCalculator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/calculator/AdjustIsolatedMarginInputCalculator.kt b/src/commonMain/kotlin/exchange.dydx.abacus/calculator/AdjustIsolatedMarginInputCalculator.kt index ac4ddd73a..fb38ded29 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/calculator/AdjustIsolatedMarginInputCalculator.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/calculator/AdjustIsolatedMarginInputCalculator.kt @@ -98,7 +98,7 @@ internal class AdjustIsolatedMarginInputCalculator(val parser: ParserProtocol) { val crossMarginUsage = parentSubaccount?.get("marginUsage") val openPositions = parser.asNativeMap(childSubaccount?.get("openPositions")) val marketId = openPositions?.keys?.firstOrNull() - val positionMargin = childSubaccount?.get("freeCollateral") + val positionMargin = childSubaccount?.get("equity") val positionLeverage = parser.value(childSubaccount, "openPositions.$marketId.leverage") val liquidationPrice = parser.value(childSubaccount, "openPositions.$marketId.liquidationPrice") From 19de38d0077caadc44a879d23db53b517ec362bb Mon Sep 17 00:00:00 2001 From: Jeremy Lee <37092291+yogurtandjam@users.noreply.github.com> Date: Fri, 31 May 2024 20:36:04 -0400 Subject: [PATCH 6/6] feat: skip v1/assets endpoint [OTE-346] (#394) --- build.gradle.kts | 2 +- .../processor/router/IRouterProcessor.kt | 4 +- .../processor/router/skip/SkipProcessor.kt | 93 +++- .../router/skip/SkipTokenProcessor.kt | 24 +- .../router/skip/SkipTokenResourceProcessor.kt | 29 +- .../processor/router/squid/SquidProcessor.kt | 4 +- .../manager/V4StateManagerAdaptor+Transfer.kt | 4 +- .../manager/configs/V4StateManagerConfigs.kt | 4 + .../state/model/TradingStateMachine+Squid.kt | 2 +- .../TradingStateMachine+TransferInput.kt | 7 +- .../v2/supervisor/OnboardingSupervisor.kt | 18 +- .../payload/v4/V4SquidTests.kt | 22 +- .../router/skip/SkipProcessorTests.kt | 264 +++++++++- .../tests/payloads/SkipTokensMock.kt | 463 ++++++++++++++++++ v4_abacus.podspec | 2 +- 15 files changed, 865 insertions(+), 77 deletions(-) create mode 100644 src/commonTest/kotlin/exchange.dydx.abacus/tests/payloads/SkipTokensMock.kt diff --git a/build.gradle.kts b/build.gradle.kts index 8b9421124..ca31d5631 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,7 +51,7 @@ allprojects { } group = "exchange.dydx.abacus" -version = "1.7.46" +version = "1.7.47" repositories { google() diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/IRouterProcessor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/IRouterProcessor.kt index a9c7b44b5..8e8d48f5a 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/IRouterProcessor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/IRouterProcessor.kt @@ -40,8 +40,8 @@ interface IRouterProcessor { fun updateTokensDefaults(modified: MutableMap, selectedChainId: String?) fun defaultChainId(): String? - fun selectedTokenSymbol(tokenAddress: String?): String? - fun selectedTokenDecimals(tokenAddress: String?): String? + fun selectedTokenSymbol(tokenAddress: String?, selectedChainId: String?): String? + fun selectedTokenDecimals(tokenAddress: String?, selectedChainId: String?): String? fun filteredTokens(chainId: String?): List? fun defaultTokenAddress(chainId: String?): String? fun chainResources(chainId: String?): Map? diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipProcessor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipProcessor.kt index 24d7c5349..968f5911f 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipProcessor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipProcessor.kt @@ -2,11 +2,13 @@ package exchange.dydx.abacus.processor.router.skip import exchange.dydx.abacus.output.input.SelectionOption import exchange.dydx.abacus.output.input.TransferInputChainResource +import exchange.dydx.abacus.output.input.TransferInputTokenResource import exchange.dydx.abacus.processor.base.BaseProcessor import exchange.dydx.abacus.processor.router.IRouterProcessor import exchange.dydx.abacus.processor.router.SharedRouterProcessor import exchange.dydx.abacus.protocols.ParserProtocol import exchange.dydx.abacus.state.internalstate.InternalTransferInputState +import exchange.dydx.abacus.state.manager.CctpConfig.cctpChainIds import exchange.dydx.abacus.utils.mutable import exchange.dydx.abacus.utils.safeSet @@ -20,6 +22,8 @@ internal class SkipProcessor( // possibly want to use a different variable so we aren't stuck with this bad type // actual type of the tokens payload is Map>>> override var tokens: List? = null + + var skipTokens: Map>>>? = null override var exchangeDestinationChainId: String? = null val sharedRouterProcessor = SharedRouterProcessor(parser) @@ -56,7 +60,24 @@ internal class SkipProcessor( existing: Map?, payload: Map ): Map? { - throw NotImplementedError("receivedTokens is not implemented in SkipProcessor!") + if (this.chains != null && this.skipTokens != null) { + return existing + } + + val chainToAssetsMap = payload["chain_to_assets_map"] as Map>>>? + + var modified = mutableMapOf() + existing?.let { + modified = it.mutable() + } + if (chainToAssetsMap == null) { + return existing + } + val selectedChainId = defaultChainId() + this.skipTokens = chainToAssetsMap + updateTokensDefaults(modified, selectedChainId) + + return modified } override fun receivedRoute( @@ -89,10 +110,9 @@ internal class SkipProcessor( override fun updateTokensDefaults(modified: MutableMap, selectedChainId: String?) { val tokenOptions = tokenOptions(selectedChainId) - modified.safeSet("transfer.depositOptions.assets", tokenOptions) - modified.safeSet("transfer.withdrawalOptions.assets", tokenOptions) + internalState.tokens = tokenOptions modified.safeSet("transfer.token", defaultTokenAddress(selectedChainId)) - modified.safeSet("transfer.resources.tokenResources", tokenResources(selectedChainId)) + internalState.tokenResources = tokenResources(selectedChainId) } override fun defaultChainId(): String? { @@ -101,20 +121,45 @@ internal class SkipProcessor( return parser.asString(selectedChain?.get("chain_id")) } - override fun selectedTokenSymbol(tokenAddress: String?): String? { - throw NotImplementedError("selectedTokenSymbol is not implemented in SkipProcessor!") + override fun selectedTokenSymbol(tokenAddress: String?, selectedChainId: String?): String? { + val tokensList = filteredTokens(selectedChainId) + tokensList?.find { + parser.asString(parser.asNativeMap(it)?.get("denom")) == tokenAddress + }?.let { + return parser.asString(parser.asNativeMap(it)?.get("symbol")) + } + return null } - override fun selectedTokenDecimals(tokenAddress: String?): String? { - throw NotImplementedError("selectedTokenDecimals is not implemented in SkipProcessor!") + override fun selectedTokenDecimals(tokenAddress: String?, selectedChainId: String?): String? { + val tokensList = filteredTokens(selectedChainId) + tokensList?.find { + parser.asString(parser.asNativeMap(it)?.get("denom")) == tokenAddress + }?.let { + return parser.asString(parser.asNativeMap(it)?.get("decimals")) + } + return null } override fun filteredTokens(chainId: String?): List? { - throw NotImplementedError("filteredTokens is not implemented in SkipProcessor!") + val chainIdToUse = chainId ?: defaultChainId() + val assetsMapForChainId = parser.asNativeMap(this.skipTokens?.get(chainIdToUse)) + return parser.asNativeList(assetsMapForChainId?.get("assets")) } override fun defaultTokenAddress(chainId: String?): String? { - throw NotImplementedError("defaultTokenAddress is not implemented in SkipProcessor!") + return chainId?.let { cid -> + // Retrieve the list of filtered tokens for the given chainId + val filteredTokens = this.filteredTokens(cid)?.mapNotNull { + parser.asString(parser.asNativeMap(it)?.get("denom")) + }.orEmpty() + // Find a matching CctpChainTokenInfo and check if its tokenAddress is in the filtered tokens + cctpChainIds?.firstOrNull { it.chainId == cid && filteredTokens.contains(it.tokenAddress) }?.tokenAddress + ?: run { + // Fallback to the first token's address from the filtered list if no CctpChainTokenInfo match is found + filteredTokens.firstOrNull() + } + } } override fun chainResources(chainId: String?): Map? { @@ -132,8 +177,17 @@ internal class SkipProcessor( return chainResources } - override fun tokenResources(chainId: String?): Map? { - throw NotImplementedError("tokenResources is not implemented in SkipProcessor!") + override fun tokenResources(chainId: String?): Map? { + val tokenResources = mutableMapOf() + filteredTokens(chainId)?.forEach { + parser.asString(parser.asNativeMap(it)?.get("denom"))?.let { key -> + val processor = SkipTokenResourceProcessor(parser) + parser.asNativeMap(it)?.let { payload -> + tokenResources[key] = processor.received(payload) + } + } + } + return tokenResources } override fun chainOptions(): List { @@ -154,7 +208,18 @@ internal class SkipProcessor( return options } - override fun tokenOptions(chainId: String?): List { - throw NotImplementedError("tokenOptions is not implemented in SkipProcessor!") + override fun tokenOptions(chainId: String?): List { + val processor = SkipTokenProcessor(parser) + val options = mutableListOf() + val tokensForSelectedChain = filteredTokens(chainId) + tokensForSelectedChain?.let { + for (asset in it) { + parser.asNativeMap(asset)?.let { _asset -> + options.add(processor.received(_asset)) + } + } + } + options.sortBy { parser.asString(it.stringKey) } + return options } } diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipTokenProcessor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipTokenProcessor.kt index 59623ca27..fbfba34ff 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipTokenProcessor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipTokenProcessor.kt @@ -1,21 +1,17 @@ package exchange.dydx.abacus.processor.router.skip -import exchange.dydx.abacus.processor.base.BaseProcessor +import exchange.dydx.abacus.output.input.SelectionOption import exchange.dydx.abacus.protocols.ParserProtocol -internal class SkipTokenProcessor(parser: ParserProtocol) : BaseProcessor(parser) { - private val keyMap = mapOf( - "string" to mapOf( - "name" to "stringKey", - "denom" to "type", - "logo_uri" to "iconUrl", - ), - ) - - override fun received( - existing: Map?, +internal class SkipTokenProcessor(private val parser: ParserProtocol) { + fun received( payload: Map - ): Map { - return transform(existing, payload, keyMap) + ): SelectionOption { + return SelectionOption( + stringKey = parser.asString(payload["name"]), + string = parser.asString(payload["name"]), + type = parser.asString(payload["denom"]) ?: "", + iconUrl = parser.asString(payload["logo_uri"]), + ) } } diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipTokenResourceProcessor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipTokenResourceProcessor.kt index e5b202a4a..76563a084 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipTokenResourceProcessor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipTokenResourceProcessor.kt @@ -1,23 +1,20 @@ package exchange.dydx.abacus.processor.router.skip -import exchange.dydx.abacus.processor.base.BaseProcessor +import exchange.dydx.abacus.output.input.TransferInputTokenResource import exchange.dydx.abacus.protocols.ParserProtocol -internal class SkipTokenResourceProcessor(parser: ParserProtocol) : BaseProcessor(parser) { - private val keyMap = mapOf( - "string" to mapOf( - "name" to "name", - "denom" to "address", - "symbol" to "symbol", - "decimals" to "decimals", - "logo_uri" to "iconUrl", - ), - ) - - override fun received( - existing: Map?, +internal class SkipTokenResourceProcessor( + private val parser: ParserProtocol +) { + fun received( payload: Map - ): Map { - return transform(existing, payload, keyMap) + ): TransferInputTokenResource { + return TransferInputTokenResource( + name = parser.asString(payload["name"]), + address = parser.asString(payload["denom"]), + symbol = parser.asString(payload["symbol"]), + decimals = parser.asInt(payload["decimals"]), + iconUrl = parser.asString(payload["logo_uri"]), + ) } } diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/squid/SquidProcessor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/squid/SquidProcessor.kt index 5e8a2b94d..c0362a6be 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/squid/SquidProcessor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/squid/SquidProcessor.kt @@ -184,7 +184,7 @@ internal class SquidProcessor( return parser.asString(selectedChain?.get("chainId")) } - override fun selectedTokenSymbol(tokenAddress: String?): String? { + override fun selectedTokenSymbol(tokenAddress: String?, selectedChainId: String?): String? { this.tokens?.find { parser.asString(parser.asNativeMap(it)?.get("address")) == tokenAddress }?.let { @@ -193,7 +193,7 @@ internal class SquidProcessor( return null } - override fun selectedTokenDecimals(tokenAddress: String?): String? { + override fun selectedTokenDecimals(tokenAddress: String?, selectedChainId: String?): String? { this.tokens?.find { parser.asString(parser.asNativeMap(it)?.get("address")) == tokenAddress }?.let { diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor+Transfer.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor+Transfer.kt index ab54bed1b..038fb6385 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor+Transfer.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor+Transfer.kt @@ -86,7 +86,7 @@ private fun V4StateManagerAdaptor.retrieveDepositRouteV1(state: PerpetualState?) val fromChain = state?.input?.transfer?.chain val fromToken = state?.input?.transfer?.token val fromAmount = parser.asDecimal(state?.input?.transfer?.size?.size)?.let { - val decimals = parser.asInt(stateMachine.squidProcessor.selectedTokenDecimals(fromToken)) + val decimals = parser.asInt(stateMachine.squidProcessor.selectedTokenDecimals(tokenAddress = fromToken, selectedChainId = fromChain)) if (decimals != null) { (it * Numeric.decimal.TEN.pow(decimals)).toBigInteger() } else { @@ -144,7 +144,7 @@ private fun V4StateManagerAdaptor.retrieveDepositRouteV2(state: PerpetualState?) val fromChain = state?.input?.transfer?.chain val fromToken = state?.input?.transfer?.token val fromAmount = parser.asDecimal(state?.input?.transfer?.size?.size)?.let { - val decimals = parser.asInt(stateMachine.squidProcessor.selectedTokenDecimals(fromToken)) + val decimals = parser.asInt(stateMachine.squidProcessor.selectedTokenDecimals(tokenAddress = fromToken, selectedChainId = fromChain)) if (decimals != null) { (it * Numeric.decimal.TEN.pow(decimals)).toBigInteger() } else { diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/configs/V4StateManagerConfigs.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/configs/V4StateManagerConfigs.kt index ef36530ee..71967078c 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/configs/V4StateManagerConfigs.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/configs/V4StateManagerConfigs.kt @@ -119,6 +119,10 @@ class V4StateManagerConfigs( return "$skipHost/v1/info/chains?include_evm=true" } + fun skipV1Assets(): String { + return "$skipHost/v1/fungible/assets?include_evm_assets=true" + } + fun nobleDenom(): String? { return "uusdc" } diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+Squid.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+Squid.kt index 156e6858c..a65417958 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+Squid.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+Squid.kt @@ -16,7 +16,7 @@ internal fun TradingStateMachine.routerChains(payload: String): StateChanges? { } } -internal fun TradingStateMachine.squidTokens(payload: String): StateChanges? { +internal fun TradingStateMachine.routerTokens(payload: String): StateChanges? { val json = parser.decodeJsonObject(payload) return if (json != null) { input = squidProcessor.receivedTokens(input, json) diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+TransferInput.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+TransferInput.kt index ac3500c88..89265d288 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+TransferInput.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+TransferInput.kt @@ -192,18 +192,19 @@ fun TradingStateMachine.transfer( return StateResponse(state, changes, if (error != null) iListOf(error) else null) } -private fun TradingStateMachine.updateTransferToTokenType(transfer: MutableMap, token: String) { +private fun TradingStateMachine.updateTransferToTokenType(transfer: MutableMap, tokenAddress: String) { + val selectedChainId = transfer["chain"] as? String if (transfer["type"] == "TRANSFER_OUT") { transfer.safeSet("size.usdcSize", null) transfer.safeSet("size.size", null) } else { transfer.safeSet( "resources.tokenSymbol", - squidProcessor.selectedTokenSymbol(token), + squidProcessor.selectedTokenSymbol(tokenAddress = tokenAddress, selectedChainId = selectedChainId), ) transfer.safeSet( "resources.tokenDecimals", - squidProcessor.selectedTokenDecimals(token), + squidProcessor.selectedTokenDecimals(tokenAddress = tokenAddress, selectedChainId = selectedChainId), ) } transfer.safeSet("route", null) diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/OnboardingSupervisor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/OnboardingSupervisor.kt index 522114ce1..4214fb79b 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/OnboardingSupervisor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/OnboardingSupervisor.kt @@ -25,6 +25,7 @@ import exchange.dydx.abacus.state.manager.pendingCctpWithdraw import exchange.dydx.abacus.state.model.TradingStateMachine import exchange.dydx.abacus.state.model.TransferInputField import exchange.dydx.abacus.state.model.routerChains +import exchange.dydx.abacus.state.model.routerTokens import exchange.dydx.abacus.state.model.squidRoute import exchange.dydx.abacus.state.model.squidRouteV2 import exchange.dydx.abacus.state.model.squidStatus @@ -81,6 +82,19 @@ internal class OnboardingSupervisor( } } + @Suppress("UnusedPrivateMember") + private fun retrieveSkipTransferTokens() { + val oldState = stateMachine.state + val tokensUrl = helper.configs.skipV1Assets() +// add API key injection +// val header = iMapOf("authorization" to skipAPIKey) + helper.get(tokensUrl, null, null) { _, response, httpCode, _ -> + if (helper.success(httpCode) && response != null) { + update(stateMachine.routerTokens(response), oldState) + } + } + } + private fun retrieveTransferAssets() { val oldState = stateMachine.state val url = helper.configs.squidV2Assets() @@ -183,7 +197,7 @@ internal class OnboardingSupervisor( val fromToken = state?.input?.transfer?.token val fromAmount = helper.parser.asDecimal(state?.input?.transfer?.size?.size)?.let { val decimals = - helper.parser.asInt(stateMachine.squidProcessor.selectedTokenDecimals(fromToken)) + helper.parser.asInt(stateMachine.squidProcessor.selectedTokenDecimals(tokenAddress = fromToken, selectedChainId = fromChain)) if (decimals != null) { (it * Numeric.decimal.TEN.pow(decimals)).toBigInteger() } else { @@ -245,7 +259,7 @@ internal class OnboardingSupervisor( val fromToken = state?.input?.transfer?.token val fromAmount = helper.parser.asDecimal(state?.input?.transfer?.size?.size)?.let { val decimals = - helper.parser.asInt(stateMachine.squidProcessor.selectedTokenDecimals(fromToken)) + helper.parser.asInt(stateMachine.squidProcessor.selectedTokenDecimals(tokenAddress = fromToken, selectedChainId = fromChain)) if (decimals != null) { (it * Numeric.decimal.TEN.pow(decimals)).toBigInteger() } else { diff --git a/src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4SquidTests.kt b/src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4SquidTests.kt index 1af6d062c..48280110a 100644 --- a/src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4SquidTests.kt +++ b/src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4SquidTests.kt @@ -2,10 +2,10 @@ package exchange.dydx.abacus.payload.v4 import exchange.dydx.abacus.state.model.TransferInputField import exchange.dydx.abacus.state.model.routerChains +import exchange.dydx.abacus.state.model.routerTokens import exchange.dydx.abacus.state.model.squidRoute import exchange.dydx.abacus.state.model.squidRouteV2 import exchange.dydx.abacus.state.model.squidStatus -import exchange.dydx.abacus.state.model.squidTokens import exchange.dydx.abacus.state.model.squidV2SdkInfo import exchange.dydx.abacus.state.model.transfer import kotlin.test.Test @@ -50,7 +50,7 @@ class V4SquidTests : V4BaseTests() { var stateChange = perp.routerChains(mock.squidChainsMock.payload) assertNotNull(stateChange) - stateChange = perp.squidTokens(mock.squidTokensMock.payload) + stateChange = perp.routerTokens(mock.squidTokensMock.payload) assertNotNull(stateChange) test({ @@ -115,7 +115,7 @@ class V4SquidTests : V4BaseTests() { var stateChange = perp.routerChains(mock.squidChainsMock.payload) assertNotNull(stateChange) - stateChange = perp.squidTokens(mock.squidTokensMock.payload) + stateChange = perp.routerTokens(mock.squidTokensMock.payload) assertNotNull(stateChange) stateChange = perp.squidRoute(mock.squidRouteMock.payload, 0, null) @@ -151,7 +151,7 @@ class V4SquidTests : V4BaseTests() { var stateChange = perp.routerChains(mock.squidChainsMock.payload) assertNotNull(stateChange) - stateChange = perp.squidTokens(mock.squidTokensMock.payload) + stateChange = perp.routerTokens(mock.squidTokensMock.payload) assertNotNull(stateChange) stateChange = perp.squidRoute(mock.squidRouteMock.errors_payload, 0, null) @@ -199,20 +199,20 @@ class V4SquidTests : V4BaseTests() { fun testSelectedTokenSymbol() { setup() - val stateChange = perp.squidTokens(mock.squidTokensMock.payload) + val stateChange = perp.routerTokens(mock.squidTokensMock.payload) assertNotNull(stateChange) - assertTrue(perp.squidProcessor.selectedTokenSymbol("0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE") == "ETH") + assertTrue(perp.squidProcessor.selectedTokenSymbol("0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "should_not_matter") == "ETH") } @Test fun testSelectedTokenDecimals() { setup() - val stateChange = perp.squidTokens(mock.squidTokensMock.payload) + val stateChange = perp.routerTokens(mock.squidTokensMock.payload) assertNotNull(stateChange) - assertTrue(perp.squidProcessor.selectedTokenDecimals("0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE") == "18") + assertTrue(perp.squidProcessor.selectedTokenDecimals("0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "should_not_matter") == "18") } @Test @@ -222,7 +222,7 @@ class V4SquidTests : V4BaseTests() { var stateChange = perp.routerChains(mock.squidChainsMock.payload) assertNotNull(stateChange) - stateChange = perp.squidTokens(mock.squidTokensMock.payload) + stateChange = perp.routerTokens(mock.squidTokensMock.payload) assertNotNull(stateChange) assertTrue(perp.squidProcessor.defaultTokenAddress("1") == "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE") @@ -248,7 +248,7 @@ class V4SquidTests : V4BaseTests() { var stateChange = perp.routerChains(mock.squidChainsMock.payload) assertNotNull(stateChange) - stateChange = perp.squidTokens(mock.squidTokensMock.payload) + stateChange = perp.routerTokens(mock.squidTokensMock.payload) assertNotNull(stateChange) val result = perp.squidProcessor.tokenResources("1") @@ -262,7 +262,7 @@ class V4SquidTests : V4BaseTests() { var stateChange = perp.routerChains(mock.squidChainsMock.payload) assertNotNull(stateChange) - stateChange = perp.squidTokens(mock.squidTokensMock.payload) + stateChange = perp.routerTokens(mock.squidTokensMock.payload) assertNotNull(stateChange) val result = perp.squidProcessor.tokenOptions("1") diff --git a/src/commonTest/kotlin/exchange.dydx.abacus/processor/router/skip/SkipProcessorTests.kt b/src/commonTest/kotlin/exchange.dydx.abacus/processor/router/skip/SkipProcessorTests.kt index 465951928..b4db78f6f 100644 --- a/src/commonTest/kotlin/exchange.dydx.abacus/processor/router/skip/SkipProcessorTests.kt +++ b/src/commonTest/kotlin/exchange.dydx.abacus/processor/router/skip/SkipProcessorTests.kt @@ -1,11 +1,14 @@ package exchange.dydx.abacus.processor.router.skip import exchange.dydx.abacus.output.input.SelectionOption import exchange.dydx.abacus.output.input.TransferInputChainResource +import exchange.dydx.abacus.output.input.TransferInputTokenResource import exchange.dydx.abacus.state.internalstate.InternalTransferInputState import exchange.dydx.abacus.tests.payloads.SkipChainsMock +import exchange.dydx.abacus.tests.payloads.SkipTokensMock import exchange.dydx.abacus.utils.Parser import kotlinx.serialization.json.Json import kotlinx.serialization.json.jsonObject +import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertEquals @@ -16,18 +19,188 @@ internal fun templateToJson(template: String): Map { class SkipProcessorTests { internal val internalState = InternalTransferInputState() - internal val skipProcessor = SkipProcessor(parser = Parser(), internalState = internalState) + internal val parser = Parser() + internal val skipProcessor = SkipProcessor(parser = parser, internalState = internalState) internal val skipChainsMock = SkipChainsMock() + internal val skipTokensMock = SkipTokensMock() + internal val selectedChainId = "osmosis-1" + internal val selectedTokenAddress = "selectedTokenDenom" + internal val selectedTokenSymbol = "selectedTokenSymbol" + internal val selectedTokenDecimals = "15" + internal val selectedChainAssets = listOf( + mapOf( + "denom" to selectedTokenAddress, + "symbol" to selectedTokenSymbol, + "decimals" to selectedTokenDecimals, + "name" to "some-name", + "logo_uri" to "some-logo-uri", + ), + mapOf( + "denom" to "testTokenKeyValue2", + "symbol" to "ARB", + "decimals" to 8, + "name" to "some-name-2", + "logo_uri" to "some-logo-uri-2", + ), + mapOf( + "denom" to "testTokenKeyValue3", + "symbol" to "ETH", + "decimals" to 5, + "name" to "some-name-3", + "logo_uri" to "some-logo-uri-3", + ), + ) + + /** + * Adds tokens to the skipProcessor instance + * This is a reduced scope mock that is to be used for UNIT TESTS ONLY. + * Integration tests should use the skipChainsMock or skipTokensMock structures. + * The test tokens fixture looks like this: + * { + * "osmosis-1": { + * "assets": [ + * { + * "denom": "selectedTokenDenom", + * "symbol": "selectedTokenSymbol", + * "decimals": 15 + * }, + * { + * "denom": "testTokenKeyValue2", + * "symbol": "ARB", + * "decimals": 8 + * }, + * { + * "denom": "testTokenKeyValue3" + * "symbol": "ETH", + * "decimals": 5 + * } + * ] + * }, + * "dont-select": { + * "assets": [ + * {"denom": "shouldNotBeSelectedValue1"}, + * {"denom": "shouldNotBeSelectedValue2"}, + * {"denom": "shouldNotBeSelectedValue3"} + * ] + * } + * } + * + * This makes it easy to know what the filteredTokens output should be + * which in turn helps us know the results of the funs that depend on it. + */ + internal fun addTokens() { + skipProcessor.skipTokens = mapOf( + selectedChainId to mapOf("assets" to selectedChainAssets), + "dont-select" to mapOf( + "assets" to listOf( + mapOf("shouldNotBeSelected1" to "shouldNotBeSelectedValue1"), + mapOf("shouldNotBeSelected2" to "shouldNotBeSelectedValue2"), + mapOf("shouldNotBeSelected3" to "shouldNotBeSelectedValue3"), + ), + ), + ) + } + + @BeforeTest + internal fun setUp() { + addTokens() + } + +// ////////////////// UNIT TESTS ////////////////////// + @Test + fun testFilteredTokens() { + val result = skipProcessor.filteredTokens(chainId = selectedChainId) + val expected = selectedChainAssets + assertEquals(expected, result) + } + + @Test + fun testSelectedTokenSymbol() { + val result = skipProcessor.selectedTokenSymbol(tokenAddress = selectedTokenAddress, selectedChainId = selectedChainId) + val expected = selectedTokenSymbol + assertEquals(expected, result) + } + + @Test + fun testSelectedTokenDecimals() { + val result = skipProcessor.selectedTokenDecimals(tokenAddress = selectedTokenAddress, selectedChainId = selectedChainId) + val expected = selectedTokenDecimals + assertEquals(expected, result) + } + + @Test + fun testDefaultTokenAddress() { + val result = skipProcessor.defaultTokenAddress(selectedChainId) + val expected = selectedTokenAddress + assertEquals(expected, result) + } + + @Test + fun testTokenResources() { + val result = skipProcessor.tokenResources(selectedChainId) + val expected = mapOf( + selectedTokenAddress to TransferInputTokenResource( + address = selectedTokenAddress, + symbol = selectedTokenSymbol, + decimals = parser.asInt(selectedTokenDecimals), + name = "some-name", + iconUrl = "some-logo-uri", + ), + "testTokenKeyValue2" to TransferInputTokenResource( + address = "testTokenKeyValue2", + symbol = "ARB", + decimals = 8, + name = "some-name-2", + iconUrl = "some-logo-uri-2", + ), + "testTokenKeyValue3" to TransferInputTokenResource( + address = "testTokenKeyValue3", + symbol = "ETH", + decimals = 5, + name = "some-name-3", + iconUrl = "some-logo-uri-3", + ), + ) + assertEquals(expected, result) + } + + @Test + fun testTokenOptions() { + val result = skipProcessor.tokenOptions(selectedChainId) + val expected = listOf( + SelectionOption( + stringKey = "some-name", + string = "some-name", + type = selectedTokenAddress, + iconUrl = "some-logo-uri", + ), + SelectionOption( + stringKey = "some-name-2", + string = "some-name-2", + type = "testTokenKeyValue2", + iconUrl = "some-logo-uri-2", + ), + SelectionOption( + stringKey = "some-name-3", + string = "some-name-3", + type = "testTokenKeyValue3", + iconUrl = "some-logo-uri-3", + ), + ) + assertEquals(expected, result) + } + + // /////////////// INTEGRATION TESTS //////////////////// @Test fun testReceivedChains() { + val payload = templateToJson( + skipChainsMock.payload, + ) val modified = skipProcessor.receivedChains( existing = mapOf(), - payload = templateToJson( - skipChainsMock.payload, - ), + payload = payload, ) - val expectedChains = listOf( SelectionOption(stringKey = "Ethereum", string = "Ethereum", type = "1", iconUrl = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png"), SelectionOption(stringKey = "aura", string = "aura", type = "xstaxy-1", iconUrl = "https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/xstaxy/chain.png"), @@ -36,8 +209,6 @@ class SkipProcessorTests { SelectionOption(stringKey = "osmosis", string = "osmosis", type = "osmosis-1", iconUrl = "https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/osmosis/chain.png"), SelectionOption(stringKey = "stride", string = "stride", type = "stride-1", iconUrl = "https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/stride/chain.png"), ) - assertEquals(expectedChains, internalState.chains) - val expectedChainResources = mapOf( "1" to TransferInputChainResource( chainName = "Ethereum", @@ -45,13 +216,90 @@ class SkipProcessorTests { iconUrl = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png", ), ) + val expectedModified = mapOf( + "transfer" to mapOf( + "chain" to "1", + ), + ) + + assertEquals(expectedChains, internalState.chains) + assertEquals(payload["chains"], skipProcessor.chains) assertEquals(expectedChainResources, internalState.chainResources) + assertEquals(expectedModified, modified) + } + @Test + fun testReceivedTokens() { + val payload = templateToJson(skipTokensMock.payload) + skipProcessor.skipTokens = null + skipProcessor.chains = listOf( + mapOf( + "chain_name" to "aura", + "chain_id" to "1", + "pfm_enabled" to false, + "supports_memo" to true, + "logo_uri" to "https ://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/xstaxy/chain.png", + "bech32_prefix" to "aura", + "chain_type" to "cosmos", + "is_testnet" to false, + ), + ) + val modified = skipProcessor.receivedTokens( + existing = mapOf(), + payload = payload, + ) val expectedModified = mapOf( "transfer" to mapOf( - "chain" to "1", + "token" to "0x97e6E0a40a3D02F12d1cEC30ebfbAE04e37C119E", ), ) + val expectedTokens = listOf( + SelectionOption( + stringKey = "Euro Coin", + string = "Euro Coin", + type = "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c", + iconUrl = "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/euroc.svg", + ), + SelectionOption( + stringKey = "Real Yield USD", + string = "Real Yield USD", + type = "0x97e6E0a40a3D02F12d1cEC30ebfbAE04e37C119E", + iconUrl = "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/yieldusd.svg", + ), + SelectionOption( + stringKey = "Umee native token", + string = "Umee native token", + type = "0x923e030f951A2401426a3407a9bcc7EB715d9a0b", + iconUrl = "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/umee.svg", + ), + ) + val expectedTokenResources = mapOf( + "0x97e6E0a40a3D02F12d1cEC30ebfbAE04e37C119E" to TransferInputTokenResource( + name = "Real Yield USD", + address = "0x97e6E0a40a3D02F12d1cEC30ebfbAE04e37C119E", + symbol = "YieldUSD", + decimals = 18, + iconUrl = "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/yieldusd.svg", + ), + "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c" to TransferInputTokenResource( + name = "Euro Coin", + address = "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c", + symbol = "EUROC", + decimals = 6, + iconUrl = "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/euroc.svg", + ), + "0x923e030f951A2401426a3407a9bcc7EB715d9a0b" to TransferInputTokenResource( + name = "Umee native token", + address = "0x923e030f951A2401426a3407a9bcc7EB715d9a0b", + symbol = "UMEE", + decimals = 6, + iconUrl = "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/umee.svg", + ), + ) + assertEquals(expectedModified, modified) + assertEquals(payload["chain_to_assets_map"], skipProcessor.skipTokens) + assertEquals(expectedTokens, internalState.tokens) + assertEquals(expectedTokenResources, internalState.tokenResources) } } diff --git a/src/commonTest/kotlin/exchange.dydx.abacus/tests/payloads/SkipTokensMock.kt b/src/commonTest/kotlin/exchange.dydx.abacus/tests/payloads/SkipTokensMock.kt new file mode 100644 index 000000000..3d3b432eb --- /dev/null +++ b/src/commonTest/kotlin/exchange.dydx.abacus/tests/payloads/SkipTokensMock.kt @@ -0,0 +1,463 @@ +package exchange.dydx.abacus.tests.payloads + +class SkipTokensMock { + internal val defaultChainIdAssets = """{ + "assets": [ + { + "denom": "0x97e6E0a40a3D02F12d1cEC30ebfbAE04e37C119E", + "chain_id": "1", + "origin_denom": "0x97e6E0a40a3D02F12d1cEC30ebfbAE04e37C119E", + "origin_chain_id": "1", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "YieldUSD", + "name": "Real Yield USD", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/yieldusd.svg", + "decimals": 18, + "token_contract": "0x97e6E0a40a3D02F12d1cEC30ebfbAE04e37C119E", + "recommended_symbol": "YieldUSD" + }, + { + "denom": "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c", + "chain_id": "1", + "origin_denom": "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c", + "origin_chain_id": "1", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "EUROC", + "name": "Euro Coin", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/euroc.svg", + "decimals": 6, + "token_contract": "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c", + "coingecko_id": "euro-coin", + "recommended_symbol": "EUROC" + }, + { + "denom": "0x923e030f951A2401426a3407a9bcc7EB715d9a0b", + "chain_id": "1", + "origin_denom": "0x923e030f951A2401426a3407a9bcc7EB715d9a0b", + "origin_chain_id": "1", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "UMEE", + "name": "Umee native token", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/umee.svg", + "decimals": 6, + "token_contract": "0x923e030f951A2401426a3407a9bcc7EB715d9a0b", + "coingecko_id": "umee", + "recommended_symbol": "UMEE" + } + ] + }""" + internal val payload = """{ + "chain_to_assets_map": { + "1": $defaultChainIdAssets, + "5": { + "assets": [ + { + "denom": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6", + "chain_id": "5", + "origin_denom": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6", + "origin_chain_id": "5", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "WETH", + "name": "weth", + "logo_uri": "https://raw.githubusercontent.com/cosmostation/chainlist/main/chain/ethereum/asset/weth.png", + "decimals": 18, + "token_contract": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6", + "coingecko_id": "weth", + "recommended_symbol": "WETH" + }, + { + "denom": "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889", + "chain_id": "5", + "origin_denom": "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889", + "origin_chain_id": "5", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "WMATIC", + "name": "wmatic-wei", + "logo_uri": "https://raw.githubusercontent.com/cosmostation/chainlist/main/chain/polygon/asset/wmatic.png", + "decimals": 18, + "token_contract": "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889", + "coingecko_id": "matic-network", + "recommended_symbol": "WMATIC" + }, + { + "denom": "", + "chain_id": "5", + "origin_denom": "", + "origin_chain_id": "5", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "ETH", + "name": "eth", + "logo_uri": "https://raw.githubusercontent.com/cosmostation/chainlist/main/chain/ethereum/asset/eth.png", + "decimals": 18, + "coingecko_id": "ethereum", + "recommended_symbol": "ETH" + } + ] + }, + "10": { + "assets": [ + { + "denom": "0x789CbBE5d19f04F38Ec9790b28Ecb07ba5617f61", + "chain_id": "10", + "origin_denom": "0x789CbBE5d19f04F38Ec9790b28Ecb07ba5617f61", + "origin_chain_id": "10", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "stTIA.axl", + "name": "Stride Staked Tia", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/sttia.svg", + "decimals": 6, + "token_contract": "0x789CbBE5d19f04F38Ec9790b28Ecb07ba5617f61", + "coingecko_id": "stride-staked-tia", + "recommended_symbol": "stTIA.axl" + }, + { + "denom": "0xb829b68f57CC546dA7E5806A929e53bE32a4625D", + "chain_id": "10", + "origin_denom": "0xb829b68f57CC546dA7E5806A929e53bE32a4625D", + "origin_chain_id": "10", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "axlETH", + "name": "Axelar Wrapped ETH", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/weth.svg", + "decimals": 18, + "token_contract": "0xb829b68f57CC546dA7E5806A929e53bE32a4625D", + "coingecko_id": "weth", + "recommended_symbol": "ETH.axl" + }, + { + "denom": "0x4200000000000000000000000000000000000042", + "chain_id": "10", + "origin_denom": "0x4200000000000000000000000000000000000042", + "origin_chain_id": "10", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "OP", + "name": "Optimism", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/op.svg", + "decimals": 18, + "token_contract": "0x4200000000000000000000000000000000000042", + "coingecko_id": "optimism", + "recommended_symbol": "OP" + } + ] + }, + "56": { + "assets": [ + { + "denom": "0x43a8cab15D06d3a5fE5854D714C37E7E9246F170", + "chain_id": "56", + "origin_denom": "0x43a8cab15D06d3a5fE5854D714C37E7E9246F170", + "origin_chain_id": "56", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "ORBS", + "name": "Orbs", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/orbs.svg", + "decimals": 18, + "token_contract": "0x43a8cab15D06d3a5fE5854D714C37E7E9246F170", + "coingecko_id": "orbs", + "recommended_symbol": "ORBS" + }, + { + "denom": "0x7C8DbFdB185C088E73999770C93b885295805739", + "chain_id": "56", + "origin_denom": "0x7C8DbFdB185C088E73999770C93b885295805739", + "origin_chain_id": "56", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "MOON", + "name": "Moonflow", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/moon.svg", + "decimals": 18, + "token_contract": "0x7C8DbFdB185C088E73999770C93b885295805739", + "recommended_symbol": "MOON" + }, + { + "denom": "0xF700D4c708C2be1463E355F337603183D20E0808", + "chain_id": "56", + "origin_denom": "0xF700D4c708C2be1463E355F337603183D20E0808", + "origin_chain_id": "56", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "GQ", + "name": "Galactic Quadrant", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/gq.svg", + "decimals": 18, + "token_contract": "0xF700D4c708C2be1463E355F337603183D20E0808", + "recommended_symbol": "GQ" + } + ] + }, + "137": { + "assets": [ + { + "denom": "0x1ED2B2b097E92B2Fe95a172dd29840c71294F1d6", + "chain_id": "137", + "origin_denom": "0x1ED2B2b097E92B2Fe95a172dd29840c71294F1d6", + "origin_chain_id": "137", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "sFRAX", + "name": "Staked FRAX", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/sfrax.svg", + "decimals": 18, + "token_contract": "0x1ED2B2b097E92B2Fe95a172dd29840c71294F1d6", + "recommended_symbol": "sFRAX" + }, + { + "denom": "0x779661872e9C891027099C9E3fd101DCc8B96433", + "chain_id": "137", + "origin_denom": "0x779661872e9C891027099C9E3fd101DCc8B96433", + "origin_chain_id": "137", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "axlWBTC", + "name": "Axelar Wrapped WBTC", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/wbtc.svg", + "decimals": 8, + "token_contract": "0x779661872e9C891027099C9E3fd101DCc8B96433", + "coingecko_id": "wrapped-bitcoin", + "recommended_symbol": "WBTC.axl" + }, + { + "denom": "0x0294D8eB7857D43FEb1210Db72456d41481f9Ede", + "chain_id": "137", + "origin_denom": "0x0294D8eB7857D43FEb1210Db72456d41481f9Ede", + "origin_chain_id": "137", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "axlLqdr", + "name": "Axelar Wrapped Lqdr", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/lqdr.svg", + "decimals": 18, + "token_contract": "0x0294D8eB7857D43FEb1210Db72456d41481f9Ede", + "coingecko_id": "liquiddriver", + "recommended_symbol": "Lqdr.axl" + } + ] + }, + "169": { + "assets": [ + { + "denom": "0x6Fae4D9935E2fcb11fC79a64e917fb2BF14DaFaa", + "chain_id": "169", + "origin_denom": "0x6Fae4D9935E2fcb11fC79a64e917fb2BF14DaFaa", + "origin_chain_id": "169", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "TIA.n", + "name": "TIA.n", + "logo_uri": "https://raw.githubusercontent.com/cosmos/chain-registry/master/celestia/images/celestia.png", + "decimals": 6, + "token_contract": "0x6Fae4D9935E2fcb11fC79a64e917fb2BF14DaFaa", + "coingecko_id": "bridged-tia-hyperlane", + "recommended_symbol": "TIA.n" + } + ] + }, + "250": { + "assets": [ + { + "denom": "0x3bB68cb55Fc9C22511467c18E42D14E8c959c4dA", + "chain_id": "250", + "origin_denom": "0x3bB68cb55Fc9C22511467c18E42D14E8c959c4dA", + "origin_chain_id": "250", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "axlATOM", + "name": "Axelar Wrapped ATOM", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/atom.svg", + "decimals": 6, + "token_contract": "0x3bB68cb55Fc9C22511467c18E42D14E8c959c4dA", + "coingecko_id": "cosmos", + "recommended_symbol": "ATOM.axl" + }, + { + "denom": "0x11eDFA12d70e8AC9e94DE019eBa278430873f8C3", + "chain_id": "250", + "origin_denom": "0x11eDFA12d70e8AC9e94DE019eBa278430873f8C3", + "origin_chain_id": "250", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "TORI", + "name": "Teritori", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/tori.svg", + "decimals": 6, + "token_contract": "0x11eDFA12d70e8AC9e94DE019eBa278430873f8C3", + "recommended_symbol": "TORI" + }, + { + "denom": "0x05E7857Cb748F0018C0CBCe3dfd575B0d8677aeF", + "chain_id": "250", + "origin_denom": "0x05E7857Cb748F0018C0CBCe3dfd575B0d8677aeF", + "origin_chain_id": "250", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "FXS", + "name": "Frax Share", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/fxs.svg", + "decimals": 18, + "token_contract": "0x05E7857Cb748F0018C0CBCe3dfd575B0d8677aeF", + "recommended_symbol": "FXS" + } + ] + }, + "314": { + "assets": [ + { + "denom": "0xEB466342C4d449BC9f53A865D5Cb90586f405215", + "chain_id": "314", + "origin_denom": "0xEB466342C4d449BC9f53A865D5Cb90586f405215", + "origin_chain_id": "314", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "axlUSDC", + "name": "Axelar Wrapped USDC", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/usdc.svg", + "decimals": 6, + "token_contract": "0xEB466342C4d449BC9f53A865D5Cb90586f405215", + "coingecko_id": "usd-coin", + "recommended_symbol": "USDC.axl" + }, + { + "denom": "0x4AA81D7AB59C775fe6F9F45E6941A0FB8cD692a6", + "chain_id": "314", + "origin_denom": "0x4AA81D7AB59C775fe6F9F45E6941A0FB8cD692a6", + "origin_chain_id": "314", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "milkTIA", + "name": "milkTIA", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/milktia.svg", + "decimals": 6, + "token_contract": "0x4AA81D7AB59C775fe6F9F45E6941A0FB8cD692a6", + "coingecko_id": "milkyway-staked-tia", + "recommended_symbol": "milkTIA" + }, + { + "denom": "filecoin-native", + "chain_id": "314", + "origin_denom": "filecoin-native", + "origin_chain_id": "314", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "FIL", + "name": "FIL", + "logo_uri": "https://assets.coingecko.com/coins/images/12817/standard/filecoin.png?1696512609", + "decimals": 18, + "coingecko_id": "filecoin", + "recommended_symbol": "FIL" + } + ] + }, + "1284": { + "assets": [ + { + "denom": "0x151904806a266EEe52700E195D2937891fb8eD59", + "chain_id": "1284", + "origin_denom": "0x151904806a266EEe52700E195D2937891fb8eD59", + "origin_chain_id": "1284", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "FXS", + "name": "Frax Share", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/fxs.svg", + "decimals": 18, + "token_contract": "0x151904806a266EEe52700E195D2937891fb8eD59", + "recommended_symbol": "FXS" + }, + { + "denom": "0x5Ac3aD1acC0A3EFd6fB89791967656128e86d8C5", + "chain_id": "1284", + "origin_denom": "0x5Ac3aD1acC0A3EFd6fB89791967656128e86d8C5", + "origin_chain_id": "1284", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "axlKNC", + "name": "Axelar Wrapped KNC", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/knc.svg", + "decimals": 18, + "token_contract": "0x5Ac3aD1acC0A3EFd6fB89791967656128e86d8C5", + "coingecko_id": "kyber-network-crystal", + "recommended_symbol": "KNC.axl" + }, + { + "denom": "0xF2605EaB29c67d06E71372CA9dfA8aDfd2d34BbF", + "chain_id": "1284", + "origin_denom": "0xF2605EaB29c67d06E71372CA9dfA8aDfd2d34BbF", + "origin_chain_id": "1284", + "trace": "", + "is_cw20": false, + "is_evm": true, + "is_svm": false, + "symbol": "axlSTARS", + "name": "Axelar Wrapped STARS", + "logo_uri": "https://raw.githubusercontent.com/axelarnetwork/axelar-configs/main/images/tokens/stars.svg", + "decimals": 6, + "token_contract": "0xF2605EaB29c67d06E71372CA9dfA8aDfd2d34BbF", + "coingecko_id": "stargaze", + "recommended_symbol": "STARS.axl" + } + ] + } + } +} + + """.trimMargin() +} diff --git a/v4_abacus.podspec b/v4_abacus.podspec index 316ebe75f..f67033cc1 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.46' + spec.version = '1.7.47' spec.homepage = 'https://github.com/dydxprotocol/v4-abacus' spec.source = { :http=> ''} spec.authors = ''