diff --git a/integration-tests/build.gradle.kts b/integration-tests/build.gradle.kts index 64186280c0..1ff56b7bed 100644 --- a/integration-tests/build.gradle.kts +++ b/integration-tests/build.gradle.kts @@ -48,10 +48,15 @@ dependencies { testImplementation(libs.dotenv) } -tasks { - bootJar { enabled = false } -} +tasks { bootJar { enabled = false } } + +apply(from = "$rootDir/scripts.gradle.kts") + +@Suppress("UNCHECKED_CAST") +val enableTestConcurrency = extra["enableTestConcurrency"] as (Test) -> Unit tasks.test { + enableTestConcurrency(this) exclude("**/org/stellar/anchor/platform/*Test.class") -} \ No newline at end of file + exclude("**/org/stellar/anchor/platform/subtest/**") +} diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/AbstractIntegrationTest.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/AbstractIntegrationTest.kt index 7015e5e15e..d06f1288a7 100644 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/AbstractIntegrationTest.kt +++ b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/AbstractIntegrationTest.kt @@ -28,11 +28,8 @@ open class AbstractIntegrationTest(private val config: TestConfig) { } val testProfileRunner = TestProfileExecutor(config) - lateinit var sep6Tests: Sep6Tests lateinit var platformApiCustodyTests: PlatformApiCustodyTests - lateinit var stellarObserverTests: StellarObserverTests lateinit var custodyApiTests: CustodyApiTests - lateinit var eventProcessingServerTests: EventProcessingServerTests lateinit var sep24E2eTests: Sep24End2EndTests lateinit var sep24RpcE2eTests: Sep24RpcEnd2EndTests lateinit var sep24CustodyE2eTests: Sep24CustodyEnd2EndTests @@ -58,9 +55,7 @@ open class AbstractIntegrationTest(private val config: TestConfig) { // Get JWT val jwt = auth() - sep6Tests = Sep6Tests(toml) platformApiCustodyTests = PlatformApiCustodyTests(config, toml, jwt) - stellarObserverTests = StellarObserverTests() custodyApiTests = CustodyApiTests(config, toml, jwt) sep24E2eTests = Sep24End2EndTests(config, jwt) sep24CustodyE2eTests = Sep24CustodyEnd2EndTests(config, jwt) @@ -68,7 +63,6 @@ open class AbstractIntegrationTest(private val config: TestConfig) { sep24CustodyRpcE2eTests = Sep24CustodyRpcEnd2EndTests(config, jwt) sep31RpcE2eTests = Sep31RpcEnd2EndTests(config, toml, jwt) sep31CustodyRpcE2eTests = Sep31CustodyRpcEnd2EndTests(config, toml, jwt) - eventProcessingServerTests = EventProcessingServerTests(config, toml, jwt) } private suspend fun auth(): String { diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/AnchorPlatformIntegrationTest.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/AnchorPlatformIntegrationTest.kt deleted file mode 100644 index b244da45cd..0000000000 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/AnchorPlatformIntegrationTest.kt +++ /dev/null @@ -1,55 +0,0 @@ -package org.stellar.anchor.platform - -import kotlinx.coroutines.* -import okhttp3.mockwebserver.MockWebServer -import org.junit.jupiter.api.* -import org.stellar.anchor.platform.test.* - -@TestMethodOrder(MethodOrderer.OrderAnnotation::class) -class AnchorPlatformIntegrationTest : - AbstractIntegrationTest(TestConfig(testProfileName = "default")) { - companion object { - private val singleton = AnchorPlatformIntegrationTest() - private val custodyMockServer = MockWebServer() - - @BeforeAll - @JvmStatic - fun construct() { - println("Running AnchorPlatformIntegrationTest") - custodyMockServer.start() - val mockServerUrl = custodyMockServer.url("").toString() - singleton.setUp(mapOf("custody.fireblocks.base_url" to mockServerUrl)) - } - - @AfterAll - @JvmStatic - fun destroy() { - custodyMockServer.shutdown() - singleton.tearDown() - } - } - - @Test - @Order(16) - fun runSep6Test() { - singleton.sep6Tests.testAll() - } - - @Test - @Order(41) - fun runCallbackApiTest() { - singleton.callbackApiTests.testAll() - } - - @Test - @Order(51) - fun runStellarObserverTest() { - singleton.stellarObserverTests.testAll() - } - - @Test - @Order(61) - fun runEventProcessingServerTest() { - singleton.eventProcessingServerTests.testAll() - } -} diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/CallbackApiTests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/CallbackApiTests.kt index b64b73c63a..29cc000b30 100644 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/CallbackApiTests.kt +++ b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/CallbackApiTests.kt @@ -8,10 +8,10 @@ import java.time.format.DateTimeFormatter import java.util.* import java.util.concurrent.TimeUnit import okhttp3.OkHttpClient -import org.junit.jupiter.api.Assertions +import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertThrows +import org.junit.jupiter.api.parallel.Execution +import org.junit.jupiter.api.parallel.ExecutionMode import org.skyscreamer.jsonassert.JSONAssert import org.stellar.anchor.api.callback.GetCustomerRequest import org.stellar.anchor.api.callback.GetFeeRequest @@ -25,10 +25,11 @@ import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.platform.callback.RestCustomerIntegration import org.stellar.anchor.platform.callback.RestFeeIntegration import org.stellar.anchor.platform.callback.RestRateIntegration -import org.stellar.anchor.platform.test.testCustomer1Json -import org.stellar.anchor.platform.test.testCustomer2Json import org.stellar.anchor.util.GsonUtils +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +@Execution(ExecutionMode.SAME_THREAD) +@TestMethodOrder(MethodOrderer.OrderAnnotation::class) class CallbackApiTests : SepTests(TestConfig(testProfileName = "default")) { companion object { diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/EventProcessingServerTests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/EventProcessingTests.kt similarity index 86% rename from integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/EventProcessingServerTests.kt rename to integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/EventProcessingTests.kt index 2eaaaa5a7d..5cc0957dcf 100644 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/EventProcessingServerTests.kt +++ b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/EventProcessingTests.kt @@ -1,18 +1,20 @@ -package org.stellar.anchor.platform.test +package org.stellar.anchor.platform.subtest +import org.junit.jupiter.api.Test import org.stellar.anchor.api.event.AnchorEvent import org.stellar.anchor.event.EventService.EventQueue.TRANSACTION import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.platform.config.PropertyEventConfig import org.stellar.anchor.platform.event.DefaultEventService import org.stellar.anchor.util.GsonUtils -import org.stellar.anchor.util.Sep1Helper -class EventProcessingServerTests(config: TestConfig, toml: Sep1Helper.TomlContent, jwt: String) { +class EventProcessingServerTests : SepTests(TestConfig(testProfileName = "default")) { companion object { val eventConfig = GsonUtils.getInstance().fromJson(eventConfigJson, PropertyEventConfig::class.java)!! } + + @Test fun testOk() { val eventService = DefaultEventService(eventConfig) val session = eventService.createSession("testOk", TRANSACTION) @@ -20,10 +22,6 @@ class EventProcessingServerTests(config: TestConfig, toml: Sep1Helper.TomlConten session.publish(quoteEvent) } - fun testAll() { - println("Performing event processing server tests...") - testOk() - } } val testQuoteEvent = diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/PlatformApiTests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/PlatformApiTests.kt index a827d42215..9efe77b9ea 100644 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/PlatformApiTests.kt +++ b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/PlatformApiTests.kt @@ -1,369 +1,5 @@ package org.stellar.anchor.platform.subtest -import com.google.gson.reflect.TypeToken -import org.apache.http.HttpStatus -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test -import org.skyscreamer.jsonassert.Customization -import org.skyscreamer.jsonassert.JSONAssert -import org.skyscreamer.jsonassert.JSONCompareMode -import org.skyscreamer.jsonassert.comparator.CustomComparator -import org.stellar.anchor.api.rpc.RpcRequest -import org.stellar.anchor.api.rpc.method.NotifyOffchainFundsReceivedRequest -import org.stellar.anchor.api.rpc.method.RequestOffchainFundsRequest -import org.stellar.anchor.api.rpc.method.RpcMethod -import org.stellar.anchor.api.rpc.method.RpcMethod.REQUEST_OFFCHAIN_FUNDS -import org.stellar.anchor.api.sep.SepTransactionStatus -import org.stellar.anchor.api.sep.sep12.Sep12PutCustomerRequest -import org.stellar.anchor.api.sep.sep31.Sep31PostTransactionRequest -import org.stellar.anchor.apiclient.PlatformApiClient -import org.stellar.anchor.auth.AuthHelper -import org.stellar.anchor.platform.Sep12Client -import org.stellar.anchor.platform.Sep24Client -import org.stellar.anchor.platform.Sep31Client -import org.stellar.anchor.platform.TestConfig -import org.stellar.anchor.util.GsonUtils - -class PlatformApiTests : SepTests(TestConfig(testProfileName = "default")) { - companion object { - private const val TX_ID = "testTxId" - private const val JSON_RPC_VERSION = "2.0" - private const val TX_ID_KEY = "TX_ID" - private const val RECEIVER_ID_KEY = "RECEIVER_ID" - private const val SENDER_ID_KEY = "SENDER_ID" - } - - private val gson = GsonUtils.getInstance() - - private val platformApiClient = - PlatformApiClient(AuthHelper.forNone(), config.env["platform.server.url"]!!) - private val sep12Client = Sep12Client(toml.getString("KYC_SERVER"), token.token) - private val sep24Client = Sep24Client(toml.getString("TRANSFER_SERVER_SEP0024"), token.token) - private val sep31Client = Sep31Client(toml.getString("DIRECT_PAYMENT_SERVER"), token.token) - - // fun testAll() { - // println("Performing Platform API tests...") - // `SEP-24 deposit complete short flow`() - // `SEP-24 deposit complete full with trust flow`() - // `SEP-24 deposit complete full with recovery flow`() - // `SEP-24 deposit complete short partial refund flow`() - // `SEP-24 withdraw complete short flow`() - // `SEP-24 withdraw complete full via pending external`() - // `SEP-24 withdraw complete full via pending user`() - // `SEP-24 withdraw full refund`() - // `SEP-31 refunded short`() - // `SEP-31 complete full with recovery`() - // `validations and errors`() - // `send single rpc request`() - // `send batch of rpc requests`() - // } - - @Test - fun `send single rpc request`() { - val depositRequest = gson.fromJson(SEP_24_DEPOSIT_REQUEST, HashMap::class.java) - - @Suppress("UNCHECKED_CAST") - val depositResponse = sep24Client.deposit(depositRequest as HashMap) - val txId = depositResponse.id - - val requestOffchainFundsParams = - gson.fromJson(REQUEST_OFFCHAIN_FUNDS_PARAMS, RequestOffchainFundsRequest::class.java) - requestOffchainFundsParams.transactionId = txId - val rpcRequest = - RpcRequest.builder() - .method(REQUEST_OFFCHAIN_FUNDS.toString()) - .jsonrpc(JSON_RPC_VERSION) - .params(requestOffchainFundsParams) - .id(1) - .build() - val response = platformApiClient.sendRpcRequest(listOf(rpcRequest)) - assertEquals(HttpStatus.SC_OK, response.code) - JSONAssert.assertEquals( - EXPECTED_RPC_RESPONSE.replace(TX_ID, txId).trimIndent(), - response.body?.string()?.trimIndent(), - CustomComparator( - JSONCompareMode.STRICT, - Customization("[*].result.started_at") { _, _ -> true }, - Customization("[*].result.updated_at") { _, _ -> true } - ) - ) - - val txResponse = platformApiClient.getTransaction(txId) - assertEquals(SepTransactionStatus.PENDING_USR_TRANSFER_START, txResponse.status) - } - - @Test - fun `send batch of rpc requests`() { - val depositRequest = gson.fromJson(SEP_24_DEPOSIT_REQUEST, HashMap::class.java) - - @Suppress("UNCHECKED_CAST") - val depositResponse = sep24Client.deposit(depositRequest as HashMap) - val txId = depositResponse.id - - val requestOffchainFundsParams = - gson.fromJson(REQUEST_OFFCHAIN_FUNDS_PARAMS, RequestOffchainFundsRequest::class.java) - val notifyOffchainFundsReceivedParams = - gson.fromJson( - NOTIFY_OFFCHAIN_FUNDS_RECEIVED_PARAMS, - NotifyOffchainFundsReceivedRequest::class.java - ) - requestOffchainFundsParams.transactionId = txId - notifyOffchainFundsReceivedParams.transactionId = txId - val rpcRequest1 = - RpcRequest.builder() - .id(1) - .method(REQUEST_OFFCHAIN_FUNDS.toString()) - .jsonrpc(JSON_RPC_VERSION) - .params(requestOffchainFundsParams) - .build() - val rpcRequest2 = - RpcRequest.builder() - .id(2) - .method(RpcMethod.NOTIFY_OFFCHAIN_FUNDS_RECEIVED.toString()) - .jsonrpc(JSON_RPC_VERSION) - .params(notifyOffchainFundsReceivedParams) - .build() - val response = platformApiClient.sendRpcRequest(listOf(rpcRequest1, rpcRequest2)) - assertEquals(HttpStatus.SC_OK, response.code) - - JSONAssert.assertEquals( - EXPECTED_RPC_BATCH_RESPONSE.replace(TX_ID, txId).trimIndent(), - response.body?.string()?.trimIndent(), - CustomComparator( - JSONCompareMode.STRICT, - Customization("[*].result.started_at") { _, _ -> true }, - Customization("[*].result.updated_at") { _, _ -> true } - ) - ) - - val txResponse = platformApiClient.getTransaction(txId) - assertEquals(SepTransactionStatus.PENDING_ANCHOR, txResponse.status) - } - - /** - * 1. incomplete -> request_offchain_funds - * 2. pending_user_transfer_start -> notify_offchain_funds_received - * 3. pending_anchor -> notify_onchain_funds_sent - * 4. completed - */ - @Test - fun `SEP-24 deposit complete short flow`() { - `test deposit flow`( - SEP_24_DEPOSIT_COMPLETE_SHORT_FLOW_ACTION_REQUESTS, - SEP_24_DEPOSIT_COMPLETE_SHORT_FLOW_ACTION_RESPONSES - ) - } - - /** - * 1. incomplete -> notify_interactive_flow_completed - * 2. pending_anchor -> request_offchain_funds - * 3. pending_user_transfer_start -> notify_offchain_funds_received - * 4. pending_anchor -> request_trust - * 5. pending_trust -> notify_trust_set - * 6. pending_anchor -> notify_onchain_funds_sent - * 7. completed - */ - @Test - fun `SEP-24 deposit complete full with trust flow`() { - `test deposit flow`( - SEP_24_DEPOSIT_COMPLETE_FULL_WITH_TRUST_FLOW_ACTION_REQUESTS, - SEP_24_DEPOSIT_COMPLETE_FULL_WITH_TRUST_FLOW_ACTION_RESPONSES - ) - } - - /** - * 1. incomplete -> request_offchain_funds - * 2. pending_user_transfer_start -> notify_offchain_funds_received - * 3. pending_anchor -> notify_transaction_error - * 4. error -> notify_transaction_recovery - * 5. pending_anchor -> notify_onchain_funds_sent - * 6. completed - */ - @Test - fun `SEP-24 deposit complete full with recovery flow`() { - `test deposit flow`( - SEP_24_DEPOSIT_COMPLETE_FULL_WITH_RECOVERY_FLOW_ACTION_REQUESTS, - SEP_24_DEPOSIT_COMPLETE_FULL_WITH_RECOVERY_FLOW_ACTION_RESPONSES - ) - } - - /** - * 1. incomplete -> request_offchain_funds - * 2. pending_user_transfer_start -> notify_offchain_funds_received - * 3. pending_anchor -> notify_refund_pending - * 4. pending_external -> notify_refund_sent - * 5. pending_anchor -> notify_onchain_funds_sent - * 6. completed - */ - @Test - fun `SEP-24 deposit complete short partial refund flow`() { - `test deposit flow`( - SEP_24_DEPOSIT_COMPLETE_SHORT_PARTIAL_REFUND_FLOW_ACTION_REQUESTS, - SEP_24_DEPOSIT_COMPLETE_SHORT_PARTIAL_REFUND_FLOW_ACTION_RESPONSES - ) - } - - /** - * 1. incomplete -> request_onchain_funds - * 2. pending_user_transfer_start -> notify_onchain_funds_received - * 3. pending_anchor -> notify_offchain_funds_sent - * 4. completed - */ - @Test - fun `SEP-24 withdraw complete short flow`() { - `test withdraw flow`( - SEP_24_WITHDRAW_COMPLETE_SHORT_FLOW_ACTION_REQUESTS, - SEP_24_WITHDRAW_COMPLETE_SHORT_FLOW_ACTION_RESPONSES - ) - } - - /** - * 1. incomplete -> request_onchain_funds - * 2. pending_user_transfer_start -> notify_onchain_funds_received - * 3. pending_anchor -> notify_offchain_funds_pending - * 4. pending_external -> notify_offchain_funds_sent - * 5. completed - */ - @Test - fun `SEP-24 withdraw complete full via pending external`() { - `test withdraw flow`( - SEP_24_WITHDRAW_COMPLETE_FULL_VIA_PENDING_EXTERNAL_FLOW_ACTION_REQUESTS, - SEP_24_WITHDRAW_COMPLETE_FULL_VIA_PENDING_EXTERNAL_FLOW_ACTION_RESPONSES - ) - } - - /** - * 1. incomplete -> request_onchain_funds - * 2. pending_user_transfer_start -> notify_onchain_funds_received - * 3. pending_anchor -> notify_offchain_funds_available - * 4. pending_user_transfer_complete -> notify_offchain_funds_sent - * 5. completed - */ - @Test - fun `SEP-24 withdraw complete full via pending user`() { - `test withdraw flow`( - SEP_24_WITHDRAW_COMPLETE_FULL_VIA_PENDING_USER_FLOW_ACTION_REQUESTS, - SEP_24_WITHDRAW_COMPLETE_FULL_VIA_PENDING_USER_FLOW_ACTION_RESPONSES - ) - } - - /** - * 1. incomplete -> request_onchain_funds - * 2. pending_user_transfer_start -> notify_onchain_funds_received - * 3. pending_anchor -> notify_refund_sent - * 4. refunded - */ - @Test - fun `SEP-24 withdraw full refund`() { - `test withdraw flow`( - SEP_24_WITHDRAW_FULL_REFUND_FLOW_ACTION_REQUESTS, - SEP_24_WITHDRAW_FULL_REFUND_FLOW_ACTION_RESPONSES - ) - } - - /** - * 1. pending_sender -> notify_onchain_funds_received - * 2. pending_receiver -> notify_refund_sent - * 3. refunded - */ - @Test - fun `SEP-31 refunded short`() { - `test receive flow`( - SEP_31_RECEIVE_REFUNDED_SHORT_FLOW_ACTION_REQUESTS, - SEP_31_RECEIVE_REFUNDED_SHORT_FLOW_ACTION_RESPONSES - ) - } - - /** - * 1. pending_sender -> notify_onchain_funds_received - * 2. pending_receiver -> request_customer_info_update - * 3. pending_customer_info_update -> notify_customer_info_updated - * 4. pending_receiver -> notify_transaction_error - * 5. error -> notify_transaction_recovery - * 6. pending_receiver -> notify_offchain_funds_pending - * 7. pending_external -> notify_offchain_funds_sent - * 8. completed - */ - @Test - fun `SEP-31 complete full with recovery`() { - `test receive flow`( - SEP_31_RECEIVE_COMPLETE_FULL_WITH_RECOVERY_FLOW_ACTION_REQUESTS, - SEP_31_RECEIVE_COMPLETE_FULL_WITH_RECOVERY_FLOW_ACTION_RESPONSES - ) - } - - @Test - fun `validations and errors`() { - `test deposit flow`(VALIDATIONS_AND_ERRORS_REQUESTS, VALIDATIONS_AND_ERRORS_RESPONSES) - } - - private fun `test deposit flow`(actionRequests: String, actionResponse: String) { - val depositRequest = gson.fromJson(SEP_24_DEPOSIT_FLOW_REQUEST, HashMap::class.java) - - @Suppress("UNCHECKED_CAST") - val depositResponse = sep24Client.deposit(depositRequest as HashMap) - `test flow`(depositResponse.id, actionRequests, actionResponse) - } - - private fun `test receive flow`(actionRequests: String, actionResponses: String) { - val receiverCustomerRequest = - GsonUtils.getInstance().fromJson(CUSTOMER_1, Sep12PutCustomerRequest::class.java) - val receiverCustomer = sep12Client.putCustomer(receiverCustomerRequest) - val senderCustomerRequest = - GsonUtils.getInstance().fromJson(CUSTOMER_2, Sep12PutCustomerRequest::class.java) - val senderCustomer = sep12Client.putCustomer(senderCustomerRequest) - - val receiveRequestJson = - SEP_31_RECEIVE_FLOW_REQUEST.replace(RECEIVER_ID_KEY, receiverCustomer!!.id) - .replace(SENDER_ID_KEY, senderCustomer!!.id) - val receiveRequest = gson.fromJson(receiveRequestJson, Sep31PostTransactionRequest::class.java) - val receiveResponse = sep31Client.postTransaction(receiveRequest) - - val updatedActionRequests = - actionRequests - .replace(RECEIVER_ID_KEY, receiverCustomer.id) - .replace(SENDER_ID_KEY, senderCustomer.id) - val updatedActionResponses = - actionResponses - .replace(RECEIVER_ID_KEY, receiverCustomer.id) - .replace(SENDER_ID_KEY, senderCustomer.id) - - `test flow`(receiveResponse.id, updatedActionRequests, updatedActionResponses) - } - - private fun `test withdraw flow`(actionRequests: String, actionResponse: String) { - val withdrawRequest = gson.fromJson(SEP_24_WITHDRAW_FLOW_REQUEST, HashMap::class.java) - - @Suppress("UNCHECKED_CAST") - val withdrawResponse = sep24Client.withdraw(withdrawRequest as HashMap) - `test flow`(withdrawResponse.id, actionRequests, actionResponse) - } - - private fun `test flow`(txId: String, actionRequests: String, actionResponses: String) { - val rpcActionRequestsType = object : TypeToken>() {}.type - val rpcActionRequests: List = - gson.fromJson(actionRequests.replace(TX_ID_KEY, txId), rpcActionRequestsType) - - val rpcActionResponses = platformApiClient.sendRpcRequest(rpcActionRequests) - - val expectedResult = actionResponses.replace(TX_ID_KEY, txId).trimIndent() - val actualResult = rpcActionResponses.body?.string()?.trimIndent() - - JSONAssert.assertEquals( - expectedResult, - actualResult, - CustomComparator( - JSONCompareMode.STRICT, - Customization("[*].result.started_at") { _, _ -> true }, - Customization("[*].result.updated_at") { _, _ -> true }, - Customization("[*].result.completed_at") { _, _ -> true }, - Customization("[*].result.memo") { _, _ -> true }, - Customization("[*].result.stellar_transactions[*].memo") { _, _ -> true } - ) - ) - } -} - private const val SEP_24_DEPOSIT_COMPLETE_SHORT_FLOW_ACTION_REQUESTS = """ [ diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/Sep12Tests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/Sep12Tests.kt index 1de803054e..3b9778b634 100644 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/Sep12Tests.kt +++ b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/Sep12Tests.kt @@ -76,3 +76,37 @@ const val customerJson = "bank_account_type": "checking" } """ + +const val testCustomer1Json = + """ +{ + "first_name": "John", + "last_name": "Doe", + "email_address": "johndoe@test.com", + "address": "123 Washington Street", + "city": "San Francisco", + "state_or_province": "CA", + "address_country_code": "US", + "clabe_number": "1234", + "bank_number": "abcd", + "bank_account_number": "1234", + "bank_account_type": "checking" +} +""" + +const val testCustomer2Json = + """ +{ + "first_name": "Jane", + "last_name": "Doe", + "email_address": "janedoe@test.com", + "address": "321 Washington Street", + "city": "San Francisco", + "state_or_province": "CA", + "address_country_code": "US", + "clabe_number": "5678", + "bank_number": "efgh", + "bank_account_number": "5678", + "bank_account_type": "checking" +} +""" diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/Sep31Tests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/Sep31Tests.kt index 235752ca83..9c4528280c 100644 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/Sep31Tests.kt +++ b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/Sep31Tests.kt @@ -2,9 +2,10 @@ package org.stellar.anchor.platform.subtest import java.time.Instant import kotlin.streams.toList +import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertThrows +import org.junit.jupiter.api.parallel.Execution +import org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD import org.skyscreamer.jsonassert.JSONAssert import org.skyscreamer.jsonassert.JSONCompareMode import org.skyscreamer.jsonassert.JSONCompareMode.LENIENT @@ -25,13 +26,14 @@ import org.stellar.anchor.apiclient.TransactionsOrderBy import org.stellar.anchor.apiclient.TransactionsSeps import org.stellar.anchor.auth.AuthHelper import org.stellar.anchor.platform.* -import org.stellar.anchor.platform.test.testCustomer1Json -import org.stellar.anchor.platform.test.testCustomer2Json import org.stellar.anchor.util.GsonUtils import org.stellar.anchor.util.StringHelper.json lateinit var savedTxn: Sep31GetTransactionResponse +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +@Execution(SAME_THREAD) +@TestMethodOrder(MethodOrderer.OrderAnnotation::class) class Sep31Tests : SepTests(TestConfig(testProfileName = "default")) { private val sep12Client: Sep12Client private val sep31Client: Sep31Client @@ -48,6 +50,7 @@ class Sep31Tests : SepTests(TestConfig(testProfileName = "default")) { } @Test + @Order(10) fun `test info endpoint`() { printRequest("Calling GET /info") val info = sep31Client.getInfo() @@ -55,6 +58,7 @@ class Sep31Tests : SepTests(TestConfig(testProfileName = "default")) { } @Test + @Order(30) fun `test post and get transactions`() { val (senderCustomer, receiverCustomer) = mkCustomers() @@ -82,7 +86,6 @@ class Sep31Tests : SepTests(TestConfig(testProfileName = "default")) { return senderCustomer!! to receiverCustomer!! } - @Test fun createTx( senderCustomer: Sep12PutCustomerResponse, receiverCustomer: Sep12PutCustomerResponse @@ -109,6 +112,7 @@ class Sep31Tests : SepTests(TestConfig(testProfileName = "default")) { } @Test + @Order(20) fun `test transactions`() { val (senderCustomer, receiverCustomer) = mkCustomers() @@ -121,7 +125,7 @@ class Sep31Tests : SepTests(TestConfig(testProfileName = "default")) { println("Created transactions ${tx1.id} ${tx2.id} ${tx3.id}") // Basic test - val txs = getTransactions() + val txs = getTransactions(pageSize = 1000) assertOrderCorrect(all, txs.records) // Order test @@ -134,13 +138,15 @@ class Sep31Tests : SepTests(TestConfig(testProfileName = "default")) { patchForTest(tx3, tx2) // OrderBy test - val orderByTxs = getTransactions(orderBy = TransactionsOrderBy.TRANSFER_RECEIVED_AT) + val orderByTxs = + getTransactions(orderBy = TransactionsOrderBy.TRANSFER_RECEIVED_AT, pageSize = 1000) assertOrderCorrect(listOf(tx2, tx3, tx1), orderByTxs.records) val orderByDesc = getTransactions( orderBy = TransactionsOrderBy.TRANSFER_RECEIVED_AT, - order = Sort.Direction.DESC + order = Sort.Direction.DESC, + pageSize = 1000 ) assertOrderCorrect(listOf(tx3, tx2, tx1), orderByDesc.records) @@ -148,6 +154,7 @@ class Sep31Tests : SepTests(TestConfig(testProfileName = "default")) { val statusesTxs = getTransactions( statuses = listOf(SepTransactionStatus.PENDING_SENDER, SepTransactionStatus.REFUNDED), + pageSize = 1000 ) assertOrderCorrect(listOf(tx1, tx2), statusesTxs.records) @@ -217,7 +224,9 @@ class Sep31Tests : SepTests(TestConfig(testProfileName = "default")) { ) } - private fun testBadAsset() { + @Test + @Order(35) + fun testBadAsset() { val customer = GsonUtils.getInstance().fromJson(testCustomer1Json, Sep12PutCustomerRequest::class.java) val pr = sep12Client.putCustomer(customer) @@ -230,6 +239,7 @@ class Sep31Tests : SepTests(TestConfig(testProfileName = "default")) { } @Test + @Order(40) fun `test patch, get and compare`() { val patch = gson.fromJson(patchRequest, PatchTransactionsRequest::class.java) // create patch request and patch @@ -248,6 +258,7 @@ class Sep31Tests : SepTests(TestConfig(testProfileName = "default")) { } @Test + @Order(50) fun `test bad requests`() { // Create sender customer val senderCustomerRequest = @@ -369,16 +380,6 @@ class Sep31Tests : SepTests(TestConfig(testProfileName = "default")) { assertNull(gotSep31TxResponse.transaction.requiredInfoMessage) assertNotNull(patchedTx.completedAt) } - - fun testAll() { - println("Performing Sep31 tests...") - `test info endpoint`() - `test transactions`() - `test post and get transactions`() - `test patch, get and compare`() - `test bad requests`() - testBadAsset() - } } private const val postTxnRequest = diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep6Tests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/Sep6Tests.kt similarity index 87% rename from integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep6Tests.kt rename to integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/Sep6Tests.kt index 9ee8ea9593..410b376be4 100644 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep6Tests.kt +++ b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/Sep6Tests.kt @@ -1,13 +1,13 @@ -package org.stellar.anchor.platform.test +package org.stellar.anchor.platform.subtest +import org.junit.jupiter.api.Test import org.skyscreamer.jsonassert.JSONAssert import org.skyscreamer.jsonassert.JSONCompareMode import org.stellar.anchor.platform.Sep6Client +import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.platform.gson -import org.stellar.anchor.util.Log -import org.stellar.anchor.util.Sep1Helper.TomlContent -class Sep6Tests(val toml: TomlContent) { +class Sep6Tests : SepTests(TestConfig(testProfileName = "default")) { private val sep6Client = Sep6Client(toml.getString("TRANSFER_SERVER")) private val expectedSep6Info = @@ -85,13 +85,9 @@ class Sep6Tests(val toml: TomlContent) { """ .trimIndent() - private fun `test Sep6 info endpoint`() { + @Test + fun `test Sep6 info endpoint`() { val info = sep6Client.getInfo() JSONAssert.assertEquals(expectedSep6Info, gson.toJson(info), JSONCompareMode.LENIENT) } - - fun testAll() { - Log.info("Performing SEP6 tests") - `test Sep6 info endpoint`() - } } diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/StellarObserverTests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/StellarObserverTests.kt similarity index 91% rename from integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/StellarObserverTests.kt rename to integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/StellarObserverTests.kt index c73e8719fd..ea9104d814 100644 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/StellarObserverTests.kt +++ b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/subtest/StellarObserverTests.kt @@ -1,15 +1,18 @@ -package org.stellar.anchor.platform.test +package org.stellar.anchor.platform.subtest import java.util.concurrent.TimeUnit import okhttp3.OkHttpClient import okhttp3.Request import org.junit.jupiter.api.Assertions +import org.junit.jupiter.api.Test +import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.platform.gson -class StellarObserverTests { +class StellarObserverTests : SepTests(TestConfig(testProfileName = "default")) { companion object { const val OBSERVER_HEALTH_SERVER_PORT = 8083 } + private val httpClient: OkHttpClient = OkHttpClient.Builder() .connectTimeout(10, TimeUnit.MINUTES) @@ -17,6 +20,7 @@ class StellarObserverTests { .writeTimeout(10, TimeUnit.MINUTES) .build() + @Test fun testStellarObserverHealth() { val httpRequest = Request.Builder() @@ -56,9 +60,4 @@ class StellarObserverTests { Assertions.assertEquals(false, stream1["stopped"]) Assertions.assertNotNull(stream1["last_event_id"]) } - - fun testAll() { - println("Performing Stellar observer tests...") - testStellarObserverHealth() - } } diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/PlatformApiTests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/PlatformApiTests.kt deleted file mode 100644 index d465d1df64..0000000000 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/PlatformApiTests.kt +++ /dev/null @@ -1,3679 +0,0 @@ -package org.stellar.anchor.platform.test - -private const val SEP_24_DEPOSIT_COMPLETE_SHORT_FLOW_ACTION_REQUESTS = - """ -[ - { - "id": "1", - "method": "request_offchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 1", - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "100" - } - } - }, - { - "id": "2", - "method": "notify_offchain_funds_received", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 2", - "funds_received_at": "2023-07-04T12:34:56Z", - "external_transaction_id": "ext-123456", - "amount_in": { - "amount": "100" - } - } - }, - { - "id": "3", - "method": "notify_onchain_funds_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 3", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - } -] - """ - -private const val SEP_24_DEPOSIT_COMPLETE_SHORT_FLOW_ACTION_RESPONSES = - """ -[ - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_user_transfer_start", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T13:16:01.810865Z", - "updated_at": "2023-08-03T13:16:03.309042Z", - "message": "test message 1", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - }, - "id": "1" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_anchor", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T13:16:01.810865Z", - "updated_at": "2023-08-03T13:16:04.486424Z", - "message": "test message 2", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "2" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "completed", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T13:16:01.810865Z", - "updated_at": "2023-08-03T13:16:06.158111Z", - "completed_at": "2023-08-03T13:16:06.158118Z", - "message": "test message 3", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "3" - } -] - """ - -private const val SEP_24_DEPOSIT_COMPLETE_FULL_WITH_TRUST_FLOW_ACTION_REQUESTS = - """ -[ - { - "id": "1", - "method": "notify_interactive_flow_completed", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 1", - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "3" - } - } - }, - { - "id": "2", - "method": "request_offchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 2", - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "3", - "method": "notify_offchain_funds_received", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 3", - "funds_received_at": "2023-07-04T12:34:56Z", - "external_transaction_id": "ext-123456", - "amount_in": { - "amount": "10.11" - }, - "amount_out": { - "amount": "9" - }, - "amount_fee": { - "amount": "1.11" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "4", - "method": "request_trust", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 4" - } - }, - { - "id": "5", - "method": "notify_trust_set", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 5" - } - }, - { - "id": "6", - "method": "notify_onchain_funds_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 6", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - } -] - """ - -private const val SEP_24_DEPOSIT_COMPLETE_FULL_WITH_TRUST_FLOW_ACTION_RESPONSES = - """ -[ - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_anchor", - "amount_expected": { - "amount": "3", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T13:24:23.164990Z", - "updated_at": "2023-08-03T13:24:24.202429Z", - "message": "test message 1", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - }, - "id": "1" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_user_transfer_start", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T13:24:23.164990Z", - "updated_at": "2023-08-03T13:24:25.245103Z", - "message": "test message 2", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - }, - "id": "2" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_anchor", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T13:24:23.164990Z", - "updated_at": "2023-08-03T13:24:26.274735Z", - "message": "test message 3", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "3" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_trust", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T13:24:23.164990Z", - "updated_at": "2023-08-03T13:24:27.297727Z", - "message": "test message 4", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "4" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_anchor", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T13:24:23.164990Z", - "updated_at": "2023-08-03T13:24:28.344421Z", - "message": "test message 5", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "5" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "completed", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T13:24:23.164990Z", - "updated_at": "2023-08-03T13:24:30.907307Z", - "completed_at": "2023-08-03T13:24:30.907312Z", - "message": "test message 6", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "6" - } -] - """ - -private const val SEP_24_DEPOSIT_COMPLETE_FULL_WITH_RECOVERY_FLOW_ACTION_REQUESTS = - """ -[ - { - "id": "1", - "method": "request_offchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 1", - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "2", - "method": "notify_offchain_funds_received", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 2", - "funds_received_at": "2023-07-04T12:34:56Z", - "external_transaction_id": "ext-123456", - "amount_in": { - "amount": "10.11" - }, - "amount_out": { - "amount": "9" - }, - "amount_fee": { - "amount": "1.11" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "3", - "method": "notify_transaction_error", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 3" - } - }, - { - "id": "4", - "method": "notify_transaction_recovery", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 4" - } - }, - { - "id": "5", - "method": "notify_onchain_funds_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 5", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - } -] - """ - -private const val SEP_24_DEPOSIT_COMPLETE_FULL_WITH_RECOVERY_FLOW_ACTION_RESPONSES = - """ -[ - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_user_transfer_start", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T14:07:19.840308Z", - "updated_at": "2023-08-03T14:07:20.883323Z", - "message": "test message 1", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - }, - "id": "1" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_anchor", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T14:07:19.840308Z", - "updated_at": "2023-08-03T14:07:21.897462Z", - "message": "test message 2", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "2" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "error", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T14:07:19.840308Z", - "updated_at": "2023-08-03T14:07:22.924959Z", - "message": "test message 3", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "3" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_anchor", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T14:07:19.840308Z", - "updated_at": "2023-08-03T14:07:23.977509Z", - "message": "test message 4", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "4" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "completed", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T14:07:19.840308Z", - "updated_at": "2023-08-03T14:07:25.181690Z", - "completed_at": "2023-08-03T14:07:25.181694Z", - "message": "test message 5", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "5" - } -] - """ - -private const val SEP_24_DEPOSIT_COMPLETE_SHORT_PARTIAL_REFUND_FLOW_ACTION_REQUESTS = - """ -[ - { - "id": "1", - "method": "request_offchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 1", - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "2", - "method": "notify_offchain_funds_received", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 2", - "funds_received_at": "2023-07-04T12:34:56Z", - "external_transaction_id": "ext-123456", - "amount_in": { - "amount": "1000.11" - }, - "amount_out": { - "amount": "9" - }, - "amount_fee": { - "amount": "1.11" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "3", - "method": "notify_refund_pending", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 3", - "refund": { - "id": "123456", - "amount": { - "amount": "989.11", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "1", - "asset": "iso4217:USD" - } - } - } - }, - { - "id": "4", - "method": "notify_refund_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 4", - "refund": { - "id": "123456", - "amount": { - "amount": "989.11", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "1", - "asset": "iso4217:USD" - } - } - } - }, - { - "id": "5", - "method": "notify_onchain_funds_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 5", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - } -] - """ - -private const val SEP_24_DEPOSIT_COMPLETE_SHORT_PARTIAL_REFUND_FLOW_ACTION_RESPONSES = - """ -[ - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_user_transfer_start", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T14:32:55.369869Z", - "updated_at": "2023-08-03T14:32:56.401608Z", - "message": "test message 1", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - }, - "id": "1" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_anchor", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "1000.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T14:32:55.369869Z", - "updated_at": "2023-08-03T14:32:57.411722Z", - "message": "test message 2", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "2" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_external", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "1000.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T14:32:55.369869Z", - "updated_at": "2023-08-03T14:32:58.452076Z", - "message": "test message 3", - "refunds": { - "amount_refunded": { - "amount": "990.11", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "1", - "asset": "iso4217:USD" - }, - "payments": [ - { - "id": "123456", - "id_type": "stellar", - "amount": { - "amount": "989.11", - "asset": "iso4217:USD" - }, - "fee": { - "amount": "1", - "asset": "iso4217:USD" - } - } - ] - }, - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "3" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_anchor", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "1000.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T14:32:55.369869Z", - "updated_at": "2023-08-03T14:32:59.512350Z", - "message": "test message 4", - "refunds": { - "amount_refunded": { - "amount": "990.11", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "1", - "asset": "iso4217:USD" - }, - "payments": [ - { - "id": "123456", - "id_type": "stellar", - "amount": { - "amount": "989.11", - "asset": "iso4217:USD" - }, - "fee": { - "amount": "1", - "asset": "iso4217:USD" - } - } - ] - }, - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "4" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "completed", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "1000.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-03T14:32:55.369869Z", - "updated_at": "2023-08-03T14:33:00.668544Z", - "completed_at": "2023-08-03T14:33:00.668548Z", - "message": "test message 5", - "refunds": { - "amount_refunded": { - "amount": "990.11", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "1", - "asset": "iso4217:USD" - }, - "payments": [ - { - "id": "123456", - "id_type": "stellar", - "amount": { - "amount": "989.11", - "asset": "iso4217:USD" - }, - "fee": { - "amount": "1", - "asset": "iso4217:USD" - } - } - ] - }, - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "5" - } -] - """ - -private const val SEP_24_WITHDRAW_COMPLETE_SHORT_FLOW_ACTION_REQUESTS = - """ -[ - { - "id": "1", - "method": "request_onchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 1", - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_expected": { - "amount": "100" - } - } - }, - { - "id": "2", - "method": "notify_onchain_funds_received", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 2", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - }, - { - "id": "3", - "method": "notify_offchain_funds_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 3", - "external_transaction_id": "ext-123456" - } - } -] - """ - -private const val SEP_24_WITHDRAW_COMPLETE_SHORT_FLOW_ACTION_RESPONSES = - """ -[ - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "pending_user_transfer_start", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:43.957105200Z", - "message": "test message 1", - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "1" - }, - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "pending_anchor", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:45.138455Z", - "message": "test message 2", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "2" - }, - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "completed", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:46.190117600Z", - "completed_at": "2023-08-04T09:30:46.190117600Z", - "message": "test message 3", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "external_transaction_id": "ext-123456", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "3" - } -] -""" - -private const val SEP_24_WITHDRAW_COMPLETE_FULL_VIA_PENDING_EXTERNAL_FLOW_ACTION_REQUESTS = - """ -[ - { - "id": "1", - "method": "request_onchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 1", - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_expected": { - "amount": "100" - } - } - }, - { - "id": "2", - "method": "notify_onchain_funds_received", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 2", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - }, - { - "id": "3", - "method": "notify_offchain_funds_pending", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 3", - "external_transaction_id": "ext-123456" - } - }, - { - "id": "4", - "method": "notify_offchain_funds_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 4", - "external_transaction_id": "ext-123456" - } - } -] - """ - -private const val SEP_24_WITHDRAW_COMPLETE_FULL_VIA_PENDING_EXTERNAL_FLOW_ACTION_RESPONSES = - """ -[ - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "pending_user_transfer_start", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:43.957105200Z", - "message": "test message 1", - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "1" - }, - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "pending_anchor", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:45.138455Z", - "message": "test message 2", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "2" - }, - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "pending_external", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:46.190117600Z", - "message": "test message 3", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "external_transaction_id": "ext-123456", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "3" - }, - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "completed", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:46.190117600Z", - "completed_at": "2023-08-04T09:30:46.190117600Z", - "message": "test message 4", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "external_transaction_id": "ext-123456", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "4" - } -] -""" - -private const val SEP_24_WITHDRAW_COMPLETE_FULL_VIA_PENDING_USER_FLOW_ACTION_RESPONSES = - """ -[ - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "pending_user_transfer_start", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:43.957105200Z", - "message": "test message 1", - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "1" - }, - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "pending_anchor", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:45.138455Z", - "message": "test message 2", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "2" - }, - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "pending_user_transfer_complete", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:46.190117600Z", - "message": "test message 3", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "external_transaction_id": "ext-123456", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "3" - }, - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "completed", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:46.190117600Z", - "completed_at": "2023-08-04T09:30:46.190117600Z", - "message": "test message 4", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "external_transaction_id": "ext-123456", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "4" - } -] -""" - -private const val SEP_24_WITHDRAW_COMPLETE_FULL_VIA_PENDING_USER_FLOW_ACTION_REQUESTS = - """ -[ - { - "id": "1", - "method": "request_onchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 1", - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_expected": { - "amount": "100" - } - } - }, - { - "id": "2", - "method": "notify_onchain_funds_received", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 2", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - }, - { - "id": "3", - "method": "notify_offchain_funds_available", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 3", - "external_transaction_id": "ext-123456" - } - }, - { - "id": "4", - "method": "notify_offchain_funds_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 4", - "external_transaction_id": "ext-123456" - } - } -] - """ - -private const val SEP_24_WITHDRAW_FULL_REFUND_FLOW_ACTION_REQUESTS = - """ -[ - { - "id": "1", - "method": "request_onchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 1", - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_expected": { - "amount": "100" - } - } - }, - { - "id": "2", - "method": "notify_onchain_funds_received", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 2", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - }, - { - "id": "3", - "method": "notify_refund_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 3", - "refund": { - "id": "123456", - "amount": { - "amount": 95, - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": 5, - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - } - } - } - } -] - """ - -private const val SEP_24_WITHDRAW_FULL_REFUND_FLOW_ACTION_RESPONSES = - """ - [ - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "pending_user_transfer_start", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:43.957105200Z", - "message": "test message 1", - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "1" - }, - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "pending_anchor", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:45.138455Z", - "message": "test message 2", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "2" - }, - { - "jsonrpc": "2.0", - "result": { - "id": TX_ID, - "sep": "24", - "kind": "withdrawal", - "status": "refunded", - "amount_expected": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "95", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-04T09:30:42.895791Z", - "updated_at": "2023-08-04T09:30:46.190117600Z", - "completed_at": "2023-08-04T09:30:46.190117600Z", - "message": "test message 3", - "refunds": { - "amount_refunded": { - "amount": "100", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payments": [ - { - "id": "123456", - "id_type": "stellar", - "amount": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "fee": { - "amount": "5", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - } - } - ] - }, - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "source_account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "destination_account": "GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF", - "memo": "MTkwYjA2NTAtMDcwNy00YmMzLTk1MjEtM2ZhYzY4MzU=", - "memo_type": "hash" - }, - "id": "3" - } -] -""" - -private const val SEP_31_RECEIVE_REFUNDED_SHORT_FLOW_ACTION_REQUESTS = - """ -[ - { - "id": "1", - "method": "notify_onchain_funds_received", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 1", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - }, - { - "id": "2", - "method": "notify_refund_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 2", - "refund": { - "id": "123456", - "amount": { - "amount": "1", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - } - } - } - } -] - """ - -private const val SEP_31_RECEIVE_REFUNDED_SHORT_FLOW_ACTION_RESPONSES = - """ -[ - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "31", - "kind": "receive", - "status": "pending_receiver", - "amount_expected": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": {}, - "amount_fee": { - "amount": "0.3", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-03T15:14:02.506800Z", - "updated_at": "2023-08-03T15:14:05.060150Z", - "transfer_received_at": "2023-06-22T08:46:56Z", - "message": "test message 1", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "NTY3NWI1YzctMGVmNC00NTY2LWFmMGMtOWY4MGVmMjg=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "customers": { - "sender": { - "id": "SENDER_ID" - }, - "receiver": { - "id": "RECEIVER_ID" - } - }, - "creator": { - "account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - } - }, - "id": "1" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "31", - "kind": "receive", - "status": "pending_anchor", - "amount_expected": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": {}, - "amount_fee": { - "amount": "0.3", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-03T15:14:02.506800Z", - "updated_at": "2023-08-03T15:14:06.437196Z", - "transfer_received_at": "2023-06-22T08:46:56Z", - "message": "test message 2", - "refunds": { - "amount_refunded": { - "amount": "2", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payments": [ - { - "id": "123456", - "id_type": "stellar", - "amount": { - "amount": "1", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "fee": { - "amount": "1", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - } - } - ] - }, - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "NTY3NWI1YzctMGVmNC00NTY2LWFmMGMtOWY4MGVmMjg=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "customers": { - "sender": { - "id": "SENDER_ID" - }, - "receiver": { - "id": "RECEIVER_ID" - } - }, - "creator": { - "account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - } - }, - "id": "2" - } -] - """ - -private const val SEP_31_RECEIVE_COMPLETE_FULL_WITH_RECOVERY_FLOW_ACTION_REQUESTS = - """ -[ - { - "id": "1", - "method": "notify_onchain_funds_received", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 1", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - }, - { - "id": "2", - "method": "request_customer_info_update", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 2" - } - }, - { - "id": "3", - "method": "notify_customer_info_updated", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 3" - } - }, - { - "id": "4", - "method": "notify_transaction_error", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 4" - } - }, - { - "id": "5", - "method": "notify_transaction_recovery", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 5" - } - }, - { - "id": "6", - "method": "notify_offchain_funds_pending", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 6", - "external_transaction_id": "ext123456789" - } - }, - { - "id": "7", - "method": "notify_offchain_funds_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 7", - "external_transaction_id": "ext123456789" - } - } -] - """ - -private const val SEP_31_RECEIVE_COMPLETE_FULL_WITH_RECOVERY_FLOW_ACTION_RESPONSES = - """ -[ - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "31", - "kind": "receive", - "status": "pending_receiver", - "amount_expected": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": {}, - "amount_fee": { - "amount": "0.3", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-07T08:01:24.478460Z", - "updated_at": "2023-08-07T08:01:25.680087Z", - "transfer_received_at": "2023-06-22T08:46:56Z", - "message": "test message 1", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "ZmQzY2I4M2YtY2UwNC00Mjc2LWFiYzEtY2QzNWUzNDk=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "customers": { - "sender": { - "id": "SENDER_ID" - }, - "receiver": { - "id": "RECEIVER_ID" - } - }, - "creator": { - "account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - } - }, - "id": "1" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "31", - "kind": "receive", - "status": "pending_customer_info_update", - "amount_expected": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": {}, - "amount_fee": { - "amount": "0.3", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-07T08:01:24.478460Z", - "updated_at": "2023-08-07T08:01:26.692095Z", - "transfer_received_at": "2023-06-22T08:46:56Z", - "message": "test message 2", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "ZmQzY2I4M2YtY2UwNC00Mjc2LWFiYzEtY2QzNWUzNDk=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "customers": { - "sender": { - "id": "SENDER_ID" - }, - "receiver": { - "id": "RECEIVER_ID" - } - }, - "creator": { - "account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - } - }, - "id": "2" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "31", - "kind": "receive", - "status": "pending_receiver", - "amount_expected": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": {}, - "amount_fee": { - "amount": "0.3", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-07T08:01:24.478460Z", - "updated_at": "2023-08-07T08:01:27.729558Z", - "transfer_received_at": "2023-06-22T08:46:56Z", - "message": "test message 3", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "ZmQzY2I4M2YtY2UwNC00Mjc2LWFiYzEtY2QzNWUzNDk=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "customers": { - "sender": { - "id": "SENDER_ID" - }, - "receiver": { - "id": "RECEIVER_ID" - } - }, - "creator": { - "account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - } - }, - "id": "3" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "31", - "kind": "receive", - "status": "error", - "amount_expected": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": {}, - "amount_fee": { - "amount": "0.3", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-07T08:01:24.478460Z", - "updated_at": "2023-08-07T08:01:28.769798Z", - "transfer_received_at": "2023-06-22T08:46:56Z", - "message": "test message 4", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "ZmQzY2I4M2YtY2UwNC00Mjc2LWFiYzEtY2QzNWUzNDk=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "customers": { - "sender": { - "id": "SENDER_ID" - }, - "receiver": { - "id": "SENDER_ID" - } - }, - "creator": { - "account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - } - }, - "id": "4" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "31", - "kind": "receive", - "status": "pending_receiver", - "amount_expected": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": {}, - "amount_fee": { - "amount": "0.3", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-07T08:01:24.478460Z", - "updated_at": "2023-08-07T08:01:29.797331Z", - "transfer_received_at": "2023-06-22T08:46:56Z", - "message": "test message 5", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "ZmQzY2I4M2YtY2UwNC00Mjc2LWFiYzEtY2QzNWUzNDk=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "customers": { - "sender": { - "id": "SENDER_ID" - }, - "receiver": { - "id": "RECEIVER_ID" - } - }, - "creator": { - "account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - } - }, - "id": "5" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "31", - "kind": "receive", - "status": "pending_external", - "amount_expected": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": {}, - "amount_fee": { - "amount": "0.3", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-07T08:01:24.478460Z", - "updated_at": "2023-08-07T08:01:30.816913Z", - "transfer_received_at": "2023-06-22T08:46:56Z", - "message": "test message 6", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "ZmQzY2I4M2YtY2UwNC00Mjc2LWFiYzEtY2QzNWUzNDk=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "external_transaction_id": "ext123456789", - "customers": { - "sender": { - "id": "SENDER_ID" - }, - "receiver": { - "id": "RECEIVER_ID" - } - }, - "creator": { - "account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - } - }, - "id": "6" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "31", - "kind": "receive", - "status": "completed", - "amount_expected": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in": { - "amount": "10", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": {}, - "amount_fee": { - "amount": "0.3", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "started_at": "2023-08-07T08:01:24.478460Z", - "updated_at": "2023-08-07T08:01:31.828811Z", - "completed_at": "2023-08-07T08:01:31.828809Z", - "transfer_received_at": "2023-06-22T08:46:56Z", - "message": "test message 7", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "memo": "ZmQzY2I4M2YtY2UwNC00Mjc2LWFiYzEtY2QzNWUzNDk=", - "memo_type": "hash", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "external_transaction_id": "ext123456789", - "customers": { - "sender": { - "id": "SENDER_ID" - }, - "receiver": { - "id": "RECEIVER_ID" - } - }, - "creator": { - "account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - } - }, - "id": "7" - } -] - """ - -private const val VALIDATIONS_AND_ERRORS_REQUESTS = - """ -[ - { - "id": "1", - "method": "notify_interactive_flow_completed", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_1", - "message": "test message 1", - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "3" - } - } - }, - { - "method": "notify_interactive_flow_completed", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 2", - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "3" - } - } - }, - { - "id": "3", - "method": "notify_interactive_flow_completed", - "jsonrpc": "3.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 3", - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "3" - } - } - }, - { - "id": "4", - "method": "unsupported method", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 4", - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "3" - } - } - }, - { - "id": "5", - "method": "request_onchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 5", - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "6", - "method": "request_offchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 6", - "amount_in": { - "amount": "10.11", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_out": { - "amount": "9", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "1.11", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "7", - "method": "request_offchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 7", - "amount_in": { - "amount": "0", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5iso4217:USD" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "8", - "method": "request_offchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 8", - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "0", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5iso4217:USD" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "9", - "method": "request_offchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 9", - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso111:III" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "10", - "method": "notify_interactive_flow_completed", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 10", - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "3" - } - } - }, - { - "id": "11", - "method": "notify_interactive_flow_completed", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 11", - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "3" - } - } - }, - { - "id": "12", - "method": "request_offchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 12", - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "13", - "method": "request_offchain_funds", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 13", - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "14", - "method": "notify_onchain_funds_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 14", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - }, - { - "id": "15", - "method": "notify_offchain_funds_received", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 15", - "funds_received_at": "2023-07-04T12:34:56Z", - "external_transaction_id": "ext-123456", - "amount_in": { - "amount": "10.11" - }, - "amount_out": { - "amount": "9" - }, - "amount_fee": { - "amount": "1.11" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "16", - "method": "notify_offchain_funds_received", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 16", - "funds_received_at": "2023-07-04T12:34:56Z", - "external_transaction_id": "ext-123456", - "amount_in": { - "amount": "10.11" - }, - "amount_out": { - "amount": "9" - }, - "amount_fee": { - "amount": "1.11" - }, - "amount_expected": { - "amount": "10.11" - } - } - }, - { - "id": "17", - "method": "notify_refund_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 17", - "refund": { - "id": "123456", - "amount": { - "amount": "989.11", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "1", - "asset": "iso4217:USD" - } - } - } - }, - { - "id": "18", - "method": "notify_refund_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 18", - "refund": { - "id": "123456", - "amount": { - "amount": "989.11", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - } - } - } - }, - { - "id": "19", - "method": "notify_onchain_funds_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 19", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - }, - { - "id": "20", - "method": "notify_onchain_funds_sent", - "jsonrpc": "2.0", - "params": { - "transaction_id": "TX_ID", - "message": "test message 20", - "stellar_transaction_id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1" - } - } -] - """ - -private const val VALIDATIONS_AND_ERRORS_RESPONSES = - """ -[ - { - "jsonrpc": "2.0", - "error": { - "id": "TX_1", - "code": -32600, - "message": "Transaction with id[TX_1] is not found" - }, - "id": "1" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32600, - "message": "Id can't be NULL" - } - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32600, - "message": "Unsupported JSON-RPC protocol version[3.0]" - }, - "id": "3" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32601, - "message": "No matching RPC method[unsupported method]" - }, - "id": "4" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32600, - "message": "RPC method[request_onchain_funds] is not supported. Status[incomplete], kind[deposit], protocol[24], funds received[false]" - }, - "id": "5" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32602, - "message": "amount_in.asset should be non-stellar asset" - }, - "id": "6" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32602, - "message": "amount_in.amount should be positive" - }, - "id": "7" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32602, - "message": "amount_out.amount should be positive" - }, - "id": "8" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32602, - "message": "'iso111:III' is not a supported asset." - }, - "id": "9" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_anchor", - "amount_expected": { - "amount": "3", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "95", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "5", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-07T10:53:58.811934Z", - "updated_at": "2023-08-07T10:53:59.928900700Z", - "message": "test message 10", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - }, - "id": "10" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32600, - "message": "RPC method[notify_interactive_flow_completed] is not supported. Status[pending_anchor], kind[deposit], protocol[24], funds received[false]" - }, - "id": "11" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_user_transfer_start", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-07T10:53:58.811934Z", - "updated_at": "2023-08-07T10:54:00.955526600Z", - "message": "test message 12", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - }, - "id": "12" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32600, - "message": "RPC method[request_offchain_funds] is not supported. Status[pending_user_transfer_start], kind[deposit], protocol[24], funds received[false]" - }, - "id": "13" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32600, - "message": "RPC method[notify_onchain_funds_sent] is not supported. Status[pending_user_transfer_start], kind[deposit], protocol[24], funds received[false]" - }, - "id": "14" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "pending_anchor", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-07T10:53:58.811934Z", - "updated_at": "2023-08-07T10:54:01.996630700Z", - "message": "test message 15", - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "15" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32600, - "message": "RPC method[notify_offchain_funds_received] is not supported. Status[pending_anchor], kind[deposit], protocol[24], funds received[true]" - }, - "id": "16" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32602, - "message": "Refund amount exceeds amount_in" - }, - "id": "17" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32602, - "message": "refund.amount.asset does not match transaction amount_in_asset" - }, - "id": "18" - }, - { - "jsonrpc": "2.0", - "result": { - "id": "TX_ID", - "sep": "24", - "kind": "deposit", - "status": "completed", - "amount_expected": { - "amount": "10.11", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_in": { - "amount": "10.11", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "1.11", - "asset": "iso4217:USD" - }, - "started_at": "2023-08-07T10:53:58.811934Z", - "updated_at": "2023-08-07T10:54:03.165199600Z", - "completed_at": "2023-08-07T10:54:03.165199600Z", - "message": "test message 19", - "stellar_transactions": [ - { - "id": "fba01f815acfe1f493271017f02929e97e30656ba57a5ac8f3d1356dd4926ea1", - "created_at": "2023-06-22T08:46:56Z", - "envelope": "AAAAAgAAAABBsSNsYI9mqhg2INua8oEzk88ixjqc/Yiq0/4MNDIcAwAPQkAAAcGcAAAACAAAAAEAAAAAIHqjOgAAAABklDSfAAAAAAAAAAEAAAAAAAAAAQAAAAC9yF4ErTewnyaxhbV7fzgFiY7A8k7xt62CIhYMXt/ovgAAAAFVU0RDAAAAAEI+fQXy7K+/7BkrIVo/G+lq7bjY5wJUq+NBPgIH3layAAAAAAKupUAAAAAAAAAAATQyHAMAAABAUjCaXkOy4VHDpkVwG42lF7ZKK471bMsKSjP2EZtYnBo4e/kYtcVNp+z15EX/qHZBvGWtbFiCBBLXQs7hmu15Cg==", - "payments": [ - { - "id": "563306435719169", - "amount": { - "amount": "4.5000000", - "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "payment_type": "payment", - "source_account": "GBA3CI3MMCHWNKQYGYQNXGXSQEZZHTZCYY5JZ7MIVLJ74DBUGIOAGNV6", - "destination_account": "GC64QXQEVU33BHZGWGC3K637HACYTDWA6JHPDN5NQIRBMDC637UL4F2W" - } - ] - } - ], - "destination_account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "external_transaction_id": "ext-123456" - }, - "id": "19" - }, - { - "jsonrpc": "2.0", - "error": { - "id": "TX_ID", - "code": -32600, - "message": "RPC method[notify_onchain_funds_sent] is not supported. Status[completed], kind[deposit], protocol[24], funds received[true]" - }, - "id": "20" - } -] - """ - -private const val SEP_24_DEPOSIT_FLOW_REQUEST = """ -{ - "asset_code": "USDC" -} - """ - -private const val SEP_24_WITHDRAW_FLOW_REQUEST = - """{ - "amount": "10", - "asset_code": "USDC", - "asset_issuer": "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5", - "account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "lang": "en" -}""" - -private const val SEP_31_RECEIVE_FLOW_REQUEST = - """ -{ - "amount": "10", - "asset_code": "USDC", - "asset_issuer": "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5", - "receiver_id": "RECEIVER_ID", - "sender_id": "SENDER_ID", - "fields": { - "transaction": { - "receiver_routing_number": "r0123", - "receiver_account_number": "a0456", - "type": "SWIFT" - } - } -} - """ - -private const val SEP_24_DEPOSIT_REQUEST = - """{ - "asset_code": "USDC", - "asset_issuer": "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5", - "lang": "en" - }""" - -private const val REQUEST_OFFCHAIN_FUNDS_PARAMS = - """{ - "transaction_id": "testTxId", - "message": "test message", - "amount_in": { - "amount": "1", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "0.9", - "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee": { - "amount": "0.1", - "asset": "iso4217:USD" - }, - "amount_expected": { - "amount": "1" - } - }""" - -private const val NOTIFY_OFFCHAIN_FUNDS_RECEIVED_PARAMS = - """{ - "transaction_id": "testTxId", - "message": "test message", - "amount_in": { - "amount": "1" - }, - "amount_out": { - "amount": "0.9" - }, - "amount_fee": { - "amount": "0.1" - }, - "external_transaction_id": "1" - }""" - -private const val EXPECTED_RPC_RESPONSE = - """ - [ - { - "jsonrpc":"2.0", - "result":{ - "id":"testTxId", - "sep":"24", - "kind":"deposit", - "status":"pending_user_transfer_start", - "amount_expected":{ - "amount":"1", - "asset":"stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in":{ - "amount":"1", - "asset":"iso4217:USD" - }, - "amount_out":{ - "amount":"0.9", - "asset":"stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee":{ - "amount":"0.1", - "asset":"iso4217:USD" - }, - "started_at":"2023-07-20T08:57:05.380736Z", - "updated_at":"2023-07-20T08:57:16.672110400Z", - "message":"test message", - "destination_account":"GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - }, - "id":1 - } -] -""" - -private const val EXPECTED_RPC_BATCH_RESPONSE = - """ - [ - { - "jsonrpc":"2.0", - "result":{ - "id":"testTxId", - "sep":"24", - "kind":"deposit", - "status":"pending_user_transfer_start", - "amount_expected":{ - "amount":"1", - "asset":"stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in":{ - "amount":"1", - "asset":"iso4217:USD" - }, - "amount_out":{ - "amount":"0.9", - "asset":"stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee":{ - "amount":"0.1", - "asset":"iso4217:USD" - }, - "started_at":"2023-07-20T09:07:51.007629Z", - "updated_at":"2023-07-20T09:07:59.425534900Z", - "message":"test message", - "destination_account":"GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - }, - "id":1 - }, - { - "jsonrpc":"2.0", - "result":{ - "id":"testTxId", - "sep":"24", - "kind":"deposit", - "status":"pending_anchor", - "amount_expected":{ - "amount":"1", - "asset":"stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_in":{ - "amount":"1", - "asset":"iso4217:USD" - }, - "amount_out":{ - "amount":"0.9", - "asset":"stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" - }, - "amount_fee":{ - "amount":"0.1", - "asset":"iso4217:USD" - }, - "started_at":"2023-07-20T09:07:51.007629Z", - "updated_at":"2023-07-20T09:07:59.448888600Z", - "message":"test message", - "external_transaction_id": "1", - "destination_account":"GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - }, - "id":2 - } -] -""" - -private const val CUSTOMER_1 = - """ -{ - "first_name": "John", - "last_name": "Doe", - "email_address": "johndoe@test.com", - "address": "123 Washington Street", - "city": "San Francisco", - "state_or_province": "CA", - "address_country_code": "US", - "clabe_number": "1234", - "bank_number": "abcd", - "bank_account_number": "1234", - "bank_account_type": "checking" -} -""" - -private const val CUSTOMER_2 = - """ -{ - "first_name": "Jane", - "last_name": "Doe", - "email_address": "janedoe@test.com", - "address": "321 Washington Street", - "city": "San Francisco", - "state_or_province": "CA", - "address_country_code": "US", - "clabe_number": "5678", - "bank_number": "efgh", - "bank_account_number": "5678", - "bank_account_type": "checking" -} -""" diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep10Tests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep10Tests.kt deleted file mode 100644 index 20b74ead5b..0000000000 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep10Tests.kt +++ /dev/null @@ -1,62 +0,0 @@ -package org.stellar.anchor.platform.test - -import kotlin.test.assertFailsWith -import org.stellar.anchor.api.exception.SepNotAuthorizedException -import org.stellar.anchor.api.sep.sep10.ValidationRequest -import org.stellar.anchor.platform.* -import org.stellar.anchor.util.Sep1Helper.TomlContent - -class Sep10Tests(val toml: TomlContent) { - lateinit var sep10Client: Sep10Client - lateinit var sep10ClientMultiSig: Sep10Client - - init { - if (!::sep10Client.isInitialized) { - sep10Client = - Sep10Client( - toml.getString("WEB_AUTH_ENDPOINT"), - toml.getString("SIGNING_KEY"), - CLIENT_WALLET_ACCOUNT, - CLIENT_WALLET_SECRET - ) - } - if (!::sep10ClientMultiSig.isInitialized) { - sep10ClientMultiSig = - Sep10Client( - toml.getString("WEB_AUTH_ENDPOINT"), - toml.getString("SIGNING_KEY"), - CLIENT_WALLET_ACCOUNT, - arrayOf( - CLIENT_WALLET_SECRET, - CLIENT_WALLET_EXTRA_SIGNER_1_SECRET, - CLIENT_WALLET_EXTRA_SIGNER_2_SECRET - ) - ) - } - } - - fun testMultiSig() { - sep10ClientMultiSig.auth() - } - - fun testOk(): String { - return sep10Client.auth() - } - - fun testUnsignedChallenge() { - val challenge = sep10Client.challenge() - - assertFailsWith( - exceptionClass = SepNotAuthorizedException::class, - block = { sep10Client.validate(ValidationRequest.of(challenge.transaction)) } - ) - } - - fun testAll() { - println("Performing SEP10 tests...") - - testOk() - testUnsignedChallenge() - testMultiSig() - } -} diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep12Tests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep12Tests.kt deleted file mode 100644 index 22ae3f78eb..0000000000 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep12Tests.kt +++ /dev/null @@ -1,106 +0,0 @@ -package org.stellar.anchor.platform.test - -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.assertThrows -import org.stellar.anchor.api.exception.SepNotFoundException -import org.stellar.anchor.api.sep.sep12.Sep12PutCustomerRequest -import org.stellar.anchor.api.sep.sep12.Sep12Status -import org.stellar.anchor.platform.* -import org.stellar.anchor.util.GsonUtils -import org.stellar.anchor.util.Sep1Helper - -const val testCustomer1Json = - """ -{ - "first_name": "John", - "last_name": "Doe", - "email_address": "johndoe@test.com", - "address": "123 Washington Street", - "city": "San Francisco", - "state_or_province": "CA", - "address_country_code": "US", - "clabe_number": "1234", - "bank_number": "abcd", - "bank_account_number": "1234", - "bank_account_type": "checking" -} -""" - -const val testCustomer2Json = - """ -{ - "first_name": "Jane", - "last_name": "Doe", - "email_address": "janedoe@test.com", - "address": "321 Washington Street", - "city": "San Francisco", - "state_or_province": "CA", - "address_country_code": "US", - "clabe_number": "5678", - "bank_number": "efgh", - "bank_account_number": "5678", - "bank_account_type": "checking" -} -""" - -class Sep12Tests(config: TestConfig, toml: Sep1Helper.TomlContent, jwt: String) { - private lateinit var sep12Client: Sep12Client - - init { - println("Performing SEP12 tests...") - if (!::sep12Client.isInitialized) { - sep12Client = Sep12Client(toml.getString("KYC_SERVER"), jwt) - } - } - - fun `test put, get customers`() { - val customer = - GsonUtils.getInstance().fromJson(testCustomer1Json, Sep12PutCustomerRequest::class.java) - customer.emailAddress = null - - // Upload a customer - printRequest("Calling PUT /customer", customer) - var pr = sep12Client.putCustomer(customer) - printResponse(pr) - - // make sure the customer was uploaded correctly. - printRequest("Calling GET /customer", customer) - var gr = sep12Client.getCustomer(pr!!.id) - printResponse(gr) - - assertEquals(pr.id, gr?.id) - - customer.emailAddress = "john.doe@stellar.org" - customer.type = "sep31-receiver" - - // Modify the customer - printRequest("Calling PUT /customer", customer) - pr = sep12Client.putCustomer(customer) - printResponse(pr) - - // Make sure the customer is modified correctly. - printRequest("Calling GET /customer", customer) - gr = sep12Client.getCustomer(pr!!.id) - printResponse(gr) - - assertEquals(pr.id, gr?.id) - assertEquals(Sep12Status.ACCEPTED, gr?.status) - - // Delete the customer - printRequest("Calling DELETE /customer/$CLIENT_WALLET_ACCOUNT") - val code = sep12Client.deleteCustomer(CLIENT_WALLET_ACCOUNT) - printResponse(code) - // currently, not implemented - assertEquals(200, code) - - val id = pr.id - val ex: SepNotFoundException = assertThrows { sep12Client.getCustomer(id) } - assertEquals("customer for 'id' '$id' not found", ex.message) - println(ex) - } - - fun testAll() { - println("Performing Sep12 tests...") - `test put, get customers`() - } -} diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24Tests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24Tests.kt deleted file mode 100644 index 2ffda78a9d..0000000000 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24Tests.kt +++ /dev/null @@ -1,428 +0,0 @@ -@file:Suppress("UNCHECKED_CAST") - -package org.stellar.anchor.platform.test - -import kotlin.test.assertNotNull -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.assertThrows -import org.skyscreamer.jsonassert.JSONAssert -import org.skyscreamer.jsonassert.JSONCompareMode.LENIENT -import org.springframework.web.util.UriComponentsBuilder -import org.stellar.anchor.api.exception.SepException -import org.stellar.anchor.api.platform.PatchTransactionsRequest -import org.stellar.anchor.api.sep.sep24.Sep24GetTransactionResponse -import org.stellar.anchor.apiclient.PlatformApiClient -import org.stellar.anchor.auth.AuthHelper -import org.stellar.anchor.auth.JwtService -import org.stellar.anchor.auth.Sep24InteractiveUrlJwt -import org.stellar.anchor.auth.Sep24MoreInfoUrlJwt -import org.stellar.anchor.platform.* -import org.stellar.anchor.util.Sep1Helper.* -import org.stellar.anchor.util.StringHelper.json - -lateinit var savedWithdrawTxn: Sep24GetTransactionResponse -lateinit var savedDepositTxn: Sep24GetTransactionResponse - -class Sep24Tests(val config: TestConfig, val toml: TomlContent, jwt: String) { - private val jwtService: JwtService = - JwtService( - config.env["secret.sep10.jwt_secret"]!!, - config.env["secret.sep24.interactive_url.jwt_secret"]!!, - config.env["secret.sep24.more_info_url.jwt_secret"]!!, - config.env["secret.callback_api.auth_secret"]!!, - config.env["secret.platform_api.auth_secret"]!!, - null - ) - - private val platformApiClient = - PlatformApiClient(AuthHelper.forNone(), config.env["platform.server.url"]!!) - private val sep24Client = Sep24Client(toml.getString("TRANSFER_SERVER_SEP0024"), jwt) - - private fun `test Sep24 info endpoint`() { - printRequest("Calling GET /info") - val info = sep24Client.getInfo() - JSONAssert.assertEquals(expectedSep24Info, gson.toJson(info), LENIENT) - } - - private fun `test Sep24 withdraw`() { - printRequest("POST /transactions/withdraw/interactive") - val withdrawRequest = gson.fromJson(withdrawRequest, HashMap::class.java) - val response = sep24Client.withdraw(withdrawRequest as HashMap) - printResponse("POST /transactions/withdraw/interactive response:", response) - savedWithdrawTxn = sep24Client.getTransaction(response.id, "USDC") - printResponse(savedWithdrawTxn) - JSONAssert.assertEquals(expectedSep24WithdrawResponse, json(savedWithdrawTxn), LENIENT) - // check the returning Sep24InteractiveUrlJwt - val params = UriComponentsBuilder.fromUriString(response.url).build().queryParams - val cipher = params["token"]!![0] - val jwt = jwtService.decode(cipher, Sep24InteractiveUrlJwt::class.java) - assertEquals(response.id, jwt.jti) - } - - private fun `test Sep24 deposit`() { - printRequest("POST /transactions/withdraw/interactive") - val depositRequest = gson.fromJson(depositRequest, HashMap::class.java) - val response = sep24Client.deposit(depositRequest as HashMap) - printResponse("POST /transactions/deposit/interactive response:", response) - savedDepositTxn = sep24Client.getTransaction(response.id, "USDC") - printResponse(savedDepositTxn) - JSONAssert.assertEquals(expectedSep24DepositResponse, json(savedDepositTxn), LENIENT) - // check the returning Sep24InteractiveUrlJwt - val params = UriComponentsBuilder.fromUriString(response.url).build().queryParams - val cipher = params["token"]!![0] - val jwt = jwtService.decode(cipher, Sep24InteractiveUrlJwt::class.java) - assertEquals(response.id, jwt.jti) - assertNotNull(jwt.claims["data"]) - assertNotNull((jwt.claims["data"] as HashMap)["asset"]) - } - - private fun `test Sep24 deposit no issuer`() { - printRequest("POST /transactions/withdraw/interactive") - val depositRequest = gson.fromJson(depositRequestNoIssuer, HashMap::class.java) - val response = sep24Client.deposit(depositRequest as HashMap) - printResponse("POST /transactions/deposit/interactive response:", response) - savedDepositTxn = sep24Client.getTransaction(response.id, "USDC") - printResponse(savedDepositTxn) - JSONAssert.assertEquals(expectedSep24DepositResponse, json(savedDepositTxn), LENIENT) - // check the returning Sep24InteractiveUrlJwt - val params = UriComponentsBuilder.fromUriString(response.url).build().queryParams - val cipher = params["token"]!![0] - val jwt = jwtService.decode(cipher, Sep24InteractiveUrlJwt::class.java) - assertEquals(response.id, jwt.jti) - assertNotNull(jwt.claims["data"]) - assertNotNull((jwt.claims["data"] as HashMap)["asset"]) - } - - private fun `test Sep24 GET transaction and check the JWT`() { - val txn = - sep24Client - .getTransaction( - savedDepositTxn.transaction.id, - "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - ) - .transaction - - val params = UriComponentsBuilder.fromUriString(txn.moreInfoUrl).build().queryParams - val cipher = params["token"]!![0] - val jwt = jwtService.decode(cipher, Sep24MoreInfoUrlJwt::class.java) - assertEquals(txn.id, jwt.jti) - } - - private fun `test PlatformAPI GET transaction for deposit and withdrawal`() { - val actualWithdrawTxn = platformApiClient.getTransaction(savedWithdrawTxn.transaction.id) - assertEquals(actualWithdrawTxn.id, savedWithdrawTxn.transaction.id) - println(expectedWithdrawTransactionResponse) - println(json(actualWithdrawTxn)) - JSONAssert.assertEquals(expectedWithdrawTransactionResponse, json(actualWithdrawTxn), LENIENT) - - val actualDepositTxn = platformApiClient.getTransaction(savedDepositTxn.transaction.id) - printResponse(actualDepositTxn) - assertEquals(actualDepositTxn.id, savedDepositTxn.transaction.id) - JSONAssert.assertEquals(expectedDepositTransactionResponse, json(actualDepositTxn), LENIENT) - } - - private fun `test patch, get and compare`() { - val patch = gson.fromJson(patchWithdrawTransactionRequest, PatchTransactionsRequest::class.java) - // create patch request and patch - patch.records[0].transaction.id = savedWithdrawTxn.transaction.id - patch.records[1].transaction.id = savedDepositTxn.transaction.id - platformApiClient.patchTransaction(patch) - - // check if the patched transactions are as expected - var afterPatchWithdraw = platformApiClient.getTransaction(savedWithdrawTxn.transaction.id) - assertEquals(afterPatchWithdraw.id, savedWithdrawTxn.transaction.id) - JSONAssert.assertEquals(expectedAfterPatchWithdraw, json(afterPatchWithdraw), LENIENT) - - var afterPatchDeposit = platformApiClient.getTransaction(savedDepositTxn.transaction.id) - assertEquals(afterPatchDeposit.id, savedDepositTxn.transaction.id) - JSONAssert.assertEquals(expectedAfterPatchDeposit, json(afterPatchDeposit), LENIENT) - - // Test patch idempotency - afterPatchWithdraw = platformApiClient.getTransaction(savedWithdrawTxn.transaction.id) - assertEquals(afterPatchWithdraw.id, savedWithdrawTxn.transaction.id) - JSONAssert.assertEquals(expectedAfterPatchWithdraw, json(afterPatchWithdraw), LENIENT) - - afterPatchDeposit = platformApiClient.getTransaction(savedDepositTxn.transaction.id) - assertEquals(afterPatchDeposit.id, savedDepositTxn.transaction.id) - JSONAssert.assertEquals(expectedAfterPatchDeposit, json(afterPatchDeposit), LENIENT) - } - - private fun `test GET transactions with bad ids`() { - val badTxnIds = listOf("null", "bad id", "123", null) - for (txnId in badTxnIds) { - assertThrows { platformApiClient.getTransaction(txnId) } - } - } - - fun testAll() { - println("Performing SEP24 tests...") - `test Sep24 info endpoint`() - `test Sep24 withdraw`() - `test Sep24 deposit`() - `test Sep24 deposit no issuer`() - `test Sep24 GET transaction and check the JWT`() - `test PlatformAPI GET transaction for deposit and withdrawal`() - `test patch, get and compare`() - `test GET transactions with bad ids`() - } -} - -private const val withdrawRequest = - """{ - "amount": "10", - "asset_code": "USDC", - "asset_issuer": "GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP", - "account": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4", - "lang": "en" -}""" - -private const val depositRequest = - """{ - "amount": "10", - "asset_code": "USDC", - "asset_issuer": "GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP", - "account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "lang": "en" -}""" - -private const val depositRequestNoIssuer = - """{ - "amount": "10", - "asset_code": "USDC", - "account": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG", - "lang": "en" -}""" - -private const val patchWithdrawTransactionRequest = - """ -{ - "records": [ - { - "transaction": { - "id": "", - "status": "completed", - "amount_in": { - "amount": "10", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_out": { - "amount": "10", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "1", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "message": "this is the message", - "refunds": { - "amount_refunded": { - "amount": "1", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_fee": { - "amount": "0.1", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "payments": [ - { - "id": 1, - "amount": { - "amount": "0.6", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "fee": { - "amount": "0.1", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - } - }, - { - "id": 2, - "amount": { - "amount": "0.4", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "fee": { - "amount": "0", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - } - } - ] - } - } - }, - { - "transaction": { - "id": "", - "status": "completed", - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "100", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_fee": { - "amount": "1", - "asset": "iso4217:USD" - }, - "message": "this is the message" - } - } - ] -} -""" - -private const val expectedAfterPatchWithdraw = - """ -{ - "sep": "24", - "kind": "withdrawal", - "status": "completed", - "amount_in": { - "amount": "10", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_out": { - "amount": "10", - "asset": "iso4217:USD" - }, - "amount_fee": { - "amount": "1", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "refunds": { - "amount_refunded": { - "amount": "1", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_fee": { - "amount": "0.1", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "payments": [ - { - "id": "1", - "id_type": "stellar", - "amount": { - "amount": "0.6", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "fee": { - "amount": "0.1", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - } - }, - { - "id": "2", - "id_type": "stellar", - "amount": { - "amount": "0.4", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "fee": { - "amount": "0", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - } - } - ] - } -}""" - -private const val expectedAfterPatchDeposit = - """ - { - "sep": "24", - "kind": "deposit", - "status": "completed", - "amount_in": { - "amount": "100", - "asset": "iso4217:USD" - }, - "amount_out": { - "amount": "100", - "asset": "stellar:USDC:GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP" - }, - "amount_fee": { - "amount": "1", - "asset": "iso4217:USD" - } - } -""" - -private const val expectedSep24Info = - """ - { - "deposit": { - "JPYC": { - "enabled": true - }, - "USD": { - "enabled": true - }, - "USDC": { - "enabled": true - } - }, - "withdraw": { - "JPYC": { - "enabled": true - }, - "USD": { - "enabled": true - }, - "USDC": { - "enabled": true - } - }, - "fee": { - "enabled": false - }, - "features": { - "account_creation": false, - "claimable_balances": false - } - } -""" - -private const val expectedSep24WithdrawResponse = - """ - { - "transaction": { - "kind": "withdrawal", - "status": "incomplete", - "refunded": false, - "from": "GAIUIZPHLIHQEMNJGSZKCEUWHAZVGUZDBDMO2JXNAJZZZVNSVHQCEWJ4" - } - } -""" - -private const val expectedSep24DepositResponse = - """ - { - "transaction": { - "kind": "deposit", - "status": "incomplete", - "refunded": false, - "to": "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" - } - } -""" - -private const val expectedWithdrawTransactionResponse = - """ - { - "sep": "24", - "kind": "withdrawal", - "status": "incomplete" - } -""" - -private const val expectedDepositTransactionResponse = - """ - { - "sep": "24", - "kind": "deposit", - "status": "incomplete" - } -""" diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31CustodyRpcEnd2EndTests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31CustodyRpcEnd2EndTests.kt index 66f4faca7a..3d7538cd2e 100644 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31CustodyRpcEnd2EndTests.kt +++ b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31CustodyRpcEnd2EndTests.kt @@ -12,7 +12,8 @@ import org.junit.jupiter.api.Assertions.assertNotNull import org.stellar.anchor.api.callback.SendEventRequest import org.stellar.anchor.api.callback.SendEventRequestPayload import org.stellar.anchor.api.event.AnchorEvent -import org.stellar.anchor.api.event.AnchorEvent.Type.* +import org.stellar.anchor.api.event.AnchorEvent.Type.TRANSACTION_CREATED +import org.stellar.anchor.api.event.AnchorEvent.Type.TRANSACTION_STATUS_CHANGED import org.stellar.anchor.api.sep.SepTransactionStatus import org.stellar.anchor.api.sep.sep12.Sep12PutCustomerRequest import org.stellar.anchor.api.sep.sep31.Sep31GetTransactionResponse @@ -20,6 +21,8 @@ import org.stellar.anchor.api.sep.sep31.Sep31PostTransactionRequest import org.stellar.anchor.apiclient.PlatformApiClient import org.stellar.anchor.auth.AuthHelper import org.stellar.anchor.platform.* +import org.stellar.anchor.platform.subtest.testCustomer1Json +import org.stellar.anchor.platform.subtest.testCustomer2Json import org.stellar.anchor.util.GsonUtils import org.stellar.anchor.util.Log.info import org.stellar.anchor.util.MemoHelper diff --git a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31RpcEnd2EndTests.kt b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31RpcEnd2EndTests.kt index 4439dabfe3..ed8c0186e5 100644 --- a/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31RpcEnd2EndTests.kt +++ b/integration-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31RpcEnd2EndTests.kt @@ -20,6 +20,8 @@ import org.stellar.anchor.api.sep.sep31.Sep31PostTransactionRequest import org.stellar.anchor.apiclient.PlatformApiClient import org.stellar.anchor.auth.AuthHelper import org.stellar.anchor.platform.* +import org.stellar.anchor.platform.subtest.testCustomer1Json +import org.stellar.anchor.platform.subtest.testCustomer2Json import org.stellar.anchor.util.GsonUtils import org.stellar.anchor.util.Log.info import org.stellar.anchor.util.MemoHelper