From a52cd5baad93083c26f615c6c1369ff827e761de Mon Sep 17 00:00:00 2001 From: Pawel Zak Date: Fri, 15 Dec 2023 11:02:25 +0100 Subject: [PATCH] PRODUCT-15779 removed deprecated parameters, updated version to 4.0.0 --- demo/src/main/java/ramp/network/demo/MainActivity.kt | 7 ++----- rampsdk/build.gradle | 6 +++--- .../java/network/ramp/sdk/events/model/Payloads.kt | 12 +++--------- .../java/network/ramp/sdk/facade/RampCallback.kt | 4 ---- .../src/main/java/network/ramp/sdk/facade/RampSDK.kt | 3 --- 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/demo/src/main/java/ramp/network/demo/MainActivity.kt b/demo/src/main/java/ramp/network/demo/MainActivity.kt index 2e48e9f..a671538 100644 --- a/demo/src/main/java/ramp/network/demo/MainActivity.kt +++ b/demo/src/main/java/ramp/network/demo/MainActivity.kt @@ -34,15 +34,12 @@ class MainActivity : AppCompatActivity() { val config = Config( hostLogoUrl = "https://ramp.network/assets/images/Logo.svg", hostAppName = "My App", - url = "https://app.dev.ramp-network.org", - hostApiKey = "3qncr4yvxfpro6endeaeu6npkh8qc23e9uadtazq", + url = "https://app.demo.ramp.network", + hostApiKey = "your host api key", enabledFlows = setOf(Flow.OFFRAMP, Flow.ONRAMP) ) // 4. Implement callbacks val callback = object : RampCallback { - override fun onPurchaseFailed() { - Log.d("MainActivity", "onPurchaseFailed") - } override fun onPurchaseCreated( purchase: Purchase, diff --git a/rampsdk/build.gradle b/rampsdk/build.gradle index 0e1244e..591a242 100644 --- a/rampsdk/build.gradle +++ b/rampsdk/build.gradle @@ -22,8 +22,8 @@ android { defaultConfig { minSdkVersion 21 targetSdkVersion 32 - versionCode 18 - versionName "3.0.4" + versionCode 19 + versionName "4.0.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' buildConfigField 'String', 'VERSION', "\"${defaultConfig.versionName}\"" @@ -84,7 +84,7 @@ afterEvaluate { from components.release groupId = 'com.github.RampNetwork' artifactId = 'ramp-sdk-android' - version = '3.0.4' + version = '4.0.0' } } } diff --git a/rampsdk/src/main/java/network/ramp/sdk/events/model/Payloads.kt b/rampsdk/src/main/java/network/ramp/sdk/events/model/Payloads.kt index c9a69fa..0ce23b9 100644 --- a/rampsdk/src/main/java/network/ramp/sdk/events/model/Payloads.kt +++ b/rampsdk/src/main/java/network/ramp/sdk/events/model/Payloads.kt @@ -48,15 +48,9 @@ data class OfframpSaleCreatedPayload( data class Purchase( val id: String, val endTime: String, // purchase validity time, ISO date-time string - @Deprecated("This parameter will be removed in future release") - val escrowAddress: String? = null, // filled only for escrow-backend purchases val cryptoAmount: String, // number-string, in wei or token units val fiatCurrency: String, // three-letter currency code val fiatValue: Double, // total value the user pays for the purchase, in fiatCurrency - @Deprecated("This parameter will be removed in future") - val assetExchangeRateEur: Double, - @Deprecated("This parameter will be removed in future") - val fiatExchangeRateEur: Double, val baseRampFee: Double, // base Ramp fee before any modifications, in fiatCurrency val networkFee: Double, // network fee for transferring the purchased asset, in fiatCurrency val appliedFee: Double, // final fee the user pays (included in fiatValue), in fiatCurrency @@ -65,8 +59,6 @@ data class Purchase( val asset: Asset, // description of the purchased asset (address, symbol, name, decimals) val receiverAddress: String, // blockchain address of the buyer val assetExchangeRate: Double,// price of 1 whole token of purchased asset, in fiatCurrency - @Deprecated("This parameter will be removed in future") - val purchaseViewToken: String, val status: String, // purchase status val paymentMethodType: String, // type of payment method used to pay for the swap: 'MANUAL_BANK_TRANSFER' | 'AUTO_BANK_TRANSFER' | 'CARD_PAYMENT' | 'APPLE_PAY' val finalTxHash: String? = null // hash of the crypto transfer blockchain transaction, filled once available @@ -97,8 +89,10 @@ data class Fiat( data class Asset( val address: String? = null, // 0x-prefixed address for ERC-20 tokens, `null` for ETH val symbol: String, // asset symbol, for example `ETH`, `DAI`, `USDC` + val apiV3Symbol: String, // asset symbol in API v3 val name: String, val decimals: Long, // token decimals, e.g. 18 for ETH/DAI, 6 for USDC val type: String, // asset type & network, e.g. `ETH`, `ERC20`, `MATIC_ERC20` - val chain: String // asset chain, for example `ETH`, `BSC`, `POLKADOT` + val chain: String, // asset chain, for example `ETH`, `BSC`, `POLKADOT` + val apiV3Type: String // asset type in API v3 ) : Parcelable \ No newline at end of file diff --git a/rampsdk/src/main/java/network/ramp/sdk/facade/RampCallback.kt b/rampsdk/src/main/java/network/ramp/sdk/facade/RampCallback.kt index f3ec83c..eb24fc0 100644 --- a/rampsdk/src/main/java/network/ramp/sdk/facade/RampCallback.kt +++ b/rampsdk/src/main/java/network/ramp/sdk/facade/RampCallback.kt @@ -5,10 +5,6 @@ import network.ramp.sdk.events.model.Purchase import network.ramp.sdk.events.model.Asset interface RampCallback { - - @Deprecated(message = "This method is deprecated and will be removed in future versions.") - fun onPurchaseFailed() - fun onPurchaseCreated(purchase: Purchase, purchaseViewToken: String, apiUrl: String) fun onOfframpSaleCreated( diff --git a/rampsdk/src/main/java/network/ramp/sdk/facade/RampSDK.kt b/rampsdk/src/main/java/network/ramp/sdk/facade/RampSDK.kt index 5e2ae72..836b4d3 100644 --- a/rampsdk/src/main/java/network/ramp/sdk/facade/RampSDK.kt +++ b/rampsdk/src/main/java/network/ramp/sdk/facade/RampSDK.kt @@ -63,9 +63,6 @@ class RampSDK { payload.apiUrl ) } - EventType.PURCHASE_FAILED -> { - callback?.onPurchaseFailed() - } EventType.OFFRAMP_SALE_CREATED -> { val payload = (it as OfframpSaleCreated).payload