diff --git a/Dockerfile b/Dockerfile index fb46e5ae2..0c8154f15 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,8 @@ WORKDIR /app ENV DEBIAN_FRONTEND=noninteractive ENV INLINE_RUNTIME_CHUNK=false RUN apt-get update && apt-get install --no-install-recommends -y gpg curl git make ca-certificates apt-transport-https && \ - curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key|gpg --dearmor >/etc/apt/trusted.gpg.d/nodesource.gpg && \ - echo "deb https://deb.nodesource.com/node_16.x focal main" | tee /etc/apt/sources.list.d/nodesource.list && \ + curl -sSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key|gpg --dearmor >/etc/apt/trusted.gpg.d/nodesource-key.gpg && \ + echo "deb https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg |gpg --dearmor >/etc/apt/trusted.gpg.d/yarnpkg.gpg && \ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ apt-get update && apt-get install -y nodejs yarn && apt-get clean @@ -22,4 +22,4 @@ RUN yarn build FROM nginx:1.17 COPY --from=build /app/build/ /usr/share/nginx/html/ -COPY nginx /etc/nginx/ \ No newline at end of file +COPY nginx /etc/nginx/ diff --git a/api/anchor-platform/callbacks/get-rates.api.mdx b/api/anchor-platform/callbacks/get-rates.api.mdx index 74a31970d..61a47cfef 100644 --- a/api/anchor-platform/callbacks/get-rates.api.mdx +++ b/api/anchor-platform/callbacks/get-rates.api.mdx @@ -52,7 +52,7 @@ Success. An object describing the fees added on top of the rate provided via the `price` attribute. -
details object[]
  • Array [
  • ]
  • +
    details object[]
  • Array [
  • ]
  • Unprocessable Entity. This status should be returned when the anchor understood the request but cannot return a success response. diff --git a/api/anchor-platform/callbacks/post-event.api.mdx b/api/anchor-platform/callbacks/post-event.api.mdx index fd235ad01..3f912152f 100644 --- a/api/anchor-platform/callbacks/post-event.api.mdx +++ b/api/anchor-platform/callbacks/post-event.api.mdx @@ -5,7 +5,7 @@ description: "Receive a JSON object representing an event." sidebar_label: "Receive an Event" hide_title: true hide_table_of_contents: true -api: {"tags":["Events","SEP-6","SEP-24","SEP-31"],"operationId":"postEvent","description":"Receive a JSON object representing an event.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["transaction_created","transaction_status_changed","transaction_error","quote_created","customer_updated"],"description":"The transaction event type. Can be one of the following:\n- `transaction_created` - a transaction was created through the SEP endpoints. The payload is in the `transaction` field.\n- `transaction_status_changed` - the status of a transaction has changed. The payload is in the `transaction` field.\n- `transaction_error` - error processing the transaction. The payload is in the `transaction` field.\n- `quote_created` - a quote was created via the SEP38 API. The payload is in the `quote` field.\n"},"timestamp":{"type":"string","format":"date-time"},"payload":{"type":"object","properties":{"transaction":{"oneOf":[{"type":"object","required":["id","sep","kind","status","amount_expected","destination_account","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["24"]},"kind":{"type":"string","enum":["deposit","withdrawal"]},"status":{"type":"string","description":"Possible status value for SEP-24 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large"],"title":"StatusSEP24"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"refund_memo":{"description":"if provided, this memo should be used for refund transactions","type":"string"},"refund_memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"}},"title":"TransactionSEP24"},{"type":"object","required":["id","sep","kind","status","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["31"]},"kind":{"type":"string","enum":["receive"]},"status":{"type":"string","description":"Possible status value for SEP-31 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_sender","pending_receiver","pending_transaction_info_update","pending_customer_info_update"],"title":"StatusSEP31"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"external_transaction_id":{"type":"string"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}}},"creator":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}},"title":"TransactionSEP31"}]},"quote":{"type":"object","properties":{"id":{"type":"string"},"sell_amount":{"type":"string"},"sell_asset":{"type":"string"},"buy_amount":{"type":"string"},"buy_asset":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"price":{"type":"string"},"total_price":{"type":"string"},"creator":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"},"transaction_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"title":"Quote"},"customer":{"type":"object","properties":{"id":{"type":"string"}},"title":"Customer"}}}},"required":["id","type","payload","timestamp"],"title":"Event"}}}},"responses":{"200":{"description":"The event is successfully processed and ready to receive next event. The response body is empty."},"400":{"description":"The event is invalid or rejected. The response body contains the error message."}},"method":"post","path":"/event","jsonRequestBodyExample":{"id":"string","type":"transaction_created","timestamp":"2023-11-03T18:39:04.140Z","payload":{"transaction":{"id":"string","sep":"24","kind":"deposit","status":"incomplete","amount_expected":{"amount":"string","asset":"string"},"amount_in":{"amount":"string","asset":"string"},"amount_out":{"amount":"string","asset":"string"},"amount_fee":{"amount":"string","asset":"string"},"started_at":"2023-11-03T18:39:04.140Z","updated_at":"2023-11-03T18:39:04.140Z","completed_at":"2023-11-03T18:39:04.140Z","transfer_received_at":"2023-11-03T18:39:04.140Z","message":"string","refunds":{"amount_refunded":{"amount":"string","asset":"string"},"amount_fee":{"amount":"string","asset":"string"},"payments":[{"id":"string","id_type":"stellar","amount":{"amount":"string","asset":"string"},"fee":{"amount":"string","asset":"string"},"requested_at":"2023-11-03T18:39:04.140Z","refunded_at":"2023-11-03T18:39:04.140Z"}]},"stellar_transactions":[{"id":"string","memo":"string","memo_type":"text","created_at":"2023-11-03T18:39:04.140Z","envelope":"string","payments":[{"id":"string","payment_type":"payment","source_account":"string","destination_account":"string","amount":{"amount":"string","asset":"string"}}]}],"source_account":"string","destination_account":"string","external_transaction_id":"string","memo":"string","memo_type":"text id hash","refund_memo":"string","refund_memo_type":"text id hash"},"quote":{"id":"string","sell_amount":"string","sell_asset":"string","buy_amount":"string","buy_asset":"string","expires_at":"2023-11-03T18:39:04.140Z","price":"string","total_price":"string","creator":{"id":"string","account":"string","memo":"string"},"transaction_id":"string","created_at":"2023-11-03T18:39:04.140Z"},"customer":{"id":"string"}}},"info":{"version":"2.0.0","description":"The Synchronous Callbacks API specification for the Stellar Anchor Platform project.\n\nThe Synchronous Callbacks API defines requests made by the Platform while it is processing a request from a client application. The\nanchor's responses to these requests affect the Platform responses to the client application.\n","title":"Synchronous Callbacks API"},"postman":{"name":"Receive an Event","description":{"content":"Receive a JSON object representing an event.\n","type":"text/plain"},"url":{"path":["event"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"tags":["Events","SEP-6","SEP-24","SEP-31"],"operationId":"postEvent","description":"Receive a JSON object representing an event.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["transaction_created","transaction_status_changed","transaction_error","quote_created","customer_updated"],"description":"The transaction event type. Can be one of the following:\n- `transaction_created` - a transaction was created through the SEP endpoints. The payload is in the `transaction` field.\n- `transaction_status_changed` - the status of a transaction has changed. The payload is in the `transaction` field.\n- `transaction_error` - error processing the transaction. The payload is in the `transaction` field.\n- `quote_created` - a quote was created via the SEP38 API. The payload is in the `quote` field.\n"},"timestamp":{"type":"string","format":"date-time"},"payload":{"type":"object","properties":{"transaction":{"oneOf":[{"type":"object","required":["id","sep","kind","status","amount_expected","destination_account","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["24"]},"kind":{"type":"string","enum":["deposit","withdrawal"]},"status":{"type":"string","description":"Possible status value for SEP-24 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large"],"title":"StatusSEP24"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"refund_memo":{"description":"if provided, this memo should be used for refund transactions","type":"string"},"refund_memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"}},"title":"TransactionSEP24"},{"type":"object","required":["id","sep","kind","status","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["31"]},"kind":{"type":"string","enum":["receive"]},"status":{"type":"string","description":"Possible status value for SEP-31 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_sender","pending_receiver","pending_transaction_info_update","pending_customer_info_update"],"title":"StatusSEP31"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"external_transaction_id":{"type":"string"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}}},"creator":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}},"title":"TransactionSEP31"}]},"quote":{"type":"object","properties":{"id":{"type":"string"},"sell_amount":{"type":"string"},"sell_asset":{"type":"string"},"buy_amount":{"type":"string"},"buy_asset":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"price":{"type":"string"},"total_price":{"type":"string"},"creator":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"},"transaction_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"title":"Quote"},"customer":{"type":"object","properties":{"id":{"type":"string"}},"title":"Customer"}}}},"required":["id","type","payload","timestamp"],"title":"Event"}}}},"responses":{"200":{"description":"The event is successfully processed and ready to receive next event. The response body is empty."},"400":{"description":"The event is invalid or rejected. The response body contains the error message."}},"method":"post","path":"/event","jsonRequestBodyExample":{"id":"string","type":"transaction_created","timestamp":"2023-11-29T20:10:08.017Z","payload":{"transaction":{"id":"string","sep":"24","kind":"deposit","status":"incomplete","amount_expected":{"amount":"string","asset":"string"},"amount_in":{"amount":"string","asset":"string"},"amount_out":{"amount":"string","asset":"string"},"amount_fee":{"amount":"string","asset":"string"},"quote_id":"string","started_at":"2023-11-29T20:10:08.018Z","updated_at":"2023-11-29T20:10:08.018Z","completed_at":"2023-11-29T20:10:08.018Z","transfer_received_at":"2023-11-29T20:10:08.018Z","message":"string","refunds":{"amount_refunded":{"amount":"string","asset":"string"},"amount_fee":{"amount":"string","asset":"string"},"payments":[{"id":"string","id_type":"stellar","amount":{"amount":"string","asset":"string"},"fee":{"amount":"string","asset":"string"},"requested_at":"2023-11-29T20:10:08.018Z","refunded_at":"2023-11-29T20:10:08.018Z"}]},"stellar_transactions":[{"id":"string","memo":"string","memo_type":"text","created_at":"2023-11-29T20:10:08.018Z","envelope":"string","payments":[{"id":"string","payment_type":"payment","source_account":"string","destination_account":"string","amount":{"amount":"string","asset":"string"}}]}],"source_account":"string","destination_account":"string","external_transaction_id":"string","memo":"string","memo_type":"text id hash","refund_memo":"string","refund_memo_type":"text id hash"},"quote":{"id":"string","sell_amount":"string","sell_asset":"string","buy_amount":"string","buy_asset":"string","expires_at":"2023-11-29T20:10:08.018Z","price":"string","total_price":"string","creator":{"id":"string","account":"string","memo":"string"},"transaction_id":"string","created_at":"2023-11-29T20:10:08.018Z"},"customer":{"id":"string"}}},"info":{"version":"2.0.0","description":"The Synchronous Callbacks API specification for the Stellar Anchor Platform project.\n\nThe Synchronous Callbacks API defines requests made by the Platform while it is processing a request from a client application. The\nanchor's responses to these requests affect the Platform responses to the client application.\n","title":"Synchronous Callbacks API"},"postman":{"name":"Receive an Event","description":{"content":"Receive a JSON object representing an event.\n","type":"text/plain"},"url":{"path":["event"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: api/anchor-platform/callbacks/synchronous-callbacks-api custom_edit_url: null @@ -31,7 +31,7 @@ import TabItem from "@theme/TabItem"; Receive a JSON object representing an event. -
    Request Body
      payload object required
      transaction object
    • oneOf
      amount_expected object required
      amount_in object
      amount_out object
      amount_fee object
      refunds object
      amount_refunded object
      amount_fee object
      payments object[]
    • Array [
    • amount object
      fee object
    • ]
    • stellar_transactions object[]
    • Array [
    • payments object[] required
    • Array [
    • amount object required
    • ]
    • ]
    • amount_expected object
      amount_in object
      amount_out object
      amount_fee object
      refunds object
      amount_refunded object
      amount_fee object
      payments object[]
    • Array [
    • amount object
      fee object
    • ]
    • stellar_transactions object[]
    • Array [
    • payments object[] required
    • Array [
    • amount object required
    • ]
    • ]
    • customers object
      +
      Request Body
        payload object required
        transaction object
      • oneOf
        amount_expected object required
        amount_in object
        amount_out object
        amount_fee object
        refunds object
        amount_refunded object
        amount_fee object
        payments object[]
      • Array [
      • amount object
        fee object
      • ]
      • stellar_transactions object[]
      • Array [
      • payments object[] required
      • Array [
      • amount object required
      • ]
      • ]
      • amount_expected object
        amount_in object
        amount_out object
        amount_fee object
        refunds object
        amount_refunded object
        amount_fee object
        payments object[]
      • Array [
      • amount object
        fee object
      • ]
      • stellar_transactions object[]
      • Array [
      • payments object[] required
      • Array [
      • amount object required
      • ]
      • ]
      • customers object
        The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12), this object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer. diff --git a/api/anchor-platform/callbacks/put-customer.api.mdx b/api/anchor-platform/callbacks/put-customer.api.mdx index 8fa5bc9df..c0ee295f5 100644 --- a/api/anchor-platform/callbacks/put-customer.api.mdx +++ b/api/anchor-platform/callbacks/put-customer.api.mdx @@ -5,7 +5,7 @@ description: "**The Anchor Platform does not persist any customer KYC data.**" sidebar_label: "Create or Update Customer Info" hide_title: true hide_table_of_contents: true -api: {"tags":["Customers","SEP-12","SEP-24","SEP-31"],"description":"**The Anchor Platform does not persist any customer KYC data.**\n\nThe request and response for this endpoint are identical to the\n[`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put)\nrequest and response defined in SEP-12.\n\nClient applications make requests with the following request body, which is forwarded to the anchor. Anchors\nmust validate and persist the data passed, and return the customer's `id`.\n","operationId":"putCustomer","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"The ID of the customer as returned in the response of a previous PUT request.","type":"string"},"account":{"description":"The Stellar or Muxed Account authenticated with the Platform via SEP-10.","type":"string"},"memo":{"description":"The memo value identifying a customer with a shared account, where the shared account is `account`.","type":"string"},"memo_type":{"description":"The type of memo used to identify a customer with a shared account.","type":"string","enum":["id","hash","text"]},"type":{"description":"The type of action the customer is being KYCd for. \nSee the [Type Specification](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#type-specification) documented in SEP-12 for more info.\nFor SEP-31 you can define your own types in the assets configuration.\nFor SEP-24 pre-defined value `sep24-customer` is used.\n","type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"additional_name":{"type":"string"},"address_country_code":{"type":"string"},"state_or_province":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"address":{"type":"string"},"mobile_number":{"type":"string"},"email_address":{"type":"string"},"birth_date":{"type":"string","format":"date"},"birth_place":{"type":"string"},"birth_country_code":{"type":"string"},"bank_account_number":{"type":"string"},"bank_account_type":{"type":"string"},"bank_number":{"type":"string"},"bank_phone_number":{"type":"string"},"bank_branch_number":{"type":"string"},"tax_id":{"type":"string"},"tax_id_name":{"type":"string"},"occupation":{"type":"string"},"employer_name":{"type":"string"},"employer_address":{"type":"string"},"language_code":{"type":"string"},"id_type":{"type":"string"},"id_country_code":{"type":"string"},"id_issue_date":{"type":"string","format":"date"},"id_expiration_date":{"type":"string","format":"date"},"id_number":{"type":"string"},"ip_address":{"type":"string"},"sex":{"type":"string"}},"title":"PutCustomerRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"title":"PutCustomerResponse"}}}},"400":{"description":"Invalid data.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"404":{"description":"Not Found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"put","path":"/customer","jsonRequestBodyExample":{"id":"string","account":"string","memo":"string","memo_type":"id","type":"string","first_name":"string","last_name":"string","additional_name":"string","address_country_code":"string","state_or_province":"string","city":"string","postal_code":"string","address":"string","mobile_number":"string","email_address":"string","birth_date":"2023-11-03","birth_place":"string","birth_country_code":"string","bank_account_number":"string","bank_account_type":"string","bank_number":"string","bank_phone_number":"string","bank_branch_number":"string","tax_id":"string","tax_id_name":"string","occupation":"string","employer_name":"string","employer_address":"string","language_code":"string","id_type":"string","id_country_code":"string","id_issue_date":"2023-11-03","id_expiration_date":"2023-11-03","id_number":"string","ip_address":"string","sex":"string"},"info":{"version":"2.0.0","description":"The Synchronous Callbacks API specification for the Stellar Anchor Platform project.\n\nThe Synchronous Callbacks API defines requests made by the Platform while it is processing a request from a client application. The\nanchor's responses to these requests affect the Platform responses to the client application.\n","title":"Synchronous Callbacks API"},"postman":{"name":"Create or Update Customer Info","description":{"content":"**The Anchor Platform does not persist any customer KYC data.**\n\nThe request and response for this endpoint are identical to the\n[`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put)\nrequest and response defined in SEP-12.\n\nClient applications make requests with the following request body, which is forwarded to the anchor. Anchors\nmust validate and persist the data passed, and return the customer's `id`.\n","type":"text/plain"},"url":{"path":["customer"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"tags":["Customers","SEP-12","SEP-24","SEP-31"],"description":"**The Anchor Platform does not persist any customer KYC data.**\n\nThe request and response for this endpoint are identical to the\n[`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put)\nrequest and response defined in SEP-12.\n\nClient applications make requests with the following request body, which is forwarded to the anchor. Anchors\nmust validate and persist the data passed, and return the customer's `id`.\n","operationId":"putCustomer","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"The ID of the customer as returned in the response of a previous PUT request.","type":"string"},"account":{"description":"The Stellar or Muxed Account authenticated with the Platform via SEP-10.","type":"string"},"memo":{"description":"The memo value identifying a customer with a shared account, where the shared account is `account`.","type":"string"},"memo_type":{"description":"The type of memo used to identify a customer with a shared account.","type":"string","enum":["id","hash","text"]},"type":{"description":"The type of action the customer is being KYCd for. \nSee the [Type Specification](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#type-specification) documented in SEP-12 for more info.\nFor SEP-31 you can define your own types in the assets configuration.\nFor SEP-24 pre-defined value `sep24-customer` is used.\n","type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"additional_name":{"type":"string"},"address_country_code":{"type":"string"},"state_or_province":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"address":{"type":"string"},"mobile_number":{"type":"string"},"email_address":{"type":"string"},"birth_date":{"type":"string","format":"date"},"birth_place":{"type":"string"},"birth_country_code":{"type":"string"},"bank_account_number":{"type":"string"},"bank_account_type":{"type":"string"},"bank_number":{"type":"string"},"bank_phone_number":{"type":"string"},"bank_branch_number":{"type":"string"},"tax_id":{"type":"string"},"tax_id_name":{"type":"string"},"occupation":{"type":"string"},"employer_name":{"type":"string"},"employer_address":{"type":"string"},"language_code":{"type":"string"},"id_type":{"type":"string"},"id_country_code":{"type":"string"},"id_issue_date":{"type":"string","format":"date"},"id_expiration_date":{"type":"string","format":"date"},"id_number":{"type":"string"},"ip_address":{"type":"string"},"sex":{"type":"string"}},"title":"PutCustomerRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"title":"PutCustomerResponse"}}}},"400":{"description":"Invalid data.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"404":{"description":"Not Found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"put","path":"/customer","jsonRequestBodyExample":{"id":"string","account":"string","memo":"string","memo_type":"id","type":"string","first_name":"string","last_name":"string","additional_name":"string","address_country_code":"string","state_or_province":"string","city":"string","postal_code":"string","address":"string","mobile_number":"string","email_address":"string","birth_date":"2023-11-29","birth_place":"string","birth_country_code":"string","bank_account_number":"string","bank_account_type":"string","bank_number":"string","bank_phone_number":"string","bank_branch_number":"string","tax_id":"string","tax_id_name":"string","occupation":"string","employer_name":"string","employer_address":"string","language_code":"string","id_type":"string","id_country_code":"string","id_issue_date":"2023-11-29","id_expiration_date":"2023-11-29","id_number":"string","ip_address":"string","sex":"string"},"info":{"version":"2.0.0","description":"The Synchronous Callbacks API specification for the Stellar Anchor Platform project.\n\nThe Synchronous Callbacks API defines requests made by the Platform while it is processing a request from a client application. The\nanchor's responses to these requests affect the Platform responses to the client application.\n","title":"Synchronous Callbacks API"},"postman":{"name":"Create or Update Customer Info","description":{"content":"**The Anchor Platform does not persist any customer KYC data.**\n\nThe request and response for this endpoint are identical to the\n[`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put)\nrequest and response defined in SEP-12.\n\nClient applications make requests with the following request body, which is forwarded to the anchor. Anchors\nmust validate and persist the data passed, and return the customer's `id`.\n","type":"text/plain"},"url":{"path":["customer"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "put api-method" info_path: api/anchor-platform/callbacks/synchronous-callbacks-api custom_edit_url: null diff --git a/api/anchor-platform/custody-server/create-custody-transaction.api.mdx b/api/anchor-platform/custody-server/create-custody-transaction.api.mdx index 0f29dcda3..7bc17fddc 100644 --- a/api/anchor-platform/custody-server/create-custody-transaction.api.mdx +++ b/api/anchor-platform/custody-server/create-custody-transaction.api.mdx @@ -1,19 +1,19 @@ --- id: create-custody-transaction title: "Create Custody Transaction" -description: "Create Custody Transaction" +description: "Custody Server creates custody transaction record in DB." sidebar_label: "Create Custody Transaction" hide_title: true hide_table_of_contents: true -api: { "tags": [ "SEP-6", "SEP-24", "SEP-31" ], "description": "Custody Server creates custody transaction record in DB.\n", "operationId": "createCustodyTransaction", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "description": "SEP transaction ID", "type": "string" }, "memo": { "description": "Memo value, that is used to identify inbound or outbound payments", "type": "string" }, "memoType": { "description": "Type of memo, that is used to identify inbound or outbound payments", "type": "string", "enum": [ "id", "hash", "text" ] }, "protocol": { "description": "Protocol of SEP transaction", "type": "string", "enum": [ "6", "24", "31" ] }, "fromAccount": { "description": "Source Stellar account", "type": "string" }, "toAccount": { "description": "Destination Stellar account", "type": "string" }, "amount": { "description": "Amount of the asset, that is sent/received", "type": "string" }, "amountFee": { "description": "Fee of SEP transaction", "type": "string" }, "asset": { "description": "Asset, that is sent/received", "type": "string" }, "kind": { "description": "Kind of the SEP transaction", "type": "string", "enum": [ "deposit", "withdrawal", "receive" ] } }, "title": "CreateCustodyTransactionRequest" } } } }, "responses": { "200": { "description": "Success.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "title": "CreateCustodyTransactionResponse" } } } }, "500": { "description": "Internal Server Error.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "title": "Error" } } } } }, "method": "post", "path": "/transactions", "jsonRequestBodyExample": { "id": "123e4567-e89b-12d3-a456-426614174000", "memo": "12345", "memoType": "id", "protocol": "24", "fromAccount": "GA3X53JGZ5SLT733GNKH3CVV7RKCL4DXWCIZG2Y24HA24L6XNEHSQXT4", "toAccount": "GA3X53JGZ5SLT733GNKH3CVV7RKCL4DXWCIZG2Y24HA24L6XNEHSQXT4", "amount": "50", "amountAsset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5", "kind": "deposit" }, "info": { "version": "2.0.0", "description": "The Custody Server API specification for the Stellar Anchor Platform project.\n\nThe Custody Server API defines requests made by the Platform to interact with custody services.\n", "title": "Custody Server API" }, "postman": { "name": "Create Custody Transaction", "description": { "content": "The Custody Server provides set of endpoints to interact with custody services.\n", "type": "text/plain" }, "url": { "path": [ "transactions" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Accept", "value": "application/json" } ], "method": "POST", "body": { "mode": "raw", "raw": "\"\"", "options": { "raw": { "language": "json" } } } } } -sidebar_class_name: "put api-method" -info_path: api/anchor-platform/custody-server-api +api: {"description":"Custody Server creates custody transaction record in DB.","operationId":"createCustodyTransaction","tags":["Custody Transactions","SEP-6","SEP-24","SEP-31"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"SEP transaction ID.","type":"string"},"memo":{"description":"Memo value, that is used to identify inbound or outbound payments.","type":"string"},"memoType":{"description":"Type of memo, that is used to identify inbound or outbound payments.","type":"string","enum":["id","hash","text"]},"protocol":{"description":"Protocol of SEP transaction.","type":"string","enum":[6,24,31]},"fromAccount":{"description":"Source Stellar account.","type":"string"},"toAccount":{"description":"Destination Stellar account.","type":"string"},"amount":{"description":"Amount of the asset, that is sent/received.","type":"string"},"amountFee":{"description":"Fee of SEP transaction.","type":"string"},"asset":{"description":"Asset, that is sent/received.","type":"string"},"kind":{"description":"Kind of the SEP transaction.","type":"string","enum":["deposit","withdrawal","receive"]}}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}}},"method":"post","path":"/transactions","jsonRequestBodyExample":{"id":"string","memo":"string","memoType":"id","protocol":6,"fromAccount":"string","toAccount":"string","amount":"string","amountFee":"string","asset":"string","kind":"deposit"},"info":{"version":"2.0.0","description":"","title":"Custody Server API"},"postman":{"name":"Create Custody Transaction","description":{"content":"Custody Server creates custody transaction record in DB.","type":"text/plain"},"url":{"path":["transactions"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" +info_path: api/anchor-platform/custody-server/custody-server-api custom_edit_url: null --- import { SepBadge } from "@site/src/components/SepBadge"; - + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; @@ -26,14 +26,16 @@ import TabItem from "@theme/TabItem"; ## Create Custody Transaction + + Custody Server creates custody transaction record in DB. -
        Request Body
        +
        Request Body
        Success. -
        Schema
          +
          Schema
          • object
          -Internal Server Error. +Internal Server Error
          Schema
          diff --git a/api/anchor-platform/custody-server/generate-unique-address.api.mdx b/api/anchor-platform/custody-server/generate-unique-address.api.mdx index b2464ea8f..6b3ec1e48 100644 --- a/api/anchor-platform/custody-server/generate-unique-address.api.mdx +++ b/api/anchor-platform/custody-server/generate-unique-address.api.mdx @@ -1,19 +1,19 @@ --- id: generate-unique-address title: "Generate Unique Address" -description: "Generate Unique Address" +description: "Custody Server calls the configured custody service to generate deposit address and memo." sidebar_label: "Generate Unique Address" hide_title: true hide_table_of_contents: true -api: { "tags": [ "SEP-6", "SEP-24", "SEP-31" ], "description": "Custody Server calls the configured custody service to generate deposit address and memo.\n", "operationId": "generateUniqueAddress", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": {}, "title": "GenerateUniqueAddressRequest" } } } }, "responses": { "200": { "description": "Success.", "content": { "application/json": { "schema": { "type": "object", "properties": { "address": { "description": "Deposit address to which the client should send funds", "type": "string" }, "memo": { "description": "Memo value, that should be added to payment by the client", "type": "string" }, "memoType": { "description": "Type of memo, that should be added to payment by the client", "type": "string", "enum": [ "id", "hash", "text" ] } }, "title": "GenerateUniqueAddressResponse" } } } }, "500": { "description": "Internal Server Error.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "title": "Error" } } } } }, "method": "post", "path": "/assets/{asset}/addresses", "jsonRequestBodyExample": {}, "info": { "version": "2.0.0", "description": "The Custody Server API specification for the Stellar Anchor Platform project.\n\nThe Custody Server API defines requests made by the Platform to interact with custody services.\n", "title": "Custody Server API" }, "postman": { "name": "Generate Unique Address", "description": { "content": "The Custody Server provides set of endpoints to interact with custody services.\n", "type": "text/plain" }, "url": { "path": [ "assets", ":asset", "addresses" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Accept", "value": "application/json" } ], "method": "POST", "body": { "mode": "raw", "raw": "\"\"", "options": { "raw": { "language": "json" } } } } } +api: {"description":"Custody Server calls the configured custody service to generate deposit address and memo.\n\nFormat of `asset` parameter - `stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5`\n","operationId":"generateUniqueAddress","tags":["Unique Address","SEP-6","SEP-24","SEP-31"],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"address":{"description":"Deposit address to which the client should send funds.","type":"string"},"memo":{"description":"Memo value, that should be added to payment by the client.","type":"string"},"memoType":{"description":"Type of memo, that should be added to payment by the client.","type":"string","enum":["id","hash","text"]}},"title":"GenerateUniqueAddressResponse"}}}},"500":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}}},"method":"post","path":"/assets/{asset}/addresses","jsonRequestBodyExample":{},"info":{"version":"2.0.0","description":"","title":"Custody Server API"},"postman":{"name":"Generate Unique Address","description":{"content":"Custody Server calls the configured custody service to generate deposit address and memo.\n\nFormat of `asset` parameter - `stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5`\n","type":"text/plain"},"url":{"path":["assets",":asset","addresses"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" -info_path: api/anchor-platform/custody-server-api +info_path: api/anchor-platform/custody-server/custody-server-api custom_edit_url: null --- import { SepBadge } from "@site/src/components/SepBadge"; - + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; @@ -26,15 +26,18 @@ import TabItem from "@theme/TabItem"; ## Generate Unique Address + + Custody Server calls the configured custody service to generate deposit address and memo. Format of `asset` parameter - `stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5` -
          Request Body
            + +
            Request Body
            • object
            Success. -
            Schema
            +
            Schema
            Internal Server Error. diff --git a/api/anchor-platform/custody-server/send-payment.api.mdx b/api/anchor-platform/custody-server/send-payment.api.mdx index dc007b576..d666a5f2a 100644 --- a/api/anchor-platform/custody-server/send-payment.api.mdx +++ b/api/anchor-platform/custody-server/send-payment.api.mdx @@ -1,19 +1,19 @@ --- id: send-payment -title: "Send payment" -description: "Send payment" -sidebar_label: "Send payment" +title: "Send Payment" +description: "Custody Server calls the configured custody service to send payment." +sidebar_label: "Send Payment" hide_title: true hide_table_of_contents: true -api: { "tags": [ "SEP-6", "SEP-24", "SEP-31" ], "description": "Custody Server calls configured Custody Service to send payment.\n", "operationId": "sendPayment", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": {}, "title": "SendPaymentRequest" } } } }, "responses": { "200": { "description": "Success.", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "description": "External TX ID from custody service", "type": "string" } }, "title": "SendPaymentResponse" } } } }, "400": { "description": "Invalid Request.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "title": "Invalid Request" } } } }, "404": { "description": "Custody Transaction is not found.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "title": "Custody Transaction is not found" } } } }, "429": { "description": "Custody Service rate limit is exceeded.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "title": "Custody Service rate limit is exceeded" } } } }, "500": { "description": "Internal Server Error.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "title": "Error" } } } }, "503": { "description": "Custody Service is unavailable.", "content": { "application/json": { "schema": { "type": "object", "properties": { "rawErrorMessage": { "type": "string" } }, "title": "Custody Service is unavailable" } } } } }, "method": "post", "path": "/transactions/{id}/payments", "jsonRequestBodyExample": {}, "info": { "version": "2.0.0", "description": "The Custody Server API specification for the Stellar Anchor Platform project.\n\nThe Custody Server API defines requests made by the Platform to interact with custody services.\n", "title": "Custody Server API" }, "postman": { "name": "Send Payment", "description": { "content": "The Custody Server provides set of endpoints to interact with custody services.\n", "type": "text/plain" }, "url": { "path": [ "transactions", ":id", "payments" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Accept", "value": "application/json" } ], "method": "POST", "body": { "mode": "raw", "raw": "\"\"", "options": { "raw": { "language": "json" } } } } } +api: {"description":"Custody Server calls the configured custody service to send payment.","operationId":"sendPayment","tags":["Payments","SEP-6","SEP-24","SEP-31"],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"External TX ID from custody service."}},"title":"SendPaymentResponse"}}}},"400":{"description":"Invalid Request.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}},"404":{"description":"Custody Transaction is not found.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}},"429":{"description":"Custody Service rate limit is exceeded.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}},"500":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}},"503":{"description":"Custody Service is unavailable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}}},"method":"post","path":"/transactions/:id/payments","jsonRequestBodyExample":{},"info":{"version":"2.0.0","description":"","title":"Custody Server API"}} sidebar_class_name: "post api-method" -info_path: api/anchor-platform/custody-server-api +info_path: api/anchor-platform/custody-server/custody-server-api custom_edit_url: null --- import { SepBadge } from "@site/src/components/SepBadge"; - + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; @@ -26,30 +26,32 @@ import TabItem from "@theme/TabItem"; ## Send Payment + + Custody Server calls the configured custody service to send payment. -
            Request Body
              +
              Request Body
              • object
              Success. -
              Schema
              +
              Schema
              Invalid Request. -
              Schema
              +
              Schema
              Custody Transaction is not found. -
              Schema
              +
              Schema
              Custody Service rate limit is exceeded. -
              Schema
              +
              Schema
              Internal Server Error. -
              Schema
              +
              Schema
              Custody Service is unavailable. -
              Schema
              +
              Schema
              diff --git a/api/anchor-platform/custody-server/send-refund.api.mdx b/api/anchor-platform/custody-server/send-refund.api.mdx index 54ffe6c53..250ff464a 100644 --- a/api/anchor-platform/custody-server/send-refund.api.mdx +++ b/api/anchor-platform/custody-server/send-refund.api.mdx @@ -1,19 +1,19 @@ --- id: send-refund title: "Send Refund" -description: "Send Refund" +description: "Custody Server calls configured Custody Service to send refund. Custody transaction record is also created in DB." sidebar_label: "Send Refund" hide_title: true hide_table_of_contents: true -api: { "tags": [ "SEP-6", "SEP-24", "SEP-31" ], "description": "Custody Server calls configured Custody Service to send payment.\n", "operationId": "sendPayment", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "memo": { "description": "Memo value, that will be added to the refund payment", "type": "string" }, "memoType": { "description": "Type of memo, that will be added to the refund payment", "type": "string" }, "amount": { "description": "Amount, that will be refunded", "type": "string" }, "amountFee": { "description": "Fee of the refund", "type": "string" } }, "title": "SendPaymentRequest" } } } }, "responses": { "200": { "description": "Success.", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "description": "External TX ID from custody service", "type": "string" } }, "title": "SendPaymentResponse" } } } }, "400": { "description": "Invalid Request.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "title": "Invalid Request" } } } }, "404": { "description": "Custody Transaction is not found.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "title": "Custody Transaction is not found" } } } }, "429": { "description": "Custody Service rate limit is exceeded.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "title": "Custody Service rate limit is exceeded" } } } }, "500": { "description": "Internal Server Error.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "title": "Error" } } } }, "503": { "description": "Custody Service is unavailable.", "content": { "application/json": { "schema": { "type": "object", "properties": { "rawErrorMessage": { "type": "string" } }, "title": "Custody Service is unavailable" } } } } }, "method": "post", "path": "/transactions/{id}/payments", "jsonRequestBodyExample": {}, "info": { "version": "2.0.0", "description": "The Custody Server API specification for the Stellar Anchor Platform project.\n\nThe Custody Server API defines requests made by the Platform to interact with custody services.\n", "title": "Custody Server API" }, "postman": { "name": "Send Payment", "description": { "content": "The Custody Server provides set of endpoints to interact with custody services.\n", "type": "text/plain" }, "url": { "path": [ "transactions", ":id", "payments" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Accept", "value": "application/json" } ], "method": "POST", "body": { "mode": "raw", "raw": "\"\"", "options": { "raw": { "language": "json" } } } } } +api: {"description":"Custody Server calls configured Custody Service to send refund. Custody transaction record is also created in DB.","operationId":"sendRefund","tags":["Refunds","SEP-6","SEP-24","SEP-31"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"memo":{"description":"Memo value, that will be added to the refund payment.","type":"string"},"memoType":{"description":"Type of memo, that will be added to the refund payment.","type":"string"},"amount":{"description":"Amount, that will be refunded.","type":"string"},"amountFee":{"description":"Fee of the refund.","type":"string"}}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"External TX ID from custody service."}},"title":"SendPaymentResponse"}}}},"400":{"description":"Invalid Request.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}},"404":{"description":"Custody Transaction is not found.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}},"429":{"description":"Custody Service rate limit is exceeded.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}},"500":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}},"503":{"description":"Custody Service is unavailable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}}},"method":"post","path":"/transactions/:id/refunds","jsonRequestBodyExample":{"memo":"string","memoType":"string","amount":"string","amountFee":"string"},"info":{"version":"2.0.0","description":"","title":"Custody Server API"}} sidebar_class_name: "post api-method" -info_path: api/anchor-platform/custody-server-api +info_path: api/anchor-platform/custody-server/custody-server-api custom_edit_url: null --- import { SepBadge } from "@site/src/components/SepBadge"; - + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; @@ -26,31 +26,32 @@ import TabItem from "@theme/TabItem"; ## Send Refund -Custody Server calls configured Custody Service to send refund. -Custody transaction record is also created in DB. + + +Custody Server calls configured Custody Service to send refund. Custody transaction record is also created in DB.
              Request Body
              Success. -
              Schema
              +
              Schema
              Invalid Request. -
              Schema
              +
              Schema
              Custody Transaction is not found. -
              Schema
              +
              Schema
              Custody Service rate limit is exceeded. -
              Schema
              +
              Schema
              Internal Server Error. -
              Schema
              +
              Schema
              Custody Service is unavailable. -
              Schema
              +
              Schema
              diff --git a/api/anchor-platform/custody-server/sidebar.js b/api/anchor-platform/custody-server/sidebar.js index 11057bb75..94a2055e1 100644 --- a/api/anchor-platform/custody-server/sidebar.js +++ b/api/anchor-platform/custody-server/sidebar.js @@ -1 +1 @@ -module.exports = [ { "type": "doc", "id": "anchor-platform/custody-server" }, { "type": "category", "label": "Custody Transactions", "link": { "type": "generated-index", "title": "Custody Transactions", "slug": "/category/anchor-platform/custody-server/custody-transactions" }, "items": [ { "type": "doc", "id": "anchor-platform/custody-server/create-custody-transaction", "label": "Create Custody Transaction", "className": "api-method post" } ] }, { "type": "category", "label": "Unique Address", "link": { "type": "generated-index", "title": "Unique Address", "slug": "/category/anchor-platform/custody-server/unique-address" }, "items": [ { "type": "doc", "id": "anchor-platform/custody-server/generate-unique-address", "label": "Generate Unique Address", "className": "api-method post" } ] }, { "type": "category", "label": "Payments", "link": { "type": "generated-index", "title": "Payments", "slug": "/category/anchor-platform/custody-server/payments" }, "items": [ { "type": "doc", "id": "anchor-platform/custody-server/send-payment", "label": "Send Payment", "className": "api-method post" } ] }, { "type": "category", "label": "Refunds", "link": { "type": "generated-index", "title": "Refunds", "slug": "/category/anchor-platform/custody-server/refunds" }, "items": [ { "type": "doc", "id": "anchor-platform/custody-server/send-refund", "label": "Send Refund", "className": "api-method post" } ] }, { "type": "category", "label": "SEP-24", "link": { "type": "generated-index", "title": "SEP-24", "slug": "/category/anchor-platform/custody-server/sep-24" }, "items": [ { "type": "doc", "id": "anchor-platform/custody-server/create-custody-transaction", "label": "Create Custody Transaction", "className": "api-method post" }, { "type": "doc", "id": "/category/anchor-platform/custody-server/generate-unique-address", "label": "Generate Unique Address", "className": "api-method post" }, { "type": "doc", "id": "anchor-platform/custody-server/send-payment", "label": "Send Payment", "className": "api-method post" }, { "type": "doc", "id": "anchor-platform/custody-server/send-payment", "label": "Send Refund", "className": "api-method post" } ] }, { "type": "category", "label": "SEP-31", "link": { "type": "generated-index", "title": "SEP-31", "slug": "/category/anchor-platform/custody-server/sep-31" }, "items": [ { "type": "doc", "id": "anchor-platform/custody-server/create-custody-transaction", "label": "Create Custody Transaction", "className": "api-method post" }, { "type": "doc", "id": "/category/anchor-platform/custody-server/generate-unique-address", "label": "Generate Unique Address", "className": "api-method post" }, { "type": "doc", "id": "anchor-platform/custody-server/send-payment", "label": "Send Payment", "className": "api-method post" }, { "type": "doc", "id": "anchor-platform/custody-server/send-payment", "label": "Send Refund", "className": "api-method post" } ] } ]; \ No newline at end of file +module.exports = [{"type":"doc","id":"anchor-platform/custody-server/custody-server-api"},{"type":"category","label":"Custody Transactions","link":{"type":"generated-index","title":"Custody Transactions","slug":"/category/anchor-platform/custody-server/custody-transactions"},"items":[{"type":"doc","id":"anchor-platform/custody-server/create-custody-transaction","label":"Create Custody Transaction","className":"api-method post"}]},{"type":"category","label":"Payments","link":{"type":"generated-index","title":"Payments","slug":"/category/anchor-platform/custody-server/payments"},"items":[{"type":"doc","id":"anchor-platform/custody-server/send-payment","label":"Send Payment","className":"api-method post"}]},{"type":"category","label":"Refunds","link":{"type":"generated-index","title":"Refunds","slug":"/category/anchor-platform/custody-server/refunds"},"items":[{"type":"doc","id":"anchor-platform/custody-server/send-refund","label":"Send Refund","className":"api-method post"}]},{"type":"category","label":"Unique Address","link":{"type":"generated-index","title":"Unique Address","slug":"/category/anchor-platform/custody-server/unique-address"},"items":[{"type":"doc","id":"anchor-platform/custody-server/generate-unique-address","label":"Generate Unique Address","className":"api-method post"}]},{"type":"category","label":"SEP-6","link":{"type":"generated-index","title":"SEP-6","slug":"/category/anchor-platform/custody-server/sep-6"},"items":[{"type":"doc","id":"anchor-platform/custody-server/create-custody-transaction","label":"Create Custody Transaction","className":"api-method post"},{"type":"doc","id":"anchor-platform/custody-server/send-payment","label":"Send Payment","className":"api-method post"},{"type":"doc","id":"anchor-platform/custody-server/send-refund","label":"Send Refund","className":"api-method post"},{"type":"doc","id":"anchor-platform/custody-server/generate-unique-address","label":"Generate Unique Address","className":"api-method post"}]},{"type":"category","label":"SEP-24","link":{"type":"generated-index","title":"SEP-24","slug":"/category/anchor-platform/custody-server/sep-24"},"items":[{"type":"doc","id":"anchor-platform/custody-server/create-custody-transaction","label":"Create Custody Transaction","className":"api-method post"},{"type":"doc","id":"anchor-platform/custody-server/send-payment","label":"Send Payment","className":"api-method post"},{"type":"doc","id":"anchor-platform/custody-server/send-refund","label":"Send Refund","className":"api-method post"},{"type":"doc","id":"anchor-platform/custody-server/generate-unique-address","label":"Generate Unique Address","className":"api-method post"}]},{"type":"category","label":"SEP-31","link":{"type":"generated-index","title":"SEP-31","slug":"/category/anchor-platform/custody-server/sep-31"},"items":[{"type":"doc","id":"anchor-platform/custody-server/create-custody-transaction","label":"Create Custody Transaction","className":"api-method post"},{"type":"doc","id":"anchor-platform/custody-server/send-payment","label":"Send Payment","className":"api-method post"},{"type":"doc","id":"anchor-platform/custody-server/send-refund","label":"Send Refund","className":"api-method post"},{"type":"doc","id":"anchor-platform/custody-server/generate-unique-address","label":"Generate Unique Address","className":"api-method post"}]}]; \ No newline at end of file diff --git a/api/anchor-platform/resources/get-transaction.api.mdx b/api/anchor-platform/resources/get-transaction.api.mdx index eb60fc026..5e4a3b75b 100644 --- a/api/anchor-platform/resources/get-transaction.api.mdx +++ b/api/anchor-platform/resources/get-transaction.api.mdx @@ -5,7 +5,7 @@ description: "Provides the information necessary for the business to determine t sidebar_label: "Retrieve a Transaction" hide_title: true hide_table_of_contents: true -api: {"tags":["Transactions","SEP-6","SEP-24","SEP-31"],"operationId":"getTransaction","description":"Provides the information necessary for the business to determine the state of the transaction identified by `id`, decide if any action must be taken to continue processing the transaction, and act on the decision.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Transaction found.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["id","sep","kind","status","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["6"]},"kind":{"type":"string","enum":["deposit","deposit-exchange","withdrawal","withdrawal-exchange"]},"status":{"type":"string","description":"Possible status value for SEP-6 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_customer_info_update","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large"],"title":"StatusSEP6"},"type":{"type":"string"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"refund_memo":{"description":"if provided, this memo should be used for refund transactions","type":"string"},"refund_memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}}}},"title":"TransactionSEP6"},{"type":"object","required":["id","sep","kind","status","amount_expected","destination_account","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["24"]},"kind":{"type":"string","enum":["deposit","withdrawal"]},"status":{"type":"string","description":"Possible status value for SEP-24 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large"],"title":"StatusSEP24"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"refund_memo":{"description":"if provided, this memo should be used for refund transactions","type":"string"},"refund_memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"}},"title":"TransactionSEP24"},{"type":"object","required":["id","sep","kind","status","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["31"]},"kind":{"type":"string","enum":["receive"]},"status":{"type":"string","description":"Possible status value for SEP-31 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_sender","pending_receiver","pending_transaction_info_update","pending_customer_info_update"],"title":"StatusSEP31"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"external_transaction_id":{"type":"string"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}}},"creator":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}},"title":"TransactionSEP31"}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"404":{"description":"Transaction not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/transactions/{id}","info":{"version":"2.0.0","title":"Platform API"},"postman":{"name":"Retrieve a Transaction","description":{"content":"Provides the information necessary for the business to determine the state of the transaction identified by `id`, decide if any action must be taken to continue processing the transaction, and act on the decision.","type":"text/plain"},"url":{"path":["transactions",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) ","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Transactions","SEP-6","SEP-24","SEP-31"],"operationId":"getTransaction","description":"Provides the information necessary for the business to determine the state of the transaction identified by `id`, decide if any action must be taken to continue processing the transaction, and act on the decision.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Transaction found.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["id","sep","kind","status","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["6"]},"kind":{"type":"string","enum":["deposit","deposit-exchange","withdrawal","withdrawal-exchange"]},"status":{"type":"string","description":"Possible status value for SEP-6 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_customer_info_update","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large"],"title":"StatusSEP6"},"type":{"type":"string"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"refund_memo":{"description":"if provided, this memo should be used for refund transactions","type":"string"},"refund_memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}}}},"title":"TransactionSEP6"},{"type":"object","required":["id","sep","kind","status","amount_expected","destination_account","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["24"]},"kind":{"type":"string","enum":["deposit","withdrawal"]},"status":{"type":"string","description":"Possible status value for SEP-24 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large"],"title":"StatusSEP24"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"refund_memo":{"description":"if provided, this memo should be used for refund transactions","type":"string"},"refund_memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"}},"title":"TransactionSEP24"},{"type":"object","required":["id","sep","kind","status","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["31"]},"kind":{"type":"string","enum":["receive"]},"status":{"type":"string","description":"Possible status value for SEP-31 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_sender","pending_receiver","pending_transaction_info_update","pending_customer_info_update"],"title":"StatusSEP31"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"external_transaction_id":{"type":"string"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}}},"creator":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}},"title":"TransactionSEP31"}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"404":{"description":"Transaction not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/transactions/{id}","info":{"version":"2.0.0","title":"Platform API"},"postman":{"name":"Retrieve a Transaction","description":{"content":"Provides the information necessary for the business to determine the state of the transaction identified by `id`, decide if any action must be taken to continue processing the transaction, and act on the decision.","type":"text/plain"},"url":{"path":["transactions",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) ","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: api/anchor-platform/resources/platform-api custom_edit_url: null @@ -62,7 +62,7 @@ For a SEP-31 Sending Anchor, the `account` and `memo` fields should be used. For a SEP-6 Anchor, the `account` and `memo` fields should be used. -
            • amount_expected object required
              amount_in object
              amount_out object
              amount_fee object
              refunds object
              amount_refunded object
              amount_fee object
              payments object[]
            • Array [
            • amount object
              fee object
            • ]
            • stellar_transactions object[]
            • Array [
            • payments object[] required
            • Array [
            • amount object required
            • ]
            • ]
            • amount_expected object
              amount_in object
              amount_out object
              amount_fee object
              refunds object
              amount_refunded object
              amount_fee object
              payments object[]
            • Array [
            • amount object
              fee object
            • ]
            • stellar_transactions object[]
            • Array [
            • payments object[] required
            • Array [
            • amount object required
            • ]
            • ]
            • customers object
              +
              amount_expected object required
              amount_in object
              amount_out object
              amount_fee object
              refunds object
              amount_refunded object
              amount_fee object
              payments object[]
            • Array [
            • amount object
              fee object
            • ]
            • stellar_transactions object[]
            • Array [
            • payments object[] required
            • Array [
            • amount object required
            • ]
            • ]
            • amount_expected object
              amount_in object
              amount_out object
              amount_fee object
              refunds object
              amount_refunded object
              amount_fee object
              payments object[]
            • Array [
            • amount object
              fee object
            • ]
            • stellar_transactions object[]
            • Array [
            • payments object[] required
            • Array [
            • amount object required
            • ]
            • ]
            • customers object
              The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12), this object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer. @@ -101,7 +101,7 @@ For a SEP-31 Sending Anchor, the `account` and `memo` fields should be used. For a SEP-6 Anchor, the `account` and `memo` fields should be used. -
            +
          Bad Request diff --git a/api/anchor-platform/resources/get-transactions.api.mdx b/api/anchor-platform/resources/get-transactions.api.mdx index f4b78ef4c..df20bc798 100644 --- a/api/anchor-platform/resources/get-transactions.api.mdx +++ b/api/anchor-platform/resources/get-transactions.api.mdx @@ -5,7 +5,7 @@ description: "Allows to query list of transactions for desired SEP. This api sup sidebar_label: "Retrieve a List of Transactions" hide_title: true hide_table_of_contents: true -api: {"tags":["Transactions","SEP-6","SEP-24","SEP-31"],"operationId":"getTransactions","description":"Allows to query list of transactions for desired SEP. This api supports pagination, and it's possible (and recommended) to make multiple requests to query transactions. The last page is reached when the number of elements returned by the endpoint is smaller than provided `page_size`.","parameters":[{"in":"query","name":"sep","required":true,"schema":{"type":"string","enum":[6,24,31]},"description":"Lookup transactions belonging to this SEP."},{"in":"query","name":"order_by","schema":{"type":"string","enum":["created_at","transfer_received_at"],"default":"created_at"},"description":"Specifies field that transactions will be ordered by. Note, that secondary sort is transaction id in ascending value.\nI.e. when timestamps for 2 or more transactions is identical, they will be sorted by id."},{"in":"query","name":"order","schema":{"type":"string","enum":["asc","desc"],"default":"asc"},"description":"Specifies order. Note, that when the field is null, all transactions with null value will be last, regardless of soring order (NULLS LAST).\nFor example, transfer time may not be specified for some transactions, resulting into `transfer_received_at` being null. If so, transactions with non-null values will be sorted and returned first, followed by all transactions with null timestamps."},{"in":"query","name":"statuses","schema":{"type":"array","items":{"type":"string","description":"Possible status values for all transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large","pending_sender","pending_receiver","pending_transaction_info_update","pending_customer_info_update"],"title":"StatusSEPAll"}},"description":"Filters transactions for specified array of statuses. If not provided, filtering is disabled (default behavior)"},{"in":"query","name":"page_size","schema":{"type":"integer","default":20},"description":"Size of a single search page. Must be positive."},{"in":"query","name":"page_number","schema":{"type":"integer","default":0},"description":"Page number to use for continuous search. Page count beings at 0."}],"responses":{"200":{"description":"Transaction found.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","required":["id","sep","kind","status","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["6"]},"kind":{"type":"string","enum":["deposit","deposit-exchange","withdrawal","withdrawal-exchange"]},"status":{"type":"string","description":"Possible status value for SEP-6 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_customer_info_update","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large"],"title":"StatusSEP6"},"type":{"type":"string"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"refund_memo":{"description":"if provided, this memo should be used for refund transactions","type":"string"},"refund_memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}}}},"title":"TransactionSEP6"}}},"title":"TransactionListSEP6"},{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","required":["id","sep","kind","status","amount_expected","destination_account","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["24"]},"kind":{"type":"string","enum":["deposit","withdrawal"]},"status":{"type":"string","description":"Possible status value for SEP-24 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large"],"title":"StatusSEP24"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"refund_memo":{"description":"if provided, this memo should be used for refund transactions","type":"string"},"refund_memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"}},"title":"TransactionSEP24"}}},"title":"TransactionListSEP24"},{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","required":["id","sep","kind","status","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["31"]},"kind":{"type":"string","enum":["receive"]},"status":{"type":"string","description":"Possible status value for SEP-31 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_sender","pending_receiver","pending_transaction_info_update","pending_customer_info_update"],"title":"StatusSEP31"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"external_transaction_id":{"type":"string"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}}},"creator":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}},"title":"TransactionSEP31"}}},"title":"TransactionListSEP31"}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"404":{"description":"Transaction not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/transactions","info":{"version":"2.0.0","title":"Platform API"},"postman":{"name":"Retrieve a List of Transactions","description":{"content":"Allows to query list of transactions for desired SEP. This api supports pagination, and it's possible (and recommended) to make multiple requests to query transactions. The last page is reached when the number of elements returned by the endpoint is smaller than provided `page_size`.","type":"text/plain"},"url":{"path":["transactions"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Lookup transactions belonging to this SEP.","type":"text/plain"},"key":"sep","value":""},{"disabled":false,"description":{"content":"Specifies field that transactions will be ordered by. Note, that secondary sort is transaction id in ascending value.\nI.e. when timestamps for 2 or more transactions is identical, they will be sorted by id.","type":"text/plain"},"key":"order_by","value":""},{"disabled":false,"description":{"content":"Specifies order. Note, that when the field is null, all transactions with null value will be last, regardless of soring order (NULLS LAST).\nFor example, transfer time may not be specified for some transactions, resulting into `transfer_received_at` being null. If so, transactions with non-null values will be sorted and returned first, followed by all transactions with null timestamps.","type":"text/plain"},"key":"order","value":""},{"disabled":false,"description":{"content":"Filters transactions for specified array of statuses. If not provided, filtering is disabled (default behavior)","type":"text/plain"},"key":"statuses","value":""},{"disabled":false,"description":{"content":"Size of a single search page. Must be positive.","type":"text/plain"},"key":"page_size","value":""},{"disabled":false,"description":{"content":"Page number to use for continuous search. Page count beings at 0.","type":"text/plain"},"key":"page_number","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Transactions","SEP-6","SEP-24","SEP-31"],"operationId":"getTransactions","description":"Allows to query list of transactions for desired SEP. This api supports pagination, and it's possible (and recommended) to make multiple requests to query transactions. The last page is reached when the number of elements returned by the endpoint is smaller than provided `page_size`.","parameters":[{"in":"query","name":"sep","required":true,"schema":{"type":"string","enum":[6,24,31]},"description":"Lookup transactions belonging to this SEP."},{"in":"query","name":"order_by","schema":{"type":"string","enum":["created_at","transfer_received_at"],"default":"created_at"},"description":"Specifies field that transactions will be ordered by. Note, that secondary sort is transaction id in ascending value.\nI.e. when timestamps for 2 or more transactions is identical, they will be sorted by id."},{"in":"query","name":"order","schema":{"type":"string","enum":["asc","desc"],"default":"asc"},"description":"Specifies order. Note, that when the field is null, all transactions with null value will be last, regardless of soring order (NULLS LAST).\nFor example, transfer time may not be specified for some transactions, resulting into `transfer_received_at` being null. If so, transactions with non-null values will be sorted and returned first, followed by all transactions with null timestamps."},{"in":"query","name":"statuses","schema":{"type":"array","items":{"type":"string","description":"Possible status values for all transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large","pending_sender","pending_receiver","pending_transaction_info_update","pending_customer_info_update"],"title":"StatusSEPAll"}},"description":"Filters transactions for specified array of statuses. If not provided, filtering is disabled (default behavior)"},{"in":"query","name":"page_size","schema":{"type":"integer","default":20},"description":"Size of a single search page. Must be positive."},{"in":"query","name":"page_number","schema":{"type":"integer","default":0},"description":"Page number to use for continuous search. Page count beings at 0."}],"responses":{"200":{"description":"Transaction found.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","required":["id","sep","kind","status","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["6"]},"kind":{"type":"string","enum":["deposit","deposit-exchange","withdrawal","withdrawal-exchange"]},"status":{"type":"string","description":"Possible status value for SEP-6 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_customer_info_update","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large"],"title":"StatusSEP6"},"type":{"type":"string"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"refund_memo":{"description":"if provided, this memo should be used for refund transactions","type":"string"},"refund_memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}}}},"title":"TransactionSEP6"}}},"title":"TransactionListSEP6"},{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","required":["id","sep","kind","status","amount_expected","destination_account","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["24"]},"kind":{"type":"string","enum":["deposit","withdrawal"]},"status":{"type":"string","description":"Possible status value for SEP-24 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_user_transfer_start","pending_user_transfer_complete","pending_anchor","pending_trust","pending_user","no_market","too_small","too_large"],"title":"StatusSEP24"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"source_account":{"type":"string"},"destination_account":{"type":"string"},"external_transaction_id":{"type":"string"},"memo":{"type":"string"},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"},"refund_memo":{"description":"if provided, this memo should be used for refund transactions","type":"string"},"refund_memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text id hash"],"title":"MemoType"}},"title":"TransactionSEP24"}}},"title":"TransactionListSEP24"},{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","required":["id","sep","kind","status","started_at"],"properties":{"id":{"type":"string"},"sep":{"type":"string","enum":["31"]},"kind":{"type":"string","enum":["receive"]},"status":{"type":"string","description":"Possible status value for SEP-31 transactions","enum":["incomplete","completed","refunded","expired","error","pending_stellar","pending_external","pending_sender","pending_receiver","pending_transaction_info_update","pending_customer_info_update"],"title":"StatusSEP31"},"amount_expected":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_in":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_out":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"quote_id":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"transfer_received_at":{"type":"string","format":"date-time"},"message":{"type":"string"},"refunds":{"type":"object","properties":{"amount_refunded":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"amount_fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"id_type":{"type":"string","enum":["stellar","external"]},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"fee":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"},"requested_at":{"type":"string","format":"date-time"},"refunded_at":{"type":"string","format":"date-time"}}}}},"title":"Refunds"},"stellar_transactions":{"type":"array","items":{"type":"object","required":["id","created_at","envelope","payments"],"properties":{"id":{"type":"string","description":"The ID of the transaction in the Stellar network."},"memo":{"type":"string","description":"The memo of the transaction in the Stellar network."},"memo_type":{"type":"string","description":"The memo type of the transaction in the Stellar network. Should be present if memo is not null.","enum":["text","hash","id"]},"created_at":{"type":"string","format":"date-time","description":"The time the transaction was registered in the Stellar network."},"envelope":{"type":"string","description":"The transaction envelope, containing all the transaction information."},"payments":{"type":"array","items":{"type":"object","required":["id","payment_type","source_account","destination_account","amount"],"properties":{"id":{"type":"string","description":"The ID of the payment in the Stellar Network."},"payment_type":{"type":"string","description":"The type of payment in the Stellar Network.","enum":["payment","path_payment"],"default":"payment"},"source_account":{"type":"string","description":"The account being debited in the Stellar Network."},"destination_account":{"type":"string","description":"The account being credited in the Stellar Network."},"amount":{"type":"object","required":["amount","asset"],"properties":{"amount":{"type":"string"},"asset":{"type":"string"}},"title":"Amount"}}}}},"title":"StellarTransaction"}},"external_transaction_id":{"type":"string"},"customers":{"type":"object","description":"The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\nthis object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.\n","properties":{"sender":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"},"receiver":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}}},"creator":{"type":"object","description":"StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.\n\nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.\n\nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.\n\nFor a SEP-6 Anchor, the `account` and `memo` fields should be used.\n","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`."}},"title":"StellarId"}},"title":"TransactionSEP31"}}},"title":"TransactionListSEP31"}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}},"404":{"description":"Transaction not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"id":{"type":"string"}},"required":["error"],"title":"Error"}}}}},"method":"get","path":"/transactions","info":{"version":"2.0.0","title":"Platform API"},"postman":{"name":"Retrieve a List of Transactions","description":{"content":"Allows to query list of transactions for desired SEP. This api supports pagination, and it's possible (and recommended) to make multiple requests to query transactions. The last page is reached when the number of elements returned by the endpoint is smaller than provided `page_size`.","type":"text/plain"},"url":{"path":["transactions"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Lookup transactions belonging to this SEP.","type":"text/plain"},"key":"sep","value":""},{"disabled":false,"description":{"content":"Specifies field that transactions will be ordered by. Note, that secondary sort is transaction id in ascending value.\nI.e. when timestamps for 2 or more transactions is identical, they will be sorted by id.","type":"text/plain"},"key":"order_by","value":""},{"disabled":false,"description":{"content":"Specifies order. Note, that when the field is null, all transactions with null value will be last, regardless of soring order (NULLS LAST).\nFor example, transfer time may not be specified for some transactions, resulting into `transfer_received_at` being null. If so, transactions with non-null values will be sorted and returned first, followed by all transactions with null timestamps.","type":"text/plain"},"key":"order","value":""},{"disabled":false,"description":{"content":"Filters transactions for specified array of statuses. If not provided, filtering is disabled (default behavior)","type":"text/plain"},"key":"statuses","value":""},{"disabled":false,"description":{"content":"Size of a single search page. Must be positive.","type":"text/plain"},"key":"page_size","value":""},{"disabled":false,"description":{"content":"Page number to use for continuous search. Page count beings at 0.","type":"text/plain"},"key":"page_number","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: api/anchor-platform/resources/platform-api custom_edit_url: null @@ -62,7 +62,7 @@ For a SEP-31 Sending Anchor, the `account` and `memo` fields should be used. For a SEP-6 Anchor, the `account` and `memo` fields should be used. -
        • ]
        • records object[]
        • Array [
        • amount_expected object required
          amount_in object
          amount_out object
          amount_fee object
          refunds object
          amount_refunded object
          amount_fee object
          payments object[]
        • Array [
        • amount object
          fee object
        • ]
        • stellar_transactions object[]
        • Array [
        • payments object[] required
        • Array [
        • amount object required
        • ]
        • ]
        • ]
        • records object[]
        • Array [
        • amount_expected object
          amount_in object
          amount_out object
          amount_fee object
          refunds object
          amount_refunded object
          amount_fee object
          payments object[]
        • Array [
        • amount object
          fee object
        • ]
        • stellar_transactions object[]
        • Array [
        • payments object[] required
        • Array [
        • amount object required
        • ]
        • ]
        • customers object
          +
        • ]
        • records object[]
        • Array [
        • amount_expected object required
          amount_in object
          amount_out object
          amount_fee object
          refunds object
          amount_refunded object
          amount_fee object
          payments object[]
        • Array [
        • amount object
          fee object
        • ]
        • stellar_transactions object[]
        • Array [
        • payments object[] required
        • Array [
        • amount object required
        • ]
        • ]
        • ]
        • records object[]
        • Array [
        • amount_expected object
          amount_in object
          amount_out object
          amount_fee object
          refunds object
          amount_refunded object
          amount_fee object
          payments object[]
        • Array [
        • amount object
          fee object
        • ]
        • stellar_transactions object[]
        • Array [
        • payments object[] required
        • Array [
        • amount object required
        • ]
        • ]
        • customers object
          The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12), this object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer. @@ -101,7 +101,7 @@ For a SEP-31 Sending Anchor, the `account` and `memo` fields should be used. For a SEP-6 Anchor, the `account` and `memo` fields should be used. -
        • ]
        • +
        • ]
        • Bad Request diff --git a/api/horizon/introduction/streaming.mdx b/api/horizon/introduction/streaming.mdx index 602bc5536..09365e105 100644 --- a/api/horizon/introduction/streaming.mdx +++ b/api/horizon/introduction/streaming.mdx @@ -21,7 +21,6 @@ All attributes for the endpoints that allow streaming are the same as regular re | [Payments](../resources/operations/object/payment.mdx) | | [Effects](../resources/effects/index.mdx) | | [Accounts](../resources/accounts/index.mdx) | -| [Offers](../resources/offers/index.mdx) | | [Trades](../resources/trades/index.mdx) | | [Order Books](../aggregations/order-books/index.mdx) | diff --git a/docs/anchoring-assets/anchor-platform/component/observer/observer.mdx b/docs/anchoring-assets/anchor-platform/component/observer/observer.mdx new file mode 100644 index 000000000..74d1788fc --- /dev/null +++ b/docs/anchoring-assets/anchor-platform/component/observer/observer.mdx @@ -0,0 +1,36 @@ +Using the Payment Observer allows you to delegate this step to the Anchor Platform. To enable the Payment Observer, use the `--stellar-observer` flag in the command section of the [compose file](#configuration). + +The Payment Observer will track all transactions sent to the distribution account. When the transaction with the expected memo is detected in the network, the status will automatically change to `pending_anchor` and event will be the emitted (if Kafka is used). + +In order to update the transaction's statuses, the observer makes corresponding JSON-RPC requests to the platform. It should use the following URL. + + + +```bash +# dev.env +PLATFORM_API_BASE_URL=http://platform-server:8085 +``` + + + +:::caution + +The Payment Observer won't validate the amounts. It's your responsibility to verify that the amount sent by the user is correct. + +::: + +:::info + +If you already have a system that monitors payments, make sure that the logic of the system matches the description below: + +First, wait for the transaction to be included in the ledger (using an SDK). This transaction must have the expected memo and destination address (distribution account). Once this transaction has been detected and verified, notify the user that the funds have been received using the [notify_onchain_funds_received](#onchain-funds-received) JSON-RPC request. + +::: + +:::tip + +The Fireblocks custody service will automatically track transactions and notify the user that the funds have been received. See the [Fireblocks custody service documentation][fireblocks] for more details. + +::: + +[fireblocks]: /docs/category/fireblocks diff --git a/docs/anchoring-assets/anchor-platform/component/rpc/error.mdx b/docs/anchoring-assets/anchor-platform/component/rpc/error.mdx new file mode 100644 index 000000000..27746e6f0 --- /dev/null +++ b/docs/anchoring-assets/anchor-platform/component/rpc/error.mdx @@ -0,0 +1,16 @@ +
          + +| Error code | Meaning | +| :--------- | :------------------------------------------- | +| -32600 | The JSON sent is not a valid Request object | +| -32601 | The method does not exist / is not available | +| -32602 | Invalid method parameter(s) | +| -32603 | Internal JSON-RPC error | + +
          + +:::tip + +We will also reference a `$transaction_id` variable. This is an identification of transaction that is being returned from the Anchor Platform on an withdrawal or deposit start request. You can obtain the transaction ID by connecting the test wallet to your local Anchor Platform instance. + +::: diff --git a/docs/anchoring-assets/anchor-platform/component/rpc/request.mdx b/docs/anchoring-assets/anchor-platform/component/rpc/request.mdx new file mode 100644 index 000000000..9157143af --- /dev/null +++ b/docs/anchoring-assets/anchor-platform/component/rpc/request.mdx @@ -0,0 +1,29 @@ +The Request object must contain the following attributes: + + + +- ATTRIBUTE + - DATA TYPE + - DESCRIPTION +- jsonrpc + - string + - A String specifying the version of the JSON-RPC protocol. MUST be exactly "2.0" +- method + - string + - A String containing the name of the method to be invoked. List of available methods you can see in [JSON-RPC Methods][json-rpc-methods] +- params + - object + - A Structured value that holds the parameter values, corresponding to method call, to be used during the invocation of the method +- id + - string + - An identifier established by the client. The Server will reply with the same value in the Response object + + + +:::tip + +It's possible to provide multiple updates in a single JSON-RPC request (by placing multiple JSON-RPC request objects). When an update is done in this way, all updates will be done sequentially. + +Most importantly, each JSON-RPC request is not atomic. If one update fails, all previous updates WILL be applied and all subsequent updates WILL be processed and applied as well. + +::: diff --git a/docs/anchoring-assets/anchor-platform/component/rpc/response.mdx b/docs/anchoring-assets/anchor-platform/component/rpc/response.mdx new file mode 100644 index 000000000..02d808103 --- /dev/null +++ b/docs/anchoring-assets/anchor-platform/component/rpc/response.mdx @@ -0,0 +1,33 @@ +The Response is expressed as a single JSON Object, with the following attributes: + + + +- ATTRIBUTE + - DATA TYPE + - DESCRIPTION +- jsonrpc + - string + - A String specifying the version of the JSON-RPC protocol. It's set to "2.0" +- result + - object + - A Structured value that holds the updated transaction details +- id + - string + - An identifier sent by the client +- error + - object + - A Structured value that holds the error details + - id + - string + - Unique id of the transaction for which an error occurred + - code + - number + - A number that indicates the error type that occurred. Please see a list of [error codes](#error-codes) below + - message + - string + - A String providing a short description of the error + - data + - string + - A primitive or structured value that contains additional information about the error + + diff --git a/docs/anchoring-assets/anchor-platform/component/rpc/rpc.mdx b/docs/anchoring-assets/anchor-platform/component/rpc/rpc.mdx new file mode 100644 index 000000000..f00b8ee7f --- /dev/null +++ b/docs/anchoring-assets/anchor-platform/component/rpc/rpc.mdx @@ -0,0 +1,17 @@ +Before making JSON-RPC requests, let's first create a template for making a request to the Anchor Platform. + + + +```bash +# call-json-rpc.sh +#!/usr/bin/env bash + +curl localhost:8085 \ + -X POST \ + -H 'Content-Type: application/json' \ + --data "@$1" +``` + + + +This small script will make a JSON-RPC request to the Anchor Platform hosted on the default port (8085). JSON transaction data stored in the provided file will be used as body (requests must be an array). diff --git a/docs/anchoring-assets/anchor-platform/component/security/api_key.mdx b/docs/anchoring-assets/anchor-platform/component/security/api_key.mdx new file mode 100644 index 000000000..f16c47f7a --- /dev/null +++ b/docs/anchoring-assets/anchor-platform/component/security/api_key.mdx @@ -0,0 +1,14 @@ +To enable API key authentication, modify your `dev.env` file: + + + +```bash +# dev.env +PLATFORM_SERVER_AUTH_TYPE=api_key +# Will be used as API key +SECRET_PLATFORM_API_AUTH_SECRET="your API key that business server will use" +``` + + + +After it's enabled, all requests must contain a valid `X-Api-Key` header, set to the configured API key. diff --git a/docs/anchoring-assets/anchor-platform/component/security/jwt.mdx b/docs/anchoring-assets/anchor-platform/component/security/jwt.mdx new file mode 100644 index 000000000..f16c47f7a --- /dev/null +++ b/docs/anchoring-assets/anchor-platform/component/security/jwt.mdx @@ -0,0 +1,14 @@ +To enable API key authentication, modify your `dev.env` file: + + + +```bash +# dev.env +PLATFORM_SERVER_AUTH_TYPE=api_key +# Will be used as API key +SECRET_PLATFORM_API_AUTH_SECRET="your API key that business server will use" +``` + + + +After it's enabled, all requests must contain a valid `X-Api-Key` header, set to the configured API key. diff --git a/docs/anchoring-assets/anchor-platform/component/security/security.mdx b/docs/anchoring-assets/anchor-platform/component/security/security.mdx new file mode 100644 index 000000000..76a3832c3 --- /dev/null +++ b/docs/anchoring-assets/anchor-platform/component/security/security.mdx @@ -0,0 +1,11 @@ +:::caution + +By default, the Platform API's endpoints such as `GET /transactions` and `GET /transactions/:id` are not protected, and are accessible by anyone who has access to the server, including wallet applications. + +::: + +:::info + +It's recommended to keep Platform server accessible only from the private network. However, you may want to add additional layer of protection via securing the API. + +::: diff --git a/docs/anchoring-assets/anchor-platform/index.mdx b/docs/anchoring-assets/anchor-platform/index.mdx index 026f7e37f..241a53958 100644 --- a/docs/anchoring-assets/anchor-platform/index.mdx +++ b/docs/anchoring-assets/anchor-platform/index.mdx @@ -12,6 +12,7 @@ The Anchor Platform accomplishes this by implementing the ecosystem's standardiz Below is a list of SEPs currently supported: - [SEP-1][sep-1]: [Stellar Info File][sep1-ap] +- [SEP-6][sep-6]: [Programmatic Deposit and Withdrawal][sep6-ap] - [SEP-10][sep-10]: [Stellar Authentication][sep10-ap] - [SEP-12][sep-12]: KYC API - [SEP-24][sep-24]: [Hosted Deposit and Withdrawal][sep24-ap] @@ -21,6 +22,7 @@ Below is a list of SEPs currently supported: The documentation for the Anchor Platform is a work in progress. Developers are welcome to dive into the code and existing documentation on the [GitHub repository][anchor-platform-github], or if you're looking to build an on & off-ramp service compatible with SEP-24, see our [getting started guide][sep24-ap]. [sep-1]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md +[sep-6]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md [sep-10]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md [sep-12]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md [sep-24]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md @@ -28,6 +30,7 @@ The documentation for the Anchor Platform is a work in progress. Developers are [sep-38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md [anchor-platform-github]: https://github.com/stellar/java-stellar-anchor-sdk [sep1-ap]: /docs/category/stellar-info-file +[sep6-ap]: /docs/category/programmatic-deposits-and-withdrawals [sep10-ap]: /docs/category/stellar-authentication [sep24-ap]: /docs/category/hosted-deposits-and-withdrawals [sep31-ap]: /docs/category/cross-border-payments diff --git a/docs/anchoring-assets/anchor-platform/sep24/integration.mdx b/docs/anchoring-assets/anchor-platform/sep24/integration.mdx index 27a089238..f024ee96b 100644 --- a/docs/anchoring-assets/anchor-platform/sep24/integration.mdx +++ b/docs/anchoring-assets/anchor-platform/sep24/integration.mdx @@ -5,6 +5,14 @@ sidebar_position: 30 import { CodeExample } from "@site/src/components/CodeExample"; import { AttributeTable } from "@site/src/components/AttributeTable"; +import Security from "../component/security/security.mdx"; +import UsingApiKey from "../component/security/api_key.mdx"; +import UsingJwt from "../component/security/jwt.mdx"; +import Rpc from "../component/rpc/rpc.mdx"; +import RpcRequest from "../component/rpc/request.mdx"; +import RpcResponse from "../component/rpc/response.mdx"; +import RpcError from "../component/rpc/error.mdx"; +import Observer from "../component/observer/observer.mdx"; One of the main points of interaction with the Anchor Platform is notifying the Anchor Platform about events related to the transaction. @@ -25,157 +33,31 @@ You can find out more about transaction flow and statuses in the [SEP-24 protoco ## Securing Platform API -:::caution - -By default, the Platform API's endpoints such as `GET /transactions` and `GET /transactions/:id` are not protected, and are accessible by anyone who has access to the server, including wallet applications. - -::: - -:::info - -It's recommended to keep Platform server accessible only from the private network. However, you may want to add additional layer of protection via securing the API. - -::: + ### Using API Key -To enable API key authentication, modify your `dev.env` file: - - - -```bash -# dev.env -PLATFORM_SERVER_AUTH_TYPE=api_key -# Will be used as API key -SECRET_PLATFORM_API_AUTH_SECRET="your API key that business server will use" -``` - - - -After it's enabled, all requests must contain a valid `X-Api-Key` header, set to the configured API key. + ### Using JWT -To enable JWT authentication, modify your `dev.env` file: - - - -```bash -# dev.env -PLATFORM_SERVER_AUTH_TYPE=jwt -SECRET_PLATFORM_API_AUTH_SECRET="your encryption key shared with your business server" -``` - - - -After it's enabled, all requests must contain a valid `Authorization` header. The JWT provided must have the `jti` and `exp` fields representing a valid transaction and token expiration time, respectively. + ## Making JSON-RPC Requests -Before making JSON-RPC requests, let's first create a template for making a request to the Anchor Platform. - - - -```bash -# call-json-rpc.sh -#!/usr/bin/env bash - -curl localhost:8085 \ - -X POST \ - -H 'Content-Type: application/json' \ - --data "@$1" -``` - - - -This small script will make a JSON-RPC request to the Anchor Platform hosted on the default port (8085). JSON transaction data stored in the provided file will be used as body (requests must be an array). + ### JSON-RPC Request -The Request object must contain the following attributes: - - - -- ATTRIBUTE - - DATA TYPE - - DESCRIPTION -- jsonrpc - - string - - A String specifying the version of the JSON-RPC protocol. MUST be exactly "2.0" -- method - - string - - A String containing the name of the method to be invoked. List of available methods you can see in [JSON-RPC Methods][json-rpc-methods] -- params - - object - - A Structured value that holds the parameter values, corresponding to method call, to be used during the invocation of the method -- id - - string - - An identifier established by the client. The Server will reply with the same value in the Response object - - - -:::tip - -It's possible to provide multiple updates in a single JSON-RPC request (by placing multiple JSON-RPC request objects). When an update is done in this way, all updates will be done sequentially. - -Most importantly, each JSON-RPC request is atomic. If one update fails, all previous updates WILL be applied and all subsequent updates WILL be processed and applied as well. - -::: + ### JSON-RPC Response -The Response is expressed as a single JSON Object, with the following attributes: - - - -- ATTRIBUTE - - DATA TYPE - - DESCRIPTION -- jsonrpc - - string - - A String specifying the version of the JSON-RPC protocol. It's set to "2.0" -- result - - object - - A Structured value that holds the updated transaction details -- id - - string - - An identifier sent by the client -- error - - object - - A Structured value that holds the error details - - id - - string - - Unique id of the transaction for which an error occurred - - code - - number - - A number that indicates the error type that occurred. Please see a list of [error codes](#error-codes) below - - message - - string - - A String providing a short description of the error - - data - - string - - A primitive or structured value that contains additional information about the error - - + ### Error Codes -
          - -| Error code | Meaning | -| :--------- | :------------------------------------------- | -| -32600 | The JSON sent is not a valid Request object | -| -32601 | The method does not exist / is not available | -| -32602 | Invalid method parameter(s) | -| -32603 | Internal JSON-RPC error | - -
          - -:::tip - -We will also reference a `$transaction_id` variable. This is an identification of transaction that is being returned from the Anchor Platform on an interactive withdrawal or deposit start request. You can obtain the transaction ID by connecting the test wallet to your local Anchor Platform instance. - -::: + ## Updating Deposit Transaction Via JSON-RPC @@ -559,7 +441,7 @@ Depending on the `success` flag, the status of the transaction will be changed t ::: -### Refund Sent +### Sending Refund Via Custody Service There is a possibility to send funds back to the user (refund). You can refund the whole sum(full refund) or do a set of partial refunds. Also, if user sent more money than expected, you can refund a part of the sum back to the user and send the rest as onchain funds. @@ -1020,7 +902,7 @@ To execute this, you need to run: The refund logic works in the same way as for the deposit flow. For more details, see [Refund Sent](#refund-sent) of the deposit flow. -### Do Stellar Refund +### Sending Refund Via Custody Service Integration with a custody service allows you to do a refund via a custody service, such as Fireblocks. @@ -1083,51 +965,8 @@ Works in the same manner as for the deposit flow. For more details, see [Transac ## Tracking Stellar Transactions -Using the Payment Observer allows you to delegate this step to the Anchor Platform. To enable the Payment Observer, use the `--stellar-observer` flag in the command section of the [compose file](#configuration). - -The Payment Observer will track all transactions sent to the distribution account. When the transaction with the expected memo is detected in the network, the status will automatically change to `pending_anchor` and event will be the emitted (if Kafka is used). - -In order to update the transaction's statuses, the observer makes corresponding JSON-RPC requests to the platform. It should use the following URL. - - - -```bash -# dev.env -PLATFORM_API_BASE_URL=http://platform-server:8085 -``` - - - -:::caution - -The Payment Observer won't validate the amounts. It's your responsibility to verify that the amount sent by the user is correct. - -::: - -:::info - -If you already have a system that monitors payments, make sure that the logic of the system matches the description below: - -First, wait for the transaction to be included in the ledger (using an SDK). This transaction must have the expected memo and destination address (distribution account). Once this transaction has been detected and verified, notify the user that the funds have been received using the [notify_onchain_funds_received](#onchain-funds-received) JSON-RPC request. + -[sep-1]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md [sep-9]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0009.md [sep-24]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md -[sep-38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md -[sep24-get-info]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#info -[anchor-platform-image]: https://hub.docker.com/r/stellar/anchor-platform -[docker-compose]: https://docs.docker.com/compose/ -[minikube]: https://minikube.sigs.k8s.io/docs/ -[kubernetes]: https://kubernetes.io/ -[nginx]: https://www.nginx.com/ -[ap-default-values]: https://github.com/stellar/java-stellar-anchor-sdk/blob/develop/platform/src/main/resources/config/anchor-config-default-values.yaml -[stellar-demo-wallet]: https://demo-wallet.stellar.org -[stellar-lab]: https://laboratory.stellar.org/ -[postgresql]: https://www.postgresql.org/ -[aurora-postgresql]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.AuroraPostgreSQL.html -[h2]: https://www.h2database.com/html/main.html -[sqlite]: https://www.sqlite.org/index.html -[flyway]: https://documentation.red-gate.com/fd/welcome-to-flyway-184127914.html -[sep-24-ref-ui]: https://github.com/stellar/sep24-reference-ui -[sep-24-ref]: https://github.com/stellar/java-stellar-anchor-sdk/tree/develop/kotlin-reference-server [json-rpc-methods]: /api/anchor-platform/rpc/methods diff --git a/docs/anchoring-assets/anchor-platform/sep6/_category_.json b/docs/anchoring-assets/anchor-platform/sep6/_category_.json new file mode 100644 index 000000000..da6dc71ce --- /dev/null +++ b/docs/anchoring-assets/anchor-platform/sep6/_category_.json @@ -0,0 +1,7 @@ +{ + "position": 65, + "label": "Programmatic Deposits and Withdrawals", + "link": { + "type": "generated-index" + } +} \ No newline at end of file diff --git a/docs/anchoring-assets/anchor-platform/sep6/configuration.mdx b/docs/anchoring-assets/anchor-platform/sep6/configuration.mdx new file mode 100644 index 000000000..fabcfb5c7 --- /dev/null +++ b/docs/anchoring-assets/anchor-platform/sep6/configuration.mdx @@ -0,0 +1,126 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Modify a Stellar Info File + +Next, let's modify the `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-6 functionality is supported by your business, and they also need to know all the currencies you support. + + + +```toml +# dev.stellar.toml +ACCOUNTS = ["add your public keys for your distribution accounts here"] +SIGNING_KEY = "add your signing key here" +NETWORK_PASSPHRASE = "Test SDF Network ; September 2015" + +TRANSFER_SERVER = "http://localhost:8080/sep6" +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" + +# Add support for USDC +[[CURRENCIES]] +code = "USDC" +issuer = "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" +status = "test" +is_asset_anchored = false +desc = "USD Coin issued by Circle" + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +Note that you will need to create another file for your production deployment that uses the public network's passphrase, your production service URLs, your Mainnet distribution accounts and signing key, as well as the Mainnet issuing accounts of the assets your service utilizes. + +## Enable Programmatic Deposits & Withdrawals + +Now you're ready to enable programmatic deposits and withdrawals using the SEP-6 API. Specify the following in your `dev.assets.yaml` file, and change the values depending on your use case. This example asset file enables support for Circle's USDC and a fiat USD to deposit from and withdraw to. The methods specified in the `deposit` and `withdraw` sections are the methods that will be exposed by the [`GET /info`][sep-6] SEP-6 endpoint under the `type` field in the case of `deposit` and `types` field in the case of `withdraw`. + + + +```yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep6_enabled: true + deposit: + enabled: true + methods: + - SEPA + - SWIFT + - cash + withdraw: + enabled: true + methods: + - bank_account + - cash + - schema: iso4217 + code: USD + significant_decimals: 2 +``` + + + +The information provided for the `assets` value closely maps to the information that will be exposed to the wallet application using the [`GET /info`][sep-6] SEP-6 endpoint. The Anchor Platform also uses this information to validate requests made to your service. + +## Test With the Demo Wallet + +Wallets should now be able to discover, authenticate, and initiate transactions with your service! Your project and source files should now look something like this. + + + +``` +├── dev.env +├── docker-compose.yaml +├── config +│ ├── dev.assets.yaml +│ ├── dev.stellar.toml +``` + + + +Your environment should now look like the following. + + + +```bash +# dev.env +ASSETS_TYPE=file +ASSETS_VALUE=/home/dev.assets.yaml + +SEP1_ENABLED=true +SEP1_TOML_TYPE=file +SEP1_TOML_VALUE=/home/dev.stellar.toml + +SEP10_ENABLED=true +SEP10_HOME_DOMAIN=localhost:8080 +SECRET_SEP10_SIGNING_SEED="a Stellar private key" +SECRET_SEP10_JWT_SECRET="a secret encryption key" +``` + + + +To test this out, go to the [Stellar Demo Wallet][stellar-demo-wallet]. + +Initiate a deposit transaction by doing the following: + +- Create a new keypair +- Click the "Add Asset" button and enter + - the code of the Stellar asset on your `stellar.toml` file + - your home domain, `localhost:8080` +- Select the dropdown and click "SEP-6 Deposit", then click "Start" + +The demo wallet should be able to find your `stellar.toml` file, authenticate using the Stellar keypair you just created, and initiate a transaction. + +[sep-6]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md +[sep1-ap]: /docs/category/stellar-info-file +[stellar-demo-wallet]: https://demo-wallet.stellar.org/ diff --git a/docs/anchoring-assets/anchor-platform/sep6/index.mdx b/docs/anchoring-assets/anchor-platform/sep6/index.mdx new file mode 100644 index 000000000..ac8c10409 --- /dev/null +++ b/docs/anchoring-assets/anchor-platform/sep6/index.mdx @@ -0,0 +1,33 @@ +--- +title: "Getting Started" +sidebar_position: 10 +--- + +This guide will walk you through configuring and integration with the Anchor Platform for the purpose of build an on & off-ramp service compatible with [SEP-6][sep-6], the ecosystem's standardized protocol for programmatic deposit and withdrawals. + +By leveraging the Anchor Platform's support for SEP-6, businesses make their own on & off-ramp service available as an in-app experience through Stellar-based applications such as wallets and exchanges, extending their reach and connecting with users through the applications they already use. + +Before continuing with this section, make sure that you have already [installed][installation-ap] the Anchor Platform, and configured necessary features, required by SEP-6: [SEP-1 (Stellar Info File)][sep1-ap] and [SEP-10 (Stellar Authentication)][sep10-ap]. + +## The Basic User Experience + +The complete customer experience for a deposit or withdrawal using SEP-6 is as follows: + +1. The customer opens the SEP-6 wallet application of their choice +2. The customer selects an asset to deposit and the wallet finds an anchor (clients could also choose the specific anchor) +3. Once the wallet authenticates with the anchor, the customer begins entering their KYC and transaction information requested by the anchor +4. The wallet provides instructions, and the customer deposits real fiat currency with the anchor (such as bank transfer) +5. Once the wallet receives the deposit, the customer receives the tokenized asset on the Stellar network from the anchor's distribution account + +The customer can then use the digital asset on the Stellar network for remittance, payments, trading, store of value, or another use case not listed here. At some later date, the customer could decide to withdraw their assets from the Stellar network, which would look something like this: + +1. The customer opens their wallet application +2. The customer selects the asset for withdrawal and wallet finds the anchor +3. After authenticating with the anchor, the customer can enter their transaction information and any additional KYC information that wasn't already collected +4. After asking for customer approval, the wallet sends the specified amount of the customer's asset balance to the anchor's distribution account on Stellar +5. Once the anchor receives the payment, the customer receives the withdrawn funds via any method supported by the anchor (such as bank transfer) + +[sep-6]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md +[installation-ap]: /docs/anchoring-assets/anchor-platform/getting_started +[sep1-ap]: /docs/category/stellar-info-file +[sep10-ap]: /docs/category/stellar-authentication diff --git a/docs/anchoring-assets/anchor-platform/sep6/integration.mdx b/docs/anchoring-assets/anchor-platform/sep6/integration.mdx new file mode 100644 index 000000000..5ee5e5331 --- /dev/null +++ b/docs/anchoring-assets/anchor-platform/sep6/integration.mdx @@ -0,0 +1,982 @@ +--- +title: "Integration" +sidebar_position: 30 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; +import { AttributeTable } from "@site/src/components/AttributeTable"; +import Security from "../component/security/security.mdx"; +import UsingApiKey from "../component/security/api_key.mdx"; +import UsingJwt from "../component/security/jwt.mdx"; +import Rpc from "../component/rpc/rpc.mdx"; +import RpcRequest from "../component/rpc/request.mdx"; +import RpcResponse from "../component/rpc/response.mdx"; +import RpcError from "../component/rpc/error.mdx"; +import Observer from "../component/observer/observer.mdx"; + +One of the main points of interaction with the Anchor Platform is notifying the Platform about events related to transactions. + +In general, you will want to provide updates for the following events. + +- Your business requires the user to submit KYC information to process a transaction +- Your business updated the in/out/fee amounts for a transaction +- Your business is ready to receive funds from the user +- Your business has received funds from the user +- Your business has sent funds to the user +- Your business has a processed a refund for the user's transaction +- Your business experienced an unexpected error + +This is done by making JSON-RPC requests to the Platform API's endpoint. JSON-RPC requests allow you to update the status of the transaction. To move the transaction to a specific status, it's necessary to make a corresponding JSON-RPC request and pass data that is required by the RPC method. + +The Anchor Platform JSON-RPC API is designed to notify the platform about changes in the status of the transaction. Given that, the API will be called every time a user or the anchor takes any action that progresses the transaction status in the flow. + +You can find out more about transaction flow and statuses in the [SEP-6 protocol document][sep-6]. + +[sep-6]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md + +## Securing Platform API + + + +### Using API Key + + + +### Using JWT + + + +## Making JSON-RPC Requests + + + +### JSON-RPC Request + + + +### JSON-RPC Response + + + +### Error Codes + + + +## Updating Deposit (Exchange) Transaction Via JSON-RPC + +SEP-6 deposit flow diagram defines sequences/rules of the transaction's status transition and a set of JSON-RPC method that should be called to change that status. You can't define the status you want to set for a specific transaction in your requests. Each JSON-RPC method defines data structures that it expects in request. If request doesn't contain a required attributes, the Anchor Platform will return and error and won't change status of the transaction. + +The deposit exchange flow is the same as the deposit flow, except the amounts will not need to be recalculated when requesting offchain funds, if the user has provided a firm quote from the anchor. + +[![sep6 deposit flow](/assets/sep6-deposit-flow-diagram.png)](/assets/sep6-deposit-flow-diagram.png) + +:::tip + +Statuses in green are mandatory and define the shortest way. + +Statuses in yellow are optional and can be skipped. + +Statuses in red mean the transaction is in an error status or it has expired. + +::: + +### Verifying KYC Information + +Although Anchor Platform does not require a customer to have their KYC information collected before initiating a deposit, your business may want to collect this information before the customer makes a transfer. By listening to transaction created events, or by polling the [`GET /transactions`][get-transactions] endpoint, you can determine if the transaction requires KYC information to be collected. The required SEP-9 fields can be communicated to the user by making a `request_customer_info_update` JSON-RPC request and providing the required field names. + + + +```json +// reuest-customer-info-update.json +[ + { + "id": "1", + "jsonrpc": "2.0", + "method": "request_customer_info_update", + "params": { + "id": "", + "message": "Please update your information to continue", + "required_customer_info_message": "A government issued ID is required for deposits over $1000.", + "required_customer_info_updates": [ + "id_type", + "id_country_code", + "id_issue_date", + "id_expiration_date", + "id_number" + ] + } + } +] +``` + + + +- `required_customer_info_message` is an optional message explaining why the user needs to update their information. +- `required_customer_info_updates` is an array of SEP-9 fields that the user must update. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh request-customer-info-update.json +``` + + + +### Ready to Receive Funds + +After the user has submitted their KYC information, the anchor can notify the Platform that they are ready to receive funds. The anchor should use the `request_offchain_funds` RPC to provide the final amounts to the user. To do so, make the following JSON-RPC request. + + + +```json +// request-offchain-funds.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "request_offchain_funds", + "params": { + "transaction_id": "", + "message": "Request offchain funds", + "amount_in": { + "amount": 10, + "asset": "iso4217:USD" + }, + "amount_out": { + "amount": 9, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 1, + "asset": "iso4217:USD" + }, + "amount_expected": { + "amount": 10 + }, + "instructions": { + "organization.bank_number": { + "value": "123456789", + "description": "US Bank routing number" + }, + "organization.bank_account_number": { + "value": "123456789", + "description": "US Bank account number" + } + } + } + } +] +``` + + + +- `amount_in` is the amount the user has to send to the business. +- `amount_out` is the amount the user will receive. +- `amount_fee` is the total amount of fees collected by the business. +- `asset` is part of the `amount_x` field and is in a SEP-38 format. In this example, it's set to USD, assuming the user made a bank transfer to the system using USD. +- `instructions` is the set of SEP-9 standard fields that user should use to send funds to the business. In this example, the user should send funds to the bank account with the routing number `123456789` and account number `123456789`. + +Information about amounts (in/out/fee) is required if you want to move the transaction to the `pending_user_transfer_start` status. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh request-offchain-funds.json +``` + + + +:::caution + +For exchange deposits with a firm quote (the request is associated with a `quote_id`), no amounts should not be provided. + +::: + +### Funds Received + +If offchain funds were received, you'll want to provide updated transaction information. + + + +```json +// offchain-funds-received.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_offchain_funds_received", + "params": { + "transaction_id": "", + "message": "Offchain funds received", + "funds_received_at": "2023-07-04T12:34:56Z", + "external_transaction_id": "7...9", + "amount_in": { + "amount": 10 + }, + "amount_out": { + "amount": 9 + }, + "amount_fee": { + "amount": 1 + }, + "amount_expected": { + "amount": 10 + } + } + } +] +``` + + + +- `funds_received_at` is the date and time of receiving funds. +- `external_transaction_id` is the ID of transaction on external network. + +The amount fields are optional. If skipped, the values prior to this request will be used. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh offchain-funds-received.json +``` + + + +### Waiting For User Funds + +In the real world, the transfer confirmation process may take time. In such cases, transactions should be set to a new status indicating that the confirmation of the transfer has been received but the funds themselves have not been received yet. + + + +```json +// offchain-funds-sent.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_offchain_funds_sent", + "params": { + "transaction_id": "", + "message": "Offchain funds sent", + "funds_received_at": "2023-07-04T12:34:56Z", + "external_transaction_id": "7...9" + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh offchain-funds-sent.json +``` + + + +### Sending Onchain Funds + +Next, send a transaction on the Stellar network to fulfill the user deposit. After the Stellar transaction has been submitted, it's necessary to send the `notify_onchain_funds_sent` JSON-RPC request to notify a user that the funds were successfully sent. + + + +```json +// onchain-funds-sent.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_onchain_funds_sent", + "params": { + "transaction_id": "", + "message": "Onchain funds sent", + "stellar_transaction_id": "7...9" + } + } +] +``` + + + +- `stellar_transaction_id` is the transaction id on Stellar network of the transfer. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh onchain-funds-sent.json +``` + + + +After this JSON-RPC request, the transaction will be transferred to the `completed` status. + +### Sending Payment Via Custody Service + +The Anchor Platform provides a possibility to send a payment via custody services, such as [Fireblocks][fireblocks]. To make a payment via a custody service, make the following JSON-RPC request. + + + +```json +// do-stellar-payment.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "do_stellar_payment", + "params": { + "transaction_id": "", + "message": "Custody payment started" + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh do-stellar-payment.json +``` + + + +After successful processing of the payment on a custody service, the Anchor Platform will automatically make the `notify_onchain_funds_sent` JSON-RPC request and the status of the transaction will be changed to `completed`. + +:::caution + +A user account may not be ready to receive funds. You can check that the account has established a [trustline](/docs/glossary#trustline). Otherwise, you can set the status of the transaction to the `pending_trust` to indicate that the anchor is waiting for the user to establish the trustline. + +If custody integration is enabled, the Anchor Platform will do this validation for you automatically. + +::: + +### Pending Trust + +This status has to be set if a payment requires an asset trustline that wasn't configured by the user. There are two ways of how the transaction may be moved to the `pending_trust` status. The first one is processing of a payment via custody service in case it detected that the trustline isn't configured. The second one is when the business itself detects that the trustline is missing and wants to notify the user that it has to be configured. To move the transaction to the `pending_trust` status, make the following JSON-RPC request. + + + +```json +// request-trust.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "request_trust", + "params": { + "transaction_id": "", + "message": "Asset trustine not configured" + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh request-trust.json +``` + + + +:::info + +Payment via custody service periodically checks if the trustline was configured. If it was, it will automatically send a payment to a custody service and change the status of the transaction to `pending_stellar`. + +::: + +### Trust Set + +This status has to be set if the business has detected that the trustline was or wasn't configured by user. + + + +```json +// trust-set.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_trust_set", + "params": { + "transaction_id": "", + "message": "Asset trustine set", + "success": "true" + } + } +] +``` + + + +- `success` flag which defines if trustline was or wasn't configured by user + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh trust-set.json +``` + + + +:::info + +Depending on the `success` flag, the status of the transaction will be changed to `pending_stellar` if the trustline was set, or to `pending_anchor` if it wasn't. + +::: + +### Refund Sent + +Sometimes, funds need to be sent back to the user (refund). You can refund the whole sum (full refund) or do a set of partial refunds back to the `source_account` using the `refund_memo` and `refund_memo_type` associated with the transaction if present. Also, if user sent more money than expected, you can refund a part of the sum back to the user and send the rest as onchain funds. + + + +```json +// refund-sent.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_refund_sent", + "params": { + "transaction_id": "", + "message": "Refund sent", + "refund": { + "id": "1c186184-09ee-486c-82a6-aa7a0ab1119c", + "amount": { + "amount": 10, + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": 1, + "asset": "iso4217:USD" + } + } + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh refund-sent.json +``` + + + +:::info + +If a sum of refunds is less than `amount_in`, the status of the transaction will be set to `pending_anchor`. Only if the sum of refunds is equal to `amount_in`, the status of the transaction will be set to `refunded`. + +::: + +### Refund Pending + +This is similar to [Refund Sent](#refund-sent), but it handles the case when a refund has been submitted to external network but is not yet confirmed. The status of the transaction is set to `pending_external`. This is the status that will be set when waiting for Bitcoin or other external crypto network to complete a transaction, or when waiting for a bank transfer. + +### Transaction Error + +If you encounter an unrecoverable error when processing the transaction, it's required to set the transaction status to `error`. You can use the message field to describe the error details. + + + +```json +// transaction-error.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_transaction_error", + "params": { + "transaction_id": "", + "message": "Error occurred" + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh transaction-error.json +``` + + + +:::tip + +If a user has made a transfer, you should do a transaction recovery, and then you can retry processing the transaction or initiate a refund. + +::: + +### Expired Transaction + +Your business may want to expire transactions that have been abandoned by the user after some time. It's good practice to clean up inactive transactions in the `incomplete` status. To do so, make the following JSON-RPC request to expire a transaction. + + + +```json +// transaction-expired.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_transaction_expired", + "params": { + "transaction_id": "", + "message": "Transaction expired" + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh transaction-expired.json +``` + + + +:::tip + +This JSON-RPC method can't be used after the user has made a transfer. + +::: + +### Transaction Recovery + +Transaction status can be changed from `error/expired` to `pending_anchor`. After recovery, you can refund the received assets or proceed with processing of the transaction. To recover a transaction, make the following JSON-RPC request. + + + +```json +// transaction-recovery.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_transaction_recovery", + "params": { + "transaction_id": "", + "message": "Transaction recovered" + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh transaction-recovery.json +``` + + + +## Updating Withdrawal (Exchange) Transaction Via JSON-RPC + +The SEP-6 withdrawal flow diagram defines the sequence/rules of the transaction's status transition. You can't define the status you want to set for a specific transaction in your requests. Each JSON-RPC method defines data structures that it expects in request. If request doesn't contain a required attributes, the Anchor Platform will return and error and won't change status of the transaction. + +The withdrawal exchange flow is the same as the withdrawal flow, except the amounts will not need to be recalculated when requesting onchain funds, if the user has provided a firm quote from the anchor. + +[![sep6 withdrawal flow](/assets/sep6-withdrawal-flow-diagram.png)](/assets/sep6-withdrawal-flow-diagram.png) + +:::tip + +Statuses in green are mandatory and define the shortest way. + +Statuses in yellow are optional and can be skipped. + +Statuses in red mean the transaction is in an error status or it has expired. + +::: + +Once the withdrawal flow is finished, implementing the withdrawal is straightforward. Some parts of the flow are similar and can be reused. + +The starting point both for withdrawal and for deposit is the same. + +### Ready to Receive Funds + +Similarly to deposit, the step after KYC has been collected is to notify the user that the anchor is ready to receive funds. However, as your service will be receiving transactions over the Stellar network, the RPC request will be different. The anchor should use the `request_onchain_funds` RPC to provide the final amounts to the user. To do so, make the following JSON-RPC request. + + + +```json +// request-onchain-funds.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "request_onchain_funds", + "params": { + "transaction_id": "", + "message": "Request onchain funds", + "amount_in": { + "amount": 10, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": 9, + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_expected": { + "amount": 10 + }, + "destination_account": "GD...G", + "memo": "12345", + "memo_type": "id" + } + } +] +``` + + + +- `amount_in` is the amount the user has to send to the business. +- `amount_out` is the amount the user will receive. +- `amount_fee` is the total amount of fees collected by the business. +- `asset` is part of the `amount_x` field and is in a SEP-38 format. In this example, it's set to USD, assuming the user made a bank transfer to the system using USD. +- `memo` is the memo the user should use when sending their onchain funds to the anchor. +- `memo_type` is the memo type the user should use when sending their onchain funds to the anchor. +- `destination_account` is the account the user should send the funds to. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh request-onchain-funds.json +``` + + + +:::caution + +For exchange withdrawals with a firm quote (the request is associated with a `quote_id`), no amounts should not be provided. + +::: + +:::tip + +Setting `memo`, `memo_type`, and `destination_account` is optional. + +If integration with a third-party custodian is enabled, the Anchor Platform can generate `memo`, `memo_type`, and `destination_address` if a corresponding `deposit_info_generator_type` is chosen. Also, you can provide `memo` and `memo_type` to the request as shown above. Note that the memo must be unique, this is what helps to associate Stellar transactions with SEP transactions. + +If your business manages the assets, the Anchor Platform can generate memos for you. When the status is changed to `pending_user_transfer_start`, the Anchor Platform sets the `memo` and `memo_type` automatically (only if it's not included in the request). + +::: + +:::note + +The Stellar account that will be used to receive funds should be configured. + +::: + +### Funds Received + +If onchain funds were received, you need to provide amounts and change the status of the transaction to `pending_anchor`. + + + +```json +// onchain-funds-received.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_onchain_funds_received", + "params": { + "transaction_id": "", + "message": "Onchain funds received", + "stellar_transaction_id": "7...9", + "amount_in": { + "amount": 10 + }, + "amount_out": { + "amount": 9 + }, + "amount_fee": { + "amount": 1 + } + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh onchain-funds-received.json +``` + + + +:::tip + +This method will be called automatically by the custody server if the custody integration is enabled. + +::: + +### Amount Updated + +If onchain funds were received, but for some reason the `amount_in` differs from specified in the interactive flow (`amount_expected`), you can update `amount_out` and `amount_fee` to make them correspond to the actual `amount_in`. The status of the transaction in this case won't be changed and will be equal to `pending_anchor`. + + + +```json +// amounts-updated.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_amounts_updated", + "params": { + "transaction_id": "", + "message": "Amounts updated", + "amount_out": { + "amount": 9 + }, + "amount_fee": { + "amount": 1 + } + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh amounts-updated.json +``` + + + +:::note + +Only `amount_out` and `amount_fee` can be updated using this JSON-RPC request, and you don't need to specify the assets of the amounts. + +::: + +### Offchain Funds Available + +You can move transaction status to `pending_user_transfer_complete` if offchain funds were sent, and if it's ready for the user / recipient to pick it up. + + + +```json +// offchain-funds-available.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_offchain_funds_available", + "params": { + "transaction_id": "", + "message": "Offchain funds available", + "external_transaction_id": "a...c" + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh offchain-funds-available.json +``` + + + +### Offchain Funds Pending + +Another option is to move the transaction's status to `pending_external`. This status means that the payment has been submitted to an external network, but is not yet confirmed. + + + +```json +// offchain-funds-pending.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_offchain_funds_pending", + "params": { + "transaction_id": "", + "message": "Offchain funds pending", + "external_transaction_id": "a...c" + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh offchain-funds-pending.json +``` + + + +### Offchain Funds Sent + +To complete the transaction and change its status to `completed`, you need to make the `notify_offchain_funds_sent` JSON-RPC request. + + + +```json +// offchain-funds-sent.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_offchain_funds_sent", + "params": { + "transaction_id": "", + "message": "Offchain funds sent", + "funds_sent_at": "2023-07-04T12:34:56Z", + "external_transaction_id": "a...c" + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh offchain-funds-sent.json +``` + + + +### Refund Sent + +The refund logic works in the same way as for the deposit flow. For more details, see [Refund Sent](#refund-sent) of the deposit flow. + +### Sending Refund Via Custody Service + +Integration with a custody service allows you to do a refund via a custody service, such as Fireblocks. + + + +```json +// do-stellar-refund.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "do_stellar_refund", + "params": { + "transaction_id": "", + "message": "Do stellar refund", + "refund": { + "amount": { + "amount": 9, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh do-stellar-refund.json +``` + + + +:::note + +Similarly to the deposit flow, you can make a full refund or a set of partial refunds. The transaction will stay in `pending_anchor` status until the sum of refunds is less than `amount_in`. If the sum of refunds is equal to `amount_in`, the Anchor Platform will automatically change the status of the transaction to `refunded`. + +::: + +### Transaction Error + +Works in the same manner as for the deposit flow. For more details, see [Transaction Error](#transaction-error) of the deposit flow. + +### Expired Transaction + +Works in the same manner as for the deposit flow. For more details, see [Expired Transaction](#expired-transaction) of the deposit flow. + +### Transaction Recovery + +Works in the same manner as for the deposit flow. For more details, see [Transaction Recovery](#transaction-recovery) of the deposit flow. + +## Tracking Stellar Transactions + + + +[get-transactions]: /api/anchor-platform/resources/get-transactions diff --git a/docs/anchoring-assets/overview.mdx b/docs/anchoring-assets/overview.mdx index 181d25a2d..eff0476a3 100644 --- a/docs/anchoring-assets/overview.mdx +++ b/docs/anchoring-assets/overview.mdx @@ -21,9 +21,10 @@ Stellar is an open-source network that is designed to interoperate with traditio Read more about SEPs in the [SEPs section](https://developers.stellar.org/docs/fundamentals-and-concepts/stellar-ecosystem-proposals). -As an anchor, the most important SEPs are [SEP-24]: Hosted Deposit and Withdrawal, and [SEP-31]: Cross Border Payments API. You’ll also work with [SEP-10]: Stellar Authentication, [SEP-12]: KYC API, and [SEP-38]: Anchor RFQ API. +As an anchor, the most important SEPs are [SEP-6]: Programmatic Deposit and Withdrawal, [SEP-24]: Hosted Deposit and Withdrawal, and [SEP-31]: Cross Border Payments API. You’ll also work with [SEP-10]: Stellar Authentication, [SEP-12]: KYC API, and [SEP-38]: Anchor RFQ API. [sep-1]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md +[sep-6]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md [sep-9]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0009.md [sep-10]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md [sep-12]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md diff --git a/docs/building-apps/wallet/component/dart/install.mdx b/docs/building-apps/wallet/component/dart/install.mdx new file mode 100644 index 000000000..44f98df16 --- /dev/null +++ b/docs/building-apps/wallet/component/dart/install.mdx @@ -0,0 +1,13 @@ +import { CodeExample } from "@site/src/components/CodeExample"; + + + +```dart +// pubspec.yaml +stellar_wallet_flutter_sdk: ^0.0.2 +stellar_flutter_sdk: ^1.6.9 +``` + + + +You can get the latest available version on the [project GitHub page](https://github.com/Soneso/stellar_wallet_flutter_sdk) diff --git a/docs/building-apps/wallet/intro.mdx b/docs/building-apps/wallet/intro.mdx index 9c07c7334..b0d4044c0 100644 --- a/docs/building-apps/wallet/intro.mdx +++ b/docs/building-apps/wallet/intro.mdx @@ -8,6 +8,7 @@ import { WalletCodeExample as CodeExample } from "@site/src/components/WalletCod import Header from "./component/header.mdx"; import KtInstall from "./component/kt/install.mdx"; import TsInstall from "./component/ts/install.mdx"; +import DartInstall from "./component/dart/install.mdx"; import KtHttpConfig from "./component/kt/httpConfig.mdx"; import KtConfigClient from "./component/kt/configClient.mdx"; import TsConfigClient from "./component/ts/configClient.mdx"; @@ -18,7 +19,11 @@ import TsConfigClient from "./component/ts/configClient.mdx"; First, you need to add the SDK dependency to your project. -} ts={} /> +} + ts={} + dart={} +/> ## Working with the SDK @@ -34,8 +39,8 @@ val wallet = Wallet(StellarConfiguration.Testnet) let wallet = walletSdk.Wallet.TestNet(); ``` -```flutter -final StellarSDK sdk = StellarSDK.TESTNET; +```dart +var wallet = Wallet(StellarConfiguration.testNet); ``` @@ -54,6 +59,10 @@ let wallet = new Wallet({ }); ``` +```dart +var wallet = Wallet(StellarConfiguration.publicNet); +``` + } /> @@ -102,6 +111,10 @@ val anchor = wallet.anchor("https://testanchor.stellar.org") let anchor = wallet.anchor({ homeDomain: "testanchor.stellar.org" }); ``` +```dart +var anchor = wallet.anchor("testanchor.stellar.org") +``` + And the most basic interaction of fetching a [SEP-1]: Stellar Info File: @@ -118,6 +131,10 @@ suspend fun anchorToml(): TomlInfo { let resp = await anchor.sep1(); ``` +```dart +var resp = await anchor.sep1(); +``` + The anchor class also supports [SEP-10]: Stellar Authentication and [SEP-24]: Hosted Deposit and Withdrawal features. diff --git a/docs/building-apps/wallet/sep10.mdx b/docs/building-apps/wallet/sep10.mdx index 4c698ed78..823604335 100644 --- a/docs/building-apps/wallet/sep10.mdx +++ b/docs/building-apps/wallet/sep10.mdx @@ -44,7 +44,7 @@ let anchor = wallet.anchor({ homeDomain: "https://testanchor.stellar.org" }); ``` ```dart -final webAuth = WebAuth.fromDomain("https://testanchor.stellar.org", Network.TESTNET); +final anchor = wallet.anchor("testanchor.stellar.org"); ``` @@ -69,9 +69,10 @@ const authToken = await sep10.authenticate({ accountKp: authKey }); ``` ```dart -KeyPair authKey = KeyPair.fromSecretSeed("my secret key"); -String accountId = authKey.accountId; -String jwtToken = await webAuth.jwtToken(accountId, [authKey]); +final authKey = SigningKeyPair.fromSecret("my secret key"); +final sep10 = await anchor.sep10(); + +final authToken = await sep10.authenticate(authKey); ``` @@ -140,25 +141,11 @@ const getAuthToken = async () => { ``` ```dart -// delegate client signing -String jwtToken = await webAuth.jwtToken( - userAccountId, - [userKeyPair], - clientDomain: "demo-wallet-server.stellar.org", - clientDomainSigningDelegate: (transaction) async { - // delegate client signing e.g.: - return myWalletSigner.signTransaction(transaction, clientKeyPair); - } -); - -// alternatively let the SDK also sign with the clientKeyPair -String jwtToken = await webAuth.jwtToken( - userAccountId, - [userKeyPair], - clientDomain: "demo-wallet-server.stellar.org", - clientDomainAccountKeyPair: clientKeyPair -); +final signer = DomainSigner("https://demo-wallet-server.stellar.org/sign"); +final sep10 = await anchor.sep10(); +final authToken = await sep10.authenticate(userKeyPair, + clientDomainSigner: signer, clientDomain: "demo-wallet-server.stellar.org"); ``` @@ -202,6 +189,16 @@ const demoWalletSigner: WalletSigner = { }; ``` +```dart +Map requestHeaders = { + "Authorization": "Bearer $token", + "Content-Type": "application/json" +}; + +var signer = DomainSigner("https://demo-wallet-server.stellar.org/sign", + requestHeaders: requestHeaders); +``` + [//]: # "TODO: update after WAL-882 is completed" diff --git a/docs/building-apps/wallet/sep24.mdx b/docs/building-apps/wallet/sep24.mdx index ff9d26b67..4a10cfc36 100644 --- a/docs/building-apps/wallet/sep24.mdx +++ b/docs/building-apps/wallet/sep24.mdx @@ -30,11 +30,7 @@ let sep24 = await anchor.sep24(); ``` ```dart -// By providing the domain hosting the stellar.toml file -final transferService = await TransferServerSEP24Service.fromDomain("place.domain.com"); - -// Or by providing the service url -final transferService = TransferServerSEP24Service("http://api.stellar-anchor.org/transfer"); +var sep24 = await anchor.sep24(); ``` @@ -56,7 +52,7 @@ const getAnchorServices = async (): Promise => { ``` ```dart -SEP24InfoResponse infoResponse = await transferService.info(); +final servicesInfo = await sep24.getServiceInfo(); ``` @@ -77,6 +73,10 @@ val asset = info.currencies.first { it.code == "USDC" }.assetId const asset = info.currencies.find(({ code }) => code === "USDC").assetId; ``` +```dart +var asset = info.currencies.firstWhere((it)=>it.code=='USDC').assetId; +``` + :::info @@ -103,11 +103,7 @@ let deposit = await anchor.sep24().deposit({ ``` ```dart -SEP24DepositRequest request = new SEP24DepositRequest(); -request.assetCode = "USDC"; -request.jwt = jwtToken; - -SEP24InteractiveResponse response = await transferService.deposit(request); +final deposit = sep24.deposit(asset, token) ``` @@ -129,8 +125,8 @@ let id = deposit.id; ``` ```dart -String url = response.url; -String id = response.id; +final url = deposit.url; +final id = deposit.id; ``` @@ -155,12 +151,9 @@ let id = withdrawal.id; ``` ```dart -SEP24WithdrawRequest request = new SEP24WithdrawRequest(); -request.assetCode = "USDC"; -request.type = "bank_account"; -request.jwt = jwtToken; - -SEP24InteractiveResponse response = await transferService.withdraw(request); +final withdrawal = sep24.withdraw(asset, token) +final url = withdrawal.url +final id = withdrawal.id ``` @@ -198,18 +191,8 @@ let deposit = await anchor.sep24().deposit({ ``` ```dart -SEP24DepositRequest request = new SEP24DepositRequest(); -request.assetCode = "USDC"; -request.jwt = jwtToken; - -StandardKYCFields kycFields = StandardKYCFields(); -kycFields.naturalPersonKYCFields = NaturalPersonKYCFields(); -kycFields.naturalPersonKYCFields!.emailAddress = "mail@example.com"; -kycFields.naturalPersonKYCFields!.photoIdFront = await Util.readFile(path); - -request.kycFields = kycFields; - -SEP24InteractiveResponse response = await transferService.deposit(request); +final deposit = await sep24.deposit(asset, token, + extraFields: {"email_address": "mail@example.com"}); ``` @@ -245,14 +228,9 @@ const depositDifferentAccount = async (): Promise => { ``` ```dart -SEP24DepositRequest request = new SEP24DepositRequest(); -request.assetCode = "USDC"; -request.account = "G..."; -request.memo = "my memo"; -request.memoType = "text"; -request.jwt = jwtToken; - -SEP24InteractiveResponse response = await transferService.deposit(request); +const recipientAccount = "G..."; +final deposit = await sep24.deposit(asset, token, destinationAccount: recipientAccount, + destinationMemo: "my memo", destinationMemoType: MemoType.text); ``` @@ -276,11 +254,8 @@ const withdrawal = await anchor.sep24().withdraw({ ``` ```dart -SEP24WithdrawRequest request = new SEP24WithdrawRequest(); -request.account = "G..."; -//... - -SEP24InteractiveResponse response = await transferService.withdraw(request); +const originAccount = "G..."; +final withdrawal = sep24.withdraw(asset, token, withdrawalAccount: originAccount); ``` @@ -315,6 +290,11 @@ let { stop, refresh } = watcher.watchOneTransaction({ }); ``` +```dart +final watcher = sep24.watcher(); +final result = watcher.watchOneTransaction(token, "transaction id"); +``` + Alternatively, we can track multiple transactions for the same asset. @@ -337,6 +317,11 @@ let { stop, refresh } = watcher.watchAllTransactions({ }); ``` +```dart +val watcher = sep24.watcher() +val result = watcher.watchAsset(token, asset) +``` + } /> @@ -359,21 +344,7 @@ const transaction = await anchor.sep24().getTransactionBy({ ``` ```dart -// single transaction -SEP24TransactionRequest request = SEP24TransactionRequest(); -request.stellarTransactionId = "transaction id"; -request.jwt = jwtToken; - -SEP24TransactionResponse response = await transferService.transaction(request); -SEP24Transaction transaction = response.transaction; - -// multiple transactions -SEP24TransactionsRequest request = SEP24TransactionsRequest(); -request.assetCode = "ETH"; -request.jwt = jwtToken; - -SEP24TransactionsResponse response = await transferService.transactions(request); -List transactions = response.transactions; +var transaction = await sep24.getTransaction("transaction id", token); ``` @@ -394,12 +365,7 @@ const transactions = await anchor.sep24().getTransactionsForAsset({ ``` ```dart -SEP24TransactionsRequest request = SEP24TransactionsRequest(); -request.assetCode = "ETH"; -request.jwt = jwtToken; - -SEP24TransactionsResponse response = await transferService.transactions(request); -List transactions = response.transactions; +var transactions = sep24.getTransactionsForAsset(asset, token); ``` @@ -423,6 +389,10 @@ let withdrawal = await anchor.sep24().withdraw({ }); ``` +```dart +final withdrawal = await sep24.withdraw(asset, token) +``` + Next, open an interactive url : @@ -439,6 +409,11 @@ let url = withdrawal.url; // open the url ``` +```dart +final url = withdrawal.url +// open the url +``` + After that we need to wait until the anchor is ready to receive funds. To do so, we will be waiting until transaction reaches `pending_user_transfer_start` status @@ -477,6 +452,20 @@ let { refresh, stop } = watcher.watchOneTransaction({ }); ``` +```dart +final withdrawalWatcher = sep24.watcher().watchOneTransaction(token, withdrawal.id) +withdrawalWatcher.controller.stream.listen( + (event) { + if (event is StatusChange && TransactionStatus.pendingUserTransferStart == event.status) { + // begin transfer + } + }, + onError: (error) { + // handle error + }, +); +``` + Next, sign and submit the Stellar transfer: @@ -506,6 +495,35 @@ keypair.sign(transfer); stellar.submitTransaction(transfer); ``` +```dart +final tx = event.transaction as WithdrawalTransaction; + +final paymentBuilder = flutter_sdk.PaymentOperationBuilder( + tx.withdrawAnchorAccount!, + flutter_sdk.Asset.createNonNativeAsset(asset.code, asset.issuer), + tx.amountIn!, +); + +final transactionBuilder = flutter_sdk.TransactionBuilder(sourceAccount) + ..addOperation(paymentBuilder.build()); + +flutter_sdk.Memo? memo; +if ("text" == tx.withdrawalMemoType) { + memo = flutter_sdk.MemoText(tx.withdrawalMemo!); +} else if ("hash" == tx.withdrawalMemoType) { + memo = flutter_sdk.MemoHash(base64Decode(tx.withdrawalMemo!)); +} // ... etc. + +if (memo != null) { + transactionBuilder.addMemo(memo); +} + +flutter_sdk.KeyPair kp = + flutter_sdk.KeyPair.fromSecretSeed(userKeyPair.secretKey); +final transaction = transactionBuilder.build()..sign(kp, network); +final paymentResult = await sdk.submitTransaction(transaction); +``` + Where `keypair` is the SEP-10 authenticated account. If you want to transfer funds from a different address, refer to [Changing Stellar Transfer Account](#changing-stellar-transfer-account) section. @@ -560,6 +578,28 @@ let { refresh, stop } = watcher.watchOneTransaction({ }); ``` +```dart +final watcher = sep24.watcher().watchOneTransaction(token, withdrawal.id) +watcher.controller.stream.listen( + (event) { + if (event is StatusChange && event.status.isTerminal()) { + if (TransactionStatus.completed != event.status) { + print("Transaction was not completed!"); + } else { + print("Success"); + } + } else if (event is ExceptionHandlerExit) { + print("Retries exhausted trying obtain transaction data, giving up."); + } else if (event is StreamControllerClosed) { + print("Transaction tracking finished"); + } + }, + onError: (error) { + // handle error + }, +); +``` + [sep-9]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-000p.md diff --git a/docs/encyclopedia/pooled-accounts-muxed-accounts-memos.mdx b/docs/encyclopedia/pooled-accounts-muxed-accounts-memos.mdx index 0cf6d98cc..2752b4b56 100644 --- a/docs/encyclopedia/pooled-accounts-muxed-accounts-memos.mdx +++ b/docs/encyclopedia/pooled-accounts-muxed-accounts-memos.mdx @@ -22,7 +22,7 @@ Muxed accounts are embedded into the protocol for convenience and standardizatio Muxed accounts do not exist on the ledger, but their shared underlying `GABC…` account does. -Muxed accounts are defined in [CAP-0027](https://stellar.org/protocol/cap-27), introduced in Protocol 13, and their string representation is described in [SEP-0021](https://stellar.org/protocol/sep-21). +Muxed accounts are defined in [CAP-0027](https://stellar.org/protocol/cap-27), introduced in Protocol 13, and their string representation is described in [SEP-0023](https://stellar.org/protocol/sep-23). It is safe for all wallets to implement sending to muxed accounts. diff --git a/docs/fundamentals-and-concepts/networks.mdx b/docs/fundamentals-and-concepts/networks.mdx index ffe0fdf11..4c3e6349e 100644 --- a/docs/fundamentals-and-concepts/networks.mdx +++ b/docs/fundamentals-and-concepts/networks.mdx @@ -38,11 +38,11 @@ Testnet and Futurenet are reset periodically to the genesis ledger to declutter Futurenet resets are on a less regular cadence than Testnet resets and don't have a set schedule. -Testnet resets happen once per quarter at 0900 UTC and are announced at least two weeks in advance on the [Stellar Dashboard](http://dashboard.stellar.org/) and through several developer community channels. Here are the 2023 dates: +Testnet resets happen once per quarter at 17:00 UTC and are announced at least two weeks in advance on the [Stellar Dashboard](http://dashboard.stellar.org/) and through several developer community channels. Here are the 2023 dates: March 15, 2023 June 14, 2023 -~~September 13, 2023~~ Note: this reset was skipped due to its proximity to the Protocol 20 Testnet updgrade. +~~September 13, 2023~~ Note: this reset was skipped due to its proximity to the Protocol 20 Testnet upgrade. December 18, 2023 If you run a Testnet Horizon instance, you need to re-join and re-sync to the network after a reset. Check out how to do that here: [Testnet Reset](https://github.com/stellar/packages/blob/master/docs/testnet-reset.md). diff --git a/docusaurus.config.js b/docusaurus.config.js index f15fd2fb5..ebeadd746 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -24,13 +24,6 @@ const config = { DSN: "efc31f19f9c54082b8d993bfb62eee57", }, ], - [ - "@docusaurus/plugin-google-analytics", - { - trackingID: "UA-53373928-1", - anonymizeIP: true, - }, - ], [ "docusaurus-plugin-openapi-docs", { @@ -60,6 +53,14 @@ const config = { }, template: "src/template.mustache", // Customize API MDX with mustache template }, + anchor_custody_api: { + specPath: "openapi/anchor-platform/bundled_custody.yml", // Path to designated spec file + outputDir: "api/anchor-platform/custody-server", // Output directory for generated .mdx docs + sidebarOptions: { + groupPathsBy: "tag", + }, + template: "src/template.mustache", // Customize API MDX with mustache template + }, stellar_disbursement_platform: { specPath: "openapi/stellar-disbursement-platform/bundled.yml", // Path to designated spec file outputDir: "api/stellar-disbursement-platform/resources", // Output directory for generated .mdx docs @@ -81,6 +82,8 @@ const config = { docItemComponent: "@theme/ApiItem", sidebarPath: require.resolve("./sidebarsApi.js"), sidebarItemsGenerator: require("./src/sidebar-api-generator"), + editUrl: "https://github.com/stellar/stellar-docs/tree/main", + showLastUpdateTime: true, }, ], require("./src/analytics-module"), @@ -108,6 +111,10 @@ const config = { theme: { customCss: [require.resolve("./src/css/custom.scss")], }, + gtag: { + trackingID: "G-ZCT4GYX8KN", + anonymizeIP: true, + } }), ], ], diff --git a/openapi/anchor-platform/Custody API.yml b/openapi/anchor-platform/Custody API.yml new file mode 100644 index 000000000..6e06b830e --- /dev/null +++ b/openapi/anchor-platform/Custody API.yml @@ -0,0 +1,234 @@ +openapi: 3.0.0 +info: + version: "2.0.0" + description: | + title: Custody Server API +tags: + - name: "Custody Transactions" + description: "Custody Server creates custody transaction record in DB." + - name: "Payments" + description: "Custody Server calls the configured custody service to send payment." + - name: "Refunds" + description: "Custody Server calls configured Custody Service to send refund. Custody transaction record is also created in DB." + - name: "Unique Address" + description: "Custody Server calls the configured custody service to generate deposit address and memo." +paths: + /transactions: + post: + description: Custody Server creates custody transaction record in DB. + summary: Create Custody Transaction + operationId: createCustodyTransaction + tags: + - Custody Transactions + - SEP-6 + - SEP-24 + - SEP-31 + requestBody: + content: + application/json: + schema: + type: object + properties: + id: + description: SEP transaction ID. + type: string + memo: + description: Memo value, that is used to identify inbound or outbound payments. + type: string + memoType: + description: Type of memo, that is used to identify inbound or outbound payments. + type: string + enum: + - id + - hash + - text + protocol: + description: Protocol of SEP transaction. + type: string + enum: + - 6 + - 24 + - 31 + fromAccount: + description: Source Stellar account. + type: string + toAccount: + description: Destination Stellar account. + type: string + amount: + description: Amount of the asset, that is sent/received. + type: string + amountFee: + description: Fee of SEP transaction. + type: string + asset: + description: Asset, that is sent/received. + type: string + kind: + description: Kind of the SEP transaction. + type: string + enum: + - deposit + - withdrawal + - receive + responses: + '200': + description: Success. + content: + application/json: + schema: + type: object + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/CustodyError' + /transactions/:id/payments: + post: + description: Custody Server calls the configured custody service to send payment. + summary: Send Payment + operationId: sendPayment + tags: + - Payments + - SEP-6 + - SEP-24 + - SEP-31 + requestBody: + content: + application/json: + schema: + type: object + responses: + '200': + description: Success. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/SendPaymentResponse' + '400': + description: Invalid Request. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/CustodyError' + '404': + description: Custody Transaction is not found. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/CustodyError' + '429': + description: Custody Service rate limit is exceeded. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/CustodyError' + '500': + description: Internal Server Error. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/CustodyError' + '503': + description: Custody Service is unavailable. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/CustodyError' + /transactions/:id/refunds: + post: + description: Custody Server calls configured Custody Service to send refund. Custody transaction record is also created in DB. + summary: Send Refund + operationId: sendRefund + tags: + - Refunds + - SEP-6 + - SEP-24 + - SEP-31 + requestBody: + content: + application/json: + schema: + type: object + properties: + memo: + description: Memo value, that will be added to the refund payment. + type: string + memoType: + description: Type of memo, that will be added to the refund payment. + type: string + amount: + description: Amount, that will be refunded. + type: string + amountFee: + description: Fee of the refund. + type: string + responses: + '200': + description: Success. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/SendPaymentResponse' + '400': + description: Invalid Request. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/CustodyError' + '404': + description: Custody Transaction is not found. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/CustodyError' + '429': + description: Custody Service rate limit is exceeded. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/CustodyError' + '500': + description: Internal Server Error. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/CustodyError' + '503': + description: Custody Service is unavailable. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/CustodyError' + /assets/{asset}/addresses: + post: + description: | + Custody Server calls the configured custody service to generate deposit address and memo. + + Format of `asset` parameter - `stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5` + summary: Generate Unique Address + operationId: generateUniqueAddress + tags: + - Unique Address + - SEP-6 + - SEP-24 + - SEP-31 + requestBody: + content: + application/json: + schema: + type: object + responses: + '200': + description: Success. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/GenerateUniqueAddressResponse' + '500': + description: Internal Server Error. + content: + application/json: + schema: + $ref: './schemas.yml#/components/schemas/CustodyError' \ No newline at end of file diff --git a/openapi/anchor-platform/bundled.yml b/openapi/anchor-platform/bundled.yml index 7ba0b125f..25c1e1162 100644 --- a/openapi/anchor-platform/bundled.yml +++ b/openapi/anchor-platform/bundled.yml @@ -435,6 +435,8 @@ components: $ref: '#/components/schemas/Amount' amount_fee: $ref: '#/components/schemas/Amount' + quote_id: + type: string started_at: type: string format: date-time diff --git a/openapi/anchor-platform/bundled_callback.yml b/openapi/anchor-platform/bundled_callback.yml index 2a1cebcd0..e61caf89a 100644 --- a/openapi/anchor-platform/bundled_callback.yml +++ b/openapi/anchor-platform/bundled_callback.yml @@ -875,6 +875,8 @@ components: $ref: '#/components/schemas/Amount' amount_fee: $ref: '#/components/schemas/Amount' + quote_id: + type: string started_at: type: string format: date-time diff --git a/openapi/anchor-platform/bundled_custody.yml b/openapi/anchor-platform/bundled_custody.yml new file mode 100644 index 000000000..4fed444e7 --- /dev/null +++ b/openapi/anchor-platform/bundled_custody.yml @@ -0,0 +1,265 @@ +openapi: 3.0.0 +info: + version: 2.0.0 + description: '' + title: Custody Server API +tags: + - name: Custody Transactions + description: Custody Server creates custody transaction record in DB. + - name: Payments + description: Custody Server calls the configured custody service to send payment. + - name: Refunds + description: Custody Server calls configured Custody Service to send refund. Custody transaction record is also created in DB. + - name: Unique Address + description: Custody Server calls the configured custody service to generate deposit address and memo. +paths: + /transactions: + post: + description: Custody Server creates custody transaction record in DB. + summary: Create Custody Transaction + operationId: createCustodyTransaction + tags: + - Custody Transactions + - SEP-6 + - SEP-24 + - SEP-31 + requestBody: + content: + application/json: + schema: + type: object + properties: + id: + description: SEP transaction ID. + type: string + memo: + description: Memo value, that is used to identify inbound or outbound payments. + type: string + memoType: + description: Type of memo, that is used to identify inbound or outbound payments. + type: string + enum: + - id + - hash + - text + protocol: + description: Protocol of SEP transaction. + type: string + enum: + - 6 + - 24 + - 31 + fromAccount: + description: Source Stellar account. + type: string + toAccount: + description: Destination Stellar account. + type: string + amount: + description: Amount of the asset, that is sent/received. + type: string + amountFee: + description: Fee of SEP transaction. + type: string + asset: + description: Asset, that is sent/received. + type: string + kind: + description: Kind of the SEP transaction. + type: string + enum: + - deposit + - withdrawal + - receive + responses: + '200': + description: Success. + content: + application/json: + schema: + type: object + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/CustodyError' + /transactions/:id/payments: + post: + description: Custody Server calls the configured custody service to send payment. + summary: Send Payment + operationId: sendPayment + tags: + - Payments + - SEP-6 + - SEP-24 + - SEP-31 + requestBody: + content: + application/json: + schema: + type: object + responses: + '200': + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/SendPaymentResponse' + '400': + description: Invalid Request. + content: + application/json: + schema: + $ref: '#/components/schemas/CustodyError' + '404': + description: Custody Transaction is not found. + content: + application/json: + schema: + $ref: '#/components/schemas/CustodyError' + '429': + description: Custody Service rate limit is exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CustodyError' + '500': + description: Internal Server Error. + content: + application/json: + schema: + $ref: '#/components/schemas/CustodyError' + '503': + description: Custody Service is unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/CustodyError' + /transactions/:id/refunds: + post: + description: Custody Server calls configured Custody Service to send refund. Custody transaction record is also created in DB. + summary: Send Refund + operationId: sendRefund + tags: + - Refunds + - SEP-6 + - SEP-24 + - SEP-31 + requestBody: + content: + application/json: + schema: + type: object + properties: + memo: + description: Memo value, that will be added to the refund payment. + type: string + memoType: + description: Type of memo, that will be added to the refund payment. + type: string + amount: + description: Amount, that will be refunded. + type: string + amountFee: + description: Fee of the refund. + type: string + responses: + '200': + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/SendPaymentResponse' + '400': + description: Invalid Request. + content: + application/json: + schema: + $ref: '#/components/schemas/CustodyError' + '404': + description: Custody Transaction is not found. + content: + application/json: + schema: + $ref: '#/components/schemas/CustodyError' + '429': + description: Custody Service rate limit is exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CustodyError' + '500': + description: Internal Server Error. + content: + application/json: + schema: + $ref: '#/components/schemas/CustodyError' + '503': + description: Custody Service is unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/CustodyError' + /assets/{asset}/addresses: + post: + description: | + Custody Server calls the configured custody service to generate deposit address and memo. + + Format of `asset` parameter - `stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5` + summary: Generate Unique Address + operationId: generateUniqueAddress + tags: + - Unique Address + - SEP-6 + - SEP-24 + - SEP-31 + requestBody: + content: + application/json: + schema: + type: object + responses: + '200': + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateUniqueAddressResponse' + '500': + description: Internal Server Error. + content: + application/json: + schema: + $ref: '#/components/schemas/CustodyError' +components: + schemas: + CustodyError: + type: object + required: + - error + properties: + error: + type: string + SendPaymentResponse: + type: object + properties: + id: + type: string + description: External TX ID from custody service. + GenerateUniqueAddressResponse: + type: object + properties: + address: + description: Deposit address to which the client should send funds. + type: string + memo: + description: Memo value, that should be added to payment by the client. + type: string + memoType: + description: Type of memo, that should be added to payment by the client. + type: string + enum: + - id + - hash + - text diff --git a/openapi/anchor-platform/schemas.yml b/openapi/anchor-platform/schemas.yml index 0ab80b1f4..584893296 100644 --- a/openapi/anchor-platform/schemas.yml +++ b/openapi/anchor-platform/schemas.yml @@ -336,6 +336,8 @@ components: $ref: '#/components/schemas/Amount' amount_fee: $ref: '#/components/schemas/Amount' + quote_id: + type: string started_at: type: string format: date-time @@ -371,6 +373,8 @@ components: type: string refund_memo_type: $ref: '#/components/schemas/MemoType' + quote_id: + type: string TransactionSEP6: type: object @@ -810,3 +814,32 @@ components: properties: id: type: string + CustodyError: + type: object + required: + - error + properties: + error: + type: string + SendPaymentResponse: + type: object + properties: + id: + type: string + description: External TX ID from custody service. + GenerateUniqueAddressResponse: + type: object + properties: + address: + description: Deposit address to which the client should send funds. + type: string + memo: + description: Memo value, that should be added to payment by the client. + type: string + memoType: + description: Type of memo, that should be added to payment by the client. + type: string + enum: + - id + - hash + - text diff --git a/package.json b/package.json index d8aab088c..ae3989ed2 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,9 @@ "api:clean": "docusaurus clean-api-docs all", "api:bundle": "yarn bundle-horizon && yarn bundle-anchor-platform && yarn bundle-stellar-disbursement-platform", "bundle-horizon": "redocly bundle openapi/horizon/main.yml --output openapi/horizon/bundled.yml", - "bundle-anchor-platform": "redocly bundle openapi/anchor-platform/Platform\\ API.yml --output openapi/anchor-platform/bundled.yml && yarn redocly bundle openapi/anchor-platform/Callbacks\\ API.yml --output openapi/anchor-platform/bundled_callback.yml", + "bundle-anchor-platform": "redocly bundle openapi/anchor-platform/Platform\\ API.yml --output openapi/anchor-platform/bundled.yml && yarn redocly bundle openapi/anchor-platform/Callbacks\\ API.yml --output openapi/anchor-platform/bundled_callback.yml && yarn redocly bundle openapi/anchor-platform/Custody\\ API.yml --output openapi/anchor-platform/bundled_custody.yml", "bundle-stellar-disbursement-platform": "redocly bundle openapi/stellar-disbursement-platform/main.yml --output openapi/stellar-disbursement-platform/bundled.yml", - "api:gen": "docusaurus gen-api-docs all && rm api/horizon/resources/*.info.mdx && rm api/anchor-platform/resources/*.info.mdx && rm api/anchor-platform/callbacks/*.info.mdx && rm api/stellar-disbursement-platform/resources/*.info.mdx", + "api:gen": "docusaurus gen-api-docs all && rm api/horizon/resources/*.info.mdx && rm api/anchor-platform/resources/*.info.mdx && rm api/anchor-platform/callbacks/*.info.mdx && rm api/stellar-disbursement-platform/resources/*.info.mdx && rm api/anchor-platform/custody-server/*.info.mdx", "api": "yarn api:clean && yarn api:bundle && yarn api:gen", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", diff --git a/src/components/ReaderFeedback/index.js b/src/components/ReaderFeedback/index.js new file mode 100644 index 000000000..8f51ddc49 --- /dev/null +++ b/src/components/ReaderFeedback/index.js @@ -0,0 +1,41 @@ +import React, { useState } from "react"; +import useIsBrowser from '@docusaurus/useIsBrowser'; + +import IconThumbsUp from '@site/static/icons/thumbs-up.svg'; +import IconThumbsDown from '@site/static/icons/thumbs-down.svg'; + +const ReaderFeedback = ({ pageId }) => { + const [feedbackGiven, setFeedbackGiven] = useState(false); + const isBrowser = useIsBrowser(); + if (!isBrowser) { + return null; + } + + const giveFeedback = (value) => { + setFeedbackGiven(true); + }; + + return ( +
          + {feedbackGiven ? ( + 'Thanks for your feedback!' + ) : ( + <> + Did you find this page helpful? + + + + )} +
          + ); +}; + +export default ReaderFeedback; diff --git a/src/css/custom.scss b/src/css/custom.scss index 673ffc19d..86058be64 100644 --- a/src/css/custom.scss +++ b/src/css/custom.scss @@ -64,3 +64,48 @@ html[data-theme="dark"] { ); margin-top: calc(var(--ifm-h4-vertical-rhythm-top) * var(--ifm-leading)); } + +/* Reader Feedback Box */ + +.readerFeedback { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + gap: 1rem; + + margin-top: 3rem; + padding: 1.5rem 2rem; + background-color: var(--ifm-menu-color-background-active); + font-weight: 700; + color: var(--ifm-color-primary); + + svg { + height: 1.5rem; + width: 1.5rem; + transition: color var(--ifm-transition-fast) var(--ifm-transition-timing-default); + + &:hover, + &:focus { + cursor: pointer; + } + } + + .feedback_thumbsup { + color: var(--ifm-color-success-lightest); + + &:hover, + &:focus { + color: var(--ifm-color-success-darkest); + } + } + + .feedback_thumbsdown { + color: var(--ifm-color-danger-lightest); + + &:hover, + &:focus { + color: var(--ifm-color-danger-darkest); + } + } +} diff --git a/src/theme/DocItem/Footer/index.js b/src/theme/DocItem/Footer/index.js new file mode 100644 index 000000000..80f671ff6 --- /dev/null +++ b/src/theme/DocItem/Footer/index.js @@ -0,0 +1,74 @@ +import React from 'react'; +import clsx from 'clsx'; +import {ThemeClassNames} from '@docusaurus/theme-common'; +import {useDoc} from '@docusaurus/theme-common/internal'; +import LastUpdated from '@theme/LastUpdated'; +import EditThisPage from '@theme/EditThisPage'; +import TagsListInline from '@theme/TagsListInline'; + +import ReaderFeedback from '@site/src/components/ReaderFeedback'; +import styles from './styles.module.css'; + +function TagsRow(props) { + return ( +
          +
          + +
          +
          + ); +} +function EditMetaRow({ + editUrl, + lastUpdatedAt, + lastUpdatedBy, + formattedLastUpdatedAt, +}) { + return ( +
          +
          {editUrl && }
          + +
          + {(lastUpdatedAt || lastUpdatedBy) && ( + + )} +
          +
          + ); +} +export default function DocItemFooter() { + const {metadata} = useDoc(); + const {editUrl, lastUpdatedAt, formattedLastUpdatedAt, lastUpdatedBy, tags} = + metadata; + const canDisplayTagsRow = tags.length > 0; + const canDisplayEditMetaRow = !!(editUrl || lastUpdatedAt || lastUpdatedBy); + const canDisplayFooter = canDisplayTagsRow || canDisplayEditMetaRow; + if (!canDisplayFooter) { + return null; + } + return ( + <> + +
          + {canDisplayTagsRow && } + {canDisplayEditMetaRow && ( + + )} +
          + + ); +} diff --git a/src/theme/DocItem/Footer/styles.module.css b/src/theme/DocItem/Footer/styles.module.css new file mode 100644 index 000000000..469aa494a --- /dev/null +++ b/src/theme/DocItem/Footer/styles.module.css @@ -0,0 +1,11 @@ +.lastUpdated { + margin-top: 0.2rem; + font-style: italic; + font-size: smaller; + } + + @media (min-width: 997px) { + .lastUpdated { + text-align: right; + } + } diff --git a/static/assets/sep6-deposit-flow-diagram.png b/static/assets/sep6-deposit-flow-diagram.png new file mode 100644 index 000000000..75d4d271a Binary files /dev/null and b/static/assets/sep6-deposit-flow-diagram.png differ diff --git a/static/assets/sep6-withdrawal-flow-diagram.png b/static/assets/sep6-withdrawal-flow-diagram.png new file mode 100644 index 000000000..0bf199f47 Binary files /dev/null and b/static/assets/sep6-withdrawal-flow-diagram.png differ diff --git a/static/definitions/sep24_31_status_transition_diagrams.drawio b/static/definitions/sep6_24_31_status_transition_diagrams.drawio similarity index 56% rename from static/definitions/sep24_31_status_transition_diagrams.drawio rename to static/definitions/sep6_24_31_status_transition_diagrams.drawio index c1e830383..61dbea4f8 100644 --- a/static/definitions/sep24_31_status_transition_diagrams.drawio +++ b/static/definitions/sep6_24_31_status_transition_diagrams.drawio @@ -1,6 +1,6 @@ - + - + @@ -338,7 +338,7 @@ - + @@ -791,4 +791,599 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/icons/thumbs-down.svg b/static/icons/thumbs-down.svg new file mode 100644 index 000000000..3e7bcd6d9 --- /dev/null +++ b/static/icons/thumbs-down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/icons/thumbs-up.svg b/static/icons/thumbs-up.svg new file mode 100644 index 000000000..226c44d85 --- /dev/null +++ b/static/icons/thumbs-up.svg @@ -0,0 +1 @@ + \ No newline at end of file