From 07482ec82adab6a51fb1c9e4ed102a885241f7bc Mon Sep 17 00:00:00 2001 From: Rui <102453770+ruixhuang@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:07:21 -0700 Subject: [PATCH] Indexer codegen (#663) --- .../IndexerAddress_registerToken_body.kt | 28 +++++++++++++ .../IndexerAffiliateAddressResponse.kt | 26 ++++++++++++ .../IndexerAffiliateMetadataResponse.kt | 30 ++++++++++++++ .../IndexerAffiliateSnapshotResponse.kt | 30 ++++++++++++++ .../IndexerAffiliateSnapshotResponseObject.kt | 40 +++++++++++++++++++ .../IndexerAffiliateTotalVolumeResponse.kt | 26 ++++++++++++ .../codegen/IndexerFillResponseObject.kt | 2 + .../IndexerMegavaultHistoricalPnlResponse.kt | 26 ++++++++++++ .../IndexerMegavaultPositionResponse.kt | 26 ++++++++++++ .../indexer/codegen/IndexerPnlTickInterval.kt | 26 ++++++++++++ .../codegen/IndexerVaultHistoricalPnl.kt | 28 +++++++++++++ .../indexer/codegen/IndexerVaultPosition.kt | 32 +++++++++++++++ .../IndexerVaultsHistoricalPnlResponse.kt | 26 ++++++++++++ swagger_codegen.sh | 2 + 14 files changed, 348 insertions(+) create mode 100644 src/commonMain/kotlin/indexer/codegen/IndexerAddress_registerToken_body.kt create mode 100644 src/commonMain/kotlin/indexer/codegen/IndexerAffiliateAddressResponse.kt create mode 100644 src/commonMain/kotlin/indexer/codegen/IndexerAffiliateMetadataResponse.kt create mode 100644 src/commonMain/kotlin/indexer/codegen/IndexerAffiliateSnapshotResponse.kt create mode 100644 src/commonMain/kotlin/indexer/codegen/IndexerAffiliateSnapshotResponseObject.kt create mode 100644 src/commonMain/kotlin/indexer/codegen/IndexerAffiliateTotalVolumeResponse.kt create mode 100644 src/commonMain/kotlin/indexer/codegen/IndexerMegavaultHistoricalPnlResponse.kt create mode 100644 src/commonMain/kotlin/indexer/codegen/IndexerMegavaultPositionResponse.kt create mode 100644 src/commonMain/kotlin/indexer/codegen/IndexerPnlTickInterval.kt create mode 100644 src/commonMain/kotlin/indexer/codegen/IndexerVaultHistoricalPnl.kt create mode 100644 src/commonMain/kotlin/indexer/codegen/IndexerVaultPosition.kt create mode 100644 src/commonMain/kotlin/indexer/codegen/IndexerVaultsHistoricalPnlResponse.kt diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerAddress_registerToken_body.kt b/src/commonMain/kotlin/indexer/codegen/IndexerAddress_registerToken_body.kt new file mode 100644 index 000000000..caf05ad3e --- /dev/null +++ b/src/commonMain/kotlin/indexer/codegen/IndexerAddress_registerToken_body.kt @@ -0,0 +1,28 @@ +/** + * Indexer API + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +package indexer.codegen + +import kotlinx.serialization.Serializable +import kotlin.js.JsExport + +/** + * + * @param language + * @param token + */ +@JsExport +@Serializable +data class AddressRegisterTokenBody( + + val language: kotlin.String? = null, + val token: kotlin.String? = null +) diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateAddressResponse.kt b/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateAddressResponse.kt new file mode 100644 index 000000000..d2b9f92ab --- /dev/null +++ b/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateAddressResponse.kt @@ -0,0 +1,26 @@ +/** + * Indexer API + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +package indexer.codegen + +import kotlinx.serialization.Serializable +import kotlin.js.JsExport + +/** + * + * @param address + */ +@JsExport +@Serializable +data class IndexerAffiliateAddressResponse( + + val address: kotlin.String? = null +) diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateMetadataResponse.kt b/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateMetadataResponse.kt new file mode 100644 index 000000000..fa1f0d849 --- /dev/null +++ b/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateMetadataResponse.kt @@ -0,0 +1,30 @@ +/** + * Indexer API + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +package indexer.codegen + +import kotlinx.serialization.Serializable +import kotlin.js.JsExport + +/** + * + * @param referralCode + * @param isVolumeEligible + * @param isAffiliate + */ +@JsExport +@Serializable +data class IndexerAffiliateMetadataResponse( + + val referralCode: kotlin.String? = null, + val isVolumeEligible: kotlin.Boolean? = null, + val isAffiliate: kotlin.Boolean? = null +) diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateSnapshotResponse.kt b/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateSnapshotResponse.kt new file mode 100644 index 000000000..822d5ef2b --- /dev/null +++ b/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateSnapshotResponse.kt @@ -0,0 +1,30 @@ +/** + * Indexer API + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +package indexer.codegen + +import kotlinx.serialization.Serializable +import kotlin.js.JsExport + +/** + * + * @param affiliateList + * @param total + * @param currentOffset + */ +@JsExport +@Serializable +data class IndexerAffiliateSnapshotResponse( + + val affiliateList: kotlin.Array? = null, + val total: kotlin.Double? = null, + val currentOffset: kotlin.Double? = null +) diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateSnapshotResponseObject.kt b/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateSnapshotResponseObject.kt new file mode 100644 index 000000000..104ded4b5 --- /dev/null +++ b/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateSnapshotResponseObject.kt @@ -0,0 +1,40 @@ +/** + * Indexer API + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +package indexer.codegen + +import kotlinx.serialization.Serializable +import kotlin.js.JsExport + +/** + * + * @param affiliateAddress + * @param affiliateReferralCode + * @param affiliateEarnings + * @param affiliateReferredTrades + * @param affiliateTotalReferredFees + * @param affiliateReferredUsers + * @param affiliateReferredNetProtocolEarnings + * @param affiliateReferredTotalVolume + */ +@JsExport +@Serializable +data class IndexerAffiliateSnapshotResponseObject( + + val affiliateAddress: kotlin.String? = null, + val affiliateReferralCode: kotlin.String? = null, + val affiliateEarnings: kotlin.Double? = null, + val affiliateReferredTrades: kotlin.Double? = null, + val affiliateTotalReferredFees: kotlin.Double? = null, + val affiliateReferredUsers: kotlin.Double? = null, + val affiliateReferredNetProtocolEarnings: kotlin.Double? = null, + val affiliateReferredTotalVolume: kotlin.Double? = null +) diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateTotalVolumeResponse.kt b/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateTotalVolumeResponse.kt new file mode 100644 index 000000000..1a2c84a7c --- /dev/null +++ b/src/commonMain/kotlin/indexer/codegen/IndexerAffiliateTotalVolumeResponse.kt @@ -0,0 +1,26 @@ +/** + * Indexer API + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +package indexer.codegen + +import kotlinx.serialization.Serializable +import kotlin.js.JsExport + +/** + * + * @param totalVolume + */ +@JsExport +@Serializable +data class IndexerAffiliateTotalVolumeResponse( + + val totalVolume: kotlin.Double? = null +) diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerFillResponseObject.kt b/src/commonMain/kotlin/indexer/codegen/IndexerFillResponseObject.kt index f92fceb0a..520618f62 100644 --- a/src/commonMain/kotlin/indexer/codegen/IndexerFillResponseObject.kt +++ b/src/commonMain/kotlin/indexer/codegen/IndexerFillResponseObject.kt @@ -25,6 +25,7 @@ import kotlin.js.JsExport * @param price * @param size * @param fee + * @param affiliateRevShare * @param createdAt * @param createdAtHeight * @param orderId @@ -44,6 +45,7 @@ data class IndexerFillResponseObject( val price: kotlin.String? = null, val size: kotlin.String? = null, val fee: kotlin.String? = null, + val affiliateRevShare: kotlin.String? = null, val createdAt: IndexerIsoString? = null, val createdAtHeight: kotlin.String? = null, val orderId: kotlin.String? = null, diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerMegavaultHistoricalPnlResponse.kt b/src/commonMain/kotlin/indexer/codegen/IndexerMegavaultHistoricalPnlResponse.kt new file mode 100644 index 000000000..fca650ace --- /dev/null +++ b/src/commonMain/kotlin/indexer/codegen/IndexerMegavaultHistoricalPnlResponse.kt @@ -0,0 +1,26 @@ +/** + * Indexer API + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +package indexer.codegen + +import kotlinx.serialization.Serializable +import kotlin.js.JsExport + +/** + * + * @param megavaultPnl + */ +@JsExport +@Serializable +data class IndexerMegavaultHistoricalPnlResponse( + + val megavaultPnl: kotlin.Array? = null +) diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerMegavaultPositionResponse.kt b/src/commonMain/kotlin/indexer/codegen/IndexerMegavaultPositionResponse.kt new file mode 100644 index 000000000..9d6c45a35 --- /dev/null +++ b/src/commonMain/kotlin/indexer/codegen/IndexerMegavaultPositionResponse.kt @@ -0,0 +1,26 @@ +/** + * Indexer API + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +package indexer.codegen + +import kotlinx.serialization.Serializable +import kotlin.js.JsExport + +/** + * + * @param positions + */ +@JsExport +@Serializable +data class IndexerMegavaultPositionResponse( + + val positions: kotlin.Array? = null +) diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerPnlTickInterval.kt b/src/commonMain/kotlin/indexer/codegen/IndexerPnlTickInterval.kt new file mode 100644 index 000000000..44d928ff5 --- /dev/null +++ b/src/commonMain/kotlin/indexer/codegen/IndexerPnlTickInterval.kt @@ -0,0 +1,26 @@ +/** + * Indexer API + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +package indexer.codegen + +import kotlinx.serialization.Serializable +import kotlin.js.JsExport + +/** + * + * Values: HOUR,DAY + */ +@JsExport +@Serializable +enum class IndexerPnlTickInterval(val value: kotlin.String) { + HOUR("hour"), // :/ + DAY("day"); // :/ +} diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerVaultHistoricalPnl.kt b/src/commonMain/kotlin/indexer/codegen/IndexerVaultHistoricalPnl.kt new file mode 100644 index 000000000..f5040a8d1 --- /dev/null +++ b/src/commonMain/kotlin/indexer/codegen/IndexerVaultHistoricalPnl.kt @@ -0,0 +1,28 @@ +/** + * Indexer API + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +package indexer.codegen + +import kotlinx.serialization.Serializable +import kotlin.js.JsExport + +/** + * + * @param ticker + * @param historicalPnl + */ +@JsExport +@Serializable +data class IndexerVaultHistoricalPnl( + + val ticker: kotlin.String? = null, + val historicalPnl: kotlin.Array? = null +) diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerVaultPosition.kt b/src/commonMain/kotlin/indexer/codegen/IndexerVaultPosition.kt new file mode 100644 index 000000000..3d62e4536 --- /dev/null +++ b/src/commonMain/kotlin/indexer/codegen/IndexerVaultPosition.kt @@ -0,0 +1,32 @@ +/** + * Indexer API + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +package indexer.codegen + +import kotlinx.serialization.Serializable +import kotlin.js.JsExport + +/** + * + * @param ticker + * @param assetPosition + * @param perpetualPosition + * @param equity + */ +@JsExport +@Serializable +data class IndexerVaultPosition( + + val ticker: kotlin.String? = null, + val assetPosition: IndexerAssetPositionResponseObject? = null, + val perpetualPosition: IndexerPerpetualPositionResponseObject? = null, + val equity: kotlin.String? = null +) diff --git a/src/commonMain/kotlin/indexer/codegen/IndexerVaultsHistoricalPnlResponse.kt b/src/commonMain/kotlin/indexer/codegen/IndexerVaultsHistoricalPnlResponse.kt new file mode 100644 index 000000000..4645ef866 --- /dev/null +++ b/src/commonMain/kotlin/indexer/codegen/IndexerVaultsHistoricalPnlResponse.kt @@ -0,0 +1,26 @@ +/** + * Indexer API + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +package indexer.codegen + +import kotlinx.serialization.Serializable +import kotlin.js.JsExport + +/** + * + * @param vaultsPnl + */ +@JsExport +@Serializable +data class IndexerVaultsHistoricalPnlResponse( + + val vaultsPnl: kotlin.Array? = null +) diff --git a/swagger_codegen.sh b/swagger_codegen.sh index 4fed07522..1feab1053 100755 --- a/swagger_codegen.sh +++ b/swagger_codegen.sh @@ -74,6 +74,8 @@ sed -i '' 's/\ PerpetualPositionsMap/\ Map in SubaccountResponseObject.kt sed -i '' 's/\ AssetPositionsMap/\ Map/g' generated/src/main/kotlin/indexer/codegen/SubaccountResponseObject.kt +# add import kotlinx.serialization.SerialName to the top of CandleResolution.kt +sed -i '' 's/package indexer.codegen/package indexer.codegen\n\nimport kotlinx.serialization.SerialName/' generated/src/main/kotlin/indexer/codegen/CandleResolution.kt # add import kotlinx.serialization.Serializable to the top of CandleResolution.kt sed -i '' 's/package indexer.codegen/package indexer.codegen\n\nimport kotlinx.serialization.Serializable/' generated/src/main/kotlin/indexer/codegen/CandleResolution.kt