diff --git a/Dockerfile b/Dockerfile index 8ae7a96dd..0c8154f15 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 as build +FROM ubuntu:22.04 as build LABEL maintainer="SDF Ops Team " @@ -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 98aec44f1..74a31970d 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 e67e301c0..fd235ad01 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-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"],"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` field 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."}},"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` field 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."}},"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` field 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."}},"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` field 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."}},"title":"StellarId"},"transaction_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"title":"Quote"}}}},"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-09-13T22:33:44.954Z","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-09-13T22:33:44.954Z","updated_at":"2023-09-13T22:33:44.954Z","completed_at":"2023-09-13T22:33:44.954Z","transfer_received_at":"2023-09-13T22:33:44.954Z","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-09-13T22:33:44.954Z","refunded_at":"2023-09-13T22:33:44.954Z"}]},"stellar_transactions":[{"id":"string","memo":"string","memo_type":"text","created_at":"2023-09-13T22:33:44.955Z","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-09-13T22:33:44.955Z","price":"string","total_price":"string","creator":{"id":"string","account":"string"},"transaction_id":"string","created_at":"2023-09-13T22:33:44.955Z"}}},"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"},"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"}}}}} sidebar_class_name: "post api-method" info_path: api/anchor-platform/callbacks/synchronous-callbacks-api custom_edit_url: null @@ -13,7 +13,7 @@ custom_edit_url: null import { SepBadge } from "@site/src/components/SepBadge"; - + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; @@ -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. @@ -43,37 +43,45 @@ StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. -For a SEP-31 Sending Anchor, the `account` field should be used. +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. -
        receiver object
        + +
        receiver object
        StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. -For a SEP-31 Sending Anchor, the `account` field should be used. +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. -
      • creator object
        +
        creator object
        StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. -For a SEP-31 Sending Anchor, the `account` field should be used. +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. -
      quote object
      creator object
      + +
    • quote object
      creator object
      StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. -For a SEP-31 Sending Anchor, the `account` field should be used. +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. -
    +
    customer object
    The event is successfully processed and ready to receive next event. The response body is empty. diff --git a/api/anchor-platform/callbacks/put-customer.api.mdx b/api/anchor-platform/callbacks/put-customer.api.mdx index 0da1fcef6..8fa5bc9df 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-09-13","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-09-13","id_expiration_date":"2023-09-13","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-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"}}}}} 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/callbacks/sidebar.js b/api/anchor-platform/callbacks/sidebar.js index 7abac89e6..5d7896966 100644 --- a/api/anchor-platform/callbacks/sidebar.js +++ b/api/anchor-platform/callbacks/sidebar.js @@ -1 +1 @@ -module.exports = [{"type":"doc","id":"anchor-platform/callbacks/synchronous-callbacks-api"},{"type":"category","label":"Unique Address","link":{"type":"generated-index","title":"Unique Address","slug":"/category/anchor-platform/callbacks/unique-address"},"items":[{"type":"doc","id":"anchor-platform/callbacks/gen-address","label":"Generate Unique Address","className":"api-method get"}]},{"type":"category","label":"Fees","link":{"type":"generated-index","title":"Fees","slug":"/category/anchor-platform/callbacks/fees"},"items":[{"type":"doc","id":"anchor-platform/callbacks/get-fee","label":"Retrieve Fees","className":"api-method get"}]},{"type":"category","label":"Rates","link":{"type":"generated-index","title":"Rates","slug":"/category/anchor-platform/callbacks/rates"},"items":[{"type":"doc","id":"anchor-platform/callbacks/get-rates","label":"Retrieve Rates","className":"api-method get"}]},{"type":"category","label":"Customers","link":{"type":"generated-index","title":"Customers","slug":"/category/anchor-platform/callbacks/customers"},"items":[{"type":"doc","id":"anchor-platform/callbacks/get-customer","label":"Retrieve Customer's Info","className":"api-method get"},{"type":"doc","id":"anchor-platform/callbacks/put-customer","label":"Create or Update Customer Info","className":"api-method put"},{"type":"doc","id":"anchor-platform/callbacks/del-customer","label":"Delete Customer Data","className":"api-method delete"}]},{"type":"category","label":"SEP-31","link":{"type":"generated-index","title":"SEP-31","slug":"/category/anchor-platform/callbacks/sep-31"},"items":[{"type":"doc","id":"anchor-platform/callbacks/gen-address","label":"Generate Unique Address","className":"api-method get"},{"type":"doc","id":"anchor-platform/callbacks/get-fee","label":"Retrieve Fees","className":"api-method get"},{"type":"doc","id":"anchor-platform/callbacks/get-rates","label":"Retrieve Rates","className":"api-method get"},{"type":"doc","id":"anchor-platform/callbacks/get-customer","label":"Retrieve Customer's Info","className":"api-method get"},{"type":"doc","id":"anchor-platform/callbacks/put-customer","label":"Create or Update Customer Info","className":"api-method put"},{"type":"doc","id":"anchor-platform/callbacks/del-customer","label":"Delete Customer Data","className":"api-method delete"},{"type":"doc","id":"anchor-platform/callbacks/post-event","label":"Receive an Event","className":"api-method post"}]},{"type":"category","label":"SEP-38","link":{"type":"generated-index","title":"SEP-38","slug":"/category/anchor-platform/callbacks/sep-38"},"items":[{"type":"doc","id":"anchor-platform/callbacks/get-rates","label":"Retrieve Rates","className":"api-method get"}]},{"type":"category","label":"SEP-12","link":{"type":"generated-index","title":"SEP-12","slug":"/category/anchor-platform/callbacks/sep-12"},"items":[{"type":"doc","id":"anchor-platform/callbacks/get-customer","label":"Retrieve Customer's Info","className":"api-method get"},{"type":"doc","id":"anchor-platform/callbacks/put-customer","label":"Create or Update Customer Info","className":"api-method put"},{"type":"doc","id":"anchor-platform/callbacks/del-customer","label":"Delete Customer Data","className":"api-method delete"}]},{"type":"category","label":"SEP-24","link":{"type":"generated-index","title":"SEP-24","slug":"/category/anchor-platform/callbacks/sep-24"},"items":[{"type":"doc","id":"anchor-platform/callbacks/put-customer","label":"Create or Update Customer Info","className":"api-method put"},{"type":"doc","id":"anchor-platform/callbacks/post-event","label":"Receive an Event","className":"api-method post"}]},{"type":"category","label":"Events","link":{"type":"generated-index","title":"Events","slug":"/category/anchor-platform/callbacks/events"},"items":[{"type":"doc","id":"anchor-platform/callbacks/post-event","label":"Receive an Event","className":"api-method post"}]}]; \ No newline at end of file +module.exports = [{"type":"doc","id":"anchor-platform/callbacks/synchronous-callbacks-api"},{"type":"category","label":"Unique Address","link":{"type":"generated-index","title":"Unique Address","slug":"/category/anchor-platform/callbacks/unique-address"},"items":[{"type":"doc","id":"anchor-platform/callbacks/gen-address","label":"Generate Unique Address","className":"api-method get"}]},{"type":"category","label":"Fees","link":{"type":"generated-index","title":"Fees","slug":"/category/anchor-platform/callbacks/fees"},"items":[{"type":"doc","id":"anchor-platform/callbacks/get-fee","label":"Retrieve Fees","className":"api-method get"}]},{"type":"category","label":"Rates","link":{"type":"generated-index","title":"Rates","slug":"/category/anchor-platform/callbacks/rates"},"items":[{"type":"doc","id":"anchor-platform/callbacks/get-rates","label":"Retrieve Rates","className":"api-method get"}]},{"type":"category","label":"Customers","link":{"type":"generated-index","title":"Customers","slug":"/category/anchor-platform/callbacks/customers"},"items":[{"type":"doc","id":"anchor-platform/callbacks/get-customer","label":"Retrieve Customer's Info","className":"api-method get"},{"type":"doc","id":"anchor-platform/callbacks/put-customer","label":"Create or Update Customer Info","className":"api-method put"},{"type":"doc","id":"anchor-platform/callbacks/del-customer","label":"Delete Customer Data","className":"api-method delete"}]},{"type":"category","label":"SEP-31","link":{"type":"generated-index","title":"SEP-31","slug":"/category/anchor-platform/callbacks/sep-31"},"items":[{"type":"doc","id":"anchor-platform/callbacks/gen-address","label":"Generate Unique Address","className":"api-method get"},{"type":"doc","id":"anchor-platform/callbacks/get-fee","label":"Retrieve Fees","className":"api-method get"},{"type":"doc","id":"anchor-platform/callbacks/get-rates","label":"Retrieve Rates","className":"api-method get"},{"type":"doc","id":"anchor-platform/callbacks/get-customer","label":"Retrieve Customer's Info","className":"api-method get"},{"type":"doc","id":"anchor-platform/callbacks/put-customer","label":"Create or Update Customer Info","className":"api-method put"},{"type":"doc","id":"anchor-platform/callbacks/del-customer","label":"Delete Customer Data","className":"api-method delete"},{"type":"doc","id":"anchor-platform/callbacks/post-event","label":"Receive an Event","className":"api-method post"}]},{"type":"category","label":"SEP-38","link":{"type":"generated-index","title":"SEP-38","slug":"/category/anchor-platform/callbacks/sep-38"},"items":[{"type":"doc","id":"anchor-platform/callbacks/get-rates","label":"Retrieve Rates","className":"api-method get"}]},{"type":"category","label":"SEP-12","link":{"type":"generated-index","title":"SEP-12","slug":"/category/anchor-platform/callbacks/sep-12"},"items":[{"type":"doc","id":"anchor-platform/callbacks/get-customer","label":"Retrieve Customer's Info","className":"api-method get"},{"type":"doc","id":"anchor-platform/callbacks/put-customer","label":"Create or Update Customer Info","className":"api-method put"},{"type":"doc","id":"anchor-platform/callbacks/del-customer","label":"Delete Customer Data","className":"api-method delete"}]},{"type":"category","label":"SEP-24","link":{"type":"generated-index","title":"SEP-24","slug":"/category/anchor-platform/callbacks/sep-24"},"items":[{"type":"doc","id":"anchor-platform/callbacks/put-customer","label":"Create or Update Customer Info","className":"api-method put"},{"type":"doc","id":"anchor-platform/callbacks/post-event","label":"Receive an Event","className":"api-method post"}]},{"type":"category","label":"Events","link":{"type":"generated-index","title":"Events","slug":"/category/anchor-platform/callbacks/events"},"items":[{"type":"doc","id":"anchor-platform/callbacks/post-event","label":"Receive an Event","className":"api-method post"}]},{"type":"category","label":"SEP-6","link":{"type":"generated-index","title":"SEP-6","slug":"/category/anchor-platform/callbacks/sep-6"},"items":[{"type":"doc","id":"anchor-platform/callbacks/post-event","label":"Receive an Event","className":"api-method post"}]}]; \ No newline at end of file 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 f11f69781..106a8c452 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-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": [ "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. +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 8949cea09..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-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 7a9e20f76..884c5f01b 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-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. +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 9ff96e8c2..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-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 6111e1ab8..eb60fc026 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-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","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` field 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."}},"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` field 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."}},"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` field 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."}},"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"},"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 @@ -13,7 +13,7 @@ custom_edit_url: null import { SepBadge } from "@site/src/components/SepBadge"; - + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; @@ -34,7 +34,7 @@ Provides the information necessary for the business to determine the state of th Transaction found. -
          Schema
          • 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
            +
            Schema
            • oneOf
              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. @@ -46,28 +46,62 @@ StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. -For a SEP-31 Sending Anchor, the `account` field should be used. +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. -
              receiver object
              + +
              receiver object
              StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. -For a SEP-31 Sending Anchor, the `account` field should be used. +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. -
            creator 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. + + +
          sender object
          StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. -For a SEP-31 Sending Anchor, the `account` field should be used. +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. + + +
          receiver object
          + +StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. + +For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. + +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. + + +
          creator object
          + +StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. + +For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. + +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 6bf881bf2..f4b78ef4c 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-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":[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","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` field 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."}},"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` field 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."}},"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` field 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."}},"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"},"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 @@ -13,7 +13,7 @@ custom_edit_url: null import { SepBadge } from "@site/src/components/SepBadge"; - + import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; @@ -30,11 +30,11 @@ import TabItem from "@theme/TabItem"; 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`. -
          Query Parameters
          +
          Query Parameters
          Transaction found. -
          Schema
          • oneOf
            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
            +
            Schema
            • oneOf
              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. @@ -46,28 +46,62 @@ StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. -For a SEP-31 Sending Anchor, the `account` field should be used. +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. -
              receiver object
              + +
              receiver object
              StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. -For a SEP-31 Sending Anchor, the `account` field should be used. +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. -
              creator 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. + + +
            sender object
            StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. -For a SEP-31 Sending Anchor, the `account` field should be used. +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. + + +
            receiver object
            + +StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. + +For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. + +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. + + +
            creator object
            + +StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. + +For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. + +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/sidebar.js b/api/anchor-platform/resources/sidebar.js index a61a9243f..939db7b92 100644 --- a/api/anchor-platform/resources/sidebar.js +++ b/api/anchor-platform/resources/sidebar.js @@ -1 +1 @@ -module.exports = [{"type":"doc","id":"anchor-platform/resources/platform-api"},{"type":"category","label":"Transactions","link":{"type":"generated-index","title":"Transactions","slug":"/category/anchor-platform/resources/transactions"},"items":[{"type":"doc","id":"anchor-platform/resources/get-transactions","label":"Retrieve a List of Transactions","className":"api-method get"},{"type":"doc","id":"anchor-platform/resources/get-transaction","label":"Retrieve a Transaction","className":"api-method get"}]},{"type":"category","label":"SEP-24","link":{"type":"generated-index","title":"SEP-24","slug":"/category/anchor-platform/resources/sep-24"},"items":[{"type":"doc","id":"anchor-platform/resources/get-transactions","label":"Retrieve a List of Transactions","className":"api-method get"},{"type":"doc","id":"anchor-platform/resources/get-transaction","label":"Retrieve a Transaction","className":"api-method get"}]},{"type":"category","label":"SEP-31","link":{"type":"generated-index","title":"SEP-31","slug":"/category/anchor-platform/resources/sep-31"},"items":[{"type":"doc","id":"anchor-platform/resources/get-transactions","label":"Retrieve a List of Transactions","className":"api-method get"},{"type":"doc","id":"anchor-platform/resources/get-transaction","label":"Retrieve a Transaction","className":"api-method get"}]}]; \ No newline at end of file +module.exports = [{"type":"doc","id":"anchor-platform/resources/platform-api"},{"type":"category","label":"Transactions","link":{"type":"generated-index","title":"Transactions","slug":"/category/anchor-platform/resources/transactions"},"items":[{"type":"doc","id":"anchor-platform/resources/get-transactions","label":"Retrieve a List of Transactions","className":"api-method get"},{"type":"doc","id":"anchor-platform/resources/get-transaction","label":"Retrieve a Transaction","className":"api-method get"}]},{"type":"category","label":"SEP-6","link":{"type":"generated-index","title":"SEP-6","slug":"/category/anchor-platform/resources/sep-6"},"items":[{"type":"doc","id":"anchor-platform/resources/get-transactions","label":"Retrieve a List of Transactions","className":"api-method get"},{"type":"doc","id":"anchor-platform/resources/get-transaction","label":"Retrieve a Transaction","className":"api-method get"}]},{"type":"category","label":"SEP-24","link":{"type":"generated-index","title":"SEP-24","slug":"/category/anchor-platform/resources/sep-24"},"items":[{"type":"doc","id":"anchor-platform/resources/get-transactions","label":"Retrieve a List of Transactions","className":"api-method get"},{"type":"doc","id":"anchor-platform/resources/get-transaction","label":"Retrieve a Transaction","className":"api-method get"}]},{"type":"category","label":"SEP-31","link":{"type":"generated-index","title":"SEP-31","slug":"/category/anchor-platform/resources/sep-31"},"items":[{"type":"doc","id":"anchor-platform/resources/get-transactions","label":"Retrieve a List of Transactions","className":"api-method get"},{"type":"doc","id":"anchor-platform/resources/get-transaction","label":"Retrieve a Transaction","className":"api-method get"}]}]; \ No newline at end of file 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/getting_started.mdx b/docs/anchoring-assets/anchor-platform/getting_started.mdx index b491eb0a4..2fd7adf23 100644 --- a/docs/anchoring-assets/anchor-platform/getting_started.mdx +++ b/docs/anchoring-assets/anchor-platform/getting_started.mdx @@ -329,6 +329,37 @@ When making requests to the Platform API, add a JWT signed by the secret defined `PLATFORM_API_BASE_URL` uses `platform` instead of `localhost` as the host because you'll be making requests to the Platform API within the local network created by docker compose. When configuring your service in a staging or production environment, make sure to update your service urls. +### Passing JVM flags + +Anchor Platform uses JVM to run. Sometimes, it's desired to change JVM flags to run the service. To do so, set environmental variable `JVM_FLAGS` to appropriate value + +```bash +# dev.env +JVM_FLAGS="-Xms256m -Xmx2048m" +``` + +:::tip + +If you need to pass environment variable from your machine to container, you should use `environment` compose option to set variables instead. Here's an example of using keystore from your local machine in the container: + +```yaml +# docker-compose.yml +version: "3.8" +services: + sep-server: + image: stellar/anchor-platform:latest + command: --sep-server + env_file: + - ./dev.env + environment: + JVM_FLAGS: -Djavax.net.ssl.trustStore=/keystore.jks -Djavax.net.ssl.trustStorePassword=${KEYSTORE_PASSWORD} + volumes: + - ${KEYSTORE_LOCATION}:/keystore.jks +# ... +``` + +Where `KEYSTORE_LOCATION` is local keystore location and `KEYSTORE_PASSWORD` is local keystore password. ::: + [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 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/building-apps/example-application-tutorial/anchor-integration/setup.mdx b/docs/building-apps/example-application-tutorial/anchor-integration/setup.mdx index 1508c3af9..f05ca1a92 100644 --- a/docs/building-apps/example-application-tutorial/anchor-integration/setup.mdx +++ b/docs/building-apps/example-application-tutorial/anchor-integration/setup.mdx @@ -22,7 +22,7 @@ Our integrations will also use the following SEPs: - [SEP-10: Stellar Web Authentication](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md) - defines the standard way for clients to create authenticated web sessions on behalf of a user who holds a Stellar account - [SEP-12: KYC API](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md) - defines a standard way for Stellar clients to upload KYC information to anchors -## Setup for anchored assets +## Finding anchored assets BasicPay takes care of all the anchor transfer details on the `/dashboard/transfers` page. See it in action here: https://basicpay.pages.dev/dashboard/transfers diff --git a/docs/building-apps/wallet/sep30.mdx b/docs/building-apps/wallet/sep30.mdx new file mode 100644 index 000000000..34e573f38 --- /dev/null +++ b/docs/building-apps/wallet/sep30.mdx @@ -0,0 +1,315 @@ +--- +title: Recovery +sidebar_position: 60 +--- + +import Header from "./component/header.mdx"; +import { WalletCodeExample as CodeExample } from "@site/src/components/WalletCodeExample"; + +
          + +The [Sep-30] standard defines the standard way for an individual (e.g., a user or wallet) to regain access to their Stellar account after losing its private key without providing any third party control of the account. During this flow the wallet communicates with one or more recovery signer servers to register the wallet for a later recovery if it's needed. + +## Create Recoverable Account + +First, let's create an account key, a device key, and a recovery key that will be attached to the account. + + + +```typescript +const accountKp = wallet.stellar().account().createKeypair(); +const deviceKp = wallet.stellar().account().createKeypair(); +const recoveryKp = wallet.stellar().account().createKeypair(); +``` + +```kotlin + val accountKp = wallet.stellar().account().createKeyPair() + val deviceKp = wallet.stellar().account().createKeyPair() + val recoveryKp = wallet.stellar().account().createKeyPair() +``` + + + +The `accountKp` is the wallet's main account. The `deviceKp` we will be adding to the wallet as a signer so a device (eg. a mobile device a wallet is hosted on) can take control of the account. And the `recoveryKp` will be used to identify the key with the recovery servers. + +Next, let's identify the recovery servers and create our recovery object: + + + +```typescript +const server1Key = "server1"; +const server1 = { + endpoint: "recovery-example.com", + authEndpoint: "auth-example.com", + homeDomain: "test-domain", +}; + +const server2Key = "server2"; +const server2 = { + endpoint: "recovery-example2.com", + authEndpoint: "auth-example2.com", + homeDomain: "test-domain2", +}; + +const recovery = wallet.recovery({ + servers: { [server1Key]: server1, [server2Key]: server2 }, +}); +``` + +```kotlin +val first = RecoveryServerKey("first") +val second = RecoveryServerKey("second") +val firstServer = RecoveryServer("recovery.example.com", "auth.example.com", "example.com") +val secondServer = RecoveryServer("recovery2.example.com", "auth2.example.com", "example.com") +val servers = mapOf(first to firstServer, second to secondServer) +val recovery = wallet.recovery(servers) +``` + + + +Next, we need to define SEP-30 identities. In this example we are going to create an identity for both servers. + + + +```typescript +const identity1 = { + role: RecoveryRole.OWNER, + authMethods: [ + { + type: RecoveryType.STELLAR_ADDRESS, + value: recoveryKp.publicKey, + }, + ], +}; + +const identity2 = { + role: RecoveryRole.OWNER, + authMethods: [ + { + type: RecoveryType.STELLAR_ADDRESS, + value: recoveryKp.publicKey, + }, + { + type: RecoveryType.EMAIL, + value: "my-email@example.com", + }, + ], +}; +``` + +```kotlin + val identities = + listOf( + RecoveryAccountIdentity( + RecoveryRole.OWNER, + listOf(RecoveryAccountAuthMethod(RecoveryType.STELLAR_ADDRESS, recoveryKp.address)) + ) + ) +``` + + + +Here, stellar key will be used as a recovery method. Other recovery servers may support email or phone as a recovery methods. + +You can read more about SEP-30 identities [here](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0030.md#common-request-fields) + +Next, let's create a recoverable account: + + + +```typescript +const config = { + accountAddress: accountKp, + deviceAddress: deviceKp, + accountThreshold: { low: 10, medium: 10, high: 10 }, + accountIdentity: { [server1Key]: [identity1], [server2Key]: [identity2] }, + signerWeight: { device: 10, recoveryServer: 5 }, +}; +const recoverableWallet = await recovery.createRecoverableWallet(config); +``` + +```kotlin + val recoverableWallet = + recovery.createRecoverableWallet( + RecoverableWalletConfig( + accountKp, + deviceKp, + AccountThreshold(10, 10, 10), + mapOf(first to identities, second to identities), + SignerWeight(10, 5) + ) + ) +``` + + + +With the given parameters, this function will create a transaction that will: + +1. Set `deviceKp` as the primary account key. Please note that the master key belonging to `accountKp` will be locked. `deviceKp` should be used as a primary signer instead. +2. Set all operation thresholds to 10. You can read more about threshold in the [documentation](https://developers.stellar.org/docs/encyclopedia/signatures-multisig#thresholds) +3. Use identities that were defined earlier on both servers. (That means, both server will accept SEP-10 authentication via `recoveryKp` as an auth method) +4. Set device key weight to 10, and recovery server weight to 5. Given these account thresholds, both servers must be used to recover the account, as transaction signed by one will only have weight of 5, which is not sufficient to change account key. + +Finally, sign and submit transaction to the network: + + + +```typescript +recoverableWallet.transaction.sign(accountKp.keypair); + +await stellar.submitTransaction(recoverableWallet.transaction); +``` + +```kotlin + val tx = recoverableWallet.transaction.sign(accountKp) + + wallet.stellar().submitTransaction(tx) +``` + + + +## Get Account Info + +You can fetch account info from one or more servers. To do so, first we need to authenticate with a recovery server using the SEP-10 authentication method: + + + +```typescript +const authToken = await recovery + .sep10Auth(server1Key) + .authenticate({ accountKp: recoveryKp }); +``` + +```kotlin + val auth1 = recovery.sep10Auth(first).authenticate(recoveryKp) +``` + + + +Next, get account info using auth tokens: + + + +```typescript +const accountResp = await recovery.getAccountInfo(accountKp, { + [server1Key]: authToken, +}); +``` + +```kotlin + val accountInfo = recovery.getAccountInfo(account, mapOf(first to auth1)) + + println("Recoverable info: $accountInfo") +``` + + + +## Recover Wallet + +Let's say we've lost our device key and need to recover our wallet. + +First, we need to authenticate with both recovery servers: + + + +```typescript +const authToken1 = await recovery + .sep10Auth(server1Key) + .authenticate({ accountKp: recoveryKp }); + +const authToken2 = await recovery + .sep10Auth(server1Key) + .authenticate({ accountKp: recoveryKp }); +``` + +```kotlin + val auth1 = recovery.sep10Auth(first).authenticate(recoveryKp) + val auth2 = recovery.sep10Auth(second).authenticate(recoveryKp) +``` + + + +We need to know the recovery signer addresses that will be used to sign the transaction. You can get them from either the recoverable wallet object we created earlier (`recoverableWallet.signers`), or via fetching account info from recovery servers. + + + +```typescript +const recoverySignerAddress1 = recoverableWallet.signers[0]; +const recoverySignerAddress2 = recoverableWallet.signers[1]; +``` + +```kotlin + val recoverySigners = recoverableWallet.signers +``` + + + +Next, create a new device key and retrieve a signed transaction that replaces the device key: + + + +```typescript +const newDeviceKp = accountService.createKeypair(); + +const serverAuth = { + [server1Key]: { + signerAddress: recoverySignerAddress1, + authToken1, + }, + [server2Key]: { + signerAddress: recoverySignerAddress2, + authToken2, + }, +}; + +const recoverTxn = await recovery.replaceDeviceKey( + accountKp, + newDeviceKp, + serverAuth, +); +``` + +```kotlin + val newKey = wallet.stellar().account().createKeyPair() + + val serverAuth = mapOf( + first to RecoveryServerSigning(recoverySigners[0], auth1), + second to RecoveryServerSigning(recoverySigners[1], auth2) + ) + + val signedReplaceKeyTransaction = + recovery.replaceDeviceKey( + accountKp, + newKey, + serverAuth + ) +``` + + + +Calling this function will create a transaction that locks the previous device key and replaces it with your new key (having the same weight as the old one). Both recovery signers will have signed the transaction. + +The lost device key is deduced automatically if not given. A signer will be considered a device key, if one of these conditions matches: + +1. It's the only signer that's not in `serverAuth`. +2. All signers in `serverAuth` have the same weight, and the potential signer is the only one with a different weight. + +Note that the account created above will match the first criteria. If 2-3 schema were used, then second criteria would match. (In 2-3 schema, 3 serves are used and 2 of them is enough to recover key. This is a recommended approach.) + +Note: you can also use more low-level `signWithRecoveryServers` functions to sign arbitrary transaction. + +Finally, it's time to submit the transaction: + + + +```typescript +await stellar.submitTransaction(recoverTxn); +``` + +```kotlin + wallet.stellar().submitTransaction(signedReplaceKeyTransaction) +``` + + + +[sep-30]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0030.md diff --git a/docs/encyclopedia/liquidity-on-stellar-sdex-liquidity-pools.mdx b/docs/encyclopedia/liquidity-on-stellar-sdex-liquidity-pools.mdx index c1295201a..a3ea58256 100644 --- a/docs/encyclopedia/liquidity-on-stellar-sdex-liquidity-pools.mdx +++ b/docs/encyclopedia/liquidity-on-stellar-sdex-liquidity-pools.mdx @@ -21,7 +21,7 @@ An order book is a record of outstanding orders on a network, and each record si A couple of notes on order books on Stellar: - The term “offers” usually refers specifically to ask orders. In Stellar, however, all orders are stored as selling- i.e., the system automatically converts bids to asks. Because of this, the terms “offer” and “order” are used interchangeably in the Stellar ecosystem. -- Order books contain all orders that are not acceptable to parties on either side to make a trade. +- Order books contain all orders that are acceptable to parties on either side to make a trade. - Some assets will have a small or nonexistent order book between them. In these cases, Stellar facilitates path payments, which we’ll discuss later. To view an order book chart, see the [Order Book Wikipedia Page](https://en.wikipedia.org/wiki/Order_book). In addition, there are also plenty of video tutorials and articles out there that can help you understand how order books work in greater detail. diff --git a/docs/fundamentals-and-concepts/stellar-data-structures/accounts.mdx b/docs/fundamentals-and-concepts/stellar-data-structures/accounts.mdx index 375e5391c..981d6f623 100644 --- a/docs/fundamentals-and-concepts/stellar-data-structures/accounts.mdx +++ b/docs/fundamentals-and-concepts/stellar-data-structures/accounts.mdx @@ -3,8 +3,6 @@ title: Accounts sidebar_position: 20 --- -## Accounts - Accounts are the central data structure in Stellar- they hold balances, sign transactions, and issue assets. Accounts can only exist with a valid keypair and the required minimum balance of XLM. To learn about minimum balance requirements, [see our section on Lumens](../lumens#minimum-balance). diff --git a/docs/fundamentals-and-concepts/stellar-data-structures/ledgers.mdx b/docs/fundamentals-and-concepts/stellar-data-structures/ledgers.mdx index dc237de00..9f10b76b5 100644 --- a/docs/fundamentals-and-concepts/stellar-data-structures/ledgers.mdx +++ b/docs/fundamentals-and-concepts/stellar-data-structures/ledgers.mdx @@ -14,5 +14,6 @@ Data is stored on the ledger as ledger entries. Possible ledger entries include: - Accounts - Claimable balances - Liquidity pools +- [Contract data](https://soroban.stellar.org/docs/fundamentals-and-concepts/persisting-data#ledger-entries) Every ledger has a ledger header, to read about what is contained in the ledger header, see our [Ledger Header Encyclopedia Entry](../../encyclopedia/ledger-headers). diff --git a/docs/fundamentals-and-concepts/testnet-and-pubnet.mdx b/docs/fundamentals-and-concepts/testnet-and-pubnet.mdx index a5ea2f2b6..affe05fad 100644 --- a/docs/fundamentals-and-concepts/testnet-and-pubnet.mdx +++ b/docs/fundamentals-and-concepts/testnet-and-pubnet.mdx @@ -35,8 +35,8 @@ Testnet resets happen once per quarter at 0900 UTC and are announced at least tw March 15, 2023 June 14, 2023 -September 13, 2023 -December 13, 2023 +~~September 13, 2023~~ Note: this reset was skipped due to its proximity to the Protocol 20 Testnet updgrade. +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/docs/run-core-node/installation.mdx b/docs/run-core-node/installation.mdx index 98a03a4cd..8894b7455 100644 --- a/docs/run-core-node/installation.mdx +++ b/docs/run-core-node/installation.mdx @@ -15,7 +15,7 @@ In addition to SDF images, Satoshipay maintains separate Docker images for [Stel ### Production environments -The SDF also maintains a Stellar-Core-only [standalone image](https://hub.docker.com/repository/docker/stellar/stellar-core). +The SDF also maintains a Stellar-Core-only standalone image: [`stellar/stellar-core`](https://hub.docker.com/r/stellar/stellar-core). Example usage: @@ -45,8 +45,6 @@ If you are using Ubuntu 18.04 LTS or later, we provide the latest stable release You may choose to install these packages individually, which offers the greatest flexibility but requires **manual** creation of the relevant configuration files and configuration of a **PostgreSQL** database. -Most people, however, choose to install the [stellar-quickstart](https://github.com/stellar/packages/blob/master/docs/quickstart.md) package which configures a **Testnet** `stellar-core` and `stellar-horizon` both backed by a local PostgreSQL database. Once installed you can easily modify either the Stellar Core configuration if you want to connect to the public network. - ## Installing from source See the [install from source](https://github.com/stellar/stellar-core/blob/master/INSTALL.md) for build instructions. diff --git a/docs/run-core-node/tier-1-orgs.mdx b/docs/run-core-node/tier-1-orgs.mdx index ffa8c7caf..864a8023e 100644 --- a/docs/run-core-node/tier-1-orgs.mdx +++ b/docs/run-core-node/tier-1-orgs.mdx @@ -3,39 +3,45 @@ title: Tier 1 Organizations sidebar_position: 120 --- -To help with Stellar’s decentralization, the most reliable and advanced Stellar teams join the ranks of “Tier 1 Organizations.” These organizations run three validators, coordinate any changes to their quorumsets, and hold themselves to a higher standard of uptime and responsiveness. +To help with Stellar’s decentralization, the most advanced teams building on Stellar run validators and strive to join the ranks of “Tier 1 organizations.” -SDF works closely with Tier 1 Orgs to ensure the health of the network, maintain good quorum intersection, and build in redundancy to minimize network disruptions. This guide outlines what it takes to be a Tier 1 Org. +Remember that the Stellar network consists of organizations that each run validators, and each organization decides for itself, by configuring a quorum set, which and how many other organizations it requires agreement from in order to commit to a particular new ledger. Tier 1 organizations are a group of organizations that, due to the fact that most other organizations require agreement from them, bear the safety and liveness of the Stellar network on their shoulders[^1]. + +To become a Tier 1 organization, a team running validators must convince enough other organizations in the Stellar network to trust them by including them in their quorum sets. As part of this process, they must meet some requirements that are accepted by the community of Stellar validators. For example, Tier 1 organizations generally run three validators, coordinate any changes to their quorum sets with each other, and hold themselves to a higher standard of uptime and responsiveness. + +As a steward of the Stellar network, the SDF works closely with Tier 1 organizations to ensure the health of the network, maintain robust quorum intersection, and build in redundancy to minimize network disruptions. This guide outlines the minimum requirements recommended by the SDF in order to be a Tier 1 organization. However, in the end, the SDF on its own cannot add or remove a Tier 1 organization; this depends on the quorum sets of many other organizations in the network. ## Why Three Validators -The most important function of a Tier 1 Org is to set up and maintain three Full Validators. Why three? +The most important recommendation for a Tier 1 organization is to set up and maintain three full validators. Why three? -On Stellar, validators choose to trust organizations when they build a quorum set. If you are a trustworthy organization, you want your presence on the network to persist even if a node fails or you take it down for maintenance. A trio of validating nodes allows that to happen: other participants can create a quorum slice for your organization that requires ⅔ of your validating nodes to agree. If 1 has issues, no big deal: the other two still vote on your organization’s behalf, so the show goes on. To ensure redundancy, it's also important that those three Full Validators are geographically dispersed: if they're in the same data center, they run the risk of going down at the same time. +On Stellar, validators choose to trust organizations when they configure their quorum set. If you are a trustworthy organization, you want your presence on the network to persist even if a node fails or you take it down for maintenance. A trio of validating nodes allows that to happen: when configuring their quorum sets, other participants can requires ⅔ of your validating nodes to agree. If 1 has issues, no big deal: the other two still vote on your organization’s behalf, so the show goes on. To ensure redundancy, it's also important that those three full validators be geographically dispersed: if they're in the same data center, they run the risk of going down at the same time. -Here’s what else Tier 1 Orgs expect of one another: +Here’s what else Tier 1 organizations should expect of one another: ## Publish History Archives -In addition to participating in SCP, a full validator publishes an archive of network transactions. To do that, you need to configure Stellar Core to record history to a publicly accessible archive, and add the location of that archive to your stellar.toml. To be a Tier 1 Org, you should set each of your nodes to record history to a separate archive. +In addition to participating in the Stellar Consensus Protocol, a full validator publishes an archive of network transactions. To do that, you need to configure Stellar Core to record history to a publicly accessible archive, and add the location of that archive to your stellar.toml. We recommend that, as a Tier 1 organization, you should set each of your nodes to record history to a separate archive. Public archives make the network more resilient: when new nodes come online, or when existing nodes lose synch, they need to consult an archive to figure out what they missed. Sharing snapshots of the ledger, which detail transactions and their results, allows those nodes to catch up, and more archives mean more redundancy and greater decentralization. Plus, sharing history keeps everyone honest. ## Set Up a Safe Quorum Set -To maximize network resilience, we’re asking every Tier 1 node to use the same quorum set configuration, which is made up of subquorums of all validators from each Tier 1 Org. +For simplicity, we’re recommending that every Tier 1 node use the same quorum set configuration, which is made up of inner quorum sets representing each Tier 1 organization. -That way, the validator community can experiment with a larger quorum, and can analyze the results of those experiments without disrupting the network. Using existing Tier 1 Orgs as a safety net, we can work together to expand the quorum methodically and deliberately. To see what that quorum set currently looks like, check out the [example Full Validator config file](https://github.com/stellar/packages/blob/master/docs/examples/pubnet-validator-full/stellar-core.cfg). +To configure a quorum set for your validator, we recommend including several Tier 1 organizations or copying the existing Tier 1 Qset and optionally adding additional organizations that you trust to it. Using existing Tier 1 organizations as a safety net, we can work together to expand the quorum methodically and deliberately. + +To see what the current recommended quorum set looks like, check out the [example Full Validator config file](https://github.com/stellar/packages/blob/master/docs/examples/pubnet-validator-full/stellar-core.cfg). ## Declare Your Node -[SEP-20](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0020.md) is an open spec that explains how self-verification of validator nodes works. The steps it specifies are pretty simple: you set the home domain of your validator’s Stellar account to your website, where you publish information about your node and your organization in a stellar.toml file. +[SEP-20](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0020.md) is an open spec that explains how self-verification of validator nodes works. The fields it specifies are pretty simple: you set the home domain of your validator’s Stellar account to your website, where you publish information about your node and your organization in a stellar.toml file. It’s an easy way to propagate information, and it harnesses the network to allow other participants to discover your node and add it to their quorum sets without the need for a centralized database. ## Keep Your Nodes Up To Date -Running a validator requires vigilance. You need to keep an eye on your nodes, keep them up to date with the latest version of Stellar Core, and check in on public channels for information about what’s currently happening with other validators. +Running a validator requires vigilance. You need to keep an eye on your nodes, keep them up to date with the latest version of Stellar Core, and check in on public channels for information about what’s currently happening with other validators. As organizations join or leave the network, you might need to update the quorum set configuration of your validators to ensure that your validators have robust quorum intersection with Tier 1 and robust quorum availability. The best two ways to do that: @@ -44,7 +50,7 @@ The best two ways to do that: We always announce new Stellar Core releases in those channels. You can also find those releases on our github. -It’s also critical that you pay attention to information about what those updates mean: often, you’ll need to set your validators to vote on something timely, such as when to upgrade the network as a whole, or how high to set the operations-per-ledger limit. +It’s also critical that you pay attention to information about what those updates mean: often, you’ll need to set your validators to vote on something timely, such as when to vote to upgrade to a new protocol version, or how high to set the operations-per-ledger limit. ## Coordinate With Other Validators @@ -55,18 +61,20 @@ Whether you run a trio of validators or a single node, it’s important that you Letting other validators know when you plan to take your node down for maintenance or to upgrade to the latest version of stellar-core prevents a critical mass of nodes from going offline at the same time. -Letting other validators know when you plan to change your quorum set allows them to respond, adjust, and think through the implications of expanding the quorum. For the quorum to expand safely, we all need to coordinate to ensure we maintain good quorum intersection. +Letting other validators know when you plan to change your quorum set allows them to respond, adjust, and think through the implications of the change. For the Stellar network to expand safely, the SDF recommends that validators coordinate off-chain to maintain good quorum intersection. ## Monitor your quorum set -We recommend using Prometheus to to scrape and store your stellar-core metrics, and Grafana to render that data for human consumption. You can find step-by-step instructions for setting up monitoring and alerts in [Monitoring and Diagnostics](./monitoring.mdx), along with links to Grafana dashboards we’ve created to make things easier. +We recommend using Prometheus to scrape and store your stellar-core metrics, and Grafana to render that data for human consumption. You can find step-by-step instructions for setting up monitoring and alerts in [Monitoring and Diagnostics](./monitoring.mdx), along with links to Grafana dashboards we’ve created to make things easier. -You can also use stellarbeat.io to view validators’ quorum configurations, and get information about their availability and uptime, and the quorum command to diagnose problems with the quorum set of the local node. +You can also use [Stellarbeat](https://stellarbeat.io) to view validators’ quorum configurations, get information about their availability and uptime, and the quorum command to diagnose problems with the quorum set of the local node. You should do regular check-ins on your quorum set. If nodes have bad uptime or prove otherwise unreliable, you may need to remove them from your quorum set so that you don’t get stuck and so that the network doesn’t halt. You may also want to add new organizations that come online and prove reliable. If you plan to do either of those things, remember to communicate and coordinate with other validators. ## Get in touch -If you think you can be a Tier 1 Org, let us know on the #validators channel on [Keybase](https://keybase.io/team/stellar.public). We can help you through the process, and once you’re up and running, we’ll work to fold you into the quorum so that you can take your rightful place as a pillar of the network. Once you’ve proven that you are responsive, reliable, and maintain good uptime, we will adjust the quorum set recipe above to include your validators. +If you think you can be a Tier 1 organization, let us know on the #validators channel on the [Stellar Developers Discord](https://discord.gg/stellardev). We can help you through the process, and once you’re up and running, we’ll help you join Tier 1 so that you can take your rightful place as a pillar of the network. Once you’ve proven that you are responsive, reliable, and maintain good uptime, we will recommend that other validators adjust their quorum set to include your validators. + +As Stellar grows, and more and more businesses build on the network, Tier 1 organizations will be crucial to a healthy expansion of the network. -As Stellar grows, and more and more businesses build on the network, Tier 1 Orgs will be crucial to the methodical expansion of the network. +[^1] The notion of Tier 1 organization can be defined precisely, but this is besides the point of this document diff --git a/docusaurus.config.js b/docusaurus.config.js index f15fd2fb5..8db7edf7b 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -60,6 +60,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 diff --git a/nginx/includes/redirects.conf b/nginx/includes/redirects.conf index 16a5ed4d2..0bf0732c4 100644 --- a/nginx/includes/redirects.conf +++ b/nginx/includes/redirects.conf @@ -1,33 +1,34 @@ -rewrite ^/docs/glossary/accounts$ "/docs/fundamentals-and-concepts/stellar-data-structures/accounts" redirect; -rewrite ^/docs/glossary/assets$ "/docs/fundamentals-and-concepts/stellar-data-structures/assets" redirect; -rewrite ^/docs/glossary/channels$ "/docs/encyclopedia/channel-accounts" redirect; -rewrite ^/docs/glossary/claimable-balance$ "/docs/encyclopedia/claimable-balances" redirect; -rewrite ^/docs/glossary/clawback$ "/docs/encyclopedia/clawbacks" redirect; -rewrite ^/docs/glossary/decentralized-exchange$ "/docs/encyclopedia/liquidity-on-stellar-sdex-and-liquidity-pools#sdex" redirect; -rewrite ^/docs/glossary/federation$ "/docs/encyclopedia/federation" redirect; -rewrite ^/docs/glossary/fee-bumps$ "/docs/encyclopedia/fee-bump-transactions" redirect; -rewrite ^/docs/glossary/fees$ "/docs/encyclopedia/fees-surge-pricing-fee-strategies" redirect; -rewrite ^/docs/glossary/inflation$ "/docs/encyclopedia/inflation" redirect; -rewrite ^/docs/glossary/ledger$ "/docs/fundamentals-and-concepts/stellar-data-structures/ledgers" redirect; -rewrite ^/docs/glossary/liquidity-pools$ "/docs/encyclopedia/liquidity-on-stellar-sdex-and-liquidity-pools#liquidity-pools" redirect; -rewrite ^/docs/glossary/lumen-supply$ "/docs/encyclopedia/lumen-supply-metrics" redirect; -rewrite ^/docs/glossary/minimum-balance$ "/docs/fundamentals-and-concepts/lumens#minimum-balance" redirect; -rewrite ^/docs/glossary/multisig$ "/docs/encyclopedia/signatures-and-multisig" redirect; -rewrite ^/docs/glossary/muxed-accounts$ "/docs/encyclopedia/network-passphrases" redirect; -rewrite ^/docs/glossary/network-passphrase$ "/docs/encyclopedia/network-passphrases" redirect; -rewrite ^/docs/glossary/operations$ "/docs/fundamentals-and-concepts/stellar-data-structures/operations-and-transactions#operations" redirect; -rewrite ^/docs/glossary/scp$ "/docs/fundamentals-and-concepts/stellar-consensus-protocol" redirect; -rewrite ^/docs/glossary/sponsored-reserves$ "/docs/encyclopedia/sponsored-reserves" redirect; -rewrite ^/docs/glossary/testnet$ "/docs/fundamentals-and-concepts/testnet-and-pubnet" redirect; -rewrite ^/docs/glossary/transactions$ "/docs/fundamentals-and-concepts/stellar-data-structures/operations-and-transactions" redirect; -rewrite ^/docs/glossary/xdr$ "/docs/encyclopedia/xdr" redirect; -rewrite ^/docs/software-and-sdks$ "/docs/tools-and-sdks#sdk-library" redirect; -rewrite ^/docs/start/introduction$ "/docs/" redirect; -rewrite ^/docs/start/list-of-operations$ "/docs/fundamentals-and-concepts/list-of-operations" redirect; -rewrite ^/docs/start/stellar-stack$ "/docs/fundamentals-and-concepts/stellar-stack" redirect; -rewrite ^/docs/tutorials/handling-errors$ "/docs/encyclopedia/error-handling" redirect; -rewrite ^/docs/tutorials/securing-projects$ "/docs/encyclopedia/securing-web-based-projects" redirect; +rewrite ^/docs/glossary/accounts$ "/docs/fundamentals-and-concepts/stellar-data-structures/accounts" permanent; +rewrite ^/docs/glossary/assets$ "/docs/fundamentals-and-concepts/stellar-data-structures/assets" permanent; +rewrite ^/docs/glossary/channels$ "/docs/encyclopedia/channel-accounts" permanent; +rewrite ^/docs/glossary/claimable-balance$ "/docs/encyclopedia/claimable-balances" permanent; +rewrite ^/docs/glossary/clawback$ "/docs/encyclopedia/clawbacks" permanent; +rewrite ^/docs/glossary/decentralized-exchange$ "/docs/encyclopedia/liquidity-on-stellar-sdex-and-liquidity-pools#sdex" permanent; +rewrite ^/docs/glossary/federation$ "/docs/encyclopedia/federation" permanent; +rewrite ^/docs/glossary/fee-bumps$ "/docs/encyclopedia/fee-bump-transactions" permanent; +rewrite ^/docs/glossary/fees$ "/docs/encyclopedia/fees-surge-pricing-fee-strategies" permanent; +rewrite ^/docs/glossary/inflation$ "/docs/encyclopedia/inflation" permanent; +rewrite ^/docs/glossary/ledger$ "/docs/fundamentals-and-concepts/stellar-data-structures/ledgers" permanent; +rewrite ^/docs/glossary/liquidity-pools$ "/docs/encyclopedia/liquidity-on-stellar-sdex-and-liquidity-pools#liquidity-pools" permanent; +rewrite ^/docs/glossary/lumen-supply$ "/docs/encyclopedia/lumen-supply-metrics" permanent; +rewrite ^/docs/glossary/minimum-balance$ "/docs/fundamentals-and-concepts/lumens#minimum-balance" permanent; +rewrite ^/docs/glossary/multisig$ "/docs/encyclopedia/signatures-and-multisig" permanent; +rewrite ^/docs/glossary/muxed-accounts$ "/docs/encyclopedia/network-passphrases" permanent; +rewrite ^/docs/glossary/network-passphrase$ "/docs/encyclopedia/network-passphrases" permanent; +rewrite ^/docs/glossary/operations$ "/docs/fundamentals-and-concepts/stellar-data-structures/operations-and-transactions#operations" permanent; +rewrite ^/docs/glossary/scp$ "/docs/fundamentals-and-concepts/stellar-consensus-protocol" permanent; +rewrite ^/docs/glossary/sponsored-reserves$ "/docs/encyclopedia/sponsored-reserves" permanent; +rewrite ^/docs/glossary/testnet$ "/docs/fundamentals-and-concepts/testnet-and-pubnet" permanent; +rewrite ^/docs/glossary/transactions$ "/docs/fundamentals-and-concepts/stellar-data-structures/operations-and-transactions" permanent; +rewrite ^/docs/glossary/xdr$ "/docs/encyclopedia/xdr" permanent; +rewrite ^/docs/software-and-sdks$ "/docs/tools-and-sdks#sdk-library" permanent; +rewrite ^/docs/start/introduction$ "/docs/" permanent; +rewrite ^/docs/start/list-of-operations$ "/docs/fundamentals-and-concepts/list-of-operations" permanent; +rewrite ^/docs/start/stellar-stack$ "/docs/fundamentals-and-concepts/stellar-stack" permanent; +rewrite ^/docs/tutorials/handling-errors$ "/docs/encyclopedia/error-handling" permanent; +rewrite ^/docs/tutorials/securing-projects$ "/docs/encyclopedia/securing-web-based-projects" permanent; +rewrite ^/docs/tutorials/moneygram-access-integration-guide$ "/docs/building-apps/moneygram-access-integration-guide" permanent; # moving /api/* locations to /api/horizon (leaving /api intact for the "overview page") -rewrite ^/api(/(?!horizon|(anchor|stellar-disbursement)-platform).+)$ /api/horizon$1 redirect; +rewrite ^/api(/(?!horizon|(anchor|stellar-disbursement)-platform).+)$ /api/horizon$1 permanent; # moving /ap_api locations to /api/anchor-platform -rewrite ^/ap_api(/.*)?$ /api/anchor-platform$1 redirect; +rewrite ^/ap_api(/.*)?$ /api/anchor-platform$1 permanent; diff --git a/openapi/anchor-platform/Callbacks API.yml b/openapi/anchor-platform/Callbacks API.yml index 1125ce85a..2b43d0d92 100644 --- a/openapi/anchor-platform/Callbacks API.yml +++ b/openapi/anchor-platform/Callbacks API.yml @@ -471,6 +471,7 @@ paths: post: tags: - Events + - SEP-6 - SEP-24 - SEP-31 summary: Receive an Event 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/Platform API.yml b/openapi/anchor-platform/Platform API.yml index 4392491bb..668fb93c8 100644 --- a/openapi/anchor-platform/Platform API.yml +++ b/openapi/anchor-platform/Platform API.yml @@ -12,6 +12,7 @@ paths: get: tags: - "Transactions" + - SEP-6 - SEP-24 - SEP-31 summary: Retrieve a List of Transactions @@ -25,7 +26,7 @@ paths: required: true schema: type: string - enum: [ 24, 31 ] + enum: [ 6, 24, 31 ] description: Lookup transactions belonging to this SEP. - in: query @@ -76,6 +77,7 @@ paths: application/json: schema: oneOf: + - $ref: './schemas.yml#/components/schemas/TransactionListSEP6' - $ref: './schemas.yml#/components/schemas/TransactionListSEP24' - $ref: './schemas.yml#/components/schemas/TransactionListSEP31' '400': @@ -94,6 +96,7 @@ paths: get: tags: - "Transactions" + - SEP-6 - SEP-24 - SEP-31 summary: Retrieve a Transaction @@ -114,6 +117,7 @@ paths: application/json: schema: oneOf: + - $ref: './schemas.yml#/components/schemas/TransactionSEP6' - $ref: './schemas.yml#/components/schemas/TransactionSEP24' - $ref: './schemas.yml#/components/schemas/TransactionSEP31' '400': diff --git a/openapi/anchor-platform/bundled.yml b/openapi/anchor-platform/bundled.yml index d3d58aec6..7ba0b125f 100644 --- a/openapi/anchor-platform/bundled.yml +++ b/openapi/anchor-platform/bundled.yml @@ -12,6 +12,7 @@ paths: get: tags: - Transactions + - SEP-6 - SEP-24 - SEP-31 summary: Retrieve a List of Transactions @@ -24,6 +25,7 @@ paths: schema: type: string enum: + - 6 - 24 - 31 description: Lookup transactions belonging to this SEP. @@ -75,6 +77,7 @@ paths: application/json: schema: oneOf: + - $ref: '#/components/schemas/TransactionListSEP6' - $ref: '#/components/schemas/TransactionListSEP24' - $ref: '#/components/schemas/TransactionListSEP31' '400': @@ -93,6 +96,7 @@ paths: get: tags: - Transactions + - SEP-6 - SEP-24 - SEP-31 summary: Retrieve a Transaction @@ -111,6 +115,7 @@ paths: application/json: schema: oneOf: + - $ref: '#/components/schemas/TransactionSEP6' - $ref: '#/components/schemas/TransactionSEP24' - $ref: '#/components/schemas/TransactionSEP31' '400': @@ -150,9 +155,9 @@ components: - pending_receiver - pending_transaction_info_update - pending_customer_info_update - StatusSEP24: + StatusSEP6: type: string - description: Possible status value for SEP-24 transactions + description: Possible status value for SEP-6 transactions enum: - incomplete - completed @@ -161,6 +166,7 @@ components: - error - pending_stellar - pending_external + - pending_customer_info_update - pending_user_transfer_start - pending_user_transfer_complete - pending_anchor @@ -270,6 +276,133 @@ components: description: The memo type of the transaction in the Stellar network. Should be present if memo is not null. enum: - text id hash + StellarId: + type: object + description: | + StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. + + For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. + + 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. + 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`. + TransactionSEP6: + 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: + $ref: '#/components/schemas/StatusSEP6' + type: + type: string + amount_expected: + $ref: '#/components/schemas/Amount' + amount_in: + $ref: '#/components/schemas/Amount' + amount_out: + $ref: '#/components/schemas/Amount' + amount_fee: + $ref: '#/components/schemas/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: + $ref: '#/components/schemas/Refunds' + stellar_transactions: + type: array + items: + $ref: '#/components/schemas/StellarTransaction' + source_account: + type: string + destination_account: + type: string + external_transaction_id: + type: string + memo: + type: string + memo_type: + $ref: '#/components/schemas/MemoType' + refund_memo: + description: if provided, this memo should be used for refund transactions + type: string + refund_memo_type: + $ref: '#/components/schemas/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), + this object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer. + properties: + sender: + $ref: '#/components/schemas/StellarId' + receiver: + $ref: '#/components/schemas/StellarId' + TransactionListSEP6: + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/TransactionSEP6' + StatusSEP24: + 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 TransactionSEP24: type: object required: @@ -359,21 +492,6 @@ components: - pending_receiver - pending_transaction_info_update - pending_customer_info_update - StellarId: - type: object - description: | - StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors. - - For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. - - For a SEP-31 Sending Anchor, the `account` field should be used. - 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. TransactionSEP31: type: object required: diff --git a/openapi/anchor-platform/bundled_callback.yml b/openapi/anchor-platform/bundled_callback.yml index c80fc5a57..2a1cebcd0 100644 --- a/openapi/anchor-platform/bundled_callback.yml +++ b/openapi/anchor-platform/bundled_callback.yml @@ -470,6 +470,7 @@ paths: post: tags: - Events + - SEP-6 - SEP-24 - SEP-31 summary: Receive an Event @@ -931,7 +932,9 @@ components: For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. - For a SEP-31 Sending Anchor, the `account` field should be used. + 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. properties: id: type: string @@ -939,6 +942,9 @@ components: 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`. TransactionSEP31: type: object required: @@ -1031,6 +1037,11 @@ components: created_at: type: string format: date-time + Customer: + type: object + properties: + id: + type: string Event: type: object properties: @@ -1043,6 +1054,7 @@ components: - transaction_status_changed - transaction_error - quote_created + - customer_updated description: | The transaction event type. Can be one of the following: - `transaction_created` - a transaction was created through the SEP endpoints. The payload is in the `transaction` field. @@ -1061,6 +1073,8 @@ components: - $ref: '#/components/schemas/TransactionSEP31' quote: $ref: '#/components/schemas/Quote' + customer: + $ref: '#/components/schemas/Customer' required: - id - type diff --git a/openapi/anchor-platform/bundled_custody.yml b/openapi/anchor-platform/bundled_custody.yml new file mode 100644 index 000000000..de32f8b5f --- /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 769b3c908..9d3a216d3 100644 --- a/openapi/anchor-platform/schemas.yml +++ b/openapi/anchor-platform/schemas.yml @@ -372,6 +372,84 @@ components: refund_memo_type: $ref: '#/components/schemas/MemoType' + TransactionSEP6: + type: object + required: [ id, sep, kind, status, started_at ] + properties: + id: + type: string + sep: + type: string + enum: [ "6" ] + kind: + type: string + enum: [ + # SEP6 + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + status: + $ref: '#/components/schemas/StatusSEP6' + type: + type: string + amount_expected: + $ref: '#/components/schemas/Amount' + amount_in: + $ref: '#/components/schemas/Amount' + amount_out: + $ref: '#/components/schemas/Amount' + amount_fee: + $ref: '#/components/schemas/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: + $ref: '#/components/schemas/Refunds' + stellar_transactions: + type: array + items: + $ref: '#/components/schemas/StellarTransaction' + source_account: + type: string + destination_account: + type: string + external_transaction_id: + type: string + memo: + type: string + memo_type: + $ref: '#/components/schemas/MemoType' + refund_memo: + description: if provided, this memo should be used for refund transactions + type: string + refund_memo_type: + $ref: '#/components/schemas/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), + this object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer. + properties: + sender: + $ref: '#/components/schemas/StellarId' + receiver: + $ref: '#/components/schemas/StellarId' + MemoType: type: string description: The memo type of the transaction in the Stellar network. Should be present if memo is not null. @@ -449,6 +527,30 @@ components: pending_customer_info_update ] + StatusSEP6: + type: string + description: Possible status value for SEP-6 transactions + enum: [ + # Shared + incomplete, + completed, + refunded, + expired, + error, + pending_stellar, + pending_external, + # SEP-6 + pending_customer_info_update, + pending_user_transfer_start, + pending_user_transfer_complete, + pending_anchor, + pending_trust, + pending_user, + no_market, + too_small, + too_large + ] + StatusSEP24: type: string description: Possible status value for SEP-24 transactions @@ -491,6 +593,14 @@ components: pending_customer_info_update ] + TransactionListSEP6: + type: object + properties: + records: + type: array + items: + $ref: './schemas.yml#/components/schemas/TransactionSEP6' + TransactionListSEP24: type: object properties: @@ -554,7 +664,9 @@ components: For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. - For a SEP-31 Sending Anchor, the `account` field should be used. + 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. properties: id: type: string @@ -562,6 +674,9 @@ components: 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`. StellarTransaction: type: object required: @@ -641,6 +756,7 @@ components: - transaction_status_changed - transaction_error - quote_created + - customer_updated description: | The transaction event type. Can be one of the following: - `transaction_created` - a transaction was created through the SEP endpoints. The payload is in the `transaction` field. @@ -659,6 +775,8 @@ components: - $ref: './schemas.yml#/components/schemas/TransactionSEP31' quote: $ref: '#/components/schemas/Quote' + customer: + $ref: '#/components/schemas/Customer' required: [ id, type, payload, timestamp ] Quote: type: object @@ -687,3 +805,37 @@ components: created_at: type: string format: date-time + Customer: + type: object + 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/static/assets/rpc-methods/do_stellar_payment.json b/static/assets/rpc-methods/do_stellar_payment.json index 5d98cb159..a1f24e2a8 100644 --- a/static/assets/rpc-methods/do_stellar_payment.json +++ b/static/assets/rpc-methods/do_stellar_payment.json @@ -4,6 +4,9 @@ "description": "Submits a payment to a stellar network by a custody service", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -39,6 +42,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -50,7 +54,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/do_stellar_refund.json b/static/assets/rpc-methods/do_stellar_refund.json index f03728290..9b9c18345 100644 --- a/static/assets/rpc-methods/do_stellar_refund.json +++ b/static/assets/rpc-methods/do_stellar_refund.json @@ -4,6 +4,9 @@ "description": "Submits a refund payment to a stellar network by a custody service", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -92,6 +95,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -103,7 +107,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/notify_amounts_updated.json b/static/assets/rpc-methods/notify_amounts_updated.json index 72d205bc3..c2e1f0d1b 100644 --- a/static/assets/rpc-methods/notify_amounts_updated.json +++ b/static/assets/rpc-methods/notify_amounts_updated.json @@ -4,6 +4,9 @@ "description": "Update amount_out and amount_fee values", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -37,9 +40,7 @@ "description": "Amount of assets" } }, - "required": [ - "amount" - ] + "required": ["amount"] } }, { @@ -54,9 +55,7 @@ "description": "Amount of assets" } }, - "required": [ - "amount" - ] + "required": ["amount"] } } ], @@ -72,10 +71,7 @@ "sep": { "type": "integer", "description": "Protocol of the transaction", - "enum": [ - "24", - "31" - ] + "enum": ["6", "24", "31"] }, "kind": { "type": "string", @@ -84,7 +80,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { @@ -264,4 +262,4 @@ } } } -} \ No newline at end of file +} diff --git a/static/assets/rpc-methods/notify_customer_info_updated.json b/static/assets/rpc-methods/notify_customer_info_updated.json index d394546c6..4f5278e22 100644 --- a/static/assets/rpc-methods/notify_customer_info_updated.json +++ b/static/assets/rpc-methods/notify_customer_info_updated.json @@ -38,10 +38,7 @@ "sep": { "type": "integer", "description": "Protocol of the transaction", - "enum": [ - "24", - "31" - ] + "enum": ["6", "24", "31"] }, "kind": { "type": "string", @@ -50,7 +47,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { @@ -230,4 +229,4 @@ } } } -} \ No newline at end of file +} diff --git a/static/assets/rpc-methods/notify_offchain_funds_available.json b/static/assets/rpc-methods/notify_offchain_funds_available.json index 104f59fdd..1b6274620 100644 --- a/static/assets/rpc-methods/notify_offchain_funds_available.json +++ b/static/assets/rpc-methods/notify_offchain_funds_available.json @@ -4,6 +4,9 @@ "description": "Funds are ready for the user / recipient to pick up", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -47,6 +50,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -58,7 +62,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/notify_offchain_funds_pending.json b/static/assets/rpc-methods/notify_offchain_funds_pending.json index 386d8adc7..3b151499d 100644 --- a/static/assets/rpc-methods/notify_offchain_funds_pending.json +++ b/static/assets/rpc-methods/notify_offchain_funds_pending.json @@ -4,6 +4,9 @@ "description": "Payment has been submitted to external network, but is not yet confirmed", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -50,6 +53,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -61,7 +65,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/notify_offchain_funds_received.json b/static/assets/rpc-methods/notify_offchain_funds_received.json index dadee3a7f..f5b5bd6fc 100644 --- a/static/assets/rpc-methods/notify_offchain_funds_received.json +++ b/static/assets/rpc-methods/notify_offchain_funds_received.json @@ -4,6 +4,9 @@ "description": "Payment is being processed internally by anchor", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -53,9 +56,7 @@ "description": "Amount of assets" } }, - "required": [ - "amount" - ] + "required": ["amount"] } }, { @@ -70,9 +71,7 @@ "description": "Amount of assets" } }, - "required": [ - "amount" - ] + "required": ["amount"] } }, { @@ -87,9 +86,7 @@ "description": "Amount of assets" } }, - "required": [ - "amount" - ] + "required": ["amount"] } } ], @@ -105,10 +102,7 @@ "sep": { "type": "integer", "description": "Protocol of the transaction", - "enum": [ - "24", - "31" - ] + "enum": ["6", "24", "31"] }, "kind": { "type": "string", @@ -117,7 +111,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { @@ -297,4 +293,4 @@ } } } -} \ No newline at end of file +} diff --git a/static/assets/rpc-methods/notify_offchain_funds_sent.json b/static/assets/rpc-methods/notify_offchain_funds_sent.json index 56a170761..ee53bb90e 100644 --- a/static/assets/rpc-methods/notify_offchain_funds_sent.json +++ b/static/assets/rpc-methods/notify_offchain_funds_sent.json @@ -1,9 +1,12 @@ { "name": "notify_offchain_funds_sent", "summary": "Offchain funds sent", - "description": "Transaction flow is fully completed for SEP-24 withdrawal flow or SEP-31 receive flow. Payment has been submitted to external network, but is not yet confirmed for SEP-24 deposit flow", + "description": "Transaction flow is fully completed for the SEP-6 and SEP-24 withdrawal flow or SEP-31 receive flow. Payment has been submitted to external network, but is not yet confirmed for SEP-24 deposit flow", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -58,6 +61,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -69,7 +73,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/notify_onchain_funds_received.json b/static/assets/rpc-methods/notify_onchain_funds_received.json index 6df80d3f4..5dae9af81 100644 --- a/static/assets/rpc-methods/notify_onchain_funds_received.json +++ b/static/assets/rpc-methods/notify_onchain_funds_received.json @@ -1,9 +1,12 @@ { "name": "notify_onchain_funds_received", "summary": "Onchain funds received", - "description": "Payment is being processed internally by anchor for SEP-24. Payment is being processed by the Receiving Anchor for SEP-31", + "description": "Payment is being processed internally by anchor for SEP-6 or SEP-24. Payment is being processed by the Receiving Anchor for SEP-31", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -48,9 +51,7 @@ "description": "Amount of assets" } }, - "required": [ - "amount" - ] + "required": ["amount"] } }, { @@ -65,9 +66,7 @@ "description": "Amount of assets" } }, - "required": [ - "amount" - ] + "required": ["amount"] } }, { @@ -82,9 +81,7 @@ "description": "Amount of assets" } }, - "required": [ - "amount" - ] + "required": ["amount"] } } ], @@ -100,10 +97,7 @@ "sep": { "type": "integer", "description": "Protocol of the transaction", - "enum": [ - "24", - "31" - ] + "enum": ["6", "24", "31"] }, "kind": { "type": "string", @@ -112,7 +106,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { @@ -292,4 +288,4 @@ } } } -} \ No newline at end of file +} diff --git a/static/assets/rpc-methods/notify_onchain_funds_sent.json b/static/assets/rpc-methods/notify_onchain_funds_sent.json index 00c8d472e..689c130d3 100644 --- a/static/assets/rpc-methods/notify_onchain_funds_sent.json +++ b/static/assets/rpc-methods/notify_onchain_funds_sent.json @@ -1,9 +1,12 @@ { "name": "notify_onchain_funds_sent", "summary": "Onchain funds sent", - "description": "Transaction flow is fully completed for SEP-24 deposit", + "description": "Transaction flow is fully completed for SEP-6 or SEP-24 deposit", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -47,6 +50,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -58,7 +62,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/notify_refund_pending.json b/static/assets/rpc-methods/notify_refund_pending.json index f1c1f5fe2..d0f91f11f 100644 --- a/static/assets/rpc-methods/notify_refund_pending.json +++ b/static/assets/rpc-methods/notify_refund_pending.json @@ -4,6 +4,9 @@ "description": "Refund has been submitted, but is not yet confirmed", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -94,6 +97,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -105,7 +109,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { @@ -285,4 +291,4 @@ } } } -} \ No newline at end of file +} diff --git a/static/assets/rpc-methods/notify_refund_sent.json b/static/assets/rpc-methods/notify_refund_sent.json index b6cfa6a7e..b21fc277b 100644 --- a/static/assets/rpc-methods/notify_refund_sent.json +++ b/static/assets/rpc-methods/notify_refund_sent.json @@ -4,6 +4,9 @@ "description": "Refund payment completed", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -96,6 +99,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -107,7 +111,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/notify_transaction_error.json b/static/assets/rpc-methods/notify_transaction_error.json index 8a94be385..28834153b 100644 --- a/static/assets/rpc-methods/notify_transaction_error.json +++ b/static/assets/rpc-methods/notify_transaction_error.json @@ -4,6 +4,9 @@ "description": "There was an error processing transaction", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -53,7 +56,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/notify_transaction_expired.json b/static/assets/rpc-methods/notify_transaction_expired.json index 7813055d3..f5e4e4c2d 100644 --- a/static/assets/rpc-methods/notify_transaction_expired.json +++ b/static/assets/rpc-methods/notify_transaction_expired.json @@ -4,6 +4,9 @@ "description": "Funds were never received by the anchor and the transaction is considered abandoned by the user", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -42,6 +45,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -53,7 +57,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/notify_transaction_recovery.json b/static/assets/rpc-methods/notify_transaction_recovery.json index a935cdf37..2e51ec9ac 100644 --- a/static/assets/rpc-methods/notify_transaction_recovery.json +++ b/static/assets/rpc-methods/notify_transaction_recovery.json @@ -1,9 +1,12 @@ { "name": "notify_transaction_recovery ", "summary": "Transaction recovery", - "description": "Transaction status is changed from error / expired to pending_anchor(SEP-24) or pending_receiver(SEP-31)", + "description": "Transaction status is changed from error / expired to pending_anchor(SEP-6 or SEP-24) or pending_receiver(SEP-31)", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -42,6 +45,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -53,7 +57,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/notify_trust_set.json b/static/assets/rpc-methods/notify_trust_set.json index c8ef9b237..b8b12e3e5 100644 --- a/static/assets/rpc-methods/notify_trust_set.json +++ b/static/assets/rpc-methods/notify_trust_set.json @@ -4,6 +4,9 @@ "description": "The user has added a trustline for the asset", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -47,6 +50,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -58,7 +62,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/open-rpc.json b/static/assets/rpc-methods/open-rpc.json index 5745ade2f..85ba3f3b5 100644 --- a/static/assets/rpc-methods/open-rpc.json +++ b/static/assets/rpc-methods/open-rpc.json @@ -177,6 +177,9 @@ "description": "The user has to initiate transfer to the anchor", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -339,6 +342,9 @@ "description": "The user has to initiate transfer to the anchor", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -522,6 +528,9 @@ "description": "Payment is being processed internally by anchor", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -668,9 +677,12 @@ { "name": "notify_onchain_funds_received", "summary": "Onchain funds received", - "description": "Payment is being processed internally by anchor for SEP-24. Payment is being processed by the Receiving Anchor for SEP-31", + "description": "Payment is being processed internally by anchor for SEP-6 or SEP-24. Payment is being processed by the Receiving Anchor for SEP-31", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -795,6 +807,9 @@ "description": "Update amount_out and amount_fee values", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -896,6 +911,9 @@ "description": "Refund has been submitted, but is not yet confirmed", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -1020,6 +1038,9 @@ "description": "Refund payment completed", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -1146,6 +1167,9 @@ "description": "Submits a payment to stellar network by a custody service", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -1201,6 +1225,9 @@ "description": "Submits a refund payment to stellar network by a custody service", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -1318,9 +1345,12 @@ { "name": "notify_onchain_funds_sent", "summary": "Onchain funds sent", - "description": "Transaction flow is fully completed for SEP-24 deposit", + "description": "Transaction flow is fully completed for SEP-6 or SEP-24 deposit", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -1385,9 +1415,12 @@ { "name": "notify_offchain_funds_sent", "summary": "Offchain funds sent", - "description": "Transaction flow is fully completed for SEP-24 withdrawal flow or SEP-31 receive flow. Payment has been submitted to external network, but is not yet confirmed for SEP-24 deposit flow", + "description": "Transaction flow is fully completed for the SEP-6 and SEP-24 withdrawal flow or SEP-31 receive flow. Payment has been submitted to external network, but is not yet confirmed for SEP-24 deposit flow", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -1464,6 +1497,9 @@ "description": "Funds are ready for the user / recipient to pick up", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -1530,6 +1566,9 @@ "description": "Payment has been submitted to external network, but is not yet confirmed", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -1599,6 +1638,9 @@ "description": "The user must add a trustline for the asset to complete", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -1654,6 +1696,9 @@ "description": "The user has added a trustline for the asset", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -1716,6 +1761,9 @@ "description": "Additional customer information is required", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 31" } @@ -1735,6 +1783,22 @@ "schema": { "type": "string" } + }, + { + "name": "required_customer_info_message", + "description": "Human readable explanation indicating why the SEP-12 information provided by the user is not sufficient to complete the transaction. This field is only relevant for SEP-6 transactions and must be set.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "required_customer_info_updates", + "description": "A list of SEP-9 fields that require updates from the user via SEP-12. This field is only relevant for SEP-6 transactions and must be set.", + "required": false, + "schema": { + "type": "array" + } } ], "result": { @@ -1826,6 +1890,9 @@ "description": "There was an error processing transaction", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -1885,6 +1952,9 @@ "description": "Funds were never received by the anchor and the transaction is considered abandoned by the user", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -1941,9 +2011,12 @@ { "name": "notify_transaction_recovery ", "summary": "Transaction recovery", - "description": "Transaction status is changed from error / expired to pending_anchor(SEP-24) or pending_receiver(SEP-31)", + "description": "Transaction status is changed from error / expired to pending_anchor(SEP-6 or SEP-24) or pending_receiver(SEP-31)", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" }, @@ -2011,6 +2084,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -2022,7 +2096,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/request_customer_info_update.json b/static/assets/rpc-methods/request_customer_info_update.json index 9de98f30f..1c0684970 100644 --- a/static/assets/rpc-methods/request_customer_info_update.json +++ b/static/assets/rpc-methods/request_customer_info_update.json @@ -4,6 +4,9 @@ "description": "Additional customer information is required", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 31" } @@ -24,6 +27,22 @@ "schema": { "type": "string" } + }, + { + "name": "required_customer_info_message", + "description": "Human readable explanation indicating why the SEP-12 information provided by the user is not sufficient to complete the transaction. This field is only relevant for SEP-6 transactions and must be set.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "required_customer_info_updates", + "description": "A list of SEP-9 fields that require updates from the user via SEP-12. This field is only relevant for SEP-6 transactions and must be set.", + "required": false, + "schema": { + "type": "array" + } } ], "result": { @@ -38,10 +57,7 @@ "sep": { "type": "integer", "description": "Protocol of the transaction", - "enum": [ - "24", - "31" - ] + "enum": ["6", "24", "31"] }, "kind": { "type": "string", @@ -50,7 +66,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { @@ -230,4 +248,4 @@ } } } -} \ No newline at end of file +} diff --git a/static/assets/rpc-methods/request_offchain_funds.json b/static/assets/rpc-methods/request_offchain_funds.json index 3c9a67cdd..b8c580a09 100644 --- a/static/assets/rpc-methods/request_offchain_funds.json +++ b/static/assets/rpc-methods/request_offchain_funds.json @@ -4,6 +4,9 @@ "description": "The user has to initiate transfer to the anchor", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -122,6 +125,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -133,7 +137,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/request_onchain_funds.json b/static/assets/rpc-methods/request_onchain_funds.json index 442d683cd..b8a7f2c81 100644 --- a/static/assets/rpc-methods/request_onchain_funds.json +++ b/static/assets/rpc-methods/request_onchain_funds.json @@ -4,6 +4,9 @@ "description": "The user has to initiate transfer to the anchor", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -146,6 +149,7 @@ "type": "integer", "description": "Protocol of the transaction", "enum": [ + "6", "24", "31" ] @@ -157,7 +161,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { diff --git a/static/assets/rpc-methods/request_trust.json b/static/assets/rpc-methods/request_trust.json index 865781a8e..22548d748 100644 --- a/static/assets/rpc-methods/request_trust.json +++ b/static/assets/rpc-methods/request_trust.json @@ -4,6 +4,9 @@ "description": "The user must add a trustline for the asset to complete", "paramStructure": "by-name", "tags": [ + { + "name": "SEP - 6" + }, { "name": "SEP - 24" } @@ -38,10 +41,7 @@ "sep": { "type": "integer", "description": "Protocol of the transaction", - "enum": [ - "24", - "31" - ] + "enum": ["6", "24", "31"] }, "kind": { "type": "string", @@ -50,7 +50,9 @@ "undefined", "receive", "deposit", - "withdrawal" + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" ] }, "status": { @@ -230,4 +232,4 @@ } } } -} \ No newline at end of file +} 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +