diff --git a/.github/workflows/SpotlessCheck.yml b/.github/workflows/SpotlessCheck.yml new file mode 100644 index 000000000..09aece018 --- /dev/null +++ b/.github/workflows/SpotlessCheck.yml @@ -0,0 +1,24 @@ +name: SpotlessCheck + +on: + pull_request: + paths: + - '**/*.kt' + +jobs: + spotlessCheck: + runs-on: macos-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + + - name: Lint Kotlin Files + run: | + ./gradlew spotlessCheck diff --git a/build.gradle.kts b/build.gradle.kts index 4273b6a65..8bd75913f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -48,7 +48,7 @@ allprojects { } group = "exchange.dydx.abacus" -version = "1.6.35" +version = "1.6.36" repositories { google() diff --git a/integration/iOS/Podfile.lock b/integration/iOS/Podfile.lock index a6f7cbf67..be8f54a9f 100644 --- a/integration/iOS/Podfile.lock +++ b/integration/iOS/Podfile.lock @@ -15,9 +15,9 @@ EXTERNAL SOURCES: :path: "~/v4-abacus" SPEC CHECKSUMS: - abacus: a57d55b0ca0d3514389573a87c47507f88eb6b0a + abacus: 46f62be6dc9b3f888093eb2c9952d0267ab40670 CryptoSwift: 562f8eceb40e80796fffc668b0cad9313284cfa6 PODFILE CHECKSUM: 37d72c15b180e62a4c42b8fb41b4836c89aa63c9 -COCOAPODS: 1.12.1 +COCOAPODS: 1.15.2 diff --git a/integration/iOS/Pods/Local Podspecs/abacus.podspec.json b/integration/iOS/Pods/Local Podspecs/abacus.podspec.json index 19df5e4ce..33e8c60d2 100644 --- a/integration/iOS/Pods/Local Podspecs/abacus.podspec.json +++ b/integration/iOS/Pods/Local Podspecs/abacus.podspec.json @@ -26,6 +26,7 @@ "osx": null, "ios": null, "tvos": null, + "visionos": null, "watchos": null } } diff --git a/integration/iOS/Pods/Manifest.lock b/integration/iOS/Pods/Manifest.lock index a6f7cbf67..be8f54a9f 100644 --- a/integration/iOS/Pods/Manifest.lock +++ b/integration/iOS/Pods/Manifest.lock @@ -15,9 +15,9 @@ EXTERNAL SOURCES: :path: "~/v4-abacus" SPEC CHECKSUMS: - abacus: a57d55b0ca0d3514389573a87c47507f88eb6b0a + abacus: 46f62be6dc9b3f888093eb2c9952d0267ab40670 CryptoSwift: 562f8eceb40e80796fffc668b0cad9313284cfa6 PODFILE CHECKSUM: 37d72c15b180e62a4c42b8fb41b4836c89aa63c9 -COCOAPODS: 1.12.1 +COCOAPODS: 1.15.2 diff --git a/integration/iOS/Pods/Pods.xcodeproj/project.pbxproj b/integration/iOS/Pods/Pods.xcodeproj/project.pbxproj index df631aa42..4939537ed 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,6 +143,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 174DE097054DE7A0410C57AF4AEF5A1A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 469F25E790D19440507BF938A40578A7; + remoteInfo = "Pods-abacus.ios"; + }; 8437FCB39ECA4A44D93FCDCBF6066E92 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; @@ -156,13 +164,6 @@ remoteGlobalIDString = 4084846DAF1774840D25DF1BF2460325; remoteInfo = abacus; }; - F99C8B5A9E9146040BECE7ABFD8E196E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 469F25E790D19440507BF938A40578A7; - remoteInfo = "Pods-abacus.ios"; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -187,7 +188,6 @@ 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 = ""; }; 1DE302C0F83772A905581CC7090CA123 /* Collection+Extension.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Collection+Extension.swift"; path = "Sources/CryptoSwift/Collection+Extension.swift"; sourceTree = ""; }; - 1E1F36967D766BC17B1215E06682912E /* abacus.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = abacus.release.xcconfig; sourceTree = ""; }; 1E34A6EC8D702D85DFC8AB0BCA04D225 /* Pods-abacus.iosTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-abacus.iosTests-acknowledgements.markdown"; sourceTree = ""; }; 233CC871C3B5E5D1C643AA3F5362558A /* DigestType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DigestType.swift; path = Sources/CryptoSwift/DigestType.swift; sourceTree = ""; }; 236DF73D92D4D71C82089CF882764244 /* NoPadding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NoPadding.swift; path = Sources/CryptoSwift/NoPadding.swift; sourceTree = ""; }; @@ -202,6 +202,7 @@ 37E3B9DB40B26E67EACDE716904859D9 /* OFB.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = OFB.swift; path = Sources/CryptoSwift/BlockMode/OFB.swift; sourceTree = ""; }; 37E6750B2D87EBA042E7B6C17E6D6CC6 /* Data+Extension.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Data+Extension.swift"; path = "Sources/CryptoSwift/Foundation/Data+Extension.swift"; sourceTree = ""; }; 38422D3128360E50B8D6715E1F390E08 /* Division.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Division.swift; path = Sources/CryptoSwift/CS_BigInt/Division.swift; sourceTree = ""; }; + 3B9814D8EB9409314A6ECBBAE173E4AE /* abacus.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = abacus.release.xcconfig; sourceTree = ""; }; 3C1FCD96FB6C948BA9ACE2A4FDB3A3A6 /* Exponentiation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Exponentiation.swift; path = Sources/CryptoSwift/CS_BigInt/Exponentiation.swift; sourceTree = ""; }; 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 = ""; }; @@ -217,7 +218,6 @@ 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 = ""; }; 5B30BDDC9AD9C2380BF6791299AE1FBE /* Subtraction.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Subtraction.swift; path = Sources/CryptoSwift/CS_BigInt/Subtraction.swift; sourceTree = ""; }; - 5B4434D04B297F5AA300030644FC6AED /* abacus.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = abacus.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 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 = ""; }; 64F91D24D56FF58C2F34255BCC0CA8D2 /* Strideable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Strideable.swift; path = Sources/CryptoSwift/CS_BigInt/Strideable.swift; sourceTree = ""; }; @@ -229,15 +229,15 @@ 70AEA7453A63A13648C04F8DBDA947E8 /* Pods-abacus.iosTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-abacus.iosTests-dummy.m"; sourceTree = ""; }; 72ED5A3746B04AD8516BAA07DEB0AFFB /* Rabbit.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Rabbit.swift; path = Sources/CryptoSwift/Rabbit.swift; sourceTree = ""; }; 73010CC983E3809BECEE5348DA1BB8C6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 7387438C7495F77B43770D7B6FC19DEA /* abacus.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = abacus.debug.xcconfig; sourceTree = ""; }; - 741487B600AA498D6CA5F665C3E8FB41 /* Abacus.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Abacus.framework; path = build/cocoapods/framework/Abacus.framework; sourceTree = ""; }; 75EBB1F2A3091B11F34E2303C5FF61FF /* Integer Conversion.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Integer Conversion.swift"; path = "Sources/CryptoSwift/CS_BigInt/Integer Conversion.swift"; sourceTree = ""; }; 770402A5FA60DB3BB6604065DEAF7112 /* Updatable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Updatable.swift; path = Sources/CryptoSwift/Updatable.swift; sourceTree = ""; }; 77C0EE24E7443418813C133F648727B2 /* BigInt.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BigInt.swift; path = Sources/CryptoSwift/CS_BigInt/BigInt.swift; sourceTree = ""; }; 78AB32080590FEF8DC83D622EA15A854 /* RSA+Signature.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "RSA+Signature.swift"; path = "Sources/CryptoSwift/RSA/RSA+Signature.swift"; sourceTree = ""; }; 7996373D44C9A5554EA9135984BC01DB /* Pods-abacus.iosTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-abacus.iosTests.release.xcconfig"; sourceTree = ""; }; + 7DDE94C33DA441C757D1443A9E6029D8 /* abacus.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = abacus.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 80BE961EA000C9CB92BFA1E9F5768324 /* String+FoundationExtension.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "String+FoundationExtension.swift"; path = "Sources/CryptoSwift/Foundation/String+FoundationExtension.swift"; sourceTree = ""; }; 80CCC2677D931811101207B70F1D6228 /* Utils+Foundation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Utils+Foundation.swift"; path = "Sources/CryptoSwift/Foundation/Utils+Foundation.swift"; sourceTree = ""; }; + 8185A52ED7B207F675CF2934EC63EA6D /* abacus.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = abacus.debug.xcconfig; sourceTree = ""; }; 82E21560551522E26DA29FC2711C8B79 /* UInt64+Extension.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UInt64+Extension.swift"; path = "Sources/CryptoSwift/UInt64+Extension.swift"; sourceTree = ""; }; 8401ED14FF39BBF39217A88493885CA8 /* BlockDecryptor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BlockDecryptor.swift; path = Sources/CryptoSwift/BlockDecryptor.swift; sourceTree = ""; }; 8829F5E52FB40D40BE9F6752C2C053EE /* Pods-abacus.ios-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-abacus.ios-umbrella.h"; sourceTree = ""; }; @@ -274,6 +274,7 @@ BE661C419D51DFFFB6B607BA7129ACE8 /* AEADChaCha20Poly1305.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AEADChaCha20Poly1305.swift; path = Sources/CryptoSwift/AEAD/AEADChaCha20Poly1305.swift; sourceTree = ""; }; BEB92CA3382C315CBB298FD2AED86DAA /* CryptoSwift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = CryptoSwift.modulemap; sourceTree = ""; }; C092A9F126768AFC3252AC09865ADD00 /* UInt128.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = UInt128.swift; path = Sources/CryptoSwift/UInt128.swift; sourceTree = ""; }; + C14B99ACD1414B162CCDFC4980F61545 /* Abacus.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Abacus.framework; path = build/cocoapods/framework/Abacus.framework; sourceTree = ""; }; C2FEF290DD729D9EEDDCCFA0F8D26A2D /* ISO10126Padding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ISO10126Padding.swift; path = Sources/CryptoSwift/ISO10126Padding.swift; sourceTree = ""; }; C38A4324A470C5585A01FF30D07C9DF4 /* Data Conversion.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Data Conversion.swift"; path = "Sources/CryptoSwift/CS_BigInt/Data Conversion.swift"; sourceTree = ""; }; C3D50E92BF2CBF4A9B65921871BDF2FF /* ASN1Scanner.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ASN1Scanner.swift; path = Sources/CryptoSwift/ASN1/ASN1Scanner.swift; sourceTree = ""; }; @@ -309,6 +310,7 @@ F3BBCD0680550B4404763E23B515A31F /* OCB.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = OCB.swift; path = Sources/CryptoSwift/BlockMode/OCB.swift; sourceTree = ""; }; F702C9EC7CE0BC75E37AA56B71F7E614 /* AES.Cryptors.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AES.Cryptors.swift; path = Sources/CryptoSwift/AES.Cryptors.swift; sourceTree = ""; }; F81274EDB681F11E7CB05F7DCA2BB33C /* CryptoSwift */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = CryptoSwift; path = CryptoSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FEB3D1B3294D15FB6DBA2952BAE81186 /* abacus-copy-dsyms.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "abacus-copy-dsyms.sh"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -339,25 +341,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 11D79B65BBCD0960017163F4C9B7E49A /* abacus */ = { - isa = PBXGroup; - children = ( - FED2887D0E5091C4759D8D8ADFF59C66 /* Frameworks */, - 8C61F33543ADD6CAD21A0CF0AA823AAF /* Pod */, - 6B380C499C1E361C8E35461210459B6B /* Support Files */, - ); - name = abacus; - path = "/Users/zhenqianhe/v4-abacus"; - sourceTree = ""; - }; - 28A0B44B5E70F779B3A567F1AE82D8B7 /* Development Pods */ = { - isa = PBXGroup; - children = ( - 11D79B65BBCD0960017163F4C9B7E49A /* abacus */, - ); - name = "Development Pods"; - sourceTree = ""; - }; 578452D2E740E91742655AC8F1636D1F /* iOS */ = { isa = PBXGroup; children = ( @@ -366,14 +349,12 @@ name = iOS; sourceTree = ""; }; - 6B380C499C1E361C8E35461210459B6B /* Support Files */ = { + 739C485E60C1DDFC7A3EBC06D0A3072C /* Pod */ = { isa = PBXGroup; children = ( - 7387438C7495F77B43770D7B6FC19DEA /* abacus.debug.xcconfig */, - 1E1F36967D766BC17B1215E06682912E /* abacus.release.xcconfig */, + 7DDE94C33DA441C757D1443A9E6029D8 /* abacus.podspec */, ); - name = "Support Files"; - path = "integration/iOS/Pods/Target Support Files/abacus"; + name = Pod; sourceTree = ""; }; 77BFA6027665EBACC42B94A7C2372871 /* Pods-abacus.iosTests */ = { @@ -392,6 +373,17 @@ path = "Target Support Files/Pods-abacus.iosTests"; sourceTree = ""; }; + 7CA89820B7C615522A1E103AFE897113 /* Support Files */ = { + isa = PBXGroup; + children = ( + FEB3D1B3294D15FB6DBA2952BAE81186 /* abacus-copy-dsyms.sh */, + 8185A52ED7B207F675CF2934EC63EA6D /* abacus.debug.xcconfig */, + 3B9814D8EB9409314A6ECBBAE173E4AE /* abacus.release.xcconfig */, + ); + name = "Support Files"; + path = "integration/iOS/Pods/Target Support Files/abacus"; + sourceTree = ""; + }; 7D94CDF401128D689D2B11EDCC7ECD3A /* Products */ = { isa = PBXGroup; children = ( @@ -402,12 +394,12 @@ name = Products; sourceTree = ""; }; - 8C61F33543ADD6CAD21A0CF0AA823AAF /* Pod */ = { + 90A2ECA4CB85E9B524F94B07F44602BA /* Development Pods */ = { isa = PBXGroup; children = ( - 5B4434D04B297F5AA300030644FC6AED /* abacus.podspec */, + D9B301EFE4BB95FFB9601DF90BE5310C /* abacus */, ); - name = Pod; + name = "Development Pods"; sourceTree = ""; }; 915C28C583640C124E56AE6BB9F0DAB2 /* CryptoSwift */ = { @@ -529,6 +521,14 @@ path = CryptoSwift; sourceTree = ""; }; + AAA3C44113D6B89851396A22AFA71EC6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + C14B99ACD1414B162CCDFC4980F61545 /* Abacus.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; B284BBC13E1216FA4484D74F45F3F36F /* Pods-abacus.ios */ = { isa = PBXGroup; children = ( @@ -559,7 +559,7 @@ isa = PBXGroup; children = ( 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, - 28A0B44B5E70F779B3A567F1AE82D8B7 /* Development Pods */, + 90A2ECA4CB85E9B524F94B07F44602BA /* Development Pods */, D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */, DA389CCA0C382AECE0DD24ED555B7245 /* Pods */, 7D94CDF401128D689D2B11EDCC7ECD3A /* Products */, @@ -575,6 +575,17 @@ name = Frameworks; sourceTree = ""; }; + D9B301EFE4BB95FFB9601DF90BE5310C /* abacus */ = { + isa = PBXGroup; + children = ( + AAA3C44113D6B89851396A22AFA71EC6 /* Frameworks */, + 739C485E60C1DDFC7A3EBC06D0A3072C /* Pod */, + 7CA89820B7C615522A1E103AFE897113 /* Support Files */, + ); + name = abacus; + path = "/Users/ruihuang/v4-abacus"; + sourceTree = ""; + }; DA389CCA0C382AECE0DD24ED555B7245 /* Pods */ = { isa = PBXGroup; children = ( @@ -598,14 +609,6 @@ path = "../Target Support Files/CryptoSwift"; sourceTree = ""; }; - FED2887D0E5091C4759D8D8ADFF59C66 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 741487B600AA498D6CA5F665C3E8FB41 /* Abacus.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -668,7 +671,7 @@ buildRules = ( ); dependencies = ( - AC2EBD83354400DAA47E7F9069901F4A /* PBXTargetDependency */, + 1F67D19EAC36A41088EB458D7432B293 /* PBXTargetDependency */, ); name = "Pods-abacus.iosTests"; productName = Pods_abacus_iosTests; @@ -699,8 +702,8 @@ BFDFE7DC352907FC980B868725387E98 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1300; - LastUpgradeCheck = 1300; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; }; buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 13.0"; @@ -748,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 = ( @@ -898,11 +918,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - AC2EBD83354400DAA47E7F9069901F4A /* PBXTargetDependency */ = { + 1F67D19EAC36A41088EB458D7432B293 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "Pods-abacus.ios"; target = 469F25E790D19440507BF938A40578A7 /* Pods-abacus.ios */; - targetProxy = F99C8B5A9E9146040BECE7ABFD8E196E /* PBXContainerItemProxy */; + targetProxy = 174DE097054DE7A0410C57AF4AEF5A1A /* PBXContainerItemProxy */; }; CF848ADCA9D462971E67CA041BBB55DD /* PBXTargetDependency */ = { isa = PBXTargetDependency; @@ -956,23 +976,6 @@ }; name = Debug; }; - 22B0388248EDA44270493DDECC58CF78 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 1E1F36967D766BC17B1215E06682912E /* 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 */; @@ -1046,22 +1049,6 @@ }; name = Debug; }; - 5B331F72A7F4402311EBC4A06282E60D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7387438C7495F77B43770D7B6FC19DEA /* 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 */; @@ -1228,6 +1215,39 @@ }; name = Debug; }; + 96B05028328C5704FCE6A41A515364C0 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8185A52ED7B207F675CF2934EC63EA6D /* 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 = 3B9814D8EB9409314A6ECBBAE173E4AE /* 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 */; @@ -1304,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/CryptoSwift/CryptoSwift.debug.xcconfig b/integration/iOS/Pods/Target Support Files/CryptoSwift/CryptoSwift.debug.xcconfig index 35a7ac658..c306fb0b0 100644 --- a/integration/iOS/Pods/Target Support Files/CryptoSwift/CryptoSwift.debug.xcconfig +++ b/integration/iOS/Pods/Target Support Files/CryptoSwift/CryptoSwift.debug.xcconfig @@ -1,7 +1,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift +LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 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/CryptoSwift/CryptoSwift.release.xcconfig b/integration/iOS/Pods/Target Support Files/CryptoSwift/CryptoSwift.release.xcconfig index 35a7ac658..c306fb0b0 100644 --- a/integration/iOS/Pods/Target Support Files/CryptoSwift/CryptoSwift.release.xcconfig +++ b/integration/iOS/Pods/Target Support Files/CryptoSwift/CryptoSwift.release.xcconfig @@ -1,7 +1,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift +LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 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-frameworks.sh b/integration/iOS/Pods/Target Support Files/Pods-abacus.ios/Pods-abacus.ios-frameworks.sh index f3fa5fd5a..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 @@ -18,7 +18,7 @@ echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" -SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +SWIFT_STDLIB_PATH="${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" BCSYMBOLMAP_DIR="BCSymbolMaps" 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 3340eaffa..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 @@ -4,7 +4,7 @@ FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwi 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) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift +LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift OTHER_LDFLAGS = $(inherited) -l"c++" -framework "Abacus" -framework "CryptoSwift" OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS PODS_BUILD_DIR = ${BUILD_DIR} 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 3340eaffa..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 @@ -4,7 +4,7 @@ FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwi 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) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift +LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift OTHER_LDFLAGS = $(inherited) -l"c++" -framework "Abacus" -framework "CryptoSwift" OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS PODS_BUILD_DIR = ${BUILD_DIR} diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/calculator/AccountCalculator.kt b/src/commonMain/kotlin/exchange.dydx.abacus/calculator/AccountCalculator.kt index ba971e710..baa96c463 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/calculator/AccountCalculator.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/calculator/AccountCalculator.kt @@ -219,11 +219,14 @@ class AccountCalculator(val parser: ParserProtocol, private val useParentSubacco // Just in case it has more than one market, we will create // two separate pending positions. - val mergedOrders = ParsingHelper.merge(parser.asNativeMap( - parser.value(parentSubaccount, "orders"), - ), parser.asNativeMap( - parser.value(childSubaccount, "orders"), - )) + val mergedOrders = ParsingHelper.merge( + parser.asNativeMap( + parser.value(parentSubaccount, "orders"), + ), + parser.asNativeMap( + parser.value(childSubaccount, "orders"), + ), + ) val modifiedParentSubaccount = parentSubaccount.toMutableMap() modifiedParentSubaccount.safeSet( diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/calculator/TriggerOrdersInputCalculator.kt b/src/commonMain/kotlin/exchange.dydx.abacus/calculator/TriggerOrdersInputCalculator.kt index f1f834991..b4b5c0470 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/calculator/TriggerOrdersInputCalculator.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/calculator/TriggerOrdersInputCalculator.kt @@ -102,7 +102,7 @@ internal class TriggerOrdersInputCalculator(val parser: ParserProtocol) { if (entryPrice != null) { val triggerPrice = parser.asDouble(parser.value(modified, "triggerPrice")) val usdcDiff = parser.asDouble(parser.value(modified, "usdcDiff")) - val percentDiff = parser.asDouble(parser.value(modified, "percentDiff")) + val percentDiff = parser.asDouble(parser.value(modified, "percentDiff"))?.let { it / 100.0 } when (inputType) { "stopLossOrder.price.triggerPrice" -> { @@ -118,8 +118,8 @@ internal class TriggerOrdersInputCalculator(val parser: ParserProtocol) { modified.safeSet( "percentDiff", when (positionSide) { - "long" -> leverage.times(size.times(entryPrice.minus(triggerPrice))).div(notionalTotal) - "short" -> leverage.times(size.times(triggerPrice.minus(entryPrice))).div(notionalTotal) + "long" -> leverage.times(size.times(entryPrice.minus(triggerPrice))).div(notionalTotal).times(100) + "short" -> leverage.times(size.times(triggerPrice.minus(entryPrice))).div(notionalTotal).times(100) else -> null }, ) @@ -138,8 +138,8 @@ internal class TriggerOrdersInputCalculator(val parser: ParserProtocol) { modified.safeSet( "percentDiff", when (positionSide) { - "long" -> leverage.times(size.times(triggerPrice.minus(entryPrice))).div(notionalTotal) - "short" -> leverage.times(size.times(entryPrice.minus(triggerPrice))).div(notionalTotal) + "long" -> leverage.times(size.times(triggerPrice.minus(entryPrice))).div(notionalTotal).times(100) + "short" -> leverage.times(size.times(entryPrice.minus(triggerPrice))).div(notionalTotal).times(100) else -> null }, ) @@ -157,7 +157,7 @@ internal class TriggerOrdersInputCalculator(val parser: ParserProtocol) { ) modified.safeSet( "percentDiff", - leverage.times(usdcDiff).div(notionalTotal), + leverage.times(usdcDiff).div(notionalTotal).times(100), ) } } @@ -173,7 +173,7 @@ internal class TriggerOrdersInputCalculator(val parser: ParserProtocol) { ) modified.safeSet( "percentDiff", - leverage.times(usdcDiff).div(notionalTotal), + leverage.times(usdcDiff).div(notionalTotal).times(100), ) } } diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/output/Account.kt b/src/commonMain/kotlin/exchange.dydx.abacus/output/Account.kt index be758877d..24b76c5b3 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/output/Account.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/output/Account.kt @@ -659,7 +659,7 @@ data class SubaccountOrder( Logger.d { "creating Account Order\n" } data?.let { // TODO: Remove default to 0 for subaccountNumber once new indexer response is consumed. Prevents breaking change - val subaccountNumber = parser.asInt(data["subaccountNumber"])?: 0 + val subaccountNumber = parser.asInt(data["subaccountNumber"]) ?: 0 val id = parser.asString(data["id"]) val clientId = parser.asInt(data["clientId"]) val marketId = parser.asString(data["marketId"]) 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 b4a2848f2..bf2e3382a 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt @@ -1,6 +1,13 @@ package exchange.dydx.abacus.state.manager -import exchange.dydx.abacus.output.* +import exchange.dydx.abacus.output.Compliance +import exchange.dydx.abacus.output.ComplianceStatus +import exchange.dydx.abacus.output.Notification +import exchange.dydx.abacus.output.PerpetualState +import exchange.dydx.abacus.output.Restriction +import exchange.dydx.abacus.output.SubaccountOrder +import exchange.dydx.abacus.output.TransferRecordType +import exchange.dydx.abacus.output.UsageRestriction import exchange.dydx.abacus.output.input.OrderType import exchange.dydx.abacus.output.input.TradeInputGoodUntil import exchange.dydx.abacus.output.input.TriggerOrder @@ -1965,9 +1972,13 @@ open class StateManagerAdaptor( val currentHeight = calculateCurrentHeight() val goodTilBlock = - if (isShortTermOrder(trade.type.rawValue, trade.timeInForce)) currentHeight?.plus( - SHORT_TERM_ORDER_DURATION - ) else null + if (isShortTermOrder(trade.type.rawValue, trade.timeInForce)) { + currentHeight?.plus( + SHORT_TERM_ORDER_DURATION, + ) + } else { + null + } return HumanReadablePlaceOrderPayload( subaccountNumber, @@ -2034,7 +2045,7 @@ open class StateManagerAdaptor( timeInForce, execution, goodTilTimeInSeconds, - goodTilBlock + goodTilBlock, ) } @@ -2387,10 +2398,8 @@ open class StateManagerAdaptor( } open fun complianceCheck() { - } - open fun complianceScreen(address: String) { val url = complianceScreenUrl(address) if (url != null) { 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 81571e2c2..e1baf727d 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt @@ -1,7 +1,6 @@ package exchange.dydx.abacus.state.manager import exchange.dydx.abacus.output.UsageRestriction -import exchange.dydx.abacus.output.input.OrderTimeInForce import exchange.dydx.abacus.output.input.TransferType import exchange.dydx.abacus.protocols.AnalyticsEvent import exchange.dydx.abacus.protocols.DataNotificationProtocol @@ -150,9 +149,6 @@ class V4StateManagerAdaptor( } } - @Suppress("PropertyName") - private val MAX_NUM_BLOCK_DELAY = 15 - private var lastValidatorCallTime: Instant? = null override fun didSetSocketConnected(socketConnected: Boolean) { @@ -991,7 +987,7 @@ class V4StateManagerAdaptor( transactionType, transactionPayloadString, transactionCallback, - onSubmitTransaction + onSubmitTransaction, ), ) } else { @@ -1022,8 +1018,8 @@ class V4StateManagerAdaptor( PlaceOrderRecord( subaccountNumber, clientId, - submitTimeMs - ) + submitTimeMs, + ), ) } }, @@ -1042,10 +1038,14 @@ class V4StateManagerAdaptor( send( error, callback, - if (isTriggerOrder) HumanReadableTriggerOrdersPayload( - listOf(payload), - emptyList(), - ) else payload + if (isTriggerOrder) { + HumanReadableTriggerOrdersPayload( + listOf(payload), + emptyList(), + ) + } else { + payload + }, ) }, useTransactionQueue = !isShortTermOrder(payload.type, payload.timeInForce), @@ -1099,10 +1099,14 @@ class V4StateManagerAdaptor( send( error, callback, - if (isTriggerOrder) HumanReadableTriggerOrdersPayload( - emptyList(), - listOf(payload), - ) else payload + if (isTriggerOrder) { + HumanReadableTriggerOrdersPayload( + emptyList(), + listOf(payload), + ) + } else { + payload + }, ) }, useTransactionQueue = !isShortTermOrder, @@ -1116,7 +1120,7 @@ class V4StateManagerAdaptor( val uiClickTimeMs = Clock.System.now().toEpochMilliseconds().toDouble() tracking( if (isCancel) AnalyticsEvent.TradeCancelOrderClick.rawValue else AnalyticsEvent.TradePlaceOrderClick.rawValue, - analyticsPayload + analyticsPayload, ) return uiClickTimeMs } @@ -1186,7 +1190,7 @@ class V4StateManagerAdaptor( val analyticsPayload = analyticsUtils.formatPlaceOrderPayload( it, isClosePosition = false, - fromSlTpDialog = true + fromSlTpDialog = true, ) submitPlaceOrder(callback, it, analyticsPayload, true) } @@ -1632,4 +1636,9 @@ class V4StateManagerAdaptor( accountBalancesTimer?.cancel() accountBalancesTimer = null } + + companion object { + @Suppress("PropertyName") + private const val MAX_NUM_BLOCK_DELAY = 15 + } } diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/utils/Settings.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/utils/Settings.kt index e7b7f2642..1744f02c9 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/utils/Settings.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/utils/Settings.kt @@ -5,9 +5,9 @@ import kotlinx.serialization.Serializable @JsExport class AppConfigs( - val subscribeToCandles: Boolean, - val loadRemote: Boolean = true, - val enableLogger: Boolean = false, + var subscribeToCandles: Boolean, + var loadRemote: Boolean = true, + var enableLogger: Boolean = false, ) { enum class SquidVersion { V1, diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/Configs.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/Configs.kt index a0f211d2d..97d6f56e5 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/Configs.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/Configs.kt @@ -187,9 +187,9 @@ class AppConfigsV2( val systemConfigs: SystemConfigs, val marketConfigs: MarketsConfigs, val accountConfigs: AccountConfigs, - val onboardingConfigs: OnboardingConfigs, - val loadRemote: Boolean = true, - val enableLogger: Boolean = false, + var onboardingConfigs: OnboardingConfigs, + var loadRemote: Boolean = true, + var enableLogger: Boolean = false, ) { companion object { val forApp = AppConfigsV2( diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt index 93e40db08..ec111e6a0 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt @@ -509,7 +509,7 @@ internal class SubaccountSupervisor( transactionType, transactionPayloadString, transactionCallback, - onSubmitTransaction + onSubmitTransaction, ), ) } else { @@ -553,7 +553,7 @@ internal class SubaccountSupervisor( subaccountNumber, clientId, submitTimeMs, - ) + ), ) } } @@ -572,14 +572,17 @@ internal class SubaccountSupervisor( helper.send( error, callback, - if (isTriggerOrder) HumanReadableTriggerOrdersPayload( - listOf(payload), - emptyList(), - ) else payload + if (isTriggerOrder) { + HumanReadableTriggerOrdersPayload( + listOf(payload), + emptyList(), + ) + } else { + payload + }, ) } - // If the transfer is successful, place the order val isolatedMarginTransactionCallback = { response: String? -> val error = parseTransactionResponse(response) @@ -596,27 +599,26 @@ internal class SubaccountSupervisor( } } - stopWatchingLastOrder() - if (transferPayloadString != null) { - // isolated margin order - submitTransaction( - TransactionType.SubaccountTransfer, - transferPayloadString, - null, - isolatedMarginTransactionCallback, - useTransactionQueue, - ) - } else { - submitTransaction( - TransactionType.PlaceOrder, - string, - onSubmitOrderTransaction, - orderTransactionCallback, - useTransactionQueue, - ) - } + if (transferPayloadString != null) { + // isolated margin order + submitTransaction( + TransactionType.SubaccountTransfer, + transferPayloadString, + null, + isolatedMarginTransactionCallback, + useTransactionQueue, + ) + } else { + submitTransaction( + TransactionType.PlaceOrder, + string, + onSubmitOrderTransaction, + orderTransactionCallback, + useTransactionQueue, + ) + } return payload } @@ -628,7 +630,7 @@ internal class SubaccountSupervisor( val uiClickTimeMs = Clock.System.now().toEpochMilliseconds().toDouble() tracking( if (isCancel) AnalyticsEvent.TradeCancelOrderClick.rawValue else AnalyticsEvent.TradePlaceOrderClick.rawValue, - analyticsPayload + analyticsPayload, ) return uiClickTimeMs } @@ -714,10 +716,14 @@ internal class SubaccountSupervisor( helper.send( error, callback, - if (isTriggerOrder) HumanReadableTriggerOrdersPayload( - emptyList(), - listOf(payload), - ) else payload + if (isTriggerOrder) { + HumanReadableTriggerOrdersPayload( + emptyList(), + listOf(payload), + ) + } else { + payload + }, ) }, useTransactionQueue = !isShortTermOrder, @@ -772,7 +778,7 @@ internal class SubaccountSupervisor( val analyticsPayload = analyticsUtils.formatPlaceOrderPayload( payload, isClosePosition = false, - fromSlTpDialog = true + fromSlTpDialog = true, ) submitPlaceOrder(callback, payload, analyticsPayload, true) } @@ -787,16 +793,16 @@ internal class SubaccountSupervisor( private fun isShortTermOrder(type: String, timeInForce: String?): Boolean { return when (type) { - "MARKET" -> true - "LIMIT" -> { - when (timeInForce) { - "GTT" -> false - else -> true - } - } - else -> false - } - } + "MARKET" -> true + "LIMIT" -> { + when (timeInForce) { + "GTT" -> false + else -> true + } + } + else -> false + } + } @Throws(Exception::class) fun placeOrderPayload(currentHeight: Int?): HumanReadablePlaceOrderPayload { diff --git a/src/commonTest/kotlin/exchange.dydx.abacus/payload/TriggerOrdersInputTests.kt b/src/commonTest/kotlin/exchange.dydx.abacus/payload/TriggerOrdersInputTests.kt index 373bf85be..915fd9751 100644 --- a/src/commonTest/kotlin/exchange.dydx.abacus/payload/TriggerOrdersInputTests.kt +++ b/src/commonTest/kotlin/exchange.dydx.abacus/payload/TriggerOrdersInputTests.kt @@ -195,7 +195,7 @@ class TriggerOrderInputTests : V4BaseTests() { "limitPrice": "300.0", "triggerPrice": "400.0", "usdcDiff": "300", - "percentDiff": "0.3515790352", + "percentDiff": "35.15790352", "input": "stopLossOrder.price.triggerPrice" }, "summary": { @@ -225,7 +225,7 @@ class TriggerOrderInputTests : V4BaseTests() { "limitPrice": "300.0", "triggerPrice": "200.0", "usdcDiff": "400", - "percentDiff": "0.4687720469", + "percentDiff": "46.87720469", "input": "stopLossOrder.price.usdcDiff" }, "summary": { @@ -240,7 +240,7 @@ class TriggerOrderInputTests : V4BaseTests() { test( { - perp.triggerOrders("0.25", TriggerOrdersInputField.stopLossPercentDiff, 0) + perp.triggerOrders("25.00", TriggerOrdersInputField.stopLossPercentDiff, 0) }, """ { @@ -255,7 +255,7 @@ class TriggerOrderInputTests : V4BaseTests() { "limitPrice": "300.0", "triggerPrice": "573.3534", "usdcDiff": "213.3233", - "percentDiff": "0.25", + "percentDiff": "25.0", "input": "stopLossOrder.price.percentDiff" }, "summary": { @@ -331,7 +331,7 @@ class TriggerOrderInputTests : V4BaseTests() { "limitPrice": "1600.0", "triggerPrice": "1800.0", "usdcDiff": "400", - "percentDiff": "0.4687720469", + "percentDiff": "46.87720469", "input": "takeProfitOrder.price.triggerPrice" }, "summary": { @@ -361,7 +361,7 @@ class TriggerOrderInputTests : V4BaseTests() { "limitPrice": "1600.0", "triggerPrice": "1600.0", "usdcDiff": "300.0", - "percentDiff": "0.3515790352", + "percentDiff": "35.15790352", "input": "takeProfitOrder.price.usdcDiff" }, "summary": { @@ -376,7 +376,7 @@ class TriggerOrderInputTests : V4BaseTests() { test( { - perp.triggerOrders("0.25", TriggerOrdersInputField.takeProfitPercentDiff, 0) + perp.triggerOrders("25.0", TriggerOrdersInputField.takeProfitPercentDiff, 0) }, """ { @@ -391,7 +391,7 @@ class TriggerOrderInputTests : V4BaseTests() { "limitPrice": "1600.0", "triggerPrice": "1426.6466", "usdcDiff": "213.3233", - "percentDiff": "0.25", + "percentDiff": "25.0", "input": "takeProfitOrder.price.percentDiff" }, "summary": { diff --git a/v4_abacus.podspec b/v4_abacus.podspec index 9178b002d..bee25841f 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.6.35' + spec.version = '1.6.36' spec.homepage = 'https://github.com/dydxprotocol/v4-abacus' spec.source = { :http=> ''} spec.authors = ''