From 9dfecd78eac143c77950b6bb62f069aad161e261 Mon Sep 17 00:00:00 2001 From: jiahuihu Date: Tue, 3 Dec 2024 17:24:57 -0500 Subject: [PATCH 1/2] wip --- .../contentDescriptors/transaction_id.json | 9 + .../anchor-platform/examples/datetime.json | 4 + .../examples/platform_transaction.json | 97 ++ .../examples/transaction_id.json | 4 + .../methods/get_transaction.json | 32 + .../src/anchor-platform/schemas/account.json | 12 + .../src/anchor-platform/schemas/customer.json | 21 + .../src/anchor-platform/schemas/datetime.json | 5 + openrpc/src/anchor-platform/schemas/memo.json | 12 + .../schemas/platform_transaction.json | 105 ++ .../schemas/stellar_transaction.json | 41 + .../anchor-platform/schemas/transaction.json | 2 +- .../platform/rpc/anchor-platform.openrpc.json | 1054 +++++++++++++++-- .../platform/rpc/methods/get_transaction.mdx | 11 + static/stellar-rpc.openrpc.json | 15 +- 15 files changed, 1323 insertions(+), 101 deletions(-) create mode 100644 openrpc/src/anchor-platform/examples/platform_transaction.json create mode 100644 openrpc/src/anchor-platform/methods/get_transaction.json create mode 100644 openrpc/src/anchor-platform/schemas/account.json create mode 100644 openrpc/src/anchor-platform/schemas/customer.json create mode 100644 openrpc/src/anchor-platform/schemas/memo.json create mode 100644 openrpc/src/anchor-platform/schemas/platform_transaction.json create mode 100644 openrpc/src/anchor-platform/schemas/stellar_transaction.json create mode 100644 platforms/anchor-platform/api-reference/platform/rpc/methods/get_transaction.mdx diff --git a/openrpc/src/anchor-platform/contentDescriptors/transaction_id.json b/openrpc/src/anchor-platform/contentDescriptors/transaction_id.json index fc28f5829..11b473461 100644 --- a/openrpc/src/anchor-platform/contentDescriptors/transaction_id.json +++ b/openrpc/src/anchor-platform/contentDescriptors/transaction_id.json @@ -25,5 +25,14 @@ "schema": { "$ref": "#/components/schemas/transaction_id" } + }, + "id": { + "name": "id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "$ref": "#/components/schemas/transaction_id" + } } } diff --git a/openrpc/src/anchor-platform/examples/datetime.json b/openrpc/src/anchor-platform/examples/datetime.json index dca669b42..ef1dc2abb 100644 --- a/openrpc/src/anchor-platform/examples/datetime.json +++ b/openrpc/src/anchor-platform/examples/datetime.json @@ -3,6 +3,10 @@ "name": "datetime", "value": "2023-08-04T10:04:06.280923Z" }, + "created_at": { + "name": "created_at", + "value": "2023-08-04T10:04:06.280923Z" + }, "started_at": { "name": "started_at", "value": "2023-08-04T10:04:06.280923Z" diff --git a/openrpc/src/anchor-platform/examples/platform_transaction.json b/openrpc/src/anchor-platform/examples/platform_transaction.json new file mode 100644 index 000000000..d787caac4 --- /dev/null +++ b/openrpc/src/anchor-platform/examples/platform_transaction.json @@ -0,0 +1,97 @@ +{ + "platformTransactionResponse": { + "name": "platformTransactionResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "31", + "kind": "receive", + "status": "completed", + "amount_expected": { + "amount": "100", + "asset": "iso4217:USD" + }, + "amount_in": { + "amount": "100.0000", + "asset": "iso4217:USD" + }, + "amount_out": { + "amount": "98.0000000", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "fee_details": { + "total": "2.0000", + "asset": "iso4217:USD" + }, + "quote_id": "quote-id", + "message": "Please don\u0027t forget to foo bar", + "refunds": { + "amount_refunded": { + "amount": "90.0000", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "8.0000", + "asset": "iso4217:USD" + }, + "payments": [ + { + "id": "1111", + "id_type": "stellar", + "amount": { + "amount": "50.0000", + "asset": "iso4217:USD" + }, + "fee": { + "amount": "4.0000", + "asset": "iso4217:USD" + } + }, + { + "id": "2222", + "id_type": "stellar", + "amount": { + "amount": "40.0000", + "asset": "iso4217:USD" + }, + "fee": { + "amount": "4.0000", + "asset": "iso4217:USD" + } + } + ] + }, + "stellar_transactions": [ + { + "id": "stellar-tx-id", + "memo": "my-memo", + "memo_type": "text", + "envelope": "here_comes_the_envelope", + "payments": [ + { + "id": "payment-id", + "amount": { + "amount": "100.0000", + "asset": "iso4217:USD" + }, + "payment_type": "payment", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + ] + } + ], + "external_transaction_id": "external-tx-id", + "customers": { + "sender": { + "id": "sender-id" + }, + "receiver": { + "id": "receiver-id" + } + }, + "creator": { + "id": "creator-id" + } + } + } +} \ No newline at end of file diff --git a/openrpc/src/anchor-platform/examples/transaction_id.json b/openrpc/src/anchor-platform/examples/transaction_id.json index 943a8fb86..42afa45f7 100644 --- a/openrpc/src/anchor-platform/examples/transaction_id.json +++ b/openrpc/src/anchor-platform/examples/transaction_id.json @@ -10,5 +10,9 @@ "external_transaction_id": { "name": "external_transaction_id", "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + }, + "id": { + "name": "id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" } } diff --git a/openrpc/src/anchor-platform/methods/get_transaction.json b/openrpc/src/anchor-platform/methods/get_transaction.json new file mode 100644 index 000000000..0c8ac0554 --- /dev/null +++ b/openrpc/src/anchor-platform/methods/get_transaction.json @@ -0,0 +1,32 @@ +{ + "name": "get_transaction", + "summary": "Retrieve a transaction.", + "description": "Retrieve a transaction by its ID.", + "paramStructure": "by-name", + "tags": [ + { "name": "SEP-6" }, + { "name": "SEP-24" }, + { "name": "SEP-31" } + ], + "params": [ + { "$ref": "#/components/contentDescriptors/id" } + ], + "result": { + "name": "get_transactionResponse", + "schema": { + "$ref": "#/components/schemas/platform_transaction" + } + }, + "examples": [ + { + "name": "get_transactionExample", + "description": "Example request to the `get_transaction` method.", + "params": [ + { "$ref": "#/components/examples/id" } + ], + "result": { + "$ref": "#/components/examples/platformTransactionResponse" + } + } + ] +} diff --git a/openrpc/src/anchor-platform/schemas/account.json b/openrpc/src/anchor-platform/schemas/account.json new file mode 100644 index 000000000..36746450b --- /dev/null +++ b/openrpc/src/anchor-platform/schemas/account.json @@ -0,0 +1,12 @@ +{ + "source_account": { + "title": "source_account", + "description":"The account being debited in the Stellar Network.", + "type": "string" + }, + "destination_account": { + "title": "destination_account", + "description":"The account being credited in the Stellar Network.", + "type": "string" + } +} \ No newline at end of file diff --git a/openrpc/src/anchor-platform/schemas/customer.json b/openrpc/src/anchor-platform/schemas/customer.json new file mode 100644 index 000000000..8295c4b89 --- /dev/null +++ b/openrpc/src/anchor-platform/schemas/customer.json @@ -0,0 +1,21 @@ +{ + "stellar_id": { + + "description": "A object that identify end-user. \nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. \nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used. \nFor a SEP-6 or SEP-24 Anchor, the `account` and `memo` fields should be used.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The `id` of the customer registered through SEP-12." + }, + "account": { + "type": "string", + "description": "Either the Stellar account or Muxed account address of the on-chain entity." + }, + "memo": { + "type": "string", + "description": "The memo value identifying a customer with a shared account, where the shared account is `account`." + } + } + } +} \ No newline at end of file diff --git a/openrpc/src/anchor-platform/schemas/datetime.json b/openrpc/src/anchor-platform/schemas/datetime.json index 8146263b4..ed424dfb1 100644 --- a/openrpc/src/anchor-platform/schemas/datetime.json +++ b/openrpc/src/anchor-platform/schemas/datetime.json @@ -4,6 +4,11 @@ "description": "A date and time.", "type": "string" }, + "created_at": { + "title": "created_at", + "description": "The date and time when the transaction is created.", + "$ref": "#/components/schemas/datetime" + }, "started_at": { "title": "started_at", "description": "Start date and time of transaction.", diff --git a/openrpc/src/anchor-platform/schemas/memo.json b/openrpc/src/anchor-platform/schemas/memo.json new file mode 100644 index 000000000..6f89e05fe --- /dev/null +++ b/openrpc/src/anchor-platform/schemas/memo.json @@ -0,0 +1,12 @@ +{ + "memo": { + "title": "memo", + "type": "string" + }, + "memo_type": { + "title": "memo_type", + "description": "The memo type of the transaction in the Stellar network. Should be present if memo is not null.", + "type": "string", + "enum": ["id", "hash", "text"] + } +} \ No newline at end of file diff --git a/openrpc/src/anchor-platform/schemas/platform_transaction.json b/openrpc/src/anchor-platform/schemas/platform_transaction.json new file mode 100644 index 000000000..414c30bdb --- /dev/null +++ b/openrpc/src/anchor-platform/schemas/platform_transaction.json @@ -0,0 +1,105 @@ +{ + "platform_transaction": { + "title": "Platform Transaction", + "description": "A platform transaction object", + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/transaction_id" + }, + "sep": { + "$ref": "#/components/schemas/sep" + }, + "kind": { + "$ref": "#/components/schemas/kind" + }, + "status": { + "$ref": "#/components/schemas/status" + }, + "amount_expected": { + "$ref": "#/components/schemas/amount_expected" + }, + "amount_in": { + "$ref": "#/components/schemas/amount_in" + }, + "amount_out": { + "$ref": "#/components/schemas/amount_out" + }, + "fee_details": { + "$ref": "#/components/schemas/fee_details" + }, + "quote_id": { + "$ref": "#/components/schemas/quote_id" + }, + "started_at": { + "$ref": "#/components/schemas/started_at" + }, + "updated_at": { + "$ref": "#/components/schemas/updated_at" + }, + "completed_at": { + "$ref": "#/components/schemas/completed_at" + }, + "transfer_received_at": { + "$ref": "#/components/schemas/transfer_received_at" + }, + "message": { + "description": "Human readable explanation of transaction status", + "$ref": "#/components/schemas/message" + }, + "refunds": { + "$ref": "#/components/schemas/refunds" + }, + "stellar_transactions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/stellar_transaction" + } + }, + "source_account": { + "$ref": "#/components/schemas/source_account" + }, + "destination_account": { + "$ref": "#/components/schemas/destination_account" + }, + "external_transaction_id": { + "$ref": "#/components/schemas/transaction_id" + }, + "memo": { + "$ref": "#/components/schemas/memo" + }, + "memo_type": { + "$ref": "#/components/schemas/memo_type" + }, + "refund_memo": { + "$ref": "#/components/schemas/memo" + }, + "refund_memo_type": { + "$ref": "#/components/schemas/memo_type" + }, + "client_domain": { + "description": "The domain of the client.", + "type": "string" + }, + "client_name": { + "description": "The domain of the client.", + "type": "string" + }, + "customers": { + "description": "The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\n this object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.", + "type": "object", + "properties": { + "sender": { + "$ref": "#/components/schemas/stellar_id" + }, + "receiver": { + "$ref": "#/components/schemas/stellar_id" + } + } + }, + "creator": { + "$ref": "#/components/schemas/stellar_id" + } + } + } +} \ No newline at end of file diff --git a/openrpc/src/anchor-platform/schemas/stellar_transaction.json b/openrpc/src/anchor-platform/schemas/stellar_transaction.json new file mode 100644 index 000000000..cddc002fa --- /dev/null +++ b/openrpc/src/anchor-platform/schemas/stellar_transaction.json @@ -0,0 +1,41 @@ +{ + "stellar_transaction": { + "title": "stellar_transaction", + "type": "object", + "properties": { + "id": { "$ref": "#/components/schemas/StellarHash" }, + "memo": {"$ref": "#/components/schemas/memo" }, + "memo_type": {"$ref": "#/components/schemas/memo_type" }, + "created_at": {"$ref": "#/components/schemas/created_at" }, + "envelop" : { + "description": "The transaction envelope, containing all the transaction information.", + "type": "string" + }, + "payments": { + "type": "array", + "items": { + "properties": { + "id": { + "description":" The ID of the payment in the Stellar Network.", + "type": "string" + }, + "payment_type": { + "description":" The ID of the payment in the Stellar Network.", + "type": "string", + "enum": [ + "payment", + "path_payment" + ], + "default": "payment" + }, + "source_account": {"$ref": "#/components/schemas/source_account"}, + "destination_account": { "$ref": "#/components/schemas/destination_account" }, + "amount": { "$ref": "#/components/schemas/AmountObjectString" } + }, + "required": ["id", "payment_type", "source_account", "destination_account", "amount"] + } + } + }, + "required": ["id", "created_at", "envelope", "payments"] + } +} \ No newline at end of file diff --git a/openrpc/src/anchor-platform/schemas/transaction.json b/openrpc/src/anchor-platform/schemas/transaction.json index cc612e7ab..038061acd 100644 --- a/openrpc/src/anchor-platform/schemas/transaction.json +++ b/openrpc/src/anchor-platform/schemas/transaction.json @@ -1,7 +1,7 @@ { "StellarHash": { "title": "hash", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "kind": { diff --git a/platforms/anchor-platform/api-reference/platform/rpc/anchor-platform.openrpc.json b/platforms/anchor-platform/api-reference/platform/rpc/anchor-platform.openrpc.json index 895bd6932..1bffe292e 100644 --- a/platforms/anchor-platform/api-reference/platform/rpc/anchor-platform.openrpc.json +++ b/platforms/anchor-platform/api-reference/platform/rpc/anchor-platform.openrpc.json @@ -76,7 +76,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -172,7 +176,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -273,7 +280,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -421,13 +428,19 @@ "required": false, "schema": { "type": "object", - "required": ["amount", "amount_fee"], + "required": [ + "amount", + "amount_fee" + ], "properties": { "amount": { "title": "amount", "description": "Amount to be refunded", "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -445,7 +458,10 @@ "title": "amount_fee", "description": "Amount of fee", "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -478,7 +494,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -574,7 +594,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -675,7 +698,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -791,6 +814,625 @@ } ] }, + { + "name": "get_transaction", + "summary": "Retrieve a transaction.", + "description": "Retrieve a transaction by its ID.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "get_transactionResponse", + "schema": { + "title": "Platform Transaction", + "description": "A platform transaction object", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [ + 6, + 24, + 31 + ] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": [ + "total", + "asset" + ], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + }, + "stellar_transactions": { + "type": "array", + "items": { + "title": "stellar_transaction", + "type": "object", + "required": [ + "id", + "created_at", + "envelope", + "payments" + ], + "properties": { + "id": { + "title": "hash", + "description": "The Stellar transaction hash.", + "type": "string" + }, + "memo": { + "title": "memo", + "type": "string" + }, + "memo_type": { + "title": "memo_type", + "description": "The memo type of the transaction in the Stellar network. Should be present if memo is not null.", + "type": "string", + "enum": [ + "id", + "hash", + "text" + ] + }, + "created_at": { + "title": "created_at", + "description": "The date and time when the transaction is created..", + "type": "string" + }, + "envelop": { + "description": "The transaction envelope, containing all the transaction information.", + "type": "string" + }, + "payments": { + "type": "array", + "items": { + "required": [ + "id", + "payment_type", + "source_account", + "destination_account", + "amount" + ], + "properties": { + "id": { + "description": " The ID of the payment in the Stellar Network.", + "type": "string" + }, + "payment_type": { + "description": " The ID of the payment in the Stellar Network.", + "type": "string", + "enum": [ + "payment", + "path_payment" + ], + "default": "payment" + }, + "source_account": { + "title": "source_account", + "description": "The account being debited in the Stellar Network.", + "type": "string" + }, + "destination_account": { + "title": "destination_account", + "description": "The account being credited in the Stellar Network.", + "type": "string" + }, + "amount": { + "type": "object", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "source_account": { + "title": "source_account", + "description": "The account being debited in the Stellar Network.", + "type": "string" + }, + "destination_account": { + "title": "destination_account", + "description": "The account being credited in the Stellar Network.", + "type": "string" + }, + "external_transaction_id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "memo": { + "title": "memo", + "type": "string" + }, + "memo_type": { + "title": "memo_type", + "description": "The memo type of the transaction in the Stellar network. Should be present if memo is not null.", + "type": "string", + "enum": [ + "id", + "hash", + "text" + ] + }, + "refund_memo": { + "title": "memo", + "type": "string" + }, + "refund_memo_type": { + "title": "memo_type", + "description": "The memo type of the transaction in the Stellar network. Should be present if memo is not null.", + "type": "string", + "enum": [ + "id", + "hash", + "text" + ] + }, + "client_domain": { + "description": "The domain of the client.", + "type": "string" + }, + "client_name": { + "description": "The domain of the client.", + "type": "string" + }, + "customers": { + "description": "The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\n this object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.", + "type": "object", + "properties": { + "sender": { + "description": "A object that identify end-user. \nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. \nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used. \nFor a SEP-6 or SEP-24 Anchor, the `account` and `memo` fields should be used.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The `id` of the customer registered through SEP-12." + }, + "account": { + "type": "string", + "description": "Either the Stellar account or Muxed account address of the on-chain entity." + }, + "memo": { + "type": "string", + "description": "The memo value identifying a customer with a shared account, where the shared account is `account`." + } + } + }, + "receiver": { + "description": "A object that identify end-user. \nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. \nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used. \nFor a SEP-6 or SEP-24 Anchor, the `account` and `memo` fields should be used.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The `id` of the customer registered through SEP-12." + }, + "account": { + "type": "string", + "description": "Either the Stellar account or Muxed account address of the on-chain entity." + }, + "memo": { + "type": "string", + "description": "The memo value identifying a customer with a shared account, where the shared account is `account`." + } + } + } + } + }, + "creator": { + "description": "A object that identify end-user. \nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. \nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used. \nFor a SEP-6 or SEP-24 Anchor, the `account` and `memo` fields should be used.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The `id` of the customer registered through SEP-12." + }, + "account": { + "type": "string", + "description": "Either the Stellar account or Muxed account address of the on-chain entity." + }, + "memo": { + "type": "string", + "description": "The memo value identifying a customer with a shared account, where the shared account is `account`." + } + } + } + } + } + }, + "examples": [ + { + "name": "get_transactionExample", + "description": "Example request to the `get_transaction` method.", + "params": [ + { + "name": "id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + } + ], + "result": { + "name": "platformTransactionResponse", + "value": { + "id": "00000000-0000-0000-0000-000000000000", + "sep": "31", + "kind": "receive", + "status": "completed", + "amount_expected": { + "amount": "100", + "asset": "iso4217:USD" + }, + "amount_in": { + "amount": "100.0000", + "asset": "iso4217:USD" + }, + "amount_out": { + "amount": "98.0000000", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "fee_details": { + "total": "2.0000", + "asset": "iso4217:USD" + }, + "quote_id": "quote-id", + "message": "Please don't forget to foo bar", + "refunds": { + "amount_refunded": { + "amount": "90.0000", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "8.0000", + "asset": "iso4217:USD" + }, + "payments": [ + { + "id": "1111", + "id_type": "stellar", + "amount": { + "amount": "50.0000", + "asset": "iso4217:USD" + }, + "fee": { + "amount": "4.0000", + "asset": "iso4217:USD" + } + }, + { + "id": "2222", + "id_type": "stellar", + "amount": { + "amount": "40.0000", + "asset": "iso4217:USD" + }, + "fee": { + "amount": "4.0000", + "asset": "iso4217:USD" + } + } + ] + }, + "stellar_transactions": [ + { + "id": "stellar-tx-id", + "memo": "my-memo", + "memo_type": "text", + "envelope": "here_comes_the_envelope", + "payments": [ + { + "id": "payment-id", + "amount": { + "amount": "100.0000", + "asset": "iso4217:USD" + }, + "payment_type": "payment", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + ] + } + ], + "external_transaction_id": "external-tx-id", + "customers": { + "sender": { + "id": "sender-id" + }, + "receiver": { + "id": "receiver-id" + } + }, + "creator": { + "id": "creator-id" + } + } + } + } + ] + }, { "name": "notify_amounts_updated", "summary": "Update transaction amounts", @@ -833,7 +1475,10 @@ "required": true, "schema": { "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -856,7 +1501,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -900,7 +1548,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -996,7 +1648,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -1097,7 +1752,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -1281,7 +1936,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -1377,7 +2036,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -1478,7 +2140,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -1628,7 +2290,10 @@ "required": true, "schema": { "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -1649,7 +2314,10 @@ "required": true, "schema": { "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -1672,7 +2340,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -1706,7 +2377,9 @@ "required": false, "schema": { "type": "object", - "required": ["amount"], + "required": [ + "amount" + ], "properties": { "amount": { "title": "amount", @@ -1742,7 +2415,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -1838,7 +2515,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -1939,7 +2619,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -2142,7 +2822,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -2238,7 +2922,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -2339,7 +3026,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -2522,7 +3209,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -2618,7 +3309,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -2719,7 +3413,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -2889,7 +3583,10 @@ "required": true, "schema": { "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -2910,7 +3607,10 @@ "required": true, "schema": { "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -2933,7 +3633,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -2977,7 +3680,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -3073,7 +3780,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -3174,7 +3884,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -3386,7 +4096,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -3482,7 +4196,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -3583,7 +4300,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -3740,7 +4457,7 @@ "required": true, "schema": { "title": "hash", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" } }, @@ -3750,7 +4467,10 @@ "required": true, "schema": { "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -3771,7 +4491,10 @@ "required": true, "schema": { "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -3794,7 +4517,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -3838,7 +4564,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -3934,7 +4664,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -4035,7 +4768,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -4191,7 +4924,7 @@ "required": true, "schema": { "title": "hash", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" } } @@ -4211,7 +4944,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -4307,7 +5044,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -4408,7 +5148,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -4555,13 +5295,20 @@ "name": "refund", "schema": { "type": "object", - "required": ["amount", "amount_fee", "id"], + "required": [ + "amount", + "amount_fee", + "id" + ], "properties": { "amount": { "title": "amount", "description": "Amount to be refunded", "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -4579,7 +5326,10 @@ "title": "amount_fee", "description": "Amount of fee", "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -4595,7 +5345,7 @@ }, "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" } } @@ -4617,7 +5367,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -4713,7 +5467,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -4814,7 +5571,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -4974,13 +5731,20 @@ "name": "refund", "schema": { "type": "object", - "required": ["amount", "amount_fee", "id"], + "required": [ + "amount", + "amount_fee", + "id" + ], "properties": { "amount": { "title": "amount", "description": "Amount to be refunded", "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -4998,7 +5762,10 @@ "title": "amount_fee", "description": "Amount of fee", "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -5014,7 +5781,7 @@ }, "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" } } @@ -5036,7 +5803,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -5132,7 +5903,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -5233,7 +6007,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -5405,7 +6179,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -5501,7 +6279,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -5602,7 +6383,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -5760,7 +6541,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -5856,7 +6641,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -5957,7 +6745,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -6122,7 +6910,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -6218,7 +7010,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -6319,7 +7114,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -6477,7 +7272,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -6573,7 +7372,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -6674,7 +7476,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -6837,7 +7639,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -6933,7 +7739,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -7034,7 +7843,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -7179,7 +7988,10 @@ "required": true, "schema": { "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -7200,7 +8012,10 @@ "required": false, "schema": { "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -7223,7 +8038,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -7257,7 +8075,9 @@ "required": false, "schema": { "type": "object", - "required": ["amount"], + "required": [ + "amount" + ], "properties": { "amount": { "title": "amount", @@ -7323,7 +8143,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -7419,7 +8243,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -7520,7 +8347,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -7674,6 +8501,9 @@ }, { "name": "SEP-24" + }, + { + "name": "SEP-31" } ], "params": [ @@ -7705,7 +8535,10 @@ "required": true, "schema": { "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -7726,7 +8559,10 @@ "required": true, "schema": { "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -7747,7 +8583,10 @@ "required": false, "schema": { "type": "object", - "required": ["amount", "asset"], + "required": [ + "amount", + "asset" + ], "properties": { "amount": { "title": "amount", @@ -7770,7 +8609,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -7804,7 +8646,9 @@ "required": false, "schema": { "type": "object", - "required": ["amount"], + "required": [ + "amount" + ], "properties": { "amount": { "title": "amount", @@ -7864,7 +8708,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -7960,7 +8808,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -8061,7 +8912,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -8253,7 +9104,11 @@ "title": "sep", "description": "Protocol of the transaction.", "type": "integer", - "enum": [6, 24, 31] + "enum": [ + 6, + 24, + 31 + ] }, "kind": { "title": "kind", @@ -8349,7 +9204,10 @@ "title": "fee_details", "description": "Description of fee charged by the anchor.", "type": "object", - "required": ["total", "asset"], + "required": [ + "total", + "asset" + ], "properties": { "total": { "type": "number" @@ -8450,7 +9308,7 @@ "properties": { "id": { "title": "id", - "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "description": "The Stellar transaction hash.", "type": "string" }, "id_type": { @@ -8555,4 +9413,4 @@ } ], "components": {} -} +} \ No newline at end of file diff --git a/platforms/anchor-platform/api-reference/platform/rpc/methods/get_transaction.mdx b/platforms/anchor-platform/api-reference/platform/rpc/methods/get_transaction.mdx new file mode 100644 index 000000000..c313dc6a1 --- /dev/null +++ b/platforms/anchor-platform/api-reference/platform/rpc/methods/get_transaction.mdx @@ -0,0 +1,11 @@ +--- +title: get_transaction +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "get_transaction")[0]} +/> diff --git a/static/stellar-rpc.openrpc.json b/static/stellar-rpc.openrpc.json index 67016b77a..2040e93ee 100644 --- a/static/stellar-rpc.openrpc.json +++ b/static/stellar-rpc.openrpc.json @@ -33,7 +33,7 @@ { "name": "getEvents", "summary": "returns contract events", - "description": "Clients can request a filtered list of events emitted by a given ledger range.\n\nStellar-RPC will support querying within a maximum 7 days of recent ledgers.\n\nNote, this could be used by the client to only prompt a refresh when there is a new ledger with relevant events. It should also be used by backend Dapp components to \"ingest\" events into their own database for querying and serving.\n\nIf making multiple requests, clients should deduplicate any events received, based on the event's unique id field. This prevents double-processing in the case of duplicate events being received.\n\nBy default soroban-rpc retains the most recent 24 hours of events.", + "description": "Clients can request a filtered list of events emitted by a given ledger range.\n\nStellar-RPC will support querying within a maximum 7 days of recent ledgers.\n\nNote, this could be used by the client to only prompt a refresh when there is a new ledger with relevant events. It should also be used by backend Dapp components to \"ingest\" events into their own database for querying and serving.\n\nIf making multiple requests, clients should deduplicate any events received, based on the event's unique id field. This prevents double-processing in the case of duplicate events being received.\n\nBy default stellar-rpc retains the most recent 24 hours of events.", "externalDocs": { "url": "https://developers.stellar.org/docs/data/rpc/api-reference/methods/getEvents" }, @@ -50,6 +50,17 @@ "type": "number" } }, + { + "name": "endLedger", + "summary": "ledger represents the end of search window", + "description": "Ledger sequence number represents the end of search window (exclusive). If a cursor is included in the request, `endLedger` must be omitted.", + "required": false, + "schema": { + "title": "ledgerSequence", + "description": "Sequence number of the ledger.", + "type": "number" + } + }, { "name": "filters", "summary": "filters to narrow events search", @@ -873,7 +884,7 @@ { "name": "getTransaction", "summary": "returns transaction details", - "description": "The getTransaction method provides details about the specified transaction. Clients are expected to periodically query this method to ascertain when a transaction has been successfully recorded on the blockchain. The stellar-rpc system maintains a restricted history of recently processed transactions, with the default retention window set at 1440 ledgers, approximately equivalent to a 2-hour timeframe. For private stellar-rpc instances, it is possible to modify the retention window value by adjusting the transaction-retention-window configuration setting. For comprehensive debugging needs that extend beyond the 2-hour timeframe, it is advisable to retrieve transaction information from Horizon, as it provides a lasting and persistent record.", + "description": "The getTransaction method provides details about the specified transaction. Clients are expected to periodically query this method to ascertain when a transaction has been successfully recorded on the blockchain. The stellar-rpc system maintains a restricted history of recently processed transactions, with the default retention window set at 24 hours. For private soroban-rpc instances, it is possible to modify the retention window value by adjusting the transaction-retention-window configuration setting, but we do not recommend values longer than 7 days. For debugging needs that extend beyond this timeframe, it is advisable to index this data yourself, employ a third-party [indexer](https://developers.stellar.org/docs/tools/developer-tools/data-indexers), or query [Hubble](https://developers.stellar.org/docs/data/hubble) (our public BigQuery data set).", "externalDocs": { "url": "https://developers.stellar.org/docs/data/rpc/api-reference/methods/getTransaction" }, From 54f5f29b92112d8c78b41027936af6ac8c2ffd68 Mon Sep 17 00:00:00 2001 From: jiahuihu Date: Wed, 4 Dec 2024 15:08:11 -0500 Subject: [PATCH 2/2] address comments --- .../anchor-platform/examples/datetime.json | 4 ++++ .../examples/platform_transaction.json | 1 + .../src/anchor-platform/schemas/customer.json | 13 ++++++++++- .../src/anchor-platform/schemas/datetime.json | 5 +++++ .../schemas/platform_transaction.json | 22 ++++++++++--------- .../platform/rpc/anchor-platform.openrpc.json | 18 +++++++++++++-- 6 files changed, 50 insertions(+), 13 deletions(-) diff --git a/openrpc/src/anchor-platform/examples/datetime.json b/openrpc/src/anchor-platform/examples/datetime.json index ef1dc2abb..90b0b7560 100644 --- a/openrpc/src/anchor-platform/examples/datetime.json +++ b/openrpc/src/anchor-platform/examples/datetime.json @@ -22,5 +22,9 @@ "funds_sent_at": { "name": "funds_sent_at", "value": "2023-07-04T12:34:38Z" + }, + "user_action_required_by": { + "name": "user_action_required_by", + "value": "2023-07-04T12:34:38Z" } } diff --git a/openrpc/src/anchor-platform/examples/platform_transaction.json b/openrpc/src/anchor-platform/examples/platform_transaction.json index d787caac4..ff6cd3f6f 100644 --- a/openrpc/src/anchor-platform/examples/platform_transaction.json +++ b/openrpc/src/anchor-platform/examples/platform_transaction.json @@ -6,6 +6,7 @@ "sep": "31", "kind": "receive", "status": "completed", + "funding_method": "SWIFT", "amount_expected": { "amount": "100", "asset": "iso4217:USD" diff --git a/openrpc/src/anchor-platform/schemas/customer.json b/openrpc/src/anchor-platform/schemas/customer.json index 8295c4b89..375132d4c 100644 --- a/openrpc/src/anchor-platform/schemas/customer.json +++ b/openrpc/src/anchor-platform/schemas/customer.json @@ -1,6 +1,5 @@ { "stellar_id": { - "description": "A object that identify end-user. \nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. \nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used. \nFor a SEP-6 or SEP-24 Anchor, the `account` and `memo` fields should be used.", "type": "object", "properties": { @@ -17,5 +16,17 @@ "description": "The memo value identifying a customer with a shared account, where the shared account is `account`." } } + }, + "customers": { + "description": "The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\n this object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.", + "type": "object", + "properties": { + "sender": { + "$ref": "#/components/schemas/stellar_id" + }, + "receiver": { + "$ref": "#/components/schemas/stellar_id" + } + } } } \ No newline at end of file diff --git a/openrpc/src/anchor-platform/schemas/datetime.json b/openrpc/src/anchor-platform/schemas/datetime.json index ed424dfb1..268d19d91 100644 --- a/openrpc/src/anchor-platform/schemas/datetime.json +++ b/openrpc/src/anchor-platform/schemas/datetime.json @@ -28,5 +28,10 @@ "title": "transfer_received_at", "description": "The date and time of receiving transfer.", "$ref": "#/components/schemas/datetime" + }, + "user_action_required_by": { + "title": "user_action_required_by", + "description": "Time and date by which user action is required.", + "$ref": "#/components/schemas/datetime" } } diff --git a/openrpc/src/anchor-platform/schemas/platform_transaction.json b/openrpc/src/anchor-platform/schemas/platform_transaction.json index 414c30bdb..bd79389d2 100644 --- a/openrpc/src/anchor-platform/schemas/platform_transaction.json +++ b/openrpc/src/anchor-platform/schemas/platform_transaction.json @@ -16,6 +16,14 @@ "status": { "$ref": "#/components/schemas/status" }, + "funding_method": { + "description": "Funding method used for transferring or settling assets.", + "type": "string" + }, + "type": { + "description": "DEPRECATED in favor of funding_method. Type of deposit, withdrawal or receive.", + "type": "string" + }, "amount_expected": { "$ref": "#/components/schemas/amount_expected" }, @@ -43,6 +51,9 @@ "transfer_received_at": { "$ref": "#/components/schemas/transfer_received_at" }, + "user_action_required_by": { + "$ref": "#/components/schemas/user_action_required_by" + }, "message": { "description": "Human readable explanation of transaction status", "$ref": "#/components/schemas/message" @@ -86,16 +97,7 @@ "type": "string" }, "customers": { - "description": "The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\n this object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.", - "type": "object", - "properties": { - "sender": { - "$ref": "#/components/schemas/stellar_id" - }, - "receiver": { - "$ref": "#/components/schemas/stellar_id" - } - } + "$ref": "#/components/schemas/customers" }, "creator": { "$ref": "#/components/schemas/stellar_id" diff --git a/platforms/anchor-platform/api-reference/platform/rpc/anchor-platform.openrpc.json b/platforms/anchor-platform/api-reference/platform/rpc/anchor-platform.openrpc.json index 1bffe292e..12e4d9970 100644 --- a/platforms/anchor-platform/api-reference/platform/rpc/anchor-platform.openrpc.json +++ b/platforms/anchor-platform/api-reference/platform/rpc/anchor-platform.openrpc.json @@ -904,6 +904,14 @@ "pending_stellar" ] }, + "funding_method": { + "description": "Funding method used for transferring or settling assets.", + "type": "string" + }, + "type": { + "description": "DEPRECATED in favor of funding_method. Type of deposit, withdrawal or receive.", + "type": "string" + }, "amount_expected": { "type": "object", "title": "amount_expected", @@ -1014,6 +1022,11 @@ "description": "The date and time of receiving transfer.", "type": "string" }, + "user_action_required_by": { + "title": "user_action_required_by", + "description": "Time and date by which user action is required.", + "type": "string" + }, "message": { "title": "message", "description": "Human readable explanation of transaction status", @@ -1149,7 +1162,7 @@ }, "created_at": { "title": "created_at", - "description": "The date and time when the transaction is created..", + "description": "The date and time when the transaction is created.", "type": "string" }, "envelop": { @@ -1338,10 +1351,11 @@ "result": { "name": "platformTransactionResponse", "value": { - "id": "00000000-0000-0000-0000-000000000000", + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", "sep": "31", "kind": "receive", "status": "completed", + "funding_method": "SWIFT", "amount_expected": { "amount": "100", "asset": "iso4217:USD"