diff --git a/build.gradle.kts b/build.gradle.kts index 8c2064f44..f33c22c1c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -52,7 +52,7 @@ allprojects { } group = "exchange.dydx.abacus" -version = "1.12.19" +version = "1.12.20" repositories { google() diff --git a/src/commonMain/kotlin/indexer/models/chain/OnChainTransactionResponse.kt b/src/commonMain/kotlin/indexer/models/chain/OnChainTransactionResponse.kt new file mode 100644 index 000000000..0c8beb8e6 --- /dev/null +++ b/src/commonMain/kotlin/indexer/models/chain/OnChainTransactionResponse.kt @@ -0,0 +1,64 @@ +package indexer.models.chain + +import exchange.dydx.abacus.protocols.asTypedObject +import exchange.dydx.abacus.utils.Parser +import kotlinx.serialization.Serializable + +// Define the structure of the error message +@Serializable +data class ChainError( + val message: String, + val line: Int? = null, + val column: Int? = null, + val stack: String? = null +) { + companion object { + val unknownError = ChainError(message = "An unknown error occurred", line = null, column = null, stack = null) + } +} + +@Serializable +data class OnChainTransactionErrorResponse( + val error: ChainError +) { + companion object { + private val parser = Parser() + + fun fromPayload(payload: String?): OnChainTransactionErrorResponse? { + return parser.asTypedObject(payload) + } + } +} + +// Define the structure of the success message +@Serializable +data class ChainEvent( + val type: String, + val attributes: List +) + +@Serializable +data class ChainEventAttribute( + val key: String, + val value: String +) + +@Serializable +data class OnChainTransactionSuccessResponse( + val height: Int? = null, + val hash: String? = null, + val code: Int? = null, + val tx: String, + val txIndex: Int? = null, + val gasUsed: String? = null, + val gasWanted: String? = null, + val events: List? = null, +) { + companion object { + private val parser = Parser() + + fun fromPayload(payload: String?): OnChainTransactionSuccessResponse? { + return parser.asTypedObject(payload) + } + } +} diff --git a/v4_abacus.podspec b/v4_abacus.podspec index b9b78cb00..2e17d52a8 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.12.19' + spec.version = '1.12.20' spec.homepage = 'https://github.com/dydxprotocol/v4-abacus' spec.source = { :http=> ''} spec.authors = ''