diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index d67cbb1f51..0000000000 --- a/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -dist -node_modules -docs -.github -build -/*.js -/*.ts -/*.d.ts -static -.docusaurus \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 109acc3371..0000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - extends: ["@stellar/eslint-config"], - rules: { - "import/no-unresolved": 0, - }, -}; diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..1c5cc736db --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,41 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + day: "sunday" + time: "02:00" + open-pull-requests-limit: 2 + groups: + minor-and-patch: + applies-to: version-updates + update-types: + - "patch" + - "minor" + major: + applies-to: version-updates + update-types: + - "major" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + day: "sunday" + time: "02:00" + open-pull-requests-limit: 2 + groups: + all-actions: + applies-to: version-updates + patterns: [ "*" ] + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "weekly" + day: "sunday" + time: "02:00" + open-pull-requests-limit: 2 + groups: + all-docker: + applies-to: version-updates + patterns: [ "*" ] \ No newline at end of file diff --git a/.github/workflows/copy-workflow.yml b/.github/workflows/copy-workflow.yml new file mode 100644 index 0000000000..3c9e7a0669 --- /dev/null +++ b/.github/workflows/copy-workflow.yml @@ -0,0 +1,74 @@ +name: Crowdin Copy and Create PR + +on: + workflow_dispatch: + # push: + # paths: [ 'docs/**', 'platforms/**','i18n/en/**', 'src/pages/**', 'meeting-notes/**' ] + # branches: [ main ] + +permissions: + contents: write + pull-requests: write + +jobs: + crowdin_copy_and_pr: + runs-on: ubuntu-latest + + steps: + - name: Checkout main branch + uses: actions/checkout@v4 + with: + ref: main + + - name: Merge latest changes from origin/main + run: | + git fetch origin + git checkout main + git merge origin/main + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: yarn install + + - name: Run crowdin:fix + run: yarn run crowdin:fix + + - name: Configure Git + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + + - name: Check for changes + id: changes + run: | + if git diff --quiet; then + echo "changes=false" >> $GITHUB_OUTPUT + else + echo "changes=true" >> $GITHUB_OUTPUT + fi + + - name: Create and push changes to branch + if: steps.changes.outputs.changes == 'true' + run: | + BRANCH_NAME="crowdin-copy-changes" + git push origin --delete $BRANCH_NAME || true + git checkout -b $BRANCH_NAME + git add . + git commit -m "chore: Copy ignored files using crowdin:fix" + git push --force --set-upstream origin $BRANCH_NAME + echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV + + - name: Install GitHub CLI + if: steps.changes.outputs.changes == 'true' + run: sudo apt-get install -y gh + + - name: Create Pull Request + if: steps.changes.outputs.changes == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr create --repo ${{ github.repository }} --base main --head ${{ env.branch_name }} --title "Copy ignored files using crowdin:fix" --body "This PR was created by GitHub Actions to copy ignored files using the crowdin:fix command." diff --git a/.github/workflows/download-workflow.yml b/.github/workflows/download-workflow.yml new file mode 100644 index 0000000000..efd3b92584 --- /dev/null +++ b/.github/workflows/download-workflow.yml @@ -0,0 +1,37 @@ +name: Crowdin Download Action + +on: + workflow_dispatch: + ### Schedule currently disabled ### + # schedule: + # - cron: '0 9 * * *' + # - cron: '0 13 * * *' + # - cron: '0 17 * * *' + +permissions: + contents: write + pull-requests: write + +jobs: + crowdin: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Synchronize with Crowdin + uses: crowdin/github-action@v2 + with: + upload_sources: false + upload_translations: false + download_translations: true + localization_branch_name: l10n_crowdin_translations + + create_pull_request: true + pull_request_title: 'New Crowdin translations' + pull_request_body: 'New Crowdin pull request with translations' + pull_request_base_branch_name: 'main' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: '669532' + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cc432896da..a9c1bde9c4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: Format MDX and Lint on: pull_request: - branches: + branches: - main workflow_dispatch: @@ -13,20 +13,25 @@ jobs: steps: - name: Checkout App Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '16' + node-version: '20' cache: 'yarn' cache-dependency-path: '**/yarn.lock' - name: Install App Dependencies run: yarn --prefer-offline - - name: Format MDX with Prettier + - name: Copy Files From Stellar CLI + run: yarn stellar-cli:build + + - name: Check MDX run: yarn check:mdx - - name: Lint with ESLint - run: yarn lint:fix + - name: Build app + run: yarn build --locale en + + diff --git a/.github/workflows/update-completed-sprint-on-issue-closed.yaml b/.github/workflows/update-completed-sprint-on-issue-closed.yaml new file mode 100644 index 0000000000..003420de56 --- /dev/null +++ b/.github/workflows/update-completed-sprint-on-issue-closed.yaml @@ -0,0 +1,23 @@ +name: Update CompletedSprint on Issue Closed + +on: + issues: + types: [closed] + +jobs: + update-completed-sprint: + runs-on: ubuntu-latest + steps: + - name: Generate token + id: generate_token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.GH_PROJECT_MANAGEMENT_APP_ID }} + private_key: ${{ secrets.GH_PROJECT_MANAGEMENT_APP_PEM }} + - name: Update CompletedSprint on Issue Closed + id: update_completedsprint_on_issue_closed + uses: stellar/actions/update-completed-sprint-on-issue-closed@main + with: + project_name: "Platform Scrum" + field_name: "CompletedSprint" + project_token: ${{ steps.generate_token.outputs.token }} diff --git a/.github/workflows/upload-workflow.yml b/.github/workflows/upload-workflow.yml new file mode 100644 index 0000000000..bfba65eb7b --- /dev/null +++ b/.github/workflows/upload-workflow.yml @@ -0,0 +1,36 @@ +name: Crowdin Upload + +on: + workflow_dispatch: + push: + branches: [ main ] + +jobs: + crowdin-upload: + runs-on: ubuntu-latest + steps: + - name: Checkout Docs Repo + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'yarn' + cache-dependency-path: '**/yarn.lock' + + - name: Install Dependencies + run: yarn --prefer-offline + + - name: Write Translations + run: yarn write-translations + + - name: Crowdin push + uses: crowdin/github-action@v2 + with: + upload_sources: true + upload_translations: false + download_translations: false + env: + CROWDIN_PROJECT_ID: '669532' + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} diff --git a/.gitignore b/.gitignore index 44e68351dd..d5ba0e6d69 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,17 @@ node_modules npm-debug.log* yarn-debug.log* yarn-error.log* + +.idea + +*.info.mdx + +# non-production openrpc.json files +/openrpc/*openrpc.json + +# Environment variables +.env + +# translation files +i18n +stellar-cli-repo diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index d75d26675b..0000000000 --- a/.gitpod.yml +++ /dev/null @@ -1,3 +0,0 @@ -tasks: - - init: yarn install - command: yarn run start diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..75e3805cae --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +G='\033[0;32m' +P='\033[0;35m' +CLEAN='\033[0;0m' + +yarn run check:mdx || (echo -e "${G}Hint:${CLEAN} execute ${P}yarn run format:mdx${CLEAN} to format files" && exit 1) diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..b6f27f1359 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..9a2a0e219c --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..a5fec59937 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +# openapi generated pages +**/*.api.mdx +**/*.tag.mdx diff --git a/Dockerfile b/Dockerfile index 8ae7a96dd4..9537682262 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 as build +FROM ubuntu:24.04 AS build LABEL maintainer="SDF Ops Team " @@ -8,18 +8,28 @@ 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_20.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 COPY . /app/ +ARG CROWDIN_PERSONAL_TOKEN RUN yarn install -RUN yarn build +RUN yarn rpcspec:build +RUN yarn stellar-cli:build +# TODO: This takes a bit of time, we should probably make sure it's only done +# for production builds +# See: https://docusaurus.io/docs/3.4.0/i18n/crowdin#automate-with-ci +RUN CROWDIN_PERSONAL_TOKEN=${CROWDIN_PERSONAL_TOKEN} yarn crowdin:sync +RUN yarn crowdin:fix +# TODO: It's actually this part that is more time-consuming. The best way to +# speed this up is to generate the preview for only `--locale en` +RUN NODE_OPTIONS="--max-old-space-size=4096" yarn build -FROM nginx:1.17 +FROM nginx:1.27 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/LICENSE b/LICENSE index 461d7af537..2bf97548c2 100644 --- a/LICENSE +++ b/LICENSE @@ -187,7 +187,8 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2022 Stellar Development Foundation + Copyright 2014 - 2024 Stellar Development Foundation + Copyright 2014 - 2024 Stellar Open Source Developers Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index 0b53a9434d..d0f21ebab2 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ TAG ?= stellar/stellar-docs:$(LABEL) BUILD_DATE := $(shell date -u +%FT%TZ) docker-build: - $(SUDO) docker build --no-cache --pull --label org.opencontainers.image.created="$(BUILD_DATE)" -t $(TAG) . + $(SUDO) docker build --no-cache --pull --label org.opencontainers.image.created="$(BUILD_DATE)" -t $(TAG) . --build-arg CROWDIN_PERSONAL_TOKEN=${CROWDIN_PERSONAL_TOKEN} docker-push: $(SUDO) docker push $(TAG) diff --git a/README.md b/README.md index 00c2d7b06a..6e6fc526f8 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,28 @@ -# Stellar Documentation and API Reference +# Stellar Documentation and API Reference 🌌 -Welcome to the official home repository for [Documentation][docs] and -[API Reference][api] for the [Stellar Network][stellar]. +Welcome to the official home repository for [Documentation][docs] for the [Stellar network][stellar]. -# Table of Contents +If you're here for the Deep Dive Docs Bounty, please navigate to the bottom of this page for all relevant information: [Deep Dive Docs Bounty](#welcome-to-the-deep-dive-docs-bounty-). + +## Table of Contents - [Contributing](#contributing) - [Quick Start](#quick-start) + - [Prerequisites](#prerequisites) + - [Development](#development) - [Repository Structure](#repository-structure) - [Using Markdown](#using-markdown) - [Markdown Basics](#markdown-basics) - [Custom Markdown](#custom-markdown) - [Alert](#alert) - [Code Example](#code-example) +- [Welcome to the Deep Dive Docs Bounty 🐙!](#welcome-to-the-deep-dive-docs-bounty-) + - [Submission process](#submission-process) + - [What makes a good submission](#what-makes-a-good-submission) +- [Helpful resources](#helpful-resources) +- [Deep Dive Docs Bounty (not currently running) Eligibility Guidelines](#deep-dive-docs-bounty-eligibility-guidelines) -# Contributing +## Contributing Contributions are more than welcome! Thank you! 🎉 @@ -29,10 +37,41 @@ helpful and meaningful way. Markdown is super easy to learn, and will come quite naturally after only a bit of practice. You can always help fix typos, spelling, and broken links, too. -# Quick Start +You can contribute to the docs in several ways: + +- See something that needs to be fixed in the docs, like an error in the code or a typo? File a [pull request (PR)](https://github.com/stellar/stellar-docs/pulls) proposing to correct the error; +- Think there is helpful content missing from the docs, like a specific how-to guide or piece of explanatory content? File an [issue](https://github.com/stellar/stellar-docs/issues) explaining what you’d like to see (be sure to search existing issues to avoid duplication); +- Have an idea that could make the docs better, like a structural change or a new section idea? File an [issue](https://github.com/stellar/stellar-docs/issues) explaining what you’d like to see (these will be added to the Ideas section on the [Dev Docs board](https://github.com/orgs/stellar/projects/56/views/1) for discussion); +- Want to complete an existing issue? Search through the issues to find something to work on! Issues without an assignee and labeled as a “Good First Issue” or with “Help Wanted” are great places to start! Once you’ve selected an issue to work on, file a PR with your proposed fix. + +No matter what you contribute, whether a PR or an issue, you can expect to receive a response from docs maintainers within one week. + +- PRs need to be reviewed and approved before merging. Look for either an approval or a follow-up question. +- Issues will be prioritized, labeled, and assigned (if possible). You can check the status of your issue on the Dev Docs board. The status of issues according to the column is: + - Ideas: these issues are being actively discussed. Ideas will either be discarded or repurposed into an actionable issue and added to the queue within three weeks. + - Backlog: these issues are not prioritized or actively being worked on. + - To Do: these issues are prioritized and will be worked on soon. + - In Progress: these issues are currently being worked on. + - Blocked: these issues are being worked on but are blocked for some reason and need attention. + - Done: these issues have been completed and can be closed. + +If you have questions, feel free to ask in the [Stellar Developer Discord](https://discord.gg/stellardev). + +## Quick Start +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)][codespaces] +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][gitpod] + +### Prerequisites -To begin development on the documentation, you will first need [yarn][yarn] -installed on your system. Once it is, you can run the following commands: +To begin development on the documentation, you will first need to install the following: + +- Node.js (v19, not higher): see https://nodejs.org/en/download/package-manager for details for your system +- npm: e.g. `sudo apt install npm` on Ubuntu +- yarn: `npm install yarn` + +### Development + +Once all the prerequisites have been installed, you can run the following commands: ```bash git clone https://github.com/stellar/stellar-docs @@ -45,15 +84,15 @@ This will begin the development server, and open a browser window/tab pointing to `http://localhost:3000/docs/`. This development server will auto-reload when it detects changes to the repository. -After you've made your changes, please use `prettier` to ensure consistent -formatting throughout the repository: +After you've made your changes, use the following commands to ensure the consistent +MDX file formatting and style across the repository: ```bash npm run check:mdx # this will search for problems in the MDX files npm run format:mdx # this will fix any problems that were found ``` -# Repository Structure +## Repository Structure - `/docs/` Contains all the documentation content. If you're contributing to the actual documentation, rather than site functionality, this is likely where you @@ -86,9 +125,9 @@ npm run format:mdx # this will fix any problems that were found case-by-case basis, and it may be determined that a redirect isn't the right approach in some instances.) -# Using Markdown +## Using Markdown -## Markdown Basics +### Markdown Basics If you're unfamiliar with Markdown, there are **loads** of good tutorials and cheat sheets out there. Check out some of these resources to get a handle on the @@ -98,24 +137,24 @@ basics: - [Interactive markdown tutorial][tutorial] - [The markdown guide][guide] -## Custom Markdown +### Custom Markdown Our repository uses some custom React components that can be used inside the `MDX` documents. Use them as follows: **Make sure that there is an empty line within the wrapper.** For example, -``` +```text -Note: the testnet is reset every three months, so when building on it, make sure you have a plan to recreate necessary accounts and other data. For more info, check out the [best practices for using the testnet](../../fundamentals-and-concepts/testnet-and-pubnet). +Note: the testnet is reset every three months, so when building on it, make sure you have a plan to recreate necessary accounts and other data. For more info, check out the [best practices for using the testnet](../../learn/fundamentals/networks.mdx). ``` -### Alert +#### Alert ![Testnet reset alert](./readme-imgs/alert.png) @@ -132,7 +171,7 @@ Note: the testnet is reset every three months, so when building on it, make sure ``` -### Code Example +#### Code Example ![Create account code example](./readme-imgs/code-example.png) @@ -200,6 +239,8 @@ const CODE_LANGS = { }; ``` +**Remember that this is a community; we build together! 💪 Our code of conduct is [here](https://www.stellar.org/community/code-of-conduct) and our Privacy Policy is [here](https://www.stellar.org/privacy-policy).** + [docs]: https://developers.stellar.org/docs [api]: https://developers.stellar.org/api [stellar]: https://stellar.org @@ -207,9 +248,10 @@ const CODE_LANGS = { [coc]: https://github.com/stellar/.github/blob/master/CODE_OF_CONDUCT.md [docusaurus]: https://docusaurus.io [mdx]: https://mdxjs.com -[yarn]: https://yarnpkg.com/ [commonmark]: https://commonmark.org/help/ [tutorial]: https://www.markdowntutorial.com/ [guide]: https://www.markdownguide.org/ [alert-example]: https://developers.stellar.org/docs/anchoring-assets/enabling-cross-border-payments/setting-up-test-server -[prism]: https://github.com/FormidableLabs/prism-react-renderer \ No newline at end of file +[prism]: https://github.com/FormidableLabs/prism-react-renderer +[codespaces]: https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=521307729&machine=basicLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=EastUs +[gitpod]: https://gitpod.io/#https://github.com/stellar/stellar-docs diff --git a/ap_versioned_docs/version-2.10/README.mdx b/ap_versioned_docs/version-2.10/README.mdx new file mode 100644 index 0000000000..6f5587ec14 --- /dev/null +++ b/ap_versioned_docs/version-2.10/README.mdx @@ -0,0 +1,12 @@ +--- +title: Anchor Platform Introduction +sidebar_position: 10 +--- + +# Anchor Platform + +The Anchor Platform is a set of tools and APIs that enable developers and businesses to build their own on and off-ramp services for the Stellar network. It provides a standardized interface, including the implementation of several Stellar Ecosystem Proposals (SEPs), to make it easy for businesses to integrate with Stellar-based wallets and exchanges. + +The platform also includes features for managing assets, transactions, and user accounts, and supports a variety of deployment options, including using Docker or Kubernetes. Overall, the Anchor Platform aims to simplify the process of building and managing a Stellar-based financial service, allowing businesses to focus on providing value to their customers. + +Learn about integrating with the Anchor Platform in the [Admin Guide](./admin-guide/README.mdx) or get API information in the [API Reference](./api-reference/README.mdx). diff --git a/ap_versioned_docs/version-2.10/admin-guide/README.mdx b/ap_versioned_docs/version-2.10/admin-guide/README.mdx new file mode 100644 index 0000000000..d955ccbfc7 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/README.mdx @@ -0,0 +1,10 @@ +--- +title: Admin Guide +sidebar_position: 10 +--- + +import DocCardList from "@theme/DocCardList"; + +All you need to know about setting up, running, and using the Anchor Platform. + + diff --git a/ap_versioned_docs/version-2.10/admin-guide/architecture.mdx b/ap_versioned_docs/version-2.10/admin-guide/architecture.mdx new file mode 100644 index 0000000000..d9abf6435c --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/architecture.mdx @@ -0,0 +1,69 @@ +--- +title: "Architecture" +sidebar_position: 20 +--- + +## Architecture + +Before starting with the Anchor Platform, let's get familiar with the architecture. This section will describe the components involved and how they interact. + +### Fundamental Architecture + +The following architectural components are required for all deployments of the Anchor Platform. + +[![fundamental anchor platform architecture](../assets/anchor-platform-architecture-1.png)](../assets/anchor-platform-architecture-1.png) + +#### Client + +The client is an application, such as a wallet or remittance sender, that acts on behalf of a user and makes requests to the system. Clients make requests to the SEP server component of the Anchor Platform using sets of standards called [SEPs][seps] (Stellar Ecosystem Proposals). + +#### SEP Server + +The SEP server is a client-facing server and therefore needs to be accessible from an external network. The SEP server processes user requests and manages the state of transactions they initiate. When the SEP server needs to provide information it doesn't have to the client, such as the exchange rate for an asset pair or the KYC status of a customer, it makes synchronous [callback][callback-api] requests to the business server and returns the information in a SEP-compliant format. + +:::note + +The SEP server will never store any sensitive information, such as KYC (PII), in the database. + +::: + +#### Business Server + +The business server is a service that you (the business) must implement to connect the Anchor Platform with your internal systems. The business server responds to callback requests sent by the SEP server, such as requests for a quote, receives events sent by event service, such as notification of a received payment to your Stellar account, and provides updates to the platform server when off-chain events occur, such as the initiation of a bank transfer to a customer. + +#### Platform Server + +The platform server is an internal component. It should be hosted in a private network and should not be accessible from the Internet. This server enables the business to fetch and update the state of transactions using its [API][platform-api]. + +#### Database + +The Anchor Platform uses a PostgreSQL database to store Stellar events and entities. It is primary used to store transactions. + +### Complete Architecture + +In addition to the components described above, the Anchor Platform includes several other components that offer additional functionality. Your business can chose to which of the additional components to use, but the diagram below visualizes the architecture of the system if all components are utilized. + +[![complete anchor platform architecture](../assets/anchor-platform-architecture-2.png)](../assets/anchor-platform-architecture-2.png) + +#### Event Service + +The event service enables the Anchor Platform to send HTTP webhooks to registered clients and your business server when the state of transactions change, removing the need for clients and/or your business server to poll the Anchor Platform's APIs. It works by reading events from published to a Kafka topic by the other Anchor Platform components. [Read more][events] about using the event service. + +#### Custody Server + +The custody server connects to enterprise wallet providers, such as Fireblocks, to send and receive payments for transactions initiated via the Anchor Platform. This service is an alternative to the Stellar Observer for businesses who use one of the supported providers. In addition to the functionality offered by the Stellar Observer, the Custody Server can also facilitate outbound payments to client's Stellar accounts. If you also use the [events] service, payments to your accounts will trigger a HTTP callback made to your business server. + +If you already have an integration with your wallet provider, then this component is not required, although your business server will need to notify the Anchor Platform when a payment associated with an Anchor Platform transaction was sent to or from your Stellar accounts via the [Platform API][platform-api]. + +Currently the only supported provider is Fireblocks. + +#### Stellar Observer + +The Stellar observer, an alternative to the custody server pictured above, monitors the Stellar blockchain using Horizon, automatically detects user payments sent to the business, and updates the corresponding transactions in the Anchor Platform's database. If you also use the [events] service, payments to your accounts will trigger a HTTP callback made to your business server. + +If you already have a solution for monitor payments to your Stellar accounts, such as an integration with your exchange, Horizon, or RPC, then this component is not required, although your business server will need to notify the Anchor Platform when a payment associated with an Anchor Platform transaction was made to your one of your Stellar accounts via the [Platform API][platform-api]. + +[seps]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/README.md +[platform-api]: ../api-reference/platform/transactions/README.mdx +[callback-api]: ../api-reference/callbacks/README.mdx +[events]: ./events/README.mdx diff --git a/ap_versioned_docs/version-2.10/admin-guide/component/observer/observer.mdx b/ap_versioned_docs/version-2.10/admin-guide/component/observer/observer.mdx new file mode 100644 index 0000000000..133ac576f2 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/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](../../getting-started.mdx#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](#funds-received-1) 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]: ../../custody-services/fireblocks/README.mdx diff --git a/ap_versioned_docs/version-2.10/admin-guide/component/rpc/error.mdx b/ap_versioned_docs/version-2.10/admin-guide/component/rpc/error.mdx new file mode 100644 index 0000000000..27746e6f0e --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/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/ap_versioned_docs/version-2.10/admin-guide/component/rpc/request.mdx b/ap_versioned_docs/version-2.10/admin-guide/component/rpc/request.mdx new file mode 100644 index 0000000000..9157143afc --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/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/ap_versioned_docs/version-2.10/admin-guide/component/rpc/response.mdx b/ap_versioned_docs/version-2.10/admin-guide/component/rpc/response.mdx new file mode 100644 index 0000000000..02d8081034 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/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/ap_versioned_docs/version-2.10/admin-guide/component/rpc/rpc.mdx b/ap_versioned_docs/version-2.10/admin-guide/component/rpc/rpc.mdx new file mode 100644 index 0000000000..f00b8ee7f5 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/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/ap_versioned_docs/version-2.10/admin-guide/component/security/api_key.mdx b/ap_versioned_docs/version-2.10/admin-guide/component/security/api_key.mdx new file mode 100644 index 0000000000..c994a59941 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/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" +``` + + + +Once enabled, all requests must include a valid `X-Api-Key` header, set to the configured API key. diff --git a/ap_versioned_docs/version-2.10/admin-guide/component/security/jwt.mdx b/ap_versioned_docs/version-2.10/admin-guide/component/security/jwt.mdx new file mode 100644 index 0000000000..50153090a4 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/component/security/jwt.mdx @@ -0,0 +1,16 @@ +To enable JWT authentication, modify your `dev.env` file: + + + +```bash +# dev.env +PLATFORM_SERVER_AUTH_TYPE=jwt +# Will be used to sign the JWT token +SECRET_PLATFORM_API_AUTH_SECRET="your secret that business server will use" +``` + + + +Anchor Platform uses the HMAC SHA-256 (HS256) algorithm to sign JWT tokens. Ensure that `SECRET_PLATFORM_API_AUTH_SECRET` is at least 32 characters long for security. + +Once enabled, all requests must include a valid `Authorization` header with the format `Bearer `. diff --git a/ap_versioned_docs/version-2.10/admin-guide/component/security/security.mdx b/ap_versioned_docs/version-2.10/admin-guide/component/security/security.mdx new file mode 100644 index 0000000000..76a3832c30 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/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/ap_versioned_docs/version-2.10/admin-guide/custody-services/README.mdx b/ap_versioned_docs/version-2.10/admin-guide/custody-services/README.mdx new file mode 100644 index 0000000000..5556776d58 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/custody-services/README.mdx @@ -0,0 +1,10 @@ +--- +title: Custody Services +sidebar_position: 80 +--- + +import DocCardList from "@theme/DocCardList"; + +Using a custody service will allow you to use an outside service to store and manage your wallets. + + diff --git a/ap_versioned_docs/version-2.10/admin-guide/custody-services/configuration.mdx b/ap_versioned_docs/version-2.10/admin-guide/custody-services/configuration.mdx new file mode 100644 index 0000000000..c6dd3abfb9 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/custody-services/configuration.mdx @@ -0,0 +1,130 @@ +--- +title: Configuration +sidebar_position: 10 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Custody Server Configuration + +If you want to use an external custody service to store and manage your wallets, then you need to deploy one more service - the Custody Server. + +This service also needs the `STELLAR_ANCHOR_CONFIG` that was previously mentioned. By default, the `anchor-config-default-values.yaml` config file will be used. + +Also, now you don't need to deploy the Stellar Observer since the Custody Server will be responsible for its functionality. + +Update the configuration file of the Anchor Platform with the base URL and port. + + + +```yaml +custody_server: + # The listening port of the Custody Server. + # Default value: 8086 + port: 8086 + # The base URL of the Custody Server. + # Default value: http://localhost:8086 + base_url: http://localhost:8086 +``` + + + +Configure authentication type. + + + +```yaml +custody_server: + auth: + # Type of authentication that is used when the Anchor Platform communicates with the Custody Server. + # Supported values: [none, api_key, jwt] + # Default value: none + type: none +``` + + + +If you set the `api_key` or `jwt` authentication type, then you need to add an environment variable. + + + +```bash +# dev.env +SECRET_CUSTODY_SERVER_AUTH_SECRET="Custody Server auth secret" +``` + + + +Start the Custody Server using Gradle or Docker. + + + +```bash +./gradlew service-runner:bootRun --args=--custody-server +docker run stellar/anchor-platform:2.10.0 --custody-server +``` + + + +## Anchor Platform Configuration + +Update the configuration file of the Anchor Platform with the deposit info generator type for SEP-24 and SEP-31. Also, you need to configure a trustline check, if you use JSON-RPC. + + + +```yaml +sep24: + # Used to choose how the SEP-24 deposit information (deposit address, memo and memo type) will be generated + # Supported value: [self, custody, none] + # Default value: self + deposit_info_generator_type: custody +sep31: + # Used to choose how the SEP-31 deposit information (deposit address, memo and memo type) will be generated + # Supported value: [self, custody, api] + # Default value: self + deposit_info_generator_type: custody + ## Trustline check configuration. Used only when custody integration is enabled +custody: + trustline: + ## @param: checkCronExpression + ## @type: string + ## Cron expression which defines how often a trustline check job runs. By default, a job runs every minute + # + check_cron_expression: "0 * * * * *" + ## @param: checkDuration + ## @type: integer + ## Determines how long (in MINUTES) the trustline will be checked. By default - 1 hour (60 minutes) + # + check_duration: 60 + ## @param: checkTimeoutMessage + ## @type: string + ## The message that will be added to the SEP transaction after the duration check is exceeded + # + check_timeout_message: Trustline check timed out +``` + + + +:::info + +- `self` - memo and memo type are generated in the local code, and the distribution account is used for the deposit address. +- `custody` - memo and memo type are generated through Custody API, for example Fireblocks, as well as the deposit address. +- `none` - deposit address, memo, and memo type should be provided by the business in a PATCH/JSON-RPC request. +- `api` - memo and memo type are generated through calling the anchor's GET /unique_address endpoint. + +::: + +## Kotlin Reference Server Configuration + +Update the configuration file of the Kotlin Reference Server to enable custody integration. + + + +```yaml +app: + # Flag that indicates that the custody integration is enabled and the payment will be submitted using the Custody Server. + # Default value: false + custodyEnabled: true +``` + + diff --git a/ap_versioned_docs/version-2.10/admin-guide/custody-services/fireblocks/README.mdx b/ap_versioned_docs/version-2.10/admin-guide/custody-services/fireblocks/README.mdx new file mode 100644 index 0000000000..43e037461e --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/custody-services/fireblocks/README.mdx @@ -0,0 +1,10 @@ +--- +title: Fireblocks +sidebar_position: 20 +--- + +import DocCardList from "@theme/DocCardList"; + +Configure [Fireblocks](https://fireblocks.io) to act as a custody service that stores and manages your wallets. + + diff --git a/ap_versioned_docs/version-2.10/admin-guide/custody-services/fireblocks/configuration.mdx b/ap_versioned_docs/version-2.10/admin-guide/custody-services/fireblocks/configuration.mdx new file mode 100644 index 0000000000..0df4d0761d --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/custody-services/fireblocks/configuration.mdx @@ -0,0 +1,68 @@ +--- +title: "Configuration" +sidebar_position: 10 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Configure Fireblocks workspace: + +1. [Configure API Co-Signer](https://support.fireblocks.io/hc/en-us/articles/4581830426268) +2. [Add API User](https://support.fireblocks.io/hc/en-us/articles/4407823826194-Adding-new-API-users) +3. [Configure Webhook URL](https://support.fireblocks.io/hc/en-us/articles/4408110107794-Configuring-Webhook-URLs) +4. [Enable One-Time Address feature](https://support.fireblocks.io/hc/en-us/articles/4409104568338) + +Update the configuration file of the Custody Server. + + + +```yaml +custody: + # Default value: none + type: fireblocks + fireblocks: + # The base URL of the Fireblocks API + # Default value: https://api.fireblocks.io + base_url: https://api.fireblocks.io + # ID of Fireblocks vault account that will be used for payments + vault_account_id: "vault_account_id" + # Fireblocks public key that is used to verify a webhook signature + public_key: "public_key" + # Mappings of fireblocks asset codes to stellar asset codes. For example: + # XLM_USDC_T_CEKS stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + # XLM_TEST stellar:native + # Codes should be separated with a space and each pair of codes should be on a new line + asset_mappings: "asset_mappings" + reconciliation: + # Cron expression which defines how often the transaction reconciliation job runs. + # By default, job runs every 15 minutes. + # Default value: 0 0/15 * * * * + cron_expression: "0 0/15 * * * *" + # Determines how many times the transaction reconciliation job will attempt to update the status of the + # transaction before marking it as failed. + # Default value: 10 + max_attempts: 10 + retry_config: + # Determines how many times the Fireblocks client will attempt to send a request before marking a call as failed. + # Default value: 3 + max_attempts: 3 + # Interval between Fireblocks client call attempts (in ms) + # Default value: 1000 + delay: 1000 +``` + + + +Add the environment variables. + + + +```bash +# dev.env +# API key, that will be added to JWT token claims. JWT token will be sent in requests to Fireblocks API +SECRET_CUSTODY_FIREBLOCKS_API_KEY="Fireblocks API key" +# Secret key, that is used to sign JWT token +SECRET_CUSTODY_FIREBLOCKS_SECRET_KEY="Fireblocks secret key" +``` + + diff --git a/ap_versioned_docs/version-2.10/admin-guide/custody-services/fireblocks/example.mdx b/ap_versioned_docs/version-2.10/admin-guide/custody-services/fireblocks/example.mdx new file mode 100644 index 0000000000..613d31bca2 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/custody-services/fireblocks/example.mdx @@ -0,0 +1,50 @@ +--- +title: "Example" +sidebar_position: 10 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +[comment]: # "Sequence diagram definitions are located in /static/definitions folder" +[comment]: # "To updated them, use https://sequencediagram.org" + +### SEP-24 deposit flow with webhook: + +- request_offchain_funds +- notify_offchain_funds_received +- do_stellar_payment +- notify_onchain_funds_sent [![sequence_diagram_sep24_deposit_webhook](../../../assets/sequence_diagram_sep24_deposit_webhook.png)](../../../assets/sequence_diagram_sep24_deposit_webhook.png) +
+ +### SEP-24 deposit flow with reconciliation job: + +- request_offchain_funds +- notify_offchain_funds_received +- do_stellar_payment +- notify_onchain_funds_sent [![sequence_diagram_sep24_deposit_job](../../../assets/sequence_diagram_sep24_deposit_job.png)](../../../assets/sequence_diagram_sep24_deposit_job.png) +
+ +### SEP-24 withdrawal flow with webhook: + +- do_stellar_payment +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep24_withdrawal_webhook](../../../assets/sequence_diagram_sep24_withdrawal_webhook.png)](../../../assets/sequence_diagram_sep24_withdrawal_webhook.png) +
+ +### SEP-24 withdrawal flow with reconciliation job: + +- request_onchain_funds +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep24_withdrawal_job](../../../assets/sequence_diagram_sep24_withdrawal_job.png)](../../../assets/sequence_diagram_sep24_withdrawal_job.png) +
+ +### SEP-31 receive flow with webhook: + +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep31_receive_webhook](../../../assets/sequence_diagram_sep31_receive_webhook.png)](../../../assets/sequence_diagram_sep31_receive_webhook.png) +
+ +### SEP-31 receive flow with reconciliation job: + +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep31_receive_job](../../../assets/sequence_diagram_sep31_receive_job.png)](../../../assets/sequence_diagram_sep31_receive_job.png) diff --git a/ap_versioned_docs/version-2.10/admin-guide/events/README.mdx b/ap_versioned_docs/version-2.10/admin-guide/events/README.mdx new file mode 100644 index 0000000000..43cc58bd93 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/events/README.mdx @@ -0,0 +1,10 @@ +--- +title: Event Handling +sidebar_position: 85 +--- + +import DocCardList from "@theme/DocCardList"; + +Receive transaction updates through HTTP webhook events. + + diff --git a/ap_versioned_docs/version-2.10/admin-guide/events/delivery.mdx b/ap_versioned_docs/version-2.10/admin-guide/events/delivery.mdx new file mode 100644 index 0000000000..cd6d3148e2 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/events/delivery.mdx @@ -0,0 +1,30 @@ +--- +title: "Delivery Guarantees" +sidebar_position: 30 +--- + +## Delivery Guarantees + +Depending on the messaging system you use, there will be different delivery guarantees. the event service uses Kafka as the messaging system, so the delivery guarantees will depend on the producer configuration and the broker configuration that you use. Depending on the number of partitions configured for the `TRANSACTION` topic, the events may be delivered out of order. + +:::caution + +Any transaction logic that depends on the order should use the transaction `status` and the `updated_at` fields to determine the order of the events. + +::: + +Next subsections will describe the delivery guarantees from the client and the business server perspective. + +### Client Delivery Guarantees + +For each client, the event service will attempt to deliver each event up to three times with an exponential backoff. If the event is not delivered after three attempts due to HTTP 4xx or 5xx errors, the event will be skipped. If the client is not reachable after three attempts, the event service will no longer attempt to deliver any events to that client. + +### Business Server Delivery Guarantees + +The event service will attempt to deliver each event to the businesss server up to three times with an exponential backoff. If the event is not delivered after three attempts due to HTTP 4xx or 5xx errors, the event will be skipped. If the business server is not reachable after three attempts, the event service will no longer attempt to deliver any events to the business server. + +:::note + +The business server delivery guarantees are the same as the client delivery guarantees. In the future, the event service will skip the events that are not delivered to clients that are not reachable. + +::: diff --git a/ap_versioned_docs/version-2.10/admin-guide/events/getting-started.mdx b/ap_versioned_docs/version-2.10/admin-guide/events/getting-started.mdx new file mode 100644 index 0000000000..d7c3a3832a --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/events/getting-started.mdx @@ -0,0 +1,8 @@ +--- +title: Getting Started +sidebar_position: 10 +--- + +Anchor Platform provides an event service that allows your business application and client applications such as wallets to receive updates about transaction updates via HTTP webhooks without the need to poll the transactions API. + +By integrating with the event service, you or your clients will be able to receive updates about the status of transactions, including when they are submitted, completed, and failed as well as any quotes created. diff --git a/ap_versioned_docs/version-2.10/admin-guide/events/integration.mdx b/ap_versioned_docs/version-2.10/admin-guide/events/integration.mdx new file mode 100644 index 0000000000..e716f33449 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/events/integration.mdx @@ -0,0 +1,166 @@ +--- +title: "Integration" +sidebar_position: 20 +--- + +This guide will walk you through integrating with the event service to start receiving events. The event service currently only supports Apache Kafka as the backend message broker. + +It assumes familiarity with Kafka and will not cover how to set up a Kafka cluster. + +## Requirements + +Anchor Platform will send events to the `TRANSACTION` Kafka topic. The event service will consume events from this topic and send them to the appropriate endpoints. + +## Configuration + +First, the event service's Kafka producer need to be configured using the `event.queue` section of the configuration file or setting the environment variables. The following is the set of required environment variables needed to configure the event service's Kafka producer: + + + +```bash +# dev.env +EVENTS_ENABLED=true +EVENTS_QUEUE_TYPE=kafka +EVENTS_QUEUE_KAFKA_BOOTSTRAP_SERVER=localhost:9092 +``` + +```yaml +# dev.services.yaml +events: + enabled: true + queue: + type: kafka + kafka: + bootstrap_server: localhost:9092 +``` + + + +Anchor Platform allows a subset of the Kafka producer's client configuration to be set. See the [default values file][default-values-file] for more information what is available. For more information on the Kafka producer's client configuration, see the [Kafka documentation](https://kafka.apache.org/documentation/#producerconfigs). + +Next, the event processor needs to be configured in the `event_processor` section of the Anchor Platform Configuration file or setting the environment variables. + + + +```bash +# dev.env +EVENT_PROCESSOR_CLIENT_STATUS_CALLBACK_ENABLED=true +EVENT_PROCESSOR_CALLBACK_API_REQUEST_ENABLED=true +``` + +```yaml +# dev.services.yaml +event_processor: + client_status_callback: + enabled: true + callback_api_request: + enabled: true +``` + + + +This will enable the event processor to start processing events from `TRANSACTION` topic. In this example, the event processor will send events to client and business server callback endpoints. + +## Receiving Events + +The event service can be used to send events to client and business server callback endpoints. The event service will send events to these endpoints as HTTP POST requests with the event data in the request body. + +### As a Client Application + +Client applications can receive updates whenever the `status` of a SEP transaction changes. + +To receive events as a client application, you will need to expose a callback URL that the event service can send events to. The event service will send a POST request to this endpoint with the event data in the request body. + +Anchor Platform will only send events to clients listed in the client configuration. See the [client configuration documentation][clients-config] for more information. + +#### Callback Signing + +Anchor Platform signs the callback requests it sends to client applications. The signature is included in the `Signature` header of the request. The callback URL signature specification can be found in the corresponding SEP protocol specifications. + +- [SEP-0006](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md#url-callback-signature) +- [SEP-0024](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#url-callback-signature) +- [SEP-0031](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md#url-callback-signature) + +### As a Business Server + +In addition to SEP transaction status updates, business servers can receive events about SEP-31 quote creation or SEP-12 customer information updates. The schema of the event data will depend on the type of event being sent. Visit the [Event API documentation](../../api-reference/callbacks/post-event.api.mdx) for more information about the schema of the event data. + +To receive events as a business server, you will need to expose a callback URL that the event service can send events to. The event service will send a POST request to this endpoint with the event data in the request body. + +#### Configuration + +The event service's callback API can be configured using the `callback_api` section of the Anchor Platform configuration file or setting the environment variables. + +:::caution + +The `--event-processor` will ignore any path segments specified in `callback_api.base_url` and will instead send events to `[scheme]://[host]:[port]/event`. This is a bug, but in order not to disrupt those using the event processor, we will defer the fix of including path segments in version 3 of the Anchor Platform. + +::: + +The following is an example of how to configure the event service's callback API with JWT authentication: + + + +```bash +# dev.env + +# note `/callback` will not be used for event callbacks +# instead events will be sent to `http://localhost:8081/event` +# all other callbacks (rates, customer, etc.) will use the provided `/callback` root path +CALLBACK_API_BASE_URL=http://localhost:8081/callback +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +CALLBACK_API_AUTH_JWT_HTTP_HEADER=Authorization +SECRET_CALLBACK_API_AUTH_SECRET="a secret for signing jwts" +``` + +```yaml +# dev.services.yaml +callback_api: + base_url: http://localhost:8081/callback + auth: + type: jwt + jwt: + expiration_milliseconds: 30000 + http_header: Authorization +``` + + + +The following is an example of how to configure the event service's callback API with API key authentication: + + + +```bash +# dev.env +CALLBACK_API_BASE_URL=http://localhost:8081/callback +CALLBACK_API_AUTH_TYPE=api_key +CALLBACK_API_AUTH_API_KEY_HTTP_HEADER=X-Api-Key +SECRET_CALLBACK_API_AUTH_SECRET="your API key" +``` + +```yaml +# dev.services.yaml +callback_api: + base_url: http://localhost:8081/callback + auth: + type: api_key + api_key: + http_header: X-Api-Key +``` + + + +This configures the event service's callback API that will be used to send events to client and business server callback endpoints. The following are the supported configuration options: + +- `base_url`: The base URL of the business server's callback endpoint. +- `secret`: The secret to be used when sending events to the business server's callback endpoint. This is used to sign the request body when JWT authentication is enabled and it is the API key when API key authentication is enabled. +- `auth`: The authentication method to be used when sending events to the business server's callback endpoint. The following are the supported authentication methods: + - `JWT`: The event service will send a JSON Web Token (JWT) in the `Authorization` header of the request. The following are the supported configuration options: + - `expiration_milliseconds`: The expiration time of the JWT in milliseconds. + - `http_header`: The header in which the JWT will be sent. + - `API_KEY`: The event service will send an API key in the `Authorization` header of the request. The following are the supported configuration options: + - `http_header`: The header in which the API key will be sent. + +[default-values-file]: https://github.com/stellar/java-stellar-anchor-sdk/blob/develop/platform/src/main/resources/config/anchor-config-default-values.yaml +[clients-config]: ../../admin-guide/sep10/README.mdx#config-with-client-attribution diff --git a/ap_versioned_docs/version-2.10/admin-guide/getting-started.mdx b/ap_versioned_docs/version-2.10/admin-guide/getting-started.mdx new file mode 100644 index 0000000000..ebaccada2d --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/getting-started.mdx @@ -0,0 +1,384 @@ +--- +title: "Getting Started" +sidebar_position: 30 +--- + +## Installation + +import { CodeExample } from "@site/src/components/CodeExample"; + +The easiest way to install the Anchor Platform is to pull the [docker image][anchor-platform-image]. + + + +```bash +docker pull stellar/anchor-platform:2.10.0 +``` + + + +## Set Up the Development Environment + +In this guide we'll use [docker compose][docker-compose] for simplicity, but you can run the Anchor Platform using other tools that support docker as well, such as [minikube] or a full-blown [kubernetes] cluster. + +Let's create a minimal compose file to get started. + + + +```yaml +# docker-compose.yml +services: + sep-server: + image: stellar/anchor-platform:2.10.0 + command: --sep-server + ports: + - "8080:8080" + env_file: + - ./dev.env + volumes: + - ./config:/home + platform-server: + image: stellar/anchor-platform:2.10.0 + command: --platform-server + ports: + - "8085:8085" + env_file: + - ./dev.env + volumes: + - ./config:/home +``` + + + +The `--sep-server` option tells the Anchor Platform to make the API endpoints defined by the SEPs you've enabled via configuration available on port 8080. + +The `--platform-sever` option makes the Platform API available, which is the backend API your service(s) will use to communicate with the Anchor Platform. It will be available on port 8085 + +## Configuration + +The Anchor Platform supports two approaches for configuration: + +- using environment variables +- using a YAML configuration file + +One or a combination of both approaches can be used. Nested variables in the YAML file are expressed using underscores or dots (`_`, `.`) when using environment variables. We'll demonstrate both approaches here, but use enviroment variables exclusively in subsequent sections. See the full set of configuration options in the Anchor Platform's [default values file][ap-default-values]. + +:::info + +The Anchor Platform does not allow application secrets in the YAML configuration file. Instead, application secrets, which all have the `SECRET_` prefix, must be specified in the environment. + +::: + +Lets create the environment file specified in our docker compose file. + + + +```bash +touch dev.env +``` + + + +And if you're using a YAML configuration file, lets create that too. + + + +```bash +mkdir config +touch config/dev.services.yaml +``` + + + +You'll need to inform the Anchor Platform where it can find your config file. So lets add an environment variable for that. + + + +```bash +# dev.env +STELLAR_ANCHOR_CONFIG=/home/dev.services.yaml +``` + + + +Specify the configuration schema version in your YAML file. + + + +```yaml +# dev.services.yaml +version: 1 +``` + + + +### Changing Port of the Platform Server + +For example, let's change port of the platform server. + +Using environment variables, this is simply: + + + +```bash +# dev.env +PLATFORM_SERVER_PORT=8085 +``` + + + +Or if using YAML configuration: + + + +```yaml +# dev.services.yaml +platform_server: + port: 8085 +``` + + + +### Specify Your Service's Assets + +Lets add the assets your Anchor Platform deployment will utilize. This configuration is specified in a YAML file. If you're only using the Anchor Platform for hosting a SEP-1 stellar.toml file or for running SEP-10 Stellar Authentication, you can skip this step. + + + +```bash +touch config/dev.assets.yaml +``` + + + +In this guide we'll build anchor services for Circle's USDC on Stellar's test network. Update the above values based on the assets you'll be issuing. Make sure to specify the testnet `issuer` in your development file, and create your own `distribution_account` using a tool like [Stellar Lab][stellar-lab]. The `distribution_account` will be used by your clients as the destination account for payments to your service. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 +``` + + + +This file needs to be referenced in our configuration so the Anchor Platform can find it. + +Using environment variables: + + + +```bash +# dev.env +ASSETS_TYPE=file +ASSETS_VALUE=/home/dev.assets.yaml +``` + + + +Using a YAML file: + + + +```yaml +# dev.services.yaml +assets: + type: file + value: /home/dev.assets.yaml +``` + + + +### Add Data Persistence + +The Anchor Platform supports [PostgreSQL][postgresql] and [Aurora PostgreSQL][aurora-postgresql] for use in production, but also supports [H2][h2] or [SQLite][sqlite] for use in development. For managing migrations, the Anchor Platform uses [Flyway][flyway]. The latest version of PostgreSQL supported by Flyway is PostgreSQL 14. + +Before we move forward, let's add a database to our development environment so the transactions we initiate persist after stopping the service. + +A database is only needed if using the Anchor Platform to facilitate transactions. + + + +```yaml +# docker-compose.yml +version: "3.8" +services: + sep-server: + image: stellar/anchor-platform:2.10.0 + command: --sep-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8080:8080" + depends_on: + - db + platform-server: + image: stellar/anchor-platform:2.10.0 + command: --platform-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8085:8085" + depends_on: + - db + db: + image: postgres:14 + ports: + - "5432:5432" + env_file: + - ./dev.env + volumes: + - ./init.sql:/docker-entrypoint-initdb.d/init.sql +``` + + + +Now let's update our environment so the platform server can connect to the database server. + + + +```bash +# dev.env +DATA_TYPE=postgres +DATA_SERVER=db +DATA_DATABASE=platform +DATA_FLYWAY_ENABLED=true + +SECRET_DATA_USERNAME=postgres +SECRET_DATA_PASSWORD=password + +POSTGRES_USER=postgres +POSTGRES_PASSWORD=password +``` + + + +If you're using YAML configuration instead, the `POSTGRES_` environment variables should always be in the environment, as they're for your database server, not the Anchor Platform. The secrets must also be specified in environment. + + + +```yaml +# dev.services.yaml +data: + type: postgres + server: db + database: platform + flyway_enabled: true +``` + + + +We have to create the `platform` database before the platform server can connect to it, so let's make a script to create our database. + + + +```bash +touch init.sql +``` + + + + + +```sql +-- init.sql +CREATE DATABASE platform; +``` + + + +Try to run the platform server in addition to the database. + + + +```bash +docker compose up +``` + + + +You should see the logs reporting a successful connection to the postgres database. + +### Configure Platform API Authentication + +To facilitate cross-border payments or deposit & withdrawal transactions, your business will need to fetch and update transaction records from the Anchor Platform's internal API. Currently, the `--sep-server` option makes public SEP APIs, while internal Platform API available on the Platform server, started by `--platform-server` option. Business should make Platform Server accessible only in the internal network, however it's possible to add authentication for accessing the internal Platform API. + +Add the following environment variables. + + + +```bash +# dev.env +PLATFORM_API_BASE_URL=http://platform-server:8085 +PLATFORM_API_AUTH_TYPE=jwt +SECRET_PLATFORM_API_AUTH_SECRET=[your jwt encryption key] +``` + + + +When making requests to the Platform API, add a JWT signed by the secret defined in your environment to the `Authorization` header as a bearer token. + +`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:2.10.0 + 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 +[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://lab.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 diff --git a/ap_versioned_docs/version-2.10/admin-guide/overview.mdx b/ap_versioned_docs/version-2.10/admin-guide/overview.mdx new file mode 100644 index 0000000000..6972fa3b25 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/overview.mdx @@ -0,0 +1,36 @@ +--- +title: "Overview" +sidebar_position: 10 +--- + +The Anchor Platform is the easiest and fastest way to deploy [anchor services](/docs/learn/fundamentals/anchors) compatible with [Stellar Ecosystem Proposals (SEPs)](https://github.com/stellar/stellar-protocol/tree/master/ecosystem). + +The goal of the Anchor Platform is to handle all Stellar-specific functionality and requirements for running an anchor, allowing businesses to focus on the core business logic necessary to provide these services. + +The Anchor Platform accomplishes this by implementing the ecosystem's standardized APIs (SEPs) for wallets, exchanges, and other applications to consume, while offering a set of backend APIs for businesses to provide information specific to them, such as transaction fees, exchange rates, and off-chain transaction statuses. + +Below is a list of SEPs currently supported: + +- [SEP-1][sep-1]: [Stellar Info File][sep1-ap] +- [SEP-6][sep-6]: [Programmatic Deposit and Withdrawal][sep6-ap] +- [SEP-10][sep-10]: [Stellar Authentication][sep10-ap] +- [SEP-12][sep-12]: KYC API +- [SEP-24][sep-24]: [Hosted Deposit and Withdrawal][sep24-ap] +- [SEP-31][sep-31]: [Cross-Border Payments API][sep31-ap] +- [SEP-38][sep-38]: Anchor RFQ API + +The documentation for the Anchor Platform is a work in progress. Developers are welcome to dive into the code and existing documentation on the [GitHub repository][anchor-platform-github], or if you're looking to build an on & off-ramp service compatible with SEP-24, see our [getting started guide][sep24-ap]. + +[sep-1]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md +[sep-6]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md +[sep-10]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md +[sep-12]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md +[sep-24]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md +[sep-31]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md +[sep-38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md +[anchor-platform-github]: https://github.com/stellar/java-stellar-anchor-sdk +[sep1-ap]: ./sep1/README.mdx +[sep6-ap]: ./sep6/README.mdx +[sep10-ap]: ./sep10/README.mdx +[sep24-ap]: ./sep24/README.mdx +[sep31-ap]: ./sep31/README.mdx diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep1/README.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep1/README.mdx new file mode 100644 index 0000000000..8344b44e88 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep1/README.mdx @@ -0,0 +1,66 @@ +--- +title: Stellar Info File +sidebar_position: 40 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Let's enable applications to learn more about your service by hosting a `stellar.toml` file at a standardized URL path. This file allows applications to find information about your business, the assets your services utilize, as well as the root URL paths for these services. We can host this file using the Anchor Platform. + +Let's create a file called `dev.stellar.toml` file using the contents below as a starting point. For the full set of attributes, see the [SEP-1 specification][sep-1]. + + + +```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" + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +Note that you'll 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. + +In your `dev.env` file, specify the following. + + + +```bash +# dev.env +SEP1_ENABLED=true +SEP1_TOML_TYPE=file +SEP1_TOML_VALUE=/home/dev.stellar.toml +``` + + + +This will tell the Anchor Platform that it should host the file specified by `SEP1_TOML_VALUE` at `./well-known/stellar.toml`. + +Alternatively, your `stellar.toml` file could be hosted using a proper static file server like [nginx]. As long as your info file includes the appropriate URLs pointing to the Anchor Platform, this will work just fine. + +[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://lab.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 diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep10/README.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep10/README.mdx new file mode 100644 index 0000000000..1db24083f6 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep10/README.mdx @@ -0,0 +1,156 @@ +--- +title: Stellar Authentication +sidebar_position: 50 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Enable Stellar Authentication + +Stellar-based wallet applications create authenticated sessions with Stellar anchors by proving they, or their users, have sufficient control over a Stellar account. Once authenticated, the wallet application uses a session token provided by the anchor in subsequent requests to the anchor's standardized services. + +The Anchor Platform supports this form of authentication with minimal configuration from the business. + + + +```bash +# dev.env +SEP10_ENABLED=true +SEP10_HOME_DOMAIN=localhost:8080 +SECRET_SEP10_SIGNING_SEED="a Stellar private key" +SECRET_SEP10_JWT_SECRET="a secret encryption key" +``` + + + +`SEP_10_HOME_DOMAIN` is the `home_domain` property used by [sep-10]. The configuration value must be equal to the host of the toml file. If you are hosting toml file via the Platform, (`SEP1_ENABLED` is set to `true`), toml file will be hosted on the SEP server. + +`SECRET_SEP10_SIGNING_SEED` is the private key to the public key you've specified as the `SIGNING_KEY` in your `stellar.toml` file. It will be used to sign authentication challenges presented to wallet applications, providing that you are in possession of the `SIGNING_KEY`. Wallets will check for this signature before signing and sending back the authentication challenge. + +`SECRET_SEP10_JWT_SECRET` is the encryption key that will be used to sign and verify the authentication tokens you issue to wallet applications after they or their users have proven control of their Stellar account. + +:::info + +By default, the Anchor Platform allows anyone with a Stellar account to authenticate with your services. If you'd like to only allow users of a particular wallet application to authenticate, or want to disallow specific users from authenticating, use the following environment variables. This is an optional feature and should only be added if it is a business requirement. + +::: + +## Config With Client Attribution + +`SEP10_CLIENT_ATTRIBUTION_REQUIRED` informs the Anchor Platform whether it should allow users of noncustodial wallets to authenticate without the wallet also identifying itself. + +`CLIENTS` is the list of outside wallet servers or clients for the Anchor server to safely communicate with. + + + +```bash +# dev.env +SEP10_CLIENT_ATTRIBUTION_REQUIRED=true +``` + + + + + +```yaml +clients: + # Each item in the list may contain the following fields: + # - name: (required) the name of the client + # - type: (required) `custodial` or `noncustodial` + # + # If the type is `custodial`, + # - signing_keys: (required) the custodial SEP-10 signing key of the client. + # - callback_url: (optional) the URL of the client's callback API endpoint. + # If one of SEP-specific URLs is also provided, then this URL will be used as a fallback. + # For example, if `callback_url_sep6` is not provided, but `callback_url_sep24` is, + # SEP-6 transactions will use the `callback_url` as the callback URL. This field is + # deprecated and will be removed in 3.0. + # - callback_url_sep6: (optional) the URL of the client's SEP-6 callback API endpoint. + # - callback_url_sep24: (optional) the URL of the client's SEP-24 callback API endpoint. + # - callback_url_sep31: (optional) the URL of the client's SEP-31 callback API endpoint. + # - callback_url_sep12: (optional) the URL of the client's SEP-10 callback API endpoint. + # - allow_any_destination: (optional) default to false. If set to true, allows any destination for deposits. + # - destination_accounts: (optional) list of accounts allowed to be used for the deposit. + # If allows_any_destinations set to true, this configuration option is ignored. + # + # If the type is `noncustodial`, + # - domains: (required) the domains of the client. + # - callback_url: (optional) the URL of the client's callback API endpoint + + # custodial client + - name: custodial-client1 + type: custodial + signing_keys: "the signing key 1 of the client1","the signing key 2 of the client1" + callback_url: https://callback.custodial-client1.com/api/v1/anchor/callback + callback_url_sep6: https://callback.custodial-client1.com/api/v1/anchor/callback/sep6 + callback_url_sep12: https://callback.custodial-client1.com/api/v1/anchor/callback/sep12 + allow_any_destination: false + destination_accounts: destAccount1,destAccount2 + - name: custodial-client2 + type: custodial + signing_keys: "the signing key of the client2", + + # noncustodial client + - name: noncustodial-client1 + type: noncustodial + domains: noncustodial-client1.co,noncustodial-client1.com + callback_url: https://callback.noncustodial-client1.co/api/v2/anchor/callback + callback_url_sep6: https://callback.noncustodial-client1.co/api/v2/anchor/callback/sep6 + callback_url_sep12: https://callback.noncustodial-client1.co/api/v2/anchor/callback/sep12 + - name: noncustodial-client2 + type: noncustodial + domains: noncustodial-client2.com +``` + +```bash +# dev.env +# custodial client +CLIENTS[0]_NAME=custodial-client1 +CLIENTS[0]_TYPE=custodial +CLIENTS[0]_SIGNING_KEYS="the signing key 1 of the client1","the signing key 2 of the client1" +CLIENTS[0]_CALLBACK_URL=https://callback.custodial-client1.com/api/v1/anchor/callback +CLIENTS[0]_ALLOW_ANY_DESTINATION=false +CLIENTS[0]_DESTINATION_ACCOUNTS=destAccount1,destAccount2 +CLIENTS[1]_NAME=custodial-client2 +CLIENTS[1]_TYPE=custodial +CLIENTS[1]_SIGNING_KEYS="the signing key of the client2" + +# noncustodial client +CLIENTS[2]_NAME=noncustodial-client1 +CLIENTS[2]_TYPE=noncustodial +CLIENTS[2]_DOMAINS=noncustodial-client1.co,noncustodial-client1.com +CLIENTS[2]_CALLBACK_URL=https://callback.noncustodial-client1.co/api/v2/anchor/callback +CLIENTS[3]_NAME=noncustodial-client2 +CLIENTS[3]_TYPE=noncustodial +CLIENTS[3]_DOMAINS=noncustodial-client2.com +``` + + + +`SEP10_CLIENT_ATTRIBUTION_REQUIRED` informs the Anchor Platform whether it should allow users of noncustodial wallets to authenticate without the wallet also identifying itself. + +`CLIENTS` is the list of outside wallet servers or clients for the Anchor server to safely communicate with. + +## Modify a Stellar Info File + +Next, let's modify `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-10 functionality is supported by your business. + + + +```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" + +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +[sep1-ap]: ../sep1/README.mdx diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep24/README.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep24/README.mdx new file mode 100644 index 0000000000..4d78a93bbd --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep24/README.mdx @@ -0,0 +1,10 @@ +--- +title: Hosted Deposits and Withdrawals +sidebar_position: 60 +--- + +import DocCardList from "@theme/DocCardList"; + +SEP-24 allows for a means by which wallets and/or exchanges allow the user to directly interact with an on & off-ramp. + + diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep24/configuration.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep24/configuration.mdx new file mode 100644 index 0000000000..09c8dc7090 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep24/configuration.mdx @@ -0,0 +1,190 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Modify a Stellar Info File + +Next, let's modify `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-24 functionality is supported by your business, and they also need to know all 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_SEP0024 = "http://localhost:8080/sep24" +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" + +# Optionally, add support for XLM +[[CURRENCIES]] +code = "native" +status = "test" +is_asset_anchored = false +anchor_asset_type = "crypto" +desc = "XLM, the native token of the Stellar network." + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +Note that you'll 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 Hosted Deposits & Withdrawals + +Now you're ready to enable hosted deposits and withdrawals via the SEP-24 API. Specify the following in your `dev.assets.yaml` file, and change the values depending on your preferences. This example asset file will enable support for Circle's USDC and a fiat USD. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep24_enabled: true + deposit: + enabled: true + withdraw: + enabled: true + - schema: iso4217 + code: USD + significant_decimals: 2 + deposit: + enabled: true + withdraw: + enabled: true + # Optional support for XLM + - schema: stellar + code: native + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 7 + sep24_enabled: true + deposit: + enabled: true + withdraw: + enabled: true +``` + + + +The information provided for the `assets` value closely maps to the information that will be exposed to the wallet application using the [`GET /info`][sep24-get-info] SEP-24 endpoint. The Anchor Platform also uses this information to validate requests made to your service. + +Add the following variables to your environment file. + + + +```bash +# dev.env +SEP24_ENABLED=true +SEP24_INTERACTIVE_URL_BASE_URL=http://example.com +SEP24_MORE_INFO_URL_BASE_URL=http://example.com +SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET="your encryption key shared with your business server" +SECRET_SEP24_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" +``` + + + +`SEP24_INTERACTIVE_URL_BASE_URL` is the URL that the Anchor Platform will provide to wallet applications when they initiate transactions. Wallet applications will open this URL in a web view inside their app, handing over control of the user experience from the wallet to your business. This URL points to the web widget your business implements. It contains all business-defined logic. We'll dive further into this experience in subsequent sections. + +`SEP24_MORE_INFO_URL_BASE_URL` is the URL that the Anchor Platform will provide to wallet applications when they want to show information about a transaction initiated previously. This URL is most often used by wallets in their transaction history views, and your business can define what information to display about the transaction. + +`SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET` and `SECRET_SEP24_MORE_INFO_URL_JWT_SECRET` are encryption keys that the Anchor Platform will use to generate short-lived tokens it will add to the URLs provided to the wallet. Your business server must also have these keys in its environment so it can verify the token's signature. + +## 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" + +SEP24_ENABLED=true +SEP24_INTERACTIVE_URL_BASE_URL=http://localhost:8081 +SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET="your encryption key shared with your business server" +SECRET_SEP24_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" +``` + + + +To test this out, go to the [Stellar Demo Wallet][stellar-demo-wallet]. + +[![demo wallet connected to the anchor platform](../../assets/anchor-platform-sep24-demo-wallet.png)](../../assets/anchor-platform-sep24-demo-wallet.png) + +Initiate a 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-24 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. However, when the demo wallet attempts to open the URL provided by the Anchor Platform, you'll get a not found page. + +[![demo wallet after initiating a transaction](../../assets/anchor-platform-sep24-demo-wallet-widget.png)](../../assets/anchor-platform-sep24-demo-wallet-widget.png) + +[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://lab.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 +[sep1-ap]: ../sep1/README.mdx diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep24/example.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep24/example.mdx new file mode 100644 index 0000000000..3ec5be0e16 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep24/example.mdx @@ -0,0 +1,438 @@ +--- +title: "Example" +sidebar_position: 40 +--- + +Integrating with the Anchor Platform involves three key areas: + +- Building a web-based user experience that can be opened in a mobile web view +- Providing transaction status updates to the Anchor Platform +- Fetching transaction status updates from the Anchor Platform + +## Building a Web-Based User Experience + +The Anchor Platform does not offer a white-label UI that your business can utilize, and instead expects the business to build their own UI and backend system. We won't build an entire on & off-ramp user experience in this guide, but will cover the ways in which your existing product should be updated to be compatible with the Anchor Platform. + +### Authentication + +If your business has an existing on & off-ramp product, you likely have an existing system for user authentication. However, because the Anchor Platform authenticates the user prior to providing the business's URL, requiring the user to go through another form of authentication is actually unnecessary. In this way, the Anchor Platform can be thought of as providing an alternative form of authentication. + +The business is free to continue requiring users to authenticate using their existing system, but the ideal user experience would skip this step and create an authenticated session for the user if they have already authenticated using their Stellar account. + +The Anchor Platform adds a JWT `token` query parameter to the business's URL given to the wallet application. This token is signed by the previously-configured `SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET` value, and includes the information you need to identify the user. The process should look something like this: + +1. Pass the `token` added to the URL of your backend system +2. Verify the signature on the `token` and check its expiration +3. Create an authenticated session for the user identified by `token.sub` + +The decoded contents of the `token` will look something like this: + + + +```json +{ + "jti": "e26cf292-814f-4918-9b40-b4f76a300f98", + "sub": "GB244654NC6YPEFU3AY7L25COGES445P3Q63W6Q76JHR3UBJMLT2XBOB:1234567", + "exp": 1516239022, + "data": { + "first_name": "John", + "last_name": "Doe", + "email": "johndoe@example.com" + } +} +``` + + + +Note that the `sub` value identifies the user using a Stellar account and integer. This is what the value will be when custodial applications that use an omnibus account authenticate with your service. When non-custodial wallets authenticate, the token may look slightly different. + + + +```json +{ + "jti": "e26cf292-814f-4918-9b40-b4f76a300f98", + "sub": "GB244654NC6YPEFU3AY7L25COGES445P3Q63W6Q76JHR3UBJMLT2XBOB", + "exp": 1516239022, + "data": { + "client_domain": "api.vibrantapp.com", + "first_name": "John", + "last_name": "Doe", + "email": "johndoe@example.com" + } +} +``` + + + +The `sub` value here only contains a public key to identify the user, and the `data.client_domain` field identifies the wallet application used to authenticate. + +In both cases, all information in the `data` object is optional, and will only be present if the wallet provides that information. + +Let's add a backend server to our compose file that will be used to verify the token and create authenticated web sessions for users initiating transactions. + + + +```yaml +# docker-compose.yaml +--- +business-server: + build: . + ports: + - "8081:8081" + env_file: + - ./dev.env + depends_on: + - platform-server +``` + + + +Let's create a simple Docker container for our application. + + + +```docker +FROM node:19 + +WORKDIR /home +COPY . . +RUN npm install + +CMD ["node", "server.js"] +``` + + + +Now let's create a minimal NodeJS application. + + + +```bash +yarn init -y +yarn add express jsonwebtoken +touch server.js +``` + + + +Below is an example of a backend server authenticating a user using NodeJS. + + + +```js +# server.js +const express = require("express"); +const jwt = require("jsonwebtoken"); +const app = express(); +const port = process.env.BUSINESS_SERVER_PORT; + +app.use(express.json()); + +/* + * We'll store user session data in memory, but production systems + * should store this data somewhere more persistent. + */ +const sessions = {}; + +/* + * Create an authenticated session for the user. + * + * Return a session token to be used in future requests as well as the + * user data. Note that you may not have a user for the stellar account + * provided, in which case the user should go through your onboarding + * process. + */ +app.post("/session", async (req, res) => { + let decodedPlatformToken; + try { + decodedPlatformToken = validatePlatformToken(req.body.platformToken); + } catch (err) { + res.status = 400; + res.send({ "error": err }); + return; + } + let user = getUser(decodedPlatformToken.sub); + let sessionToken = jwt.sign( + { "jti": decodedPlatformToken.jti }, + process.env.SESSION_JWT_SECRET + ); + sessions[sessionToken] = user; + res.send({ + "token": sessionToken, + "user": user + }); +}); + +/* + * Validate the signature and contents of the platform's token + */ +function validatePlatformToken(token) { + if (!token) { + throw "missing 'platformToken'"; + } + let decodedToken; + try { + decodedToken = jwt.verify(token, process.env.SECRET_SEP10_JWT_SECRET); + } catch { + throw "invalid 'platformToken'"; + } + if (!decodedToken.jti) { + throw "invalid 'platformToken': missing 'jti'"; + } + return decodedToken; +} + +/* + * Query your own database for the user based on account:memo string parameter + */ +function getUser(sub) { + return null; +} + +app.listen(port, () => { + console.log(`business server listening on port ${port}`); +}); +``` + + + +Run this with the platform server and database and initiate a new transaction with the [demo wallet][stellar-demo-wallet]. Then, we'll send the token to our server. + + + +```bash +curl \ + -X POST \ + -H 'Content-Type: application/json' \ + -d '{"platformToken": ""}' \ + http://localhost:8081/session | jq +``` + + + +## Providing Updates to the Platform + +Let's create an endpoint for our business server that accepts the information collected in our UI. + + + +```js +# server.js + +// Production systems should either let the Anchor Platform generate its own memos +// or have your custodial service generate a memo for each transaction. +const transactionMemos = {}; + +app.post("/transaction", async (req, res) => { + let sessionToken; + try { + sessionToken = validateSessionToken(req.headers.get("authorization")); + } catch (err) { + res.status = 400; + res.send({ "error": err }) + return; + } + // assuming this is a withdrawal transaction, we'll provide a memo, which is + // required by our third-party custodian to credit us the payment. When the + // payment is made with this memo, we can match the on-chain payment with the + // transaction in the Anchor Platform's database. + transactionMemos[req.body.transaction.id] = parseInt(Math.random() * 100000); + let rpcRequestBody = [ + { + "id": 1, + "jsonrpc": "2.0", + "method": "request_onchain_funds", + "params": { + "transaction_id": req.body.transaction.id,, + "message": "waiting for the user to provide off-chain funds.", + "amount_in": { + "amount": req.body.amount_in.amount, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": req.body.amount_out.amount, + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": req.body.amount_fee.amount, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "destination_account": "GD...G", + "memo": transactionMemos[req.body.transaction.id], + "memo_type": "id" + } + } + ]; + let platformResponse; + try { + platformResponse = await updatePlatformTransaction(rpcRequestBody); + } catch (err) { + res.status = 500; + res.send({ "error": err }) + return; + } + res.send({ + "transaction": platformResponse.records[0] + }); +}); + +function validateSessionToken(authorizationHeader) { + let parts = authorizationHeader.split(" "); + if (parts.length != 2 || parts[0] != "Bearer") { + throw "invalid authorization header format"; + } + let sessionToken = parts[1]; + try { + jwt.verify(sessionToken, process.env.SESSION_JWT_SECRET); + } catch { + throw "invalid session token"; + } + if (!sessions[sessionToken]) { + throw "expired session"; + } + return sessionToken; +} + +async function updatePlatformTransaction(requestBody) { + let response = await fetch( + `${process.env.PLATFORM_SERVER}`, + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(requestBody) + } + ); + if (response.status != 200) { + throw `unexpected status code: ${response.status}`; + } + return await response.json(); +} +``` + + + +This will update the Anchor Platform's database with the information provided and enable wallet applications to fetch this updated information so it can relay it back to the user. You should have already informed the user of the transaction's amounts and that your business's is waiting for the on-chain payment to arrive, but providing these updates allows users to view their transactions' statuses through their mobile application without opening the business' UI again. + +:::note + +At this time, the Anchor Platform does not send notifications to the wallet application when transaction statuses change, however, it is on our roadmap to add these notifications or "callback requests" so that wallet applications do not have to poll the Anchor Platform for updates. + +::: + +## Fetching Updates from the Platform + +If you only use the Anchor Platform to expose the SEP APIs to wallet applications, then you won't have a strong reason for fetching transaction status updates from the Anchor Platform, mostly because it won't update the transaction status until you make `JSON-RPC API` requests. + +However, if you use the Anchor Platform to monitor the Stellar network for incoming payments (associated with withdrawal transactions), the Anchor Platform will update transaction statuses when payments are received. + +There are two ways to fetch updates from the Anchor Platform, + +- Polling the Platform API's `GET /transactions/:id` endpoint for the transactions you're expecting a payment for +- Streaming transaction status change events from a Kafka cluster + +While streaming transaction status changes from a Kafka cluster may be a more robust and scalable approach, we're going to use the polling method in this guide. Setting up and using a Kafka cluster will be the subject of a different section of the docs. + +First, let's configure the Anchor Platform to observe the Stellar network for incoming payments. + + + +```yaml +# docker-compose.yml +--- +stellar-observer: + image: stellar/anchor-platform:2.10.0 + command: --stellar-observer + env_file: + - ./dev.env + volumes: + - ./config:/home + depends_on: + - db +``` + + + +The `--stellar-observer` command starts a process that monitors the distribution accounts configured in your `config.yaml` file for withdrawal payments. + +If a payment is sent to one of these accounts and the memo attached to the transaction matches a `memo` value provided or generated by the Anchor Platform, the Anchor Platform will consider the transaction that memo is associated with as received and update the transaction's status to `pending_anchor`. It does this by making a `JSON-RPC API` request, so we need to configure the URL it should use. + + + +```bash +# dev.env +PLATFORM_API_BASE_URL=http://platform-server:8085 +``` + + + +Let's make some additions to the `server.js` file so we can poll the Anchor Platform for our expected payments. + + + +```js +// server.js +... +/* + * Fetch the transaction data from the Platform API + * + * Production systems should have proper retry mechanisms. + */ +async function getPlatformTransaction(transactionId) { + let response = await fetch(`${process.env.PLATFORM_SERVER}/transactions/${transactionId}`) + if (response.status != 200) { + throw `unexpected status code: ${response.status}`; + } + return await response.json(); +} + +(async () => { + while (true) { + await new Promise(r => setTimeout(r, 2000)); + let requestPromises; + for (const transactionId in transactionMemos) { + requestPromises.push(getPlatformTransaction(transactionId)) + } + let transactions = await new Promise.all(requestPromises); + for (const transaction in transactions) { + // assuming all requests were successful + if (transaction.status == "pending_anchor") { + // initiate off-chain delivery of funds + console.log(`received payment for transaction ${transaction.id}`); + } + } + } +})() +``` + + + +## Full Example Implementation + +Stellar provides an example business server implementation for SEP-24. It's split into two parts: 1) a web UI, accessible for the end user; and 2) a back-end implementation, used to get and push updates from/to the Anchor Platform. + +The code for web UI can be found [here][sep-24-ref-ui] + +The code for the backend is a part of the Anchor Platform, and is available as a [submodule][sep-24-ref]. + +[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://lab.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 diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep24/faq.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep24/faq.mdx new file mode 100644 index 0000000000..5972a06cf9 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep24/faq.mdx @@ -0,0 +1,39 @@ +--- +title: "FAQ" +sidebar_position: 50 +--- + +### How To Use JWTs? + +As part of the flow, once a user makes a request, i.e. an interactive withdrawal/deposit request, it will be processed by the Anchor Platform and forwarded to your service. The Anchor Platform will make a `GET` call to `?token=`. + +This JWT token will contain: + +1. `exp` is the expiration time of the token. You should check that the provided token has not expired. +2. `sub` is the account associated with this transaction. It can be used to identify the user account. Note that this value may be different from the account that will be used to receive/send funds. +3. `jti` is the hash of the transaction. +4. `data` is the extra payload that has been set by the user. It will always contain the Stellar `asset` wants to deposit or withdraw. If provided by the client, it will also contain the `amount` the user wants to transact, the `client_domain` of the wallet verified during SEP-10 authentication, and `client_name` (defined as 'name' in [clients] configuration if provided), and the `lang` (language) preference of the user. + +### How To Provide Fees? + +Currently, it's recommended to provide fees/exchange rates in the iFrame/web view of your application. + +[SEP-24] standard provides a `/fee` endpoint to allow businesses to set static fees for their transactions. However, it's not currently supported by the Anchor Platform. + +:::note + +/fee endpoint will be deprecated in the future. + +::: + +### How to identify the user account? + +You should use the `sub` field of the JWT token. For custodial wallets, this value will be in the format `account:memo`. Use the memo to identity the user. For noncustodial wallets, simply use the `sub` value itself, which will be equal to the user account. + +### How to identify the wallet? + +Utilize the `data.client_domain` attributes within the JWT token. In the presence of [clients] configuration, the JWT token will additionally incorporate the `data.client_name` field, enabling wallet identification. + +[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 +[clients]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep24/getting-started.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep24/getting-started.mdx new file mode 100644 index 0000000000..ce1d1dbf46 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep24/getting-started.mdx @@ -0,0 +1,33 @@ +--- +title: "Getting Started" +sidebar_position: 10 +--- + +This guide will walk you through configuring and integrating with the Anchor Platform for the purpose of building an on & off-ramp service compatible with [SEP-24][sep-24], the ecosystem's standardized protocol for hosted deposits and withdrawals. + +By leveraging the Anchor Platform's support for SEP-24, businesses make their 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-24: [SEP-1 (Stellar Info File)][sep1-ap] and [SEP-10 (Stellar Authentication)][sep10-ap] + +## The Basic User Experience + +The complete customer experience a deposit and withdrawal goes something like this: + +1. The customer opens the SEP-24 wallet application of their choice +2. The customer selects an asset to deposit and the wallet finds an anchor (clients could also chose 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 (e.g. makes a 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 wallet opens the given interactive URL and allows the customer to enter their transaction information (KYC has already been 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 bank transfer. + +[sep-24]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md +[installation-ap]: ../../admin-guide/getting-started.mdx +[sep1-ap]: ../sep1/README.mdx +[sep10-ap]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep24/integration.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep24/integration.mdx new file mode 100644 index 0000000000..a396e9c44d --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep24/integration.mdx @@ -0,0 +1,1009 @@ +--- +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 Anchor Platform about events related to the transaction. + +In general, you'll want to provide updates for the following events: + +- Your business is processing the KYC information provided by the user +- 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 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 this 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-24 protocol document][sep-24] + +## Securing Platform API + + + +### Using API Key + + + +### Using JWT + + + +## Making JSON-RPC Requests + + + +### JSON-RPC Request + + + +### JSON-RPC Response + + + +### Error Codes + + + +## Updating Deposit Transaction Via JSON-RPC + +SEP-24 deposit flow diagram defines sequence/rules of the transaction's status transition and a set of JSON-RPC methods 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. + +[![sep24 deposit flow](../../assets/sep24-deposit-flow-diagram.png)](../../assets/sep24-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. + +::: + +### Ready to Receive Funds + +The first step of the deposit flow after starting the deposit itself is collecting KYC. It's usually done in the web-app, but can also be optionally provided by the wallet application, using [SEP-9]. Once the necessary KYC is collected, a `request_offchain_funds` JSON-RPC request should be made. + + + +```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 + } + } + } +] +``` + + + +- `amount_in` is the amount the user has to sent 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. + +Information abouts amounts (in/out/fee) is required if you want to move the transaction from the `incomplete` to the `pending_user_transfer_start` status. If transaction status is changed from `pending_anchor` to `pending_user_transfer_start`, you can skip defining the amounts. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh request-offchain-funds.json +``` + + + +:::tip + +When the KYC process is long (for example, ID verification), it's advised to first set the transaction status to `pending_anchor` by using `notify_interactive_flow_completed` JSON-RPC request. This will indicate to the user that KYC is being processed. + +::: + +### Processing KYC Information + +:::tip + +This step is optional. Most businesses don't use it. You can skip it and go to the [next step](#funds-received). + +Using this status is recommended when KYC verification may need to be performed asynchronously. + +::: + +You **must** specify the `amount_x` fields. + + + +```json +// kyc-in-process.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_interactive_flow_completed", + "params": { + "transaction_id": "", + "message": "Interactive flow completed.", + "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 + } + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh kyc-in-process.json +``` + + + +### Funds Received + +If offchain funds were received, you'll want to provide an 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 from previous JSON-RPC requests will be taken. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh offchain-funds-received.json +``` + + + +### Waiting For User Funds + +In a 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 a user request. After the transaction completion, 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. To make a payment via custody service, it's necessary to 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/learn/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, it's necessary to 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. + +::: + +### 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. + + + +```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 + +It's similar to [Refund sent](#refund-sent), but it handles a 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 a good practice to clean up inactive transactions in the `incomplete` status. To do so, simply change the transaction status to `expired`. + + + +```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. + +::: + +### On-Hold Transaction + +In rare cases, you may want to pause current transaction and request more information from the user (after the transfer has been received). This could be used for compliance use cases. + + + +```json +// transaction-hold.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_transaction_on_hold", + "params": { + "transaction_id": "", + "message": "Transaction is on hold. Please contact customer support to resolve the hold." + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh transaction-hold.json +``` + + + +### 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, it's necessary to 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 Transaction Via JSON-RPC + +This diagram defines a sequence/rules of transaction's status transition for SEP-24 withdrawal flow. + +[![sep24 withdrawal flow](../../assets/sep24-withdrawal-flow-diagram.png)](../../assets/sep24-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 deposit 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 + +Similar to deposit, the next step 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 update will look differently. + + + +```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" + } + } +] +``` + + + +- `memo` Value of memo to attach to the transaction +- `memo_type` Type of memo that the anchor should attach to the transaction +- `destination_account` Destination account + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh request-onchain-funds.json +``` + + + +:::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. + +::: + +### Processing KYC Information + +This step is optional, and it's similar to [Processing KYC Information](#processing-kyc-information) of the deposit flow. + +### 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 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 +``` + + + +### 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 +``` + + + +### 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. + +### On-Hold Transaction + +Works in the same manner as for the deposit flow. For more details, see [On-Hold Transaction](#on-hold-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 + + + +[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 +[json-rpc-methods]: ../../api-reference/platform/rpc/methods/README.mdx diff --git a/docs/anchoring-assets/enabling-deposit-and-withdrawal/setting-up-production-server.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep24/setting-up-production-server.mdx similarity index 59% rename from docs/anchoring-assets/enabling-deposit-and-withdrawal/setting-up-production-server.mdx rename to ap_versioned_docs/version-2.10/admin-guide/sep24/setting-up-production-server.mdx index bc3d6c4d20..f631e5dbf3 100644 --- a/docs/anchoring-assets/enabling-deposit-and-withdrawal/setting-up-production-server.mdx +++ b/ap_versioned_docs/version-2.10/admin-guide/sep24/setting-up-production-server.mdx @@ -1,19 +1,42 @@ --- title: Set Up a Production Server -sidebar_position: 40 +sidebar_position: 60 --- +import { CodeExample } from "@site/src/components/CodeExample"; + Once the test server is live and you have tested both deposit and withdraw flows, it's time to get started with the real deploy connected to real KYC and real banking rails providers. Before using any banking APIs, it's critical that you perform a full security audit on the system to make sure that there aren't any vulnerabilities. ## Deploying a Secure Environment Make sure to keep the test server up, and deploy the production (mainnet) system in a separate environment. Having two deploys allows you to validate new features on the testnet before moving them to the final production deploy. You can also have a third staging environment if there's a big team working on this codebase and/or there will be many pushes to be tested internally before sharing with other institutions. -To switch to Stellar's public (mainnet) network, all you have to do is change the network [passphrase](../../encyclopedia/network-passphrases.mdx) (for authenticating requests) and [Horizon URL](https://horizon.stellar.org/). Stellar SDKs have all the built-in logic to switch from test to public with minor changes to the codebase. +To switch to Stellar's public (mainnet) network, all you have to do is change the network [passphrase](/docs/learn/encyclopedia/network-configuration/network-passphrases) (for authenticating requests) and [Horizon URL](https://horizon.stellar.org/). + +You can copy your existing development configs to create a production configuration. + +First, you need to change your info file (`stellar.toml`): + + + +```toml +# stellar.toml +NETWORK_PASSPHRASE = "Public Global Stellar Network ; September 2015" +``` -If you're issuing your own asset in addition of offering an on/off ramp, make sure you follow [best practices for asset issuance](../../issuing-assets/how-to-issue-an-asset.mdx) by creating a distribution account that is separate from the issuing account before distributing real assets on the public network. The issuing account secret key should be highly secured via means such as cold storage or multi-signature, and should only be used to send (and, consequently, issue) assets to the distribution account. The distribution account will be used by your server to send (and receive) assets to other accounts programmatically. + -Since the distribution account will be managed programmatically, it should only have a balance necessary to keep operations running for a short period of time. The issuing account should send small amounts of an asset to the distribution account frequently to represent the expected deposit volume for a given period. You should set up the transfer from the issuing account to the distribution account once day (or once a week week) to make sure the distribution account only has the minimum necessary balance to keep the operation functional in that short period. +Next, change your Anchor Platform configuration in `production.env` file: + + + +```bash +# production.env +STELLAR_NETWORK_NETWORK="Public" +STELLAR_NETWORK_HORIZON_URL=https://horizon.stellar.org +``` + + ## Connecting to Real KYC @@ -23,13 +46,17 @@ How you handle KYC is up to you: there are many services that provide KYC soluti Some countries require different KYC fields depending on the amount to be deposited or withdrawn. If that's the case in your jurisdiction and you need to adapt your KYC forms based on the deposit or withdrawal amount, simply add an amount field before the KYC form, and make sure that the KYC fields are updated based on that value. -KYC information should be linked to the session created through [Stellar Web Authentication](./setting-up-test-server.mdx#authentication) and, consequently, to the user, so you only need to ask the user for it once. After the first KYC flow is complete, a user shouldn't have to input the information again. +KYC information should be linked to the session created through [Stellar Web Authentication](../sep10/README.mdx) and, consequently, to the user, so you only need to ask the user for it once. After the first KYC flow is complete, a user shouldn't have to input the information again. Make sure the errors and validation messages are clear and include instructions for what to do next to ensure a good user experience and increase the KYC conversion rate. You should also localize messages based on the user's language and location. ## Pre-Filling the KYC Form -Pre-filling the KYC form is a great way to reduce the friction of getting started using an anchor, and wallets usually provide a set of fields that are commonly used throughout the ecosystem. In summary, the anchor can render the KYC form with the user's values that were previously sent by the wallet in the /transactions/deposit/interactive and /transactions/withdraw/interactive endpoints. All fields from [SEP-9](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0009.md) can be sent by wallets in the previously mentioned endpoints, but the most common are: email, first name, last name and phone number. Also, you should still enable the pre-filled fields to be editable, since the user might have inputted a different name in the Wallet's sign-up process, and could want to edit it before finalizing the Anchor's KYC process. +Pre-filling the KYC form is a great way to reduce the friction of getting started using an anchor, and wallets usually provide a set of fields that are commonly used throughout the ecosystem. In summary, the anchor can render the KYC form with the user's values that were previously sent by the wallet in the `/transactions/deposit/interactive` and `/transactions/withdraw/interactive` endpoints. + +All fields from [SEP-9](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0009.md) can be sent by wallets in the previously mentioned endpoints, but the most common are: email, first name, last name and phone number. Also, you should still enable the pre-filled fields to be editable, since the user might have inputted a different name in the Wallet's sign-up process, and could want to edit it before finalizing the Anchor's KYC process. + +All SEP-9 data that was sent from the wallet is a part of the [Interactive JWT](./faq.mdx#how-to-use-jwts), send by the Anchor Platform ## Connecting to Real Banking Rails @@ -50,42 +77,36 @@ Once your application is fully functional, it's a good idea to test different sc ### General Tests -- Check to make sure the interactive interface follows our [UX Guidelines](https://github.com/stellar/anchor-ux-guidelines) -- Test the interactive flow usability on really small and really large screens -- Check that the issuing account is set up with the correct home domain, and that the website on that home domain has branding visuals, content about your company, clear language telling users how to report problems, and a method for contacting you to seek support. +- Test the interactive flow usability - Test the interface using different locale information, and check for translated content including error messages, responses, date formatting, and number formatting ### KYC Tests - Check that KYC appears with a new wallet SK -- Check that KYC (and email, if it's being used to identify users) is not appearing when using a previous wallet SK - Check that KYC doesn't accept incorrectly formatted inputs, and that the error messages are comprehensible - Check that you can use the same KYC information (email, phone number, username, etc) multiple times - Check that you can go through KYC multiple times with the same Stellar SK. -### Deposit Test +### Interactive Test -- Check that deposits are disabled for really small and really large values - Check that the deposit flow goes through, and that the banking rails are working -- Check that the endpoint returns an error if the JWT token is missing -- Check that all deposit response params conform to [protocols](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#deposit) +- Check that you cannot make a withdrawal with a value higher than the current balance +- Check that the withdrawal flow goes through, and that the banking rails are working -### Withdraw Tests +### Security Tests -- Check that withdrawals are disabled for really small and really large values -- Check that you cannot make a withdrawal with a value higher than the current balance -- Check that the withdraw flow goes through, and that the banking rails are working -- Check that the endpoint returns an error if the JWT token is missing -- Check that all withdraw params conform to [protocols](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#withdraw) +- Make sure platform endpoints are secured -### Transaction(s) Tests +## Polishing and Internationalization -- Check that the `/transaction` endpoint is working for a newly created transaction -- Check that the `/transaction` endpoint is working for a completed transaction -- Check that the `/transactions` endpoint returns all transactions from a specific user +Supporting two languages (English and the fiat currency country language) allows users to have a seamless experience while navigating through screens, and supports international institutions (like wallets) that need to test the product before starting new integrations. -### Security Tests +You can support multiple languages in your webapp by using the `Accept-Language` parameter from the http request headers to localize the content and allowing users to change that in a simple way (e.g. a flag icon on the top bar). If a specific wallet doesn't send the header parameter, we recommend showing the user a language selection screen in the beginning of the deposit and withdraw processes. Once a user chooses a language, you can store their selection so you only need to ask them once. In addition to localizing text, make sure to check number formatting, dates, etc. + +Having a group of beta testers is a great way to check if there are any edge cases that need polishing, and to confirm that the system is working well with a variety of user inputs. You can beta test using a soft launch stage before you start putting effort into marketing and distribution. Documenting the testing process with screenshots and videos is very helpful for future security audits, and gives new partners and potential users clarity and confidence in the product. + +## Connecting to Wallets + +All Anchor user interactions are done through a Wallet, so it's vital for Anchors to be connected to Wallets that have a good market penetration in the region where the business is most focused. Connecting to Wallets is a simple process, since both ends of that integration are already compliant with SEPs. -- Ensure distribution is done through a dedicated distribution account (not the issuing account) -- Ensure market making is done through a dedicated account (not the issuing account) -- Make sure all authenticated endpoints are not accessible without the JWT tokens +Stellar.org maintains a [list of wallets](https://www.stellar.org/ecosystem/projects), many of which currently support SEP-24 Sending them a message with more information on an asset and an issuer account is a great way to start getting some real users to the Anchor. diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep31/README.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep31/README.mdx new file mode 100644 index 0000000000..3cf13af916 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep31/README.mdx @@ -0,0 +1,10 @@ +--- +title: Cross-Border Payments +sidebar_position: 70 +--- + +import DocCardList from "@theme/DocCardList"; + +SEP-31 allows for a means by which wallets and/or exchanges interact with Stellar's existing set of send-side services. + + diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep31/configuration.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep31/configuration.mdx new file mode 100644 index 0000000000..d68d781de3 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep31/configuration.mdx @@ -0,0 +1,382 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Modify a Stellar Info File + +Let's start by modifying our `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-31 functionality is supported by your business, and they also need to know all 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" + +DIRECT_PAYMENT_SERVER = "http://localhost:8080/sep31" +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" + +[[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'll 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 Cross Border Payments + +Now you're ready to enable cross-border payments the SEP-31 API. Specify the following in your `dev.assets.yaml` file. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep31_enabled: true + sep31: + quotes_supported: true + quotes_required: true + fields: + transaction: {} + send: + min_amount: 0 + max_amount: 10000 +``` + + + +The information provided in the `sep31` and `send` objects closely map to the information that will be exposed to the wallet application using the [`GET /info`][sep31-get-info] SEP-31 endpoint. The Anchor Platform also uses this information to validate requests made to your service. `sep31.fields.transaction` should be left empty and will be removed in a future release, but you can adjust the `send.min_amount` and `send.max_amount` values according to your service's limits. + +The `sep31.quotes_supported` and `sep31.quotes_required` determine whether or not sending organizations can and are required to request an FX rate using the [SEP-38 `POST /quote`][sep38-post-quote] endpoint. Almost all senders prefer this approach so that they can communicate the rate to their customers prior to proceeding. + +Add the following variable to your environment file. + + + +```bash +# dev.env +SEP31_ENABLED=true +``` + + + +Senders should now be able to discover, authenticate, and initiate transactions with your service! Run the following command to start the Anchor Platform. + + + +```bash +docker compose up +``` + + + +Check that your API is live. + + + +```bash +curl http://localhost:8080/sep31/info | jq +``` + + + +You should get the following. + + + +```json +{ + "receive": { + "USDC": { + "enabled": true, + "quotes_supported": true, + "quotes_required": true, + "min_amount": 0, + "max_amount": 10000, + "fields": { + "transaction": {} + } + } + } +} +``` + + + +## Enable the Customer KYC API + +Businesses need to collect and validate KYC information on the customers they're facilitating transactions for. Clients determine what KYC information needs to be collected and send that information via a SEP-12 KYC API hosted by the Anchor Platform, but the Anchor Platform never stores personally-identifiable information (PII). Instead, it forwards requests from clients to the business server, and returns the business' responses back to the client, acting as a proxy server. + +See the [Anchor Platform KYC API specification][platform-api-kyc] for details on the endpoints that must be implemented on your business' server. + +To make this API available to clients, lets add the service URL to our Stellar Info File. + + + +```toml +# dev.stellar.toml +KYC_SERVER = "http://localhost:8080/sep12" +``` + + + +Lets enable it in our environment too. + + + +```bash +# dev.env +SEP12_ENABLED=true +``` + + + +Finally, we have to define your business' customer types. Each type of customer requires different a set of KYC information. For example, you can offer your cross-border payments service in two distinct regulatory jurisdictions, so customers in different jurisdictions have different KYC requirements and would be represented using different types. + +:::info + +Currently, customer types must be mutually exclusive, meaning a customer cannot be more than one type. + +This limitation is in place because the Anchor Platform cannot validate whether a customer is approved for a specific type of transaction, such as one sending a large amount. It can only validate that a customer is approved for one of the customer types defined. This limitation will be removed in a future release. + +::: + +In this guide, we'll only have two types, a sending customer type and a receiving customer type. Currently, our customer types are defined in our assets configuration, but this will change in a future release. + + + +```yaml +# dev.assets.yaml +sep31: + sep12: + sender: + types: + sep31-sender: + description: customers sending to recipients + receiver: + types: + sep31-receiver: + description: customers receiving from senders +``` + + + +Let's ping the info endpoint again to verify. After `docker compose up`, run the following command: + + + +```bash +curl http://localhost:8080/sep31/info | jq +``` + + + +You should get the following: + + + +```json +{ + "receive": { + "USDC": { + "enabled": true, + "quotes_supported": true, + "quotes_required": true, + "min_amount": 0, + "max_amount": 10000, + "fields": { + "transaction": {} + }, + "sep12": { + "sender": { + "types": { + "sep31-sender": { + "description": "customers sending to recipients" + } + } + }, + "receiver": { + "types": { + "sep31-receiver": { + "description": "customers receiving from senders" + } + } + } + } + } + } +} +``` + + + +## Enable the RFQ API + +Businesses need to provide their send-side counterparts with a [Rate][get-rates-api] API to check the exchange rates they're offering between the on-chain asset being used for settlement and the fiat asset being used to pay the recipient. If the rate is competitive, senders also need to be able to request a commitment to the rate currently being offered from business for a short period of time. + +The Anchor Platform provides the [SEP-38 RFQ API][sep38] to senders for this purpose. + +To make this API available to clients, lets add the service URL to our Stellar Info File. + + + +```toml +# dev.stellar.toml +DIRECT_PAYMENT_SERVER = "http://localhost:8080/sep31" +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" +KYC_SERVER = "http://localhost:8080/sep12" +QUOTE_SERVER = "http://localhost:8080/sep38" +``` + + + +Lets enable it in our environment too. + + + +```bash +# dev.env +SEP38_ENABLED=true +``` + + + +We also need to enable USDC to be used in this API, as well as add an off-chain asset it can be exchanged with. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep31_enabled: true + sep38_enabled: true + send: + min_amount: 0 + max_amount: 10000 + sep31: + quotes_supported: true + quotes_required: true + fields: + transaction: {} + sep12: + sender: + types: + sep31-sender: + description: customers sending to recipients + receiver: + types: + sep31-receiver: + description: customers receiving from senders + sep38: + exchangeable_assets: + - iso4217:BRL + country_codes: + - BRA + - schema: iso4217 + code: BRL + sep38_enabled: true + sep38: + exchangeable_assets: + - stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + country_codes: + - BRA + significant_decimals: 2 + buy_delivery_methods: + - name: PIX + description: Have BRL sent directly to your bank account. +``` + + + +Lets test that your RFQ API is live! Following `docker compose up`: + + + +```bash +curl http://localhost:8080/sep38/info | jq +``` + + + +You should get the following: + + + +```json +{ + "assets": [ + { + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + { + "asset": "iso4217:BRL", + "country_codes": ["BRA"], + "buy_delivery_methods": [ + { + "name": "PIX", + "description": "Have BRL sent directly to your bank account." + } + ] + } + ] +} +``` + + + +## Configure Callback API Authentication + +Just as your business will need to make requests to the Anchor Platform, the Anchor Platform will need to make requests to your business. Let's add authentication to these requests as well. + + + +```bash +# dev.env +CALLBACK_API_BASE_URL=http://server:8081 +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +SECRET_CALLBACK_API_AUTH_SECRET= +``` + + + +`CALLBACK_API_BASE_URL` uses `server` instead of `localhost` as the host because the Anchor Platform will be making requests to your business server from 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. + +We'll define the server that implements the endpoints defined in the Callback API in the following section. + +:::caution + +Note that as of 2.x path segments are not supported in `CALLBACK_API_BASE_URL` (such as `http://server:8081/myPath`). + +::: + +[sep31-get-info]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md#get-info +[sep1-ap]: ../sep1/README.mdx +[get-rates-api]: ../../api-reference/callbacks/get-rates.api.mdx +[sep38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md +[sep38-post-quote]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#post-quote +[platform-api-kyc]: ../../api-reference/callbacks/get-customer.api.mdx diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep31/getting-started.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep31/getting-started.mdx new file mode 100644 index 0000000000..d6b239c2df --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep31/getting-started.mdx @@ -0,0 +1,21 @@ +--- +title: "Getting Started" +sidebar_position: 10 +--- + +This guide will walk you through configuring and integrating with the Anchor Platform for the purpose of building a cross-border payments recieve-side service compatible with [SEP-31][sep-31], the ecosystem's standardized protocol for cross-border payments. + +By leveraging the Anchor Platform's support for SEP-31, businesses make their service compatible with Stellar's existing set of send-side services. + +:::info + +As we improve the documentation, parts of this guide that are relevant to other use cases may be moved into their own sections. + +::: + +Before continuing with this section, make sure that you have already [installed][installation-ap] the Anchor Platform and configured the necessary features required by SEP-31: [SEP-1 (Stellar Info File)][sep1-ap] and [SEP-10 (Stellar Authentication)][sep10-ap]. + +[sep-31]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md +[installation-ap]: ../../admin-guide/getting-started.mdx +[sep1-ap]: ../sep1/README.mdx +[sep10-ap]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep31/integration.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep31/integration.mdx new file mode 100644 index 0000000000..12407473b0 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep31/integration.mdx @@ -0,0 +1,664 @@ +--- +title: "Integration" +sidebar_position: 30 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Integrating with the Anchor Platform for facilitating cross-border payments involves implementing the following, at a minimum: + +- [`GET /customer`][get-customer] & [`PUT /customer`][put-customer] KYC API endpoints to request & collect customers' KYC data +- [`GET /rate`][get-rate] RFQ API endpoint to provide FX rates between the on & off-chain assets supported +- `GET /transactions` requests to fetch updates on the Anchor Platform's transactions' statuses (documentation coming soon) +- [`JSON-RPC`][json-rpc-methods] requests to update the Anchor Platform's transactions' statuses + +The following may also be required depending on your use case: + +- [`GET /fee`][get-fee] if your business wants to provide senders the option to skip the quote creation step +- [`GET /unique_address`][get-unique-address] if your business uses a custody service for on-chain assets +- [`DELETE /customer`][delete-customer] if your business wants or is required to allow senders to request deletion of customer data + +## Create a Business Server + +First, lets create a business server and add it to our docker compose file. + + + +```yaml +version: "3.8" + +services: + sep-server: + image: stellar/anchor-platform:2.10.0 + command: --sep-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8080:8080" + depends_on: + - db + platform-server: + image: stellar/anchor-platform:2.10.0 + command: --platform-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8085:8085" + depends_on: + - db + + server: + build: . + ports: + - "8081:8081" + env_file: + - ./dev.env + db: + image: postgres:14 + ports: + - "5432:5432" + env_file: + - ./dev.env +``` + + + +Next, create a simple web server using your preferred programming language and a `Dockerfile` that starts the server. `docker compose up` should successfully start all three services. + +This guide does not provide an example implementation of the endpoints, but you can find more information about the request and response schemas in the [Anchor Platform API Reference][ap-api], and the sections below will expand on concepts important to understand when implementing the endpoints. + +## Customer Callback Endpoints + +The Anchor Platform never stores your customers' PII, and instead acts as a proxy server between client applications and your business, forwarding requests and responses to the other party. Currently, requests and responses are almost identical to those defined in the [SEP-12 KYC API specification][sep12]. + +### Identifying Customers + +Customers can be identified using two approaches. + +The first approach uses a Stellar account and memo. When using the Anchor Platform for facilitating cross-border payments, the sending organization uses their own Stellar account, the one used to authenticate via [SEP-10 Stellar Authentication][ap-sep10], when registering customers with your business. Memos are used to distinguish unique customers originating from the same sending organization. + +The second approach uses customer IDs generated by your service. For example, if a sending organization is registering a customer, your business will receive a `PUT /customer` request like the following: + + + +```json +{ + "account": "GDJUOFZGW5WYBK4GIETCSSM6MTTIJ4SUMCQITPTLUWMQ6B4UIX2IEX47", + "memo": "780284017", + "type": "sep31-sender", + "first_name": "John", + "last_name": "Doe", + "email": "johndoe@example.com" +} +``` + + + +In this example, the `GDJ...X47` public key identifies the sending organization, and the `780284017` memo identifies the customer. Memos are usually 64-bit integers, but they can also be other data types, so they should be saved as strings. In response, your business should return a customer ID. + + + +```json +{ + "id": "fb5ddc93-1d5d-490d-ba5f-2c361cea41f7" +} +``` + + + +Your business server can use any identifer for customers as long as it is a string. + +Following the registration of a customer, the sending organization can use either approach when checking the customer's status. For example, you may get a `GET /customer` request like the following: + + + +``` +/customer?account=GDJUOFZGW5WYBK4GIETCSSM6MTTIJ4SUMCQITPTLUWMQ6B4UIX2IEX47&memo=780284017&type=sep31-sender +``` + + + +Or, the sending organziation could use the identifier you returned when they originally registered the customer. + + + +``` +/customer?id=fb5ddc93-1d5d-490d-ba5f-2c361cea41f7&type=sep31-sender +``` + + + +Your business will need to maintain a mapping between the account & memo used to originally register the customer and the ID you return in the response, as well as the KYC data provided. In future iterations of the Anchor Platform, we may maintain this mapping for your business so you only have to work with the IDs you generate. + +### Customer Types + +Your business likely requires different sets of KYC information depending on the type of customer. You can define the labels for each of these customer types in your `dev.assets.yaml` file, and your sending organizations will need to understand which label to use when registering or querying the status of customers. + +In `PUT /customer` requests, you should use the type passed to evaluate whether the sender has provided all of the required fields. In `GET /customer` requests, you should use the type to determine the customer's status. + +### Test with the Demo Wallet + +You can test your implementation with the [Stellar Demo Wallet][demo-wallet] following the steps below. + +1. Select "Generate keypair for new account" +2. Select "Create account" +3. Select "Add Asset" and enter the asset code and the Anchor Platform's home domain, `localhost:8080` +4. Select "Add trustline" +5. Fund your account with a balance of the asset +6. Select "SEP-31 Send" in the dropdown menu + +You should see the demo wallet find your service URLs, authenticate, and check which KYC fields it needs to collect. It should then present a form for you to enter the KYC details for the sender and reciever. + +[![demo wallet after initiating a transaction](../../assets/anchor-platform-sep31-demo-wallet-widget.png)](../../assets/anchor-platform-sep31-demo-wallet-widget.png) + +Once you've entered in the information requested, it will send that information to the Anchor Platform, which will send it to your business server. Once the demo wallet has the customers' IDs you generated, it will initiate a transaction which should fail. + +## Rate Callback Endpoint + +Once the sending organization has registered the customers involved in the transaction, it will need to request a quote, or FX rate, from your business. The Anchor Platform requests this information from your business server using the [`GET /rate` endpoint][get-rate]. + +### Firm vs. Indicative Quotes + +Requests for quotes will have a `type` parameter that is either [`indicative`][indicative] or [`firm`][firm]. If `type=firm`, your response must include the `id` & `expires_at` date-time field and reserve the liquidity needed to fulfil this quote until the quote expires. If `type=indicative`, do not return `id` or `expires_at` fields because the rate provided will not be used in a transaction. + +Note that the client may request that the quote expires after a specific date-time using the `expires_after` parameter. Your business must honor this request by returning an `expires_at` value that is at or after the requested date-time or reject the request with a 400 Bad Request response, which will be forwarded to the client. + +### Using the Client ID + +Requests may include a `client_id` parameter that identifies the sending organization requesting the rate. You can use this parameter to adhere to the commercial terms agreed upon with that sending organization, such as offering discounted rates. `client_id` may not be present for indicative requests, in which case your market price should be returned. Currently `client_id` will always be the Stellar public key the sending organization used to authenticate with the Anchor Platform. + +### Delivery Methods + +It is common for businesses' rates and fees to differ depending on the payment rails used to send funds to the recipient. If your delivery methods are configured in your `asset.yaml` file, clients will always provide the payment rail they want your business to use for firm quote requests. + +Because this endpoint is currently only used paying out remittances in off-chain assets, the `buy_delivery_method` will be used. If this endpoint is ever used in other transaction flows such as SEP-24 deposits, then `sell_delivery_method` may also be passed for business that support these types of transactions. + +## Fetching Transaction Status Updates + +To facilitate cross-border payments, you'll need to be able to detect when a sending organization has sent your business an on-chain payment and determine which transaction that payment was meant to fulfil. + +The easiest way to do that is to run the Stellar Observer, which will detect these payments and update the corresponding transaction record with information about the payment. Your business can then detect these updates by polling the `GET /transactions` Platform API endpoint. + +### Running the Stellar Observer + +The Stellar Observer monitors the Stellar ledger for payments made to your account(s) and updates the corresponding transaction records with on-chain payment information. To run the observer, add the following to your docker compose file. + + + +```yaml +services: + ... + observer: + image: stellar/anchor-platform:2.10.0 + command: --stellar-observer + env_file: + - ./dev.env + volumes: + - ./config:/home +``` + + + +### Polling for Received Payments + +The Stellar Observer makes JSON-RPC requests to the Platform API whenever it detects payments received for transactions initiated by sending organizations, thus updating the transaction's `transfer_received_at` date-time. + +Your business should periodically poll the `GET /transactions` Platform API endpoint to detect these updates. You can refer to the following example: + + + +```bash +curl http://localhost:8080/transactions?sep=31&order_by=transfer_received_at&order=desc +``` + + + +The response will include a list of cross-border payment transactions initiated by sending organizations. This list will be ordered according to the time a payment was received for that transaction. For each transaction returned, your business should check whether or not it has already detected the payment for that transaction. If it has, you have detected all payments made to your account(s). + +## Updating Transaction Via JSON-RPC + +SEP-31 flow diagram defines sequence/rules of the transaction's status transition and a set of JSON-RPC methods 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 the request. If the request doesn't contain required attributes, the Anchor Platform will return an error and won't change the status of the transaction. + +[![sep31 flow](../../assets/sep31-transition-diagram.png)](../../assets/sep31-transition-diagram.png) + +:::tip + +Statuses in green are mandatory and define the shortest flow. + +Statuses in yellow are optional and can be skipped. + +Statuses in red mean the transaction is in an error status or it has expired. + +::: + +You can create a [template][sep24-integration-make-json-rpc-request] for making a JSON-RPC requests to the Anchor Platform. + +This chapter also contains information about the format of [request][sep24-integration-rpc-request]/[response][sep24-integration-rpc-response] and [error codes][sep24-integration-error-codes] that might be returned by the Anchor Platform. + +### Ready to Receive Funds + +SEP-31 Transactions should initially be in the `pending_sender` status. The Receiving Anchor waits to receive the payment identified by the stellar_memo included in the POST /transactions response. + +Once your business detects that it has received an on-chain payment for a specific transaction, it has to update the transaction status. + + + +```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 +``` + + + +The transaction status will be changed to `pending_receiver`. + +### Offchain Funds Sent + +To complete the transaction and change its status to `completed`, you need to make a `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 +``` + + + +### Offchain Funds Pending + +Another option is to move the transaction's status to `pending_external`. This status means that payment has been submitted to external network, but it 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 +``` + + + +### Verifying Customer Information + +In some cases, the Receiving Anchor might need to request an updated information from the Sending Anchor. For example, the bank tells the Receiving Anchor that the provided Receiving Client's name is incorrect or missing a middle initial. Since this information was sent via SEP-12, the transaction should go into the `pending_customer_info_update` status until the Sending Anchor makes another SEP-12 `PUT /customer` request to update. The Sending Anchor can check which fields need to be updated by making a SEP-12 `GET /customer` request including the id or account & memo parameters. The Receiving Anchor should respond with a `NEEDS_INFO` status and `last_name` included in the fields described. + +After the Sending Anchor makes a SEP-12 `PUT /customer` request, call the `notify_customer_info_updated` JSON-RPC method againto update the transaction status. Additionally, call this method whenever the SEP-12 status for a customer changes, such as when the customer's information is being validated and the status changes from `NEEDS_INFO` to `PROCESSING`. This ensures that any clients configured with a callback URL are notified of the latest customer status, allowing the client to prompt the user to update their information. + + + +```json +// notify-customer-info-updated.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_customer_info_updated", + "params": { + "transaction_id": "", + "message": "Customer info updated", + "customer_id": "45f8884d-d6e1-477f-a680-503179263359", + "customer_type": "sep31-receiver" // or sep31-sender + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh notify-customer-info-updated.json +``` + + + +### Do Stellar Refund + +Integration with the custody service allows you to do refund via 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 + +You can't do multiple refunds in the SEP-31 flow. For this reason, the total refund amount plus the amount fee should equal `amount_in`. Otherwise, you will get an error. + +::: + +### Refund Sent + +There is a possibility to send all funds back to the `Sending Anchor` (refund). You need to refund the whole sum(full refund). + + + +```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 +``` + + + +:::note + +You can't do multiple refunds in SEP-31 flow. For this reason, the amount to refund plus the amount fee should equal `amount_in`. Otherwise, you will get an error. + +::: + +### 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 details of the error. + + + +```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 those transactions that have been abandoned by the user after some time. It's a good practice to clean up inactive transactions in the `incomplete` status. To do so, simply change the transaction's status to `expired`. + + + +```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 + +The transaction status can be changed from `error/expired` to `pending-anchor`. After recovery, you can refund the received assets or proceed with the processing of the transaction. To recover the transaction, it's necessary to 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 +``` + + + +## Fee Callback Endpoint + +Your business may want to offer sending organizations the option to skip the quote creation process, allowing your business to use a rate determined at the time the funds are paid out to the recipient. In this case, the Anchor Platform will not make a `GET /rate` request, but you will still need to provide the fee your business will charge for these types of transactions using the [`GET /fee`][get-fee] endpoint. + +### Configuration + +You can enable these types of transactions by updating your `assets.yaml` file configuration: + + + +```yaml +assets: + - ... + sep31: + quotes_required: false +``` + + + +## Unique Address Callback Endpoint + +Businesses must provide a unique Stellar account and memo pair for each transaction requested by sending organizations so that the Anchor Platform can identify and map the on-chain payment sent for the specific transaction. The Anchor Platform can generate these account & memo pairs itself, but most businesses use a custodial service to receive on-chain payments. In this case, the business must request the custodian to generate the Stellar account & memo. This is done by using the [`GET /unique_address` endpoint][get-unique-address]. + +### Configuration + +To configure the Anchor Platform to make these requests, add the following to your configuration: + + + +```bash +# dev.env +SEP31_DEPOSIT_INFO_GENERATOR_TYPE=api +``` + + + +:::caution + +This endpoint may be removed during future major version updates of the Anchor Platform, when it adds support for connecting to custodial services and generating these addresses automatically. + +::: + +[ap-api]: ../../README.mdx +[ap-sep10]: ../sep10/README.mdx +[sep12]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md +[demo-wallet]: https://demo-wallet.stellar.org +[indicative]: https://www.investopedia.com/terms/i/indicativequote.asp +[firm]: https://www.investopedia.com/terms/f/firmquote.asp +[get-unique-address]: ../../api-reference/callbacks/gen-address.api.mdx +[get-customer]: ../../api-reference/callbacks/get-customer.api.mdx +[put-customer]: ../../api-reference/callbacks/put-customer.api.mdx +[get-rate]: ../../api-reference/callbacks/get-rates.api.mdx +[get-fee]: ../../api-reference/callbacks/get-fee.api.mdx +[put-customer-callback]: ../../api-reference/callbacks/put-customer.api.mdx +[delete-customer]: ../../api-reference/callbacks/del-customer.api.mdx +[json-rpc-methods]: ../../api-reference/platform/rpc/methods/README.mdx +[sep24-integration-make-json-rpc-request]: ../sep24/integration.mdx#making-json-rpc-requests +[sep24-integration-rpc-request]: ../sep24/integration.mdx#json-rpc-request +[sep24-integration-rpc-response]: ../sep24/integration.mdx#json-rpc-response +[sep24-integration-error-codes]: ../sep24/integration.mdx#error-codes diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep6/README.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep6/README.mdx new file mode 100644 index 0000000000..7af76ff6bd --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep6/README.mdx @@ -0,0 +1,10 @@ +--- +title: Programmatic Deposits and Withdrawals +sidebar_position: 65 +--- + +import DocCardList from "@theme/DocCardList"; + +SEP-6 allows for a means by which wallets and/or exchanges interact with an anchor on behalf of users, never requiring the user to directly interact with the on & off-ramp. + + diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep6/configuration.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep6/configuration.mdx new file mode 100644 index 0000000000..dea7867383 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep6/configuration.mdx @@ -0,0 +1,251 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +# Configuration + +To enable SEP-6 deposits and withdraws, the Anchor Platform must be configured to do the following: + +- Provide the necessary service URLs for SEP-6, 12, & 38 endpoints in the `stellar.toml` file +- Provide information about the on & off-chain assets, as well as the payment rails, supported by your business via SEP-6 and SEP-38 `/info` endpoints +- Support the endpoints and callbacks required to request KYC information and provide exchange rates + +## Enable Programmatic Deposits & Withdrawals + +Add the following variables to your environment file. + + + +```bash +# dev.env +SEP6_ENABLED=true +SEP12_ENABLED=true +SEP38_ENABLED=true +``` + + + +### Modify a Stellar Info File + +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 Stellar assets 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" +KYC_SERVER = "http://localhost:8080/sep12" +ANCHOR_QUOTE_SERVER = "http://localhost:8080/sep38" + +# 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. + +### Modify the Assets Configuration File + +Now you're ready to 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 `sep38` sections are methods that will be exposed by the SEP-38 [`GET /info`][sep38] endpoint. + +The methods specified in the `deposit` and `withdraw` sections are the methods that will be exposed by the SEP-6 [`GET /info`][sep-6] endpoint. The methods listed should match the methods defined in the SEP-38 section of the file. + +Also note that fiat assets, those with the `schema: iso4217`, do not need the `sep6_enabled`, `deposit`, or `withdraw` configuration objects specified. In the same way, Stellar assets, those with `schema: stellar`, do not need the `sep38.sell_delivery_methods` or `sep38.buy_delivery_methods` configuration objects specified. + + + +```yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep6_enabled: true + sep38_enabled: true + sep38: + exchangeable_assets: + - iso4217:USD + deposit: + enabled: true + methods: + - ACH + withdraw: + enabled: true + methods: + - ACH + - schema: iso4217 + code: USD + significant_decimals: 2 + sep38_enabled: true + sep38: + exchangeable_assets: + - stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + buy_delivery_methods: + - name: ACH + description: ACH debits for US bank accounts + sell_delivery_methods: + - name: ACH + description: ACH credit for US bank accounts +``` + + + +### Managing Distribution Accounts + +Note that the example above lists a `distribution_account` attribute for the USDC entry. If specified, this account will be provided along with a randomly generated and unique-per-transaction memo to clients as the address to send funds to for withdrawal transactions. The transaction's memo is how you or the Anchor Platform will match the funds received with a transaction record in the Anchor Platform's database. + +If you do not have your own Stellar account and instead use a third party that provides you a Stellar account and memo so they can receive funds on your behalf, such as an exchange or custodian, you should omit the `distribution_account` field from your assets config file. Instead, you'll need to provide the Stellar account and memo you'd like to use to receive funds through a request to the Anchor Platform's [`request_onchain_funds`][request-onchain-funds] on a per-transaction basis. + +To configure the Anchor Platform to expect the Stellar account and memo to be provided via API instead of configured via the assets file, specify the following environment variable. + + + +```bash +# dev.env +SEP6_DEPOSIT_INFO_GENERATOR_TYPE=none +``` + + + +If you use a wallet provider supported by the Anchor Platform's custody service, such as Fireblocks, you can also configure the Anchor Platform to connect directly to your wallet provider to fetch your distribution accounts and memos. If this is configured, the Anchor Platform will also use the wallet provider to send funds to customers. See the [custody services] section for more information about configuring this feature, but first you'll need to specify a different value for the above-mentioned environment variable. + + + +```bash +# dev.env +SEP6_DEPOSIT_INFO_GENERATOR_TYPE=custody +``` + + + +### Enable Callbacks to the Business Server + +Businesses need to collect and validate KYC information on the customers they're facilitating transactions for. Clients ask your business what KYC information needs to be collected and sends that information via the SEP-12 KYC API hosted by the Anchor Platform, but the Anchor Platform never stores personally-identifiable information (PII). Instead, it forwards requests from clients to the business server, and returns the business' responses back to the client, acting as a proxy server. + +Additionally, businesses need to provide clients with a [Rates][get-rates-api] API to check the exchange rates they're offering between the onchain and offchain assets supported by the business. If the rate is competitive, clients also need to be able to request a commitment to the rate currently being offered from business for a short period of time. Similarly to the KYC API, the Anchor Platform makes requests to your business server to fetch exchange rates and quotes and returns them to clients. + +To enable these requests to your business server, first you'll need to add your business server to the docker compose file. Then, to support requests to your business server from the Anchor Platform, you need to enable callbacks. + + + +```bash +# dev.env +CALLBACK_API_BASE_URL=http://business-server:3000/callbacks +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +CALLBACK_API_AUTH_JWT_HTTP_HEADER=Authorization +SECRET_CALLBACK_API_AUTH_SECRET="a secret used to sign JWTs" +``` + + + +The above tells the Anchor Platform to include a [JWT][how-to-use-jwt], signed with the configured secret, in the `Authorization` header of requests made to `/callbacks/` so your server can authenticate the Anchor Platform before processing requests. + +`more_info_url` is an optional URL provided by your business server for wallet applications to display information about previously initiated transactions. This URL is typically used by wallets in their transaction history views, and your business can specify the information to be displayed about the transaction. + + + +```bash +# dev.env +SEP6_MORE_INFO_URL_BASE_URL=http://example.com +SECRET_SEP6_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" +``` + + + +See the [KYC API][platform-api-kyc] and [Rates API][sep38] for details on the endpoints that must be implemented on your business server. + +## 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 something 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 + +SEP6_ENABLED=true +SEP6_DEPOSIT_INFO_GENERATOR_TYPE=none +SEP6_MORE_INFO_URL_BASE_URL=http://example.com +SECRET_SEP6_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" + +SEP10_ENABLED=true +SEP10_HOME_DOMAIN=localhost:8080 +SECRET_SEP10_SIGNING_SEED="a Stellar private key" +SECRET_SEP10_JWT_SECRET="a secret used to sign JWTs" + +SEP12_ENABLED=true + +SEP38_ENABLED=true + +CALLBACK_API_BASE_URL=http://business-server:3000/callbacks +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +CALLBACK_API_AUTH_JWT_HTTP_HEADER=Authorization +SECRET_CALLBACK_API_AUTH_SECRET="a secret used to sign JWTs" +``` + + + +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]: ../sep1/README.mdx +[stellar-demo-wallet]: https://demo-wallet.stellar.org/ +[get-rates-api]: ../../api-reference/callbacks/get-rates.api.mdx +[sep38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md +[platform-api-kyc]: ../../api-reference/callbacks/get-customer.api.mdx +[request-onchain-funds]: ../../api-reference/platform/rpc/methods/request_onchain_funds.mdx +[how-to-use-jwt]: ../sep24/faq.mdx diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep6/getting-started.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep6/getting-started.mdx new file mode 100644 index 0000000000..3a1d875e92 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep6/getting-started.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]: ../../admin-guide/getting-started.mdx +[sep1-ap]: ../sep1/README.mdx +[sep10-ap]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.10/admin-guide/sep6/integration.mdx b/ap_versioned_docs/version-2.10/admin-guide/sep6/integration.mdx new file mode 100644 index 0000000000..2d24140610 --- /dev/null +++ b/ap_versioned_docs/version-2.10/admin-guide/sep6/integration.mdx @@ -0,0 +1,975 @@ +--- +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 require determine if a transaction requires the customer to update their information. The required SEP-9 fields can be communicated to the user by returning a `NEEDS_INFO` status with the required fields in the `fields` attribute. + +After the user has submitted their KYC information, call the `notify_customer_info_updated` JSON-RPC method againto update the transaction status. Additionally, call this method whenever the SEP-12 status for a customer changes, such as when the customer's information is being validated and the status changes from `NEEDS_INFO` to `PROCESSING`. This ensures that any clients configured with a callback URL are notified of the latest customer status, allowing the client to prompt the user to update their information. + + + +```json +// notify-customer-info-updated.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_customer_info_updated", + "params": { + "transaction_id": "", + "message": "Customer info updated", + "customer_id": "45f8884d-d6e1-477f-a680-503179263359", + "customer_type": "sep6-deposit" // or sep6-withdrawal + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh notify-customer-info-updated.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](../custody-services/fireblocks/README.mdx). 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/learn/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-reference/platform/transactions/get-transactions.api.mdx diff --git a/ap_versioned_docs/version-2.10/api-reference/README.mdx b/ap_versioned_docs/version-2.10/api-reference/README.mdx new file mode 100644 index 0000000000..1a9f52ea6c --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/README.mdx @@ -0,0 +1,10 @@ +--- +title: API Reference +sidebar_position: 20 +--- + +import DocCardList from "@theme/DocCardList"; + +View all Anchor Platform API information. + + diff --git a/ap_versioned_docs/version-2.10/api-reference/_category_.json b/ap_versioned_docs/version-2.10/api-reference/_category_.json new file mode 100644 index 0000000000..0d44758281 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/_category_.json @@ -0,0 +1,3 @@ +{ + "collapsed": false +} diff --git a/ap_versioned_docs/version-2.10/api-reference/callbacks/README.mdx b/ap_versioned_docs/version-2.10/api-reference/callbacks/README.mdx new file mode 100644 index 0000000000..54cf2996c5 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/callbacks/README.mdx @@ -0,0 +1,22 @@ +--- +title: Callbacks Server +sidebar_position: 20 +--- + +import { EndpointsTable } from "@site/src/components/EndpointsTable"; + +The Anchor Platform provides several callback functionalities for your business server. + + + +| | | +| ------ | ---------------------------------------- | +| GET | [/customer](./get-customer.api.mdx) | +| PUT | [/customer](./put-customer.api.mdx) | +| DELETE | [/customer/:id](./del-customer.api.mdx) | +| POST | [/event](./post-event.api.mdx) | +| GET | [/fee](./get-fee.api.mdx) | +| GET | [/rate](./get-rates.api.mdx) | +| GET | [/unique_address](./gen-address.api.mdx) | + + diff --git a/ap_versioned_docs/version-2.10/api-reference/callbacks/del-customer.api.mdx b/ap_versioned_docs/version-2.10/api-reference/callbacks/del-customer.api.mdx new file mode 100644 index 0000000000..07d817a0eb --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/callbacks/del-customer.api.mdx @@ -0,0 +1,144 @@ +--- +id: del-customer +title: "Delete Customer Data" +description: "The request for this endpoint is identical to the" +sidebar_label: "Delete Customer Data" +hide_title: true +hide_table_of_contents: true +api: eJztVE1v2zAM/SsCd9gGOHaa7eRb0eZQYBiKpTslASZLTKxNllSRXhsY/u+DHLtptmy/YL7Ypvgh8j2+DljuCco13LTEvsFIsM3geUYYBvNqeT+7WkA2fHy4SocaSUUT2HgHJTzUKCI+tkgsdj4Krg0JdDp441gYEkajY6OkFewF17hx62+3y0/Lh6Uo1Fj02/ZdzRyoLIq94bqtcuWbghitlXF6z0L07JW3RWV9VTSSGGOBytOBGJuCMMzm86tF3ug3U+KZRouM7zduuqPGnXGohXHi2Fu+cRt3O7il64kp9C0JLVkKH8Vji+354XiWGh4qGO/yjYMMfMAo0++dhhI02mmukEGQUTbIacblugOTxhck15CBkw1CCUZDBqRqbCSUHfAhJCtxNG4PfQapCRNRQ8mxxX6bLBS8I6Tkv5h/TK9zgFatUkiUp/iPlxymGwrnE4St0zlkoLxjdJzcZQjWqKGr4julmO7PS/rqOypOXcY0AzbHK2GMPl7sxegL5rMe12P0NgM2bJPfcjD06ckAnxkdGe+O8/yBBygn6mbwU9oWL1I4za1Brv0IETIO6HANJbxwsuiM7hMcGH9OkLXRQgkTVZW0tpLqR161ZBwSzY6+OT7LJliUTtU+JipDKmnczqeWU7bj5D/k83wOlzZqdXCqjt75lsTNWIbE9f2doIDK7EY4xo1DsTquiLgeSop7K3nnYyNC9AmWgeP/znvcC5p2mUQjNYrqMKR/yfdUG4vCDIsdok/EMm4v5EkCom+EFMoadCxeMScXD2n3jzN5m+qMxB1lgfBUWu52qPi88u/+l0oMGzhR5dTeakAFMrBGoSNMIIwLdx2kqlEsBhhO6JZF8fT0lMvhNPdxX4yhVHy6u1l+Xi1ni3ye19zYgbPBEzfSvUo8CsrLbt1Klr8j3Z2W7L+MnsvoKAuMz1wEK41LijHg042LugZ1UtbS6KQStSdOJ11XScKv0fZ9Mj+2GA9QrrdJFKKRVeLHugNtKH1rKHfSEv4DnXdfRlF6L/52udEo3eGkPQDZqEpGQ7/tM6hRaoyv5OpaKQz8KuQPsT1TqyPi0Pe/AB/asHM= +sidebar_class_name: "delete api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +The request for this endpoint is identical to the [`DELETE /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-delete) request defined in SEP-12. + +Delete the customer's data or queue the customers data for deletion. + + + +
+ +

+ Path Parameters +

+
+
+
    + +
+
+
+
+
+ + +
Success.
+
+
+ +
Customer not found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/callbacks/gen-address.api.mdx b/ap_versioned_docs/version-2.10/api-reference/callbacks/gen-address.api.mdx new file mode 100644 index 0000000000..d294ffb4ab --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/callbacks/gen-address.api.mdx @@ -0,0 +1,259 @@ +--- +id: gen-address +title: "Generate Unique Address" +description: "If the platform is configured with `depositInfoGeneratorType: api`, the Platform make this request to" +sidebar_label: "Generate Unique Address" +hide_title: true +hide_table_of_contents: true +api: eJztWFlz6joS/isa34c5OYVZQwK8cYBwCIQQtpCtiJAaW2BLRpIBJ5X/fks2JGS5d6amZh6mKnlJIrW7W+pF39fPFgVFJAs0E9yqWK050i6gwMN6LqSPmEJE8DlzQgkUbZh20SOFQCimW3wumsBBYi3kMAqggnDAHlOxgt5egY+XgLTLFJKwCkFppMU9NyJVTlwh0QyTJXCKYA0yQpr5gDDSEnOFiXHKuMA40wxroGgWIYyIx4BrhIPAYwQbofQ9v+fDN6V+qDRyQiwx12DsYx275YMvkAQdSg4UMf7eM6ZQyNkqhBRSAjGNCOZoBsjHQQAU5Wwt7BzSAuHX891zCUqEkgBSIXERVgiju0GjZxdyDz9crQNVyWSUBs/DMi2kkwmk0IIIL6MgsAu5o8Ozxsf4DRKMK67YJO7NPbFBGxF61DgTKqBoLiTqAwG2ZtzZHVolx+QA1PhIJGBtjg5M7o6FHn9gQkTIdSq+iaNHFGAm1T0XoVaMwrvYp1CojPYak8SDinHt7h93b4fyQfqY0TTjywzznUyAl6IC3ZU3JjrMP1Wvpuejs2GUY5cbN2qUqyM3DLOX/avczZr6rXb9fDwa3LS86wFzGzfTNYT9i7Dn/sbDcY2Ux4te/Ri20dPNYBzVO35pZHf7YbWw7ZdoxybNk6pY4YutcxmcZuVJ2SnKxXZS7Xt1ul2Fx+1xzZlc5MfBRvYp6bRgGJZy3qx/5fYm1eD3RExvt83gmB0LMQjC6nJTxypHj50LvCKbRb2VFbPLzmlQUKPV+Yko1rsX3apdpDAprrxuq2VfN7brhe13xlNSuOwfK88p+erEOZ38PlkHK7Ll+cnaad1EYe180HP4r/zm+Next2w13as2y+drNRXR8eJ0wupndhO3T67r5fbEG86Xw41oqnnpnKzrNyvHni7ydHk2r+ccOKtHg2LgzfKjrM/r/VYt23NIt3Z92hj9GpOmXtXqvdFKnZYv19PbQQk2Ue5ie3whWbUtpk9Fv00vb7xbhgEuyl5Y3Iy9cifH87f85MottkazYvual6OT6/z1qFOsD0aDNb2VZ+fb05msO1GvTmkJjsEf5Ton21M+l0+82xsu+p2u9p/CKp/kO5O8Gk4n7dZ5YTTdzubli1nhmrbqTad2XmQlp9WuecXxWa11rqFEbK80WaxhUco3+ZZ2cTMa/Sb5aSnXWNzOSM/tdzZP4Sh/dXqzbY8WS9loeUs3u4iqZVZak3KwXd/iM5qvXUZ2bdYvF1i9PsB+uRC63V6zbpPF5LQaBroxI8AbOXqOPft2sBr1et2+XTr/vZzmi/3r4/aQNW36ZBfEQDzxKPt0vl2c9cUZy49/NW019XJRd3p7sZou2+VeKXt1+lSFcNsIvV+DYbDMbQo2Pzsrs8nldRYXGrxLTroX86W7XC2i/GXg8JGKTnk+37ws1fnsZFYddpxVuG2XBeS64eppXFrnO63c0eea8tgaMkCZ/uO7qr6r6ruq/pOquudWyhKBwSdM8Ba1KpYDvEqpBKWslKWxo6zKnTVK3sb9xkPK2toKgngvecjNWoAl9kGDNOvPFjNgaRWCjKyUxbEPVsU6eMinjFqpD9BqeIirFMg1SLRhnocUXu9eXqEMxjkEP5hTFGCl4v3H9xYekXalCB03gQnAaSAY1+l7vkNxOAFDG6ZcUAYTJMjn0IBNIQBODZxKMMIUJ/eQOtTg4wjFh40X7x6bjSHKHGhRj6/WkZi/B4DVXuutv1FYg2diotLvMNFOWGUSg/Z+IYMDZkuYgwROILPHWirjgLYPHDhKx9FWxAUfW5VnS0eBCYnSknHHeklZBuMxCdSqaBnCy4NZUYHgCpSRz2ez5tf7iA1CQkCptJWyiOAauDYyB7Azs1BG8PmzYTFbANFWygqkOa5miZn3d/zZYpWj5EuDujVm3AAwc517ALe7tb2GioFxCYpLgKEWiJlosrkByhSUZjxByCbj/9a3D6q/cA49NtPp9CPaSaKdJBISYfR4Ee/d+eEW6EeRf5kBVBCV8QBLngFOImJEKMPvksxWARCGPfYENBMI4QG1d3hW2bHZg3/BF+qP94tHJjcxRz9/wpaZi3F+/kS7zYQLABrs/OagN0IuD27tLZWM7s+3M9zTC8MPtMbENX8d6gxw5APXf6lzmqx+pdjsGO//LQPoh4atTiEXKzdlgsPo0WejKQt46JsmZ6StlGXErZTFqPXw8q5g7j6lxsNL/JOyil+VTUNKIdNoeNgF4kaXVBzdu/2ZxiUE0+wp7APaVygigkLcCmeCRv/FcgTj6ZftgtEvlj/cSvL1Q8rSTHuwP7i1uxrYauDK5G38YCwhsir7lyVlrbEXwuELYzqSD9oVyTsV+4q1a1WszIemkbKSxyPRG0rPqlj76iLY8wyhTs8MdwOl7EQ2DVvsBx4k7TVNhG8Zg4zP40w22pLYFdLZdPbLp2sQceJKwUWoUG1nRpnujuKynO9DaKjpYVLuGPlrJgRSmFi8Mva/1kthbs6wp+cK+ZiCmQC8e182LvPAkHWmjG7TsE3TxK+sfi6F//XQwKToPU/u5J/qNd3ULkEVvJnG87npyu8sf5T/ei5hveXH2/EGcVSslOUxAlzFVb9DEdUAExdQPg7DW3Qrmcxms0njeDdumbtPVabTqjW6g4adT2fTrva9OFENlvAxP1C8m9UA+gB4PgT7+a24vqdB39Og72nQN2/95q3f06Dvqvquqv/nqkqAWILnDeExMwfGDdSPMdbzDm3ffaToDynLFUqbnefnGVYwkt7Li1lOpj8Gg1Om8MwzpGCOPQV/A6h+9Hf84Qh9j4P+5+OgL8OdELFPs7odIbNiXrTGkpmIWpW7h5eU5QKmIA9oXJUQCPTBV59I6Ds612wMrZeXPwEbr0K4 +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +If the platform is configured with `depositInfoGeneratorType: api`, the Platform make this request to the Anchor backend every time a transaction is initiated by a client application. + +The Anchor must guarantee that the memo returned in this request is unique, so it can be mapped 1-to-1 to a Platform resource such as a [SEP-31](https://stellar.org/protocol/sep-31) transaction. + +Here is how this flow would be used for Receiving Anchors that need to create their unique `(account, memo)` pairs outside the platform, using Circle: + +[![](https://mermaid.ink/img/pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1)](https://mermaid.live/edit#pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1) + + + +
+ +

+ Query Parameters +

+
+
+
    + +
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
    + + + + unique_address + + + object + + + +
    +
    + An object containing the unique + `stellar_address:memo` pair used to identify a + destination. +
    + + + +
    +
    +
    +
+
+
+ + + +
+
+
+
+
+ +
+ Error. The Platform will respond to the client application with the + same response code and body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/callbacks/get-customer.api.mdx b/ap_versioned_docs/version-2.10/api-reference/callbacks/get-customer.api.mdx new file mode 100644 index 0000000000..932d7ad907 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/callbacks/get-customer.api.mdx @@ -0,0 +1,563 @@ +--- +id: get-customer +title: "Retrieve Customer's Info" +description: "The request and response for this endpoint is identical to the" +sidebar_label: "Retrieve Customer's Info" +hide_title: true +hide_table_of_contents: true +api: eJztWG1z2zYS/is7uA9pZihKdtJco28eRcnp2jo+y+lNx/bYELES0YAAC4CWNR7995sFSImyGbu13ZvLTfzFFAksnt199gV7wwS6zMrSS6PZkJ3kCBZ/r9B54FqARVca7RDmxoLPpQPUojRSe5AOpEDtZcYVeAM+xzN9evlhfAL9rHLeFGgvz7/LvS/dsN9fSJ9XszQzRd95VIrb5n+vtMabzKj+TJlZv+DOo+1jZtzKeSz6DsveYLC3nxbib43g3gL9yzPdCVXgXGoUIDVMx0e9vf30TJ/pkx3wXCmzdJApido78GZIawD2UniPPstJG5hLVMKFR4f2Cm0wjbToSLaxAi0pbnEhCTJw0LiEBiJcSQ68hkCWOfr0X7FMWfmXjQ9Jqcm8rYEw6EAbDzm/QuBbtI0WKGpfI5Tc8gI9WgcOyeM6vK5lJyA9uNxUimzvK6sjBWqr1aYS213RPSkQxxwvtq8aKTOsBaGAZY4atGlj4BYDjjS6aj+FUY7Z56id575yYOZtlXzOPRR8BVxZ5GIVD2jU3JDiDhcgC3KXOfocoykameT5ubEFp3iBJXfAswxLjyIBi79hFp6MBeelUqARhYPCWAz70tve6FwV9rcWxc9VKbgP5tyc3+0BuOWA9EyzhHm+cGx4ykaNIuw8Ydc9h2V4TSx9wxIW2Vo/vNqjRaZEG46bCDZkC/SNCJawrXfY8PSGSUohv1doVyxhmhfIhkwKlnQkmck7clbbtMDd1v23SBMdW1q8kqZyQJFUszBlCXNZjgVnwxvmVyWd6byVesHW66QbE88yU2nfCWwaQ4988HN1jQIO4mLglc9juiM3LKWPSeJIcU8eCeEezDd4FKYCC9MJiD7AFVcV1vl2vpJ60eZ5wMLB5ZzirVYuIf5ajETa+UKZ+7J+vnw01ouwtgswfSCHBeCVQ0Eh1UB/EPd9gBKGuiqIr4FVOXc5URuvPTv/ItgHcfIsBPMOF6WDGZKZf/x1FBJiClPEusad0MZpiZmcExuk0c+dzAlaz7VPeHmmhcmqArW/Vdoe40BvuXZR74svBGhrCcia78tc1qWxMdSLmBDJXtw5k0kKjhT+Tdm7nSnn1hS7FhZYohYOTF022ud9h+kiTbYZsZEiW2WFipTidkGJoyDiuJePs4XigVm7FniHc16pWA0uUV+m8BPXi4ovEDIjEGrfoIDKEU0m04/w5tXb3l4K/6gKroEKDp8p6kY2cl0CWW5khi6hjuVMF+gcX6BrFcCQ+KQDVR/3kIPPE9YkSUff9wcD+rerzS9cSbHJmNAkcEAZClxTHvFaOu+a6rONhRi6pOxsdbsxkC40PdSAFRU1HKU1V1LgthLF3OVqQ8w6kvvMiFUKx62fEmO5v91gQjRE0+KdaanhNEbCX9ppRi9kRnvUnuzLy1LVkdn/zZGRb+46ycyoIWDkoUhaylyxU6HCWloqrV5Gx0nR4d6kWX5PKjwYjcZHJ+N3LGFHxx9H4+l0cviBJexwPH43vZgcvv/IEnY8/ud4RIvO1wmLDUIXUC6EJJ24OtoB11agI5/eUSbK/TLmzYuZ1DwGY1XMQktBXU5AuUPhDsvUodT6xq3lJEt6LDpMtl5TMxPVa32dGaOQa7Ze04KavuLim5E6jfQURm5ImLBfxseT95PRwcnk4+HF8fhfnybHNTnRWmO7cBGyOmF2w/bSK3r1YduiNjmFcOM1L0oVbTGtsgyd+/HXUQjcqijIwLHwZdxhvH60WpWcU0OAGlzcOa+UWlFz8EKE3MdLIg5SKQ3proloJvYy3J+//qH3aj7f671++73ovd1/Pej9nX8/ED8M3mTzsKkxatt2HVScS+v8RSxct5P8yW5ZDkshLE3ueOruceuEKf5HZdPKPyUaCy7VBRfConMPig+roVn9h46o/xL2uqv+jYlT6VMy+G7kfomjSXcWX+9WgLj7fEvYAI81+F/fxX9oPLw3lRZfgw4h1DxqRx1PuBZ+Roqt+rK5CZB7Lp3U1RToc1PfOMNN0+dsyDbzE6JBuB7HIyqr2JA1HUDGlZrx7HM6o+4MnevFtWmdA7jOcmOpQ2B0FLWYpDJJiwZ/lQ7SQff1cKWz3BpN19BRfYyDg6MJ7LTrmxlKc508CEdub4ulNeSWejR1n9zY67imfXNQcIFNJ7aRt8ylQpoHSEeyKUfFW2IzIgsdOK+nHNBiThjInOlokxdu05a5uudyuD2az+eY+d2Tb6/vOiKOIGqqbNWbBq+whCmZIaXp4U3TlR+UPMsR9oMbtt4d9vvL5TLl4Wtq7KJfb3X9nyaj8eF03NtPB2nuCxU4WxrnC65bgo/RW4lXuOmCXziYEAHuFNNNoH2bin6bin6biv5fTkVjkaMJUr9UXIYGN2Sbm7rinLJNxTlPWG6cp3c3NzPu8JNV6zW9jhMFqkNCOrr1Czacc+XwgZzynEPQTlVi5ZWttpQxmoP8OZjPNBK9B+F2IPsEmH/9oPQeDerx7RPgP31s+gC8ZmL7DBi//pHpPbZ6BjN9pbPT+4xye2L8SPP8jw1W79G4ngtv9TynH1bS4Wx4SrOKHLlA27rjHISy19p154a2c7X5MD5h6/V/AIMyEEU= +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +The request and response for this endpoint is identical to the [`GET /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-get) request and response defined in SEP-12. + +This endpoint allows clients to: + +1. Fetch the fields the server requires in order to register a new customer via a SEP-12 [`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) request + +If the server does not have a customer registered for the parameters sent in the request, it should return the fields required in the response. The same response should be returned when no parameters are sent. + +2. Check the status of a customer that may already be registered + +This allows clients to check whether the customers information was accepted, rejected, or still needs more info. If the server still needs more info, or the server needs updated information, it should return the fields required. + + + +
+ +

+ Query Parameters +

+
+
+
    + + + + + + + +
+
+
+
+
+ + +
+ Valid request. Customer either already exists or the customer + identified by the parameters is new and must provide the field values + described in the response body. Response bodies are identical to the + schema defined in + [SEP-12](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-get). +
+
+ + + + +
+ + Schema + +
+
    + + + +
    + + + + fields + + + object + + + +
    + +
    + + + + property name* + + + + +
    + + + + +
    +
    +
    +
    +
    +
    + +
    + + + + provided_fields + + + object + + + +
    + +
    + + + + property name* + + + + +
    + + + + + + +
    +
    +
    +
    +
    +
    + +
+
+
+ + + + + + The case when a customer has been successfully KYC'd and + approved + + + +
+
+
+
+
+ +
Error.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Not Found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/callbacks/get-fee.api.mdx b/ap_versioned_docs/version-2.10/api-reference/callbacks/get-fee.api.mdx new file mode 100644 index 0000000000..aa52875ec0 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/callbacks/get-fee.api.mdx @@ -0,0 +1,354 @@ +--- +id: get-fee +title: "Retrieve Fees" +description: "The Platform will make this request to the anchor every time a transaction is initiated by a client application" +sidebar_label: "Retrieve Fees" +hide_title: true +hide_table_of_contents: true +api: eJztWFuP27YS/isD9qEt4JXdTQsUfvNJN4XRog2yKQ4O1ouYpkYWuxKpkKN1DMP/vRhSsmRbyZ6k26KXfTJMkXP55j47kaJXTlekrRFT8TpHeFlIyqwrYaOLAkp5h0C59uDwbY2egCxQjiCNyq0DvEe3BdIlggRy0nipmBhoD9po0pIwhdUWJKhCoyGQVVVoJfnSwmw05bYmkLB8W1vCNzpdJguzMCzJLLIoa0+AxteOJZEU2Hs0qTZrkCYFhwr1Pf9TtSdbovPgK1Q605iCNuFBK36JGCn88L/n4VA7LNGQXxiDCr2XrI+FSjpi3ZvnfdUiZqsz2gfBZU9wh1S7eC1DBE0RV5VLt0bIrDslH6jMmxc11Q5H0QBo0spqQ1DKLawQao9pkNTZe50ioCddBrgzRM9fzhH3UDnNPG1rHYatx90nC/PfHE1kqXJp1si2LGUa5OiA9CrHUkZtVggylRVFgXxdVdZFlGuPoKTHZGHESJBcezG9ES8QvbgdiXcXHqtwcn318uLZV3xmK3RB1nkqpmKN9AJRjEQlnSyR0PH1ndDsrm9rdFsxEkaWKKaCfeKN9B5JjAYcO3wJQp3jEtVgAif+rQ3guwYGNtYyOhtGPkvQZmFuZoHyPEVDOmspvrCulHT7RU5U+el4vNaU16tE2XLsCYtCuvb3onKWrLLFeFXY1biUntCNUVm/9YTl2GN1MZk8+zYp088C2wt9xOoiC6y+jBhHu4jpTtC2CrCQ02Yt9iPRuHsqpuRq3I+GYTzS8AEkD/HYwNXBeAZcZ51/JGpRvdLW5j2YhU9gs2MkHnTHBxwwgZ8N9qgGLsuFOboZDyNRWWzk1nPEaqOKOj3PYjDP3idWl1X7CTuYU5M/SpLKYXzTkB3BylLewDCYnzN0aBSmEAgfEkvFiqYPWOlBX/6/DHMS2x/t18PGAOsW5s80BmiuZn89Y0Qd3uj0zA4zA21wojsUxQGdS3kXClYfoddcqebfgZKmXxZtlqGDVGdBFToUxe4k0ueKN2t5zb/jCs3kr2OWAalU6x+y13WwV0xhbiAWrlgalwcNl+BzWxcplJJUHj2pT+jO2E379oRq74k1nTqyppwRUpIQ7rUMj7+aPGL2QjdkGg6RwOry0F0xSjY7asNqj+5xy88nCNP1gZ8izi2f+Moaj57vX04m/HMswHWtuEdMxEgoawgN8Z2eh45/9Xxxd87Yrn5FxSmoctzikI5sMsShS51wN+KQvGJFvj0l0Xwf0jG+GApRQZoKPprF1/2jF4ivGijEfs9fvr68PAfjF1M5G1rmVYFwZUjTtglHT5Jq3wbBCps2GFPYxObykFlrdjxP1qZH3eWqJg5oY2lhmhZago/oQ2unBGacjWVZFTEZbw6da3sFlE0RNq0YsmLoHE8lYULpvBjdwkiTjq2D1gP5hrEEFbpSU9PctkPNybjDg0yk1WXlmF0TiM180wj70cLQ2ZgVxT00n+eZ7/NuAAusJCy/nkzgPzKFV/F8GWahpo4wlYVB5zifsIXW2M4JYRo77nAj8A1gK5tuY+w8kocHKQa9U6fDrtl3/vj6tnPOq3AQ3fKboRgNF9gPPxrknhVliSc+xOgGbP4GyOxHAt8RGs8TXZiX7nArpu28NRL3sqixP3dx+iuRctsMXWHiolxMxTgL85dHd98OX7UrxFS0LbqSRbGS6i5Z1V4b9P4i3k2ayIx+xi28YC7aZJaVY2rRYM+SSTIZzvVbo3Jnja09PG/YeJi9nLdh1tit7Rjaot1sDg7mr5xlAxwG9PfTTTFjHdpgi4NvGzGdO+W6CLO85oE65MBQwA8xmjlbDq48gl9ypmEBP+/ylG+80mPHWmYZKjrmfHp/iEUctRun6NS7DlYRI1FohZzap7u25s4qqXKEy2CGzrrT8Xiz2SQyfE2sW4+bp3784/z51U/XVxeXySTJqSyCd1bWUylNj/ArJKfxHiFM/Ccm3nVx9LR5eto8/bGbp5hKCd/RuCqkNpxlg6fvmkR3E1qx25HIrSf+u9utpMdfXLHf83FsUzn9pTp0PKmYZrLw+AGv/uJVk6+/hH/RBmoQ61iAjlZ0TRESgkeBRwD1H7OM+gCAp8u5T8TwaSP1SEuQB329nd0ex1BPG6pHMs7ZYvD3J6OnJdbvW2J9wFr9zeHjVI2PWWk9EOPtquqPFmxovfWwh58Jd8t/nGbpxPTmdj8SOcoUXW9MnCmFVT8ozobco3Hx+6vXYr//DYJ81Kk= +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +The Platform will make this request to the anchor every time a transaction is initiated by a client application without a `quote_id`. + +The Anchor must ensure that the sending and receiving customers specified in the request meet the KYC requirements necessary to partake in the transaction described in the request. + +The anchor must return the fee it will charge for the transaction. + +In the future, this endpoint may be used to provide estimated fees to client applications prior to initiating transactions. When this change is made, the request schema will be adapted to support the use case. + + + +
+ +

+ Query Parameters +

+
+
+
    + + + + + + + +
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
    + + + + fee + + + object + + + +
    + + +
    +
    +
    +
+
+
+ + + +
+
+
+
+
+ +
+ Unprocessable Entity. This status should be returned when the anchor + understood the request but cannot return a success response. An + example for when this response code would be appropriate is if the + sender and/or receiver is not permitted to initiate a transaction with + the specified amounts. In these cases, the Platform will respond to + the client application's request with a `400 Bad Request` and include + the error message provided by the anchor in the response body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
+ Error. The Platform will respond to the client application with the + same response code and body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/callbacks/get-rates.api.mdx b/ap_versioned_docs/version-2.10/api-reference/callbacks/get-rates.api.mdx new file mode 100644 index 0000000000..9ad8d94bb4 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/callbacks/get-rates.api.mdx @@ -0,0 +1,593 @@ +--- +id: get-rates +title: "Retrieve Rates" +description: "Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must" +sidebar_label: "Retrieve Rates" +hide_title: true +hide_table_of_contents: true +api: eJztW+tv3DYS/1cGOuBi32m1TtIWxQL54CZua+CuDWIb/eD1ebnSyGIjkQpJ7WbPcP/2wwypxz78qJO768Of1pJIDuf9myF9HWVoUyNrJ7WKJtGpEcqKlJ4suEI4kGqhywWCW2pQWo3wQyMXokTlQCv4K+g8H6WFkAqEtegs7NkmLUBYODt585rGnDgsS2FAqAxyKRwcnb3bh6qxbqoai4Af00KoKwQjHAaqwiCkuqoaJVPhMAOnwRUIaSmJsqjrkj5IrcDghwatk+qKR7iegwR+KlCFORYq8R6nKgy37YpvS+FybSrItaEXWxuK14dZVBltUtqWcruSUGlBa2jI0aUFSJdM1VS9Y65SoWCOcC5Vxhtf4MVe4VxtJ+PxcrlMpFqgdbrGTIok1dXYoansWI77CR8a7TARtt4HbabqPJemetAi+ZiG9tMTOO23S3qA2uiFzOgdHL9hReHHWhovYJkTe1MVZN8JUAAty0JiRg95Qc9qu2AmbaobRRr02rU1pjKX6Q5NWr+vTtJSpWWTsUUgzPz4S5nNoBZGVOjQTJVXGutCWK14H0fSFWhgZrEsL0VF5GegDczmzap7XsqyJIUEIhlINeDM9jRsDPPGgcIFGphrVyRwrHhLVlQIS7GKpwqHJDMs5QLN6rJCV+hsxvJk4ltfKrG6bRObZGOwUqUIntRUBfbI5wbc+UdJyuncjt6xYKbqrGaHSVEuWn8xaGutLHoz9zrsdcBiWohSZsKht3IWIPNUG5ki6HxtHaZ07N+FiWREuZDlpivx4n7eHQ7+rHe0pXQFCPj+9PQtWCdcY6cq1RnvYfblwQv4RmTwnXC4FKsZb4QMas0Q4jUziGHGTMxir6Qcccaxp2U5I1vIdVnqpZ3QgiNyhxnbPA/Gj5KUNVUAo/59EhTBzlWIBYKAWltJbkxrN37LVl4pcgah3GWGqaxEaWeQYS6VNwYWOC0FqVa5vGq8Syab5Jx2ogzk8EMjylactqmYUjcyQ0eaSIIAwkrexTf3D69eee8emFq8Jk745VWwgr9BL1b4O7BsPPe6zMCZBh9GqrfiGG4ltbdJa38HsU1NZRotKO28yh7Cx45Fg0X98oqdrNWUsF7q0q3YRsmNdaMy8jE0RhvmHTi8rX/YWGX2/OBfe6NdZrE/m6oojpy4stHkPOKkEl3E0ceRxZpfnRy9Hb18HsX+j6/po67RG8xxFk2iK3R+Whz10S2anF9HklL/hwbNKoojJSqMJpFb1RjFm/CAEuyqZuslybaeiVkCxznMKCHM4rV44GUYIlzQh2yDIj9xqkF7KdwsieLIpgVWIppc+y1MIuuMVFdRHKFqKuK0T4lRHBHJ6OImjmgr0mAWTUhXN/Futro0ssXboQKZoXIyl2haNLALcFTifR88mX1KXNJS6gxpvrEesug8RwOZpB9aJkdk4NG/CeCETeu1p3X8xnbpiYi0gbxu5qVM4T2u+PXgsSUnGlcQBwSZYCEFkCk8P0igTc0+QCjbGJwqBlobK4X03EefNvRWwqUFUl4ZjH6v9FIR4TmWmkQSgg56C/cII3iNHORUz55WJWe/Ac18KHPKYgOGsp0ckcC9A8GyQM7C2pCbT9VgMsMYn0fIRFi7DNJom705eYySwLctrrEgyqVYdTNhfc2EffI2g725zQb7cLrTwXxAvMX4WHIk4A3UKVUPW/NNOKCm6vyQVz0OFh5W+1abSrgeRF5JVzRzho7WW137O6qNdjrV5Xhe6vm4EtahGWOq7co6rMYW69HBwcuvkyr7C5MdyTVSo5xJ7d8jsoe6ccfdPRLsbDyIqRfflsCGeOoPKLFBttstM58IGZYMJHGvGd5heAn8RMMo57YxkQSbavVzk4ZlXLEGyB7pUf0K9/E2cItfbRY7+YGenany/Azx5iMZ4qLJrC4J3e5k6fz45Ed4+fyrr0bPQZR1IUYve6NElSzle+nrQG2uxvQ0Pj758dLPuAwz9qFFzySLxqJ5ZiFtDGcmkWUGLWWmNtbaQjcll4aYOl929SGds0Bb93Eo16pbOrQGwtO8WY1JRlALyQiIuwIECKSbKgr7CyFLMS+Rs9BSU0ivNLcESCwS7SPF6qHGpcgdmp1i9ab+jECZ5UwxG6AT4CKI9ulkhR1E4MLaR5ph+udkJq0vxrhS9hW4xwpellM1p9Lg/Oz0NZBCv/7q4PlGSW81a1BaPaKvI9rDSKhsRHsIMSIpXFXug+e+z41BXwZdYxTMvjg4oAJpqt75nD6jLQo1LPWZQa1I3iyjIQSgBMyVSypUcIFW25+SBzdq4p1a8Z+GsUgbNlfvuNREIlDlV9qIX3pQ1wbZezao9hZ57k0Zp2oghr647Thk7M4TrVdv13noXWCA5dvaba2M3azh7o4mg+C42Tf4hCj5ieIW1Ehr4aZvJOBaUM2Nrn7nEt/ZxLlP5BeUh33FY+n7i4MD+lkX7kmTphRSozhKtXKoHI0ZbHn8s6WB19uE9PxnTCm71YaqOic9GQKp94+S2a5yan1vx2/a8DyMVT/8eApnJ0dvCFwrmNESr3q8PEsIf/QRchcVH6GiScSBi4LWFumj3g7WYurDyLPZ3M8fR3etFmgsEWp7V1SGZTBfDdEAbYKSV6PkFmggM6Om6iZQitl4dNOWulRYULXnu4VGZJL2IUrIpRIqxXht1SUH6jnF2hyNCdWc73zOhW0RLdfMw+gWhvgWa9vqY8chsTelWO9yjGhL8JBWB+ydG8w/N8xluqOwNbu/z/obAtMHafEOpDqEc7ej0mNqpwWBD2rzNnKtN457RLNWEMeQYR3qXK2g0Etf3FPzkB26t6oQCYnXAU79tazeAVzbZvsQfT6Q1aEFfFZOc9wZl7ZaLv4L+Pfztq/iCWS0GU0NhrrrMhNA6TZKDQFmwzdxQThn5LxxmGyFQO6QPkzoPJQ9xWPawCSz5WvOh+muK0JpqbahkxbCXLGME/gnuRw7fW3QIp+SSAW/mcKTGA794gHLwhhBoEI6rOz9ucdjj4cIjEZ2OQgxZsfFj6KqS4TZ4evvuascw+wbI/4tSyk4d6f0l88d/usJmgWFN/+ILg18DMjdt5tDcPhxl1F6G3iUA4cIHmzJd0v7fjy3k1u7pt50U+1tt+v3Zy2mn6PvOFu/iu//JwT9Bu2Acy/8bscXceSkK2nL1Aj+FvENL/8uAJfoZnO+95rW7LfnD2auT/RJOd7oOgzC3wXNGK423MRNHH3x4sU2fjpTtdGEoLg2PFJOulVbT/Fx0EA8vurBzEOHQchsVIbGOh0QbtvgpNM2X9nQGTFXTAKsB2zDwy1/+GepDLJbh8OPPdFqazNoS7Op4nI4dM1pGX9cUBHzV4MQuI5cusgdeu9zna08cv1MeJN3sbMLtQtjblqFnz0woyN+4TX+5S7EzAM2zoUfJmQv2u6cthMJdzxIuCyb34FkGGE7VARb/XHNe1xFk/bkJ464Rtp5AkRVSajz+PiHT35cEU2iMRcO5J9m0Z4CNaaMJlGbX1JRlnORvk/mjZUKrR35sUmIyKG5n+oqIjJS5ZrYDPg6mkQvk4PkYGdQPFmptDBa6cbC60DGwuHb4+52wHox0B6AbB5O10aTKrpjudvX9UWi7U/4K5Fh6zu9YRWSWk4uxGLyfD7G6LyVcZPYYWxsoeSztMFnfbxob5lYHFwu6CrgnvLm+F0k/PlfMI+evRPWShRHpUyR4meXc6PDWqQFwgtWQ6/d0FkS/JWbS2GqHf/j+PXRDydHoxfJAfeU2E5rbV0l1GDhd0hNuAVCe564kV07l3q6T/R0n+jpPtHTfaKn+0RP94me7hP9Fu8TeVRK5e64LoVUBFgZKlwHqHjue8wXcVRo6+j5+ppakmemvLmh1/6QgQBkJrkwy6JJLkqLd8CCvXcB++7D/+JK0U4uPYoO15wCho4iOjt5OB9Pd4ae7gw96s7QHRY5vKH2SLPccK8/wYWiO+S5dtvqcwv0D3O/6A4BDu9aPVJ+v7ULRveaS9ux/Dz8/n8uHd2n0s/A49MtpHti+fo1rk+Q9NPFpMdfTLpDQRsXwj5BQU93lHZdmLkv0G5fR/rvqOBPfm/pnlRwlxYu6MFIUkM0Oad/tChQZGgGJxGHaYr1MJNsnaOsHUR8d3Qa3dz8B08O754= +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must use exchange rates that are communicated to the client application requesting the transaction. When clients make requests to the Platform for these exchange rates, the Platform sends this request to the anchor to fetch it. + +Rates can be [indicative](https://www.investopedia.com/terms/i/indicativequote.asp) or [firm](https://www.investopedia.com/terms/f/firmquote.asp). The anchor must provide an ID and expiration if the client requests a firm rate. + +Anchors can provide discounted rates specific client applications. The Platform includes the `client_id` parameter for this reason. + +Either `sell_amount` or `buy_amount` will be included in requests as parameters, but never both. In the same way, either `sell_delivery_method` and `buy_delivery_method` may be included in requests, but never both, since either `sell_asset` or `buy_asset` is a Stellar asset. + +Upon receiving the response, the Anchor Platform will validate the amount and price of the response. + +If the validation fails, the Platform will respond to the client application's request with a HTTP status code of `502 Bad Gateway`. + +The `sell_amount`, `buy_amount`, `price`, and `fee` are validated as follows: + +- if `rate.fee` exists, + - `rate.fee.asset` must have a positive value of `significant_decimals` defined in the asset configuration. + - `rate.fee.total` must equal to the sum of `rate.fee.details.amount`. + - if the `rate.fee.asset == rate.sell_asset`, `sell_amount ~= price * buy_amount + fee` must hold true. + - if the `rate.fee.asset == rate.buy_asset`, `sell_amount ~= price * (buy_amount + fee)` must hold true. +- if `rate.fee` does not exist, `sell_amount ~= price * buy_amount` must hold true. + +The `~=` is defined as equality within rounding error. The rounding error is defined as `10^(-significant_decimals)` + + + +
+ +

+ Query Parameters +

+
+
+
    + + + + + + + + + + +
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
    + + + + rate + + + object + + + +
    + + + + + + +
    + + + + fee + + + object + + + +
    +
    + An object describing the fees added on top + of the rate provided via the `price` + attribute. +
    + + + +
    + + + + details + + + object[] + + + +
    +
  • +
    + Array [ +
    +
  • + + + +
  • +
    + ] +
    +
  • +
    +
    +
    +
    +
    +
    +
    +
    +
    +
+
+
+ + + +
+
+
+
+
+ +
+ Unprocessable Entity. This status should be returned when the anchor + understood the request but cannot return a success response. In these + cases, the Platform will respond to the client application's request + with a `400 Bad Request` and include the error message provided by the + anchor in the response body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
+ Error. The Platform will respond to the client application with the + same response code and body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/callbacks/post-event.api.mdx b/ap_versioned_docs/version-2.10/api-reference/callbacks/post-event.api.mdx new file mode 100644 index 0000000000..0bb1897fd2 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/callbacks/post-event.api.mdx @@ -0,0 +1,2354 @@ +--- +id: post-event +title: "Receive an Event" +description: "Receive a JSON object representing an event." +sidebar_label: "Receive an Event" +hide_title: true +hide_table_of_contents: true +api: eJylWEtz2zgS/isoXHKhJEf2ZLK8ZVyeqmztTDwj72VtlwwRTREJCTBo0LJKpf++1QAokpL8kMcXi2j0A41+fI0Nd2KJPL3lV4+gHfL7hD+NEGq/Nru6Hn3iif8/vYg/zj/SJlODFU4Z/VXylNcGnRfAEy4BM6tqovGU/w0ZqEdggv179u1PZhbfIXPMQm0BQTull0xoBsQ7vtM84RZ+NoDuNyPXPN3wzGhHctMNF3VdqswrnXxHkr7hmBVQCfrl1jXwlAcFPOG1JROdAiSqkr096KzSS75N4sI+IeGgm4oc4KzQKDJSOc8sCAeSJ4NVdMI1OM8KoZcHRLDWWJ7wn41x0BOQNehMBXbe1NIv3e+77aYA1pMUHMTIzDG7FJotgBkNzOTMFcByU5ZmpfQyvdMj9nDE6gc2YmIgcSWQRSJzhTXNsvCyZlfXDLSsjdIOx4wMqcW6NEIyhUxpv6mv4oHlCko5PlA9dA1ZQKxhlSwf2lOQPWHrP9LqfU7K/A9WW5MBIsWZG/r0ZC2DWwwO9UsDVz4q0brx/DP7cv31WTWet1Pgw1FVgE5U9bGYzI2thOMpp5AZ0VZiiYJfz4DeqejTaPiW8/T2kI0SUFmQFP+KohWh5gn/obT/8NfHEy4q02g3h6cashDVEtAp7fNzLrKMyIHBOpBz4SjKnXIlabvprJldXU8v+DZ5tyVv0XD+kW/vtzET310uEMpyHg7+Ah0RjpMXzfolbk9+lhmeamUB6ZRvDw6rsiP1jSLNOFHOn6f7cDb2mKeGhWrmoCyF/So/IBMWYoFH5grhmJJU4vM1FZRRg2CRCS1Z6CJsBlpSXn7RWWEsJmzROKaNa+mhdfR2jO/0nf7dWCb8lo9T1hbSJKSUkjGfGBamKSWVSWzyXGXKl0/D8qYs151dxNXKaBNz0aDSgPiB/SayH6DlntoDy6PyGPIP/ogPFVQmGoM9axqEfXmf3i/mTXF7rLV4T8XmsTu/haVCB7bXEIKbxxQRbUa/Kv9KuQJsKIIhOFjkZcayP5onkLsFIaUFxNYUo0dZIZRmdD1u7fWSB952KNrJHkXZwO6CPbzoTrhSrmCCYSFsZ0TCVgVYCM1pQKFqvbuPMd9uu+qyC3ufTL3280zliO3hhOztKfvLF61thxveWcB6Ii9bSdstLR9UWs/ZdZd+a+rV2AD5WhFYG41B/fTsjP4d3lHAMQoZNhn15ZCPsUmT57VkFoRcU7LaiB01PLkIEX0zbVWxhZFrEgZVHaPl4lXFSj+KUkmKRQvffe86JpVwp1AafVgEKFEBolhCCAR4cqBRGY2+if6ANU9b5JxwH4UvIujtPYW2K0wLn723XcFTPoGIpBHsI9igoLElT3nhXI3pZJKJslyI7Me4LVajsHcMT6KqSxC+oowzU3FSRGj57w5XX4VNbZx0cRjj5RnU24ETPj2bXozOPo+mn24+fk7PL9LpdPzLv379Hx8CkiHkGOqiXp5y7xPf0FMuoTaoXNfaU650ZshUB0cQB40EsZt2YmMD7aVeZFP6RAbTuBM5coC3cgQsueeRDsc85+HP5OE4NLy6r3Xd6zv9ReVg5zHjXueIudA330LeaImdB+Zh5eSbOsGNtVhXfmylFBl6U8n5rvz5Wr2LoLcKP8GOOLS+wXGtT17Z6MFqNHzey6NjJw0dcvjdnt3BEyVUv/28ZB3oRyjNsDm94ONIapXFTwpl09gMdlPAsG0fDAl9155wQ1tfRN+tiiq41aKc77fvt3uWKUlza7G71/k+R2/5GcasJGw6l6YSVKI61kjQooLD0nGsnvZmk/3loeeGk8je6v7W/tzxUujEWaLXTPojRu9Y3WQxPMCRKxp68wjS2hP7eloNMVRfhAcxSucebFLbDdjhfHw2PjsKN2drnRXWaNMgu4z9GGniZ1hDpvL4VMVyMwTDAe2z61I4wn0EfgiG+KngZbkScmr2LFYbZJWQwBZhjNnJWxWqBKY82Om9foiWjeXWVISKfXyx3quax0F3OoCHD7hDREhgzBWA0KkWeU4PeQPN+/uPqfBDyw6F7o438/CFJ7xUGWj08R0j/0stsgLY1F9DB4PSyWS1Wo2Fp46NXU4iK07+8/Xy6s/Z1Wg6PhsXrio9YCOMVQndE7x7mtTs6Ntl7/Hx9GfMXrJP6pJSexut30Scd8sDzrtPeEH4L73lm81CIPzXltstLf9swK55entPgNIqsSCn3VJnKEBICuEd8rwMlo5uAm6P+PPwyXQAO6+/zW4o7eNTa2Uk8VixosIlVjzlnB56Y9/ZhLUNL4VeNqH5B5n0939tl6DO +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Receive a JSON object representing an event. + + + + + +
+ +

+ 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. +
    + +
    + + + + 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` 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. +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + + 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` 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. +
+
+
+ +
+ The event is invalid or rejected. The response body contains the error + message. +
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/callbacks/put-customer.api.mdx b/ap_versioned_docs/version-2.10/api-reference/callbacks/put-customer.api.mdx new file mode 100644 index 0000000000..7143f1fb83 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/callbacks/put-customer.api.mdx @@ -0,0 +1,1119 @@ +--- +id: put-customer +title: "Create or Update Customer Info" +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: eJztWm1v4zYS/isE70O7C1v2ukFx8LdcugWCXougSXAo4kCmqFHErkSyJJXECPLfiyEl68WSkwP2gFvAXxKZM5o3zgwfkXyhjj1Yur6jF5V1qgRj6f2MPs8taD98/flq/iOd+f+fVvXD6qx++OETcqdguRHaCSXpmn78eJMDOZc8V4ZcFcxlypQkVWCJVI5oMFZYR5jcEV7rJL/8cUFS5lj08eNGbiQKMPBXBZ4vJQasVtICyZQhLheWgEy1EtIRZoCIFKQTnBXEKeJy2Mi77dXtDVk08rf33+fOabteLB6Ey6sk4qpcWAdFwUzzf66NcoqrYpEUKlmUzDowC+DK7qyDcmFBz5fLT6uoTP/RCJ7ryn3YyFFbU8iEhJQISULwInTtohCAZmtdCM4wZJaU7MveX0uehMvRC5KpolBPQj7sY5GodDcjT7ngOREWo/HETApp7TdhPuhRHXy7kWVlHXlkhUiZA29eE35kx4gTzayFdFbb7iojPa3x8DtLtiLdRuT3xj6upGNCol1KFjtincHnTECRovVFsZEJTBlHWMfDbScMiz+tklsvHQPkdhpGlW5kIiQzu65C8l59ZVU4oZlxC0zKOQZgoHIj6YwqDcYbdZnSNdWVa4qDzmg9F/9S6Y6uX2j9Mj4OncExy3MoGT6hdLqmKvkTuKMzqg1qcQIsUkWKf/uFhFVw+RNRWW9C0KEwTyG3nK+VOudURhjRBh6FqizBGqjNjeissSDMF32dUca5qoLth5qvQ1UQZciv1TOk5DxwE1a5PNSbg7SN7b7SHwULCb8cVVpCqcY1IgWTtWoqOtthYrHWda+MEZszAympzceCAAPeiD4Fa2RbP28njYnD6JhFSMGYessqG3Krse1Nww41zijIqsS2KlI6ozmzOfLAs6P3rw3zMUMYx8F+PghLEsBA/fLHRYplEG3kNYR43N3gi9cauMjq1PzarRBNm9uuhg8kVbwqQbpu9/O9u1TYrmWmoo38WRkS1hCyUxXhTNYtE38aop6kd9s2SY59KnSCTDxUoT47YlZnmPjzpuuGPNpa0Kuz+X4dwGDhPIYyP0gHZ5i0IcbxVEV2eIio8z905EHbRDdRH7NWcYHFEpH/5CA9wZTefpIZVfanMwUNMrUkTPNGdvV9D9FDNGuj2EgR1te5wOTDMBfMPGCnKDEN7YdxZzNhrIslK6HTnlpywY5RWZoKVM2KozwGrI19MZhdzFU6zmgdcxArE2ujHoXk41xcuN0oQSvrWDEtvrZjlFaqRBQQy6pMwIxyQMlEER+TkQjj8hhX2EPyjIZZomvqGfbsumATfgb6m0FLmPwyHXtPrfvQMe96fE3/mdD1hhSdK3k0kp4rMbguHw34swODieUzPwMTN0vGYUoULDmqkidVzArBjk5+qSTsjknp8fkcTaf0mZ126mi21Czjy+BPoA3w0CtuLZDteDC2REjrgKWji5pjz3X3miBNp43ivNIsGDNaC7pQOzDTAvYcx0JQMPlQsQeYTm6RTiejSN8uDpHGwtoK3l+VIo3hWYuwrPxXrx1JHKGPxsHC8+i4gQyMYcXULPaaVvwIZr/0vt3B3mLHJBGuwKGrFvfWONyTRzD0CemekO4J6X5LSPcE/k7g7wT+TuDvBP7+Z+BP58opDHhmVIAekwLDjmbvpYTxL+98RyrHzC5mGrOTFbHK4kbMOyW8gVODNG2UymIDFmHBWPsaFT2FcbsyVRYLydVYVo0HqXmrEI8gR60efe//D1f/2mDpFmC/ekMDyvWOrZbLw15xXXEO1mIL+Ko70O/8Ggjm1daejRl4Kf2xQzjV+XpWgjFq4ltrwv5mYwyxaHj7vnXqsx9o3Dg7dOM35cjPqpLpt+BDvX5Ki6dKdH33Qr/Ajq6b07wZ9VDxfad6r/f4zeByVZ+AoBfM5XRN96dqFKvbPOKRIeqqTEHXtIHcnBUF9rAoqazAGp0H3gieWakLqI+quCopqsIY/t6erHwOTE1etlW9/5Brh8Ji2v9dLyDh42PYGYa7vJ2e0UHF7WgHDHcMGWLgHmkE+rb0EcTbEgPQbX/38O2Bjp7ffTTb+RLrg9iW0MWudLVcnc2X/5yvfqQDmDp8YcqvDigdDA6x6AR5OFE95DkY7gPOAXGAMzuhmICXnfj3UGVnvAWTByHvY8gJcgsdO0IHiPGAMrSuQXfDkYOwd7FcNxN6EG6EMGLKALC1hD1O6w1NZccAlfXzbQyAHXAcBriLWzr1hZCj/dlb9SfKZbB6T9TOBBc2bpl5QI/NMNB+iJbRkg7vRvjtpp3kuVES960u6i5pyfnVJentLdR3HdrtqeGNCm0ULi9Rc2FiWm7YKbDtFYOSpUCSXX836ykXBRDh95K0UQgvwqZUc/vAn1Uxwg9uMETkBk+qQkv/zu436Wx9FG87txtYlgF3fc1D/jEVYRujXvJa9679ooJZKjggJFm/0Dq5zzXjOZCVn4Z2cVovFk9PTxHz1EiZh0X9ql38+/Li82/Xn+eraBnlriz82osNuGSyI/jCAN6mUIbcan+vosFF5BLTYDDnnSsCp6sxp6sx3/rVmLrj407uQhdMSGx/vrpeaoB4R/cA8X5Gc2Udjr28JMzCrSleX3H4rwrMjq7v7hGUGsESrOs73BrOgflVco9eL4INc9zgbTHs6DHE66x56Zxz0K7DfgDYewD36vYGsUN9p6cMSxfK9WJn7SPa+Pr6N5WB57o= +sidebar_class_name: "put api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +**The Anchor Platform does not persist any customer KYC data.** + +The request and response for this endpoint are identical to the [`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) request and response defined in SEP-12. + +Client applications make requests with the following request body, which is forwarded to the anchor. Anchors must validate and persist the data passed, and return the customer's `id`. Requests containing only string fields will be forwarded to the anchor as with the `application/json` content type. Requests containing binary fields will be forwarded to the anchor as with the `multipart/form-data` content type. + + + + + +
+ +

+ Body +

+
+
+
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

+ Body +

+
+
+
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Invalid data.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Not Found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/callbacks/versions.json b/ap_versioned_docs/version-2.10/api-reference/callbacks/versions.json new file mode 100644 index 0000000000..923a4cadd5 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/callbacks/versions.json @@ -0,0 +1,12 @@ +[ + { + "version": "3.0.0", + "label": "v3.0.0", + "baseUrl": "/platforms/anchor-platform/next/api-reference/callbacks" + }, + { + "version": "2.10.0", + "label": "v2.10.0", + "baseUrl": "/platforms/anchor-platform/api-reference/callbacks" + } +] diff --git a/ap_versioned_docs/version-2.10/api-reference/custody/README.mdx b/ap_versioned_docs/version-2.10/api-reference/custody/README.mdx new file mode 100644 index 0000000000..9632f1a96f --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/custody/README.mdx @@ -0,0 +1,19 @@ +--- +title: Custody Server +sidebar_position: 30 +--- + +import { MethodTable } from "@site/src/components/MethodTable"; + +The Custody Server provides a set of endpoints to interact with custody services, such as Fireblocks. + + + +| | | +| -------------------------------------------------------------- | --- | +| [Custody Transaction](./create-custody-transaction.api.mdx) | | +| [Payment](./send-payment.api.mdx) | | +| [Refund](./send-refund.api.mdx) | | +| [Unique address generation](./generate-unique-address.api.mdx) | | + + diff --git a/ap_versioned_docs/version-2.10/api-reference/custody/create-custody-transaction.api.mdx b/ap_versioned_docs/version-2.10/api-reference/custody/create-custody-transaction.api.mdx new file mode 100644 index 0000000000..9b03be5755 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/custody/create-custody-transaction.api.mdx @@ -0,0 +1,275 @@ +--- +id: create-custody-transaction +title: "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: eJytV0tz2zYQ/is7uPRCS67T9sCb4zhTTx/R1O7J8WEFrkTEIMAAS8kcjf57ZgFKlGXFk6TVQaKX+358u96oiqIOpmXjnSrVVRfZVz3cUlhRAB0ImSLogcwBXUQtzBBI+1CBcfDu7UQVyrcUUN7cVKpUWXJQdzeKqUIxLqMq7/e2Dt5G9VCop7NIbeK4vZ6d/aaK9Hvxy/Dw5mdhCvS5o8hvfdWrcqO0d0yO5RHb1hqdPJl+ihLVRkVdU4PyxH1LqlR+/ok0q0K1QfxmQ1Hemkq+n6fk9nr2LO6bdxLtoCdyMG6ptoVqqPEvhf+ixsMKbUcFcI0MJkIXqQL2YCpybBY9GDf3navAB/Ad5+cW+4Ycx6/aukvEY3tCBb8A4fjfLBaKXNdIQUylClVjrIWHnlg9bFMK2WtvX3ozG96IR0dpfM2KlDyVW0q9LdQi+OZSa9/lAh+Vx3dBE9wyWYsBMPOdTBv7r2p5R5GNS03zTaqwOa3nMtElXq4JMEbisQyRHE8DaTIrql5R+55OVPY90TelUbSI2RO+fa83j8admIc/jDRODvA7ilpR66ORkVsbrquAa7RK5jg5oB626SOE2HoX8zxenJ+fqHinNcXUpz849tnSr6eU3zim4NDuEPA6BB9+3FIGKhOokhxQUvZwjDqZPMruKiAta9jSiMvZmyFT9MTkYkLN8n6jHqlX5Q48C5VA51UQ3T4IknDtBa9bHxMcIteqVFM+xORCxZSMbKcLVpWqZm5jOZ0Om+Esc0zoCZvWEjpd+zDRvlFiRbL0zwjY15lpB7hjr2QMff53xrmMPCPSJIx4hguj1MGYj8TdwB5T0qwdEPPojIQ8A/vu3RbKuEUCeklI7pk3k/PJuXpRrKGFVHGM0TXtF2oc9qx3jjRHAWmSDmyDiQRrtJYY2uBXpqIQC4idrgEjvDeB5tbrx1iITCRXAboKhnHagzksfDic0AjGGTbIVMHKYBriy1QsmFnkhQ/NBO7qBA9hZTQJUqADtGksWHSzz7M/wOSH+RCEmJp30TiKkSKsay+LB7yjHVzErm19ENv7kCZw4wCryiToHVQvOpe8RWu4B79YUKAK5v1Ju0WiHh8uyefoYYHaWMPI9HLTiTltDTn+KR6jvji2gN53WY0EImZolQSH5BTPVPW+G8VhbawFDma5pAAIv9/dzUCjtXPUj9BgRXuRXc6GZph8dB/d3nYgrHqocUVSBuOYlvnKAoHRrOCoTVJCHLBUUfum9Y5cQnznGXZwVEhJa98t65NOZPcd5bvB+XQ1nGgWWIsp3OVBNp7Xub2Sf+heSBzeUmvMe0iM+AAy0Nmd42rsm3Wv5nJ2kzJ11YVAjm12zzvbn2gziX4cmclHOUOt0eRiQiGHjcztZYu6JrhIwzzCXDmdrtfrCaa3Ex+W00E0Tv+8ubr++/b67GJyPqm5sQmzBUobdAeKr9IxDCcO3mNwOLhk/8stPiwSOdGmrUXjBLhSRJsB4u8VH53dtWyA8l5tNnOM9G+w262QP3cUelXeP8hKCQbnAnH3cpbVhBWFg91zlV0/S5C930Av9+W22Elcak0tv8p7uKRmH27vVKHmw9Hf+EpkAq5lz+JalSr9H5JDKjeZtlEW3bLDpfBmnfL5AvWzi8k= +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server creates custody transaction record in DB. + + + + + +
+ +

+ Body +

+
+
+
    + + + + + + + + + + +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    +
    + object +
    +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/custody/generate-unique-address.api.mdx b/ap_versioned_docs/version-2.10/api-reference/custody/generate-unique-address.api.mdx new file mode 100644 index 0000000000..1119bd8a6e --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/custody/generate-unique-address.api.mdx @@ -0,0 +1,209 @@ +--- +id: generate-unique-address +title: "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: eJylVsFS20gQ/ZWuuexFyCyQUKWbAyahlmQJJlC7G6oYj1rWhNG0MtOycVH+91SPZEOA3cPmJJXc3e9Nv9c9flAlRhNsy5a8KtRRF5nKFUwxLDCA0c5F4BrBkK/svAtYghliIoaFNQhMMEePQTNCiS1Fy6DLMmCMoH0JDTaUf/Vf/QmFRjNQBbc6RuRbaHXQDTIG2IHbyOicDsWX6fFR8f7du+ODw9OTt2fXfxyeH348nlxNj64vDo/Pv1xf7X/6a//48vPk6uTs4NP48mD8+cP+32dnJ2fjN7dfvcoUtULHkj8tVaE27L54+73DcU9NZYr1PKrin+2h+99hE3CTqfudiG2KmU7Od96qLD33DoaX/d8lKOD3DiO/o3KligdlyDN6llfdts6aRGT0LUqDH1Q0NTZa3njVoioUzb6hYbVer9dSK7bkI0YJ2NvdlcfPCk07YzDGXGX/FylTbZAGse1hBq1eQh0/E5MJlrU1dW8IZ9EzxJo6V0JEX0LV+TIRG/AiB+vnap0pscDL+h+xIVho12EGXOttsRkKJJYC2OpVIziz1RPUf8W4TB+f48hXcZ1E/DJSptB3jVjClipTtY61xOA9qxtRkC07CX//mukuBnkHtd+8JvCpZwxeu80MTkKg8Etyi0FtwFJIo1QT1/7sgf7zY+6mrU8ONExJopP4rzOF94w+WvIyIw/qDleq2AxNppK0/zk86xvRjWuSMW0pJnNqrlWhRmlFxFGRnqPBgyh1Y2pMD9kFpwpVM7exGI2G1bTTR+R4r5vWofamppAbapQASsMuHmd20gep4mGdKeurZFSp38uxn+/mu+pFGwZ1VPbca2KdJwtSlih5j4bT/KCI2wYbEZbaOWRoAy1siSFmEDtTg45wYgPOHJm7mElOmi1ZpAEN2gVunBqhogActI/aCHwE6y1bzVjCwupk43E6O5w7zRWFJofL2sbt6rayoUG75DiW2kwpbdrvYvhzNhxCoGZdtD6JAMuaoIsI5NNkSUrs2paCYG+PlMOplwGzwm5Tuup8Yqud5RVQVaFcKsPUPcfN0tcXt5JwjgSVNtZZlouHOp5R58vH5jANM/xb3JbVxlDnWYhVsKKuLyMHERhcpMShOdlPpVbUPabD0joHHOx8jgE0fLi8PE935UybO2h0iduUTc8GM6R7cIsdUJcrqPUCRQbrGef9tQVLy3Vf4JlNUkM8sKhoqGnJy86yETwxbAY9E0lr6ub1qyR6+h77veeJbbV6zSywFCi93Yw6RjK9vRI/7V9kPHEjLLUAehYQClAFano6z9XYmnVbZnx+mjp11IWAnl1Pj7xbvWIzOf3jyOTpD4CzBmXPFg/K60bmdtxqUyPspWF+3BrFaLRcLnOdfs0pzEdDahydnR5NPk0nO3v5bl5z42Tp/QApKz98 +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server calls the configured custody service to generate deposit address and memo. + +Format of `asset` parameter - `stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5` + + + + + +
+ +

+ Body +

+
+
+
    +
    object
    +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + + + +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/custody/send-payment.api.mdx b/ap_versioned_docs/version-2.10/api-reference/custody/send-payment.api.mdx new file mode 100644 index 0000000000..35c005a45e --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/custody/send-payment.api.mdx @@ -0,0 +1,369 @@ +--- +id: 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: eJzNVk1v4zYQ/SsDXnpRZDdJC1S3NHVRA0UbxD4s0OyBpkYWNxSpckZ2BMP/vRhKtpPY3QXaS04SSM7HezN8w50qkUy0LdvgVaHuO+JQ9rDAuMEIRjtHwDWCCb6y6y5iCWY8Qxg31iBwAEJfQqv7Bj3nKlOhxajF5bxUhZLdh2FTZYr1mlTxlxpXSH3O1MsVYZtWF7OHqx9Vlr7Xt+PPzfdyKOLfHRL/HMpeFTtlgmfxWOyUbltnTQo4+UICZKfI1Nho+eO+RVWosPqChtV+v9+LL2qDJyQ5cD2dyuctE4vOGCQSNP8xUqbaKESwHcLY8tUZ4mj9WmXvos5eGKPXDpafYP4LVDE07/nOlQBgy078LE7cPo6YRoi3l1DN/UY7W8LjwOX/Qif1sBFLKRvGGKIU6S3kYfkM9WsAY8fN0slD5rfnmR86cxm1J21kFSyBDwxV6Hz5QaFc//TvUBbjBYqaEZxtLAsifDGIJX5QQD9c7qqxa0fZSAYfNf+bbxfEEnReb7R1euXwIwLZZwpfGD3Z4EU3d+oZe1UchDRTG+06/Kqg7j9nqkGug0h0GygJluZaFWrCp0tGk8KWk/Yg1pmiVOMhaBedKlTN3FIxmYxCdTWcyPFFN61D7U0dYm5CoySkUPZ4UvLZcEgVu32mrK+CECH+h8rc5NN8qs6IGBvtTD6XMqleyaWMsOA9GiYZUyh92kZLCFvtHDK0MWxsiZEyoM7UoAl+tRFXLphnyo6jTfsSIhq0GzyMOYIqRHhNFFhv2WrGEjZWp6l5l7DDg9NchdjksKwtHQenJdAetEuXh8U3h2S2YHROR/hzNYKQUKuOrEciJNjWATpCCB4hVMmEurYNUWIfIeUw96DL0iatHF1XnU/Zame5h1BVKCN91V+Mm6XVszeB5EwBKm2ssyziFTpeiQifyOEAxln0/B0d3WpjQudZEqugD93gRoBIGNwkw5Gc7I2rPnQnc9ha54CjXa8xgobflsuH9FJZafMMjS7xaHLgbGyG/Mk/+WPsiLrsodYblDJYz7geHi2wtVwPDt61SSLEA0sVTWja4NHzYQwdrnomJa1Dt64vJjGk7xFLSdMHtlV/qVlgK6H0gQfQRMEM7ZXy0/7M4lU3wlZLQM8SJMThJZHSeV+NY7Me3dw9zBNT912M6NkN6QXv+gttJuhPVyZ/8ipTzhqUh0ixU143cm/vWm1qhOt0mU+qUUwm2+0212k3D3E9GU1p8vv8fvbHYnZ1nU/zmhsnsvcPSXzImw== +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server calls the configured custody service to send payment. + + + + + +
+ +

+ Body +

+
+
+
    +
    object
    +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Invalid Request.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Transaction is not found.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service rate limit is exceeded.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service is unavailable.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/custody/send-refund.api.mdx b/ap_versioned_docs/version-2.10/api-reference/custody/send-refund.api.mdx new file mode 100644 index 0000000000..8e8e80f876 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/custody/send-refund.api.mdx @@ -0,0 +1,411 @@ +--- +id: send-refund +title: "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: eJzNVktv4zYQ/isDXnpR5DRJC1S3bNZBDfQRxD4UaPZAUyOLG4pUOSM7QrD/fTGU/Ijtbg/bQ3yxMCRn5pvXN6+qRDLRtmyDV4W664hD2cMc4xojGO0cgQm+sqsuYgmH59YgcABCX0LEqvNlvjvnqD1pI1ohogmxBEugHQUwETVjCdbDxw+5ylRoMWq5OStVoUTdY9KmMsV6Rar4Ww0CUp8y9XJB2CbhfPpw8bPK0v/Vzfhx/aNcivhPh8QfQtmr4lWZ4Bk9y6duW2dNMjf5TIL5VZGpsdHyxX2LqlBh+RkNq0y1UZxjiySnDTZB/t+G7HdsAqy16zADrjXDxjoHSwRdllhKhLjGMUDQ6r5BzwJ7tEUcrV+pL1lSv0jCYxMihVCB3PhOI7oJ3RCJtyZuk/xI+aAPy29ouscz/t5jcnfv0hkF6SeZojZ4GgJ8dXl5qmzeGYNEouJ/yqMtD+6M/mRHVqcvjNFrB4u/YPYRqhgaMGNx01D8uRIAbNmJnjn68mEI/OOISQ0Qb86hmvm1draEx6FSvwudVLuNWEpTYIwhSgu8hTyIT1AfAhhbd5pubj2/OfV82+KLgxa3BD4wVGHM9TuEcvXLv0PZTrOoGcHZxrIgwheDOFb/+wP00/mqGqt2nN/pwXv1//q/E2IJOq/X2jq9dPgegXzJFL4werLBCyu9qmfsVbGlqUwlZvgmXX35JLOf6yD01wZKA0tzrQo1OeBRmhS2nMSRCTNFKcWDzS46VaiauaViMhnn1MVwI8cX3bQOtTd1iLkJjRKLErHHPU1Oh0t7mtsPxj0v7WVbGjmWJDo4IAnrq0SZ4umQ4uv8Mr9UJxEdK/ZkDi9qfDN3ZSkJ3qNhEtZDKfg2WkLYaOeQoY1hbUuMlAF1pgZNcG8jLl0wz5TtFhadlhaDdo1bviSoQjzcXAist2zTtrK2OvHZbYoiPDjNVYhNDova0pYR0o7jQbvUhSy6R2aeMzqnI/y5HEGIqWVH1iMREmzqAB0hBL9jTuraNkSxvYOUw8wL49s0dEfVVeeTt9pZ7iFUFcqituzP2s2S9GTL88NqVmljnWWZgqHjZThYJlK0jbPo+QfaqdXGSNbFsQr60A1qBIiYwXV6OAYne6OqD93++bBwcLSrFUbQ8Oti8ZB2z6U2z9DoEndPtjEbiyF/8k9+ZzuiLnuo9RolDdYzrobNEjaW60HBUZmkgHhgyaIJTRs8et7y2XZmZJLSOnSr+qwTg/seh0XMB7ZVf65YYCOm9DYOoImCGcor+af9yYvDPXqjxaBnMRLisJIkd46zsSvWnZrbh1mK1F0XI3p2g3vBu/5MmQn6fcvkT15lylmDstEUr8rrRvr2ttWmRrhKzbyfP8Vkstlscp1O8xBXk/EpTX6b3U3/mE8vrvLLvObGyfz8CoE2aek= +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server calls configured Custody Service to send refund. Custody transaction record is also created in DB. + + + + + +
+ +

+ Body +

+
+
+
    + + + + +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Invalid Request.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Transaction is not found.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service rate limit is exceeded.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service is unavailable.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/custody/versions.json b/ap_versioned_docs/version-2.10/api-reference/custody/versions.json new file mode 100644 index 0000000000..5fe5133350 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/custody/versions.json @@ -0,0 +1,12 @@ +[ + { + "version": "3.0.0", + "label": "v3.0.0", + "baseUrl": "/platforms/anchor-platform/next/api-reference/custody" + }, + { + "version": "2.10.0", + "label": "v2.10.0", + "baseUrl": "/platforms/anchor-platform/api-reference/custody" + } +] diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/README.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/README.mdx new file mode 100644 index 0000000000..33ec426998 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/README.mdx @@ -0,0 +1,17 @@ +--- +title: Platform Server +sidebar_position: 10 +--- + +import { MethodTable } from "@site/src/components/MethodTable"; + +Data on the Anchor Platform is available through two different APIs: A REST API and a JSON-RPC API. Each of these APIs has associated documentation here. + + + +| | | +| ------------------------------------- | --- | +| [REST API](./transactions/README.mdx) | | +| [JSON-RPC API](./rpc/README.mdx) | | + + diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/README.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/README.mdx new file mode 100644 index 0000000000..60798cab01 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/README.mdx @@ -0,0 +1,10 @@ +--- +title: JSON-RPC API +sidebar_position: 20 +--- + +import DocCardList from "@theme/DocCardList"; + +Interact with your Anchor Platform instance through the use of lightweight, easy-to-use RPC requests. + + diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/anchor-platform.openrpc.json b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/anchor-platform.openrpc.json new file mode 100644 index 0000000000..934d78e819 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/anchor-platform.openrpc.json @@ -0,0 +1,8955 @@ +{ + "openrpc": "1.2.6", + "info": { + "title": "Anchor Platform", + "description": "The Anchor Platform is a set of tools and APIs that enable developers and businesses to build their own on and off-ramp services for the Stellar network. It provides a standardized interface, including the implementation of several Stellar Ecosystem Proposals (SEPs), to make it easy for businesses to integrate with Stellar-based wallets and exchanges.", + "termsOfService": "https://stellar.org/terms-of-service", + "contact": { + "name": "Stellar Development Foundation", + "url": "https://stellar.org/connect", + "email": "hello@stellar.org" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "2.10.0" + }, + "servers": [ + { + "name": "Platform API", + "url": "https://platform-server.exampleanchor.com", + "summary": "Example URL endpoint for the Platform Server.", + "description": "Example URL endpoint for the Platform Server. Note: This is an example URL only, you must configure your own Platform Server." + } + ], + "methods": [ + { + "name": "do_stellar_payment", + "summary": "Submits a Stellar payment", + "description": "Submits a payment to a stellar network by a custody service.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "do_stellar_paymentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "do_stellar_paymentExample", + "description": "Example request to the `do_stellar_payment` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Do Stellar payment" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "do_stellar_refund", + "summary": "Submits a Stellar refund", + "description": "Submits a refund payment to a stellar network by a custody service", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "refund", + "description": "An object describing refund associated with this transaction.", + "required": false, + "schema": { + "type": "object", + "required": ["amount", "amount_fee"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount to be refunded", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount of assets to refund", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of refund", + "type": "string" + } + } + }, + "amount_fee": { + "title": "amount_fee", + "description": "Amount of fee", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "The amount of fee", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of fee charged by anchor", + "type": "string" + } + } + } + } + } + } + ], + "result": { + "name": "do_stellar_refundResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "do_stellar_refundExample", + "description": "Example request to the `do_stellar_refund` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Do Stellar refund" + }, + { + "name": "refund", + "value": { + "amount": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_amounts_updated", + "summary": "Update transaction amounts", + "description": "Update amount_out and amount_fee values", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + } + ], + "result": { + "name": "notify_amounts_updatedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_amounts_updatedExample", + "description": "Example request to the `notify_amounts_updated` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Amounts updated" + }, + { + "name": "amount_out", + "value": { + "amount": 1 + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_customer_info_updated", + "summary": "Customer info updated", + "description": "The customer's status for the transaction has been updated. Use this method to notify the wallet of the status change. If `customer_id` and `customer_type` are provided, the transaction status will reflect the customer's status. If not, the transaction status will default to the standard pending status for the SEP.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "customer_id", + "description": "The SEP-12 ID of the customer", + "required": "false", + "schema": { + "type": "string" + } + }, + { + "name": "customer_type", + "description": "The SEP-12 type of the customer", + "required": "false", + "schema": { + "type": "string" + } + } + ], + "result": { + "name": "notify_customer_info_updatedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_customer_info_updatedExample", + "description": "Example request to the `notify_customer_info_updated` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Customer info updated" + }, + { + "name": "customer_id", + "value": "45f8884d-d6e1-477f-a680-503179263359" + }, + { + "name": "customer_type", + "value": "sep31-receiver" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_interactive_flow_completed", + "summary": "Interactive flow completed", + "description": "Platform has collected the transaction amounts and fees from the business", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + }, + { + "name": "amount_expected", + "description": "The amount expected in the payment", + "required": false, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "notify_interactive_flow_completedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_interactive_flow_completedExample", + "description": "Example request to the `notify_interactive_flow_completed` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Interactive flow completed successfully." + }, + { + "name": "amount_in", + "value": { + "amount": 1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_available", + "summary": "Offchain funds are available", + "description": "Funds are ready for the user / recipient to pick up.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "notify_offchain_funds_availableResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_availableExample", + "description": "Example request to the `notify_offchain_funds_available` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Offchain funds available" + }, + { + "name": "stellar_transaction_id", + "value": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_pending", + "summary": "Offchain funds pending", + "description": "Payment has been submitted to external network, but is not yet confirmed", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "notify_offchain_funds_pendingResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_pendingExample", + "description": "Example request to the `notify_offchain_funds_pending` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Offchain funds pending" + }, + { + "name": "external_transaction_id", + "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_received", + "summary": "Offchain funds received", + "description": "Payment is being processed internally by anchor", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "funds_received_at", + "description": "The date and time of receiving funds.", + "required": false, + "schema": { + "title": "datetime", + "description": "A date and time.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + } + ], + "result": { + "name": "notify_offchain_funds_receivedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_receivedExample", + "description": "Example request to the `notify_offchain_funds_received` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Funds received successfully" + }, + { + "name": "funds_received_at", + "value": "2023-07-04T12:34:56Z" + }, + { + "name": "external_transaction_id", + "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + }, + { + "name": "amount_in", + "value": { + "amount": 1 + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9 + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1 + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_sent", + "summary": "Offchain funds sent", + "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" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "funds_sent_at", + "description": "The date and time of sending funds.", + "required": false, + "schema": { + "title": "datetime", + "description": "A date and time.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "notify_offchain_funds_sentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_sentExample", + "description": "Example request to the `notify_offchain_funds_sent` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Offchain funds sent" + }, + { + "name": "funds_sent_at", + "value": "2023-07-04T12:34:38Z" + }, + { + "name": "external_transaction_id", + "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_onchain_funds_received", + "summary": "Onchain funds received", + "description": "Notify that the payment is being processed internally by anchor for SEP-6 or SEP-24. For SEP-31, notify that the payment is being processed by the Receiving Anchor. In the request, amount parameters are optional, but have a strict rule of how to set them. Either none, only `amount_in`, or all of fields (`amount_in`, `amount_out`, `amount_fee`) must be specified. ", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "stellar_transaction_id", + "summary": "Transaction ID on Stellar", + "description": "The unique transaction identifier for this transfer on the Stellar network.", + "required": true, + "schema": { + "title": "hash", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + } + ], + "result": { + "name": "notify_onchain_funds_receivedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_onchain_funds_receivedExample", + "description": "Example request to the `notify_onchain_funds_received` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Onchain funds received" + }, + { + "name": "stellar_transaction_id", + "value": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e" + }, + { + "name": "amount_in", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_onchain_funds_sent", + "summary": "Onchain funds sent", + "description": "Transaction flow is fully completed for SEP-6 or SEP-24 deposit", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "stellar_transaction_id", + "summary": "Transaction ID on Stellar", + "description": "The unique transaction identifier for this transfer on the Stellar network.", + "required": true, + "schema": { + "title": "hash", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + } + ], + "result": { + "name": "notify_onchain_funds_sentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_onchain_funds_sentExample", + "description": "Example request to the `notify_onchain_funds_sent` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Onchain funds sent" + }, + { + "name": "stellar_transaction_id", + "value": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_refund_pending", + "summary": "Refund pending", + "description": "Refund has been submitted, but is not yet confirmed", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "refund", + "schema": { + "type": "object", + "required": ["amount", "amount_fee", "id"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount to be refunded", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount of assets to refund", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of refund", + "type": "string" + } + } + }, + "amount_fee": { + "title": "amount_fee", + "description": "Amount of fee", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "The amount of fee", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of fee charged by anchor", + "type": "string" + } + } + }, + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "notify_refund_pendingResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_refund_pendingExample", + "description": "Example request to the `notify_refund_pending` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Refund pending" + }, + { + "name": "refund", + "value": { + "id": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e", + "amount": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_refund_sent", + "summary": "Payment refunded", + "description": "Refund payment completed", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "refund", + "schema": { + "type": "object", + "required": ["amount", "amount_fee", "id"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount to be refunded", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount of assets to refund", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of refund", + "type": "string" + } + } + }, + "amount_fee": { + "title": "amount_fee", + "description": "Amount of fee", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "The amount of fee", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of fee charged by anchor", + "type": "string" + } + } + }, + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "notify_refund_sentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_refund_sentExample", + "description": "Example request to the `notify_refund_sent` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Refund sent" + }, + { + "name": "refund", + "value": { + "id": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e", + "amount": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_error", + "summary": "Transaction processing error", + "description": "There was an error processing transaction", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_errorResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_errorExample", + "description": "Example request to the `notify_transaction_error` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction error" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_expired", + "summary": "Transaction has expired", + "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" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_expiredResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_expiredExample", + "description": "Example request to the `notify_transaction_expired` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction expired" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_on_hold", + "summary": "Transaction transaction is on hold", + "description": "Notify transaction is currently on hold by the anchor (e.g. compliance hold). Anchor should update message to guide user through the steps.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "user_action_required_by", + "description": "Time and date by which user action is required", + "required": false, + "schema": { + "title": "datetime", + "description": "A date and time.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_on_holdResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_on_holdExample", + "description": "Example request to the `notify_transaction_on_hold` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction on hold, please contact customer service to lift the hold." + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_recovery ", + "summary": "Transaction recovery", + "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" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_recoveryResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_recoveryExample", + "description": "Example request to the `notify_transaction_recovery` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction recovered" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_trust_set", + "summary": "Asset trustline set", + "description": "The user has added a trustline for the asset", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "success", + "description": "Flag which indicates if trustline was configured by user.", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "result": { + "name": "notify_trust_setResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_trust_setExample", + "description": "Example request to the `notify_trust_set` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Trustline set" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_offchain_funds", + "summary": "Request offchain funds", + "description": "The user has to initiate transfer to the anchor", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "This is required if the transaction is associated with a firm quote and for transactions where `amount_in.asset` and `amount_out.asset` are the same.", + "required": false, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + }, + { + "name": "amount_expected", + "description": "The amount expected in the payment", + "required": false, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "instructions", + "description": "A set of SEP-9 fields that describe how the user can complete the offchain deposit", + "required": false, + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The SEP-9 field name" + }, + "field": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the field" + }, + "description": { + "type": "string", + "description": "A human readable description of the field" + } + } + } + } + } + } + } + ], + "result": { + "name": "request_offchain_fundsResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_offchain_fundsExample", + "description": "Example request to the `request_offchain_funds` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Request offchain funds" + }, + { + "name": "amount_in", + "value": { + "amount": 1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + }, + { + "name": "instructions", + "value": { + "organization.bank_number": { + "value": "123456789", + "description": "US Bank routing number" + }, + "organization.bank_account_number": { + "value": "123456789", + "description": "US Bank account number" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_onchain_funds", + "summary": "Request onchain funds", + "description": "The user has to initiate transfer to the anchor", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "This is required if the transaction is associated with a firm quote and for transactions where `amount_in.asset` and `amount_out.asset` are the same.", + "required": false, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + }, + { + "name": "amount_expected", + "description": "The amount expected in the payment", + "required": false, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "destination_account", + "description": "Destination account", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "memo", + "description": "Value of memo to attach to transaction", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "memo_type", + "description": "Type of memo that anchor should attach to the transaction", + "required": false, + "schema": { + "type": "string" + } + } + ], + "result": { + "name": "request_onchain_fundsResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_onchain_fundsExample", + "description": "Example request to the `request_onchain_funds` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Requesting onchain funds" + }, + { + "name": "amount_in", + "value": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_trust", + "summary": "A trustline to the asset isn't set", + "description": "The user must add a trustline for the asset to complete", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "request_trustResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_trustExample", + "description": "Example request to the `request_trust` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Request trust" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + } + ], + "components": {} +} diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/README.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/README.mdx new file mode 100644 index 0000000000..af6f303020 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/README.mdx @@ -0,0 +1,41 @@ +--- +title: JSON-RPC Methods +order: 20 +sidebar_label: Methods +--- + +import { EndpointsTable } from "@site/src/components/EndpointsTable"; + +This section lists the Anchor Platform JSON-RPC API methods that should be called by Stellar clients to update status of the transaction. + +The OpenRPC Specification for JSON-RPC API is available [here](https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/stellar/stellar-docs/main/static/assets/rpc-methods/open-rpc.json). + +Postman collection is available [here](https://documenter.getpostman.com/view/9257637/2s9Y5U1kra) + + + +| | | +| --- | --- | +| | [notify_interactive_flow_completed](notify_interactive_flow_completed.mdx) | +| | [request_offchain_funds](request_offchain_funds.mdx) | +| | [request_onchain_funds](request_onchain_funds.mdx) | +| | [notify_offchain_funds_received](notify_offchain_funds_received.mdx) | +| | [notify_onchain_funds_received](notify_onchain_funds_received.mdx) | +| | [notify_amounts_updated](notify_amounts_updated.mdx) | +| | [notify_refund_pending](notify_refund_pending.mdx) | +| | [notify_refund_sent](notify_refund_sent.mdx) | +| | [do_stellar_payment](do_stellar_payment.mdx) | +| | [do_stellar_refund](do_stellar_refund.mdx) | +| | [notify_onchain_funds_sent](notify_onchain_funds_sent.mdx) | +| | [notify_offchain_funds_sent](notify_offchain_funds_sent.mdx) | +| | [notify_offchain_funds_available](notify_offchain_funds_available.mdx) | +| | [notify_offchain_funds_pending](notify_offchain_funds_pending.mdx) | +| | [request_trust](request_trust.mdx) | +| | [notify_trust_set](notify_trust_set.mdx) | +| | [notify_customer_info_updated](notify_customer_info_updated.mdx) | +| | [notify_transaction_error](notify_transaction_error.mdx) | +| | [notify_transaction_expired](notify_transaction_expired.mdx) | +| | [notify_transaction_recovery](notify_transaction_recovery.mdx) | +| | [notify_transaction_on_hold](notify_transaction_on_hold.mdx) | + + diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/do_stellar_payment.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/do_stellar_payment.mdx new file mode 100644 index 0000000000..3f82ad67fb --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/do_stellar_payment.mdx @@ -0,0 +1,13 @@ +--- +title: do_stellar_payment +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "do_stellar_payment")[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/do_stellar_refund.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/do_stellar_refund.mdx new file mode 100644 index 0000000000..6816862774 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/do_stellar_refund.mdx @@ -0,0 +1,13 @@ +--- +title: do_stellar_refund +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "do_stellar_refund")[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_amounts_updated.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_amounts_updated.mdx new file mode 100644 index 0000000000..8daed8f441 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_amounts_updated.mdx @@ -0,0 +1,13 @@ +--- +title: notify_amounts_updated +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_amounts_updated")[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_customer_info_updated.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_customer_info_updated.mdx new file mode 100644 index 0000000000..ffc4795d88 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_customer_info_updated.mdx @@ -0,0 +1,15 @@ +--- +title: notify_customer_info_updated +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_customer_info_updated", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_interactive_flow_completed.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_interactive_flow_completed.mdx new file mode 100644 index 0000000000..55ba759ec8 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_interactive_flow_completed.mdx @@ -0,0 +1,15 @@ +--- +title: notify_interactive_flow_completed +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_interactive_flow_completed", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_offchain_funds_available.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_offchain_funds_available.mdx new file mode 100644 index 0000000000..9bca880e34 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_offchain_funds_available.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_available +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_available", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_offchain_funds_pending.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_offchain_funds_pending.mdx new file mode 100644 index 0000000000..a7573189ca --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_offchain_funds_pending.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_pending +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_pending", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_offchain_funds_received.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_offchain_funds_received.mdx new file mode 100644 index 0000000000..9e19062eeb --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_offchain_funds_received.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_received +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_received", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_offchain_funds_sent.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_offchain_funds_sent.mdx new file mode 100644 index 0000000000..5478e2b595 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_offchain_funds_sent.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_sent +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_sent", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_onchain_funds_received.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_onchain_funds_received.mdx new file mode 100644 index 0000000000..24ef7eacac --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_onchain_funds_received.mdx @@ -0,0 +1,15 @@ +--- +title: notify_onchain_funds_received +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_onchain_funds_received", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_onchain_funds_sent.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_onchain_funds_sent.mdx new file mode 100644 index 0000000000..1a776c9582 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_onchain_funds_sent.mdx @@ -0,0 +1,15 @@ +--- +title: notify_onchain_funds_sent +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_onchain_funds_sent", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_refund_pending.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_refund_pending.mdx new file mode 100644 index 0000000000..bc24b12291 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_refund_pending.mdx @@ -0,0 +1,13 @@ +--- +title: notify_refund_pending +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_refund_pending")[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_refund_sent.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_refund_sent.mdx new file mode 100644 index 0000000000..fc0255d3fe --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_refund_sent.mdx @@ -0,0 +1,13 @@ +--- +title: notify_refund_sent +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_refund_sent")[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_transaction_error.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_transaction_error.mdx new file mode 100644 index 0000000000..83b48d8f83 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_transaction_error.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_error +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_error", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_transaction_expired.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_transaction_expired.mdx new file mode 100644 index 0000000000..6587a4cf9b --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_transaction_expired.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_expired +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_expired", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_transaction_on_hold.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_transaction_on_hold.mdx new file mode 100644 index 0000000000..bd00841ec1 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_transaction_on_hold.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_on_hold +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_on_hold", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_transaction_recovery.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_transaction_recovery.mdx new file mode 100644 index 0000000000..d134b53937 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_transaction_recovery.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_recovery +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_recovery", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_trust_set.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_trust_set.mdx new file mode 100644 index 0000000000..5968934e5e --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/notify_trust_set.mdx @@ -0,0 +1,11 @@ +--- +title: notify_trust_set +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_trust_set")[0]} +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/request_offchain_funds.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/request_offchain_funds.mdx new file mode 100644 index 0000000000..7066f66bbb --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/request_offchain_funds.mdx @@ -0,0 +1,13 @@ +--- +title: request_offchain_funds +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_offchain_funds")[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/request_onchain_funds.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/request_onchain_funds.mdx new file mode 100644 index 0000000000..6c14cd105a --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/request_onchain_funds.mdx @@ -0,0 +1,13 @@ +--- +title: request_onchain_funds +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_onchain_funds")[0] + } +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/request_trust.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/request_trust.mdx new file mode 100644 index 0000000000..62a368d0ae --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/methods/request_trust.mdx @@ -0,0 +1,11 @@ +--- +title: request_trust +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_trust")[0]} +/> diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/rpc/overview.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/overview.mdx new file mode 100644 index 0000000000..aa544d766e --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/rpc/overview.mdx @@ -0,0 +1,16 @@ +--- +title: Overview +sidebar_position: 10 +--- + +JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. + +It's simple and easy to use, as it uses a single HTTP endpoint and a JSON object that contains the method name and parameters. It is transport agnostic in that the concepts can be used within the same process, over sockets, over http, or in many various message passing environments. It uses [JSON](http://www.json.org/) ([RFC 4627](http://www.ietf.org/rfc/rfc4627.txt)) as data format. + +:::note + +All member names exchanged between the Client and the Server that are considered for matching of any kind should be considered to be case-sensitive. + +::: + +You can read more about JSON-RPC protocol [here](https://www.jsonrpc.org/specification). diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/transactions/README.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/transactions/README.mdx new file mode 100644 index 0000000000..3ee4b6728c --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/transactions/README.mdx @@ -0,0 +1,19 @@ +--- +title: Transactions +sidebar_position: 10 +--- + +import { EndpointsTable } from "@site/src/components/EndpointsTable"; + +Transactions are representations of a SEP transaction. It holds information about the protocol being used, and all necessary information passed by an external party (such as wallet or an anchor). + +Should not be confused with stellar [transactions](/docs/learn/glossary#transaction). + + + +| | | +| --- | -------------------------------------------- | +| GET | [/transactions/:id](get-transaction.api.mdx) | +| GET | [/transactions/](./get-transactions.api.mdx) | + + diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/transactions/get-transaction.api.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/transactions/get-transaction.api.mdx new file mode 100644 index 0000000000..0ec826764d --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/transactions/get-transaction.api.mdx @@ -0,0 +1,3642 @@ +--- +id: get-transaction +title: "Retrieve a Transaction" +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." +sidebar_label: "Retrieve a Transaction" +hide_title: true +hide_table_of_contents: true +api: eJzdlU1v4zYQhv/KYE4toMheJ9iDbmlhFAaK1kjSUxpkaXJscSORDDlyYhj678XQMizvpsF2eyjQkz5mOF9659EeWW0SVvd4F5VLSrP1LuFDga8XiUK23M6XFx+xyNfZ1XBz+UGcfKCo5MjCYIUb4lEULNBQ0tGG/FThMvqtNZSAawLr1j62+Sw40pSSijtY+5itqy5ZRykBezDEFFvrKFsSKybw6/zAp2xgDTm2a0sGVjv4ZM2nAgxpawjsGpTbweDYdolhRcDqiZwk0N6xdR1BiF4KsW7zZfQClDMSALzLNomcrHclFhhUVK0UKdPao5Veg+IaC3SqJazQGiww0nNnIxmsOHZUYNI1tQqrPfIuiFfiaN0G+/5BnFPwLlES+2w6lcv5NEeThrXvnJFSpBVyLN4qhMbqPODJ5yRH9qOU3tHv61zukNyvPpPmszLvD3UnCljgk3X5gRV36XATmcyjYtEBW27ovKjb+fIj9sV3J1Ct7xw/0msgzWQOamLrckePSmsxf2Mhs6t/U8m3ZLj8gP1D3/d9gVdvfa2flIEbeu4o8T/5TF9WHKJsHNuDLihGH98QUCHdvKGr844Pp0cdzfOLYxNX70vOef4O2f1H/fQF0iuTSxluovon2mF1ZFyBW9V09C7rZClb4toPoMt7zzVWOBlxIk321vRZSXF7BEIXG6ywZg6pmkxCo1jQd3FwKelVtaEh5XTtY6l9i5JK8CgtS5DD8C/LaTnFU3fLIQ7c5jhf0fauJjjmgkMusAmUA+uYolMNaN8G78hxCQuGVPuuMULG2icmA9aBghDtVojriF98fMocHDxFAisCpTM0Vw3BOvo243GRUxCXcFfbdExPTq2agf9jwq+JdZ0jd8FIsnPQj8YLXaaz5QTXy0X5p/xkGqvJJZJpDbi9DkrXBLM8r9P0q8nk5eWlVNla+riZDEfT5NfFz/PfbucXs3Ja1tw2WVzBJ26VGwW+IY6WtgQK3vnR7U/78L/95w2ryPTKomjrZEvzqPfDXtzj+MNhgZU1sp0iLrHu9yuV6I/Y9L28fu4o7rC6f5BljFaEkpfH2CT3Bqu1ahK9M+ofbgYY/Ah/V+DwUrndaedRiJ9pYI0wvMCalKE4wsS11hR4dOQryJ3R4Zf5Hfb9X9LROYE= +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/platform/transactions/platform-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +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. + + + +
+ +

+ Path Parameters +

+
+
+
    + +
+
+
+
+
+ + +
Transaction found.
+
+ + + + +
+ + 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. +
    + +
    + + + + 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` 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. +
    + + + +
    +
    +
    +
    +
    +
    +
    + + + + + + +
    + + + + 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` 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
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Transaction not found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/transactions/get-transactions.api.mdx b/ap_versioned_docs/version-2.10/api-reference/platform/transactions/get-transactions.api.mdx new file mode 100644 index 0000000000..3bf2323413 --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/transactions/get-transactions.api.mdx @@ -0,0 +1,4275 @@ +--- +id: get-transactions +title: "Retrieve a List of Transactions" +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`." +sidebar_label: "Retrieve a List of Transactions" +hide_title: true +hide_table_of_contents: true +api: eJztWN9P20gQ/ldG+3IgGUMpuoe8cSd6QuJ6qGmfKAobexxvWe+6O+MAjfK/n2btJA4JAVrpKp36ZGc9u/PtN78zU6wnpAZX6mPQjnTGxjtS14m6PyCs45fh2eXB7yqJz+OT7uXtGxHyNQYtW85zNVAT5LVTEpUjZcHU8lMN1Km1/o6APXxtMDyANcTgC+DeJih8gBzJBMxheHaZwsfSEOjaADV17QMT1HpiXFSbgHY5GP6NoPZEZmwR9mQpYOarCl2O+b4orPQtQtVYNrVFCPi1QeIelD4EUYlgNbFoQjAEAXVWYg53JTrgEsE11RiDgEeLFToWGW6CwxzGD1EEXV5741j2U6WtxQBcagd18FOTYw43cvyIzDe8SVWiah10hYxBWJ8pI5RFdCpRTleoBoqwVokS+MKPGnBoMFGUlVhpNZgpfqijGAfjJipR6JpKTCjmi6YTs80f2+XC+9umXjfDGK13E+MmwhGLCcQYap5sB+ZDjmE0lpXn0WQBNWM+0qwSFbUWGEYBMzTTdvlaIBa6sawGffEN6MMaM1MYJCgM2lwI5vWL3BlrYYwQEUbrpPDeMyatLGHmXa7DA5AP0Va93WByMA40Zehy4WKqbYPpZ3eeYto5g6mQWFd167nH4ANUPuA6CENgcnRsMm1FMT4scYna1mlM/gy/LyJXU9YF3jqLsr6DvqhgjZmlr7fMGgLXWJuAtvYxw1zGby09y5tJBCUQcKJDbpFIooW8wG21wd77TxcXQ7g4HX7cTz+7dz4A3uuqtgKhc4tIMFT6AZznyFcHOY98k6/WqRaFJHHuJmAce7jZ5mA3MEaRENQpnAuuZNulvDtYXYwe26xNNF3UFybIdQsvSa416A6mVm7ztM2JNTeEtM3sOgQtooaxom3usG7ny0VybM9c3EcYfAyy50rGZV6swagStXjNYwIqGkmtIntfx1SUKAzBi4vWbayMiNFa3V/Be8bgtO0tNYRhtLQQsQ785NcemIWAdlm5ppRDQ49PEEb9qNLhFmPC8X4U83H3bnWY9M8kqRr9Mzu/WVezJGxkXOFHTZ3rNWRZQ+wrDGufrxPFhq0YahgNMTy7PLVWzTcC852xUgg2S+PK/aMLxJjq/CQ6skTJosAkUMRjYiwQ5Ib02GIOe11WgDGWemp82H/SB5cVapsTGsc4ibws08zx0WaOMd9QYGog4ybig6hDVsbamsLfDcWwrj0ZNlN8OhwilLbuvhDMJpZLqedd7WYPDWEkNfOOjWt8Qx24FKJk5hvHbaog0AxHqZpfi/tT7Z1E5mCmjo+O5LGup9cGQeEbl6cxghyjY5HWdW1NFluYwy8kW2a9G3mH/xSxB+ju5sdfMIu+23lP7/wLQzw8u/w98vZy+eOTV254+0bNr+dzcdWTbVf+Q+fwoe2rXnPXxwDqID0lm5bcNqdspLd5oky+ZXne742uut29oDuLC4tLnOy2m0TS6233k+4zl0zM6CimcHGdW3xQg0UXn6iY8Xd28+LZFXLpu1Y+dqRcqoE6fFQfCMN00aU2waqBKplrGhwe1lZz4UN10IqkXTlv03Sa+SrGj6REua0c0vL+Nj1Kj3rud9mdA8N4zkY9kwZ9oQtaXZLhtJOaH2sMSLXwDh2ncM5ApW9sLomm9CS1W9o6qIOZakZwyHc+3MaC3kl23YbOMuxKZxF8Ffuh86gCuRtNOvXoJLlSlBg3ZJx0POyhQM7KeHJbBKKApGzcGH1k1wQME5xenqefnUqUNRk6QmGrS4OntYwicBz5WrE/ODy8u7tLdfya+jA57LbS4cX5n2fvh2cHx+lRWnLVlpvaE1fa9Q7+gBwMThE0XHSD2a5pbraKiV+D3e7BrotqxnuWCDFOAj6abtaF2JXiR+O3uKmsz2ZjTfgp2PlcltuaKIG3qOZqUGhLuMM6ex+6HLIPr5j0noDdppV2Du1yioqV5OV4/m8z206meoPxD9P1a0b7aTPa8zb+fgP/173+7sheDZ3f66+v7Pd3wunPH9+J58d7/ucRLseSFcZr+RGMgFSDK/nTrUQtfrJqzk6zDGvu7dpoLdd6sr/OPqr5/F+ZpqBM +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/platform/transactions/platform-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +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 +

+
+
+
    + + + + + + +
+
+
+
+
+ + +
Transaction found.
+
+ + + + +
+ + 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. +
    + +
    + + + + 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` 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. +
    + + + +
    +
    +
    +
    +
    +
    +
  • +
    + ] +
    +
  • +
    +
    +
    +
    + + +
    + + + + 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` 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
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Transaction not found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.10/api-reference/platform/transactions/versions.json b/ap_versioned_docs/version-2.10/api-reference/platform/transactions/versions.json new file mode 100644 index 0000000000..6bae1b77eb --- /dev/null +++ b/ap_versioned_docs/version-2.10/api-reference/platform/transactions/versions.json @@ -0,0 +1,12 @@ +[ + { + "version": "3.0.0", + "label": "v3.0.0", + "baseUrl": "/platforms/anchor-platform/next/api-reference/platform/transactions" + }, + { + "version": "2.10.0", + "label": "v2.10.0", + "baseUrl": "/platforms/anchor-platform/api-reference/platform/transactions" + } +] diff --git a/ap_versioned_docs/version-2.10/assets/SEP24-state-diagram.png b/ap_versioned_docs/version-2.10/assets/SEP24-state-diagram.png new file mode 100644 index 0000000000..65d2bb5363 Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/SEP24-state-diagram.png differ diff --git a/ap_versioned_docs/version-2.10/assets/anchor-platform-architecture-1.png b/ap_versioned_docs/version-2.10/assets/anchor-platform-architecture-1.png new file mode 100644 index 0000000000..0917091187 Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/anchor-platform-architecture-1.png differ diff --git a/ap_versioned_docs/version-2.10/assets/anchor-platform-architecture-2.png b/ap_versioned_docs/version-2.10/assets/anchor-platform-architecture-2.png new file mode 100644 index 0000000000..6e2c1e64b5 Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/anchor-platform-architecture-2.png differ diff --git a/ap_versioned_docs/version-2.10/assets/anchor-platform-sep24-demo-wallet-widget.png b/ap_versioned_docs/version-2.10/assets/anchor-platform-sep24-demo-wallet-widget.png new file mode 100644 index 0000000000..b2461d306e Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/anchor-platform-sep24-demo-wallet-widget.png differ diff --git a/ap_versioned_docs/version-2.10/assets/anchor-platform-sep24-demo-wallet.png b/ap_versioned_docs/version-2.10/assets/anchor-platform-sep24-demo-wallet.png new file mode 100644 index 0000000000..169f450fa3 Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/anchor-platform-sep24-demo-wallet.png differ diff --git a/ap_versioned_docs/version-2.10/assets/anchor-platform-sep31-demo-wallet-widget.png b/ap_versioned_docs/version-2.10/assets/anchor-platform-sep31-demo-wallet-widget.png new file mode 100644 index 0000000000..be483f58c9 Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/anchor-platform-sep31-demo-wallet-widget.png differ diff --git a/ap_versioned_docs/version-2.10/assets/sep24-deposit-flow-diagram.png b/ap_versioned_docs/version-2.10/assets/sep24-deposit-flow-diagram.png new file mode 100644 index 0000000000..6a45a3e108 Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/sep24-deposit-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.10/assets/sep24-withdrawal-flow-diagram.png b/ap_versioned_docs/version-2.10/assets/sep24-withdrawal-flow-diagram.png new file mode 100644 index 0000000000..f69ee06dad Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/sep24-withdrawal-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.10/assets/sep31-transition-diagram.png b/ap_versioned_docs/version-2.10/assets/sep31-transition-diagram.png new file mode 100644 index 0000000000..8dae3cd7b0 Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/sep31-transition-diagram.png differ diff --git a/ap_versioned_docs/version-2.10/assets/sep6-deposit-flow-diagram.png b/ap_versioned_docs/version-2.10/assets/sep6-deposit-flow-diagram.png new file mode 100644 index 0000000000..fa947373ae Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/sep6-deposit-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.10/assets/sep6-withdrawal-flow-diagram.png b/ap_versioned_docs/version-2.10/assets/sep6-withdrawal-flow-diagram.png new file mode 100644 index 0000000000..187b871aac Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/sep6-withdrawal-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep24_deposit_job.png b/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep24_deposit_job.png new file mode 100644 index 0000000000..30b8059f85 Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep24_deposit_job.png differ diff --git a/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep24_deposit_webhook.png b/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep24_deposit_webhook.png new file mode 100644 index 0000000000..630d9173d0 Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep24_deposit_webhook.png differ diff --git a/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep24_withdrawal_job.png b/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep24_withdrawal_job.png new file mode 100644 index 0000000000..a768c5218f Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep24_withdrawal_job.png differ diff --git a/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep24_withdrawal_webhook.png b/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep24_withdrawal_webhook.png new file mode 100644 index 0000000000..4005a81d27 Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep24_withdrawal_webhook.png differ diff --git a/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep31_receive_job.png b/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep31_receive_job.png new file mode 100644 index 0000000000..3150663fe1 Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep31_receive_job.png differ diff --git a/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep31_receive_webhook.png b/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep31_receive_webhook.png new file mode 100644 index 0000000000..7a66bbdcc9 Binary files /dev/null and b/ap_versioned_docs/version-2.10/assets/sequence_diagram_sep31_receive_webhook.png differ diff --git a/ap_versioned_docs/version-2.11/README.mdx b/ap_versioned_docs/version-2.11/README.mdx new file mode 100644 index 0000000000..6f5587ec14 --- /dev/null +++ b/ap_versioned_docs/version-2.11/README.mdx @@ -0,0 +1,12 @@ +--- +title: Anchor Platform Introduction +sidebar_position: 10 +--- + +# Anchor Platform + +The Anchor Platform is a set of tools and APIs that enable developers and businesses to build their own on and off-ramp services for the Stellar network. It provides a standardized interface, including the implementation of several Stellar Ecosystem Proposals (SEPs), to make it easy for businesses to integrate with Stellar-based wallets and exchanges. + +The platform also includes features for managing assets, transactions, and user accounts, and supports a variety of deployment options, including using Docker or Kubernetes. Overall, the Anchor Platform aims to simplify the process of building and managing a Stellar-based financial service, allowing businesses to focus on providing value to their customers. + +Learn about integrating with the Anchor Platform in the [Admin Guide](./admin-guide/README.mdx) or get API information in the [API Reference](./api-reference/README.mdx). diff --git a/ap_versioned_docs/version-2.11/admin-guide/README.mdx b/ap_versioned_docs/version-2.11/admin-guide/README.mdx new file mode 100644 index 0000000000..d955ccbfc7 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/README.mdx @@ -0,0 +1,10 @@ +--- +title: Admin Guide +sidebar_position: 10 +--- + +import DocCardList from "@theme/DocCardList"; + +All you need to know about setting up, running, and using the Anchor Platform. + + diff --git a/ap_versioned_docs/version-2.11/admin-guide/architecture.mdx b/ap_versioned_docs/version-2.11/admin-guide/architecture.mdx new file mode 100644 index 0000000000..d9abf6435c --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/architecture.mdx @@ -0,0 +1,69 @@ +--- +title: "Architecture" +sidebar_position: 20 +--- + +## Architecture + +Before starting with the Anchor Platform, let's get familiar with the architecture. This section will describe the components involved and how they interact. + +### Fundamental Architecture + +The following architectural components are required for all deployments of the Anchor Platform. + +[![fundamental anchor platform architecture](../assets/anchor-platform-architecture-1.png)](../assets/anchor-platform-architecture-1.png) + +#### Client + +The client is an application, such as a wallet or remittance sender, that acts on behalf of a user and makes requests to the system. Clients make requests to the SEP server component of the Anchor Platform using sets of standards called [SEPs][seps] (Stellar Ecosystem Proposals). + +#### SEP Server + +The SEP server is a client-facing server and therefore needs to be accessible from an external network. The SEP server processes user requests and manages the state of transactions they initiate. When the SEP server needs to provide information it doesn't have to the client, such as the exchange rate for an asset pair or the KYC status of a customer, it makes synchronous [callback][callback-api] requests to the business server and returns the information in a SEP-compliant format. + +:::note + +The SEP server will never store any sensitive information, such as KYC (PII), in the database. + +::: + +#### Business Server + +The business server is a service that you (the business) must implement to connect the Anchor Platform with your internal systems. The business server responds to callback requests sent by the SEP server, such as requests for a quote, receives events sent by event service, such as notification of a received payment to your Stellar account, and provides updates to the platform server when off-chain events occur, such as the initiation of a bank transfer to a customer. + +#### Platform Server + +The platform server is an internal component. It should be hosted in a private network and should not be accessible from the Internet. This server enables the business to fetch and update the state of transactions using its [API][platform-api]. + +#### Database + +The Anchor Platform uses a PostgreSQL database to store Stellar events and entities. It is primary used to store transactions. + +### Complete Architecture + +In addition to the components described above, the Anchor Platform includes several other components that offer additional functionality. Your business can chose to which of the additional components to use, but the diagram below visualizes the architecture of the system if all components are utilized. + +[![complete anchor platform architecture](../assets/anchor-platform-architecture-2.png)](../assets/anchor-platform-architecture-2.png) + +#### Event Service + +The event service enables the Anchor Platform to send HTTP webhooks to registered clients and your business server when the state of transactions change, removing the need for clients and/or your business server to poll the Anchor Platform's APIs. It works by reading events from published to a Kafka topic by the other Anchor Platform components. [Read more][events] about using the event service. + +#### Custody Server + +The custody server connects to enterprise wallet providers, such as Fireblocks, to send and receive payments for transactions initiated via the Anchor Platform. This service is an alternative to the Stellar Observer for businesses who use one of the supported providers. In addition to the functionality offered by the Stellar Observer, the Custody Server can also facilitate outbound payments to client's Stellar accounts. If you also use the [events] service, payments to your accounts will trigger a HTTP callback made to your business server. + +If you already have an integration with your wallet provider, then this component is not required, although your business server will need to notify the Anchor Platform when a payment associated with an Anchor Platform transaction was sent to or from your Stellar accounts via the [Platform API][platform-api]. + +Currently the only supported provider is Fireblocks. + +#### Stellar Observer + +The Stellar observer, an alternative to the custody server pictured above, monitors the Stellar blockchain using Horizon, automatically detects user payments sent to the business, and updates the corresponding transactions in the Anchor Platform's database. If you also use the [events] service, payments to your accounts will trigger a HTTP callback made to your business server. + +If you already have a solution for monitor payments to your Stellar accounts, such as an integration with your exchange, Horizon, or RPC, then this component is not required, although your business server will need to notify the Anchor Platform when a payment associated with an Anchor Platform transaction was made to your one of your Stellar accounts via the [Platform API][platform-api]. + +[seps]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/README.md +[platform-api]: ../api-reference/platform/transactions/README.mdx +[callback-api]: ../api-reference/callbacks/README.mdx +[events]: ./events/README.mdx diff --git a/ap_versioned_docs/version-2.11/admin-guide/component/observer/observer.mdx b/ap_versioned_docs/version-2.11/admin-guide/component/observer/observer.mdx new file mode 100644 index 0000000000..133ac576f2 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/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](../../getting-started.mdx#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](#funds-received-1) 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]: ../../custody-services/fireblocks/README.mdx diff --git a/ap_versioned_docs/version-2.11/admin-guide/component/rpc/error.mdx b/ap_versioned_docs/version-2.11/admin-guide/component/rpc/error.mdx new file mode 100644 index 0000000000..27746e6f0e --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/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/ap_versioned_docs/version-2.11/admin-guide/component/rpc/request.mdx b/ap_versioned_docs/version-2.11/admin-guide/component/rpc/request.mdx new file mode 100644 index 0000000000..9157143afc --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/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/ap_versioned_docs/version-2.11/admin-guide/component/rpc/response.mdx b/ap_versioned_docs/version-2.11/admin-guide/component/rpc/response.mdx new file mode 100644 index 0000000000..02d8081034 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/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/ap_versioned_docs/version-2.11/admin-guide/component/rpc/rpc.mdx b/ap_versioned_docs/version-2.11/admin-guide/component/rpc/rpc.mdx new file mode 100644 index 0000000000..f00b8ee7f5 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/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/ap_versioned_docs/version-2.11/admin-guide/component/security/api_key.mdx b/ap_versioned_docs/version-2.11/admin-guide/component/security/api_key.mdx new file mode 100644 index 0000000000..c994a59941 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/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" +``` + + + +Once enabled, all requests must include a valid `X-Api-Key` header, set to the configured API key. diff --git a/ap_versioned_docs/version-2.11/admin-guide/component/security/jwt.mdx b/ap_versioned_docs/version-2.11/admin-guide/component/security/jwt.mdx new file mode 100644 index 0000000000..50153090a4 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/component/security/jwt.mdx @@ -0,0 +1,16 @@ +To enable JWT authentication, modify your `dev.env` file: + + + +```bash +# dev.env +PLATFORM_SERVER_AUTH_TYPE=jwt +# Will be used to sign the JWT token +SECRET_PLATFORM_API_AUTH_SECRET="your secret that business server will use" +``` + + + +Anchor Platform uses the HMAC SHA-256 (HS256) algorithm to sign JWT tokens. Ensure that `SECRET_PLATFORM_API_AUTH_SECRET` is at least 32 characters long for security. + +Once enabled, all requests must include a valid `Authorization` header with the format `Bearer `. diff --git a/ap_versioned_docs/version-2.11/admin-guide/component/security/security.mdx b/ap_versioned_docs/version-2.11/admin-guide/component/security/security.mdx new file mode 100644 index 0000000000..76a3832c30 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/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/ap_versioned_docs/version-2.11/admin-guide/custody-services/README.mdx b/ap_versioned_docs/version-2.11/admin-guide/custody-services/README.mdx new file mode 100644 index 0000000000..5556776d58 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/custody-services/README.mdx @@ -0,0 +1,10 @@ +--- +title: Custody Services +sidebar_position: 80 +--- + +import DocCardList from "@theme/DocCardList"; + +Using a custody service will allow you to use an outside service to store and manage your wallets. + + diff --git a/ap_versioned_docs/version-2.11/admin-guide/custody-services/configuration.mdx b/ap_versioned_docs/version-2.11/admin-guide/custody-services/configuration.mdx new file mode 100644 index 0000000000..d202cb3862 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/custody-services/configuration.mdx @@ -0,0 +1,130 @@ +--- +title: Configuration +sidebar_position: 10 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Custody Server Configuration + +If you want to use an external custody service to store and manage your wallets, then you need to deploy one more service - the Custody Server. + +This service also needs the `STELLAR_ANCHOR_CONFIG` that was previously mentioned. By default, the `anchor-config-default-values.yaml` config file will be used. + +Also, now you don't need to deploy the Stellar Observer since the Custody Server will be responsible for its functionality. + +Update the configuration file of the Anchor Platform with the base URL and port. + + + +```yaml +custody_server: + # The listening port of the Custody Server. + # Default value: 8086 + port: 8086 + # The base URL of the Custody Server. + # Default value: http://localhost:8086 + base_url: http://localhost:8086 +``` + + + +Configure authentication type. + + + +```yaml +custody_server: + auth: + # Type of authentication that is used when the Anchor Platform communicates with the Custody Server. + # Supported values: [none, api_key, jwt] + # Default value: none + type: none +``` + + + +If you set the `api_key` or `jwt` authentication type, then you need to add an environment variable. + + + +```bash +# dev.env +SECRET_CUSTODY_SERVER_AUTH_SECRET="Custody Server auth secret" +``` + + + +Start the Custody Server using Gradle or Docker. + + + +```bash +./gradlew service-runner:bootRun --args=--custody-server +docker run stellar/anchor-platform:2.11.0 --custody-server +``` + + + +## Anchor Platform Configuration + +Update the configuration file of the Anchor Platform with the deposit info generator type for SEP-24 and SEP-31. Also, you need to configure a trustline check, if you use JSON-RPC. + + + +```yaml +sep24: + # Used to choose how the SEP-24 deposit information (deposit address, memo and memo type) will be generated + # Supported value: [self, custody, none] + # Default value: self + deposit_info_generator_type: custody +sep31: + # Used to choose how the SEP-31 deposit information (deposit address, memo and memo type) will be generated + # Supported value: [self, custody, api] + # Default value: self + deposit_info_generator_type: custody + ## Trustline check configuration. Used only when custody integration is enabled +custody: + trustline: + ## @param: checkCronExpression + ## @type: string + ## Cron expression which defines how often a trustline check job runs. By default, a job runs every minute + # + check_cron_expression: "0 * * * * *" + ## @param: checkDuration + ## @type: integer + ## Determines how long (in MINUTES) the trustline will be checked. By default - 1 hour (60 minutes) + # + check_duration: 60 + ## @param: checkTimeoutMessage + ## @type: string + ## The message that will be added to the SEP transaction after the duration check is exceeded + # + check_timeout_message: Trustline check timed out +``` + + + +:::info + +- `self` - memo and memo type are generated in the local code, and the distribution account is used for the deposit address. +- `custody` - memo and memo type are generated through Custody API, for example Fireblocks, as well as the deposit address. +- `none` - deposit address, memo, and memo type should be provided by the business in a PATCH/JSON-RPC request. +- `api` - memo and memo type are generated through calling the anchor's GET /unique_address endpoint. + +::: + +## Kotlin Reference Server Configuration + +Update the configuration file of the Kotlin Reference Server to enable custody integration. + + + +```yaml +app: + # Flag that indicates that the custody integration is enabled and the payment will be submitted using the Custody Server. + # Default value: false + custodyEnabled: true +``` + + diff --git a/ap_versioned_docs/version-2.11/admin-guide/custody-services/fireblocks/README.mdx b/ap_versioned_docs/version-2.11/admin-guide/custody-services/fireblocks/README.mdx new file mode 100644 index 0000000000..43e037461e --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/custody-services/fireblocks/README.mdx @@ -0,0 +1,10 @@ +--- +title: Fireblocks +sidebar_position: 20 +--- + +import DocCardList from "@theme/DocCardList"; + +Configure [Fireblocks](https://fireblocks.io) to act as a custody service that stores and manages your wallets. + + diff --git a/ap_versioned_docs/version-2.11/admin-guide/custody-services/fireblocks/configuration.mdx b/ap_versioned_docs/version-2.11/admin-guide/custody-services/fireblocks/configuration.mdx new file mode 100644 index 0000000000..0df4d0761d --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/custody-services/fireblocks/configuration.mdx @@ -0,0 +1,68 @@ +--- +title: "Configuration" +sidebar_position: 10 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Configure Fireblocks workspace: + +1. [Configure API Co-Signer](https://support.fireblocks.io/hc/en-us/articles/4581830426268) +2. [Add API User](https://support.fireblocks.io/hc/en-us/articles/4407823826194-Adding-new-API-users) +3. [Configure Webhook URL](https://support.fireblocks.io/hc/en-us/articles/4408110107794-Configuring-Webhook-URLs) +4. [Enable One-Time Address feature](https://support.fireblocks.io/hc/en-us/articles/4409104568338) + +Update the configuration file of the Custody Server. + + + +```yaml +custody: + # Default value: none + type: fireblocks + fireblocks: + # The base URL of the Fireblocks API + # Default value: https://api.fireblocks.io + base_url: https://api.fireblocks.io + # ID of Fireblocks vault account that will be used for payments + vault_account_id: "vault_account_id" + # Fireblocks public key that is used to verify a webhook signature + public_key: "public_key" + # Mappings of fireblocks asset codes to stellar asset codes. For example: + # XLM_USDC_T_CEKS stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + # XLM_TEST stellar:native + # Codes should be separated with a space and each pair of codes should be on a new line + asset_mappings: "asset_mappings" + reconciliation: + # Cron expression which defines how often the transaction reconciliation job runs. + # By default, job runs every 15 minutes. + # Default value: 0 0/15 * * * * + cron_expression: "0 0/15 * * * *" + # Determines how many times the transaction reconciliation job will attempt to update the status of the + # transaction before marking it as failed. + # Default value: 10 + max_attempts: 10 + retry_config: + # Determines how many times the Fireblocks client will attempt to send a request before marking a call as failed. + # Default value: 3 + max_attempts: 3 + # Interval between Fireblocks client call attempts (in ms) + # Default value: 1000 + delay: 1000 +``` + + + +Add the environment variables. + + + +```bash +# dev.env +# API key, that will be added to JWT token claims. JWT token will be sent in requests to Fireblocks API +SECRET_CUSTODY_FIREBLOCKS_API_KEY="Fireblocks API key" +# Secret key, that is used to sign JWT token +SECRET_CUSTODY_FIREBLOCKS_SECRET_KEY="Fireblocks secret key" +``` + + diff --git a/ap_versioned_docs/version-2.11/admin-guide/custody-services/fireblocks/example.mdx b/ap_versioned_docs/version-2.11/admin-guide/custody-services/fireblocks/example.mdx new file mode 100644 index 0000000000..613d31bca2 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/custody-services/fireblocks/example.mdx @@ -0,0 +1,50 @@ +--- +title: "Example" +sidebar_position: 10 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +[comment]: # "Sequence diagram definitions are located in /static/definitions folder" +[comment]: # "To updated them, use https://sequencediagram.org" + +### SEP-24 deposit flow with webhook: + +- request_offchain_funds +- notify_offchain_funds_received +- do_stellar_payment +- notify_onchain_funds_sent [![sequence_diagram_sep24_deposit_webhook](../../../assets/sequence_diagram_sep24_deposit_webhook.png)](../../../assets/sequence_diagram_sep24_deposit_webhook.png) +
+ +### SEP-24 deposit flow with reconciliation job: + +- request_offchain_funds +- notify_offchain_funds_received +- do_stellar_payment +- notify_onchain_funds_sent [![sequence_diagram_sep24_deposit_job](../../../assets/sequence_diagram_sep24_deposit_job.png)](../../../assets/sequence_diagram_sep24_deposit_job.png) +
+ +### SEP-24 withdrawal flow with webhook: + +- do_stellar_payment +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep24_withdrawal_webhook](../../../assets/sequence_diagram_sep24_withdrawal_webhook.png)](../../../assets/sequence_diagram_sep24_withdrawal_webhook.png) +
+ +### SEP-24 withdrawal flow with reconciliation job: + +- request_onchain_funds +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep24_withdrawal_job](../../../assets/sequence_diagram_sep24_withdrawal_job.png)](../../../assets/sequence_diagram_sep24_withdrawal_job.png) +
+ +### SEP-31 receive flow with webhook: + +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep31_receive_webhook](../../../assets/sequence_diagram_sep31_receive_webhook.png)](../../../assets/sequence_diagram_sep31_receive_webhook.png) +
+ +### SEP-31 receive flow with reconciliation job: + +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep31_receive_job](../../../assets/sequence_diagram_sep31_receive_job.png)](../../../assets/sequence_diagram_sep31_receive_job.png) diff --git a/ap_versioned_docs/version-2.11/admin-guide/events/README.mdx b/ap_versioned_docs/version-2.11/admin-guide/events/README.mdx new file mode 100644 index 0000000000..43cc58bd93 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/events/README.mdx @@ -0,0 +1,10 @@ +--- +title: Event Handling +sidebar_position: 85 +--- + +import DocCardList from "@theme/DocCardList"; + +Receive transaction updates through HTTP webhook events. + + diff --git a/ap_versioned_docs/version-2.11/admin-guide/events/delivery.mdx b/ap_versioned_docs/version-2.11/admin-guide/events/delivery.mdx new file mode 100644 index 0000000000..cd6d3148e2 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/events/delivery.mdx @@ -0,0 +1,30 @@ +--- +title: "Delivery Guarantees" +sidebar_position: 30 +--- + +## Delivery Guarantees + +Depending on the messaging system you use, there will be different delivery guarantees. the event service uses Kafka as the messaging system, so the delivery guarantees will depend on the producer configuration and the broker configuration that you use. Depending on the number of partitions configured for the `TRANSACTION` topic, the events may be delivered out of order. + +:::caution + +Any transaction logic that depends on the order should use the transaction `status` and the `updated_at` fields to determine the order of the events. + +::: + +Next subsections will describe the delivery guarantees from the client and the business server perspective. + +### Client Delivery Guarantees + +For each client, the event service will attempt to deliver each event up to three times with an exponential backoff. If the event is not delivered after three attempts due to HTTP 4xx or 5xx errors, the event will be skipped. If the client is not reachable after three attempts, the event service will no longer attempt to deliver any events to that client. + +### Business Server Delivery Guarantees + +The event service will attempt to deliver each event to the businesss server up to three times with an exponential backoff. If the event is not delivered after three attempts due to HTTP 4xx or 5xx errors, the event will be skipped. If the business server is not reachable after three attempts, the event service will no longer attempt to deliver any events to the business server. + +:::note + +The business server delivery guarantees are the same as the client delivery guarantees. In the future, the event service will skip the events that are not delivered to clients that are not reachable. + +::: diff --git a/ap_versioned_docs/version-2.11/admin-guide/events/getting-started.mdx b/ap_versioned_docs/version-2.11/admin-guide/events/getting-started.mdx new file mode 100644 index 0000000000..d7c3a3832a --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/events/getting-started.mdx @@ -0,0 +1,8 @@ +--- +title: Getting Started +sidebar_position: 10 +--- + +Anchor Platform provides an event service that allows your business application and client applications such as wallets to receive updates about transaction updates via HTTP webhooks without the need to poll the transactions API. + +By integrating with the event service, you or your clients will be able to receive updates about the status of transactions, including when they are submitted, completed, and failed as well as any quotes created. diff --git a/ap_versioned_docs/version-2.11/admin-guide/events/integration.mdx b/ap_versioned_docs/version-2.11/admin-guide/events/integration.mdx new file mode 100644 index 0000000000..e716f33449 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/events/integration.mdx @@ -0,0 +1,166 @@ +--- +title: "Integration" +sidebar_position: 20 +--- + +This guide will walk you through integrating with the event service to start receiving events. The event service currently only supports Apache Kafka as the backend message broker. + +It assumes familiarity with Kafka and will not cover how to set up a Kafka cluster. + +## Requirements + +Anchor Platform will send events to the `TRANSACTION` Kafka topic. The event service will consume events from this topic and send them to the appropriate endpoints. + +## Configuration + +First, the event service's Kafka producer need to be configured using the `event.queue` section of the configuration file or setting the environment variables. The following is the set of required environment variables needed to configure the event service's Kafka producer: + + + +```bash +# dev.env +EVENTS_ENABLED=true +EVENTS_QUEUE_TYPE=kafka +EVENTS_QUEUE_KAFKA_BOOTSTRAP_SERVER=localhost:9092 +``` + +```yaml +# dev.services.yaml +events: + enabled: true + queue: + type: kafka + kafka: + bootstrap_server: localhost:9092 +``` + + + +Anchor Platform allows a subset of the Kafka producer's client configuration to be set. See the [default values file][default-values-file] for more information what is available. For more information on the Kafka producer's client configuration, see the [Kafka documentation](https://kafka.apache.org/documentation/#producerconfigs). + +Next, the event processor needs to be configured in the `event_processor` section of the Anchor Platform Configuration file or setting the environment variables. + + + +```bash +# dev.env +EVENT_PROCESSOR_CLIENT_STATUS_CALLBACK_ENABLED=true +EVENT_PROCESSOR_CALLBACK_API_REQUEST_ENABLED=true +``` + +```yaml +# dev.services.yaml +event_processor: + client_status_callback: + enabled: true + callback_api_request: + enabled: true +``` + + + +This will enable the event processor to start processing events from `TRANSACTION` topic. In this example, the event processor will send events to client and business server callback endpoints. + +## Receiving Events + +The event service can be used to send events to client and business server callback endpoints. The event service will send events to these endpoints as HTTP POST requests with the event data in the request body. + +### As a Client Application + +Client applications can receive updates whenever the `status` of a SEP transaction changes. + +To receive events as a client application, you will need to expose a callback URL that the event service can send events to. The event service will send a POST request to this endpoint with the event data in the request body. + +Anchor Platform will only send events to clients listed in the client configuration. See the [client configuration documentation][clients-config] for more information. + +#### Callback Signing + +Anchor Platform signs the callback requests it sends to client applications. The signature is included in the `Signature` header of the request. The callback URL signature specification can be found in the corresponding SEP protocol specifications. + +- [SEP-0006](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md#url-callback-signature) +- [SEP-0024](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#url-callback-signature) +- [SEP-0031](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md#url-callback-signature) + +### As a Business Server + +In addition to SEP transaction status updates, business servers can receive events about SEP-31 quote creation or SEP-12 customer information updates. The schema of the event data will depend on the type of event being sent. Visit the [Event API documentation](../../api-reference/callbacks/post-event.api.mdx) for more information about the schema of the event data. + +To receive events as a business server, you will need to expose a callback URL that the event service can send events to. The event service will send a POST request to this endpoint with the event data in the request body. + +#### Configuration + +The event service's callback API can be configured using the `callback_api` section of the Anchor Platform configuration file or setting the environment variables. + +:::caution + +The `--event-processor` will ignore any path segments specified in `callback_api.base_url` and will instead send events to `[scheme]://[host]:[port]/event`. This is a bug, but in order not to disrupt those using the event processor, we will defer the fix of including path segments in version 3 of the Anchor Platform. + +::: + +The following is an example of how to configure the event service's callback API with JWT authentication: + + + +```bash +# dev.env + +# note `/callback` will not be used for event callbacks +# instead events will be sent to `http://localhost:8081/event` +# all other callbacks (rates, customer, etc.) will use the provided `/callback` root path +CALLBACK_API_BASE_URL=http://localhost:8081/callback +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +CALLBACK_API_AUTH_JWT_HTTP_HEADER=Authorization +SECRET_CALLBACK_API_AUTH_SECRET="a secret for signing jwts" +``` + +```yaml +# dev.services.yaml +callback_api: + base_url: http://localhost:8081/callback + auth: + type: jwt + jwt: + expiration_milliseconds: 30000 + http_header: Authorization +``` + + + +The following is an example of how to configure the event service's callback API with API key authentication: + + + +```bash +# dev.env +CALLBACK_API_BASE_URL=http://localhost:8081/callback +CALLBACK_API_AUTH_TYPE=api_key +CALLBACK_API_AUTH_API_KEY_HTTP_HEADER=X-Api-Key +SECRET_CALLBACK_API_AUTH_SECRET="your API key" +``` + +```yaml +# dev.services.yaml +callback_api: + base_url: http://localhost:8081/callback + auth: + type: api_key + api_key: + http_header: X-Api-Key +``` + + + +This configures the event service's callback API that will be used to send events to client and business server callback endpoints. The following are the supported configuration options: + +- `base_url`: The base URL of the business server's callback endpoint. +- `secret`: The secret to be used when sending events to the business server's callback endpoint. This is used to sign the request body when JWT authentication is enabled and it is the API key when API key authentication is enabled. +- `auth`: The authentication method to be used when sending events to the business server's callback endpoint. The following are the supported authentication methods: + - `JWT`: The event service will send a JSON Web Token (JWT) in the `Authorization` header of the request. The following are the supported configuration options: + - `expiration_milliseconds`: The expiration time of the JWT in milliseconds. + - `http_header`: The header in which the JWT will be sent. + - `API_KEY`: The event service will send an API key in the `Authorization` header of the request. The following are the supported configuration options: + - `http_header`: The header in which the API key will be sent. + +[default-values-file]: https://github.com/stellar/java-stellar-anchor-sdk/blob/develop/platform/src/main/resources/config/anchor-config-default-values.yaml +[clients-config]: ../../admin-guide/sep10/README.mdx#config-with-client-attribution diff --git a/ap_versioned_docs/version-2.11/admin-guide/getting-started.mdx b/ap_versioned_docs/version-2.11/admin-guide/getting-started.mdx new file mode 100644 index 0000000000..992e614b24 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/getting-started.mdx @@ -0,0 +1,384 @@ +--- +title: "Getting Started" +sidebar_position: 30 +--- + +## Installation + +import { CodeExample } from "@site/src/components/CodeExample"; + +The easiest way to install the Anchor Platform is to pull the [docker image][anchor-platform-image]. + + + +```bash +docker pull stellar/anchor-platform:2.11.0 +``` + + + +## Set Up the Development Environment + +In this guide we'll use [docker compose][docker-compose] for simplicity, but you can run the Anchor Platform using other tools that support docker as well, such as [minikube] or a full-blown [kubernetes] cluster. + +Let's create a minimal compose file to get started. + + + +```yaml +# docker-compose.yml +services: + sep-server: + image: stellar/anchor-platform:2.11.0 + command: --sep-server + ports: + - "8080:8080" + env_file: + - ./dev.env + volumes: + - ./config:/home + platform-server: + image: stellar/anchor-platform:2.11.0 + command: --platform-server + ports: + - "8085:8085" + env_file: + - ./dev.env + volumes: + - ./config:/home +``` + + + +The `--sep-server` option tells the Anchor Platform to make the API endpoints defined by the SEPs you've enabled via configuration available on port 8080. + +The `--platform-sever` option makes the Platform API available, which is the backend API your service(s) will use to communicate with the Anchor Platform. It will be available on port 8085 + +## Configuration + +The Anchor Platform supports two approaches for configuration: + +- using environment variables +- using a YAML configuration file + +One or a combination of both approaches can be used. Nested variables in the YAML file are expressed using underscores or dots (`_`, `.`) when using environment variables. We'll demonstrate both approaches here, but use enviroment variables exclusively in subsequent sections. See the full set of configuration options in the Anchor Platform's [default values file][ap-default-values]. + +:::info + +The Anchor Platform does not allow application secrets in the YAML configuration file. Instead, application secrets, which all have the `SECRET_` prefix, must be specified in the environment. + +::: + +Lets create the environment file specified in our docker compose file. + + + +```bash +touch dev.env +``` + + + +And if you're using a YAML configuration file, lets create that too. + + + +```bash +mkdir config +touch config/dev.services.yaml +``` + + + +You'll need to inform the Anchor Platform where it can find your config file. So lets add an environment variable for that. + + + +```bash +# dev.env +STELLAR_ANCHOR_CONFIG=/home/dev.services.yaml +``` + + + +Specify the configuration schema version in your YAML file. + + + +```yaml +# dev.services.yaml +version: 1 +``` + + + +### Changing Port of the Platform Server + +For example, let's change port of the platform server. + +Using environment variables, this is simply: + + + +```bash +# dev.env +PLATFORM_SERVER_PORT=8085 +``` + + + +Or if using YAML configuration: + + + +```yaml +# dev.services.yaml +platform_server: + port: 8085 +``` + + + +### Specify Your Service's Assets + +Lets add the assets your Anchor Platform deployment will utilize. This configuration is specified in a YAML file. If you're only using the Anchor Platform for hosting a SEP-1 stellar.toml file or for running SEP-10 Stellar Authentication, you can skip this step. + + + +```bash +touch config/dev.assets.yaml +``` + + + +In this guide we'll build anchor services for Circle's USDC on Stellar's test network. Update the above values based on the assets you'll be issuing. Make sure to specify the testnet `issuer` in your development file, and create your own `distribution_account` using a tool like [Stellar Lab][stellar-lab]. The `distribution_account` will be used by your clients as the destination account for payments to your service. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 +``` + + + +This file needs to be referenced in our configuration so the Anchor Platform can find it. + +Using environment variables: + + + +```bash +# dev.env +ASSETS_TYPE=file +ASSETS_VALUE=/home/dev.assets.yaml +``` + + + +Using a YAML file: + + + +```yaml +# dev.services.yaml +assets: + type: file + value: /home/dev.assets.yaml +``` + + + +### Add Data Persistence + +The Anchor Platform supports [PostgreSQL][postgresql] and [Aurora PostgreSQL][aurora-postgresql] for use in production, but also supports [H2][h2] or [SQLite][sqlite] for use in development. For managing migrations, the Anchor Platform uses [Flyway][flyway]. The latest version of PostgreSQL supported by Flyway is PostgreSQL 14. + +Before we move forward, let's add a database to our development environment so the transactions we initiate persist after stopping the service. + +A database is only needed if using the Anchor Platform to facilitate transactions. + + + +```yaml +# docker-compose.yml +version: "3.8" +services: + sep-server: + image: stellar/anchor-platform:2.11.0 + command: --sep-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8080:8080" + depends_on: + - db + platform-server: + image: stellar/anchor-platform:2.11.0 + command: --platform-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8085:8085" + depends_on: + - db + db: + image: postgres:14 + ports: + - "5432:5432" + env_file: + - ./dev.env + volumes: + - ./init.sql:/docker-entrypoint-initdb.d/init.sql +``` + + + +Now let's update our environment so the platform server can connect to the database server. + + + +```bash +# dev.env +DATA_TYPE=postgres +DATA_SERVER=db +DATA_DATABASE=platform +DATA_FLYWAY_ENABLED=true + +SECRET_DATA_USERNAME=postgres +SECRET_DATA_PASSWORD=password + +POSTGRES_USER=postgres +POSTGRES_PASSWORD=password +``` + + + +If you're using YAML configuration instead, the `POSTGRES_` environment variables should always be in the environment, as they're for your database server, not the Anchor Platform. The secrets must also be specified in environment. + + + +```yaml +# dev.services.yaml +data: + type: postgres + server: db + database: platform + flyway_enabled: true +``` + + + +We have to create the `platform` database before the platform server can connect to it, so let's make a script to create our database. + + + +```bash +touch init.sql +``` + + + + + +```sql +-- init.sql +CREATE DATABASE platform; +``` + + + +Try to run the platform server in addition to the database. + + + +```bash +docker compose up +``` + + + +You should see the logs reporting a successful connection to the postgres database. + +### Configure Platform API Authentication + +To facilitate cross-border payments or deposit & withdrawal transactions, your business will need to fetch and update transaction records from the Anchor Platform's internal API. Currently, the `--sep-server` option makes public SEP APIs, while internal Platform API available on the Platform server, started by `--platform-server` option. Business should make Platform Server accessible only in the internal network, however it's possible to add authentication for accessing the internal Platform API. + +Add the following environment variables. + + + +```bash +# dev.env +PLATFORM_API_BASE_URL=http://platform-server:8085 +PLATFORM_API_AUTH_TYPE=jwt +SECRET_PLATFORM_API_AUTH_SECRET=[your jwt encryption key] +``` + + + +When making requests to the Platform API, add a JWT signed by the secret defined in your environment to the `Authorization` header as a bearer token. + +`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:2.11.0 + 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 +[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://lab.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 diff --git a/ap_versioned_docs/version-2.11/admin-guide/overview.mdx b/ap_versioned_docs/version-2.11/admin-guide/overview.mdx new file mode 100644 index 0000000000..6972fa3b25 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/overview.mdx @@ -0,0 +1,36 @@ +--- +title: "Overview" +sidebar_position: 10 +--- + +The Anchor Platform is the easiest and fastest way to deploy [anchor services](/docs/learn/fundamentals/anchors) compatible with [Stellar Ecosystem Proposals (SEPs)](https://github.com/stellar/stellar-protocol/tree/master/ecosystem). + +The goal of the Anchor Platform is to handle all Stellar-specific functionality and requirements for running an anchor, allowing businesses to focus on the core business logic necessary to provide these services. + +The Anchor Platform accomplishes this by implementing the ecosystem's standardized APIs (SEPs) for wallets, exchanges, and other applications to consume, while offering a set of backend APIs for businesses to provide information specific to them, such as transaction fees, exchange rates, and off-chain transaction statuses. + +Below is a list of SEPs currently supported: + +- [SEP-1][sep-1]: [Stellar Info File][sep1-ap] +- [SEP-6][sep-6]: [Programmatic Deposit and Withdrawal][sep6-ap] +- [SEP-10][sep-10]: [Stellar Authentication][sep10-ap] +- [SEP-12][sep-12]: KYC API +- [SEP-24][sep-24]: [Hosted Deposit and Withdrawal][sep24-ap] +- [SEP-31][sep-31]: [Cross-Border Payments API][sep31-ap] +- [SEP-38][sep-38]: Anchor RFQ API + +The documentation for the Anchor Platform is a work in progress. Developers are welcome to dive into the code and existing documentation on the [GitHub repository][anchor-platform-github], or if you're looking to build an on & off-ramp service compatible with SEP-24, see our [getting started guide][sep24-ap]. + +[sep-1]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md +[sep-6]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md +[sep-10]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md +[sep-12]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md +[sep-24]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md +[sep-31]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md +[sep-38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md +[anchor-platform-github]: https://github.com/stellar/java-stellar-anchor-sdk +[sep1-ap]: ./sep1/README.mdx +[sep6-ap]: ./sep6/README.mdx +[sep10-ap]: ./sep10/README.mdx +[sep24-ap]: ./sep24/README.mdx +[sep31-ap]: ./sep31/README.mdx diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep1/README.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep1/README.mdx new file mode 100644 index 0000000000..8344b44e88 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep1/README.mdx @@ -0,0 +1,66 @@ +--- +title: Stellar Info File +sidebar_position: 40 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Let's enable applications to learn more about your service by hosting a `stellar.toml` file at a standardized URL path. This file allows applications to find information about your business, the assets your services utilize, as well as the root URL paths for these services. We can host this file using the Anchor Platform. + +Let's create a file called `dev.stellar.toml` file using the contents below as a starting point. For the full set of attributes, see the [SEP-1 specification][sep-1]. + + + +```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" + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +Note that you'll 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. + +In your `dev.env` file, specify the following. + + + +```bash +# dev.env +SEP1_ENABLED=true +SEP1_TOML_TYPE=file +SEP1_TOML_VALUE=/home/dev.stellar.toml +``` + + + +This will tell the Anchor Platform that it should host the file specified by `SEP1_TOML_VALUE` at `./well-known/stellar.toml`. + +Alternatively, your `stellar.toml` file could be hosted using a proper static file server like [nginx]. As long as your info file includes the appropriate URLs pointing to the Anchor Platform, this will work just fine. + +[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://lab.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 diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep10/README.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep10/README.mdx new file mode 100644 index 0000000000..1db24083f6 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep10/README.mdx @@ -0,0 +1,156 @@ +--- +title: Stellar Authentication +sidebar_position: 50 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Enable Stellar Authentication + +Stellar-based wallet applications create authenticated sessions with Stellar anchors by proving they, or their users, have sufficient control over a Stellar account. Once authenticated, the wallet application uses a session token provided by the anchor in subsequent requests to the anchor's standardized services. + +The Anchor Platform supports this form of authentication with minimal configuration from the business. + + + +```bash +# dev.env +SEP10_ENABLED=true +SEP10_HOME_DOMAIN=localhost:8080 +SECRET_SEP10_SIGNING_SEED="a Stellar private key" +SECRET_SEP10_JWT_SECRET="a secret encryption key" +``` + + + +`SEP_10_HOME_DOMAIN` is the `home_domain` property used by [sep-10]. The configuration value must be equal to the host of the toml file. If you are hosting toml file via the Platform, (`SEP1_ENABLED` is set to `true`), toml file will be hosted on the SEP server. + +`SECRET_SEP10_SIGNING_SEED` is the private key to the public key you've specified as the `SIGNING_KEY` in your `stellar.toml` file. It will be used to sign authentication challenges presented to wallet applications, providing that you are in possession of the `SIGNING_KEY`. Wallets will check for this signature before signing and sending back the authentication challenge. + +`SECRET_SEP10_JWT_SECRET` is the encryption key that will be used to sign and verify the authentication tokens you issue to wallet applications after they or their users have proven control of their Stellar account. + +:::info + +By default, the Anchor Platform allows anyone with a Stellar account to authenticate with your services. If you'd like to only allow users of a particular wallet application to authenticate, or want to disallow specific users from authenticating, use the following environment variables. This is an optional feature and should only be added if it is a business requirement. + +::: + +## Config With Client Attribution + +`SEP10_CLIENT_ATTRIBUTION_REQUIRED` informs the Anchor Platform whether it should allow users of noncustodial wallets to authenticate without the wallet also identifying itself. + +`CLIENTS` is the list of outside wallet servers or clients for the Anchor server to safely communicate with. + + + +```bash +# dev.env +SEP10_CLIENT_ATTRIBUTION_REQUIRED=true +``` + + + + + +```yaml +clients: + # Each item in the list may contain the following fields: + # - name: (required) the name of the client + # - type: (required) `custodial` or `noncustodial` + # + # If the type is `custodial`, + # - signing_keys: (required) the custodial SEP-10 signing key of the client. + # - callback_url: (optional) the URL of the client's callback API endpoint. + # If one of SEP-specific URLs is also provided, then this URL will be used as a fallback. + # For example, if `callback_url_sep6` is not provided, but `callback_url_sep24` is, + # SEP-6 transactions will use the `callback_url` as the callback URL. This field is + # deprecated and will be removed in 3.0. + # - callback_url_sep6: (optional) the URL of the client's SEP-6 callback API endpoint. + # - callback_url_sep24: (optional) the URL of the client's SEP-24 callback API endpoint. + # - callback_url_sep31: (optional) the URL of the client's SEP-31 callback API endpoint. + # - callback_url_sep12: (optional) the URL of the client's SEP-10 callback API endpoint. + # - allow_any_destination: (optional) default to false. If set to true, allows any destination for deposits. + # - destination_accounts: (optional) list of accounts allowed to be used for the deposit. + # If allows_any_destinations set to true, this configuration option is ignored. + # + # If the type is `noncustodial`, + # - domains: (required) the domains of the client. + # - callback_url: (optional) the URL of the client's callback API endpoint + + # custodial client + - name: custodial-client1 + type: custodial + signing_keys: "the signing key 1 of the client1","the signing key 2 of the client1" + callback_url: https://callback.custodial-client1.com/api/v1/anchor/callback + callback_url_sep6: https://callback.custodial-client1.com/api/v1/anchor/callback/sep6 + callback_url_sep12: https://callback.custodial-client1.com/api/v1/anchor/callback/sep12 + allow_any_destination: false + destination_accounts: destAccount1,destAccount2 + - name: custodial-client2 + type: custodial + signing_keys: "the signing key of the client2", + + # noncustodial client + - name: noncustodial-client1 + type: noncustodial + domains: noncustodial-client1.co,noncustodial-client1.com + callback_url: https://callback.noncustodial-client1.co/api/v2/anchor/callback + callback_url_sep6: https://callback.noncustodial-client1.co/api/v2/anchor/callback/sep6 + callback_url_sep12: https://callback.noncustodial-client1.co/api/v2/anchor/callback/sep12 + - name: noncustodial-client2 + type: noncustodial + domains: noncustodial-client2.com +``` + +```bash +# dev.env +# custodial client +CLIENTS[0]_NAME=custodial-client1 +CLIENTS[0]_TYPE=custodial +CLIENTS[0]_SIGNING_KEYS="the signing key 1 of the client1","the signing key 2 of the client1" +CLIENTS[0]_CALLBACK_URL=https://callback.custodial-client1.com/api/v1/anchor/callback +CLIENTS[0]_ALLOW_ANY_DESTINATION=false +CLIENTS[0]_DESTINATION_ACCOUNTS=destAccount1,destAccount2 +CLIENTS[1]_NAME=custodial-client2 +CLIENTS[1]_TYPE=custodial +CLIENTS[1]_SIGNING_KEYS="the signing key of the client2" + +# noncustodial client +CLIENTS[2]_NAME=noncustodial-client1 +CLIENTS[2]_TYPE=noncustodial +CLIENTS[2]_DOMAINS=noncustodial-client1.co,noncustodial-client1.com +CLIENTS[2]_CALLBACK_URL=https://callback.noncustodial-client1.co/api/v2/anchor/callback +CLIENTS[3]_NAME=noncustodial-client2 +CLIENTS[3]_TYPE=noncustodial +CLIENTS[3]_DOMAINS=noncustodial-client2.com +``` + + + +`SEP10_CLIENT_ATTRIBUTION_REQUIRED` informs the Anchor Platform whether it should allow users of noncustodial wallets to authenticate without the wallet also identifying itself. + +`CLIENTS` is the list of outside wallet servers or clients for the Anchor server to safely communicate with. + +## Modify a Stellar Info File + +Next, let's modify `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-10 functionality is supported by your business. + + + +```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" + +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +[sep1-ap]: ../sep1/README.mdx diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep24/README.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep24/README.mdx new file mode 100644 index 0000000000..4d78a93bbd --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep24/README.mdx @@ -0,0 +1,10 @@ +--- +title: Hosted Deposits and Withdrawals +sidebar_position: 60 +--- + +import DocCardList from "@theme/DocCardList"; + +SEP-24 allows for a means by which wallets and/or exchanges allow the user to directly interact with an on & off-ramp. + + diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep24/configuration.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep24/configuration.mdx new file mode 100644 index 0000000000..09c8dc7090 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep24/configuration.mdx @@ -0,0 +1,190 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Modify a Stellar Info File + +Next, let's modify `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-24 functionality is supported by your business, and they also need to know all 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_SEP0024 = "http://localhost:8080/sep24" +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" + +# Optionally, add support for XLM +[[CURRENCIES]] +code = "native" +status = "test" +is_asset_anchored = false +anchor_asset_type = "crypto" +desc = "XLM, the native token of the Stellar network." + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +Note that you'll 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 Hosted Deposits & Withdrawals + +Now you're ready to enable hosted deposits and withdrawals via the SEP-24 API. Specify the following in your `dev.assets.yaml` file, and change the values depending on your preferences. This example asset file will enable support for Circle's USDC and a fiat USD. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep24_enabled: true + deposit: + enabled: true + withdraw: + enabled: true + - schema: iso4217 + code: USD + significant_decimals: 2 + deposit: + enabled: true + withdraw: + enabled: true + # Optional support for XLM + - schema: stellar + code: native + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 7 + sep24_enabled: true + deposit: + enabled: true + withdraw: + enabled: true +``` + + + +The information provided for the `assets` value closely maps to the information that will be exposed to the wallet application using the [`GET /info`][sep24-get-info] SEP-24 endpoint. The Anchor Platform also uses this information to validate requests made to your service. + +Add the following variables to your environment file. + + + +```bash +# dev.env +SEP24_ENABLED=true +SEP24_INTERACTIVE_URL_BASE_URL=http://example.com +SEP24_MORE_INFO_URL_BASE_URL=http://example.com +SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET="your encryption key shared with your business server" +SECRET_SEP24_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" +``` + + + +`SEP24_INTERACTIVE_URL_BASE_URL` is the URL that the Anchor Platform will provide to wallet applications when they initiate transactions. Wallet applications will open this URL in a web view inside their app, handing over control of the user experience from the wallet to your business. This URL points to the web widget your business implements. It contains all business-defined logic. We'll dive further into this experience in subsequent sections. + +`SEP24_MORE_INFO_URL_BASE_URL` is the URL that the Anchor Platform will provide to wallet applications when they want to show information about a transaction initiated previously. This URL is most often used by wallets in their transaction history views, and your business can define what information to display about the transaction. + +`SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET` and `SECRET_SEP24_MORE_INFO_URL_JWT_SECRET` are encryption keys that the Anchor Platform will use to generate short-lived tokens it will add to the URLs provided to the wallet. Your business server must also have these keys in its environment so it can verify the token's signature. + +## 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" + +SEP24_ENABLED=true +SEP24_INTERACTIVE_URL_BASE_URL=http://localhost:8081 +SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET="your encryption key shared with your business server" +SECRET_SEP24_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" +``` + + + +To test this out, go to the [Stellar Demo Wallet][stellar-demo-wallet]. + +[![demo wallet connected to the anchor platform](../../assets/anchor-platform-sep24-demo-wallet.png)](../../assets/anchor-platform-sep24-demo-wallet.png) + +Initiate a 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-24 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. However, when the demo wallet attempts to open the URL provided by the Anchor Platform, you'll get a not found page. + +[![demo wallet after initiating a transaction](../../assets/anchor-platform-sep24-demo-wallet-widget.png)](../../assets/anchor-platform-sep24-demo-wallet-widget.png) + +[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://lab.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 +[sep1-ap]: ../sep1/README.mdx diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep24/example.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep24/example.mdx new file mode 100644 index 0000000000..1013eb5964 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep24/example.mdx @@ -0,0 +1,438 @@ +--- +title: "Example" +sidebar_position: 40 +--- + +Integrating with the Anchor Platform involves three key areas: + +- Building a web-based user experience that can be opened in a mobile web view +- Providing transaction status updates to the Anchor Platform +- Fetching transaction status updates from the Anchor Platform + +## Building a Web-Based User Experience + +The Anchor Platform does not offer a white-label UI that your business can utilize, and instead expects the business to build their own UI and backend system. We won't build an entire on & off-ramp user experience in this guide, but will cover the ways in which your existing product should be updated to be compatible with the Anchor Platform. + +### Authentication + +If your business has an existing on & off-ramp product, you likely have an existing system for user authentication. However, because the Anchor Platform authenticates the user prior to providing the business's URL, requiring the user to go through another form of authentication is actually unnecessary. In this way, the Anchor Platform can be thought of as providing an alternative form of authentication. + +The business is free to continue requiring users to authenticate using their existing system, but the ideal user experience would skip this step and create an authenticated session for the user if they have already authenticated using their Stellar account. + +The Anchor Platform adds a JWT `token` query parameter to the business's URL given to the wallet application. This token is signed by the previously-configured `SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET` value, and includes the information you need to identify the user. The process should look something like this: + +1. Pass the `token` added to the URL of your backend system +2. Verify the signature on the `token` and check its expiration +3. Create an authenticated session for the user identified by `token.sub` + +The decoded contents of the `token` will look something like this: + + + +```json +{ + "jti": "e26cf292-814f-4918-9b40-b4f76a300f98", + "sub": "GB244654NC6YPEFU3AY7L25COGES445P3Q63W6Q76JHR3UBJMLT2XBOB:1234567", + "exp": 1516239022, + "data": { + "first_name": "John", + "last_name": "Doe", + "email": "johndoe@example.com" + } +} +``` + + + +Note that the `sub` value identifies the user using a Stellar account and integer. This is what the value will be when custodial applications that use an omnibus account authenticate with your service. When non-custodial wallets authenticate, the token may look slightly different. + + + +```json +{ + "jti": "e26cf292-814f-4918-9b40-b4f76a300f98", + "sub": "GB244654NC6YPEFU3AY7L25COGES445P3Q63W6Q76JHR3UBJMLT2XBOB", + "exp": 1516239022, + "data": { + "client_domain": "api.vibrantapp.com", + "first_name": "John", + "last_name": "Doe", + "email": "johndoe@example.com" + } +} +``` + + + +The `sub` value here only contains a public key to identify the user, and the `data.client_domain` field identifies the wallet application used to authenticate. + +In both cases, all information in the `data` object is optional, and will only be present if the wallet provides that information. + +Let's add a backend server to our compose file that will be used to verify the token and create authenticated web sessions for users initiating transactions. + + + +```yaml +# docker-compose.yaml +--- +business-server: + build: . + ports: + - "8081:8081" + env_file: + - ./dev.env + depends_on: + - platform-server +``` + + + +Let's create a simple Docker container for our application. + + + +```docker +FROM node:19 + +WORKDIR /home +COPY . . +RUN npm install + +CMD ["node", "server.js"] +``` + + + +Now let's create a minimal NodeJS application. + + + +```bash +yarn init -y +yarn add express jsonwebtoken +touch server.js +``` + + + +Below is an example of a backend server authenticating a user using NodeJS. + + + +```js +# server.js +const express = require("express"); +const jwt = require("jsonwebtoken"); +const app = express(); +const port = process.env.BUSINESS_SERVER_PORT; + +app.use(express.json()); + +/* + * We'll store user session data in memory, but production systems + * should store this data somewhere more persistent. + */ +const sessions = {}; + +/* + * Create an authenticated session for the user. + * + * Return a session token to be used in future requests as well as the + * user data. Note that you may not have a user for the stellar account + * provided, in which case the user should go through your onboarding + * process. + */ +app.post("/session", async (req, res) => { + let decodedPlatformToken; + try { + decodedPlatformToken = validatePlatformToken(req.body.platformToken); + } catch (err) { + res.status = 400; + res.send({ "error": err }); + return; + } + let user = getUser(decodedPlatformToken.sub); + let sessionToken = jwt.sign( + { "jti": decodedPlatformToken.jti }, + process.env.SESSION_JWT_SECRET + ); + sessions[sessionToken] = user; + res.send({ + "token": sessionToken, + "user": user + }); +}); + +/* + * Validate the signature and contents of the platform's token + */ +function validatePlatformToken(token) { + if (!token) { + throw "missing 'platformToken'"; + } + let decodedToken; + try { + decodedToken = jwt.verify(token, process.env.SECRET_SEP10_JWT_SECRET); + } catch { + throw "invalid 'platformToken'"; + } + if (!decodedToken.jti) { + throw "invalid 'platformToken': missing 'jti'"; + } + return decodedToken; +} + +/* + * Query your own database for the user based on account:memo string parameter + */ +function getUser(sub) { + return null; +} + +app.listen(port, () => { + console.log(`business server listening on port ${port}`); +}); +``` + + + +Run this with the platform server and database and initiate a new transaction with the [demo wallet][stellar-demo-wallet]. Then, we'll send the token to our server. + + + +```bash +curl \ + -X POST \ + -H 'Content-Type: application/json' \ + -d '{"platformToken": ""}' \ + http://localhost:8081/session | jq +``` + + + +## Providing Updates to the Platform + +Let's create an endpoint for our business server that accepts the information collected in our UI. + + + +```js +# server.js + +// Production systems should either let the Anchor Platform generate its own memos +// or have your custodial service generate a memo for each transaction. +const transactionMemos = {}; + +app.post("/transaction", async (req, res) => { + let sessionToken; + try { + sessionToken = validateSessionToken(req.headers.get("authorization")); + } catch (err) { + res.status = 400; + res.send({ "error": err }) + return; + } + // assuming this is a withdrawal transaction, we'll provide a memo, which is + // required by our third-party custodian to credit us the payment. When the + // payment is made with this memo, we can match the on-chain payment with the + // transaction in the Anchor Platform's database. + transactionMemos[req.body.transaction.id] = parseInt(Math.random() * 100000); + let rpcRequestBody = [ + { + "id": 1, + "jsonrpc": "2.0", + "method": "request_onchain_funds", + "params": { + "transaction_id": req.body.transaction.id,, + "message": "waiting for the user to provide off-chain funds.", + "amount_in": { + "amount": req.body.amount_in.amount, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": req.body.amount_out.amount, + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": req.body.amount_fee.amount, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "destination_account": "GD...G", + "memo": transactionMemos[req.body.transaction.id], + "memo_type": "id" + } + } + ]; + let platformResponse; + try { + platformResponse = await updatePlatformTransaction(rpcRequestBody); + } catch (err) { + res.status = 500; + res.send({ "error": err }) + return; + } + res.send({ + "transaction": platformResponse.records[0] + }); +}); + +function validateSessionToken(authorizationHeader) { + let parts = authorizationHeader.split(" "); + if (parts.length != 2 || parts[0] != "Bearer") { + throw "invalid authorization header format"; + } + let sessionToken = parts[1]; + try { + jwt.verify(sessionToken, process.env.SESSION_JWT_SECRET); + } catch { + throw "invalid session token"; + } + if (!sessions[sessionToken]) { + throw "expired session"; + } + return sessionToken; +} + +async function updatePlatformTransaction(requestBody) { + let response = await fetch( + `${process.env.PLATFORM_SERVER}`, + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(requestBody) + } + ); + if (response.status != 200) { + throw `unexpected status code: ${response.status}`; + } + return await response.json(); +} +``` + + + +This will update the Anchor Platform's database with the information provided and enable wallet applications to fetch this updated information so it can relay it back to the user. You should have already informed the user of the transaction's amounts and that your business's is waiting for the on-chain payment to arrive, but providing these updates allows users to view their transactions' statuses through their mobile application without opening the business' UI again. + +:::note + +At this time, the Anchor Platform does not send notifications to the wallet application when transaction statuses change, however, it is on our roadmap to add these notifications or "callback requests" so that wallet applications do not have to poll the Anchor Platform for updates. + +::: + +## Fetching Updates from the Platform + +If you only use the Anchor Platform to expose the SEP APIs to wallet applications, then you won't have a strong reason for fetching transaction status updates from the Anchor Platform, mostly because it won't update the transaction status until you make `JSON-RPC API` requests. + +However, if you use the Anchor Platform to monitor the Stellar network for incoming payments (associated with withdrawal transactions), the Anchor Platform will update transaction statuses when payments are received. + +There are two ways to fetch updates from the Anchor Platform, + +- Polling the Platform API's `GET /transactions/:id` endpoint for the transactions you're expecting a payment for +- Streaming transaction status change events from a Kafka cluster + +While streaming transaction status changes from a Kafka cluster may be a more robust and scalable approach, we're going to use the polling method in this guide. Setting up and using a Kafka cluster will be the subject of a different section of the docs. + +First, let's configure the Anchor Platform to observe the Stellar network for incoming payments. + + + +```yaml +# docker-compose.yml +--- +stellar-observer: + image: stellar/anchor-platform:2.11.0 + command: --stellar-observer + env_file: + - ./dev.env + volumes: + - ./config:/home + depends_on: + - db +``` + + + +The `--stellar-observer` command starts a process that monitors the distribution accounts configured in your `config.yaml` file for withdrawal payments. + +If a payment is sent to one of these accounts and the memo attached to the transaction matches a `memo` value provided or generated by the Anchor Platform, the Anchor Platform will consider the transaction that memo is associated with as received and update the transaction's status to `pending_anchor`. It does this by making a `JSON-RPC API` request, so we need to configure the URL it should use. + + + +```bash +# dev.env +PLATFORM_API_BASE_URL=http://platform-server:8085 +``` + + + +Let's make some additions to the `server.js` file so we can poll the Anchor Platform for our expected payments. + + + +```js +// server.js +... +/* + * Fetch the transaction data from the Platform API + * + * Production systems should have proper retry mechanisms. + */ +async function getPlatformTransaction(transactionId) { + let response = await fetch(`${process.env.PLATFORM_SERVER}/transactions/${transactionId}`) + if (response.status != 200) { + throw `unexpected status code: ${response.status}`; + } + return await response.json(); +} + +(async () => { + while (true) { + await new Promise(r => setTimeout(r, 2000)); + let requestPromises; + for (const transactionId in transactionMemos) { + requestPromises.push(getPlatformTransaction(transactionId)) + } + let transactions = await new Promise.all(requestPromises); + for (const transaction in transactions) { + // assuming all requests were successful + if (transaction.status == "pending_anchor") { + // initiate off-chain delivery of funds + console.log(`received payment for transaction ${transaction.id}`); + } + } + } +})() +``` + + + +## Full Example Implementation + +Stellar provides an example business server implementation for SEP-24. It's split into two parts: 1) a web UI, accessible for the end user; and 2) a back-end implementation, used to get and push updates from/to the Anchor Platform. + +The code for web UI can be found [here][sep-24-ref-ui] + +The code for the backend is a part of the Anchor Platform, and is available as a [submodule][sep-24-ref]. + +[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://lab.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 diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep24/faq.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep24/faq.mdx new file mode 100644 index 0000000000..5972a06cf9 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep24/faq.mdx @@ -0,0 +1,39 @@ +--- +title: "FAQ" +sidebar_position: 50 +--- + +### How To Use JWTs? + +As part of the flow, once a user makes a request, i.e. an interactive withdrawal/deposit request, it will be processed by the Anchor Platform and forwarded to your service. The Anchor Platform will make a `GET` call to `?token=`. + +This JWT token will contain: + +1. `exp` is the expiration time of the token. You should check that the provided token has not expired. +2. `sub` is the account associated with this transaction. It can be used to identify the user account. Note that this value may be different from the account that will be used to receive/send funds. +3. `jti` is the hash of the transaction. +4. `data` is the extra payload that has been set by the user. It will always contain the Stellar `asset` wants to deposit or withdraw. If provided by the client, it will also contain the `amount` the user wants to transact, the `client_domain` of the wallet verified during SEP-10 authentication, and `client_name` (defined as 'name' in [clients] configuration if provided), and the `lang` (language) preference of the user. + +### How To Provide Fees? + +Currently, it's recommended to provide fees/exchange rates in the iFrame/web view of your application. + +[SEP-24] standard provides a `/fee` endpoint to allow businesses to set static fees for their transactions. However, it's not currently supported by the Anchor Platform. + +:::note + +/fee endpoint will be deprecated in the future. + +::: + +### How to identify the user account? + +You should use the `sub` field of the JWT token. For custodial wallets, this value will be in the format `account:memo`. Use the memo to identity the user. For noncustodial wallets, simply use the `sub` value itself, which will be equal to the user account. + +### How to identify the wallet? + +Utilize the `data.client_domain` attributes within the JWT token. In the presence of [clients] configuration, the JWT token will additionally incorporate the `data.client_name` field, enabling wallet identification. + +[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 +[clients]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep24/getting-started.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep24/getting-started.mdx new file mode 100644 index 0000000000..ce1d1dbf46 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep24/getting-started.mdx @@ -0,0 +1,33 @@ +--- +title: "Getting Started" +sidebar_position: 10 +--- + +This guide will walk you through configuring and integrating with the Anchor Platform for the purpose of building an on & off-ramp service compatible with [SEP-24][sep-24], the ecosystem's standardized protocol for hosted deposits and withdrawals. + +By leveraging the Anchor Platform's support for SEP-24, businesses make their 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-24: [SEP-1 (Stellar Info File)][sep1-ap] and [SEP-10 (Stellar Authentication)][sep10-ap] + +## The Basic User Experience + +The complete customer experience a deposit and withdrawal goes something like this: + +1. The customer opens the SEP-24 wallet application of their choice +2. The customer selects an asset to deposit and the wallet finds an anchor (clients could also chose 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 (e.g. makes a 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 wallet opens the given interactive URL and allows the customer to enter their transaction information (KYC has already been 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 bank transfer. + +[sep-24]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md +[installation-ap]: ../../admin-guide/getting-started.mdx +[sep1-ap]: ../sep1/README.mdx +[sep10-ap]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep24/integration.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep24/integration.mdx new file mode 100644 index 0000000000..a396e9c44d --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep24/integration.mdx @@ -0,0 +1,1009 @@ +--- +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 Anchor Platform about events related to the transaction. + +In general, you'll want to provide updates for the following events: + +- Your business is processing the KYC information provided by the user +- 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 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 this 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-24 protocol document][sep-24] + +## Securing Platform API + + + +### Using API Key + + + +### Using JWT + + + +## Making JSON-RPC Requests + + + +### JSON-RPC Request + + + +### JSON-RPC Response + + + +### Error Codes + + + +## Updating Deposit Transaction Via JSON-RPC + +SEP-24 deposit flow diagram defines sequence/rules of the transaction's status transition and a set of JSON-RPC methods 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. + +[![sep24 deposit flow](../../assets/sep24-deposit-flow-diagram.png)](../../assets/sep24-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. + +::: + +### Ready to Receive Funds + +The first step of the deposit flow after starting the deposit itself is collecting KYC. It's usually done in the web-app, but can also be optionally provided by the wallet application, using [SEP-9]. Once the necessary KYC is collected, a `request_offchain_funds` JSON-RPC request should be made. + + + +```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 + } + } + } +] +``` + + + +- `amount_in` is the amount the user has to sent 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. + +Information abouts amounts (in/out/fee) is required if you want to move the transaction from the `incomplete` to the `pending_user_transfer_start` status. If transaction status is changed from `pending_anchor` to `pending_user_transfer_start`, you can skip defining the amounts. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh request-offchain-funds.json +``` + + + +:::tip + +When the KYC process is long (for example, ID verification), it's advised to first set the transaction status to `pending_anchor` by using `notify_interactive_flow_completed` JSON-RPC request. This will indicate to the user that KYC is being processed. + +::: + +### Processing KYC Information + +:::tip + +This step is optional. Most businesses don't use it. You can skip it and go to the [next step](#funds-received). + +Using this status is recommended when KYC verification may need to be performed asynchronously. + +::: + +You **must** specify the `amount_x` fields. + + + +```json +// kyc-in-process.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_interactive_flow_completed", + "params": { + "transaction_id": "", + "message": "Interactive flow completed.", + "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 + } + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh kyc-in-process.json +``` + + + +### Funds Received + +If offchain funds were received, you'll want to provide an 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 from previous JSON-RPC requests will be taken. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh offchain-funds-received.json +``` + + + +### Waiting For User Funds + +In a 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 a user request. After the transaction completion, 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. To make a payment via custody service, it's necessary to 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/learn/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, it's necessary to 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. + +::: + +### 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. + + + +```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 + +It's similar to [Refund sent](#refund-sent), but it handles a 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 a good practice to clean up inactive transactions in the `incomplete` status. To do so, simply change the transaction status to `expired`. + + + +```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. + +::: + +### On-Hold Transaction + +In rare cases, you may want to pause current transaction and request more information from the user (after the transfer has been received). This could be used for compliance use cases. + + + +```json +// transaction-hold.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_transaction_on_hold", + "params": { + "transaction_id": "", + "message": "Transaction is on hold. Please contact customer support to resolve the hold." + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh transaction-hold.json +``` + + + +### 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, it's necessary to 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 Transaction Via JSON-RPC + +This diagram defines a sequence/rules of transaction's status transition for SEP-24 withdrawal flow. + +[![sep24 withdrawal flow](../../assets/sep24-withdrawal-flow-diagram.png)](../../assets/sep24-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 deposit 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 + +Similar to deposit, the next step 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 update will look differently. + + + +```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" + } + } +] +``` + + + +- `memo` Value of memo to attach to the transaction +- `memo_type` Type of memo that the anchor should attach to the transaction +- `destination_account` Destination account + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh request-onchain-funds.json +``` + + + +:::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. + +::: + +### Processing KYC Information + +This step is optional, and it's similar to [Processing KYC Information](#processing-kyc-information) of the deposit flow. + +### 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 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 +``` + + + +### 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 +``` + + + +### 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. + +### On-Hold Transaction + +Works in the same manner as for the deposit flow. For more details, see [On-Hold Transaction](#on-hold-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 + + + +[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 +[json-rpc-methods]: ../../api-reference/platform/rpc/methods/README.mdx diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep24/setting-up-production-server.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep24/setting-up-production-server.mdx new file mode 100644 index 0000000000..f631e5dbf3 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep24/setting-up-production-server.mdx @@ -0,0 +1,112 @@ +--- +title: Set Up a Production Server +sidebar_position: 60 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Once the test server is live and you have tested both deposit and withdraw flows, it's time to get started with the real deploy connected to real KYC and real banking rails providers. Before using any banking APIs, it's critical that you perform a full security audit on the system to make sure that there aren't any vulnerabilities. + +## Deploying a Secure Environment + +Make sure to keep the test server up, and deploy the production (mainnet) system in a separate environment. Having two deploys allows you to validate new features on the testnet before moving them to the final production deploy. You can also have a third staging environment if there's a big team working on this codebase and/or there will be many pushes to be tested internally before sharing with other institutions. + +To switch to Stellar's public (mainnet) network, all you have to do is change the network [passphrase](/docs/learn/encyclopedia/network-configuration/network-passphrases) (for authenticating requests) and [Horizon URL](https://horizon.stellar.org/). + +You can copy your existing development configs to create a production configuration. + +First, you need to change your info file (`stellar.toml`): + + + +```toml +# stellar.toml +NETWORK_PASSPHRASE = "Public Global Stellar Network ; September 2015" +``` + + + +Next, change your Anchor Platform configuration in `production.env` file: + + + +```bash +# production.env +STELLAR_NETWORK_NETWORK="Public" +STELLAR_NETWORK_HORIZON_URL=https://horizon.stellar.org +``` + + + +## Connecting to Real KYC + +Most anchors need to collect [Know Your Customer](https://en.wikipedia.org/wiki/Know_your_customer) information to comply with local regulations before honoring deposits and withdrawals. The KYC flow usually consists of a simple form that gathers relevant information about the user such as name, email, address, age, and government-issued ID number. + +How you handle KYC is up to you: there are many services that provide KYC solutions through APIs and iFrames, and validate the input data and sync with governmental databases to verify requirements. Each jurisdiction has specific KYC requirements, and they differ from jurisdiction to jurisdiction, so it's best to find a country-specific KYC provider that meets your needs. + +Some countries require different KYC fields depending on the amount to be deposited or withdrawn. If that's the case in your jurisdiction and you need to adapt your KYC forms based on the deposit or withdrawal amount, simply add an amount field before the KYC form, and make sure that the KYC fields are updated based on that value. + +KYC information should be linked to the session created through [Stellar Web Authentication](../sep10/README.mdx) and, consequently, to the user, so you only need to ask the user for it once. After the first KYC flow is complete, a user shouldn't have to input the information again. + +Make sure the errors and validation messages are clear and include instructions for what to do next to ensure a good user experience and increase the KYC conversion rate. You should also localize messages based on the user's language and location. + +## Pre-Filling the KYC Form + +Pre-filling the KYC form is a great way to reduce the friction of getting started using an anchor, and wallets usually provide a set of fields that are commonly used throughout the ecosystem. In summary, the anchor can render the KYC form with the user's values that were previously sent by the wallet in the `/transactions/deposit/interactive` and `/transactions/withdraw/interactive` endpoints. + +All fields from [SEP-9](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0009.md) can be sent by wallets in the previously mentioned endpoints, but the most common are: email, first name, last name and phone number. Also, you should still enable the pre-filled fields to be editable, since the user might have inputted a different name in the Wallet's sign-up process, and could want to edit it before finalizing the Anchor's KYC process. + +All SEP-9 data that was sent from the wallet is a part of the [Interactive JWT](./faq.mdx#how-to-use-jwts), send by the Anchor Platform + +## Connecting to Real Banking Rails + +Fiat-backed token issuers are expected to manage a full reserve. That means there's a 1:1 relationship between Stellar-network tokens and money in the bank. Since each fiat token on Stellar is backed by, and can be redeemed for, an underlying, real-world asset, issuers of fiat-backed tokens need to connect to real banking rails to validate user deposits (through bank transfers, credit card payments, etc.) and to complete user withdrawals (generally through bank transfers). If you're an anchor honoring deposits and withdrawals of a token another organization issues, you'll follow a similar process. + +In order to fetch (and identify) a user transfer, issuers usually take one of two approaches: + +- API Polling: this option consists of fetching the bank's API, through a cron job, to check for the updated status of the list of transfers received by (and sent from) the issuer's bank account. Once the system confirms a new transaction and identifies that it relates to a specific deposit, it can send the digital funds to that user's account +- Webhook: not all banking rails support this option, but it's the leanest in terms of back-end logic. In this approach, the bank proactively hits an issuer's endpoint once it receives a new transfer, updating that information on the issuer's database. The issuer can then can match that transaction to an existing in-process deposit, and validate that the user can receive their digital funds + +There are many ways to identify that a specific bank transfer relates to a specific deposit (and, consequently, to a user). Some banks (and countries) have transfer infrastructure that allows the creation of a single bank account per transfer; others require users to add an identification parameter to their transfers. Some banks provide the user ID number in the transaction information so issuers can match that with the information provided in the KYC form. + +Make sure to do a full security audit on your systems when banking rails connections are in place. Some banks provide a testing API that can be used for development and deployment to testnet or staging environments, which means you can test and audit the codebase before moving to a final production-ready bank integration. For better security, some anchors also prefer to add a manual final step before approving withdrawal transfers. In terms of UX, this manual approval is acceptable as long as the wait times align with user expectations, which usually means they aren't longer than a couple of hours. + +## Testing Edge Cases + +Once your application is fully functional, it's a good idea to test different scenarios and edge cases to make sure the system is behaving as expected. Here's a list of testing suggestions that should cover a large amount of the application's edge cases: + +### General Tests + +- Test the interactive flow usability +- Test the interface using different locale information, and check for translated content including error messages, responses, date formatting, and number formatting + +### KYC Tests + +- Check that KYC appears with a new wallet SK +- Check that KYC doesn't accept incorrectly formatted inputs, and that the error messages are comprehensible +- Check that you can use the same KYC information (email, phone number, username, etc) multiple times +- Check that you can go through KYC multiple times with the same Stellar SK. + +### Interactive Test + +- Check that the deposit flow goes through, and that the banking rails are working +- Check that you cannot make a withdrawal with a value higher than the current balance +- Check that the withdrawal flow goes through, and that the banking rails are working + +### Security Tests + +- Make sure platform endpoints are secured + +## Polishing and Internationalization + +Supporting two languages (English and the fiat currency country language) allows users to have a seamless experience while navigating through screens, and supports international institutions (like wallets) that need to test the product before starting new integrations. + +You can support multiple languages in your webapp by using the `Accept-Language` parameter from the http request headers to localize the content and allowing users to change that in a simple way (e.g. a flag icon on the top bar). If a specific wallet doesn't send the header parameter, we recommend showing the user a language selection screen in the beginning of the deposit and withdraw processes. Once a user chooses a language, you can store their selection so you only need to ask them once. In addition to localizing text, make sure to check number formatting, dates, etc. + +Having a group of beta testers is a great way to check if there are any edge cases that need polishing, and to confirm that the system is working well with a variety of user inputs. You can beta test using a soft launch stage before you start putting effort into marketing and distribution. Documenting the testing process with screenshots and videos is very helpful for future security audits, and gives new partners and potential users clarity and confidence in the product. + +## Connecting to Wallets + +All Anchor user interactions are done through a Wallet, so it's vital for Anchors to be connected to Wallets that have a good market penetration in the region where the business is most focused. Connecting to Wallets is a simple process, since both ends of that integration are already compliant with SEPs. + +Stellar.org maintains a [list of wallets](https://www.stellar.org/ecosystem/projects), many of which currently support SEP-24 Sending them a message with more information on an asset and an issuer account is a great way to start getting some real users to the Anchor. diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep31/README.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep31/README.mdx new file mode 100644 index 0000000000..3cf13af916 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep31/README.mdx @@ -0,0 +1,10 @@ +--- +title: Cross-Border Payments +sidebar_position: 70 +--- + +import DocCardList from "@theme/DocCardList"; + +SEP-31 allows for a means by which wallets and/or exchanges interact with Stellar's existing set of send-side services. + + diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep31/configuration.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep31/configuration.mdx new file mode 100644 index 0000000000..d68d781de3 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep31/configuration.mdx @@ -0,0 +1,382 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Modify a Stellar Info File + +Let's start by modifying our `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-31 functionality is supported by your business, and they also need to know all 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" + +DIRECT_PAYMENT_SERVER = "http://localhost:8080/sep31" +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" + +[[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'll 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 Cross Border Payments + +Now you're ready to enable cross-border payments the SEP-31 API. Specify the following in your `dev.assets.yaml` file. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep31_enabled: true + sep31: + quotes_supported: true + quotes_required: true + fields: + transaction: {} + send: + min_amount: 0 + max_amount: 10000 +``` + + + +The information provided in the `sep31` and `send` objects closely map to the information that will be exposed to the wallet application using the [`GET /info`][sep31-get-info] SEP-31 endpoint. The Anchor Platform also uses this information to validate requests made to your service. `sep31.fields.transaction` should be left empty and will be removed in a future release, but you can adjust the `send.min_amount` and `send.max_amount` values according to your service's limits. + +The `sep31.quotes_supported` and `sep31.quotes_required` determine whether or not sending organizations can and are required to request an FX rate using the [SEP-38 `POST /quote`][sep38-post-quote] endpoint. Almost all senders prefer this approach so that they can communicate the rate to their customers prior to proceeding. + +Add the following variable to your environment file. + + + +```bash +# dev.env +SEP31_ENABLED=true +``` + + + +Senders should now be able to discover, authenticate, and initiate transactions with your service! Run the following command to start the Anchor Platform. + + + +```bash +docker compose up +``` + + + +Check that your API is live. + + + +```bash +curl http://localhost:8080/sep31/info | jq +``` + + + +You should get the following. + + + +```json +{ + "receive": { + "USDC": { + "enabled": true, + "quotes_supported": true, + "quotes_required": true, + "min_amount": 0, + "max_amount": 10000, + "fields": { + "transaction": {} + } + } + } +} +``` + + + +## Enable the Customer KYC API + +Businesses need to collect and validate KYC information on the customers they're facilitating transactions for. Clients determine what KYC information needs to be collected and send that information via a SEP-12 KYC API hosted by the Anchor Platform, but the Anchor Platform never stores personally-identifiable information (PII). Instead, it forwards requests from clients to the business server, and returns the business' responses back to the client, acting as a proxy server. + +See the [Anchor Platform KYC API specification][platform-api-kyc] for details on the endpoints that must be implemented on your business' server. + +To make this API available to clients, lets add the service URL to our Stellar Info File. + + + +```toml +# dev.stellar.toml +KYC_SERVER = "http://localhost:8080/sep12" +``` + + + +Lets enable it in our environment too. + + + +```bash +# dev.env +SEP12_ENABLED=true +``` + + + +Finally, we have to define your business' customer types. Each type of customer requires different a set of KYC information. For example, you can offer your cross-border payments service in two distinct regulatory jurisdictions, so customers in different jurisdictions have different KYC requirements and would be represented using different types. + +:::info + +Currently, customer types must be mutually exclusive, meaning a customer cannot be more than one type. + +This limitation is in place because the Anchor Platform cannot validate whether a customer is approved for a specific type of transaction, such as one sending a large amount. It can only validate that a customer is approved for one of the customer types defined. This limitation will be removed in a future release. + +::: + +In this guide, we'll only have two types, a sending customer type and a receiving customer type. Currently, our customer types are defined in our assets configuration, but this will change in a future release. + + + +```yaml +# dev.assets.yaml +sep31: + sep12: + sender: + types: + sep31-sender: + description: customers sending to recipients + receiver: + types: + sep31-receiver: + description: customers receiving from senders +``` + + + +Let's ping the info endpoint again to verify. After `docker compose up`, run the following command: + + + +```bash +curl http://localhost:8080/sep31/info | jq +``` + + + +You should get the following: + + + +```json +{ + "receive": { + "USDC": { + "enabled": true, + "quotes_supported": true, + "quotes_required": true, + "min_amount": 0, + "max_amount": 10000, + "fields": { + "transaction": {} + }, + "sep12": { + "sender": { + "types": { + "sep31-sender": { + "description": "customers sending to recipients" + } + } + }, + "receiver": { + "types": { + "sep31-receiver": { + "description": "customers receiving from senders" + } + } + } + } + } + } +} +``` + + + +## Enable the RFQ API + +Businesses need to provide their send-side counterparts with a [Rate][get-rates-api] API to check the exchange rates they're offering between the on-chain asset being used for settlement and the fiat asset being used to pay the recipient. If the rate is competitive, senders also need to be able to request a commitment to the rate currently being offered from business for a short period of time. + +The Anchor Platform provides the [SEP-38 RFQ API][sep38] to senders for this purpose. + +To make this API available to clients, lets add the service URL to our Stellar Info File. + + + +```toml +# dev.stellar.toml +DIRECT_PAYMENT_SERVER = "http://localhost:8080/sep31" +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" +KYC_SERVER = "http://localhost:8080/sep12" +QUOTE_SERVER = "http://localhost:8080/sep38" +``` + + + +Lets enable it in our environment too. + + + +```bash +# dev.env +SEP38_ENABLED=true +``` + + + +We also need to enable USDC to be used in this API, as well as add an off-chain asset it can be exchanged with. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep31_enabled: true + sep38_enabled: true + send: + min_amount: 0 + max_amount: 10000 + sep31: + quotes_supported: true + quotes_required: true + fields: + transaction: {} + sep12: + sender: + types: + sep31-sender: + description: customers sending to recipients + receiver: + types: + sep31-receiver: + description: customers receiving from senders + sep38: + exchangeable_assets: + - iso4217:BRL + country_codes: + - BRA + - schema: iso4217 + code: BRL + sep38_enabled: true + sep38: + exchangeable_assets: + - stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + country_codes: + - BRA + significant_decimals: 2 + buy_delivery_methods: + - name: PIX + description: Have BRL sent directly to your bank account. +``` + + + +Lets test that your RFQ API is live! Following `docker compose up`: + + + +```bash +curl http://localhost:8080/sep38/info | jq +``` + + + +You should get the following: + + + +```json +{ + "assets": [ + { + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + { + "asset": "iso4217:BRL", + "country_codes": ["BRA"], + "buy_delivery_methods": [ + { + "name": "PIX", + "description": "Have BRL sent directly to your bank account." + } + ] + } + ] +} +``` + + + +## Configure Callback API Authentication + +Just as your business will need to make requests to the Anchor Platform, the Anchor Platform will need to make requests to your business. Let's add authentication to these requests as well. + + + +```bash +# dev.env +CALLBACK_API_BASE_URL=http://server:8081 +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +SECRET_CALLBACK_API_AUTH_SECRET= +``` + + + +`CALLBACK_API_BASE_URL` uses `server` instead of `localhost` as the host because the Anchor Platform will be making requests to your business server from 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. + +We'll define the server that implements the endpoints defined in the Callback API in the following section. + +:::caution + +Note that as of 2.x path segments are not supported in `CALLBACK_API_BASE_URL` (such as `http://server:8081/myPath`). + +::: + +[sep31-get-info]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md#get-info +[sep1-ap]: ../sep1/README.mdx +[get-rates-api]: ../../api-reference/callbacks/get-rates.api.mdx +[sep38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md +[sep38-post-quote]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#post-quote +[platform-api-kyc]: ../../api-reference/callbacks/get-customer.api.mdx diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep31/getting-started.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep31/getting-started.mdx new file mode 100644 index 0000000000..d6b239c2df --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep31/getting-started.mdx @@ -0,0 +1,21 @@ +--- +title: "Getting Started" +sidebar_position: 10 +--- + +This guide will walk you through configuring and integrating with the Anchor Platform for the purpose of building a cross-border payments recieve-side service compatible with [SEP-31][sep-31], the ecosystem's standardized protocol for cross-border payments. + +By leveraging the Anchor Platform's support for SEP-31, businesses make their service compatible with Stellar's existing set of send-side services. + +:::info + +As we improve the documentation, parts of this guide that are relevant to other use cases may be moved into their own sections. + +::: + +Before continuing with this section, make sure that you have already [installed][installation-ap] the Anchor Platform and configured the necessary features required by SEP-31: [SEP-1 (Stellar Info File)][sep1-ap] and [SEP-10 (Stellar Authentication)][sep10-ap]. + +[sep-31]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md +[installation-ap]: ../../admin-guide/getting-started.mdx +[sep1-ap]: ../sep1/README.mdx +[sep10-ap]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep31/integration.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep31/integration.mdx new file mode 100644 index 0000000000..b8fda8408d --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep31/integration.mdx @@ -0,0 +1,664 @@ +--- +title: "Integration" +sidebar_position: 30 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Integrating with the Anchor Platform for facilitating cross-border payments involves implementing the following, at a minimum: + +- [`GET /customer`][get-customer] & [`PUT /customer`][put-customer] KYC API endpoints to request & collect customers' KYC data +- [`GET /rate`][get-rate] RFQ API endpoint to provide FX rates between the on & off-chain assets supported +- `GET /transactions` requests to fetch updates on the Anchor Platform's transactions' statuses (documentation coming soon) +- [`JSON-RPC`][json-rpc-methods] requests to update the Anchor Platform's transactions' statuses + +The following may also be required depending on your use case: + +- [`GET /fee`][get-fee] if your business wants to provide senders the option to skip the quote creation step +- [`GET /unique_address`][get-unique-address] if your business uses a custody service for on-chain assets +- [`DELETE /customer`][delete-customer] if your business wants or is required to allow senders to request deletion of customer data + +## Create a Business Server + +First, lets create a business server and add it to our docker compose file. + + + +```yaml +version: "3.8" + +services: + sep-server: + image: stellar/anchor-platform:2.11.0 + command: --sep-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8080:8080" + depends_on: + - db + platform-server: + image: stellar/anchor-platform:2.11.0 + command: --platform-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8085:8085" + depends_on: + - db + + server: + build: . + ports: + - "8081:8081" + env_file: + - ./dev.env + db: + image: postgres:14 + ports: + - "5432:5432" + env_file: + - ./dev.env +``` + + + +Next, create a simple web server using your preferred programming language and a `Dockerfile` that starts the server. `docker compose up` should successfully start all three services. + +This guide does not provide an example implementation of the endpoints, but you can find more information about the request and response schemas in the [Anchor Platform API Reference][ap-api], and the sections below will expand on concepts important to understand when implementing the endpoints. + +## Customer Callback Endpoints + +The Anchor Platform never stores your customers' PII, and instead acts as a proxy server between client applications and your business, forwarding requests and responses to the other party. Currently, requests and responses are almost identical to those defined in the [SEP-12 KYC API specification][sep12]. + +### Identifying Customers + +Customers can be identified using two approaches. + +The first approach uses a Stellar account and memo. When using the Anchor Platform for facilitating cross-border payments, the sending organization uses their own Stellar account, the one used to authenticate via [SEP-10 Stellar Authentication][ap-sep10], when registering customers with your business. Memos are used to distinguish unique customers originating from the same sending organization. + +The second approach uses customer IDs generated by your service. For example, if a sending organization is registering a customer, your business will receive a `PUT /customer` request like the following: + + + +```json +{ + "account": "GDJUOFZGW5WYBK4GIETCSSM6MTTIJ4SUMCQITPTLUWMQ6B4UIX2IEX47", + "memo": "780284017", + "type": "sep31-sender", + "first_name": "John", + "last_name": "Doe", + "email": "johndoe@example.com" +} +``` + + + +In this example, the `GDJ...X47` public key identifies the sending organization, and the `780284017` memo identifies the customer. Memos are usually 64-bit integers, but they can also be other data types, so they should be saved as strings. In response, your business should return a customer ID. + + + +```json +{ + "id": "fb5ddc93-1d5d-490d-ba5f-2c361cea41f7" +} +``` + + + +Your business server can use any identifer for customers as long as it is a string. + +Following the registration of a customer, the sending organization can use either approach when checking the customer's status. For example, you may get a `GET /customer` request like the following: + + + +``` +/customer?account=GDJUOFZGW5WYBK4GIETCSSM6MTTIJ4SUMCQITPTLUWMQ6B4UIX2IEX47&memo=780284017&type=sep31-sender +``` + + + +Or, the sending organziation could use the identifier you returned when they originally registered the customer. + + + +``` +/customer?id=fb5ddc93-1d5d-490d-ba5f-2c361cea41f7&type=sep31-sender +``` + + + +Your business will need to maintain a mapping between the account & memo used to originally register the customer and the ID you return in the response, as well as the KYC data provided. In future iterations of the Anchor Platform, we may maintain this mapping for your business so you only have to work with the IDs you generate. + +### Customer Types + +Your business likely requires different sets of KYC information depending on the type of customer. You can define the labels for each of these customer types in your `dev.assets.yaml` file, and your sending organizations will need to understand which label to use when registering or querying the status of customers. + +In `PUT /customer` requests, you should use the type passed to evaluate whether the sender has provided all of the required fields. In `GET /customer` requests, you should use the type to determine the customer's status. + +### Test with the Demo Wallet + +You can test your implementation with the [Stellar Demo Wallet][demo-wallet] following the steps below. + +1. Select "Generate keypair for new account" +2. Select "Create account" +3. Select "Add Asset" and enter the asset code and the Anchor Platform's home domain, `localhost:8080` +4. Select "Add trustline" +5. Fund your account with a balance of the asset +6. Select "SEP-31 Send" in the dropdown menu + +You should see the demo wallet find your service URLs, authenticate, and check which KYC fields it needs to collect. It should then present a form for you to enter the KYC details for the sender and reciever. + +[![demo wallet after initiating a transaction](../../assets/anchor-platform-sep31-demo-wallet-widget.png)](../../assets/anchor-platform-sep31-demo-wallet-widget.png) + +Once you've entered in the information requested, it will send that information to the Anchor Platform, which will send it to your business server. Once the demo wallet has the customers' IDs you generated, it will initiate a transaction which should fail. + +## Rate Callback Endpoint + +Once the sending organization has registered the customers involved in the transaction, it will need to request a quote, or FX rate, from your business. The Anchor Platform requests this information from your business server using the [`GET /rate` endpoint][get-rate]. + +### Firm vs. Indicative Quotes + +Requests for quotes will have a `type` parameter that is either [`indicative`][indicative] or [`firm`][firm]. If `type=firm`, your response must include the `id` & `expires_at` date-time field and reserve the liquidity needed to fulfil this quote until the quote expires. If `type=indicative`, do not return `id` or `expires_at` fields because the rate provided will not be used in a transaction. + +Note that the client may request that the quote expires after a specific date-time using the `expires_after` parameter. Your business must honor this request by returning an `expires_at` value that is at or after the requested date-time or reject the request with a 400 Bad Request response, which will be forwarded to the client. + +### Using the Client ID + +Requests may include a `client_id` parameter that identifies the sending organization requesting the rate. You can use this parameter to adhere to the commercial terms agreed upon with that sending organization, such as offering discounted rates. `client_id` may not be present for indicative requests, in which case your market price should be returned. Currently `client_id` will always be the Stellar public key the sending organization used to authenticate with the Anchor Platform. + +### Delivery Methods + +It is common for businesses' rates and fees to differ depending on the payment rails used to send funds to the recipient. If your delivery methods are configured in your `asset.yaml` file, clients will always provide the payment rail they want your business to use for firm quote requests. + +Because this endpoint is currently only used paying out remittances in off-chain assets, the `buy_delivery_method` will be used. If this endpoint is ever used in other transaction flows such as SEP-24 deposits, then `sell_delivery_method` may also be passed for business that support these types of transactions. + +## Fetching Transaction Status Updates + +To facilitate cross-border payments, you'll need to be able to detect when a sending organization has sent your business an on-chain payment and determine which transaction that payment was meant to fulfil. + +The easiest way to do that is to run the Stellar Observer, which will detect these payments and update the corresponding transaction record with information about the payment. Your business can then detect these updates by polling the `GET /transactions` Platform API endpoint. + +### Running the Stellar Observer + +The Stellar Observer monitors the Stellar ledger for payments made to your account(s) and updates the corresponding transaction records with on-chain payment information. To run the observer, add the following to your docker compose file. + + + +```yaml +services: + ... + observer: + image: stellar/anchor-platform:2.11.0 + command: --stellar-observer + env_file: + - ./dev.env + volumes: + - ./config:/home +``` + + + +### Polling for Received Payments + +The Stellar Observer makes JSON-RPC requests to the Platform API whenever it detects payments received for transactions initiated by sending organizations, thus updating the transaction's `transfer_received_at` date-time. + +Your business should periodically poll the `GET /transactions` Platform API endpoint to detect these updates. You can refer to the following example: + + + +```bash +curl http://localhost:8080/transactions?sep=31&order_by=transfer_received_at&order=desc +``` + + + +The response will include a list of cross-border payment transactions initiated by sending organizations. This list will be ordered according to the time a payment was received for that transaction. For each transaction returned, your business should check whether or not it has already detected the payment for that transaction. If it has, you have detected all payments made to your account(s). + +## Updating Transaction Via JSON-RPC + +SEP-31 flow diagram defines sequence/rules of the transaction's status transition and a set of JSON-RPC methods 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 the request. If the request doesn't contain required attributes, the Anchor Platform will return an error and won't change the status of the transaction. + +[![sep31 flow](../../assets/sep31-transition-diagram.png)](../../assets/sep31-transition-diagram.png) + +:::tip + +Statuses in green are mandatory and define the shortest flow. + +Statuses in yellow are optional and can be skipped. + +Statuses in red mean the transaction is in an error status or it has expired. + +::: + +You can create a [template][sep24-integration-make-json-rpc-request] for making a JSON-RPC requests to the Anchor Platform. + +This chapter also contains information about the format of [request][sep24-integration-rpc-request]/[response][sep24-integration-rpc-response] and [error codes][sep24-integration-error-codes] that might be returned by the Anchor Platform. + +### Ready to Receive Funds + +SEP-31 Transactions should initially be in the `pending_sender` status. The Receiving Anchor waits to receive the payment identified by the stellar_memo included in the POST /transactions response. + +Once your business detects that it has received an on-chain payment for a specific transaction, it has to update the transaction status. + + + +```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 +``` + + + +The transaction status will be changed to `pending_receiver`. + +### Offchain Funds Sent + +To complete the transaction and change its status to `completed`, you need to make a `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 +``` + + + +### Offchain Funds Pending + +Another option is to move the transaction's status to `pending_external`. This status means that payment has been submitted to external network, but it 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 +``` + + + +### Verifying Customer Information + +In some cases, the Receiving Anchor might need to request an updated information from the Sending Anchor. For example, the bank tells the Receiving Anchor that the provided Receiving Client's name is incorrect or missing a middle initial. Since this information was sent via SEP-12, the transaction should go into the `pending_customer_info_update` status until the Sending Anchor makes another SEP-12 `PUT /customer` request to update. The Sending Anchor can check which fields need to be updated by making a SEP-12 `GET /customer` request including the id or account & memo parameters. The Receiving Anchor should respond with a `NEEDS_INFO` status and `last_name` included in the fields described. + +After the Sending Anchor makes a SEP-12 `PUT /customer` request, call the `notify_customer_info_updated` JSON-RPC method againto update the transaction status. Additionally, call this method whenever the SEP-12 status for a customer changes, such as when the customer's information is being validated and the status changes from `NEEDS_INFO` to `PROCESSING`. This ensures that any clients configured with a callback URL are notified of the latest customer status, allowing the client to prompt the user to update their information. + + + +```json +// notify-customer-info-updated.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_customer_info_updated", + "params": { + "transaction_id": "", + "message": "Customer info updated", + "customer_id": "45f8884d-d6e1-477f-a680-503179263359", + "customer_type": "sep31-receiver" // or sep31-sender + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh notify-customer-info-updated.json +``` + + + +### Do Stellar Refund + +Integration with the custody service allows you to do refund via 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 + +You can't do multiple refunds in the SEP-31 flow. For this reason, the total refund amount plus the amount fee should equal `amount_in`. Otherwise, you will get an error. + +::: + +### Refund Sent + +There is a possibility to send all funds back to the `Sending Anchor` (refund). You need to refund the whole sum(full refund). + + + +```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 +``` + + + +:::note + +You can't do multiple refunds in SEP-31 flow. For this reason, the amount to refund plus the amount fee should equal `amount_in`. Otherwise, you will get an error. + +::: + +### 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 details of the error. + + + +```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 those transactions that have been abandoned by the user after some time. It's a good practice to clean up inactive transactions in the `incomplete` status. To do so, simply change the transaction's status to `expired`. + + + +```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 + +The transaction status can be changed from `error/expired` to `pending-anchor`. After recovery, you can refund the received assets or proceed with the processing of the transaction. To recover the transaction, it's necessary to 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 +``` + + + +## Fee Callback Endpoint + +Your business may want to offer sending organizations the option to skip the quote creation process, allowing your business to use a rate determined at the time the funds are paid out to the recipient. In this case, the Anchor Platform will not make a `GET /rate` request, but you will still need to provide the fee your business will charge for these types of transactions using the [`GET /fee`][get-fee] endpoint. + +### Configuration + +You can enable these types of transactions by updating your `assets.yaml` file configuration: + + + +```yaml +assets: + - ... + sep31: + quotes_required: false +``` + + + +## Unique Address Callback Endpoint + +Businesses must provide a unique Stellar account and memo pair for each transaction requested by sending organizations so that the Anchor Platform can identify and map the on-chain payment sent for the specific transaction. The Anchor Platform can generate these account & memo pairs itself, but most businesses use a custodial service to receive on-chain payments. In this case, the business must request the custodian to generate the Stellar account & memo. This is done by using the [`GET /unique_address` endpoint][get-unique-address]. + +### Configuration + +To configure the Anchor Platform to make these requests, add the following to your configuration: + + + +```bash +# dev.env +SEP31_DEPOSIT_INFO_GENERATOR_TYPE=api +``` + + + +:::caution + +This endpoint may be removed during future major version updates of the Anchor Platform, when it adds support for connecting to custodial services and generating these addresses automatically. + +::: + +[ap-api]: ../../README.mdx +[ap-sep10]: ../sep10/README.mdx +[sep12]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md +[demo-wallet]: https://demo-wallet.stellar.org +[indicative]: https://www.investopedia.com/terms/i/indicativequote.asp +[firm]: https://www.investopedia.com/terms/f/firmquote.asp +[get-unique-address]: ../../api-reference/callbacks/gen-address.api.mdx +[get-customer]: ../../api-reference/callbacks/get-customer.api.mdx +[put-customer]: ../../api-reference/callbacks/put-customer.api.mdx +[get-rate]: ../../api-reference/callbacks/get-rates.api.mdx +[get-fee]: ../../api-reference/callbacks/get-fee.api.mdx +[put-customer-callback]: ../../api-reference/callbacks/put-customer.api.mdx +[delete-customer]: ../../api-reference/callbacks/del-customer.api.mdx +[json-rpc-methods]: ../../api-reference/platform/rpc/methods/README.mdx +[sep24-integration-make-json-rpc-request]: ../sep24/integration.mdx#making-json-rpc-requests +[sep24-integration-rpc-request]: ../sep24/integration.mdx#json-rpc-request +[sep24-integration-rpc-response]: ../sep24/integration.mdx#json-rpc-response +[sep24-integration-error-codes]: ../sep24/integration.mdx#error-codes diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep6/README.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep6/README.mdx new file mode 100644 index 0000000000..7af76ff6bd --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep6/README.mdx @@ -0,0 +1,10 @@ +--- +title: Programmatic Deposits and Withdrawals +sidebar_position: 65 +--- + +import DocCardList from "@theme/DocCardList"; + +SEP-6 allows for a means by which wallets and/or exchanges interact with an anchor on behalf of users, never requiring the user to directly interact with the on & off-ramp. + + diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep6/configuration.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep6/configuration.mdx new file mode 100644 index 0000000000..dea7867383 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep6/configuration.mdx @@ -0,0 +1,251 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +# Configuration + +To enable SEP-6 deposits and withdraws, the Anchor Platform must be configured to do the following: + +- Provide the necessary service URLs for SEP-6, 12, & 38 endpoints in the `stellar.toml` file +- Provide information about the on & off-chain assets, as well as the payment rails, supported by your business via SEP-6 and SEP-38 `/info` endpoints +- Support the endpoints and callbacks required to request KYC information and provide exchange rates + +## Enable Programmatic Deposits & Withdrawals + +Add the following variables to your environment file. + + + +```bash +# dev.env +SEP6_ENABLED=true +SEP12_ENABLED=true +SEP38_ENABLED=true +``` + + + +### Modify a Stellar Info File + +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 Stellar assets 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" +KYC_SERVER = "http://localhost:8080/sep12" +ANCHOR_QUOTE_SERVER = "http://localhost:8080/sep38" + +# 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. + +### Modify the Assets Configuration File + +Now you're ready to 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 `sep38` sections are methods that will be exposed by the SEP-38 [`GET /info`][sep38] endpoint. + +The methods specified in the `deposit` and `withdraw` sections are the methods that will be exposed by the SEP-6 [`GET /info`][sep-6] endpoint. The methods listed should match the methods defined in the SEP-38 section of the file. + +Also note that fiat assets, those with the `schema: iso4217`, do not need the `sep6_enabled`, `deposit`, or `withdraw` configuration objects specified. In the same way, Stellar assets, those with `schema: stellar`, do not need the `sep38.sell_delivery_methods` or `sep38.buy_delivery_methods` configuration objects specified. + + + +```yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep6_enabled: true + sep38_enabled: true + sep38: + exchangeable_assets: + - iso4217:USD + deposit: + enabled: true + methods: + - ACH + withdraw: + enabled: true + methods: + - ACH + - schema: iso4217 + code: USD + significant_decimals: 2 + sep38_enabled: true + sep38: + exchangeable_assets: + - stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + buy_delivery_methods: + - name: ACH + description: ACH debits for US bank accounts + sell_delivery_methods: + - name: ACH + description: ACH credit for US bank accounts +``` + + + +### Managing Distribution Accounts + +Note that the example above lists a `distribution_account` attribute for the USDC entry. If specified, this account will be provided along with a randomly generated and unique-per-transaction memo to clients as the address to send funds to for withdrawal transactions. The transaction's memo is how you or the Anchor Platform will match the funds received with a transaction record in the Anchor Platform's database. + +If you do not have your own Stellar account and instead use a third party that provides you a Stellar account and memo so they can receive funds on your behalf, such as an exchange or custodian, you should omit the `distribution_account` field from your assets config file. Instead, you'll need to provide the Stellar account and memo you'd like to use to receive funds through a request to the Anchor Platform's [`request_onchain_funds`][request-onchain-funds] on a per-transaction basis. + +To configure the Anchor Platform to expect the Stellar account and memo to be provided via API instead of configured via the assets file, specify the following environment variable. + + + +```bash +# dev.env +SEP6_DEPOSIT_INFO_GENERATOR_TYPE=none +``` + + + +If you use a wallet provider supported by the Anchor Platform's custody service, such as Fireblocks, you can also configure the Anchor Platform to connect directly to your wallet provider to fetch your distribution accounts and memos. If this is configured, the Anchor Platform will also use the wallet provider to send funds to customers. See the [custody services] section for more information about configuring this feature, but first you'll need to specify a different value for the above-mentioned environment variable. + + + +```bash +# dev.env +SEP6_DEPOSIT_INFO_GENERATOR_TYPE=custody +``` + + + +### Enable Callbacks to the Business Server + +Businesses need to collect and validate KYC information on the customers they're facilitating transactions for. Clients ask your business what KYC information needs to be collected and sends that information via the SEP-12 KYC API hosted by the Anchor Platform, but the Anchor Platform never stores personally-identifiable information (PII). Instead, it forwards requests from clients to the business server, and returns the business' responses back to the client, acting as a proxy server. + +Additionally, businesses need to provide clients with a [Rates][get-rates-api] API to check the exchange rates they're offering between the onchain and offchain assets supported by the business. If the rate is competitive, clients also need to be able to request a commitment to the rate currently being offered from business for a short period of time. Similarly to the KYC API, the Anchor Platform makes requests to your business server to fetch exchange rates and quotes and returns them to clients. + +To enable these requests to your business server, first you'll need to add your business server to the docker compose file. Then, to support requests to your business server from the Anchor Platform, you need to enable callbacks. + + + +```bash +# dev.env +CALLBACK_API_BASE_URL=http://business-server:3000/callbacks +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +CALLBACK_API_AUTH_JWT_HTTP_HEADER=Authorization +SECRET_CALLBACK_API_AUTH_SECRET="a secret used to sign JWTs" +``` + + + +The above tells the Anchor Platform to include a [JWT][how-to-use-jwt], signed with the configured secret, in the `Authorization` header of requests made to `/callbacks/` so your server can authenticate the Anchor Platform before processing requests. + +`more_info_url` is an optional URL provided by your business server for wallet applications to display information about previously initiated transactions. This URL is typically used by wallets in their transaction history views, and your business can specify the information to be displayed about the transaction. + + + +```bash +# dev.env +SEP6_MORE_INFO_URL_BASE_URL=http://example.com +SECRET_SEP6_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" +``` + + + +See the [KYC API][platform-api-kyc] and [Rates API][sep38] for details on the endpoints that must be implemented on your business server. + +## 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 something 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 + +SEP6_ENABLED=true +SEP6_DEPOSIT_INFO_GENERATOR_TYPE=none +SEP6_MORE_INFO_URL_BASE_URL=http://example.com +SECRET_SEP6_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" + +SEP10_ENABLED=true +SEP10_HOME_DOMAIN=localhost:8080 +SECRET_SEP10_SIGNING_SEED="a Stellar private key" +SECRET_SEP10_JWT_SECRET="a secret used to sign JWTs" + +SEP12_ENABLED=true + +SEP38_ENABLED=true + +CALLBACK_API_BASE_URL=http://business-server:3000/callbacks +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +CALLBACK_API_AUTH_JWT_HTTP_HEADER=Authorization +SECRET_CALLBACK_API_AUTH_SECRET="a secret used to sign JWTs" +``` + + + +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]: ../sep1/README.mdx +[stellar-demo-wallet]: https://demo-wallet.stellar.org/ +[get-rates-api]: ../../api-reference/callbacks/get-rates.api.mdx +[sep38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md +[platform-api-kyc]: ../../api-reference/callbacks/get-customer.api.mdx +[request-onchain-funds]: ../../api-reference/platform/rpc/methods/request_onchain_funds.mdx +[how-to-use-jwt]: ../sep24/faq.mdx diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep6/getting-started.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep6/getting-started.mdx new file mode 100644 index 0000000000..3a1d875e92 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep6/getting-started.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]: ../../admin-guide/getting-started.mdx +[sep1-ap]: ../sep1/README.mdx +[sep10-ap]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.11/admin-guide/sep6/integration.mdx b/ap_versioned_docs/version-2.11/admin-guide/sep6/integration.mdx new file mode 100644 index 0000000000..2d24140610 --- /dev/null +++ b/ap_versioned_docs/version-2.11/admin-guide/sep6/integration.mdx @@ -0,0 +1,975 @@ +--- +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 require determine if a transaction requires the customer to update their information. The required SEP-9 fields can be communicated to the user by returning a `NEEDS_INFO` status with the required fields in the `fields` attribute. + +After the user has submitted their KYC information, call the `notify_customer_info_updated` JSON-RPC method againto update the transaction status. Additionally, call this method whenever the SEP-12 status for a customer changes, such as when the customer's information is being validated and the status changes from `NEEDS_INFO` to `PROCESSING`. This ensures that any clients configured with a callback URL are notified of the latest customer status, allowing the client to prompt the user to update their information. + + + +```json +// notify-customer-info-updated.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_customer_info_updated", + "params": { + "transaction_id": "", + "message": "Customer info updated", + "customer_id": "45f8884d-d6e1-477f-a680-503179263359", + "customer_type": "sep6-deposit" // or sep6-withdrawal + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh notify-customer-info-updated.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](../custody-services/fireblocks/README.mdx). 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/learn/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-reference/platform/transactions/get-transactions.api.mdx diff --git a/ap_versioned_docs/version-2.11/api-reference/README.mdx b/ap_versioned_docs/version-2.11/api-reference/README.mdx new file mode 100644 index 0000000000..1a9f52ea6c --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/README.mdx @@ -0,0 +1,10 @@ +--- +title: API Reference +sidebar_position: 20 +--- + +import DocCardList from "@theme/DocCardList"; + +View all Anchor Platform API information. + + diff --git a/ap_versioned_docs/version-2.11/api-reference/_category_.json b/ap_versioned_docs/version-2.11/api-reference/_category_.json new file mode 100644 index 0000000000..0d44758281 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/_category_.json @@ -0,0 +1,3 @@ +{ + "collapsed": false +} diff --git a/ap_versioned_docs/version-2.11/api-reference/callbacks/README.mdx b/ap_versioned_docs/version-2.11/api-reference/callbacks/README.mdx new file mode 100644 index 0000000000..54cf2996c5 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/callbacks/README.mdx @@ -0,0 +1,22 @@ +--- +title: Callbacks Server +sidebar_position: 20 +--- + +import { EndpointsTable } from "@site/src/components/EndpointsTable"; + +The Anchor Platform provides several callback functionalities for your business server. + + + +| | | +| ------ | ---------------------------------------- | +| GET | [/customer](./get-customer.api.mdx) | +| PUT | [/customer](./put-customer.api.mdx) | +| DELETE | [/customer/:id](./del-customer.api.mdx) | +| POST | [/event](./post-event.api.mdx) | +| GET | [/fee](./get-fee.api.mdx) | +| GET | [/rate](./get-rates.api.mdx) | +| GET | [/unique_address](./gen-address.api.mdx) | + + diff --git a/ap_versioned_docs/version-2.11/api-reference/callbacks/del-customer.api.mdx b/ap_versioned_docs/version-2.11/api-reference/callbacks/del-customer.api.mdx new file mode 100644 index 0000000000..07d817a0eb --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/callbacks/del-customer.api.mdx @@ -0,0 +1,144 @@ +--- +id: del-customer +title: "Delete Customer Data" +description: "The request for this endpoint is identical to the" +sidebar_label: "Delete Customer Data" +hide_title: true +hide_table_of_contents: true +api: eJztVE1v2zAM/SsCd9gGOHaa7eRb0eZQYBiKpTslASZLTKxNllSRXhsY/u+DHLtptmy/YL7Ypvgh8j2+DljuCco13LTEvsFIsM3geUYYBvNqeT+7WkA2fHy4SocaSUUT2HgHJTzUKCI+tkgsdj4Krg0JdDp441gYEkajY6OkFewF17hx62+3y0/Lh6Uo1Fj02/ZdzRyoLIq94bqtcuWbghitlXF6z0L07JW3RWV9VTSSGGOBytOBGJuCMMzm86tF3ug3U+KZRouM7zduuqPGnXGohXHi2Fu+cRt3O7il64kp9C0JLVkKH8Vji+354XiWGh4qGO/yjYMMfMAo0++dhhI02mmukEGQUTbIacblugOTxhck15CBkw1CCUZDBqRqbCSUHfAhJCtxNG4PfQapCRNRQ8mxxX6bLBS8I6Tkv5h/TK9zgFatUkiUp/iPlxymGwrnE4St0zlkoLxjdJzcZQjWqKGr4julmO7PS/rqOypOXcY0AzbHK2GMPl7sxegL5rMe12P0NgM2bJPfcjD06ckAnxkdGe+O8/yBBygn6mbwU9oWL1I4za1Brv0IETIO6HANJbxwsuiM7hMcGH9OkLXRQgkTVZW0tpLqR161ZBwSzY6+OT7LJliUTtU+JipDKmnczqeWU7bj5D/k83wOlzZqdXCqjt75lsTNWIbE9f2doIDK7EY4xo1DsTquiLgeSop7K3nnYyNC9AmWgeP/znvcC5p2mUQjNYrqMKR/yfdUG4vCDIsdok/EMm4v5EkCom+EFMoadCxeMScXD2n3jzN5m+qMxB1lgfBUWu52qPi88u/+l0oMGzhR5dTeakAFMrBGoSNMIIwLdx2kqlEsBhhO6JZF8fT0lMvhNPdxX4yhVHy6u1l+Xi1ni3ye19zYgbPBEzfSvUo8CsrLbt1Klr8j3Z2W7L+MnsvoKAuMz1wEK41LijHg042LugZ1UtbS6KQStSdOJ11XScKv0fZ9Mj+2GA9QrrdJFKKRVeLHugNtKH1rKHfSEv4DnXdfRlF6L/52udEo3eGkPQDZqEpGQ7/tM6hRaoyv5OpaKQz8KuQPsT1TqyPi0Pe/AB/asHM= +sidebar_class_name: "delete api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +The request for this endpoint is identical to the [`DELETE /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-delete) request defined in SEP-12. + +Delete the customer's data or queue the customers data for deletion. + + + +
+ +

+ Path Parameters +

+
+
+
    + +
+
+
+
+
+ + +
Success.
+
+
+ +
Customer not found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/callbacks/gen-address.api.mdx b/ap_versioned_docs/version-2.11/api-reference/callbacks/gen-address.api.mdx new file mode 100644 index 0000000000..d294ffb4ab --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/callbacks/gen-address.api.mdx @@ -0,0 +1,259 @@ +--- +id: gen-address +title: "Generate Unique Address" +description: "If the platform is configured with `depositInfoGeneratorType: api`, the Platform make this request to" +sidebar_label: "Generate Unique Address" +hide_title: true +hide_table_of_contents: true +api: eJztWFlz6joS/isa34c5OYVZQwK8cYBwCIQQtpCtiJAaW2BLRpIBJ5X/fks2JGS5d6amZh6mKnlJIrW7W+pF39fPFgVFJAs0E9yqWK050i6gwMN6LqSPmEJE8DlzQgkUbZh20SOFQCimW3wumsBBYi3kMAqggnDAHlOxgt5egY+XgLTLFJKwCkFppMU9NyJVTlwh0QyTJXCKYA0yQpr5gDDSEnOFiXHKuMA40wxroGgWIYyIx4BrhIPAYwQbofQ9v+fDN6V+qDRyQiwx12DsYx275YMvkAQdSg4UMf7eM6ZQyNkqhBRSAjGNCOZoBsjHQQAU5Wwt7BzSAuHX891zCUqEkgBSIXERVgiju0GjZxdyDz9crQNVyWSUBs/DMi2kkwmk0IIIL6MgsAu5o8Ozxsf4DRKMK67YJO7NPbFBGxF61DgTKqBoLiTqAwG2ZtzZHVolx+QA1PhIJGBtjg5M7o6FHn9gQkTIdSq+iaNHFGAm1T0XoVaMwrvYp1CojPYak8SDinHt7h93b4fyQfqY0TTjywzznUyAl6IC3ZU3JjrMP1Wvpuejs2GUY5cbN2qUqyM3DLOX/avczZr6rXb9fDwa3LS86wFzGzfTNYT9i7Dn/sbDcY2Ux4te/Ri20dPNYBzVO35pZHf7YbWw7ZdoxybNk6pY4YutcxmcZuVJ2SnKxXZS7Xt1ul2Fx+1xzZlc5MfBRvYp6bRgGJZy3qx/5fYm1eD3RExvt83gmB0LMQjC6nJTxypHj50LvCKbRb2VFbPLzmlQUKPV+Yko1rsX3apdpDAprrxuq2VfN7brhe13xlNSuOwfK88p+erEOZ38PlkHK7Ll+cnaad1EYe180HP4r/zm+Next2w13as2y+drNRXR8eJ0wupndhO3T67r5fbEG86Xw41oqnnpnKzrNyvHni7ydHk2r+ccOKtHg2LgzfKjrM/r/VYt23NIt3Z92hj9GpOmXtXqvdFKnZYv19PbQQk2Ue5ie3whWbUtpk9Fv00vb7xbhgEuyl5Y3Iy9cifH87f85MottkazYvual6OT6/z1qFOsD0aDNb2VZ+fb05msO1GvTmkJjsEf5Ton21M+l0+82xsu+p2u9p/CKp/kO5O8Gk4n7dZ5YTTdzubli1nhmrbqTad2XmQlp9WuecXxWa11rqFEbK80WaxhUco3+ZZ2cTMa/Sb5aSnXWNzOSM/tdzZP4Sh/dXqzbY8WS9loeUs3u4iqZVZak3KwXd/iM5qvXUZ2bdYvF1i9PsB+uRC63V6zbpPF5LQaBroxI8AbOXqOPft2sBr1et2+XTr/vZzmi/3r4/aQNW36ZBfEQDzxKPt0vl2c9cUZy49/NW019XJRd3p7sZou2+VeKXt1+lSFcNsIvV+DYbDMbQo2Pzsrs8nldRYXGrxLTroX86W7XC2i/GXg8JGKTnk+37ws1fnsZFYddpxVuG2XBeS64eppXFrnO63c0eea8tgaMkCZ/uO7qr6r6ruq/pOquudWyhKBwSdM8Ba1KpYDvEqpBKWslKWxo6zKnTVK3sb9xkPK2toKgngvecjNWoAl9kGDNOvPFjNgaRWCjKyUxbEPVsU6eMinjFqpD9BqeIirFMg1SLRhnocUXu9eXqEMxjkEP5hTFGCl4v3H9xYekXalCB03gQnAaSAY1+l7vkNxOAFDG6ZcUAYTJMjn0IBNIQBODZxKMMIUJ/eQOtTg4wjFh40X7x6bjSHKHGhRj6/WkZi/B4DVXuutv1FYg2diotLvMNFOWGUSg/Z+IYMDZkuYgwROILPHWirjgLYPHDhKx9FWxAUfW5VnS0eBCYnSknHHeklZBuMxCdSqaBnCy4NZUYHgCpSRz2ez5tf7iA1CQkCptJWyiOAauDYyB7Azs1BG8PmzYTFbANFWygqkOa5miZn3d/zZYpWj5EuDujVm3AAwc517ALe7tb2GioFxCYpLgKEWiJlosrkByhSUZjxByCbj/9a3D6q/cA49NtPp9CPaSaKdJBISYfR4Ee/d+eEW6EeRf5kBVBCV8QBLngFOImJEKMPvksxWARCGPfYENBMI4QG1d3hW2bHZg3/BF+qP94tHJjcxRz9/wpaZi3F+/kS7zYQLABrs/OagN0IuD27tLZWM7s+3M9zTC8MPtMbENX8d6gxw5APXf6lzmqx+pdjsGO//LQPoh4atTiEXKzdlgsPo0WejKQt46JsmZ6StlGXErZTFqPXw8q5g7j6lxsNL/JOyil+VTUNKIdNoeNgF4kaXVBzdu/2ZxiUE0+wp7APaVygigkLcCmeCRv/FcgTj6ZftgtEvlj/cSvL1Q8rSTHuwP7i1uxrYauDK5G38YCwhsir7lyVlrbEXwuELYzqSD9oVyTsV+4q1a1WszIemkbKSxyPRG0rPqlj76iLY8wyhTs8MdwOl7EQ2DVvsBx4k7TVNhG8Zg4zP40w22pLYFdLZdPbLp2sQceJKwUWoUG1nRpnujuKynO9DaKjpYVLuGPlrJgRSmFi8Mva/1kthbs6wp+cK+ZiCmQC8e182LvPAkHWmjG7TsE3TxK+sfi6F//XQwKToPU/u5J/qNd3ULkEVvJnG87npyu8sf5T/ei5hveXH2/EGcVSslOUxAlzFVb9DEdUAExdQPg7DW3Qrmcxms0njeDdumbtPVabTqjW6g4adT2fTrva9OFENlvAxP1C8m9UA+gB4PgT7+a24vqdB39Og72nQN2/95q3f06Dvqvquqv/nqkqAWILnDeExMwfGDdSPMdbzDm3ffaToDynLFUqbnefnGVYwkt7Li1lOpj8Gg1Om8MwzpGCOPQV/A6h+9Hf84Qh9j4P+5+OgL8OdELFPs7odIbNiXrTGkpmIWpW7h5eU5QKmIA9oXJUQCPTBV59I6Ds612wMrZeXPwEbr0K4 +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +If the platform is configured with `depositInfoGeneratorType: api`, the Platform make this request to the Anchor backend every time a transaction is initiated by a client application. + +The Anchor must guarantee that the memo returned in this request is unique, so it can be mapped 1-to-1 to a Platform resource such as a [SEP-31](https://stellar.org/protocol/sep-31) transaction. + +Here is how this flow would be used for Receiving Anchors that need to create their unique `(account, memo)` pairs outside the platform, using Circle: + +[![](https://mermaid.ink/img/pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1)](https://mermaid.live/edit#pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1) + + + +
+ +

+ Query Parameters +

+
+
+
    + +
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
    + + + + unique_address + + + object + + + +
    +
    + An object containing the unique + `stellar_address:memo` pair used to identify a + destination. +
    + + + +
    +
    +
    +
+
+
+ + + +
+
+
+
+
+ +
+ Error. The Platform will respond to the client application with the + same response code and body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/callbacks/get-customer.api.mdx b/ap_versioned_docs/version-2.11/api-reference/callbacks/get-customer.api.mdx new file mode 100644 index 0000000000..932d7ad907 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/callbacks/get-customer.api.mdx @@ -0,0 +1,563 @@ +--- +id: get-customer +title: "Retrieve Customer's Info" +description: "The request and response for this endpoint is identical to the" +sidebar_label: "Retrieve Customer's Info" +hide_title: true +hide_table_of_contents: true +api: eJztWG1z2zYS/is7uA9pZihKdtJco28eRcnp2jo+y+lNx/bYELES0YAAC4CWNR7995sFSImyGbu13ZvLTfzFFAksnt199gV7wwS6zMrSS6PZkJ3kCBZ/r9B54FqARVca7RDmxoLPpQPUojRSe5AOpEDtZcYVeAM+xzN9evlhfAL9rHLeFGgvz7/LvS/dsN9fSJ9XszQzRd95VIrb5n+vtMabzKj+TJlZv+DOo+1jZtzKeSz6DsveYLC3nxbib43g3gL9yzPdCVXgXGoUIDVMx0e9vf30TJ/pkx3wXCmzdJApido78GZIawD2UniPPstJG5hLVMKFR4f2Cm0wjbToSLaxAi0pbnEhCTJw0LiEBiJcSQ68hkCWOfr0X7FMWfmXjQ9Jqcm8rYEw6EAbDzm/QuBbtI0WKGpfI5Tc8gI9WgcOyeM6vK5lJyA9uNxUimzvK6sjBWqr1aYS213RPSkQxxwvtq8aKTOsBaGAZY4atGlj4BYDjjS6aj+FUY7Z56id575yYOZtlXzOPRR8BVxZ5GIVD2jU3JDiDhcgC3KXOfocoykameT5ubEFp3iBJXfAswxLjyIBi79hFp6MBeelUqARhYPCWAz70tve6FwV9rcWxc9VKbgP5tyc3+0BuOWA9EyzhHm+cGx4ykaNIuw8Ydc9h2V4TSx9wxIW2Vo/vNqjRaZEG46bCDZkC/SNCJawrXfY8PSGSUohv1doVyxhmhfIhkwKlnQkmck7clbbtMDd1v23SBMdW1q8kqZyQJFUszBlCXNZjgVnwxvmVyWd6byVesHW66QbE88yU2nfCWwaQ4988HN1jQIO4mLglc9juiM3LKWPSeJIcU8eCeEezDd4FKYCC9MJiD7AFVcV1vl2vpJ60eZ5wMLB5ZzirVYuIf5ajETa+UKZ+7J+vnw01ouwtgswfSCHBeCVQ0Eh1UB/EPd9gBKGuiqIr4FVOXc5URuvPTv/ItgHcfIsBPMOF6WDGZKZf/x1FBJiClPEusad0MZpiZmcExuk0c+dzAlaz7VPeHmmhcmqArW/Vdoe40BvuXZR74svBGhrCcia78tc1qWxMdSLmBDJXtw5k0kKjhT+Tdm7nSnn1hS7FhZYohYOTF022ud9h+kiTbYZsZEiW2WFipTidkGJoyDiuJePs4XigVm7FniHc16pWA0uUV+m8BPXi4ovEDIjEGrfoIDKEU0m04/w5tXb3l4K/6gKroEKDp8p6kY2cl0CWW5khi6hjuVMF+gcX6BrFcCQ+KQDVR/3kIPPE9YkSUff9wcD+rerzS9cSbHJmNAkcEAZClxTHvFaOu+a6rONhRi6pOxsdbsxkC40PdSAFRU1HKU1V1LgthLF3OVqQ8w6kvvMiFUKx62fEmO5v91gQjRE0+KdaanhNEbCX9ppRi9kRnvUnuzLy1LVkdn/zZGRb+46ycyoIWDkoUhaylyxU6HCWloqrV5Gx0nR4d6kWX5PKjwYjcZHJ+N3LGFHxx9H4+l0cviBJexwPH43vZgcvv/IEnY8/ud4RIvO1wmLDUIXUC6EJJ24OtoB11agI5/eUSbK/TLmzYuZ1DwGY1XMQktBXU5AuUPhDsvUodT6xq3lJEt6LDpMtl5TMxPVa32dGaOQa7Ze04KavuLim5E6jfQURm5ImLBfxseT95PRwcnk4+HF8fhfnybHNTnRWmO7cBGyOmF2w/bSK3r1YduiNjmFcOM1L0oVbTGtsgyd+/HXUQjcqijIwLHwZdxhvH60WpWcU0OAGlzcOa+UWlFz8EKE3MdLIg5SKQ3proloJvYy3J+//qH3aj7f671++73ovd1/Pej9nX8/ED8M3mTzsKkxatt2HVScS+v8RSxct5P8yW5ZDkshLE3ueOruceuEKf5HZdPKPyUaCy7VBRfConMPig+roVn9h46o/xL2uqv+jYlT6VMy+G7kfomjSXcWX+9WgLj7fEvYAI81+F/fxX9oPLw3lRZfgw4h1DxqRx1PuBZ+Roqt+rK5CZB7Lp3U1RToc1PfOMNN0+dsyDbzE6JBuB7HIyqr2JA1HUDGlZrx7HM6o+4MnevFtWmdA7jOcmOpQ2B0FLWYpDJJiwZ/lQ7SQff1cKWz3BpN19BRfYyDg6MJ7LTrmxlKc508CEdub4ulNeSWejR1n9zY67imfXNQcIFNJ7aRt8ylQpoHSEeyKUfFW2IzIgsdOK+nHNBiThjInOlokxdu05a5uudyuD2az+eY+d2Tb6/vOiKOIGqqbNWbBq+whCmZIaXp4U3TlR+UPMsR9oMbtt4d9vvL5TLl4Wtq7KJfb3X9nyaj8eF03NtPB2nuCxU4WxrnC65bgo/RW4lXuOmCXziYEAHuFNNNoH2bin6bin6biv5fTkVjkaMJUr9UXIYGN2Sbm7rinLJNxTlPWG6cp3c3NzPu8JNV6zW9jhMFqkNCOrr1Czacc+XwgZzynEPQTlVi5ZWttpQxmoP8OZjPNBK9B+F2IPsEmH/9oPQeDerx7RPgP31s+gC8ZmL7DBi//pHpPbZ6BjN9pbPT+4xye2L8SPP8jw1W79G4ngtv9TynH1bS4Wx4SrOKHLlA27rjHISy19p154a2c7X5MD5h6/V/AIMyEEU= +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +The request and response for this endpoint is identical to the [`GET /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-get) request and response defined in SEP-12. + +This endpoint allows clients to: + +1. Fetch the fields the server requires in order to register a new customer via a SEP-12 [`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) request + +If the server does not have a customer registered for the parameters sent in the request, it should return the fields required in the response. The same response should be returned when no parameters are sent. + +2. Check the status of a customer that may already be registered + +This allows clients to check whether the customers information was accepted, rejected, or still needs more info. If the server still needs more info, or the server needs updated information, it should return the fields required. + + + +
+ +

+ Query Parameters +

+
+
+
    + + + + + + + +
+
+
+
+
+ + +
+ Valid request. Customer either already exists or the customer + identified by the parameters is new and must provide the field values + described in the response body. Response bodies are identical to the + schema defined in + [SEP-12](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-get). +
+
+ + + + +
+ + Schema + +
+
    + + + +
    + + + + fields + + + object + + + +
    + +
    + + + + property name* + + + + +
    + + + + +
    +
    +
    +
    +
    +
    + +
    + + + + provided_fields + + + object + + + +
    + +
    + + + + property name* + + + + +
    + + + + + + +
    +
    +
    +
    +
    +
    + +
+
+
+ + + + + + The case when a customer has been successfully KYC'd and + approved + + + +
+
+
+
+
+ +
Error.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Not Found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/callbacks/get-fee.api.mdx b/ap_versioned_docs/version-2.11/api-reference/callbacks/get-fee.api.mdx new file mode 100644 index 0000000000..aa52875ec0 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/callbacks/get-fee.api.mdx @@ -0,0 +1,354 @@ +--- +id: get-fee +title: "Retrieve Fees" +description: "The Platform will make this request to the anchor every time a transaction is initiated by a client application" +sidebar_label: "Retrieve Fees" +hide_title: true +hide_table_of_contents: true +api: eJztWFuP27YS/isD9qEt4JXdTQsUfvNJN4XRog2yKQ4O1ouYpkYWuxKpkKN1DMP/vRhSsmRbyZ6k26KXfTJMkXP55j47kaJXTlekrRFT8TpHeFlIyqwrYaOLAkp5h0C59uDwbY2egCxQjiCNyq0DvEe3BdIlggRy0nipmBhoD9po0pIwhdUWJKhCoyGQVVVoJfnSwmw05bYmkLB8W1vCNzpdJguzMCzJLLIoa0+AxteOJZEU2Hs0qTZrkCYFhwr1Pf9TtSdbovPgK1Q605iCNuFBK36JGCn88L/n4VA7LNGQXxiDCr2XrI+FSjpi3ZvnfdUiZqsz2gfBZU9wh1S7eC1DBE0RV5VLt0bIrDslH6jMmxc11Q5H0QBo0spqQ1DKLawQao9pkNTZe50ioCddBrgzRM9fzhH3UDnNPG1rHYatx90nC/PfHE1kqXJp1si2LGUa5OiA9CrHUkZtVggylRVFgXxdVdZFlGuPoKTHZGHESJBcezG9ES8QvbgdiXcXHqtwcn318uLZV3xmK3RB1nkqpmKN9AJRjEQlnSyR0PH1ndDsrm9rdFsxEkaWKKaCfeKN9B5JjAYcO3wJQp3jEtVgAif+rQ3guwYGNtYyOhtGPkvQZmFuZoHyPEVDOmspvrCulHT7RU5U+el4vNaU16tE2XLsCYtCuvb3onKWrLLFeFXY1biUntCNUVm/9YTl2GN1MZk8+zYp088C2wt9xOoiC6y+jBhHu4jpTtC2CrCQ02Yt9iPRuHsqpuRq3I+GYTzS8AEkD/HYwNXBeAZcZ51/JGpRvdLW5j2YhU9gs2MkHnTHBxwwgZ8N9qgGLsuFOboZDyNRWWzk1nPEaqOKOj3PYjDP3idWl1X7CTuYU5M/SpLKYXzTkB3BylLewDCYnzN0aBSmEAgfEkvFiqYPWOlBX/6/DHMS2x/t18PGAOsW5s80BmiuZn89Y0Qd3uj0zA4zA21wojsUxQGdS3kXClYfoddcqebfgZKmXxZtlqGDVGdBFToUxe4k0ueKN2t5zb/jCs3kr2OWAalU6x+y13WwV0xhbiAWrlgalwcNl+BzWxcplJJUHj2pT+jO2E379oRq74k1nTqyppwRUpIQ7rUMj7+aPGL2QjdkGg6RwOry0F0xSjY7asNqj+5xy88nCNP1gZ8izi2f+Moaj57vX04m/HMswHWtuEdMxEgoawgN8Z2eh45/9Xxxd87Yrn5FxSmoctzikI5sMsShS51wN+KQvGJFvj0l0Xwf0jG+GApRQZoKPprF1/2jF4ivGijEfs9fvr68PAfjF1M5G1rmVYFwZUjTtglHT5Jq3wbBCps2GFPYxObykFlrdjxP1qZH3eWqJg5oY2lhmhZago/oQ2unBGacjWVZFTEZbw6da3sFlE0RNq0YsmLoHE8lYULpvBjdwkiTjq2D1gP5hrEEFbpSU9PctkPNybjDg0yk1WXlmF0TiM180wj70cLQ2ZgVxT00n+eZ7/NuAAusJCy/nkzgPzKFV/F8GWahpo4wlYVB5zifsIXW2M4JYRo77nAj8A1gK5tuY+w8kocHKQa9U6fDrtl3/vj6tnPOq3AQ3fKboRgNF9gPPxrknhVliSc+xOgGbP4GyOxHAt8RGs8TXZiX7nArpu28NRL3sqixP3dx+iuRctsMXWHiolxMxTgL85dHd98OX7UrxFS0LbqSRbGS6i5Z1V4b9P4i3k2ayIx+xi28YC7aZJaVY2rRYM+SSTIZzvVbo3Jnja09PG/YeJi9nLdh1tit7Rjaot1sDg7mr5xlAxwG9PfTTTFjHdpgi4NvGzGdO+W6CLO85oE65MBQwA8xmjlbDq48gl9ypmEBP+/ylG+80mPHWmYZKjrmfHp/iEUctRun6NS7DlYRI1FohZzap7u25s4qqXKEy2CGzrrT8Xiz2SQyfE2sW4+bp3784/z51U/XVxeXySTJqSyCd1bWUylNj/ArJKfxHiFM/Ccm3nVx9LR5eto8/bGbp5hKCd/RuCqkNpxlg6fvmkR3E1qx25HIrSf+u9utpMdfXLHf83FsUzn9pTp0PKmYZrLw+AGv/uJVk6+/hH/RBmoQ61iAjlZ0TRESgkeBRwD1H7OM+gCAp8u5T8TwaSP1SEuQB329nd0ex1BPG6pHMs7ZYvD3J6OnJdbvW2J9wFr9zeHjVI2PWWk9EOPtquqPFmxovfWwh58Jd8t/nGbpxPTmdj8SOcoUXW9MnCmFVT8ozobco3Hx+6vXYr//DYJ81Kk= +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +The Platform will make this request to the anchor every time a transaction is initiated by a client application without a `quote_id`. + +The Anchor must ensure that the sending and receiving customers specified in the request meet the KYC requirements necessary to partake in the transaction described in the request. + +The anchor must return the fee it will charge for the transaction. + +In the future, this endpoint may be used to provide estimated fees to client applications prior to initiating transactions. When this change is made, the request schema will be adapted to support the use case. + + + +
+ +

+ Query Parameters +

+
+
+
    + + + + + + + +
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
    + + + + fee + + + object + + + +
    + + +
    +
    +
    +
+
+
+ + + +
+
+
+
+
+ +
+ Unprocessable Entity. This status should be returned when the anchor + understood the request but cannot return a success response. An + example for when this response code would be appropriate is if the + sender and/or receiver is not permitted to initiate a transaction with + the specified amounts. In these cases, the Platform will respond to + the client application's request with a `400 Bad Request` and include + the error message provided by the anchor in the response body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
+ Error. The Platform will respond to the client application with the + same response code and body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/callbacks/get-rates.api.mdx b/ap_versioned_docs/version-2.11/api-reference/callbacks/get-rates.api.mdx new file mode 100644 index 0000000000..9ad8d94bb4 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/callbacks/get-rates.api.mdx @@ -0,0 +1,593 @@ +--- +id: get-rates +title: "Retrieve Rates" +description: "Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must" +sidebar_label: "Retrieve Rates" +hide_title: true +hide_table_of_contents: true +api: eJztW+tv3DYS/1cGOuBi32m1TtIWxQL54CZua+CuDWIb/eD1ebnSyGIjkQpJ7WbPcP/2wwypxz78qJO768Of1pJIDuf9myF9HWVoUyNrJ7WKJtGpEcqKlJ4suEI4kGqhywWCW2pQWo3wQyMXokTlQCv4K+g8H6WFkAqEtegs7NkmLUBYODt585rGnDgsS2FAqAxyKRwcnb3bh6qxbqoai4Af00KoKwQjHAaqwiCkuqoaJVPhMAOnwRUIaSmJsqjrkj5IrcDghwatk+qKR7iegwR+KlCFORYq8R6nKgy37YpvS+FybSrItaEXWxuK14dZVBltUtqWcruSUGlBa2jI0aUFSJdM1VS9Y65SoWCOcC5Vxhtf4MVe4VxtJ+PxcrlMpFqgdbrGTIok1dXYoansWI77CR8a7TARtt4HbabqPJemetAi+ZiG9tMTOO23S3qA2uiFzOgdHL9hReHHWhovYJkTe1MVZN8JUAAty0JiRg95Qc9qu2AmbaobRRr02rU1pjKX6Q5NWr+vTtJSpWWTsUUgzPz4S5nNoBZGVOjQTJVXGutCWK14H0fSFWhgZrEsL0VF5GegDczmzap7XsqyJIUEIhlINeDM9jRsDPPGgcIFGphrVyRwrHhLVlQIS7GKpwqHJDMs5QLN6rJCV+hsxvJk4ltfKrG6bRObZGOwUqUIntRUBfbI5wbc+UdJyuncjt6xYKbqrGaHSVEuWn8xaGutLHoz9zrsdcBiWohSZsKht3IWIPNUG5ki6HxtHaZ07N+FiWREuZDlpivx4n7eHQ7+rHe0pXQFCPj+9PQtWCdcY6cq1RnvYfblwQv4RmTwnXC4FKsZb4QMas0Q4jUziGHGTMxir6Qcccaxp2U5I1vIdVnqpZ3QgiNyhxnbPA/Gj5KUNVUAo/59EhTBzlWIBYKAWltJbkxrN37LVl4pcgah3GWGqaxEaWeQYS6VNwYWOC0FqVa5vGq8Syab5Jx2ogzk8EMjylactqmYUjcyQ0eaSIIAwkrexTf3D69eee8emFq8Jk745VWwgr9BL1b4O7BsPPe6zMCZBh9GqrfiGG4ltbdJa38HsU1NZRotKO28yh7Cx45Fg0X98oqdrNWUsF7q0q3YRsmNdaMy8jE0RhvmHTi8rX/YWGX2/OBfe6NdZrE/m6oojpy4stHkPOKkEl3E0ceRxZpfnRy9Hb18HsX+j6/po67RG8xxFk2iK3R+Whz10S2anF9HklL/hwbNKoojJSqMJpFb1RjFm/CAEuyqZuslybaeiVkCxznMKCHM4rV44GUYIlzQh2yDIj9xqkF7KdwsieLIpgVWIppc+y1MIuuMVFdRHKFqKuK0T4lRHBHJ6OImjmgr0mAWTUhXN/Futro0ssXboQKZoXIyl2haNLALcFTifR88mX1KXNJS6gxpvrEesug8RwOZpB9aJkdk4NG/CeCETeu1p3X8xnbpiYi0gbxu5qVM4T2u+PXgsSUnGlcQBwSZYCEFkCk8P0igTc0+QCjbGJwqBlobK4X03EefNvRWwqUFUl4ZjH6v9FIR4TmWmkQSgg56C/cII3iNHORUz55WJWe/Ac18KHPKYgOGsp0ckcC9A8GyQM7C2pCbT9VgMsMYn0fIRFi7DNJom705eYySwLctrrEgyqVYdTNhfc2EffI2g725zQb7cLrTwXxAvMX4WHIk4A3UKVUPW/NNOKCm6vyQVz0OFh5W+1abSrgeRF5JVzRzho7WW137O6qNdjrV5Xhe6vm4EtahGWOq7co6rMYW69HBwcuvkyr7C5MdyTVSo5xJ7d8jsoe6ccfdPRLsbDyIqRfflsCGeOoPKLFBttstM58IGZYMJHGvGd5heAn8RMMo57YxkQSbavVzk4ZlXLEGyB7pUf0K9/E2cItfbRY7+YGenany/Azx5iMZ4qLJrC4J3e5k6fz45Ed4+fyrr0bPQZR1IUYve6NElSzle+nrQG2uxvQ0Pj758dLPuAwz9qFFzySLxqJ5ZiFtDGcmkWUGLWWmNtbaQjcll4aYOl929SGds0Bb93Eo16pbOrQGwtO8WY1JRlALyQiIuwIECKSbKgr7CyFLMS+Rs9BSU0ivNLcESCwS7SPF6qHGpcgdmp1i9ab+jECZ5UwxG6AT4CKI9ulkhR1E4MLaR5ph+udkJq0vxrhS9hW4xwpellM1p9Lg/Oz0NZBCv/7q4PlGSW81a1BaPaKvI9rDSKhsRHsIMSIpXFXug+e+z41BXwZdYxTMvjg4oAJpqt75nD6jLQo1LPWZQa1I3iyjIQSgBMyVSypUcIFW25+SBzdq4p1a8Z+GsUgbNlfvuNREIlDlV9qIX3pQ1wbZezao9hZ57k0Zp2oghr647Thk7M4TrVdv13noXWCA5dvaba2M3azh7o4mg+C42Tf4hCj5ieIW1Ehr4aZvJOBaUM2Nrn7nEt/ZxLlP5BeUh33FY+n7i4MD+lkX7kmTphRSozhKtXKoHI0ZbHn8s6WB19uE9PxnTCm71YaqOic9GQKp94+S2a5yan1vx2/a8DyMVT/8eApnJ0dvCFwrmNESr3q8PEsIf/QRchcVH6GiScSBi4LWFumj3g7WYurDyLPZ3M8fR3etFmgsEWp7V1SGZTBfDdEAbYKSV6PkFmggM6Om6iZQitl4dNOWulRYULXnu4VGZJL2IUrIpRIqxXht1SUH6jnF2hyNCdWc73zOhW0RLdfMw+gWhvgWa9vqY8chsTelWO9yjGhL8JBWB+ydG8w/N8xluqOwNbu/z/obAtMHafEOpDqEc7ej0mNqpwWBD2rzNnKtN457RLNWEMeQYR3qXK2g0Etf3FPzkB26t6oQCYnXAU79tazeAVzbZvsQfT6Q1aEFfFZOc9wZl7ZaLv4L+Pfztq/iCWS0GU0NhrrrMhNA6TZKDQFmwzdxQThn5LxxmGyFQO6QPkzoPJQ9xWPawCSz5WvOh+muK0JpqbahkxbCXLGME/gnuRw7fW3QIp+SSAW/mcKTGA794gHLwhhBoEI6rOz9ucdjj4cIjEZ2OQgxZsfFj6KqS4TZ4evvuascw+wbI/4tSyk4d6f0l88d/usJmgWFN/+ILg18DMjdt5tDcPhxl1F6G3iUA4cIHmzJd0v7fjy3k1u7pt50U+1tt+v3Zy2mn6PvOFu/iu//JwT9Bu2Acy/8bscXceSkK2nL1Aj+FvENL/8uAJfoZnO+95rW7LfnD2auT/RJOd7oOgzC3wXNGK423MRNHH3x4sU2fjpTtdGEoLg2PFJOulVbT/Fx0EA8vurBzEOHQchsVIbGOh0QbtvgpNM2X9nQGTFXTAKsB2zDwy1/+GepDLJbh8OPPdFqazNoS7Op4nI4dM1pGX9cUBHzV4MQuI5cusgdeu9zna08cv1MeJN3sbMLtQtjblqFnz0woyN+4TX+5S7EzAM2zoUfJmQv2u6cthMJdzxIuCyb34FkGGE7VARb/XHNe1xFk/bkJ464Rtp5AkRVSajz+PiHT35cEU2iMRcO5J9m0Z4CNaaMJlGbX1JRlnORvk/mjZUKrR35sUmIyKG5n+oqIjJS5ZrYDPg6mkQvk4PkYGdQPFmptDBa6cbC60DGwuHb4+52wHox0B6AbB5O10aTKrpjudvX9UWi7U/4K5Fh6zu9YRWSWk4uxGLyfD7G6LyVcZPYYWxsoeSztMFnfbxob5lYHFwu6CrgnvLm+F0k/PlfMI+evRPWShRHpUyR4meXc6PDWqQFwgtWQ6/d0FkS/JWbS2GqHf/j+PXRDydHoxfJAfeU2E5rbV0l1GDhd0hNuAVCe564kV07l3q6T/R0n+jpPtHTfaKn+0RP94me7hP9Fu8TeVRK5e64LoVUBFgZKlwHqHjue8wXcVRo6+j5+ppakmemvLmh1/6QgQBkJrkwy6JJLkqLd8CCvXcB++7D/+JK0U4uPYoO15wCho4iOjt5OB9Pd4ae7gw96s7QHRY5vKH2SLPccK8/wYWiO+S5dtvqcwv0D3O/6A4BDu9aPVJ+v7ULRveaS9ux/Dz8/n8uHd2n0s/A49MtpHti+fo1rk+Q9NPFpMdfTLpDQRsXwj5BQU93lHZdmLkv0G5fR/rvqOBPfm/pnlRwlxYu6MFIUkM0Oad/tChQZGgGJxGHaYr1MJNsnaOsHUR8d3Qa3dz8B08O754= +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must use exchange rates that are communicated to the client application requesting the transaction. When clients make requests to the Platform for these exchange rates, the Platform sends this request to the anchor to fetch it. + +Rates can be [indicative](https://www.investopedia.com/terms/i/indicativequote.asp) or [firm](https://www.investopedia.com/terms/f/firmquote.asp). The anchor must provide an ID and expiration if the client requests a firm rate. + +Anchors can provide discounted rates specific client applications. The Platform includes the `client_id` parameter for this reason. + +Either `sell_amount` or `buy_amount` will be included in requests as parameters, but never both. In the same way, either `sell_delivery_method` and `buy_delivery_method` may be included in requests, but never both, since either `sell_asset` or `buy_asset` is a Stellar asset. + +Upon receiving the response, the Anchor Platform will validate the amount and price of the response. + +If the validation fails, the Platform will respond to the client application's request with a HTTP status code of `502 Bad Gateway`. + +The `sell_amount`, `buy_amount`, `price`, and `fee` are validated as follows: + +- if `rate.fee` exists, + - `rate.fee.asset` must have a positive value of `significant_decimals` defined in the asset configuration. + - `rate.fee.total` must equal to the sum of `rate.fee.details.amount`. + - if the `rate.fee.asset == rate.sell_asset`, `sell_amount ~= price * buy_amount + fee` must hold true. + - if the `rate.fee.asset == rate.buy_asset`, `sell_amount ~= price * (buy_amount + fee)` must hold true. +- if `rate.fee` does not exist, `sell_amount ~= price * buy_amount` must hold true. + +The `~=` is defined as equality within rounding error. The rounding error is defined as `10^(-significant_decimals)` + + + +
+ +

+ Query Parameters +

+
+
+
    + + + + + + + + + + +
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
    + + + + rate + + + object + + + +
    + + + + + + +
    + + + + fee + + + object + + + +
    +
    + An object describing the fees added on top + of the rate provided via the `price` + attribute. +
    + + + +
    + + + + details + + + object[] + + + +
    +
  • +
    + Array [ +
    +
  • + + + +
  • +
    + ] +
    +
  • +
    +
    +
    +
    +
    +
    +
    +
    +
    +
+
+
+ + + +
+
+
+
+
+ +
+ Unprocessable Entity. This status should be returned when the anchor + understood the request but cannot return a success response. In these + cases, the Platform will respond to the client application's request + with a `400 Bad Request` and include the error message provided by the + anchor in the response body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
+ Error. The Platform will respond to the client application with the + same response code and body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/callbacks/post-event.api.mdx b/ap_versioned_docs/version-2.11/api-reference/callbacks/post-event.api.mdx new file mode 100644 index 0000000000..0bb1897fd2 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/callbacks/post-event.api.mdx @@ -0,0 +1,2354 @@ +--- +id: post-event +title: "Receive an Event" +description: "Receive a JSON object representing an event." +sidebar_label: "Receive an Event" +hide_title: true +hide_table_of_contents: true +api: eJylWEtz2zgS/isoXHKhJEf2ZLK8ZVyeqmztTDwj72VtlwwRTREJCTBo0LJKpf++1QAokpL8kMcXi2j0A41+fI0Nd2KJPL3lV4+gHfL7hD+NEGq/Nru6Hn3iif8/vYg/zj/SJlODFU4Z/VXylNcGnRfAEy4BM6tqovGU/w0ZqEdggv179u1PZhbfIXPMQm0BQTull0xoBsQ7vtM84RZ+NoDuNyPXPN3wzGhHctMNF3VdqswrnXxHkr7hmBVQCfrl1jXwlAcFPOG1JROdAiSqkr096KzSS75N4sI+IeGgm4oc4KzQKDJSOc8sCAeSJ4NVdMI1OM8KoZcHRLDWWJ7wn41x0BOQNehMBXbe1NIv3e+77aYA1pMUHMTIzDG7FJotgBkNzOTMFcByU5ZmpfQyvdMj9nDE6gc2YmIgcSWQRSJzhTXNsvCyZlfXDLSsjdIOx4wMqcW6NEIyhUxpv6mv4oHlCko5PlA9dA1ZQKxhlSwf2lOQPWHrP9LqfU7K/A9WW5MBIsWZG/r0ZC2DWwwO9UsDVz4q0brx/DP7cv31WTWet1Pgw1FVgE5U9bGYzI2thOMpp5AZ0VZiiYJfz4DeqejTaPiW8/T2kI0SUFmQFP+KohWh5gn/obT/8NfHEy4q02g3h6cashDVEtAp7fNzLrKMyIHBOpBz4SjKnXIlabvprJldXU8v+DZ5tyVv0XD+kW/vtzET310uEMpyHg7+Ah0RjpMXzfolbk9+lhmeamUB6ZRvDw6rsiP1jSLNOFHOn6f7cDb2mKeGhWrmoCyF/So/IBMWYoFH5grhmJJU4vM1FZRRg2CRCS1Z6CJsBlpSXn7RWWEsJmzROKaNa+mhdfR2jO/0nf7dWCb8lo9T1hbSJKSUkjGfGBamKSWVSWzyXGXKl0/D8qYs151dxNXKaBNz0aDSgPiB/SayH6DlntoDy6PyGPIP/ogPFVQmGoM9axqEfXmf3i/mTXF7rLV4T8XmsTu/haVCB7bXEIKbxxQRbUa/Kv9KuQJsKIIhOFjkZcayP5onkLsFIaUFxNYUo0dZIZRmdD1u7fWSB952KNrJHkXZwO6CPbzoTrhSrmCCYSFsZ0TCVgVYCM1pQKFqvbuPMd9uu+qyC3ufTL3280zliO3hhOztKfvLF61thxveWcB6Ii9bSdstLR9UWs/ZdZd+a+rV2AD5WhFYG41B/fTsjP4d3lHAMQoZNhn15ZCPsUmT57VkFoRcU7LaiB01PLkIEX0zbVWxhZFrEgZVHaPl4lXFSj+KUkmKRQvffe86JpVwp1AafVgEKFEBolhCCAR4cqBRGY2+if6ANU9b5JxwH4UvIujtPYW2K0wLn723XcFTPoGIpBHsI9igoLElT3nhXI3pZJKJslyI7Me4LVajsHcMT6KqSxC+oowzU3FSRGj57w5XX4VNbZx0cRjj5RnU24ETPj2bXozOPo+mn24+fk7PL9LpdPzLv379Hx8CkiHkGOqiXp5y7xPf0FMuoTaoXNfaU650ZshUB0cQB40EsZt2YmMD7aVeZFP6RAbTuBM5coC3cgQsueeRDsc85+HP5OE4NLy6r3Xd6zv9ReVg5zHjXueIudA330LeaImdB+Zh5eSbOsGNtVhXfmylFBl6U8n5rvz5Wr2LoLcKP8GOOLS+wXGtT17Z6MFqNHzey6NjJw0dcvjdnt3BEyVUv/28ZB3oRyjNsDm94ONIapXFTwpl09gMdlPAsG0fDAl9155wQ1tfRN+tiiq41aKc77fvt3uWKUlza7G71/k+R2/5GcasJGw6l6YSVKI61kjQooLD0nGsnvZmk/3loeeGk8je6v7W/tzxUujEWaLXTPojRu9Y3WQxPMCRKxp68wjS2hP7eloNMVRfhAcxSucebFLbDdjhfHw2PjsKN2drnRXWaNMgu4z9GGniZ1hDpvL4VMVyMwTDAe2z61I4wn0EfgiG+KngZbkScmr2LFYbZJWQwBZhjNnJWxWqBKY82Om9foiWjeXWVISKfXyx3quax0F3OoCHD7hDREhgzBWA0KkWeU4PeQPN+/uPqfBDyw6F7o438/CFJ7xUGWj08R0j/0stsgLY1F9DB4PSyWS1Wo2Fp46NXU4iK07+8/Xy6s/Z1Wg6PhsXrio9YCOMVQndE7x7mtTs6Ntl7/Hx9GfMXrJP6pJSexut30Scd8sDzrtPeEH4L73lm81CIPzXltstLf9swK55entPgNIqsSCn3VJnKEBICuEd8rwMlo5uAm6P+PPwyXQAO6+/zW4o7eNTa2Uk8VixosIlVjzlnB56Y9/ZhLUNL4VeNqH5B5n0939tl6DO +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Receive a JSON object representing an event. + + + + + +
+ +

+ 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. +
    + +
    + + + + 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` 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. +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + + 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` 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. +
+
+
+ +
+ The event is invalid or rejected. The response body contains the error + message. +
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/callbacks/put-customer.api.mdx b/ap_versioned_docs/version-2.11/api-reference/callbacks/put-customer.api.mdx new file mode 100644 index 0000000000..7143f1fb83 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/callbacks/put-customer.api.mdx @@ -0,0 +1,1119 @@ +--- +id: put-customer +title: "Create or Update Customer Info" +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: eJztWm1v4zYS/isE70O7C1v2ukFx8LdcugWCXougSXAo4kCmqFHErkSyJJXECPLfiyEl68WSkwP2gFvAXxKZM5o3zgwfkXyhjj1Yur6jF5V1qgRj6f2MPs8taD98/flq/iOd+f+fVvXD6qx++OETcqdguRHaCSXpmn78eJMDOZc8V4ZcFcxlypQkVWCJVI5oMFZYR5jcEV7rJL/8cUFS5lj08eNGbiQKMPBXBZ4vJQasVtICyZQhLheWgEy1EtIRZoCIFKQTnBXEKeJy2Mi77dXtDVk08rf33+fOabteLB6Ey6sk4qpcWAdFwUzzf66NcoqrYpEUKlmUzDowC+DK7qyDcmFBz5fLT6uoTP/RCJ7ryn3YyFFbU8iEhJQISULwInTtohCAZmtdCM4wZJaU7MveX0uehMvRC5KpolBPQj7sY5GodDcjT7ngOREWo/HETApp7TdhPuhRHXy7kWVlHXlkhUiZA29eE35kx4gTzayFdFbb7iojPa3x8DtLtiLdRuT3xj6upGNCol1KFjtincHnTECRovVFsZEJTBlHWMfDbScMiz+tklsvHQPkdhpGlW5kIiQzu65C8l59ZVU4oZlxC0zKOQZgoHIj6YwqDcYbdZnSNdWVa4qDzmg9F/9S6Y6uX2j9Mj4OncExy3MoGT6hdLqmKvkTuKMzqg1qcQIsUkWKf/uFhFVw+RNRWW9C0KEwTyG3nK+VOudURhjRBh6FqizBGqjNjeissSDMF32dUca5qoLth5qvQ1UQZciv1TOk5DxwE1a5PNSbg7SN7b7SHwULCb8cVVpCqcY1IgWTtWoqOtthYrHWda+MEZszAympzceCAAPeiD4Fa2RbP28njYnD6JhFSMGYessqG3Krse1Nww41zijIqsS2KlI6ozmzOfLAs6P3rw3zMUMYx8F+PghLEsBA/fLHRYplEG3kNYR43N3gi9cauMjq1PzarRBNm9uuhg8kVbwqQbpu9/O9u1TYrmWmoo38WRkS1hCyUxXhTNYtE38aop6kd9s2SY59KnSCTDxUoT47YlZnmPjzpuuGPNpa0Kuz+X4dwGDhPIYyP0gHZ5i0IcbxVEV2eIio8z905EHbRDdRH7NWcYHFEpH/5CA9wZTefpIZVfanMwUNMrUkTPNGdvV9D9FDNGuj2EgR1te5wOTDMBfMPGCnKDEN7YdxZzNhrIslK6HTnlpywY5RWZoKVM2KozwGrI19MZhdzFU6zmgdcxArE2ujHoXk41xcuN0oQSvrWDEtvrZjlFaqRBQQy6pMwIxyQMlEER+TkQjj8hhX2EPyjIZZomvqGfbsumATfgb6m0FLmPwyHXtPrfvQMe96fE3/mdD1hhSdK3k0kp4rMbguHw34swODieUzPwMTN0vGYUoULDmqkidVzArBjk5+qSTsjknp8fkcTaf0mZ126mi21Czjy+BPoA3w0CtuLZDteDC2REjrgKWji5pjz3X3miBNp43ivNIsGDNaC7pQOzDTAvYcx0JQMPlQsQeYTm6RTiejSN8uDpHGwtoK3l+VIo3hWYuwrPxXrx1JHKGPxsHC8+i4gQyMYcXULPaaVvwIZr/0vt3B3mLHJBGuwKGrFvfWONyTRzD0CemekO4J6X5LSPcE/k7g7wT+TuDvBP7+Z+BP58opDHhmVIAekwLDjmbvpYTxL+98RyrHzC5mGrOTFbHK4kbMOyW8gVODNG2UymIDFmHBWPsaFT2FcbsyVRYLydVYVo0HqXmrEI8gR60efe//D1f/2mDpFmC/ekMDyvWOrZbLw15xXXEO1mIL+Ko70O/8Ggjm1daejRl4Kf2xQzjV+XpWgjFq4ltrwv5mYwyxaHj7vnXqsx9o3Dg7dOM35cjPqpLpt+BDvX5Ki6dKdH33Qr/Ajq6b07wZ9VDxfad6r/f4zeByVZ+AoBfM5XRN96dqFKvbPOKRIeqqTEHXtIHcnBUF9rAoqazAGp0H3gieWakLqI+quCopqsIY/t6erHwOTE1etlW9/5Brh8Ji2v9dLyDh42PYGYa7vJ2e0UHF7WgHDHcMGWLgHmkE+rb0EcTbEgPQbX/38O2Bjp7ffTTb+RLrg9iW0MWudLVcnc2X/5yvfqQDmDp8YcqvDigdDA6x6AR5OFE95DkY7gPOAXGAMzuhmICXnfj3UGVnvAWTByHvY8gJcgsdO0IHiPGAMrSuQXfDkYOwd7FcNxN6EG6EMGLKALC1hD1O6w1NZccAlfXzbQyAHXAcBriLWzr1hZCj/dlb9SfKZbB6T9TOBBc2bpl5QI/NMNB+iJbRkg7vRvjtpp3kuVES960u6i5pyfnVJentLdR3HdrtqeGNCm0ULi9Rc2FiWm7YKbDtFYOSpUCSXX836ykXBRDh95K0UQgvwqZUc/vAn1Uxwg9uMETkBk+qQkv/zu436Wx9FG87txtYlgF3fc1D/jEVYRujXvJa9679ooJZKjggJFm/0Dq5zzXjOZCVn4Z2cVovFk9PTxHz1EiZh0X9ql38+/Li82/Xn+eraBnlriz82osNuGSyI/jCAN6mUIbcan+vosFF5BLTYDDnnSsCp6sxp6sx3/rVmLrj407uQhdMSGx/vrpeaoB4R/cA8X5Gc2Udjr28JMzCrSleX3H4rwrMjq7v7hGUGsESrOs73BrOgflVco9eL4INc9zgbTHs6DHE66x56Zxz0K7DfgDYewD36vYGsUN9p6cMSxfK9WJn7SPa+Pr6N5WB57o= +sidebar_class_name: "put api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +**The Anchor Platform does not persist any customer KYC data.** + +The request and response for this endpoint are identical to the [`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) request and response defined in SEP-12. + +Client applications make requests with the following request body, which is forwarded to the anchor. Anchors must validate and persist the data passed, and return the customer's `id`. Requests containing only string fields will be forwarded to the anchor as with the `application/json` content type. Requests containing binary fields will be forwarded to the anchor as with the `multipart/form-data` content type. + + + + + +
+ +

+ Body +

+
+
+
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

+ Body +

+
+
+
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Invalid data.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Not Found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/callbacks/versions.json b/ap_versioned_docs/version-2.11/api-reference/callbacks/versions.json new file mode 100644 index 0000000000..96c990ca3e --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/callbacks/versions.json @@ -0,0 +1,12 @@ +[ + { + "version": "3.0.0", + "label": "v3.0.0", + "baseUrl": "/platforms/anchor-platform/next/api-reference/callbacks" + }, + { + "version": "2.11.0", + "label": "v2.11.0", + "baseUrl": "/platforms/anchor-platform/api-reference/callbacks" + } +] diff --git a/ap_versioned_docs/version-2.11/api-reference/custody/README.mdx b/ap_versioned_docs/version-2.11/api-reference/custody/README.mdx new file mode 100644 index 0000000000..9632f1a96f --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/custody/README.mdx @@ -0,0 +1,19 @@ +--- +title: Custody Server +sidebar_position: 30 +--- + +import { MethodTable } from "@site/src/components/MethodTable"; + +The Custody Server provides a set of endpoints to interact with custody services, such as Fireblocks. + + + +| | | +| -------------------------------------------------------------- | --- | +| [Custody Transaction](./create-custody-transaction.api.mdx) | | +| [Payment](./send-payment.api.mdx) | | +| [Refund](./send-refund.api.mdx) | | +| [Unique address generation](./generate-unique-address.api.mdx) | | + + diff --git a/ap_versioned_docs/version-2.11/api-reference/custody/create-custody-transaction.api.mdx b/ap_versioned_docs/version-2.11/api-reference/custody/create-custody-transaction.api.mdx new file mode 100644 index 0000000000..9b03be5755 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/custody/create-custody-transaction.api.mdx @@ -0,0 +1,275 @@ +--- +id: create-custody-transaction +title: "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: eJytV0tz2zYQ/is7uPRCS67T9sCb4zhTTx/R1O7J8WEFrkTEIMAAS8kcjf57ZgFKlGXFk6TVQaKX+358u96oiqIOpmXjnSrVVRfZVz3cUlhRAB0ImSLogcwBXUQtzBBI+1CBcfDu7UQVyrcUUN7cVKpUWXJQdzeKqUIxLqMq7/e2Dt5G9VCop7NIbeK4vZ6d/aaK9Hvxy/Dw5mdhCvS5o8hvfdWrcqO0d0yO5RHb1hqdPJl+ihLVRkVdU4PyxH1LqlR+/ok0q0K1QfxmQ1Hemkq+n6fk9nr2LO6bdxLtoCdyMG6ptoVqqPEvhf+ixsMKbUcFcI0MJkIXqQL2YCpybBY9GDf3navAB/Ad5+cW+4Ycx6/aukvEY3tCBb8A4fjfLBaKXNdIQUylClVjrIWHnlg9bFMK2WtvX3ozG96IR0dpfM2KlDyVW0q9LdQi+OZSa9/lAh+Vx3dBE9wyWYsBMPOdTBv7r2p5R5GNS03zTaqwOa3nMtElXq4JMEbisQyRHE8DaTIrql5R+55OVPY90TelUbSI2RO+fa83j8admIc/jDRODvA7ilpR66ORkVsbrquAa7RK5jg5oB626SOE2HoX8zxenJ+fqHinNcXUpz849tnSr6eU3zim4NDuEPA6BB9+3FIGKhOokhxQUvZwjDqZPMruKiAta9jSiMvZmyFT9MTkYkLN8n6jHqlX5Q48C5VA51UQ3T4IknDtBa9bHxMcIteqVFM+xORCxZSMbKcLVpWqZm5jOZ0Om+Esc0zoCZvWEjpd+zDRvlFiRbL0zwjY15lpB7hjr2QMff53xrmMPCPSJIx4hguj1MGYj8TdwB5T0qwdEPPojIQ8A/vu3RbKuEUCeklI7pk3k/PJuXpRrKGFVHGM0TXtF2oc9qx3jjRHAWmSDmyDiQRrtJYY2uBXpqIQC4idrgEjvDeB5tbrx1iITCRXAboKhnHagzksfDic0AjGGTbIVMHKYBriy1QsmFnkhQ/NBO7qBA9hZTQJUqADtGksWHSzz7M/wOSH+RCEmJp30TiKkSKsay+LB7yjHVzErm19ENv7kCZw4wCryiToHVQvOpe8RWu4B79YUKAK5v1Ju0WiHh8uyefoYYHaWMPI9HLTiTltDTn+KR6jvji2gN53WY0EImZolQSH5BTPVPW+G8VhbawFDma5pAAIv9/dzUCjtXPUj9BgRXuRXc6GZph8dB/d3nYgrHqocUVSBuOYlvnKAoHRrOCoTVJCHLBUUfum9Y5cQnznGXZwVEhJa98t65NOZPcd5bvB+XQ1nGgWWIsp3OVBNp7Xub2Sf+heSBzeUmvMe0iM+AAy0Nmd42rsm3Wv5nJ2kzJ11YVAjm12zzvbn2gziX4cmclHOUOt0eRiQiGHjcztZYu6JrhIwzzCXDmdrtfrCaa3Ex+W00E0Tv+8ubr++/b67GJyPqm5sQmzBUobdAeKr9IxDCcO3mNwOLhk/8stPiwSOdGmrUXjBLhSRJsB4u8VH53dtWyA8l5tNnOM9G+w262QP3cUelXeP8hKCQbnAnH3cpbVhBWFg91zlV0/S5C930Av9+W22Elcak0tv8p7uKRmH27vVKHmw9Hf+EpkAq5lz+JalSr9H5JDKjeZtlEW3bLDpfBmnfL5AvWzi8k= +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server creates custody transaction record in DB. + + + + + +
+ +

+ Body +

+
+
+
    + + + + + + + + + + +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    +
    + object +
    +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/custody/generate-unique-address.api.mdx b/ap_versioned_docs/version-2.11/api-reference/custody/generate-unique-address.api.mdx new file mode 100644 index 0000000000..1119bd8a6e --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/custody/generate-unique-address.api.mdx @@ -0,0 +1,209 @@ +--- +id: generate-unique-address +title: "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: eJylVsFS20gQ/ZWuuexFyCyQUKWbAyahlmQJJlC7G6oYj1rWhNG0MtOycVH+91SPZEOA3cPmJJXc3e9Nv9c9flAlRhNsy5a8KtRRF5nKFUwxLDCA0c5F4BrBkK/svAtYghliIoaFNQhMMEePQTNCiS1Fy6DLMmCMoH0JDTaUf/Vf/QmFRjNQBbc6RuRbaHXQDTIG2IHbyOicDsWX6fFR8f7du+ODw9OTt2fXfxyeH348nlxNj64vDo/Pv1xf7X/6a//48vPk6uTs4NP48mD8+cP+32dnJ2fjN7dfvcoUtULHkj8tVaE27L54+73DcU9NZYr1PKrin+2h+99hE3CTqfudiG2KmU7Od96qLD33DoaX/d8lKOD3DiO/o3KligdlyDN6llfdts6aRGT0LUqDH1Q0NTZa3njVoioUzb6hYbVer9dSK7bkI0YJ2NvdlcfPCk07YzDGXGX/FylTbZAGse1hBq1eQh0/E5MJlrU1dW8IZ9EzxJo6V0JEX0LV+TIRG/AiB+vnap0pscDL+h+xIVho12EGXOttsRkKJJYC2OpVIziz1RPUf8W4TB+f48hXcZ1E/DJSptB3jVjClipTtY61xOA9qxtRkC07CX//mukuBnkHtd+8JvCpZwxeu80MTkKg8Etyi0FtwFJIo1QT1/7sgf7zY+6mrU8ONExJopP4rzOF94w+WvIyIw/qDleq2AxNppK0/zk86xvRjWuSMW0pJnNqrlWhRmlFxFGRnqPBgyh1Y2pMD9kFpwpVM7exGI2G1bTTR+R4r5vWofamppAbapQASsMuHmd20gep4mGdKeurZFSp38uxn+/mu+pFGwZ1VPbca2KdJwtSlih5j4bT/KCI2wYbEZbaOWRoAy1siSFmEDtTg45wYgPOHJm7mElOmi1ZpAEN2gVunBqhogActI/aCHwE6y1bzVjCwupk43E6O5w7zRWFJofL2sbt6rayoUG75DiW2kwpbdrvYvhzNhxCoGZdtD6JAMuaoIsI5NNkSUrs2paCYG+PlMOplwGzwm5Tuup8Yqud5RVQVaFcKsPUPcfN0tcXt5JwjgSVNtZZlouHOp5R58vH5jANM/xb3JbVxlDnWYhVsKKuLyMHERhcpMShOdlPpVbUPabD0joHHOx8jgE0fLi8PE935UybO2h0iduUTc8GM6R7cIsdUJcrqPUCRQbrGef9tQVLy3Vf4JlNUkM8sKhoqGnJy86yETwxbAY9E0lr6ub1qyR6+h77veeJbbV6zSywFCi93Yw6RjK9vRI/7V9kPHEjLLUAehYQClAFano6z9XYmnVbZnx+mjp11IWAnl1Pj7xbvWIzOf3jyOTpD4CzBmXPFg/K60bmdtxqUyPspWF+3BrFaLRcLnOdfs0pzEdDahydnR5NPk0nO3v5bl5z42Tp/QApKz98 +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server calls the configured custody service to generate deposit address and memo. + +Format of `asset` parameter - `stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5` + + + + + +
+ +

+ Body +

+
+
+
    +
    object
    +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + + + +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/custody/send-payment.api.mdx b/ap_versioned_docs/version-2.11/api-reference/custody/send-payment.api.mdx new file mode 100644 index 0000000000..35c005a45e --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/custody/send-payment.api.mdx @@ -0,0 +1,369 @@ +--- +id: 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: eJzNVk1v4zYQ/SsDXnpRZDdJC1S3NHVRA0UbxD4s0OyBpkYWNxSpckZ2BMP/vRhKtpPY3QXaS04SSM7HezN8w50qkUy0LdvgVaHuO+JQ9rDAuMEIRjtHwDWCCb6y6y5iCWY8Qxg31iBwAEJfQqv7Bj3nKlOhxajF5bxUhZLdh2FTZYr1mlTxlxpXSH3O1MsVYZtWF7OHqx9Vlr7Xt+PPzfdyKOLfHRL/HMpeFTtlgmfxWOyUbltnTQo4+UICZKfI1Nho+eO+RVWosPqChtV+v9+LL2qDJyQ5cD2dyuctE4vOGCQSNP8xUqbaKESwHcLY8tUZ4mj9WmXvos5eGKPXDpafYP4LVDE07/nOlQBgy078LE7cPo6YRoi3l1DN/UY7W8LjwOX/Qif1sBFLKRvGGKIU6S3kYfkM9WsAY8fN0slD5rfnmR86cxm1J21kFSyBDwxV6Hz5QaFc//TvUBbjBYqaEZxtLAsifDGIJX5QQD9c7qqxa0fZSAYfNf+bbxfEEnReb7R1euXwIwLZZwpfGD3Z4EU3d+oZe1UchDRTG+06/Kqg7j9nqkGug0h0GygJluZaFWrCp0tGk8KWk/Yg1pmiVOMhaBedKlTN3FIxmYxCdTWcyPFFN61D7U0dYm5CoySkUPZ4UvLZcEgVu32mrK+CECH+h8rc5NN8qs6IGBvtTD6XMqleyaWMsOA9GiYZUyh92kZLCFvtHDK0MWxsiZEyoM7UoAl+tRFXLphnyo6jTfsSIhq0GzyMOYIqRHhNFFhv2WrGEjZWp6l5l7DDg9NchdjksKwtHQenJdAetEuXh8U3h2S2YHROR/hzNYKQUKuOrEciJNjWATpCCB4hVMmEurYNUWIfIeUw96DL0iatHF1XnU/Zame5h1BVKCN91V+Mm6XVszeB5EwBKm2ssyziFTpeiQifyOEAxln0/B0d3WpjQudZEqugD93gRoBIGNwkw5Gc7I2rPnQnc9ha54CjXa8xgobflsuH9FJZafMMjS7xaHLgbGyG/Mk/+WPsiLrsodYblDJYz7geHi2wtVwPDt61SSLEA0sVTWja4NHzYQwdrnomJa1Dt64vJjGk7xFLSdMHtlV/qVlgK6H0gQfQRMEM7ZXy0/7M4lU3wlZLQM8SJMThJZHSeV+NY7Me3dw9zBNT912M6NkN6QXv+gttJuhPVyZ/8ipTzhqUh0ixU143cm/vWm1qhOt0mU+qUUwm2+0212k3D3E9GU1p8vv8fvbHYnZ1nU/zmhsnsvcPSXzImw== +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server calls the configured custody service to send payment. + + + + + +
+ +

+ Body +

+
+
+
    +
    object
    +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Invalid Request.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Transaction is not found.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service rate limit is exceeded.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service is unavailable.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/custody/send-refund.api.mdx b/ap_versioned_docs/version-2.11/api-reference/custody/send-refund.api.mdx new file mode 100644 index 0000000000..8e8e80f876 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/custody/send-refund.api.mdx @@ -0,0 +1,411 @@ +--- +id: send-refund +title: "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: eJzNVktv4zYQ/isDXnpR5DRJC1S3bNZBDfQRxD4UaPZAUyOLG4pUOSM7QrD/fTGU/Ijtbg/bQ3yxMCRn5pvXN6+qRDLRtmyDV4W664hD2cMc4xojGO0cgQm+sqsuYgmH59YgcABCX0LEqvNlvjvnqD1pI1ohogmxBEugHQUwETVjCdbDxw+5ylRoMWq5OStVoUTdY9KmMsV6Rar4Ww0CUp8y9XJB2CbhfPpw8bPK0v/Vzfhx/aNcivhPh8QfQtmr4lWZ4Bk9y6duW2dNMjf5TIL5VZGpsdHyxX2LqlBh+RkNq0y1UZxjiySnDTZB/t+G7HdsAqy16zADrjXDxjoHSwRdllhKhLjGMUDQ6r5BzwJ7tEUcrV+pL1lSv0jCYxMihVCB3PhOI7oJ3RCJtyZuk/xI+aAPy29ouscz/t5jcnfv0hkF6SeZojZ4GgJ8dXl5qmzeGYNEouJ/yqMtD+6M/mRHVqcvjNFrB4u/YPYRqhgaMGNx01D8uRIAbNmJnjn68mEI/OOISQ0Qb86hmvm1draEx6FSvwudVLuNWEpTYIwhSgu8hTyIT1AfAhhbd5pubj2/OfV82+KLgxa3BD4wVGHM9TuEcvXLv0PZTrOoGcHZxrIgwheDOFb/+wP00/mqGqt2nN/pwXv1//q/E2IJOq/X2jq9dPgegXzJFL4werLBCyu9qmfsVbGlqUwlZvgmXX35JLOf6yD01wZKA0tzrQo1OeBRmhS2nMSRCTNFKcWDzS46VaiauaViMhnn1MVwI8cX3bQOtTd1iLkJjRKLErHHPU1Oh0t7mtsPxj0v7WVbGjmWJDo4IAnrq0SZ4umQ4uv8Mr9UJxEdK/ZkDi9qfDN3ZSkJ3qNhEtZDKfg2WkLYaOeQoY1hbUuMlAF1pgZNcG8jLl0wz5TtFhadlhaDdo1bviSoQjzcXAist2zTtrK2OvHZbYoiPDjNVYhNDova0pYR0o7jQbvUhSy6R2aeMzqnI/y5HEGIqWVH1iMREmzqAB0hBL9jTuraNkSxvYOUw8wL49s0dEfVVeeTt9pZ7iFUFcqituzP2s2S9GTL88NqVmljnWWZgqHjZThYJlK0jbPo+QfaqdXGSNbFsQr60A1qBIiYwXV6OAYne6OqD93++bBwcLSrFUbQ8Oti8ZB2z6U2z9DoEndPtjEbiyF/8k9+ZzuiLnuo9RolDdYzrobNEjaW60HBUZmkgHhgyaIJTRs8et7y2XZmZJLSOnSr+qwTg/seh0XMB7ZVf65YYCOm9DYOoImCGcor+af9yYvDPXqjxaBnMRLisJIkd46zsSvWnZrbh1mK1F0XI3p2g3vBu/5MmQn6fcvkT15lylmDstEUr8rrRvr2ttWmRrhKzbyfP8Vkstlscp1O8xBXk/EpTX6b3U3/mE8vrvLLvObGyfz8CoE2aek= +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server calls configured Custody Service to send refund. Custody transaction record is also created in DB. + + + + + +
+ +

+ Body +

+
+
+
    + + + + +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Invalid Request.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Transaction is not found.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service rate limit is exceeded.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service is unavailable.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/custody/versions.json b/ap_versioned_docs/version-2.11/api-reference/custody/versions.json new file mode 100644 index 0000000000..dcf08d52c8 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/custody/versions.json @@ -0,0 +1,12 @@ +[ + { + "version": "3.0.0", + "label": "v3.0.0", + "baseUrl": "/platforms/anchor-platform/next/api-reference/custody" + }, + { + "version": "2.11.0", + "label": "v2.11.0", + "baseUrl": "/platforms/anchor-platform/api-reference/custody" + } +] diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/README.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/README.mdx new file mode 100644 index 0000000000..33ec426998 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/README.mdx @@ -0,0 +1,17 @@ +--- +title: Platform Server +sidebar_position: 10 +--- + +import { MethodTable } from "@site/src/components/MethodTable"; + +Data on the Anchor Platform is available through two different APIs: A REST API and a JSON-RPC API. Each of these APIs has associated documentation here. + + + +| | | +| ------------------------------------- | --- | +| [REST API](./transactions/README.mdx) | | +| [JSON-RPC API](./rpc/README.mdx) | | + + diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/README.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/README.mdx new file mode 100644 index 0000000000..60798cab01 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/README.mdx @@ -0,0 +1,10 @@ +--- +title: JSON-RPC API +sidebar_position: 20 +--- + +import DocCardList from "@theme/DocCardList"; + +Interact with your Anchor Platform instance through the use of lightweight, easy-to-use RPC requests. + + diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/anchor-platform.openrpc.json b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/anchor-platform.openrpc.json new file mode 100644 index 0000000000..e42bf84314 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/anchor-platform.openrpc.json @@ -0,0 +1,8955 @@ +{ + "openrpc": "1.2.6", + "info": { + "title": "Anchor Platform", + "description": "The Anchor Platform is a set of tools and APIs that enable developers and businesses to build their own on and off-ramp services for the Stellar network. It provides a standardized interface, including the implementation of several Stellar Ecosystem Proposals (SEPs), to make it easy for businesses to integrate with Stellar-based wallets and exchanges.", + "termsOfService": "https://stellar.org/terms-of-service", + "contact": { + "name": "Stellar Development Foundation", + "url": "https://stellar.org/connect", + "email": "hello@stellar.org" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "2.11.0" + }, + "servers": [ + { + "name": "Platform API", + "url": "https://platform-server.exampleanchor.com", + "summary": "Example URL endpoint for the Platform Server.", + "description": "Example URL endpoint for the Platform Server. Note: This is an example URL only, you must configure your own Platform Server." + } + ], + "methods": [ + { + "name": "do_stellar_payment", + "summary": "Submits a Stellar payment", + "description": "Submits a payment to a stellar network by a custody service.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "do_stellar_paymentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "do_stellar_paymentExample", + "description": "Example request to the `do_stellar_payment` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Do Stellar payment" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "do_stellar_refund", + "summary": "Submits a Stellar refund", + "description": "Submits a refund payment to a stellar network by a custody service", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "refund", + "description": "An object describing refund associated with this transaction.", + "required": false, + "schema": { + "type": "object", + "required": ["amount", "amount_fee"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount to be refunded", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount of assets to refund", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of refund", + "type": "string" + } + } + }, + "amount_fee": { + "title": "amount_fee", + "description": "Amount of fee", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "The amount of fee", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of fee charged by anchor", + "type": "string" + } + } + } + } + } + } + ], + "result": { + "name": "do_stellar_refundResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "do_stellar_refundExample", + "description": "Example request to the `do_stellar_refund` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Do Stellar refund" + }, + { + "name": "refund", + "value": { + "amount": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_amounts_updated", + "summary": "Update transaction amounts", + "description": "Update amount_out and amount_fee values", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + } + ], + "result": { + "name": "notify_amounts_updatedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_amounts_updatedExample", + "description": "Example request to the `notify_amounts_updated` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Amounts updated" + }, + { + "name": "amount_out", + "value": { + "amount": 1 + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_customer_info_updated", + "summary": "Customer info updated", + "description": "The customer's status for the transaction has been updated. Use this method to notify the wallet of the status change. If `customer_id` and `customer_type` are provided, the transaction status will reflect the customer's status. If not, the transaction status will default to the standard pending status for the SEP.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "customer_id", + "description": "The SEP-12 ID of the customer", + "required": "false", + "schema": { + "type": "string" + } + }, + { + "name": "customer_type", + "description": "The SEP-12 type of the customer", + "required": "false", + "schema": { + "type": "string" + } + } + ], + "result": { + "name": "notify_customer_info_updatedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_customer_info_updatedExample", + "description": "Example request to the `notify_customer_info_updated` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Customer info updated" + }, + { + "name": "customer_id", + "value": "45f8884d-d6e1-477f-a680-503179263359" + }, + { + "name": "customer_type", + "value": "sep31-receiver" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_interactive_flow_completed", + "summary": "Interactive flow completed", + "description": "Platform has collected the transaction amounts and fees from the business", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + }, + { + "name": "amount_expected", + "description": "The amount expected in the payment", + "required": false, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "notify_interactive_flow_completedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_interactive_flow_completedExample", + "description": "Example request to the `notify_interactive_flow_completed` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Interactive flow completed successfully." + }, + { + "name": "amount_in", + "value": { + "amount": 1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_available", + "summary": "Offchain funds are available", + "description": "Funds are ready for the user / recipient to pick up.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "notify_offchain_funds_availableResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_availableExample", + "description": "Example request to the `notify_offchain_funds_available` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Offchain funds available" + }, + { + "name": "stellar_transaction_id", + "value": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_pending", + "summary": "Offchain funds pending", + "description": "Payment has been submitted to external network, but is not yet confirmed", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "notify_offchain_funds_pendingResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_pendingExample", + "description": "Example request to the `notify_offchain_funds_pending` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Offchain funds pending" + }, + { + "name": "external_transaction_id", + "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_received", + "summary": "Offchain funds received", + "description": "Payment is being processed internally by anchor", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "funds_received_at", + "description": "The date and time of receiving funds.", + "required": false, + "schema": { + "title": "datetime", + "description": "A date and time.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + } + ], + "result": { + "name": "notify_offchain_funds_receivedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_receivedExample", + "description": "Example request to the `notify_offchain_funds_received` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Funds received successfully" + }, + { + "name": "funds_received_at", + "value": "2023-07-04T12:34:56Z" + }, + { + "name": "external_transaction_id", + "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + }, + { + "name": "amount_in", + "value": { + "amount": 1 + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9 + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1 + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_sent", + "summary": "Offchain funds sent", + "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" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "funds_sent_at", + "description": "The date and time of sending funds.", + "required": false, + "schema": { + "title": "datetime", + "description": "A date and time.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "notify_offchain_funds_sentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_sentExample", + "description": "Example request to the `notify_offchain_funds_sent` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Offchain funds sent" + }, + { + "name": "funds_sent_at", + "value": "2023-07-04T12:34:38Z" + }, + { + "name": "external_transaction_id", + "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_onchain_funds_received", + "summary": "Onchain funds received", + "description": "Notify that the payment is being processed internally by anchor for SEP-6 or SEP-24. For SEP-31, notify that the payment is being processed by the Receiving Anchor. In the request, amount parameters are optional, but have a strict rule of how to set them. Either none, only `amount_in`, or all of fields (`amount_in`, `amount_out`, `amount_fee`) must be specified. ", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "stellar_transaction_id", + "summary": "Transaction ID on Stellar", + "description": "The unique transaction identifier for this transfer on the Stellar network.", + "required": true, + "schema": { + "title": "hash", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + } + ], + "result": { + "name": "notify_onchain_funds_receivedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_onchain_funds_receivedExample", + "description": "Example request to the `notify_onchain_funds_received` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Onchain funds received" + }, + { + "name": "stellar_transaction_id", + "value": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e" + }, + { + "name": "amount_in", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_onchain_funds_sent", + "summary": "Onchain funds sent", + "description": "Transaction flow is fully completed for SEP-6 or SEP-24 deposit", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "stellar_transaction_id", + "summary": "Transaction ID on Stellar", + "description": "The unique transaction identifier for this transfer on the Stellar network.", + "required": true, + "schema": { + "title": "hash", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + } + ], + "result": { + "name": "notify_onchain_funds_sentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_onchain_funds_sentExample", + "description": "Example request to the `notify_onchain_funds_sent` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Onchain funds sent" + }, + { + "name": "stellar_transaction_id", + "value": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_refund_pending", + "summary": "Refund pending", + "description": "Refund has been submitted, but is not yet confirmed", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "refund", + "schema": { + "type": "object", + "required": ["amount", "amount_fee", "id"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount to be refunded", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount of assets to refund", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of refund", + "type": "string" + } + } + }, + "amount_fee": { + "title": "amount_fee", + "description": "Amount of fee", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "The amount of fee", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of fee charged by anchor", + "type": "string" + } + } + }, + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "notify_refund_pendingResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_refund_pendingExample", + "description": "Example request to the `notify_refund_pending` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Refund pending" + }, + { + "name": "refund", + "value": { + "id": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e", + "amount": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_refund_sent", + "summary": "Payment refunded", + "description": "Refund payment completed", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "refund", + "schema": { + "type": "object", + "required": ["amount", "amount_fee", "id"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount to be refunded", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount of assets to refund", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of refund", + "type": "string" + } + } + }, + "amount_fee": { + "title": "amount_fee", + "description": "Amount of fee", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "The amount of fee", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of fee charged by anchor", + "type": "string" + } + } + }, + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "notify_refund_sentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_refund_sentExample", + "description": "Example request to the `notify_refund_sent` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Refund sent" + }, + { + "name": "refund", + "value": { + "id": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e", + "amount": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_error", + "summary": "Transaction processing error", + "description": "There was an error processing transaction", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_errorResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_errorExample", + "description": "Example request to the `notify_transaction_error` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction error" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_expired", + "summary": "Transaction has expired", + "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" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_expiredResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_expiredExample", + "description": "Example request to the `notify_transaction_expired` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction expired" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_on_hold", + "summary": "Transaction transaction is on hold", + "description": "Notify transaction is currently on hold by the anchor (e.g. compliance hold). Anchor should update message to guide user through the steps.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "user_action_required_by", + "description": "Time and date by which user action is required", + "required": false, + "schema": { + "title": "datetime", + "description": "A date and time.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_on_holdResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_on_holdExample", + "description": "Example request to the `notify_transaction_on_hold` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction on hold, please contact customer service to lift the hold." + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_recovery ", + "summary": "Transaction recovery", + "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" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_recoveryResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_recoveryExample", + "description": "Example request to the `notify_transaction_recovery` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction recovered" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_trust_set", + "summary": "Asset trustline set", + "description": "The user has added a trustline for the asset", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "success", + "description": "Flag which indicates if trustline was configured by user.", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "result": { + "name": "notify_trust_setResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_trust_setExample", + "description": "Example request to the `notify_trust_set` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Trustline set" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_offchain_funds", + "summary": "Request offchain funds", + "description": "The user has to initiate transfer to the anchor", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "This is required if the transaction is associated with a firm quote and for transactions where `amount_in.asset` and `amount_out.asset` are the same.", + "required": false, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + }, + { + "name": "amount_expected", + "description": "The amount expected in the payment", + "required": false, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "instructions", + "description": "A set of SEP-9 fields that describe how the user can complete the offchain deposit", + "required": false, + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The SEP-9 field name" + }, + "field": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the field" + }, + "description": { + "type": "string", + "description": "A human readable description of the field" + } + } + } + } + } + } + } + ], + "result": { + "name": "request_offchain_fundsResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_offchain_fundsExample", + "description": "Example request to the `request_offchain_funds` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Request offchain funds" + }, + { + "name": "amount_in", + "value": { + "amount": 1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + }, + { + "name": "instructions", + "value": { + "organization.bank_number": { + "value": "123456789", + "description": "US Bank routing number" + }, + "organization.bank_account_number": { + "value": "123456789", + "description": "US Bank account number" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_onchain_funds", + "summary": "Request onchain funds", + "description": "The user has to initiate transfer to the anchor", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "This is required if the transaction is associated with a firm quote and for transactions where `amount_in.asset` and `amount_out.asset` are the same.", + "required": false, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + }, + { + "name": "amount_expected", + "description": "The amount expected in the payment", + "required": false, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "destination_account", + "description": "Destination account", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "memo", + "description": "Value of memo to attach to transaction", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "memo_type", + "description": "Type of memo that anchor should attach to the transaction", + "required": false, + "schema": { + "type": "string" + } + } + ], + "result": { + "name": "request_onchain_fundsResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_onchain_fundsExample", + "description": "Example request to the `request_onchain_funds` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Requesting onchain funds" + }, + { + "name": "amount_in", + "value": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_trust", + "summary": "A trustline to the asset isn't set", + "description": "The user must add a trustline for the asset to complete", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "request_trustResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_trustExample", + "description": "Example request to the `request_trust` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Request trust" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + } + ], + "components": {} +} diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/README.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/README.mdx new file mode 100644 index 0000000000..af6f303020 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/README.mdx @@ -0,0 +1,41 @@ +--- +title: JSON-RPC Methods +order: 20 +sidebar_label: Methods +--- + +import { EndpointsTable } from "@site/src/components/EndpointsTable"; + +This section lists the Anchor Platform JSON-RPC API methods that should be called by Stellar clients to update status of the transaction. + +The OpenRPC Specification for JSON-RPC API is available [here](https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/stellar/stellar-docs/main/static/assets/rpc-methods/open-rpc.json). + +Postman collection is available [here](https://documenter.getpostman.com/view/9257637/2s9Y5U1kra) + + + +| | | +| --- | --- | +| | [notify_interactive_flow_completed](notify_interactive_flow_completed.mdx) | +| | [request_offchain_funds](request_offchain_funds.mdx) | +| | [request_onchain_funds](request_onchain_funds.mdx) | +| | [notify_offchain_funds_received](notify_offchain_funds_received.mdx) | +| | [notify_onchain_funds_received](notify_onchain_funds_received.mdx) | +| | [notify_amounts_updated](notify_amounts_updated.mdx) | +| | [notify_refund_pending](notify_refund_pending.mdx) | +| | [notify_refund_sent](notify_refund_sent.mdx) | +| | [do_stellar_payment](do_stellar_payment.mdx) | +| | [do_stellar_refund](do_stellar_refund.mdx) | +| | [notify_onchain_funds_sent](notify_onchain_funds_sent.mdx) | +| | [notify_offchain_funds_sent](notify_offchain_funds_sent.mdx) | +| | [notify_offchain_funds_available](notify_offchain_funds_available.mdx) | +| | [notify_offchain_funds_pending](notify_offchain_funds_pending.mdx) | +| | [request_trust](request_trust.mdx) | +| | [notify_trust_set](notify_trust_set.mdx) | +| | [notify_customer_info_updated](notify_customer_info_updated.mdx) | +| | [notify_transaction_error](notify_transaction_error.mdx) | +| | [notify_transaction_expired](notify_transaction_expired.mdx) | +| | [notify_transaction_recovery](notify_transaction_recovery.mdx) | +| | [notify_transaction_on_hold](notify_transaction_on_hold.mdx) | + + diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/do_stellar_payment.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/do_stellar_payment.mdx new file mode 100644 index 0000000000..3f82ad67fb --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/do_stellar_payment.mdx @@ -0,0 +1,13 @@ +--- +title: do_stellar_payment +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "do_stellar_payment")[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/do_stellar_refund.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/do_stellar_refund.mdx new file mode 100644 index 0000000000..6816862774 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/do_stellar_refund.mdx @@ -0,0 +1,13 @@ +--- +title: do_stellar_refund +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "do_stellar_refund")[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_amounts_updated.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_amounts_updated.mdx new file mode 100644 index 0000000000..8daed8f441 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_amounts_updated.mdx @@ -0,0 +1,13 @@ +--- +title: notify_amounts_updated +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_amounts_updated")[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_customer_info_updated.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_customer_info_updated.mdx new file mode 100644 index 0000000000..ffc4795d88 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_customer_info_updated.mdx @@ -0,0 +1,15 @@ +--- +title: notify_customer_info_updated +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_customer_info_updated", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_interactive_flow_completed.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_interactive_flow_completed.mdx new file mode 100644 index 0000000000..55ba759ec8 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_interactive_flow_completed.mdx @@ -0,0 +1,15 @@ +--- +title: notify_interactive_flow_completed +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_interactive_flow_completed", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_offchain_funds_available.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_offchain_funds_available.mdx new file mode 100644 index 0000000000..9bca880e34 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_offchain_funds_available.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_available +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_available", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_offchain_funds_pending.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_offchain_funds_pending.mdx new file mode 100644 index 0000000000..a7573189ca --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_offchain_funds_pending.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_pending +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_pending", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_offchain_funds_received.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_offchain_funds_received.mdx new file mode 100644 index 0000000000..9e19062eeb --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_offchain_funds_received.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_received +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_received", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_offchain_funds_sent.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_offchain_funds_sent.mdx new file mode 100644 index 0000000000..5478e2b595 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_offchain_funds_sent.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_sent +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_sent", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_onchain_funds_received.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_onchain_funds_received.mdx new file mode 100644 index 0000000000..24ef7eacac --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_onchain_funds_received.mdx @@ -0,0 +1,15 @@ +--- +title: notify_onchain_funds_received +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_onchain_funds_received", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_onchain_funds_sent.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_onchain_funds_sent.mdx new file mode 100644 index 0000000000..1a776c9582 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_onchain_funds_sent.mdx @@ -0,0 +1,15 @@ +--- +title: notify_onchain_funds_sent +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_onchain_funds_sent", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_refund_pending.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_refund_pending.mdx new file mode 100644 index 0000000000..bc24b12291 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_refund_pending.mdx @@ -0,0 +1,13 @@ +--- +title: notify_refund_pending +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_refund_pending")[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_refund_sent.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_refund_sent.mdx new file mode 100644 index 0000000000..fc0255d3fe --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_refund_sent.mdx @@ -0,0 +1,13 @@ +--- +title: notify_refund_sent +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_refund_sent")[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_transaction_error.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_transaction_error.mdx new file mode 100644 index 0000000000..83b48d8f83 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_transaction_error.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_error +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_error", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_transaction_expired.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_transaction_expired.mdx new file mode 100644 index 0000000000..6587a4cf9b --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_transaction_expired.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_expired +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_expired", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_transaction_on_hold.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_transaction_on_hold.mdx new file mode 100644 index 0000000000..bd00841ec1 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_transaction_on_hold.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_on_hold +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_on_hold", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_transaction_recovery.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_transaction_recovery.mdx new file mode 100644 index 0000000000..d134b53937 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_transaction_recovery.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_recovery +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_recovery", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_trust_set.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_trust_set.mdx new file mode 100644 index 0000000000..5968934e5e --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/notify_trust_set.mdx @@ -0,0 +1,11 @@ +--- +title: notify_trust_set +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_trust_set")[0]} +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/request_offchain_funds.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/request_offchain_funds.mdx new file mode 100644 index 0000000000..7066f66bbb --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/request_offchain_funds.mdx @@ -0,0 +1,13 @@ +--- +title: request_offchain_funds +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_offchain_funds")[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/request_onchain_funds.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/request_onchain_funds.mdx new file mode 100644 index 0000000000..6c14cd105a --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/request_onchain_funds.mdx @@ -0,0 +1,13 @@ +--- +title: request_onchain_funds +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_onchain_funds")[0] + } +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/request_trust.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/request_trust.mdx new file mode 100644 index 0000000000..62a368d0ae --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/methods/request_trust.mdx @@ -0,0 +1,11 @@ +--- +title: request_trust +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_trust")[0]} +/> diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/rpc/overview.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/overview.mdx new file mode 100644 index 0000000000..aa544d766e --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/rpc/overview.mdx @@ -0,0 +1,16 @@ +--- +title: Overview +sidebar_position: 10 +--- + +JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. + +It's simple and easy to use, as it uses a single HTTP endpoint and a JSON object that contains the method name and parameters. It is transport agnostic in that the concepts can be used within the same process, over sockets, over http, or in many various message passing environments. It uses [JSON](http://www.json.org/) ([RFC 4627](http://www.ietf.org/rfc/rfc4627.txt)) as data format. + +:::note + +All member names exchanged between the Client and the Server that are considered for matching of any kind should be considered to be case-sensitive. + +::: + +You can read more about JSON-RPC protocol [here](https://www.jsonrpc.org/specification). diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/transactions/README.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/transactions/README.mdx new file mode 100644 index 0000000000..3ee4b6728c --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/transactions/README.mdx @@ -0,0 +1,19 @@ +--- +title: Transactions +sidebar_position: 10 +--- + +import { EndpointsTable } from "@site/src/components/EndpointsTable"; + +Transactions are representations of a SEP transaction. It holds information about the protocol being used, and all necessary information passed by an external party (such as wallet or an anchor). + +Should not be confused with stellar [transactions](/docs/learn/glossary#transaction). + + + +| | | +| --- | -------------------------------------------- | +| GET | [/transactions/:id](get-transaction.api.mdx) | +| GET | [/transactions/](./get-transactions.api.mdx) | + + diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/transactions/get-transaction.api.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/transactions/get-transaction.api.mdx new file mode 100644 index 0000000000..0ec826764d --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/transactions/get-transaction.api.mdx @@ -0,0 +1,3642 @@ +--- +id: get-transaction +title: "Retrieve a Transaction" +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." +sidebar_label: "Retrieve a Transaction" +hide_title: true +hide_table_of_contents: true +api: eJzdlU1v4zYQhv/KYE4toMheJ9iDbmlhFAaK1kjSUxpkaXJscSORDDlyYhj678XQMizvpsF2eyjQkz5mOF9659EeWW0SVvd4F5VLSrP1LuFDga8XiUK23M6XFx+xyNfZ1XBz+UGcfKCo5MjCYIUb4lEULNBQ0tGG/FThMvqtNZSAawLr1j62+Sw40pSSijtY+5itqy5ZRykBezDEFFvrKFsSKybw6/zAp2xgDTm2a0sGVjv4ZM2nAgxpawjsGpTbweDYdolhRcDqiZwk0N6xdR1BiF4KsW7zZfQClDMSALzLNomcrHclFhhUVK0UKdPao5Veg+IaC3SqJazQGiww0nNnIxmsOHZUYNI1tQqrPfIuiFfiaN0G+/5BnFPwLlES+2w6lcv5NEeThrXvnJFSpBVyLN4qhMbqPODJ5yRH9qOU3tHv61zukNyvPpPmszLvD3UnCljgk3X5gRV36XATmcyjYtEBW27ovKjb+fIj9sV3J1Ct7xw/0msgzWQOamLrckePSmsxf2Mhs6t/U8m3ZLj8gP1D3/d9gVdvfa2flIEbeu4o8T/5TF9WHKJsHNuDLihGH98QUCHdvKGr844Pp0cdzfOLYxNX70vOef4O2f1H/fQF0iuTSxluovon2mF1ZFyBW9V09C7rZClb4toPoMt7zzVWOBlxIk321vRZSXF7BEIXG6ywZg6pmkxCo1jQd3FwKelVtaEh5XTtY6l9i5JK8CgtS5DD8C/LaTnFU3fLIQ7c5jhf0fauJjjmgkMusAmUA+uYolMNaN8G78hxCQuGVPuuMULG2icmA9aBghDtVojriF98fMocHDxFAisCpTM0Vw3BOvo243GRUxCXcFfbdExPTq2agf9jwq+JdZ0jd8FIsnPQj8YLXaaz5QTXy0X5p/xkGqvJJZJpDbi9DkrXBLM8r9P0q8nk5eWlVNla+riZDEfT5NfFz/PfbucXs3Ja1tw2WVzBJ26VGwW+IY6WtgQK3vnR7U/78L/95w2ryPTKomjrZEvzqPfDXtzj+MNhgZU1sp0iLrHu9yuV6I/Y9L28fu4o7rC6f5BljFaEkpfH2CT3Bqu1ahK9M+ofbgYY/Ah/V+DwUrndaedRiJ9pYI0wvMCalKE4wsS11hR4dOQryJ3R4Zf5Hfb9X9LROYE= +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/platform/transactions/platform-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +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. + + + +
+ +

+ Path Parameters +

+
+
+
    + +
+
+
+
+
+ + +
Transaction found.
+
+ + + + +
+ + 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. +
    + +
    + + + + 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` 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. +
    + + + +
    +
    +
    +
    +
    +
    +
    + + + + + + +
    + + + + 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` 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
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Transaction not found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/transactions/get-transactions.api.mdx b/ap_versioned_docs/version-2.11/api-reference/platform/transactions/get-transactions.api.mdx new file mode 100644 index 0000000000..3bf2323413 --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/transactions/get-transactions.api.mdx @@ -0,0 +1,4275 @@ +--- +id: get-transactions +title: "Retrieve a List of Transactions" +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`." +sidebar_label: "Retrieve a List of Transactions" +hide_title: true +hide_table_of_contents: true +api: eJztWN9P20gQ/ldG+3IgGUMpuoe8cSd6QuJ6qGmfKAobexxvWe+6O+MAjfK/n2btJA4JAVrpKp36ZGc9u/PtN78zU6wnpAZX6mPQjnTGxjtS14m6PyCs45fh2eXB7yqJz+OT7uXtGxHyNQYtW85zNVAT5LVTEpUjZcHU8lMN1Km1/o6APXxtMDyANcTgC+DeJih8gBzJBMxheHaZwsfSEOjaADV17QMT1HpiXFSbgHY5GP6NoPZEZmwR9mQpYOarCl2O+b4orPQtQtVYNrVFCPi1QeIelD4EUYlgNbFoQjAEAXVWYg53JTrgEsE11RiDgEeLFToWGW6CwxzGD1EEXV5741j2U6WtxQBcagd18FOTYw43cvyIzDe8SVWiah10hYxBWJ8pI5RFdCpRTleoBoqwVokS+MKPGnBoMFGUlVhpNZgpfqijGAfjJipR6JpKTCjmi6YTs80f2+XC+9umXjfDGK13E+MmwhGLCcQYap5sB+ZDjmE0lpXn0WQBNWM+0qwSFbUWGEYBMzTTdvlaIBa6sawGffEN6MMaM1MYJCgM2lwI5vWL3BlrYYwQEUbrpPDeMyatLGHmXa7DA5AP0Va93WByMA40Zehy4WKqbYPpZ3eeYto5g6mQWFd167nH4ANUPuA6CENgcnRsMm1FMT4scYna1mlM/gy/LyJXU9YF3jqLsr6DvqhgjZmlr7fMGgLXWJuAtvYxw1zGby09y5tJBCUQcKJDbpFIooW8wG21wd77TxcXQ7g4HX7cTz+7dz4A3uuqtgKhc4tIMFT6AZznyFcHOY98k6/WqRaFJHHuJmAce7jZ5mA3MEaRENQpnAuuZNulvDtYXYwe26xNNF3UFybIdQsvSa416A6mVm7ztM2JNTeEtM3sOgQtooaxom3usG7ny0VybM9c3EcYfAyy50rGZV6swagStXjNYwIqGkmtIntfx1SUKAzBi4vWbayMiNFa3V/Be8bgtO0tNYRhtLQQsQ785NcemIWAdlm5ppRDQ49PEEb9qNLhFmPC8X4U83H3bnWY9M8kqRr9Mzu/WVezJGxkXOFHTZ3rNWRZQ+wrDGufrxPFhq0YahgNMTy7PLVWzTcC852xUgg2S+PK/aMLxJjq/CQ6skTJosAkUMRjYiwQ5Ib02GIOe11WgDGWemp82H/SB5cVapsTGsc4ibws08zx0WaOMd9QYGog4ybig6hDVsbamsLfDcWwrj0ZNlN8OhwilLbuvhDMJpZLqedd7WYPDWEkNfOOjWt8Qx24FKJk5hvHbaog0AxHqZpfi/tT7Z1E5mCmjo+O5LGup9cGQeEbl6cxghyjY5HWdW1NFluYwy8kW2a9G3mH/xSxB+ju5sdfMIu+23lP7/wLQzw8u/w98vZy+eOTV254+0bNr+dzcdWTbVf+Q+fwoe2rXnPXxwDqID0lm5bcNqdspLd5oky+ZXne742uut29oDuLC4tLnOy2m0TS6233k+4zl0zM6CimcHGdW3xQg0UXn6iY8Xd28+LZFXLpu1Y+dqRcqoE6fFQfCMN00aU2waqBKplrGhwe1lZz4UN10IqkXTlv03Sa+SrGj6REua0c0vL+Nj1Kj3rud9mdA8N4zkY9kwZ9oQtaXZLhtJOaH2sMSLXwDh2ncM5ApW9sLomm9CS1W9o6qIOZakZwyHc+3MaC3kl23YbOMuxKZxF8Ffuh86gCuRtNOvXoJLlSlBg3ZJx0POyhQM7KeHJbBKKApGzcGH1k1wQME5xenqefnUqUNRk6QmGrS4OntYwicBz5WrE/ODy8u7tLdfya+jA57LbS4cX5n2fvh2cHx+lRWnLVlpvaE1fa9Q7+gBwMThE0XHSD2a5pbraKiV+D3e7BrotqxnuWCDFOAj6abtaF2JXiR+O3uKmsz2ZjTfgp2PlcltuaKIG3qOZqUGhLuMM6ex+6HLIPr5j0noDdppV2Du1yioqV5OV4/m8z206meoPxD9P1a0b7aTPa8zb+fgP/173+7sheDZ3f66+v7Pd3wunPH9+J58d7/ucRLseSFcZr+RGMgFSDK/nTrUQtfrJqzk6zDGvu7dpoLdd6sr/OPqr5/F+ZpqBM +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/platform/transactions/platform-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +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 +

+
+
+
    + + + + + + +
+
+
+
+
+ + +
Transaction found.
+
+ + + + +
+ + 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. +
    + +
    + + + + 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` 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. +
    + + + +
    +
    +
    +
    +
    +
    +
  • +
    + ] +
    +
  • +
    +
    +
    +
    + + +
    + + + + 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` 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
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Transaction not found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.11/api-reference/platform/transactions/versions.json b/ap_versioned_docs/version-2.11/api-reference/platform/transactions/versions.json new file mode 100644 index 0000000000..2f7060939b --- /dev/null +++ b/ap_versioned_docs/version-2.11/api-reference/platform/transactions/versions.json @@ -0,0 +1,12 @@ +[ + { + "version": "3.0.0", + "label": "v3.0.0", + "baseUrl": "/platforms/anchor-platform/next/api-reference/platform/transactions" + }, + { + "version": "2.11.0", + "label": "v2.11.0", + "baseUrl": "/platforms/anchor-platform/api-reference/platform/transactions" + } +] diff --git a/ap_versioned_docs/version-2.11/assets/SEP24-state-diagram.png b/ap_versioned_docs/version-2.11/assets/SEP24-state-diagram.png new file mode 100644 index 0000000000..65d2bb5363 Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/SEP24-state-diagram.png differ diff --git a/ap_versioned_docs/version-2.11/assets/anchor-platform-architecture-1.png b/ap_versioned_docs/version-2.11/assets/anchor-platform-architecture-1.png new file mode 100644 index 0000000000..0917091187 Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/anchor-platform-architecture-1.png differ diff --git a/ap_versioned_docs/version-2.11/assets/anchor-platform-architecture-2.png b/ap_versioned_docs/version-2.11/assets/anchor-platform-architecture-2.png new file mode 100644 index 0000000000..6e2c1e64b5 Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/anchor-platform-architecture-2.png differ diff --git a/ap_versioned_docs/version-2.11/assets/anchor-platform-sep24-demo-wallet-widget.png b/ap_versioned_docs/version-2.11/assets/anchor-platform-sep24-demo-wallet-widget.png new file mode 100644 index 0000000000..b2461d306e Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/anchor-platform-sep24-demo-wallet-widget.png differ diff --git a/ap_versioned_docs/version-2.11/assets/anchor-platform-sep24-demo-wallet.png b/ap_versioned_docs/version-2.11/assets/anchor-platform-sep24-demo-wallet.png new file mode 100644 index 0000000000..169f450fa3 Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/anchor-platform-sep24-demo-wallet.png differ diff --git a/ap_versioned_docs/version-2.11/assets/anchor-platform-sep31-demo-wallet-widget.png b/ap_versioned_docs/version-2.11/assets/anchor-platform-sep31-demo-wallet-widget.png new file mode 100644 index 0000000000..be483f58c9 Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/anchor-platform-sep31-demo-wallet-widget.png differ diff --git a/ap_versioned_docs/version-2.11/assets/sep24-deposit-flow-diagram.png b/ap_versioned_docs/version-2.11/assets/sep24-deposit-flow-diagram.png new file mode 100644 index 0000000000..6a45a3e108 Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/sep24-deposit-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.11/assets/sep24-withdrawal-flow-diagram.png b/ap_versioned_docs/version-2.11/assets/sep24-withdrawal-flow-diagram.png new file mode 100644 index 0000000000..f69ee06dad Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/sep24-withdrawal-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.11/assets/sep31-transition-diagram.png b/ap_versioned_docs/version-2.11/assets/sep31-transition-diagram.png new file mode 100644 index 0000000000..8dae3cd7b0 Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/sep31-transition-diagram.png differ diff --git a/ap_versioned_docs/version-2.11/assets/sep6-deposit-flow-diagram.png b/ap_versioned_docs/version-2.11/assets/sep6-deposit-flow-diagram.png new file mode 100644 index 0000000000..fa947373ae Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/sep6-deposit-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.11/assets/sep6-withdrawal-flow-diagram.png b/ap_versioned_docs/version-2.11/assets/sep6-withdrawal-flow-diagram.png new file mode 100644 index 0000000000..187b871aac Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/sep6-withdrawal-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep24_deposit_job.png b/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep24_deposit_job.png new file mode 100644 index 0000000000..30b8059f85 Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep24_deposit_job.png differ diff --git a/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep24_deposit_webhook.png b/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep24_deposit_webhook.png new file mode 100644 index 0000000000..630d9173d0 Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep24_deposit_webhook.png differ diff --git a/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep24_withdrawal_job.png b/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep24_withdrawal_job.png new file mode 100644 index 0000000000..a768c5218f Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep24_withdrawal_job.png differ diff --git a/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep24_withdrawal_webhook.png b/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep24_withdrawal_webhook.png new file mode 100644 index 0000000000..4005a81d27 Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep24_withdrawal_webhook.png differ diff --git a/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep31_receive_job.png b/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep31_receive_job.png new file mode 100644 index 0000000000..3150663fe1 Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep31_receive_job.png differ diff --git a/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep31_receive_webhook.png b/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep31_receive_webhook.png new file mode 100644 index 0000000000..7a66bbdcc9 Binary files /dev/null and b/ap_versioned_docs/version-2.11/assets/sequence_diagram_sep31_receive_webhook.png differ diff --git a/ap_versioned_docs/version-2.8/README.mdx b/ap_versioned_docs/version-2.8/README.mdx new file mode 100644 index 0000000000..6f5587ec14 --- /dev/null +++ b/ap_versioned_docs/version-2.8/README.mdx @@ -0,0 +1,12 @@ +--- +title: Anchor Platform Introduction +sidebar_position: 10 +--- + +# Anchor Platform + +The Anchor Platform is a set of tools and APIs that enable developers and businesses to build their own on and off-ramp services for the Stellar network. It provides a standardized interface, including the implementation of several Stellar Ecosystem Proposals (SEPs), to make it easy for businesses to integrate with Stellar-based wallets and exchanges. + +The platform also includes features for managing assets, transactions, and user accounts, and supports a variety of deployment options, including using Docker or Kubernetes. Overall, the Anchor Platform aims to simplify the process of building and managing a Stellar-based financial service, allowing businesses to focus on providing value to their customers. + +Learn about integrating with the Anchor Platform in the [Admin Guide](./admin-guide/README.mdx) or get API information in the [API Reference](./api-reference/README.mdx). diff --git a/ap_versioned_docs/version-2.8/admin-guide/README.mdx b/ap_versioned_docs/version-2.8/admin-guide/README.mdx new file mode 100644 index 0000000000..d955ccbfc7 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/README.mdx @@ -0,0 +1,10 @@ +--- +title: Admin Guide +sidebar_position: 10 +--- + +import DocCardList from "@theme/DocCardList"; + +All you need to know about setting up, running, and using the Anchor Platform. + + diff --git a/ap_versioned_docs/version-2.8/admin-guide/architecture.mdx b/ap_versioned_docs/version-2.8/admin-guide/architecture.mdx new file mode 100644 index 0000000000..d9abf6435c --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/architecture.mdx @@ -0,0 +1,69 @@ +--- +title: "Architecture" +sidebar_position: 20 +--- + +## Architecture + +Before starting with the Anchor Platform, let's get familiar with the architecture. This section will describe the components involved and how they interact. + +### Fundamental Architecture + +The following architectural components are required for all deployments of the Anchor Platform. + +[![fundamental anchor platform architecture](../assets/anchor-platform-architecture-1.png)](../assets/anchor-platform-architecture-1.png) + +#### Client + +The client is an application, such as a wallet or remittance sender, that acts on behalf of a user and makes requests to the system. Clients make requests to the SEP server component of the Anchor Platform using sets of standards called [SEPs][seps] (Stellar Ecosystem Proposals). + +#### SEP Server + +The SEP server is a client-facing server and therefore needs to be accessible from an external network. The SEP server processes user requests and manages the state of transactions they initiate. When the SEP server needs to provide information it doesn't have to the client, such as the exchange rate for an asset pair or the KYC status of a customer, it makes synchronous [callback][callback-api] requests to the business server and returns the information in a SEP-compliant format. + +:::note + +The SEP server will never store any sensitive information, such as KYC (PII), in the database. + +::: + +#### Business Server + +The business server is a service that you (the business) must implement to connect the Anchor Platform with your internal systems. The business server responds to callback requests sent by the SEP server, such as requests for a quote, receives events sent by event service, such as notification of a received payment to your Stellar account, and provides updates to the platform server when off-chain events occur, such as the initiation of a bank transfer to a customer. + +#### Platform Server + +The platform server is an internal component. It should be hosted in a private network and should not be accessible from the Internet. This server enables the business to fetch and update the state of transactions using its [API][platform-api]. + +#### Database + +The Anchor Platform uses a PostgreSQL database to store Stellar events and entities. It is primary used to store transactions. + +### Complete Architecture + +In addition to the components described above, the Anchor Platform includes several other components that offer additional functionality. Your business can chose to which of the additional components to use, but the diagram below visualizes the architecture of the system if all components are utilized. + +[![complete anchor platform architecture](../assets/anchor-platform-architecture-2.png)](../assets/anchor-platform-architecture-2.png) + +#### Event Service + +The event service enables the Anchor Platform to send HTTP webhooks to registered clients and your business server when the state of transactions change, removing the need for clients and/or your business server to poll the Anchor Platform's APIs. It works by reading events from published to a Kafka topic by the other Anchor Platform components. [Read more][events] about using the event service. + +#### Custody Server + +The custody server connects to enterprise wallet providers, such as Fireblocks, to send and receive payments for transactions initiated via the Anchor Platform. This service is an alternative to the Stellar Observer for businesses who use one of the supported providers. In addition to the functionality offered by the Stellar Observer, the Custody Server can also facilitate outbound payments to client's Stellar accounts. If you also use the [events] service, payments to your accounts will trigger a HTTP callback made to your business server. + +If you already have an integration with your wallet provider, then this component is not required, although your business server will need to notify the Anchor Platform when a payment associated with an Anchor Platform transaction was sent to or from your Stellar accounts via the [Platform API][platform-api]. + +Currently the only supported provider is Fireblocks. + +#### Stellar Observer + +The Stellar observer, an alternative to the custody server pictured above, monitors the Stellar blockchain using Horizon, automatically detects user payments sent to the business, and updates the corresponding transactions in the Anchor Platform's database. If you also use the [events] service, payments to your accounts will trigger a HTTP callback made to your business server. + +If you already have a solution for monitor payments to your Stellar accounts, such as an integration with your exchange, Horizon, or RPC, then this component is not required, although your business server will need to notify the Anchor Platform when a payment associated with an Anchor Platform transaction was made to your one of your Stellar accounts via the [Platform API][platform-api]. + +[seps]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/README.md +[platform-api]: ../api-reference/platform/transactions/README.mdx +[callback-api]: ../api-reference/callbacks/README.mdx +[events]: ./events/README.mdx diff --git a/ap_versioned_docs/version-2.8/admin-guide/component/observer/observer.mdx b/ap_versioned_docs/version-2.8/admin-guide/component/observer/observer.mdx new file mode 100644 index 0000000000..133ac576f2 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/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](../../getting-started.mdx#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](#funds-received-1) 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]: ../../custody-services/fireblocks/README.mdx diff --git a/ap_versioned_docs/version-2.8/admin-guide/component/rpc/error.mdx b/ap_versioned_docs/version-2.8/admin-guide/component/rpc/error.mdx new file mode 100644 index 0000000000..27746e6f0e --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/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/ap_versioned_docs/version-2.8/admin-guide/component/rpc/request.mdx b/ap_versioned_docs/version-2.8/admin-guide/component/rpc/request.mdx new file mode 100644 index 0000000000..9157143afc --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/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/ap_versioned_docs/version-2.8/admin-guide/component/rpc/response.mdx b/ap_versioned_docs/version-2.8/admin-guide/component/rpc/response.mdx new file mode 100644 index 0000000000..02d8081034 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/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/ap_versioned_docs/version-2.8/admin-guide/component/rpc/rpc.mdx b/ap_versioned_docs/version-2.8/admin-guide/component/rpc/rpc.mdx new file mode 100644 index 0000000000..f00b8ee7f5 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/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/ap_versioned_docs/version-2.8/admin-guide/component/security/api_key.mdx b/ap_versioned_docs/version-2.8/admin-guide/component/security/api_key.mdx new file mode 100644 index 0000000000..c994a59941 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/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" +``` + + + +Once enabled, all requests must include a valid `X-Api-Key` header, set to the configured API key. diff --git a/ap_versioned_docs/version-2.8/admin-guide/component/security/jwt.mdx b/ap_versioned_docs/version-2.8/admin-guide/component/security/jwt.mdx new file mode 100644 index 0000000000..50153090a4 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/component/security/jwt.mdx @@ -0,0 +1,16 @@ +To enable JWT authentication, modify your `dev.env` file: + + + +```bash +# dev.env +PLATFORM_SERVER_AUTH_TYPE=jwt +# Will be used to sign the JWT token +SECRET_PLATFORM_API_AUTH_SECRET="your secret that business server will use" +``` + + + +Anchor Platform uses the HMAC SHA-256 (HS256) algorithm to sign JWT tokens. Ensure that `SECRET_PLATFORM_API_AUTH_SECRET` is at least 32 characters long for security. + +Once enabled, all requests must include a valid `Authorization` header with the format `Bearer `. diff --git a/ap_versioned_docs/version-2.8/admin-guide/component/security/security.mdx b/ap_versioned_docs/version-2.8/admin-guide/component/security/security.mdx new file mode 100644 index 0000000000..76a3832c30 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/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/ap_versioned_docs/version-2.8/admin-guide/custody-services/README.mdx b/ap_versioned_docs/version-2.8/admin-guide/custody-services/README.mdx new file mode 100644 index 0000000000..5556776d58 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/custody-services/README.mdx @@ -0,0 +1,10 @@ +--- +title: Custody Services +sidebar_position: 80 +--- + +import DocCardList from "@theme/DocCardList"; + +Using a custody service will allow you to use an outside service to store and manage your wallets. + + diff --git a/ap_versioned_docs/version-2.8/admin-guide/custody-services/configuration.mdx b/ap_versioned_docs/version-2.8/admin-guide/custody-services/configuration.mdx new file mode 100644 index 0000000000..a068caab1d --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/custody-services/configuration.mdx @@ -0,0 +1,130 @@ +--- +title: Configuration +sidebar_position: 10 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Custody Server Configuration + +If you want to use an external custody service to store and manage your wallets, then you need to deploy one more service - the Custody Server. + +This service also needs the `STELLAR_ANCHOR_CONFIG` that was previously mentioned. By default, the `anchor-config-default-values.yaml` config file will be used. + +Also, now you don't need to deploy the Stellar Observer since the Custody Server will be responsible for its functionality. + +Update the configuration file of the Anchor Platform with the base URL and port. + + + +```yaml +custody_server: + # The listening port of the Custody Server. + # Default value: 8086 + port: 8086 + # The base URL of the Custody Server. + # Default value: http://localhost:8086 + base_url: http://localhost:8086 +``` + + + +Configure authentication type. + + + +```yaml +custody_server: + auth: + # Type of authentication that is used when the Anchor Platform communicates with the Custody Server. + # Supported values: [none, api_key, jwt] + # Default value: none + type: none +``` + + + +If you set the `api_key` or `jwt` authentication type, then you need to add an environment variable. + + + +```bash +# dev.env +SECRET_CUSTODY_SERVER_AUTH_SECRET="Custody Server auth secret" +``` + + + +Start the Custody Server using Gradle or Docker. + + + +```bash +./gradlew service-runner:bootRun --args=--custody-server +docker run stellar/anchor-platform:2.8.4 --custody-server +``` + + + +## Anchor Platform Configuration + +Update the configuration file of the Anchor Platform with the deposit info generator type for SEP-24 and SEP-31. Also, you need to configure a trustline check, if you use JSON-RPC. + + + +```yaml +sep24: + # Used to choose how the SEP-24 deposit information (deposit address, memo and memo type) will be generated + # Supported value: [self, custody, none] + # Default value: self + deposit_info_generator_type: custody +sep31: + # Used to choose how the SEP-31 deposit information (deposit address, memo and memo type) will be generated + # Supported value: [self, custody, api] + # Default value: self + deposit_info_generator_type: custody + ## Trustline check configuration. Used only when custody integration is enabled +custody: + trustline: + ## @param: checkCronExpression + ## @type: string + ## Cron expression which defines how often a trustline check job runs. By default, a job runs every minute + # + check_cron_expression: "0 * * * * *" + ## @param: checkDuration + ## @type: integer + ## Determines how long (in MINUTES) the trustline will be checked. By default - 1 hour (60 minutes) + # + check_duration: 60 + ## @param: checkTimeoutMessage + ## @type: string + ## The message that will be added to the SEP transaction after the duration check is exceeded + # + check_timeout_message: Trustline check timed out +``` + + + +:::info + +- `self` - memo and memo type are generated in the local code, and the distribution account is used for the deposit address. +- `custody` - memo and memo type are generated through Custody API, for example Fireblocks, as well as the deposit address. +- `none` - deposit address, memo, and memo type should be provided by the business in a PATCH/JSON-RPC request. +- `api` - memo and memo type are generated through calling the anchor's GET /unique_address endpoint. + +::: + +## Kotlin Reference Server Configuration + +Update the configuration file of the Kotlin Reference Server to enable custody integration. + + + +```yaml +app: + # Flag that indicates that the custody integration is enabled and the payment will be submitted using the Custody Server. + # Default value: false + custodyEnabled: true +``` + + diff --git a/ap_versioned_docs/version-2.8/admin-guide/custody-services/fireblocks/README.mdx b/ap_versioned_docs/version-2.8/admin-guide/custody-services/fireblocks/README.mdx new file mode 100644 index 0000000000..43e037461e --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/custody-services/fireblocks/README.mdx @@ -0,0 +1,10 @@ +--- +title: Fireblocks +sidebar_position: 20 +--- + +import DocCardList from "@theme/DocCardList"; + +Configure [Fireblocks](https://fireblocks.io) to act as a custody service that stores and manages your wallets. + + diff --git a/ap_versioned_docs/version-2.8/admin-guide/custody-services/fireblocks/configuration.mdx b/ap_versioned_docs/version-2.8/admin-guide/custody-services/fireblocks/configuration.mdx new file mode 100644 index 0000000000..0df4d0761d --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/custody-services/fireblocks/configuration.mdx @@ -0,0 +1,68 @@ +--- +title: "Configuration" +sidebar_position: 10 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Configure Fireblocks workspace: + +1. [Configure API Co-Signer](https://support.fireblocks.io/hc/en-us/articles/4581830426268) +2. [Add API User](https://support.fireblocks.io/hc/en-us/articles/4407823826194-Adding-new-API-users) +3. [Configure Webhook URL](https://support.fireblocks.io/hc/en-us/articles/4408110107794-Configuring-Webhook-URLs) +4. [Enable One-Time Address feature](https://support.fireblocks.io/hc/en-us/articles/4409104568338) + +Update the configuration file of the Custody Server. + + + +```yaml +custody: + # Default value: none + type: fireblocks + fireblocks: + # The base URL of the Fireblocks API + # Default value: https://api.fireblocks.io + base_url: https://api.fireblocks.io + # ID of Fireblocks vault account that will be used for payments + vault_account_id: "vault_account_id" + # Fireblocks public key that is used to verify a webhook signature + public_key: "public_key" + # Mappings of fireblocks asset codes to stellar asset codes. For example: + # XLM_USDC_T_CEKS stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + # XLM_TEST stellar:native + # Codes should be separated with a space and each pair of codes should be on a new line + asset_mappings: "asset_mappings" + reconciliation: + # Cron expression which defines how often the transaction reconciliation job runs. + # By default, job runs every 15 minutes. + # Default value: 0 0/15 * * * * + cron_expression: "0 0/15 * * * *" + # Determines how many times the transaction reconciliation job will attempt to update the status of the + # transaction before marking it as failed. + # Default value: 10 + max_attempts: 10 + retry_config: + # Determines how many times the Fireblocks client will attempt to send a request before marking a call as failed. + # Default value: 3 + max_attempts: 3 + # Interval between Fireblocks client call attempts (in ms) + # Default value: 1000 + delay: 1000 +``` + + + +Add the environment variables. + + + +```bash +# dev.env +# API key, that will be added to JWT token claims. JWT token will be sent in requests to Fireblocks API +SECRET_CUSTODY_FIREBLOCKS_API_KEY="Fireblocks API key" +# Secret key, that is used to sign JWT token +SECRET_CUSTODY_FIREBLOCKS_SECRET_KEY="Fireblocks secret key" +``` + + diff --git a/ap_versioned_docs/version-2.8/admin-guide/custody-services/fireblocks/example.mdx b/ap_versioned_docs/version-2.8/admin-guide/custody-services/fireblocks/example.mdx new file mode 100644 index 0000000000..613d31bca2 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/custody-services/fireblocks/example.mdx @@ -0,0 +1,50 @@ +--- +title: "Example" +sidebar_position: 10 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +[comment]: # "Sequence diagram definitions are located in /static/definitions folder" +[comment]: # "To updated them, use https://sequencediagram.org" + +### SEP-24 deposit flow with webhook: + +- request_offchain_funds +- notify_offchain_funds_received +- do_stellar_payment +- notify_onchain_funds_sent [![sequence_diagram_sep24_deposit_webhook](../../../assets/sequence_diagram_sep24_deposit_webhook.png)](../../../assets/sequence_diagram_sep24_deposit_webhook.png) +
+ +### SEP-24 deposit flow with reconciliation job: + +- request_offchain_funds +- notify_offchain_funds_received +- do_stellar_payment +- notify_onchain_funds_sent [![sequence_diagram_sep24_deposit_job](../../../assets/sequence_diagram_sep24_deposit_job.png)](../../../assets/sequence_diagram_sep24_deposit_job.png) +
+ +### SEP-24 withdrawal flow with webhook: + +- do_stellar_payment +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep24_withdrawal_webhook](../../../assets/sequence_diagram_sep24_withdrawal_webhook.png)](../../../assets/sequence_diagram_sep24_withdrawal_webhook.png) +
+ +### SEP-24 withdrawal flow with reconciliation job: + +- request_onchain_funds +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep24_withdrawal_job](../../../assets/sequence_diagram_sep24_withdrawal_job.png)](../../../assets/sequence_diagram_sep24_withdrawal_job.png) +
+ +### SEP-31 receive flow with webhook: + +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep31_receive_webhook](../../../assets/sequence_diagram_sep31_receive_webhook.png)](../../../assets/sequence_diagram_sep31_receive_webhook.png) +
+ +### SEP-31 receive flow with reconciliation job: + +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep31_receive_job](../../../assets/sequence_diagram_sep31_receive_job.png)](../../../assets/sequence_diagram_sep31_receive_job.png) diff --git a/ap_versioned_docs/version-2.8/admin-guide/events/README.mdx b/ap_versioned_docs/version-2.8/admin-guide/events/README.mdx new file mode 100644 index 0000000000..43cc58bd93 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/events/README.mdx @@ -0,0 +1,10 @@ +--- +title: Event Handling +sidebar_position: 85 +--- + +import DocCardList from "@theme/DocCardList"; + +Receive transaction updates through HTTP webhook events. + + diff --git a/ap_versioned_docs/version-2.8/admin-guide/events/delivery.mdx b/ap_versioned_docs/version-2.8/admin-guide/events/delivery.mdx new file mode 100644 index 0000000000..cd6d3148e2 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/events/delivery.mdx @@ -0,0 +1,30 @@ +--- +title: "Delivery Guarantees" +sidebar_position: 30 +--- + +## Delivery Guarantees + +Depending on the messaging system you use, there will be different delivery guarantees. the event service uses Kafka as the messaging system, so the delivery guarantees will depend on the producer configuration and the broker configuration that you use. Depending on the number of partitions configured for the `TRANSACTION` topic, the events may be delivered out of order. + +:::caution + +Any transaction logic that depends on the order should use the transaction `status` and the `updated_at` fields to determine the order of the events. + +::: + +Next subsections will describe the delivery guarantees from the client and the business server perspective. + +### Client Delivery Guarantees + +For each client, the event service will attempt to deliver each event up to three times with an exponential backoff. If the event is not delivered after three attempts due to HTTP 4xx or 5xx errors, the event will be skipped. If the client is not reachable after three attempts, the event service will no longer attempt to deliver any events to that client. + +### Business Server Delivery Guarantees + +The event service will attempt to deliver each event to the businesss server up to three times with an exponential backoff. If the event is not delivered after three attempts due to HTTP 4xx or 5xx errors, the event will be skipped. If the business server is not reachable after three attempts, the event service will no longer attempt to deliver any events to the business server. + +:::note + +The business server delivery guarantees are the same as the client delivery guarantees. In the future, the event service will skip the events that are not delivered to clients that are not reachable. + +::: diff --git a/ap_versioned_docs/version-2.8/admin-guide/events/getting-started.mdx b/ap_versioned_docs/version-2.8/admin-guide/events/getting-started.mdx new file mode 100644 index 0000000000..d7c3a3832a --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/events/getting-started.mdx @@ -0,0 +1,8 @@ +--- +title: Getting Started +sidebar_position: 10 +--- + +Anchor Platform provides an event service that allows your business application and client applications such as wallets to receive updates about transaction updates via HTTP webhooks without the need to poll the transactions API. + +By integrating with the event service, you or your clients will be able to receive updates about the status of transactions, including when they are submitted, completed, and failed as well as any quotes created. diff --git a/ap_versioned_docs/version-2.8/admin-guide/events/integration.mdx b/ap_versioned_docs/version-2.8/admin-guide/events/integration.mdx new file mode 100644 index 0000000000..e716f33449 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/events/integration.mdx @@ -0,0 +1,166 @@ +--- +title: "Integration" +sidebar_position: 20 +--- + +This guide will walk you through integrating with the event service to start receiving events. The event service currently only supports Apache Kafka as the backend message broker. + +It assumes familiarity with Kafka and will not cover how to set up a Kafka cluster. + +## Requirements + +Anchor Platform will send events to the `TRANSACTION` Kafka topic. The event service will consume events from this topic and send them to the appropriate endpoints. + +## Configuration + +First, the event service's Kafka producer need to be configured using the `event.queue` section of the configuration file or setting the environment variables. The following is the set of required environment variables needed to configure the event service's Kafka producer: + + + +```bash +# dev.env +EVENTS_ENABLED=true +EVENTS_QUEUE_TYPE=kafka +EVENTS_QUEUE_KAFKA_BOOTSTRAP_SERVER=localhost:9092 +``` + +```yaml +# dev.services.yaml +events: + enabled: true + queue: + type: kafka + kafka: + bootstrap_server: localhost:9092 +``` + + + +Anchor Platform allows a subset of the Kafka producer's client configuration to be set. See the [default values file][default-values-file] for more information what is available. For more information on the Kafka producer's client configuration, see the [Kafka documentation](https://kafka.apache.org/documentation/#producerconfigs). + +Next, the event processor needs to be configured in the `event_processor` section of the Anchor Platform Configuration file or setting the environment variables. + + + +```bash +# dev.env +EVENT_PROCESSOR_CLIENT_STATUS_CALLBACK_ENABLED=true +EVENT_PROCESSOR_CALLBACK_API_REQUEST_ENABLED=true +``` + +```yaml +# dev.services.yaml +event_processor: + client_status_callback: + enabled: true + callback_api_request: + enabled: true +``` + + + +This will enable the event processor to start processing events from `TRANSACTION` topic. In this example, the event processor will send events to client and business server callback endpoints. + +## Receiving Events + +The event service can be used to send events to client and business server callback endpoints. The event service will send events to these endpoints as HTTP POST requests with the event data in the request body. + +### As a Client Application + +Client applications can receive updates whenever the `status` of a SEP transaction changes. + +To receive events as a client application, you will need to expose a callback URL that the event service can send events to. The event service will send a POST request to this endpoint with the event data in the request body. + +Anchor Platform will only send events to clients listed in the client configuration. See the [client configuration documentation][clients-config] for more information. + +#### Callback Signing + +Anchor Platform signs the callback requests it sends to client applications. The signature is included in the `Signature` header of the request. The callback URL signature specification can be found in the corresponding SEP protocol specifications. + +- [SEP-0006](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md#url-callback-signature) +- [SEP-0024](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#url-callback-signature) +- [SEP-0031](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md#url-callback-signature) + +### As a Business Server + +In addition to SEP transaction status updates, business servers can receive events about SEP-31 quote creation or SEP-12 customer information updates. The schema of the event data will depend on the type of event being sent. Visit the [Event API documentation](../../api-reference/callbacks/post-event.api.mdx) for more information about the schema of the event data. + +To receive events as a business server, you will need to expose a callback URL that the event service can send events to. The event service will send a POST request to this endpoint with the event data in the request body. + +#### Configuration + +The event service's callback API can be configured using the `callback_api` section of the Anchor Platform configuration file or setting the environment variables. + +:::caution + +The `--event-processor` will ignore any path segments specified in `callback_api.base_url` and will instead send events to `[scheme]://[host]:[port]/event`. This is a bug, but in order not to disrupt those using the event processor, we will defer the fix of including path segments in version 3 of the Anchor Platform. + +::: + +The following is an example of how to configure the event service's callback API with JWT authentication: + + + +```bash +# dev.env + +# note `/callback` will not be used for event callbacks +# instead events will be sent to `http://localhost:8081/event` +# all other callbacks (rates, customer, etc.) will use the provided `/callback` root path +CALLBACK_API_BASE_URL=http://localhost:8081/callback +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +CALLBACK_API_AUTH_JWT_HTTP_HEADER=Authorization +SECRET_CALLBACK_API_AUTH_SECRET="a secret for signing jwts" +``` + +```yaml +# dev.services.yaml +callback_api: + base_url: http://localhost:8081/callback + auth: + type: jwt + jwt: + expiration_milliseconds: 30000 + http_header: Authorization +``` + + + +The following is an example of how to configure the event service's callback API with API key authentication: + + + +```bash +# dev.env +CALLBACK_API_BASE_URL=http://localhost:8081/callback +CALLBACK_API_AUTH_TYPE=api_key +CALLBACK_API_AUTH_API_KEY_HTTP_HEADER=X-Api-Key +SECRET_CALLBACK_API_AUTH_SECRET="your API key" +``` + +```yaml +# dev.services.yaml +callback_api: + base_url: http://localhost:8081/callback + auth: + type: api_key + api_key: + http_header: X-Api-Key +``` + + + +This configures the event service's callback API that will be used to send events to client and business server callback endpoints. The following are the supported configuration options: + +- `base_url`: The base URL of the business server's callback endpoint. +- `secret`: The secret to be used when sending events to the business server's callback endpoint. This is used to sign the request body when JWT authentication is enabled and it is the API key when API key authentication is enabled. +- `auth`: The authentication method to be used when sending events to the business server's callback endpoint. The following are the supported authentication methods: + - `JWT`: The event service will send a JSON Web Token (JWT) in the `Authorization` header of the request. The following are the supported configuration options: + - `expiration_milliseconds`: The expiration time of the JWT in milliseconds. + - `http_header`: The header in which the JWT will be sent. + - `API_KEY`: The event service will send an API key in the `Authorization` header of the request. The following are the supported configuration options: + - `http_header`: The header in which the API key will be sent. + +[default-values-file]: https://github.com/stellar/java-stellar-anchor-sdk/blob/develop/platform/src/main/resources/config/anchor-config-default-values.yaml +[clients-config]: ../../admin-guide/sep10/README.mdx#config-with-client-attribution diff --git a/ap_versioned_docs/version-2.8/admin-guide/getting-started.mdx b/ap_versioned_docs/version-2.8/admin-guide/getting-started.mdx new file mode 100644 index 0000000000..c434ee9a4d --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/getting-started.mdx @@ -0,0 +1,384 @@ +--- +title: "Getting Started" +sidebar_position: 30 +--- + +## Installation + +import { CodeExample } from "@site/src/components/CodeExample"; + +The easiest way to install the Anchor Platform is to pull the [docker image][anchor-platform-image]. + + + +```bash +docker pull stellar/anchor-platform:2.8.4 +``` + + + +## Set Up the Development Environment + +In this guide we'll use [docker compose][docker-compose] for simplicity, but you can run the Anchor Platform using other tools that support docker as well, such as [minikube] or a full-blown [kubernetes] cluster. + +Let's create a minimal compose file to get started. + + + +```yaml +# docker-compose.yml +services: + sep-server: + image: stellar/anchor-platform:2.8.4 + command: --sep-server + ports: + - "8080:8080" + env_file: + - ./dev.env + volumes: + - ./config:/home + platform-server: + image: stellar/anchor-platform:2.8.4 + command: --platform-server + ports: + - "8085:8085" + env_file: + - ./dev.env + volumes: + - ./config:/home +``` + + + +The `--sep-server` option tells the Anchor Platform to make the API endpoints defined by the SEPs you've enabled via configuration available on port 8080. + +The `--platform-sever` option makes the Platform API available, which is the backend API your service(s) will use to communicate with the Anchor Platform. It will be available on port 8085 + +## Configuration + +The Anchor Platform supports two approaches for configuration: + +- using environment variables +- using a YAML configuration file + +One or a combination of both approaches can be used. Nested variables in the YAML file are expressed using underscores or dots (`_`, `.`) when using environment variables. We'll demonstrate both approaches here, but use enviroment variables exclusively in subsequent sections. See the full set of configuration options in the Anchor Platform's [default values file][ap-default-values]. + +:::info + +The Anchor Platform does not allow application secrets in the YAML configuration file. Instead, application secrets, which all have the `SECRET_` prefix, must be specified in the environment. + +::: + +Lets create the environment file specified in our docker compose file. + + + +```bash +touch dev.env +``` + + + +And if you're using a YAML configuration file, lets create that too. + + + +```bash +mkdir config +touch config/dev.services.yaml +``` + + + +You'll need to inform the Anchor Platform where it can find your config file. So lets add an environment variable for that. + + + +```bash +# dev.env +STELLAR_ANCHOR_CONFIG=/home/dev.services.yaml +``` + + + +Specify the configuration schema version in your YAML file. + + + +```yaml +# dev.services.yaml +version: 1 +``` + + + +### Changing Port of the Platform Server + +For example, let's change port of the platform server. + +Using environment variables, this is simply: + + + +```bash +# dev.env +PLATFORM_SERVER_PORT=8085 +``` + + + +Or if using YAML configuration: + + + +```yaml +# dev.services.yaml +platform_server: + port: 8085 +``` + + + +### Specify Your Service's Assets + +Lets add the assets your Anchor Platform deployment will utilize. This configuration is specified in a YAML file. If you're only using the Anchor Platform for hosting a SEP-1 stellar.toml file or for running SEP-10 Stellar Authentication, you can skip this step. + + + +```bash +touch config/dev.assets.yaml +``` + + + +In this guide we'll build anchor services for Circle's USDC on Stellar's test network. Update the above values based on the assets you'll be issuing. Make sure to specify the testnet `issuer` in your development file, and create your own `distribution_account` using a tool like [Stellar Lab][stellar-lab]. The `distribution_account` will be used by your clients as the destination account for payments to your service. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 +``` + + + +This file needs to be referenced in our configuration so the Anchor Platform can find it. + +Using environment variables: + + + +```bash +# dev.env +ASSETS_TYPE=file +ASSETS_VALUE=/home/dev.assets.yaml +``` + + + +Using a YAML file: + + + +```yaml +# dev.services.yaml +assets: + type: file + value: /home/dev.assets.yaml +``` + + + +### Add Data Persistence + +The Anchor Platform supports [PostgreSQL][postgresql] and [Aurora PostgreSQL][aurora-postgresql] for use in production, but also supports [H2][h2] or [SQLite][sqlite] for use in development. For managing migrations, the Anchor Platform uses [Flyway][flyway]. The latest version of PostgreSQL supported by Flyway is PostgreSQL 14. + +Before we move forward, let's add a database to our development environment so the transactions we initiate persist after stopping the service. + +A database is only needed if using the Anchor Platform to facilitate transactions. + + + +```yaml +# docker-compose.yml +version: "3.8" +services: + sep-server: + image: stellar/anchor-platform:2.8.4 + command: --sep-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8080:8080" + depends_on: + - db + platform-server: + image: stellar/anchor-platform:2.8.4 + command: --platform-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8085:8085" + depends_on: + - db + db: + image: postgres:14 + ports: + - "5432:5432" + env_file: + - ./dev.env + volumes: + - ./init.sql:/docker-entrypoint-initdb.d/init.sql +``` + + + +Now let's update our environment so the platform server can connect to the database server. + + + +```bash +# dev.env +DATA_TYPE=postgres +DATA_SERVER=db +DATA_DATABASE=platform +DATA_FLYWAY_ENABLED=true + +SECRET_DATA_USERNAME=postgres +SECRET_DATA_PASSWORD=password + +POSTGRES_USER=postgres +POSTGRES_PASSWORD=password +``` + + + +If you're using YAML configuration instead, the `POSTGRES_` environment variables should always be in the environment, as they're for your database server, not the Anchor Platform. The secrets must also be specified in environment. + + + +```yaml +# dev.services.yaml +data: + type: postgres + server: db + database: platform + flyway_enabled: true +``` + + + +We have to create the `platform` database before the platform server can connect to it, so let's make a script to create our database. + + + +```bash +touch init.sql +``` + + + + + +```sql +-- init.sql +CREATE DATABASE platform; +``` + + + +Try to run the platform server in addition to the database. + + + +```bash +docker compose up +``` + + + +You should see the logs reporting a successful connection to the postgres database. + +### Configure Platform API Authentication + +To facilitate cross-border payments or deposit & withdrawal transactions, your business will need to fetch and update transaction records from the Anchor Platform's internal API. Currently, the `--sep-server` option makes public SEP APIs, while internal Platform API available on the Platform server, started by `--platform-server` option. Business should make Platform Server accessible only in the internal network, however it's possible to add authentication for accessing the internal Platform API. + +Add the following environment variables. + + + +```bash +# dev.env +PLATFORM_API_BASE_URL=http://platform-server:8085 +PLATFORM_API_AUTH_TYPE=jwt +SECRET_PLATFORM_API_AUTH_SECRET=[your jwt encryption key] +``` + + + +When making requests to the Platform API, add a JWT signed by the secret defined in your environment to the `Authorization` header as a bearer token. + +`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:2.8.4 + 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 +[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 diff --git a/ap_versioned_docs/version-2.8/admin-guide/overview.mdx b/ap_versioned_docs/version-2.8/admin-guide/overview.mdx new file mode 100644 index 0000000000..6972fa3b25 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/overview.mdx @@ -0,0 +1,36 @@ +--- +title: "Overview" +sidebar_position: 10 +--- + +The Anchor Platform is the easiest and fastest way to deploy [anchor services](/docs/learn/fundamentals/anchors) compatible with [Stellar Ecosystem Proposals (SEPs)](https://github.com/stellar/stellar-protocol/tree/master/ecosystem). + +The goal of the Anchor Platform is to handle all Stellar-specific functionality and requirements for running an anchor, allowing businesses to focus on the core business logic necessary to provide these services. + +The Anchor Platform accomplishes this by implementing the ecosystem's standardized APIs (SEPs) for wallets, exchanges, and other applications to consume, while offering a set of backend APIs for businesses to provide information specific to them, such as transaction fees, exchange rates, and off-chain transaction statuses. + +Below is a list of SEPs currently supported: + +- [SEP-1][sep-1]: [Stellar Info File][sep1-ap] +- [SEP-6][sep-6]: [Programmatic Deposit and Withdrawal][sep6-ap] +- [SEP-10][sep-10]: [Stellar Authentication][sep10-ap] +- [SEP-12][sep-12]: KYC API +- [SEP-24][sep-24]: [Hosted Deposit and Withdrawal][sep24-ap] +- [SEP-31][sep-31]: [Cross-Border Payments API][sep31-ap] +- [SEP-38][sep-38]: Anchor RFQ API + +The documentation for the Anchor Platform is a work in progress. Developers are welcome to dive into the code and existing documentation on the [GitHub repository][anchor-platform-github], or if you're looking to build an on & off-ramp service compatible with SEP-24, see our [getting started guide][sep24-ap]. + +[sep-1]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md +[sep-6]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md +[sep-10]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md +[sep-12]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md +[sep-24]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md +[sep-31]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md +[sep-38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md +[anchor-platform-github]: https://github.com/stellar/java-stellar-anchor-sdk +[sep1-ap]: ./sep1/README.mdx +[sep6-ap]: ./sep6/README.mdx +[sep10-ap]: ./sep10/README.mdx +[sep24-ap]: ./sep24/README.mdx +[sep31-ap]: ./sep31/README.mdx diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep1/README.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep1/README.mdx new file mode 100644 index 0000000000..72834e2a2d --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep1/README.mdx @@ -0,0 +1,66 @@ +--- +title: Stellar Info File +sidebar_position: 40 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Let's enable applications to learn more about your service by hosting a `stellar.toml` file at a standardized URL path. This file allows applications to find information about your business, the assets your services utilize, as well as the root URL paths for these services. We can host this file using the Anchor Platform. + +Let's create a file called `dev.stellar.toml` file using the contents below as a starting point. For the full set of attributes, see the [SEP-1 specification][sep-1]. + + + +```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" + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +Note that you'll 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. + +In your `dev.env` file, specify the following. + + + +```bash +# dev.env +SEP1_ENABLED=true +SEP1_TOML_TYPE=file +SEP1_TOML_VALUE=/home/dev.stellar.toml +``` + + + +This will tell the Anchor Platform that it should host the file specified by `SEP1_TOML_VALUE` at `./well-known/stellar.toml`. + +Alternatively, your `stellar.toml` file could be hosted using a proper static file server like [nginx]. As long as your info file includes the appropriate URLs pointing to the Anchor Platform, this will work just fine. + +[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 diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep10/README.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep10/README.mdx new file mode 100644 index 0000000000..485e404be0 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep10/README.mdx @@ -0,0 +1,143 @@ +--- +title: Stellar Authentication +sidebar_position: 50 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Enable Stellar Authentication + +Stellar-based wallet applications create authenticated sessions with Stellar anchors by proving they, or their users, have sufficient control over a Stellar account. Once authenticated, the wallet application uses a session token provided by the anchor in subsequent requests to the anchor's standardized services. + +The Anchor Platform supports this form of authentication with minimal configuration from the business. + + + +```bash +# dev.env +SEP10_ENABLED=true +SEP10_HOME_DOMAIN=localhost:8080 +SECRET_SEP10_SIGNING_SEED="a Stellar private key" +SECRET_SEP10_JWT_SECRET="a secret encryption key" +``` + + + +`SEP_10_HOME_DOMAIN` is the `home_domain` property used by [sep-10]. The configuration value must be equal to the host of the toml file. If you are hosting toml file via the Platform, (`SEP1_ENABLED` is set to `true`), toml file will be hosted on the SEP server. + +`SECRET_SEP10_SIGNING_SEED` is the private key to the public key you've specified as the `SIGNING_KEY` in your `stellar.toml` file. It will be used to sign authentication challenges presented to wallet applications, providing that you are in possession of the `SIGNING_KEY`. Wallets will check for this signature before signing and sending back the authentication challenge. + +`SECRET_SEP10_JWT_SECRET` is the encryption key that will be used to sign and verify the authentication tokens you issue to wallet applications after they or their users have proven control of their Stellar account. + +:::info + +By default, the Anchor Platform allows anyone with a Stellar account to authenticate with your services. If you'd like to only allow users of a particular wallet application to authenticate, or want to disallow specific users from authenticating, use the following environment variables. This is an optional feature and should only be added if it is a business requirement. + +::: + +## Config With Client Attribution + +`SEP10_CLIENT_ATTRIBUTION_REQUIRED` informs the Anchor Platform whether it should allow users of noncustodial wallets to authenticate without the wallet also identifying itself. + +`CLIENTS` is the list of outside wallet servers or clients for the Anchor server to safely communicate with. + + + +```bash +# dev.env +SEP10_CLIENT_ATTRIBUTION_REQUIRED=true +``` + + + + + +```yaml +clients: + # Each item in the list may contain the following fields: + # - name: (required) the name of the client + # - type: (required) `custodial` or `noncustodial` + # + # If the type is `custodial`, + # - signing_keys: (required) the custodial SEP-10 signing key of the client. + # - callback_url: (optional) the URL of the client's callback API endpoint. + # - allow_any_destination: (optional) default to false. If set to true, allows any destination for deposits. + # - destination_accounts: (optional) list of accounts allowed to be used for the deposit. If allows_any_destinations set to true, this configuration option is ignored. + # + # If the type is `noncustodial`, + # - domains: (required) the domains of the client. + # - callback_url: (optional) the URL of the client's callback API endpoint + + # custodial client + - name: custodial-client1 + type: custodial + signing_keys: "the signing key 1 of the client1","the signing key 2 of the client1" + callback_url: https://callback.custodial-client1.com/api/v1/anchor/callback + allow_any_destination: false + destination_accounts: destAccount1,destAccount2 + - name: custodial-client2 + type: custodial + signing_keys: "the signing key of the client2", + + # noncustodial client + - name: noncustodial-client1 + type: noncustodial + domains: noncustodial-client1.co,noncustodial-client1.com + callback_url: https://callback.noncustodial-client1.co/api/v2/anchor/callback + - name: noncustodial-client2 + type: noncustodial + domains: noncustodial-client2.com +``` + +```bash +# dev.env +# custodial client +CLIENTS[0]_NAME=custodial-client1 +CLIENTS[0]_TYPE=custodial +CLIENTS[0]_SIGNING_KEYS="the signing key 1 of the client1","the signing key 2 of the client1" +CLIENTS[0]_CALLBACK_URL=https://callback.custodial-client1.com/api/v1/anchor/callback +CLIENTS[0]_ALLOW_ANY_DESTINATION=false +CLIENTS[0]_DESTINATION_ACCOUNTS=destAccount1,destAccount2 +CLIENTS[1]_NAME=custodial-client2 +CLIENTS[1]_TYPE=custodial +CLIENTS[1]_SIGNING_KEYS="the signing key of the client2" + +# noncustodial client +CLIENTS[2]_NAME=noncustodial-client1 +CLIENTS[2]_TYPE=noncustodial +CLIENTS[2]_DOMAINS=noncustodial-client1.co,noncustodial-client1.com +CLIENTS[2]_CALLBACK_URL=https://callback.noncustodial-client1.co/api/v2/anchor/callback +CLIENTS[3]_NAME=noncustodial-client2 +CLIENTS[3]_TYPE=noncustodial +CLIENTS[3]_DOMAINS=noncustodial-client2.com +``` + + + +`SEP10_CLIENT_ATTRIBUTION_REQUIRED` informs the Anchor Platform whether it should allow users of noncustodial wallets to authenticate without the wallet also identifying itself. + +`CLIENTS` is the list of outside wallet servers or clients for the Anchor server to safely communicate with. + +## Modify a Stellar Info File + +Next, let's modify `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-10 functionality is supported by your business. + + + +```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" + +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +[sep1-ap]: ../sep1/README.mdx diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep24/README.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep24/README.mdx new file mode 100644 index 0000000000..4d78a93bbd --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep24/README.mdx @@ -0,0 +1,10 @@ +--- +title: Hosted Deposits and Withdrawals +sidebar_position: 60 +--- + +import DocCardList from "@theme/DocCardList"; + +SEP-24 allows for a means by which wallets and/or exchanges allow the user to directly interact with an on & off-ramp. + + diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep24/configuration.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep24/configuration.mdx new file mode 100644 index 0000000000..3c6d294c8e --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep24/configuration.mdx @@ -0,0 +1,190 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Modify a Stellar Info File + +Next, let's modify `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-24 functionality is supported by your business, and they also need to know all 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_SEP0024 = "http://localhost:8080/sep24" +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" + +# Optionally, add support for XLM +[[CURRENCIES]] +code = "native" +status = "test" +is_asset_anchored = false +anchor_asset_type = "crypto" +desc = "XLM, the native token of the Stellar network." + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +Note that you'll 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 Hosted Deposits & Withdrawals + +Now you're ready to enable hosted deposits and withdrawals via the SEP-24 API. Specify the following in your `dev.assets.yaml` file, and change the values depending on your preferences. This example asset file will enable support for Circle's USDC and a fiat USD. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep24_enabled: true + deposit: + enabled: true + withdraw: + enabled: true + - schema: iso4217 + code: USD + significant_decimals: 2 + deposit: + enabled: true + withdraw: + enabled: true + # Optional support for XLM + - schema: stellar + code: native + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 7 + sep24_enabled: true + deposit: + enabled: true + withdraw: + enabled: true +``` + + + +The information provided for the `assets` value closely maps to the information that will be exposed to the wallet application using the [`GET /info`][sep24-get-info] SEP-24 endpoint. The Anchor Platform also uses this information to validate requests made to your service. + +Add the following variables to your environment file. + + + +```bash +# dev.env +SEP24_ENABLED=true +SEP24_INTERACTIVE_URL_BASE_URL=http://example.com +SEP24_MORE_INFO_URL_BASE_URL=http://example.com +SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET="your encryption key shared with your business server" +SECRET_SEP24_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" +``` + + + +`SEP24_INTERACTIVE_URL_BASE_URL` is the URL that the Anchor Platform will provide to wallet applications when they initiate transactions. Wallet applications will open this URL in a web view inside their app, handing over control of the user experience from the wallet to your business. This URL points to the web widget your business implements. It contains all business-defined logic. We'll dive further into this experience in subsequent sections. + +`SEP24_MORE_INFO_URL_BASE_URL` is the URL that the Anchor Platform will provide to wallet applications when they want to show information about a transaction initiated previously. This URL is most often used by wallets in their transaction history views, and your business can define what information to display about the transaction. + +`SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET` and `SECRET_SEP24_MORE_INFO_URL_JWT_SECRET` are encryption keys that the Anchor Platform will use to generate short-lived tokens it will add to the URLs provided to the wallet. Your business server must also have these keys in its environment so it can verify the token's signature. + +## 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" + +SEP24_ENABLED=true +SEP24_INTERACTIVE_URL_BASE_URL=http://localhost:8081 +SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET="your encryption key shared with your business server" +SECRET_SEP24_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" +``` + + + +To test this out, go to the [Stellar Demo Wallet][stellar-demo-wallet]. + +[![demo wallet connected to the anchor platform](../../assets/anchor-platform-sep24-demo-wallet.png)](../../assets/anchor-platform-sep24-demo-wallet.png) + +Initiate a 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-24 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. However, when the demo wallet attempts to open the URL provided by the Anchor Platform, you'll get a not found page. + +[![demo wallet after initiating a transaction](../../assets/anchor-platform-sep24-demo-wallet-widget.png)](../../assets/anchor-platform-sep24-demo-wallet-widget.png) + +[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 +[sep1-ap]: ../sep1/README.mdx diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep24/example.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep24/example.mdx new file mode 100644 index 0000000000..7c424f535b --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep24/example.mdx @@ -0,0 +1,438 @@ +--- +title: "Example" +sidebar_position: 40 +--- + +Integrating with the Anchor Platform involves three key areas: + +- Building a web-based user experience that can be opened in a mobile web view +- Providing transaction status updates to the Anchor Platform +- Fetching transaction status updates from the Anchor Platform + +## Building a Web-Based User Experience + +The Anchor Platform does not offer a white-label UI that your business can utilize, and instead expects the business to build their own UI and backend system. We won't build an entire on & off-ramp user experience in this guide, but will cover the ways in which your existing product should be updated to be compatible with the Anchor Platform. + +### Authentication + +If your business has an existing on & off-ramp product, you likely have an existing system for user authentication. However, because the Anchor Platform authenticates the user prior to providing the business's URL, requiring the user to go through another form of authentication is actually unnecessary. In this way, the Anchor Platform can be thought of as providing an alternative form of authentication. + +The business is free to continue requiring users to authenticate using their existing system, but the ideal user experience would skip this step and create an authenticated session for the user if they have already authenticated using their Stellar account. + +The Anchor Platform adds a JWT `token` query parameter to the business's URL given to the wallet application. This token is signed by the previously-configured `SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET` value, and includes the information you need to identify the user. The process should look something like this: + +1. Pass the `token` added to the URL of your backend system +2. Verify the signature on the `token` and check its expiration +3. Create an authenticated session for the user identified by `token.sub` + +The decoded contents of the `token` will look something like this: + + + +```json +{ + "jti": "e26cf292-814f-4918-9b40-b4f76a300f98", + "sub": "GB244654NC6YPEFU3AY7L25COGES445P3Q63W6Q76JHR3UBJMLT2XBOB:1234567", + "exp": 1516239022, + "data": { + "first_name": "John", + "last_name": "Doe", + "email": "johndoe@example.com" + } +} +``` + + + +Note that the `sub` value identifies the user using a Stellar account and integer. This is what the value will be when custodial applications that use an omnibus account authenticate with your service. When non-custodial wallets authenticate, the token may look slightly different. + + + +```json +{ + "jti": "e26cf292-814f-4918-9b40-b4f76a300f98", + "sub": "GB244654NC6YPEFU3AY7L25COGES445P3Q63W6Q76JHR3UBJMLT2XBOB", + "exp": 1516239022, + "data": { + "client_domain": "api.vibrantapp.com", + "first_name": "John", + "last_name": "Doe", + "email": "johndoe@example.com" + } +} +``` + + + +The `sub` value here only contains a public key to identify the user, and the `data.client_domain` field identifies the wallet application used to authenticate. + +In both cases, all information in the `data` object is optional, and will only be present if the wallet provides that information. + +Let's add a backend server to our compose file that will be used to verify the token and create authenticated web sessions for users initiating transactions. + + + +```yaml +# docker-compose.yaml +--- +business-server: + build: . + ports: + - "8081:8081" + env_file: + - ./dev.env + depends_on: + - platform-server +``` + + + +Let's create a simple Docker container for our application. + + + +```docker +FROM node:19 + +WORKDIR /home +COPY . . +RUN npm install + +CMD ["node", "server.js"] +``` + + + +Now let's create a minimal NodeJS application. + + + +```bash +yarn init -y +yarn add express jsonwebtoken +touch server.js +``` + + + +Below is an example of a backend server authenticating a user using NodeJS. + + + +```js +# server.js +const express = require("express"); +const jwt = require("jsonwebtoken"); +const app = express(); +const port = process.env.BUSINESS_SERVER_PORT; + +app.use(express.json()); + +/* + * We'll store user session data in memory, but production systems + * should store this data somewhere more persistent. + */ +const sessions = {}; + +/* + * Create an authenticated session for the user. + * + * Return a session token to be used in future requests as well as the + * user data. Note that you may not have a user for the stellar account + * provided, in which case the user should go through your onboarding + * process. + */ +app.post("/session", async (req, res) => { + let decodedPlatformToken; + try { + decodedPlatformToken = validatePlatformToken(req.body.platformToken); + } catch (err) { + res.status = 400; + res.send({ "error": err }); + return; + } + let user = getUser(decodedPlatformToken.sub); + let sessionToken = jwt.sign( + { "jti": decodedPlatformToken.jti }, + process.env.SESSION_JWT_SECRET + ); + sessions[sessionToken] = user; + res.send({ + "token": sessionToken, + "user": user + }); +}); + +/* + * Validate the signature and contents of the platform's token + */ +function validatePlatformToken(token) { + if (!token) { + throw "missing 'platformToken'"; + } + let decodedToken; + try { + decodedToken = jwt.verify(token, process.env.SECRET_SEP10_JWT_SECRET); + } catch { + throw "invalid 'platformToken'"; + } + if (!decodedToken.jti) { + throw "invalid 'platformToken': missing 'jti'"; + } + return decodedToken; +} + +/* + * Query your own database for the user based on account:memo string parameter + */ +function getUser(sub) { + return null; +} + +app.listen(port, () => { + console.log(`business server listening on port ${port}`); +}); +``` + + + +Run this with the platform server and database and initiate a new transaction with the [demo wallet][stellar-demo-wallet]. Then, we'll send the token to our server. + + + +```bash +curl \ + -X POST \ + -H 'Content-Type: application/json' \ + -d '{"platformToken": ""}' \ + http://localhost:8081/session | jq +``` + + + +## Providing Updates to the Platform + +Let's create an endpoint for our business server that accepts the information collected in our UI. + + + +```js +# server.js + +// Production systems should either let the Anchor Platform generate its own memos +// or have your custodial service generate a memo for each transaction. +const transactionMemos = {}; + +app.post("/transaction", async (req, res) => { + let sessionToken; + try { + sessionToken = validateSessionToken(req.headers.get("authorization")); + } catch (err) { + res.status = 400; + res.send({ "error": err }) + return; + } + // assuming this is a withdrawal transaction, we'll provide a memo, which is + // required by our third-party custodian to credit us the payment. When the + // payment is made with this memo, we can match the on-chain payment with the + // transaction in the Anchor Platform's database. + transactionMemos[req.body.transaction.id] = parseInt(Math.random() * 100000); + let rpcRequestBody = [ + { + "id": 1, + "jsonrpc": "2.0", + "method": "request_onchain_funds", + "params": { + "transaction_id": req.body.transaction.id,, + "message": "waiting for the user to provide off-chain funds.", + "amount_in": { + "amount": req.body.amount_in.amount, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": req.body.amount_out.amount, + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": req.body.amount_fee.amount, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "destination_account": "GD...G", + "memo": transactionMemos[req.body.transaction.id], + "memo_type": "id" + } + } + ]; + let platformResponse; + try { + platformResponse = await updatePlatformTransaction(rpcRequestBody); + } catch (err) { + res.status = 500; + res.send({ "error": err }) + return; + } + res.send({ + "transaction": platformResponse.records[0] + }); +}); + +function validateSessionToken(authorizationHeader) { + let parts = authorizationHeader.split(" "); + if (parts.length != 2 || parts[0] != "Bearer") { + throw "invalid authorization header format"; + } + let sessionToken = parts[1]; + try { + jwt.verify(sessionToken, process.env.SESSION_JWT_SECRET); + } catch { + throw "invalid session token"; + } + if (!sessions[sessionToken]) { + throw "expired session"; + } + return sessionToken; +} + +async function updatePlatformTransaction(requestBody) { + let response = await fetch( + `${process.env.PLATFORM_SERVER}`, + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(requestBody) + } + ); + if (response.status != 200) { + throw `unexpected status code: ${response.status}`; + } + return await response.json(); +} +``` + + + +This will update the Anchor Platform's database with the information provided and enable wallet applications to fetch this updated information so it can relay it back to the user. You should have already informed the user of the transaction's amounts and that your business's is waiting for the on-chain payment to arrive, but providing these updates allows users to view their transactions' statuses through their mobile application without opening the business' UI again. + +:::note + +At this time, the Anchor Platform does not send notifications to the wallet application when transaction statuses change, however, it is on our roadmap to add these notifications or "callback requests" so that wallet applications do not have to poll the Anchor Platform for updates. + +::: + +## Fetching Updates from the Platform + +If you only use the Anchor Platform to expose the SEP APIs to wallet applications, then you won't have a strong reason for fetching transaction status updates from the Anchor Platform, mostly because it won't update the transaction status until you make `JSON-RPC API` requests. + +However, if you use the Anchor Platform to monitor the Stellar network for incoming payments (associated with withdrawal transactions), the Anchor Platform will update transaction statuses when payments are received. + +There are two ways to fetch updates from the Anchor Platform, + +- Polling the Platform API's `GET /transactions/:id` endpoint for the transactions you're expecting a payment for +- Streaming transaction status change events from a Kafka cluster + +While streaming transaction status changes from a Kafka cluster may be a more robust and scalable approach, we're going to use the polling method in this guide. Setting up and using a Kafka cluster will be the subject of a different section of the docs. + +First, let's configure the Anchor Platform to observe the Stellar network for incoming payments. + + + +```yaml +# docker-compose.yml +--- +stellar-observer: + image: stellar/anchor-platform:2.8.4 + command: --stellar-observer + env_file: + - ./dev.env + volumes: + - ./config:/home + depends_on: + - db +``` + + + +The `--stellar-observer` command starts a process that monitors the distribution accounts configured in your `config.yaml` file for withdrawal payments. + +If a payment is sent to one of these accounts and the memo attached to the transaction matches a `memo` value provided or generated by the Anchor Platform, the Anchor Platform will consider the transaction that memo is associated with as received and update the transaction's status to `pending_anchor`. It does this by making a `JSON-RPC API` request, so we need to configure the URL it should use. + + + +```bash +# dev.env +PLATFORM_API_BASE_URL=http://platform-server:8085 +``` + + + +Let's make some additions to the `server.js` file so we can poll the Anchor Platform for our expected payments. + + + +```js +// server.js +... +/* + * Fetch the transaction data from the Platform API + * + * Production systems should have proper retry mechanisms. + */ +async function getPlatformTransaction(transactionId) { + let response = await fetch(`${process.env.PLATFORM_SERVER}/transactions/${transactionId}`) + if (response.status != 200) { + throw `unexpected status code: ${response.status}`; + } + return await response.json(); +} + +(async () => { + while (true) { + await new Promise(r => setTimeout(r, 2000)); + let requestPromises; + for (const transactionId in transactionMemos) { + requestPromises.push(getPlatformTransaction(transactionId)) + } + let transactions = await new Promise.all(requestPromises); + for (const transaction in transactions) { + // assuming all requests were successful + if (transaction.status == "pending_anchor") { + // initiate off-chain delivery of funds + console.log(`received payment for transaction ${transaction.id}`); + } + } + } +})() +``` + + + +## Full Example Implementation + +Stellar provides an example business server implementation for SEP-24. It's split into two parts: 1) a web UI, accessible for the end user; and 2) a back-end implementation, used to get and push updates from/to the Anchor Platform. + +The code for web UI can be found [here][sep-24-ref-ui] + +The code for the backend is a part of the Anchor Platform, and is available as a [submodule][sep-24-ref]. + +[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 diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep24/faq.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep24/faq.mdx new file mode 100644 index 0000000000..5972a06cf9 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep24/faq.mdx @@ -0,0 +1,39 @@ +--- +title: "FAQ" +sidebar_position: 50 +--- + +### How To Use JWTs? + +As part of the flow, once a user makes a request, i.e. an interactive withdrawal/deposit request, it will be processed by the Anchor Platform and forwarded to your service. The Anchor Platform will make a `GET` call to `?token=`. + +This JWT token will contain: + +1. `exp` is the expiration time of the token. You should check that the provided token has not expired. +2. `sub` is the account associated with this transaction. It can be used to identify the user account. Note that this value may be different from the account that will be used to receive/send funds. +3. `jti` is the hash of the transaction. +4. `data` is the extra payload that has been set by the user. It will always contain the Stellar `asset` wants to deposit or withdraw. If provided by the client, it will also contain the `amount` the user wants to transact, the `client_domain` of the wallet verified during SEP-10 authentication, and `client_name` (defined as 'name' in [clients] configuration if provided), and the `lang` (language) preference of the user. + +### How To Provide Fees? + +Currently, it's recommended to provide fees/exchange rates in the iFrame/web view of your application. + +[SEP-24] standard provides a `/fee` endpoint to allow businesses to set static fees for their transactions. However, it's not currently supported by the Anchor Platform. + +:::note + +/fee endpoint will be deprecated in the future. + +::: + +### How to identify the user account? + +You should use the `sub` field of the JWT token. For custodial wallets, this value will be in the format `account:memo`. Use the memo to identity the user. For noncustodial wallets, simply use the `sub` value itself, which will be equal to the user account. + +### How to identify the wallet? + +Utilize the `data.client_domain` attributes within the JWT token. In the presence of [clients] configuration, the JWT token will additionally incorporate the `data.client_name` field, enabling wallet identification. + +[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 +[clients]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep24/getting-started.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep24/getting-started.mdx new file mode 100644 index 0000000000..ce1d1dbf46 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep24/getting-started.mdx @@ -0,0 +1,33 @@ +--- +title: "Getting Started" +sidebar_position: 10 +--- + +This guide will walk you through configuring and integrating with the Anchor Platform for the purpose of building an on & off-ramp service compatible with [SEP-24][sep-24], the ecosystem's standardized protocol for hosted deposits and withdrawals. + +By leveraging the Anchor Platform's support for SEP-24, businesses make their 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-24: [SEP-1 (Stellar Info File)][sep1-ap] and [SEP-10 (Stellar Authentication)][sep10-ap] + +## The Basic User Experience + +The complete customer experience a deposit and withdrawal goes something like this: + +1. The customer opens the SEP-24 wallet application of their choice +2. The customer selects an asset to deposit and the wallet finds an anchor (clients could also chose 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 (e.g. makes a 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 wallet opens the given interactive URL and allows the customer to enter their transaction information (KYC has already been 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 bank transfer. + +[sep-24]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md +[installation-ap]: ../../admin-guide/getting-started.mdx +[sep1-ap]: ../sep1/README.mdx +[sep10-ap]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep24/integration.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep24/integration.mdx new file mode 100644 index 0000000000..a396e9c44d --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep24/integration.mdx @@ -0,0 +1,1009 @@ +--- +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 Anchor Platform about events related to the transaction. + +In general, you'll want to provide updates for the following events: + +- Your business is processing the KYC information provided by the user +- 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 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 this 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-24 protocol document][sep-24] + +## Securing Platform API + + + +### Using API Key + + + +### Using JWT + + + +## Making JSON-RPC Requests + + + +### JSON-RPC Request + + + +### JSON-RPC Response + + + +### Error Codes + + + +## Updating Deposit Transaction Via JSON-RPC + +SEP-24 deposit flow diagram defines sequence/rules of the transaction's status transition and a set of JSON-RPC methods 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. + +[![sep24 deposit flow](../../assets/sep24-deposit-flow-diagram.png)](../../assets/sep24-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. + +::: + +### Ready to Receive Funds + +The first step of the deposit flow after starting the deposit itself is collecting KYC. It's usually done in the web-app, but can also be optionally provided by the wallet application, using [SEP-9]. Once the necessary KYC is collected, a `request_offchain_funds` JSON-RPC request should be made. + + + +```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 + } + } + } +] +``` + + + +- `amount_in` is the amount the user has to sent 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. + +Information abouts amounts (in/out/fee) is required if you want to move the transaction from the `incomplete` to the `pending_user_transfer_start` status. If transaction status is changed from `pending_anchor` to `pending_user_transfer_start`, you can skip defining the amounts. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh request-offchain-funds.json +``` + + + +:::tip + +When the KYC process is long (for example, ID verification), it's advised to first set the transaction status to `pending_anchor` by using `notify_interactive_flow_completed` JSON-RPC request. This will indicate to the user that KYC is being processed. + +::: + +### Processing KYC Information + +:::tip + +This step is optional. Most businesses don't use it. You can skip it and go to the [next step](#funds-received). + +Using this status is recommended when KYC verification may need to be performed asynchronously. + +::: + +You **must** specify the `amount_x` fields. + + + +```json +// kyc-in-process.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_interactive_flow_completed", + "params": { + "transaction_id": "", + "message": "Interactive flow completed.", + "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 + } + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh kyc-in-process.json +``` + + + +### Funds Received + +If offchain funds were received, you'll want to provide an 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 from previous JSON-RPC requests will be taken. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh offchain-funds-received.json +``` + + + +### Waiting For User Funds + +In a 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 a user request. After the transaction completion, 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. To make a payment via custody service, it's necessary to 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/learn/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, it's necessary to 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. + +::: + +### 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. + + + +```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 + +It's similar to [Refund sent](#refund-sent), but it handles a 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 a good practice to clean up inactive transactions in the `incomplete` status. To do so, simply change the transaction status to `expired`. + + + +```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. + +::: + +### On-Hold Transaction + +In rare cases, you may want to pause current transaction and request more information from the user (after the transfer has been received). This could be used for compliance use cases. + + + +```json +// transaction-hold.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_transaction_on_hold", + "params": { + "transaction_id": "", + "message": "Transaction is on hold. Please contact customer support to resolve the hold." + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh transaction-hold.json +``` + + + +### 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, it's necessary to 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 Transaction Via JSON-RPC + +This diagram defines a sequence/rules of transaction's status transition for SEP-24 withdrawal flow. + +[![sep24 withdrawal flow](../../assets/sep24-withdrawal-flow-diagram.png)](../../assets/sep24-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 deposit 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 + +Similar to deposit, the next step 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 update will look differently. + + + +```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" + } + } +] +``` + + + +- `memo` Value of memo to attach to the transaction +- `memo_type` Type of memo that the anchor should attach to the transaction +- `destination_account` Destination account + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh request-onchain-funds.json +``` + + + +:::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. + +::: + +### Processing KYC Information + +This step is optional, and it's similar to [Processing KYC Information](#processing-kyc-information) of the deposit flow. + +### 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 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 +``` + + + +### 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 +``` + + + +### 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. + +### On-Hold Transaction + +Works in the same manner as for the deposit flow. For more details, see [On-Hold Transaction](#on-hold-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 + + + +[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 +[json-rpc-methods]: ../../api-reference/platform/rpc/methods/README.mdx diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep24/setting-up-production-server.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep24/setting-up-production-server.mdx new file mode 100644 index 0000000000..f631e5dbf3 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep24/setting-up-production-server.mdx @@ -0,0 +1,112 @@ +--- +title: Set Up a Production Server +sidebar_position: 60 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Once the test server is live and you have tested both deposit and withdraw flows, it's time to get started with the real deploy connected to real KYC and real banking rails providers. Before using any banking APIs, it's critical that you perform a full security audit on the system to make sure that there aren't any vulnerabilities. + +## Deploying a Secure Environment + +Make sure to keep the test server up, and deploy the production (mainnet) system in a separate environment. Having two deploys allows you to validate new features on the testnet before moving them to the final production deploy. You can also have a third staging environment if there's a big team working on this codebase and/or there will be many pushes to be tested internally before sharing with other institutions. + +To switch to Stellar's public (mainnet) network, all you have to do is change the network [passphrase](/docs/learn/encyclopedia/network-configuration/network-passphrases) (for authenticating requests) and [Horizon URL](https://horizon.stellar.org/). + +You can copy your existing development configs to create a production configuration. + +First, you need to change your info file (`stellar.toml`): + + + +```toml +# stellar.toml +NETWORK_PASSPHRASE = "Public Global Stellar Network ; September 2015" +``` + + + +Next, change your Anchor Platform configuration in `production.env` file: + + + +```bash +# production.env +STELLAR_NETWORK_NETWORK="Public" +STELLAR_NETWORK_HORIZON_URL=https://horizon.stellar.org +``` + + + +## Connecting to Real KYC + +Most anchors need to collect [Know Your Customer](https://en.wikipedia.org/wiki/Know_your_customer) information to comply with local regulations before honoring deposits and withdrawals. The KYC flow usually consists of a simple form that gathers relevant information about the user such as name, email, address, age, and government-issued ID number. + +How you handle KYC is up to you: there are many services that provide KYC solutions through APIs and iFrames, and validate the input data and sync with governmental databases to verify requirements. Each jurisdiction has specific KYC requirements, and they differ from jurisdiction to jurisdiction, so it's best to find a country-specific KYC provider that meets your needs. + +Some countries require different KYC fields depending on the amount to be deposited or withdrawn. If that's the case in your jurisdiction and you need to adapt your KYC forms based on the deposit or withdrawal amount, simply add an amount field before the KYC form, and make sure that the KYC fields are updated based on that value. + +KYC information should be linked to the session created through [Stellar Web Authentication](../sep10/README.mdx) and, consequently, to the user, so you only need to ask the user for it once. After the first KYC flow is complete, a user shouldn't have to input the information again. + +Make sure the errors and validation messages are clear and include instructions for what to do next to ensure a good user experience and increase the KYC conversion rate. You should also localize messages based on the user's language and location. + +## Pre-Filling the KYC Form + +Pre-filling the KYC form is a great way to reduce the friction of getting started using an anchor, and wallets usually provide a set of fields that are commonly used throughout the ecosystem. In summary, the anchor can render the KYC form with the user's values that were previously sent by the wallet in the `/transactions/deposit/interactive` and `/transactions/withdraw/interactive` endpoints. + +All fields from [SEP-9](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0009.md) can be sent by wallets in the previously mentioned endpoints, but the most common are: email, first name, last name and phone number. Also, you should still enable the pre-filled fields to be editable, since the user might have inputted a different name in the Wallet's sign-up process, and could want to edit it before finalizing the Anchor's KYC process. + +All SEP-9 data that was sent from the wallet is a part of the [Interactive JWT](./faq.mdx#how-to-use-jwts), send by the Anchor Platform + +## Connecting to Real Banking Rails + +Fiat-backed token issuers are expected to manage a full reserve. That means there's a 1:1 relationship between Stellar-network tokens and money in the bank. Since each fiat token on Stellar is backed by, and can be redeemed for, an underlying, real-world asset, issuers of fiat-backed tokens need to connect to real banking rails to validate user deposits (through bank transfers, credit card payments, etc.) and to complete user withdrawals (generally through bank transfers). If you're an anchor honoring deposits and withdrawals of a token another organization issues, you'll follow a similar process. + +In order to fetch (and identify) a user transfer, issuers usually take one of two approaches: + +- API Polling: this option consists of fetching the bank's API, through a cron job, to check for the updated status of the list of transfers received by (and sent from) the issuer's bank account. Once the system confirms a new transaction and identifies that it relates to a specific deposit, it can send the digital funds to that user's account +- Webhook: not all banking rails support this option, but it's the leanest in terms of back-end logic. In this approach, the bank proactively hits an issuer's endpoint once it receives a new transfer, updating that information on the issuer's database. The issuer can then can match that transaction to an existing in-process deposit, and validate that the user can receive their digital funds + +There are many ways to identify that a specific bank transfer relates to a specific deposit (and, consequently, to a user). Some banks (and countries) have transfer infrastructure that allows the creation of a single bank account per transfer; others require users to add an identification parameter to their transfers. Some banks provide the user ID number in the transaction information so issuers can match that with the information provided in the KYC form. + +Make sure to do a full security audit on your systems when banking rails connections are in place. Some banks provide a testing API that can be used for development and deployment to testnet or staging environments, which means you can test and audit the codebase before moving to a final production-ready bank integration. For better security, some anchors also prefer to add a manual final step before approving withdrawal transfers. In terms of UX, this manual approval is acceptable as long as the wait times align with user expectations, which usually means they aren't longer than a couple of hours. + +## Testing Edge Cases + +Once your application is fully functional, it's a good idea to test different scenarios and edge cases to make sure the system is behaving as expected. Here's a list of testing suggestions that should cover a large amount of the application's edge cases: + +### General Tests + +- Test the interactive flow usability +- Test the interface using different locale information, and check for translated content including error messages, responses, date formatting, and number formatting + +### KYC Tests + +- Check that KYC appears with a new wallet SK +- Check that KYC doesn't accept incorrectly formatted inputs, and that the error messages are comprehensible +- Check that you can use the same KYC information (email, phone number, username, etc) multiple times +- Check that you can go through KYC multiple times with the same Stellar SK. + +### Interactive Test + +- Check that the deposit flow goes through, and that the banking rails are working +- Check that you cannot make a withdrawal with a value higher than the current balance +- Check that the withdrawal flow goes through, and that the banking rails are working + +### Security Tests + +- Make sure platform endpoints are secured + +## Polishing and Internationalization + +Supporting two languages (English and the fiat currency country language) allows users to have a seamless experience while navigating through screens, and supports international institutions (like wallets) that need to test the product before starting new integrations. + +You can support multiple languages in your webapp by using the `Accept-Language` parameter from the http request headers to localize the content and allowing users to change that in a simple way (e.g. a flag icon on the top bar). If a specific wallet doesn't send the header parameter, we recommend showing the user a language selection screen in the beginning of the deposit and withdraw processes. Once a user chooses a language, you can store their selection so you only need to ask them once. In addition to localizing text, make sure to check number formatting, dates, etc. + +Having a group of beta testers is a great way to check if there are any edge cases that need polishing, and to confirm that the system is working well with a variety of user inputs. You can beta test using a soft launch stage before you start putting effort into marketing and distribution. Documenting the testing process with screenshots and videos is very helpful for future security audits, and gives new partners and potential users clarity and confidence in the product. + +## Connecting to Wallets + +All Anchor user interactions are done through a Wallet, so it's vital for Anchors to be connected to Wallets that have a good market penetration in the region where the business is most focused. Connecting to Wallets is a simple process, since both ends of that integration are already compliant with SEPs. + +Stellar.org maintains a [list of wallets](https://www.stellar.org/ecosystem/projects), many of which currently support SEP-24 Sending them a message with more information on an asset and an issuer account is a great way to start getting some real users to the Anchor. diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep31/README.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep31/README.mdx new file mode 100644 index 0000000000..3cf13af916 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep31/README.mdx @@ -0,0 +1,10 @@ +--- +title: Cross-Border Payments +sidebar_position: 70 +--- + +import DocCardList from "@theme/DocCardList"; + +SEP-31 allows for a means by which wallets and/or exchanges interact with Stellar's existing set of send-side services. + + diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep31/configuration.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep31/configuration.mdx new file mode 100644 index 0000000000..d68d781de3 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep31/configuration.mdx @@ -0,0 +1,382 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Modify a Stellar Info File + +Let's start by modifying our `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-31 functionality is supported by your business, and they also need to know all 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" + +DIRECT_PAYMENT_SERVER = "http://localhost:8080/sep31" +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" + +[[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'll 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 Cross Border Payments + +Now you're ready to enable cross-border payments the SEP-31 API. Specify the following in your `dev.assets.yaml` file. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep31_enabled: true + sep31: + quotes_supported: true + quotes_required: true + fields: + transaction: {} + send: + min_amount: 0 + max_amount: 10000 +``` + + + +The information provided in the `sep31` and `send` objects closely map to the information that will be exposed to the wallet application using the [`GET /info`][sep31-get-info] SEP-31 endpoint. The Anchor Platform also uses this information to validate requests made to your service. `sep31.fields.transaction` should be left empty and will be removed in a future release, but you can adjust the `send.min_amount` and `send.max_amount` values according to your service's limits. + +The `sep31.quotes_supported` and `sep31.quotes_required` determine whether or not sending organizations can and are required to request an FX rate using the [SEP-38 `POST /quote`][sep38-post-quote] endpoint. Almost all senders prefer this approach so that they can communicate the rate to their customers prior to proceeding. + +Add the following variable to your environment file. + + + +```bash +# dev.env +SEP31_ENABLED=true +``` + + + +Senders should now be able to discover, authenticate, and initiate transactions with your service! Run the following command to start the Anchor Platform. + + + +```bash +docker compose up +``` + + + +Check that your API is live. + + + +```bash +curl http://localhost:8080/sep31/info | jq +``` + + + +You should get the following. + + + +```json +{ + "receive": { + "USDC": { + "enabled": true, + "quotes_supported": true, + "quotes_required": true, + "min_amount": 0, + "max_amount": 10000, + "fields": { + "transaction": {} + } + } + } +} +``` + + + +## Enable the Customer KYC API + +Businesses need to collect and validate KYC information on the customers they're facilitating transactions for. Clients determine what KYC information needs to be collected and send that information via a SEP-12 KYC API hosted by the Anchor Platform, but the Anchor Platform never stores personally-identifiable information (PII). Instead, it forwards requests from clients to the business server, and returns the business' responses back to the client, acting as a proxy server. + +See the [Anchor Platform KYC API specification][platform-api-kyc] for details on the endpoints that must be implemented on your business' server. + +To make this API available to clients, lets add the service URL to our Stellar Info File. + + + +```toml +# dev.stellar.toml +KYC_SERVER = "http://localhost:8080/sep12" +``` + + + +Lets enable it in our environment too. + + + +```bash +# dev.env +SEP12_ENABLED=true +``` + + + +Finally, we have to define your business' customer types. Each type of customer requires different a set of KYC information. For example, you can offer your cross-border payments service in two distinct regulatory jurisdictions, so customers in different jurisdictions have different KYC requirements and would be represented using different types. + +:::info + +Currently, customer types must be mutually exclusive, meaning a customer cannot be more than one type. + +This limitation is in place because the Anchor Platform cannot validate whether a customer is approved for a specific type of transaction, such as one sending a large amount. It can only validate that a customer is approved for one of the customer types defined. This limitation will be removed in a future release. + +::: + +In this guide, we'll only have two types, a sending customer type and a receiving customer type. Currently, our customer types are defined in our assets configuration, but this will change in a future release. + + + +```yaml +# dev.assets.yaml +sep31: + sep12: + sender: + types: + sep31-sender: + description: customers sending to recipients + receiver: + types: + sep31-receiver: + description: customers receiving from senders +``` + + + +Let's ping the info endpoint again to verify. After `docker compose up`, run the following command: + + + +```bash +curl http://localhost:8080/sep31/info | jq +``` + + + +You should get the following: + + + +```json +{ + "receive": { + "USDC": { + "enabled": true, + "quotes_supported": true, + "quotes_required": true, + "min_amount": 0, + "max_amount": 10000, + "fields": { + "transaction": {} + }, + "sep12": { + "sender": { + "types": { + "sep31-sender": { + "description": "customers sending to recipients" + } + } + }, + "receiver": { + "types": { + "sep31-receiver": { + "description": "customers receiving from senders" + } + } + } + } + } + } +} +``` + + + +## Enable the RFQ API + +Businesses need to provide their send-side counterparts with a [Rate][get-rates-api] API to check the exchange rates they're offering between the on-chain asset being used for settlement and the fiat asset being used to pay the recipient. If the rate is competitive, senders also need to be able to request a commitment to the rate currently being offered from business for a short period of time. + +The Anchor Platform provides the [SEP-38 RFQ API][sep38] to senders for this purpose. + +To make this API available to clients, lets add the service URL to our Stellar Info File. + + + +```toml +# dev.stellar.toml +DIRECT_PAYMENT_SERVER = "http://localhost:8080/sep31" +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" +KYC_SERVER = "http://localhost:8080/sep12" +QUOTE_SERVER = "http://localhost:8080/sep38" +``` + + + +Lets enable it in our environment too. + + + +```bash +# dev.env +SEP38_ENABLED=true +``` + + + +We also need to enable USDC to be used in this API, as well as add an off-chain asset it can be exchanged with. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep31_enabled: true + sep38_enabled: true + send: + min_amount: 0 + max_amount: 10000 + sep31: + quotes_supported: true + quotes_required: true + fields: + transaction: {} + sep12: + sender: + types: + sep31-sender: + description: customers sending to recipients + receiver: + types: + sep31-receiver: + description: customers receiving from senders + sep38: + exchangeable_assets: + - iso4217:BRL + country_codes: + - BRA + - schema: iso4217 + code: BRL + sep38_enabled: true + sep38: + exchangeable_assets: + - stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + country_codes: + - BRA + significant_decimals: 2 + buy_delivery_methods: + - name: PIX + description: Have BRL sent directly to your bank account. +``` + + + +Lets test that your RFQ API is live! Following `docker compose up`: + + + +```bash +curl http://localhost:8080/sep38/info | jq +``` + + + +You should get the following: + + + +```json +{ + "assets": [ + { + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + { + "asset": "iso4217:BRL", + "country_codes": ["BRA"], + "buy_delivery_methods": [ + { + "name": "PIX", + "description": "Have BRL sent directly to your bank account." + } + ] + } + ] +} +``` + + + +## Configure Callback API Authentication + +Just as your business will need to make requests to the Anchor Platform, the Anchor Platform will need to make requests to your business. Let's add authentication to these requests as well. + + + +```bash +# dev.env +CALLBACK_API_BASE_URL=http://server:8081 +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +SECRET_CALLBACK_API_AUTH_SECRET= +``` + + + +`CALLBACK_API_BASE_URL` uses `server` instead of `localhost` as the host because the Anchor Platform will be making requests to your business server from 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. + +We'll define the server that implements the endpoints defined in the Callback API in the following section. + +:::caution + +Note that as of 2.x path segments are not supported in `CALLBACK_API_BASE_URL` (such as `http://server:8081/myPath`). + +::: + +[sep31-get-info]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md#get-info +[sep1-ap]: ../sep1/README.mdx +[get-rates-api]: ../../api-reference/callbacks/get-rates.api.mdx +[sep38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md +[sep38-post-quote]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#post-quote +[platform-api-kyc]: ../../api-reference/callbacks/get-customer.api.mdx diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep31/getting-started.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep31/getting-started.mdx new file mode 100644 index 0000000000..d6b239c2df --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep31/getting-started.mdx @@ -0,0 +1,21 @@ +--- +title: "Getting Started" +sidebar_position: 10 +--- + +This guide will walk you through configuring and integrating with the Anchor Platform for the purpose of building a cross-border payments recieve-side service compatible with [SEP-31][sep-31], the ecosystem's standardized protocol for cross-border payments. + +By leveraging the Anchor Platform's support for SEP-31, businesses make their service compatible with Stellar's existing set of send-side services. + +:::info + +As we improve the documentation, parts of this guide that are relevant to other use cases may be moved into their own sections. + +::: + +Before continuing with this section, make sure that you have already [installed][installation-ap] the Anchor Platform and configured the necessary features required by SEP-31: [SEP-1 (Stellar Info File)][sep1-ap] and [SEP-10 (Stellar Authentication)][sep10-ap]. + +[sep-31]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md +[installation-ap]: ../../admin-guide/getting-started.mdx +[sep1-ap]: ../sep1/README.mdx +[sep10-ap]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep31/integration.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep31/integration.mdx new file mode 100644 index 0000000000..eb7f83f05d --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep31/integration.mdx @@ -0,0 +1,693 @@ +--- +title: "Integration" +sidebar_position: 30 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Integrating with the Anchor Platform for facilitating cross-border payments involves implementing the following, at a minimum: + +- [`GET /customer`][get-customer] & [`PUT /customer`][put-customer] KYC API endpoints to request & collect customers' KYC data +- [`GET /rate`][get-rate] RFQ API endpoint to provide FX rates between the on & off-chain assets supported +- `GET /transactions` requests to fetch updates on the Anchor Platform's transactions' statuses (documentation coming soon) +- [`JSON-RPC`][json-rpc-methods] requests to update the Anchor Platform's transactions' statuses + +The following may also be required depending on your use case: + +- [`GET /fee`][get-fee] if your business wants to provide senders the option to skip the quote creation step +- [`GET /unique_address`][get-unique-address] if your business uses a custody service for on-chain assets +- [`DELETE /customer`][delete-customer] if your business wants or is required to allow senders to request deletion of customer data + +## Create a Business Server + +First, lets create a business server and add it to our docker compose file. + + + +```yaml +version: "3.8" + +services: + sep-server: + image: stellar/anchor-platform:2.8.4 + command: --sep-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8080:8080" + depends_on: + - db + platform-server: + image: stellar/anchor-platform:2.8.4 + command: --platform-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8085:8085" + depends_on: + - db + + server: + build: . + ports: + - "8081:8081" + env_file: + - ./dev.env + db: + image: postgres:14 + ports: + - "5432:5432" + env_file: + - ./dev.env +``` + + + +Next, create a simple web server using your preferred programming language and a `Dockerfile` that starts the server. `docker compose up` should successfully start all three services. + +This guide does not provide an example implementation of the endpoints, but you can find more information about the request and response schemas in the [Anchor Platform API Reference][ap-api], and the sections below will expand on concepts important to understand when implementing the endpoints. + +## Customer Callback Endpoints + +The Anchor Platform never stores your customers' PII, and instead acts as a proxy server between client applications and your business, forwarding requests and responses to the other party. Currently, requests and responses are almost identical to those defined in the [SEP-12 KYC API specification][sep12]. + +### Identifying Customers + +Customers can be identified using two approaches. + +The first approach uses a Stellar account and memo. When using the Anchor Platform for facilitating cross-border payments, the sending organization uses their own Stellar account, the one used to authenticate via [SEP-10 Stellar Authentication][ap-sep10], when registering customers with your business. Memos are used to distinguish unique customers originating from the same sending organization. + +The second approach uses customer IDs generated by your service. For example, if a sending organization is registering a customer, your business will receive a `PUT /customer` request like the following: + + + +```json +{ + "account": "GDJUOFZGW5WYBK4GIETCSSM6MTTIJ4SUMCQITPTLUWMQ6B4UIX2IEX47", + "memo": "780284017", + "type": "sep31-sender", + "first_name": "John", + "last_name": "Doe", + "email": "johndoe@example.com" +} +``` + + + +In this example, the `GDJ...X47` public key identifies the sending organization, and the `780284017` memo identifies the customer. Memos are usually 64-bit integers, but they can also be other data types, so they should be saved as strings. In response, your business should return a customer ID. + + + +```json +{ + "id": "fb5ddc93-1d5d-490d-ba5f-2c361cea41f7" +} +``` + + + +Your business server can use any identifer for customers as long as it is a string. + +Following the registration of a customer, the sending organization can use either approach when checking the customer's status. For example, you may get a `GET /customer` request like the following: + + + +``` +/customer?account=GDJUOFZGW5WYBK4GIETCSSM6MTTIJ4SUMCQITPTLUWMQ6B4UIX2IEX47&memo=780284017&type=sep31-sender +``` + + + +Or, the sending organziation could use the identifier you returned when they originally registered the customer. + + + +``` +/customer?id=fb5ddc93-1d5d-490d-ba5f-2c361cea41f7&type=sep31-sender +``` + + + +Your business will need to maintain a mapping between the account & memo used to originally register the customer and the ID you return in the response, as well as the KYC data provided. In future iterations of the Anchor Platform, we may maintain this mapping for your business so you only have to work with the IDs you generate. + +### Customer Types + +Your business likely requires different sets of KYC information depending on the type of customer. You can define the labels for each of these customer types in your `dev.assets.yaml` file, and your sending organizations will need to understand which label to use when registering or querying the status of customers. + +In `PUT /customer` requests, you should use the type passed to evaluate whether the sender has provided all of the required fields. In `GET /customer` requests, you should use the type to determine the customer's status. + +### Test with the Demo Wallet + +You can test your implementation with the [Stellar Demo Wallet][demo-wallet] following the steps below. + +1. Select "Generate keypair for new account" +2. Select "Create account" +3. Select "Add Asset" and enter the asset code and the Anchor Platform's home domain, `localhost:8080` +4. Select "Add trustline" +5. Fund your account with a balance of the asset +6. Select "SEP-31 Send" in the dropdown menu + +You should see the demo wallet find your service URLs, authenticate, and check which KYC fields it needs to collect. It should then present a form for you to enter the KYC details for the sender and reciever. + +[![demo wallet after initiating a transaction](../../assets/anchor-platform-sep31-demo-wallet-widget.png)](../../assets/anchor-platform-sep31-demo-wallet-widget.png) + +Once you've entered in the information requested, it will send that information to the Anchor Platform, which will send it to your business server. Once the demo wallet has the customers' IDs you generated, it will initiate a transaction which should fail. + +## Rate Callback Endpoint + +Once the sending organization has registered the customers involved in the transaction, it will need to request a quote, or FX rate, from your business. The Anchor Platform requests this information from your business server using the [`GET /rate` endpoint][get-rate]. + +### Firm vs. Indicative Quotes + +Requests for quotes will have a `type` parameter that is either [`indicative`][indicative] or [`firm`][firm]. If `type=firm`, your response must include the `id` & `expires_at` date-time field and reserve the liquidity needed to fulfil this quote until the quote expires. If `type=indicative`, do not return `id` or `expires_at` fields because the rate provided will not be used in a transaction. + +Note that the client may request that the quote expires after a specific date-time using the `expires_after` parameter. Your business must honor this request by returning an `expires_at` value that is at or after the requested date-time or reject the request with a 400 Bad Request response, which will be forwarded to the client. + +### Using the Client ID + +Requests may include a `client_id` parameter that identifies the sending organization requesting the rate. You can use this parameter to adhere to the commercial terms agreed upon with that sending organization, such as offering discounted rates. `client_id` may not be present for indicative requests, in which case your market price should be returned. Currently `client_id` will always be the Stellar public key the sending organization used to authenticate with the Anchor Platform. + +### Delivery Methods + +It is common for businesses' rates and fees to differ depending on the payment rails used to send funds to the recipient. If your delivery methods are configured in your `asset.yaml` file, clients will always provide the payment rail they want your business to use for firm quote requests. + +Because this endpoint is currently only used paying out remittances in off-chain assets, the `buy_delivery_method` will be used. If this endpoint is ever used in other transaction flows such as SEP-24 deposits, then `sell_delivery_method` may also be passed for business that support these types of transactions. + +## Fetching Transaction Status Updates + +To facilitate cross-border payments, you'll need to be able to detect when a sending organization has sent your business an on-chain payment and determine which transaction that payment was meant to fulfil. + +The easiest way to do that is to run the Stellar Observer, which will detect these payments and update the corresponding transaction record with information about the payment. Your business can then detect these updates by polling the `GET /transactions` Platform API endpoint. + +### Running the Stellar Observer + +The Stellar Observer monitors the Stellar ledger for payments made to your account(s) and updates the corresponding transaction records with on-chain payment information. To run the observer, add the following to your docker compose file. + + + +```yaml +services: + ... + observer: + image: stellar/anchor-platform:2.8.4 + command: --stellar-observer + env_file: + - ./dev.env + volumes: + - ./config:/home +``` + + + +### Polling for Received Payments + +The Stellar Observer makes JSON-RPC requests to the Platform API whenever it detects payments received for transactions initiated by sending organizations, thus updating the transaction's `transfer_received_at` date-time. + +Your business should periodically poll the `GET /transactions` Platform API endpoint to detect these updates. You can refer to the following example: + + + +```bash +curl http://localhost:8080/transactions?sep=31&order_by=transfer_received_at&order=desc +``` + + + +The response will include a list of cross-border payment transactions initiated by sending organizations. This list will be ordered according to the time a payment was received for that transaction. For each transaction returned, your business should check whether or not it has already detected the payment for that transaction. If it has, you have detected all payments made to your account(s). + +## Updating Transaction Via JSON-RPC + +SEP-31 flow diagram defines sequence/rules of the transaction's status transition and a set of JSON-RPC methods 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 the request. If the request doesn't contain required attributes, the Anchor Platform will return an error and won't change the status of the transaction. + +[![sep31 flow](../../assets/sep31-transition-diagram.png)](../../assets/sep31-transition-diagram.png) + +:::tip + +Statuses in green are mandatory and define the shortest flow. + +Statuses in yellow are optional and can be skipped. + +Statuses in red mean the transaction is in an error status or it has expired. + +::: + +You can create a [template][sep24-integration-make-json-rpc-request] for making a JSON-RPC requests to the Anchor Platform. + +This chapter also contains information about the format of [request][sep24-integration-rpc-request]/[response][sep24-integration-rpc-response] and [error codes][sep24-integration-error-codes] that might be returned by the Anchor Platform. + +### Ready to Receive Funds + +SEP-31 Transactions should initially be in the `pending_sender` status. The Receiving Anchor waits to receive the payment identified by the stellar_memo included in the POST /transactions response. + +Once your business detects that it has received an on-chain payment for a specific transaction, it has to update the transaction status. + + + +```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 +``` + + + +The transaction status will be changed to `pending_receiver`. + +### Offchain Funds Sent + +To complete the transaction and change its status to `completed`, you need to make a `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 +``` + + + +### Offchain Funds Pending + +Another option is to move the transaction's status to `pending_external`. This status means that payment has been submitted to external network, but it 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 +``` + + + +### Customer Info Needed + +In some cases, the Receiving Anchor might need to request an updated information from the Sending Anchor. For example, the bank tells the Receiving Anchor that the provided Receiving Client's name is incorrect or missing a middle initial. Since this information was sent via SEP-12, the transaction should go into the `pending_customer_info_update` status until the Sending Anchor makes another SEP-12 `PUT /customer` request to update. The Sending Anchor can check which fields need to be updated by making a SEP-12 `GET /customer` request including the id or account & memo parameters. The Receiving Anchor should respond with a `NEEDS_INFO` status and `last_name` included in the fields described. + + + +```json +// pending-customer-info-update.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "pending_customer_info_update", + "params": { + "transaction_id": "", + "message": "Customer info needed" + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh pending-customer-info-update.json +``` + + + +### Customer Info Updated + +After the Sending Anchor has made another SEP-12 `PUT /customer` request to update customer info, the Receiving Anchor should change the status of the transaction to `pending_receiver`. + + + +```json +// notify-customer-info-updated.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_customer_info_updated", + "params": { + "transaction_id": "", + "message": "Customer info updated" + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh notify-customer-info-updated.json +``` + + + +### Do Stellar Refund + +Integration with the custody service allows you to do refund via 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 + +You can't do multiple refunds in the SEP-31 flow. For this reason, the total refund amount plus the amount fee should equal `amount_in`. Otherwise, you will get an error. + +::: + +### Refund Sent + +There is a possibility to send all funds back to the `Sending Anchor` (refund). You need to refund the whole sum(full refund). + + + +```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 +``` + + + +:::note + +You can't do multiple refunds in SEP-31 flow. For this reason, the amount to refund plus the amount fee should equal `amount_in`. Otherwise, you will get an error. + +::: + +### 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 details of the error. + + + +```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 those transactions that have been abandoned by the user after some time. It's a good practice to clean up inactive transactions in the `incomplete` status. To do so, simply change the transaction's status to `expired`. + + + +```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 + +The transaction status can be changed from `error/expired` to `pending-anchor`. After recovery, you can refund the received assets or proceed with the processing of the transaction. To recover the transaction, it's necessary to 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 +``` + + + +## Fee Callback Endpoint + +Your business may want to offer sending organizations the option to skip the quote creation process, allowing your business to use a rate determined at the time the funds are paid out to the recipient. In this case, the Anchor Platform will not make a `GET /rate` request, but you will still need to provide the fee your business will charge for these types of transactions using the [`GET /fee`][get-fee] endpoint. + +### Configuration + +You can enable these types of transactions by updating your `assets.yaml` file configuration: + + + +```yaml +assets: + - ... + sep31: + quotes_required: false +``` + + + +## Unique Address Callback Endpoint + +Businesses must provide a unique Stellar account and memo pair for each transaction requested by sending organizations so that the Anchor Platform can identify and map the on-chain payment sent for the specific transaction. The Anchor Platform can generate these account & memo pairs itself, but most businesses use a custodial service to receive on-chain payments. In this case, the business must request the custodian to generate the Stellar account & memo. This is done by using the [`GET /unique_address` endpoint][get-unique-address]. + +### Configuration + +To configure the Anchor Platform to make these requests, add the following to your configuration: + + + +```bash +# dev.env +SEP31_DEPOSIT_INFO_GENERATOR_TYPE=api +``` + + + +:::caution + +This endpoint may be removed during future major version updates of the Anchor Platform, when it adds support for connecting to custodial services and generating these addresses automatically. + +::: + +[ap-api]: ../../README.mdx +[ap-sep10]: ../sep10/README.mdx +[sep12]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md +[demo-wallet]: https://demo-wallet.stellar.org +[indicative]: https://www.investopedia.com/terms/i/indicativequote.asp +[firm]: https://www.investopedia.com/terms/f/firmquote.asp +[get-unique-address]: ../../api-reference/callbacks/gen-address.api.mdx +[get-customer]: ../../api-reference/callbacks/get-customer.api.mdx +[put-customer]: ../../api-reference/callbacks/put-customer.api.mdx +[get-rate]: ../../api-reference/callbacks/get-rates.api.mdx +[get-fee]: ../../api-reference/callbacks/get-fee.api.mdx +[put-customer-callback]: ../../api-reference/callbacks/put-customer.api.mdx +[delete-customer]: ../../api-reference/callbacks/del-customer.api.mdx +[json-rpc-methods]: ../../api-reference/platform/rpc/methods/README.mdx +[sep24-integration-make-json-rpc-request]: ../sep24/integration.mdx#making-json-rpc-requests +[sep24-integration-rpc-request]: ../sep24/integration.mdx#json-rpc-request +[sep24-integration-rpc-response]: ../sep24/integration.mdx#json-rpc-response +[sep24-integration-error-codes]: ../sep24/integration.mdx#error-codes diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep6/README.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep6/README.mdx new file mode 100644 index 0000000000..7af76ff6bd --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep6/README.mdx @@ -0,0 +1,10 @@ +--- +title: Programmatic Deposits and Withdrawals +sidebar_position: 65 +--- + +import DocCardList from "@theme/DocCardList"; + +SEP-6 allows for a means by which wallets and/or exchanges interact with an anchor on behalf of users, never requiring the user to directly interact with the on & off-ramp. + + diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep6/configuration.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep6/configuration.mdx new file mode 100644 index 0000000000..dea7867383 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep6/configuration.mdx @@ -0,0 +1,251 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +# Configuration + +To enable SEP-6 deposits and withdraws, the Anchor Platform must be configured to do the following: + +- Provide the necessary service URLs for SEP-6, 12, & 38 endpoints in the `stellar.toml` file +- Provide information about the on & off-chain assets, as well as the payment rails, supported by your business via SEP-6 and SEP-38 `/info` endpoints +- Support the endpoints and callbacks required to request KYC information and provide exchange rates + +## Enable Programmatic Deposits & Withdrawals + +Add the following variables to your environment file. + + + +```bash +# dev.env +SEP6_ENABLED=true +SEP12_ENABLED=true +SEP38_ENABLED=true +``` + + + +### Modify a Stellar Info File + +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 Stellar assets 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" +KYC_SERVER = "http://localhost:8080/sep12" +ANCHOR_QUOTE_SERVER = "http://localhost:8080/sep38" + +# 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. + +### Modify the Assets Configuration File + +Now you're ready to 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 `sep38` sections are methods that will be exposed by the SEP-38 [`GET /info`][sep38] endpoint. + +The methods specified in the `deposit` and `withdraw` sections are the methods that will be exposed by the SEP-6 [`GET /info`][sep-6] endpoint. The methods listed should match the methods defined in the SEP-38 section of the file. + +Also note that fiat assets, those with the `schema: iso4217`, do not need the `sep6_enabled`, `deposit`, or `withdraw` configuration objects specified. In the same way, Stellar assets, those with `schema: stellar`, do not need the `sep38.sell_delivery_methods` or `sep38.buy_delivery_methods` configuration objects specified. + + + +```yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep6_enabled: true + sep38_enabled: true + sep38: + exchangeable_assets: + - iso4217:USD + deposit: + enabled: true + methods: + - ACH + withdraw: + enabled: true + methods: + - ACH + - schema: iso4217 + code: USD + significant_decimals: 2 + sep38_enabled: true + sep38: + exchangeable_assets: + - stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + buy_delivery_methods: + - name: ACH + description: ACH debits for US bank accounts + sell_delivery_methods: + - name: ACH + description: ACH credit for US bank accounts +``` + + + +### Managing Distribution Accounts + +Note that the example above lists a `distribution_account` attribute for the USDC entry. If specified, this account will be provided along with a randomly generated and unique-per-transaction memo to clients as the address to send funds to for withdrawal transactions. The transaction's memo is how you or the Anchor Platform will match the funds received with a transaction record in the Anchor Platform's database. + +If you do not have your own Stellar account and instead use a third party that provides you a Stellar account and memo so they can receive funds on your behalf, such as an exchange or custodian, you should omit the `distribution_account` field from your assets config file. Instead, you'll need to provide the Stellar account and memo you'd like to use to receive funds through a request to the Anchor Platform's [`request_onchain_funds`][request-onchain-funds] on a per-transaction basis. + +To configure the Anchor Platform to expect the Stellar account and memo to be provided via API instead of configured via the assets file, specify the following environment variable. + + + +```bash +# dev.env +SEP6_DEPOSIT_INFO_GENERATOR_TYPE=none +``` + + + +If you use a wallet provider supported by the Anchor Platform's custody service, such as Fireblocks, you can also configure the Anchor Platform to connect directly to your wallet provider to fetch your distribution accounts and memos. If this is configured, the Anchor Platform will also use the wallet provider to send funds to customers. See the [custody services] section for more information about configuring this feature, but first you'll need to specify a different value for the above-mentioned environment variable. + + + +```bash +# dev.env +SEP6_DEPOSIT_INFO_GENERATOR_TYPE=custody +``` + + + +### Enable Callbacks to the Business Server + +Businesses need to collect and validate KYC information on the customers they're facilitating transactions for. Clients ask your business what KYC information needs to be collected and sends that information via the SEP-12 KYC API hosted by the Anchor Platform, but the Anchor Platform never stores personally-identifiable information (PII). Instead, it forwards requests from clients to the business server, and returns the business' responses back to the client, acting as a proxy server. + +Additionally, businesses need to provide clients with a [Rates][get-rates-api] API to check the exchange rates they're offering between the onchain and offchain assets supported by the business. If the rate is competitive, clients also need to be able to request a commitment to the rate currently being offered from business for a short period of time. Similarly to the KYC API, the Anchor Platform makes requests to your business server to fetch exchange rates and quotes and returns them to clients. + +To enable these requests to your business server, first you'll need to add your business server to the docker compose file. Then, to support requests to your business server from the Anchor Platform, you need to enable callbacks. + + + +```bash +# dev.env +CALLBACK_API_BASE_URL=http://business-server:3000/callbacks +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +CALLBACK_API_AUTH_JWT_HTTP_HEADER=Authorization +SECRET_CALLBACK_API_AUTH_SECRET="a secret used to sign JWTs" +``` + + + +The above tells the Anchor Platform to include a [JWT][how-to-use-jwt], signed with the configured secret, in the `Authorization` header of requests made to `/callbacks/` so your server can authenticate the Anchor Platform before processing requests. + +`more_info_url` is an optional URL provided by your business server for wallet applications to display information about previously initiated transactions. This URL is typically used by wallets in their transaction history views, and your business can specify the information to be displayed about the transaction. + + + +```bash +# dev.env +SEP6_MORE_INFO_URL_BASE_URL=http://example.com +SECRET_SEP6_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" +``` + + + +See the [KYC API][platform-api-kyc] and [Rates API][sep38] for details on the endpoints that must be implemented on your business server. + +## 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 something 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 + +SEP6_ENABLED=true +SEP6_DEPOSIT_INFO_GENERATOR_TYPE=none +SEP6_MORE_INFO_URL_BASE_URL=http://example.com +SECRET_SEP6_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" + +SEP10_ENABLED=true +SEP10_HOME_DOMAIN=localhost:8080 +SECRET_SEP10_SIGNING_SEED="a Stellar private key" +SECRET_SEP10_JWT_SECRET="a secret used to sign JWTs" + +SEP12_ENABLED=true + +SEP38_ENABLED=true + +CALLBACK_API_BASE_URL=http://business-server:3000/callbacks +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +CALLBACK_API_AUTH_JWT_HTTP_HEADER=Authorization +SECRET_CALLBACK_API_AUTH_SECRET="a secret used to sign JWTs" +``` + + + +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]: ../sep1/README.mdx +[stellar-demo-wallet]: https://demo-wallet.stellar.org/ +[get-rates-api]: ../../api-reference/callbacks/get-rates.api.mdx +[sep38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md +[platform-api-kyc]: ../../api-reference/callbacks/get-customer.api.mdx +[request-onchain-funds]: ../../api-reference/platform/rpc/methods/request_onchain_funds.mdx +[how-to-use-jwt]: ../sep24/faq.mdx diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep6/getting-started.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep6/getting-started.mdx new file mode 100644 index 0000000000..3a1d875e92 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep6/getting-started.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]: ../../admin-guide/getting-started.mdx +[sep1-ap]: ../sep1/README.mdx +[sep10-ap]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.8/admin-guide/sep6/integration.mdx b/ap_versioned_docs/version-2.8/admin-guide/sep6/integration.mdx new file mode 100644 index 0000000000..fae2ab0c81 --- /dev/null +++ b/ap_versioned_docs/version-2.8/admin-guide/sep6/integration.mdx @@ -0,0 +1,971 @@ +--- +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 require determine if a transaction requires the customer to update their information. The required SEP-9 fields can be communicated to the user by returning a `NEEDS_INFO` status with the required fields in the `fields` attribute. + + + +```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" + } + } +] +``` + + + +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](../custody-services/fireblocks/README.mdx). 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/learn/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-reference/platform/transactions/get-transactions.api.mdx diff --git a/ap_versioned_docs/version-2.8/api-reference/README.mdx b/ap_versioned_docs/version-2.8/api-reference/README.mdx new file mode 100644 index 0000000000..1a9f52ea6c --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/README.mdx @@ -0,0 +1,10 @@ +--- +title: API Reference +sidebar_position: 20 +--- + +import DocCardList from "@theme/DocCardList"; + +View all Anchor Platform API information. + + diff --git a/ap_versioned_docs/version-2.8/api-reference/_category_.json b/ap_versioned_docs/version-2.8/api-reference/_category_.json new file mode 100644 index 0000000000..0d44758281 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/_category_.json @@ -0,0 +1,3 @@ +{ + "collapsed": false +} diff --git a/ap_versioned_docs/version-2.8/api-reference/callbacks/README.mdx b/ap_versioned_docs/version-2.8/api-reference/callbacks/README.mdx new file mode 100644 index 0000000000..54cf2996c5 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/callbacks/README.mdx @@ -0,0 +1,22 @@ +--- +title: Callbacks Server +sidebar_position: 20 +--- + +import { EndpointsTable } from "@site/src/components/EndpointsTable"; + +The Anchor Platform provides several callback functionalities for your business server. + + + +| | | +| ------ | ---------------------------------------- | +| GET | [/customer](./get-customer.api.mdx) | +| PUT | [/customer](./put-customer.api.mdx) | +| DELETE | [/customer/:id](./del-customer.api.mdx) | +| POST | [/event](./post-event.api.mdx) | +| GET | [/fee](./get-fee.api.mdx) | +| GET | [/rate](./get-rates.api.mdx) | +| GET | [/unique_address](./gen-address.api.mdx) | + + diff --git a/ap_versioned_docs/version-2.8/api-reference/callbacks/del-customer.api.mdx b/ap_versioned_docs/version-2.8/api-reference/callbacks/del-customer.api.mdx new file mode 100644 index 0000000000..149e2db097 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/callbacks/del-customer.api.mdx @@ -0,0 +1,144 @@ +--- +id: del-customer +title: "Delete Customer Data" +description: "The request for this endpoint is identical to the" +sidebar_label: "Delete Customer Data" +hide_title: true +hide_table_of_contents: true +api: eJztVE1v2zgQ/SvE7KEtIEuON4dCtyDxIUCxCNbZk22gFDm22FIkwxk1MQT99wVlKbZbb3/B6iJpOB+ceW9eByz3BOUa7lti32Ak2GbwNiMMg3m1fJrdLCAbPv68SYcaSUUT2HgHJTzXKCK+tEgsdj4Krg0JdDp441gYEkajY6OkFewF17hx668Pyy/L56Uo1Fj06/ZjzRyoLIq94bqtcuWbghitlXF6z0L07JW3RWV9VTSSGGOBytOBGJuCMMzm85tF3ug/psQzjRYZP23cdEeNO+NQC+PEsbd84zbuYXBL1xNT6AcSWrIUPoqXFtvLw/EsNTxUMN7lGwcZ+IBRpt9HDSVotNNcIYMgo2yQ04zLdQcmjS9IriEDJxuEEoyGDEjV2EgoO+BDSFbiaNwe+gxSEyaihpJji/02WSh4R0jJfzG/Ta9LgFatUkiUp/jbaw7TDYXzCcLW6RwyUN4xOk7uMgRr1NBV8Y1STPfrJX31DRWnLmOaAZvjlTBGH6/2YvQV80WP6zF6mwEbtslvORj69GSAb4yOjHfHeX7HA5QTdTP4IW2LVymc5tYg136ECBkHdLiGEt45WXRG9wkOjD8myNpooYSJqkpaW0n1Pa9aMg6JZkffHN9kEyxKp2ofE5UhlTRu51PLKdtx8ov8c34L1zZqdXCqjt75lsT9WIbE3dOjoIDK7EY4xo1DsTquiLgbSoonK3nnYyNC9AmWgeO/z3vcC5p2mUQjNYrqMKR/z/daG4vCDIsdok/EMm4v5EkCom+EFMoadCzOmJOL57T7x5l8SHVG4o6yQHgqLXc7VHxZ+Wf/ayWGDZyocmpvNaACGVij0BEmEMaFuwtS1SgW+RyyM3TLonh9fc3lcJr7uC/GUCq+PN4v/1otZ4t8ntfc2IGzwRM30p0lHgXlfbceJMufke5OS/a/jF7K6CgLjG9cBCuNS4ox4NONi7oGdVLW0uikErUnTiddV0nCf6Lt+2R+aTEeoFxvkyhEI6vEj3UH2lD61lDupCX8DTof/x5F6ZP4r8uNRukOJ+0ByEZVMhr6bZ9BjVJjPJOrO6Uw8FnIL2J7oVZHxKHv/wVOQ7B+ +sidebar_class_name: "delete api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +The request for this endpoint is identical to the [`DELETE /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-delete) request defined in SEP-12. + +Delete the customer's data or queue the customers data for deletion. + + + +
+ +

+ Path Parameters +

+
+
+
    + +
+
+
+
+
+ + +
Success.
+
+
+ +
Customer not found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/api-reference/callbacks/gen-address.api.mdx b/ap_versioned_docs/version-2.8/api-reference/callbacks/gen-address.api.mdx new file mode 100644 index 0000000000..1a51c2a1d5 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/callbacks/gen-address.api.mdx @@ -0,0 +1,259 @@ +--- +id: gen-address +title: "Generate Unique Address" +description: "If the platform is configured with `depositInfoGeneratorType: api`, the Platform make this request to" +sidebar_label: "Generate Unique Address" +hide_title: true +hide_table_of_contents: true +api: eJztWFtTKjsW/iuZnIfZ7urmpijwxgZkI4jITbwVhs6iO9CdNEkaaC3/+6nQoKCeM1NTMw9TpS9qsnqtlaxLvm+9YArKkSzUTHBcwo0p0h6g0Cd6KmSAmEKO4FPmRhIoWjHtoScKoVBMN/hU1IGDJFrIfhxCCZGQPVkbBZ2dgoDMAWmPKSRhEYHSSIsHbkTK3PGERBPizIFTBEuQMdIsAESQloQr4hinjAuMM82IBoomMSLI8RlwjUgY+swhRij1wB94/11pECmN3IhIwjUY+0Rv3AogEEiCjiQHihg/9IwpFHG2iMBCSiCmkUM4mgAKSBgCRVlbCzuLtEDk7XwPXIISkXQAqcjxEFGIoPterWMfZx9/eFqHqpROKw2+T2RKSDcdSqGFI/y0gtA+zh7tn3VzjN8gwbjiiVXi3tQXK7QSkU+NM5ECiqZCoi44wJaMu9tDq+SYHIAaHx0JRJujA5PbY6GnH8RxRMS1tbmJoycUEibVAxeRVozCQewtFCmjvcKk40PJuHb/j/v3QwUgA8JoivF5mgVuOiRzUYL2wh86Oso9l6/HF4PzfpxlVysvrhXLAy+KMlfd6+ztkgaNZvViOOjdNvybHvNqt+MlRN3LqOP9Jv1hxSkOZ53qCazj59veMK62gsLAbnej8vG6W6At26mflsWCXK7dq/AsI0+Lbl7O1qNy16/S9SI6aQ4r7ugyNwxXskudVgP6USHrT7rXXmdUDn+PxPhuXQ9P2IkQvTAqz1dVorL0xL0kC2c1qzYyYnLVOguP1WBxcSry1fZlu2znKYzyC7/daNg3tfVyZget4dg5vuqeKN8tBOrUPRv9Pl2GC2fNc6Ol27iNo8pFr+PyX7nVya8Tf96oe9dNlstVKiqmw9nZiFXP7Tppnt5Ui82R35/O+ytRV9PChbOs3i5cezzL0fn5tJp14bwa9/KhP8kNMgGvdhuVTMd12pWbs9rg19Cp60Wl2hks1Fnxajm+6xVgFWcv1yeXkpWbYvycD5r06ta/YwTgsuhH+dXQL7ayPHfHT6+9fGMwyTdveDE+vcndDFr5am/QW9I7eX6xPpvIqht3qpQW4ASCQbZ1uj7jU/nM253+rNtq6+A5KvNRrjXKqf541GxcHA/G68m0eDk5vqGNat2tXORZwW00K35+eF5pXGgoOLZfGM2WMCvk6nxN26QeD347uXEhW5vdTZyO122tnqNB7vrsdt0czOay1vDnXmYWl4ussHSK4Xp5R85prnIV25VJt3jMqtUeCYrHkdfu1Ku2MxudlaNQ1yYO8FqWXhDfvustBp1Ou2sXLn7Px7l89+ak2Wd1mz7bx6Innnmceb5Yz8674pzlhr/qthr72bg9vrtcjOfNYqeQuT57LkO0rkX+r14/nGdXxzY/Py+y0dVNhhzXeNs5bV9O5958MYtzV6HLByo+47lc/apQ5ZPTSbnfchfRulkUkG1Hi+dhYZlrNbJHn2vKZ0tIA2X6j++q+q6q76r6T6rqgWMLi9DgEyZ4g+ISdoGXKZWgFLawJq7CpXs8SN7G3cajhde2gnCzlzzkZi0kkgSgQZr1F8wMWFpEIGNsYU4CwCW895CPGcXWB2jV38dVCuQSJFox30eKLLcvr1AG4+yDH8IpColSm/2nQwtPSHtSRK6XwATgNBSM69QD36I4koChFVMeKIMJEuSzb8CmEAKnBk4lGGFMknuw9jUEJEabw24W75/qtT5K72lRT2/WkZgeAsByp/He3ygswTcxUakDTLQVVunEoL1bSJOQ2RKmIIE7kN5hLZV2Qdt7DhylNtFWjgcBwaUXrOPQhERpybiLXy1sMB6TQHFJywheH82KCgVXoIx8LpMxvw4j1oscB5RKYQs7gmvg2sjswc70TBnBl8+GxWQGjsYWDqU5rmaJmcM7/myxzFHypUHdmjBuAJi5zh2A297aTkPJwLgExSXAUAvETDTZ1ABlCkozniBkk/F/69sH1V84h57qqVTqCW0l0VYSCYkIerrc7N0H0RroR5F/mQFUOCrtA5E8DdyJHSNCGTlIMluF4DDis2eg6VAIH6i9xbPK3pjd+xcCof44XDwyuUk4+vkT1sxcjPvzJ9puJlwAUG/rNwe9EnK+d2vvqWR0f76d/o5eGH6gNXE889e+zpDEAXD9lzrHyepXis2O8f7fMoB+aFhrC3lEeZYJDqNHn41aGHgUmCZnpLGFjTi2MKP48fWgYO4/pcbj6+bHwvmvyqYmpZAp1N/vAptGl1Qc3bn9mcYlBNPsKRIA2lUocgSFTSucCBr/F8sRjKdftgtGv1j+cCvJ148W1kz7sDs43l4NrDVwZfJ282DMIcal3cti4SXxI9h/YUxHCkB7InmnNr4S7eESTn9oGhZOHo9EbyR9XMK76nKI7xtCnZoY7gZK2YlsCtYkCH1I2mvKEQE2BhmfbjLZaEtil0sVUidfPl29mDueFFxEClW2ZpTp7mhTltNdCA013U/KLSN/y4RQChOLN8b+13opTM0ZdvRcoYBQMBOAg/dl5TEfDFlnyug2Dds0TfLG6qdSBF8PDUyKPvDkTv6p3tJNbRNUwbtpMp2arnxg+aP813MJ/J4f78frbaKCLewzB7jaVP0WRZRD4niAcqkMtvaiW0qnV6tVimx2Ny1z+6lKtxqVWrtXs3OpTMrTgb9JVIMlAsL3FG9nNYA+AJ4PwX55L67vadD3NOh7GvTNW7956/c06Luqvqvq/7mqEiCW4HlDeMzMgXED9TcY62WLtu8/UvRHC3tCabPz8jIhCgbSf301y8n0x2BwyhSZ+IYUTImv4G8A1Y/ulj8coe9x0P98HPRluBMi9mlWtyVkeMOLlkQyE1Fcun98tbAHhILco3Flx4FQ7331iYQe0Ll6rY9fX/8ErnhCww== +sidebar_class_name: "get api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +If the platform is configured with `depositInfoGeneratorType: api`, the Platform make this request to the Anchor backend every time a transaction is initiated by a client application. + +The Anchor must guarantee that the memo returned in this request is unique, so it can be mapped 1-to-1 to a Platform resource such as a [SEP-31](https://stellar.org/protocol/sep-31) transaction. + +Here is how this flow would be used for Receiving Anchors that need to create their unique `(account, memo)` pairs outside the platform, using Circle: + +[![](https://mermaid.ink/img/pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1)](https://mermaid.live/edit#pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1) + + + +
+ +

+ Query Parameters +

+
+
+
    + +
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
    + + + + unique_address + + + object + + + +
    +
    + An object containing the unique + `stellar_address:memo` pair used to identify a + destination. +
    + + + +
    +
    +
    +
+
+
+ + + +
+
+
+
+
+ +
+ Error. The Platform will respond to the client application with the + same response code and body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/api-reference/callbacks/get-customer.api.mdx b/ap_versioned_docs/version-2.8/api-reference/callbacks/get-customer.api.mdx new file mode 100644 index 0000000000..9d906172cc --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/callbacks/get-customer.api.mdx @@ -0,0 +1,563 @@ +--- +id: get-customer +title: "Retrieve Customer's Info" +description: "The request and response for this endpoint is identical to the" +sidebar_label: "Retrieve Customer's Info" +hide_title: true +hide_table_of_contents: true +api: eJztWG1z2zYS/is7uA9pZijKdtxcom8eRcnp2jo+y2mnY3tsiFiJaECABUDLGo/+e2cBUqJsxm5t9+ZyE38xRQKLZ3effcHeMIEus7L00mg2YCc5gsXfK3QeuBZg0ZVGO4SZseBz6QC1KI3UHqQDKVB7mXEF3oDP8UyfXn4YnUA/q5w3BdrL8+9y70s36Pfn0ufVNM1M0XceleK2+d8rrfEmM6o/VWbaL7jzaPuYGbd0Hou+w7K3s7O7lxbiH43g3hz9yzPdCVXgTGoUIDVMRke93b30TJ/pky3wXCmzcJApido78GZAawB2U3iPPstJG5hJVMKFR4f2Cm0wjbToSLaxAi0pbnEuCTJw0LiABiJcSQ68hkCWOfr0X7FMWfmXjQ9JqfGsrYEw6EAbDzm/QuAbtI0WKGpfI5Tc8gI9WgcOyeM6vK5lJyA9uNxUimzvK6sjBWqr1aYSm13RPSkQxxwvNq8aKVOsBaGARY4atGlj4BYDjjS6ai+FYY7Z56id575yYGZtlXzOPRR8CVxZ5GIZD2jUXJPiDhcgC3IXOfocoykameT5mbEFp3iBBXfAswxLjyIBi79hFp6MBeelUqARhYPCWAz70tve6FwV9rcWxc9VKbgP5lyf3+0BuOWA9EyzhHk+d2xwyoaNIuw8Ydc9h2V4TSx9zRIW2Vo/vNqlRaZEG44bCzZgc/SNCJawjXfY4PSGSUohv1dolyxhmhfIBkwKlnQkmfE7clbbtMDdxv23SBMdW1q8kqZyQJFUszBlCXNZjgVngxvmlyWd6byVes5Wq6QbE88yU2nfCWwSQ4988FN1jQIO4mLglc9juiM3LKSPSeJIcU8eCeEezLfzKEwFFqYTEH2AK64qrPPtbCn1vM3zgIWDyznFW61cQvy1GIm09YUy92X9fPlorBdhbRdg+kAOC8Arh4JCqoH+IO77ACUMdVUQXwOrcu5yojZee3b+RbAP4uRZCOYtLkoHUyQz//DrMCTEFCaIdY07oY2TEjM5IzZIo587mRO0nmuf8PJMC5NVBWp/q7Q9xoHecu2i3hdfCNDWEpA13xe5rEtjY6gXMSGSvbhzJpMUHCn8Qtm7nSln1hTbFhZYohYOTF022ud9h+k8TTYZsZEiW2WFipTidk6JoyDiuJePs4XigVnbFniHM16pWA0uUV+m8CPX84rPETIjEGrfoIDKEU3Gk4/w+tXb3m4K/6oKroEKDp8q6kbWcl0CWW5khi6hjuVMF+gcn6NrFcCQ+KQDVR/3kIPPE9YkSUff93Z26N+2Nj9zJcU6Y0KTwAFlKHBNecRr6bxrqs8mFmLokrLT5e3GQLrQ9FADVlTUcJTWXEmBm0oUc5erDTHtSO5TI5YpHLd+Sozl/naDCdEQTYt3pqWG0xgJf2unGb2QGe1Re7IvL0tVR2b/N0dGvrnrJDOlhoCRhyJpKXPFToUKa2mptHoZHSdFh3uTZvk9qfBgOBwdnYzesYQdHX8cjiaT8eEHlrDD0ejd5GJ8+P4jS9jx6N+jIS06XyUsNghdQLkQknTi6mgLXFuBjnx6R5ko98uY1y+mUvMYjFUxDS0FdTkB5RaFOyxTh1LrG7eWkyzpsegw2WpFzUxUr/V1aoxCrtlqRQtq+oqLb0bqNNJTGLkmYcJ+Hh2P34+HByfjj4cXx6P/fBof1+REa43twkXI6oTZDdtLr+jVh02L2uQUwo3XvChVtMWkyjJ07odfhyFwq6IgA8fCl3GH8frRalVyTg0BanBx56xSaknNwQsRch8viThIpTSkuyaimdjNcG+2/6b3ajbb7e2//V703u7t7/T+yb/fEW92XmezsKkxatt2HVScSev8RSxct5P8yXZZDkshLE3ueOrucauEKf5nZdPKvyQaCy7VBRfConMPig+roVn9p46o/xK231X/RsSp9CkZfDtyv8TRpDuLr7YrQNx9viFsgMca/Pt38R8aD+9NpcXXoEMINY/aUccTroWfkWKrvmyuA+SeSyd1NQX63NQ3znDT9DkbsPX8hGgQrsfxiMoqNmBNB5BxpaY8+5xOqTtD53pxbVrnAK6z3FjqEBgdRS0mqUzSosH30jfpfvf1cKmz3BpN19BhfYyDg6MxbLXr6xlKc508CEduboulNeSWejR1n9zY67imfXNQcIFNJ7aWt8ilQpoHSEeyKUfFW2IzIgsdOK+nHNBiThjInOlokxdu3Za5uudyuDmaz2aY+e2Tb6/vOiKOIGqqbNSbBK+whCmZIaXpwU3TlR+UPMsR9tIdlrS8O+j3F4tFysPX1Nh5v97q+j+Oh6PDyai3l+6kuS9U4GxpnC+4bgk+Rm8lXuG6C37hYEwEuFNM14H2bSr6bSr6bSr6fzkVjUWOJkj9UnEZGtyQbW7qinPK1hXnPGG5cZ7e3dxMucNPVq1W9DpOFKgOCeno1i/YYMaVwwdyynMOQTtViZVXttpSxmgO8tdgPtNI9B6Em4HsE2D+/YPSezSox7dPgP/0sekD8JqJ7TNg/PpHpvfY6hnM9JXOTu8zyu2J8SPN8z82WL1H43ouvNHznH5YSYezwSnNKnLkAm3rjnMQyl5r150b2tbV5sPohK1WfwAL0BBQ +sidebar_class_name: "get api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +The request and response for this endpoint is identical to the [`GET /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-get) request and response defined in SEP-12. + +This endpoint allows clients to: + +1. Fetch the fields the server requires in order to register a new customer via a SEP-12 [`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) request + +If the server does not have a customer registered for the parameters sent in the request, it should return the fields required in the response. The same response should be returned when no parameters are sent. + +2. Check the status of a customer that may already be registered + +This allows clients to check whether the customers information was accepted, rejected, or still needs more info. If the server still needs more info, or the server needs updated information, it should return the fields required. + + + +
+ +

+ Query Parameters +

+
+
+
    + + + + + + + +
+
+
+
+
+ + +
+ Valid request. Customer either already exists or the customer + identified by the parameters is new and must provide the field values + described in the response body. Response bodies are identical to the + schema defined in + [SEP-12](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-get). +
+
+ + + + +
+ + Schema + +
+
    + + + +
    + + + + fields + + + object + + + +
    + +
    + + + + property name* + + + + +
    + + + + +
    +
    +
    +
    +
    +
    + +
    + + + + provided_fields + + + object + + + +
    + +
    + + + + property name* + + + + +
    + + + + + + +
    +
    +
    +
    +
    +
    + +
+
+
+ + + + + + The case when a customer has been successfully KYC'd and + approved + + + +
+
+
+
+
+ +
Error.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Not Found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/api-reference/callbacks/get-fee.api.mdx b/ap_versioned_docs/version-2.8/api-reference/callbacks/get-fee.api.mdx new file mode 100644 index 0000000000..a449e4b095 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/callbacks/get-fee.api.mdx @@ -0,0 +1,354 @@ +--- +id: get-fee +title: "Retrieve Fees" +description: "The Platform will make this request to the anchor every time a transaction is initiated by a client application" +sidebar_label: "Retrieve Fees" +hide_title: true +hide_table_of_contents: true +api: eJztWFuP27YS/isD9qEt4JXdbQoUfvNJN4XRog2yKQ4O1ouYpkYWuxKpkKN1DMP/vRhSsmRbyZ6k26KXfTJMkXP55j47kaJXTlekrRFT8TpHeFlIyqwrYaOLAkp5h0C59uDwbY2egCxQjiCNyq0DvEe3BdIlggRy0nipmBhoD9po0pIwhdUWJKhCoyGQVVVoJfnSwmw05bYmkLB8W1vCNzpdJguzMCzJLLIoa0+AxteOJZEU2Hs0qTZrkCYFhwr1Pf9TtSdbovPgK1Q605iCNuFBK36JGCn88L/n4VA7LNGQXxiDCr2XrI+FSjpi3ZvnfdUiZqsz2gfBZU9wh1S7eC1DBE0RV5VLt0bIrDslH6jMmxc11Q5H0QBo0spqQ1DKLawQao9pkNTZe50ioCddBrgzRM9fzhH3UDnNPG1rHYatx90nC/PfHE1kqXJp1si2LGUa5OiA9CrHUkZtVggylRVFgXxdVdZFlGuPoKTHZGHESJBcezG9ES8QvbgdiXcXHqtwcn318uLrr/jMVuiCrPNUTMUa6QWiGIlKOlkioePrO6HZXd/W6LZiJIwsUUwF+8Qb6T2SGA04dvgShDrHJarBBE78WxvAdw0MbKxldDaMfJagzcLczALleYqGdNZSfGFdKen2i5yo8tPxeK0pr1eJsuXYExaFdO3vReUsWWWL8aqwq3EpPaEbo7J+6wnLscfqYjL5+tukTD8LbC/0EauLLLD6MmIc7SKmO0HbKsBCTpu12I9E4+6pmJKrcT8ahvFIwweQPMRjA1cH4xlwnXX+kahF9Upbm/dgFj6BzY6ReNAdH3DABH422KMauCwX5uhmPIxEZbGRW88Rq40q6vQ8i8E8e59YXVbtJ+xgTk3+KEkqh/FNQ3YEK0t5A8Ngfs7QoVGYQiB8SCwVK5o+YKUHffn/MsxJbH+0Xw8bA6xbmD/TGKC5mv31jBF1eKPTMzvMDLTBie5QFAd0LuVdKFh9hF5zpZp/B0qaflm0WYYOUp0FVehQFLuTSJ8r3qzlNf+OKzSTv45ZBqRSrX/IXtfBXjGFuYFYuGJpXB40XILPbV2kUEpSefSkPqE7Yzft2xOqvSfWdOrImnJGSElCuNcyPP5q8ojZC92QaThEAqvLQ3fFKNnsqA2rPbrHLT+fIEzXB36KOLd84itrPHq+fzmZ8M+xANe14h4xESOhrCE0xHd6Hjr+1fPF3Tlju/oVFaegynGLQzqyyRCHLnXC3YhD8ooV+faURPN9SMf4YihEBWkq+GgWX/ePXiC+aqAQ+z1/eXZ5eQ7GL6ZyNrTMqwLhypCmbROOniTVvg2CFTZtMKawic3lIbPW7HierE2PustVTRzQxtLCNC20BB/Rh9ZOCcw4G8uyKmIy3hw61/YKKJsibFoxZMXQOZ5KwoTSeTG6hZEmHVsHrQfyDWMJKnSlpqa5bYeak3GHB5lIq8vKMbsmEJv5phH2o4WhszErintoPs8z3+fdABZYSVg+m0zgPzKFV/F8GWahpo4wlYVB5zifsIXW2M4JYRo77nAj8A1gK5tuY+w8kocHKQa9U6fDrtl3/vj6tnPOq3AQ3fKboRgNF9gPPxrknhVliSc+xOgGbP4GyOxHAt8RGs8TXZiX7nArpu28NRL3sqixP3dx+iuRctsMXWHiolxMxTgL85dHd98OX7UrxFS0LbqSRbGS6i5Z1V4b9P4i3k2ayIx+xi28YC7aZJaVY2rRYJfJt8mz4Vy/NSp31tjaw/OGjYfZy3kbZo3d2o6hLdrN5uBg/spZNsBhQH8/3RQz1qENtjj4thHTuVOuizDLax6oQw4MBfwQo5mz5eDKI/glZxoW8PMuT/nGKz12rGWWoaJjzqf3h1jEUbtxik6962AVMRKFVsipfbpra+6skipHuEwmYtSz7nQ83mw2iQxfE+vW4+apH/84f3710/XVxWUySXIqi+CdlfVUStMj/ArJabxHCBP/iYl3XRw9bZ6eNk9/7OYpplLCdzSuCqkNZ9ng6bsm0d2EVux2JHLrif/udivp8RdX7Pd8HNtUTn+pDh1PKqaZLDx+wKu/eNXk6y/hX7SBGsQ6FqCjFV1ThITgUeARQP3HLKM+AODpcu4TMXzaSD3SEuRBX29nt8cx1NOG6pGMc7YY/P3J6GmJ9fuWWB+wVn9z+DhV42NWWg/EeLuq+qMFG1pvPezhZ8Ld8h+nWToxvbndj0SOMkXXGxNnSmHVD4qzIfdoXPz+6rXY738DGe3UtA== +sidebar_class_name: "get api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +The Platform will make this request to the anchor every time a transaction is initiated by a client application without a `quote_id`. + +The Anchor must ensure that the sending and receiving customers specified in the request meet the KYC requirements necessary to partake in the transaction described in the request. + +The anchor must return the fee it will charge for the transaction. + +In the future, this endpoint may be used to provide estimated fees to client applications prior to initiating transactions. When this change is made, the request schema will be adapted to support the use case. + + + +
+ +

+ Query Parameters +

+
+
+
    + + + + + + + +
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
    + + + + fee + + + object + + + +
    + + +
    +
    +
    +
+
+
+ + + +
+
+
+
+
+ +
+ Unprocessable Entity. This status should be returned when the anchor + understood the request but cannot return a success response. An + example for when this response code would be appropriate is if the + sender and/or receiver is not permitted to initiate a transaction with + the specified amounts. In these cases, the Platform will respond to + the client application's request with a `400 Bad Request` and include + the error message provided by the anchor in the response body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
+ Error. The Platform will respond to the client application with the + same response code and body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/api-reference/callbacks/get-rates.api.mdx b/ap_versioned_docs/version-2.8/api-reference/callbacks/get-rates.api.mdx new file mode 100644 index 0000000000..e89903be15 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/callbacks/get-rates.api.mdx @@ -0,0 +1,578 @@ +--- +id: get-rates +title: "Retrieve Rates" +description: "Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must" +sidebar_label: "Retrieve Rates" +hide_title: true +hide_table_of_contents: true +api: eJztWm1v3DYS/isDHnCJD1qtk/SKYIF+cBP3zkCvLeIE/eA1vFxpZLGRSIWk7OwZ/u+HGeqF+xKv6+Tu+uJP9koUhzOceeaZIW9Eji6zqvHKaDETb63UTmb0y4EvpQelr0x1heCvDWijJ/ihVVeyQu3BaPgrmKKYZKVUGqRz6B08dW1WgnTw7vT1Kxpz6rGqpAWpcyiU9HD87s0B1K3zc906BPyYlVJfIljpsZMqLUJm6rrVKpMec/AGfImQVYoky6ap6IUyGix+aNF5pS95hB81SOHnEnX3jYNavse57oa7fsafKukLY2sojKUHWwtK1oc51DktUrlecj+T1FlJcxgo0GclKJ/O9Vy/Ya0yqWGJcKZ0zgu/wvOnpfeNm02n19fXqdJX6LxpMFcyzUw99WhrN1XT8YMPrfGYStccgLFzfVYoW99rkmJKQ8fPU3g7Lpf2ARprrlROz+DkNW8UfmyUDQZWBak3153tBwNKoGnZSKzoEU8YVO0nzJXLTKtpB8PuugYzVahsx066sK7B0kpnVZuzRyAswvgLlS+gkVbW6NHOddg03gvpjOZ1HCtfooWFw6q6kDWJX4CxsFi2q+H3taoq2pBOSA5KR5q5UYZLYNl60HiFFpbGlymcaF6SkzXCtVwlc42xyBwrdYV2dVGjL02+YHuy8K03tVx9ahGbYhNwSmcIQdRcd+pRzEXahZ+KNmcIO3qWzrVIhJeXTszOBLukOE/Ex4nDhh+dHv80efFMJOGfl/TSNBg84CQXM3GJPnyWiNE2YnZ2IxQBx4cW7UokQssaxUz4VYMi2QQXCs9Vg2AK9oZeV8xTOClgQe60COFm0TVGOwzu2dkHFuxrqjcp/2JHRXch/SIViXBZibUUs5uwhJlw3ip9KRKBuq1J0zGgRCJIpDi/TQQtRVnMxczbFm+T3WoNTril25EGlaP2qlBoeyzZBVe1fN9DVac+ub1yFHgdSLQuAJ4pCrSQK/pD0xSIDFvjkw7a2O1fBVknr93g3CSkd4OmXVYqg/e44sfRz16cbH1JGhDgwpWSQK7w7DCFPrB5L1C71uJcM0xvzNQFd3DkSEOopc9KJK+MRr/X5lqT4CVWhkwSYJQAliwU8IlVY/sMXhfUM7ri2IlkFrHNKQYihfKdGpHBcyyURrgukWPYWNDGz3X0MYNggHtyEd5dhnha5uhOAeFS+K5HRQeyupar4UtYnzPE5Kcc9vZTPjjG/c4A4zefcj62HBl4I2cpPSa9YhNM9FyfHfGsJ52Hd7N9Z2wt/ZiCLpUv2yUnHhe8rv87aazxJjPVdFmZ5bSWzqOdYmbcynmspw6byeHhi5dpnf+FxU7UmqhJwaIO9pjsvmE8aLfHgoOPd2YazbdlsBiN/4AWi3LpbpvxKwL2NUvsdcM7HC+Fn2mYNn7ARDJsZvQvbdZN48u1rP7AiBpn2KdbFBa/2i126gOjOnMd9IlpywMVYsplVxeZyXdn4bOT0x/hxbOvv548A1k1pZy8GJ0SdXqt3qvAIo29nNKv6cnpjxfhi4vuiwOg+ckuZIvWoX3iIGstZyaZ5xYdZaYea11p2oqJJWY+kLYR0jkL9KyRodzoYequsOh+LdvVlGwEjVSWcJlrCiIEys81wf6VVJVcVshZ6NoQpNeGCwoyi0L3QLMGqnEhC492p1mDqz9xkKPjTLGI2AnklFdpnV7VOFAEpuUBaeL0z8lMuUDlmGcH/h64QrDlXC8RJJy9e/sKaENffn34bKMgcIZ3UDkzobcTWsNE6nxCa+gwIi19XR1A0H7Mjd1+WfSt1bD46vAQvpX5XL8JOX1BS5Q6LhRYQaPJ3myjmAJQApZVi6RkFwL9bn9OHtxg1Dt3JbyKschYdtcQuFSCEqkKM23gV8iSwSSd7YMaxNxlUQRXxrmOzEBb3FiVRRpyYcMfurC9Q90yhoByHRUZ2FMEmRRZRhfqsrU9d7gbTSJw3Kw6PgMlP9Pcksrwnm5azJBYUwyqhTX179ziO0vAfSY/pzwcKh5H758fHtKfdeOetllGkCoSkRntUXsaEy15+oujgTfbgszyF8wouzWWqjqvghgiqftHqXxXObW+tpPXPTzHWPXDj2/h3enxayLXGhY0xTcjX16kxD9GhNwlJSCUmAkGLgKtLdHHox+sYer9xLPb7NeP0d3oK7SOBAVn4/oMc1iuYjZAi6Dk1Wq1RRrIzagls0mUEnYe0/alLhUWVO2FXoOVuaJ1yAoKpaXOMFmb9ZqBeklYW6C1XTUX+iZL6XpGyzVzjG7dkNCg6RsFHDhk9raSa2QEJrQk+KZT/m8Qt1O4NCxNlQOxSHh6ZrH40jSX5U66pbmDA96/mJjeaxfvYKoxnfs0Kz3xZLFg8Kg275Frve00Mpq1gjiBHJuuzjUaSnMdintqe3JAj17VISHpGvHUX6vqHcS1b9XF7POeqsYe8EU1LXAnLm21XMIbCM+XfV8lCMhpMYYaDE2PTdx0GhZKDQFWgx1rAdJ7q5atx3QLAr3xsrqf0XkoR0rgtJ2SrFaoOe+3d0MRSlP1DZ2slPaSbZzCvyjkOOgbiw65x6o0/GYKT1I4Ry9V5SKVpbWSSIXyWLv9uSdwj/sYjEYOOQgx4cDFj7JuKoTF0at/0tNFAotvrfy3qpTk3J3RfyF3hLenaK8I3sJP9FmnRyRu32qOwOPHXU4ZfOBBAdwheOdLoVuKmHb25Y5v79cJLFxbP41ep2Geg0XP6ZcI+KGVlQuzsMtSOlxrB5wF4w8rPk+EV76iJVMj+DvE1zz9m464iNvN70PU9G6//X305fqHISknG12HCP7O6Yt4tngRt4n46vnzbf70TjfWEIPi2vBYe+VXfT3lpW9dZJ5Q9WAeqEMEma3O0TpvOobbNzipVx8qGzph4opJgguEbWhmp3Mdjg4clUFu62iJozwMvuPA68l48MSQLYfaDPrSbK65HO665jQNWktVMCl/GUHgOnMZkLvrvS9NvgrM9QvxTV7Fzi7ULo656RXh68iNjvlB2PG/72LMPGDjVOl+Rg6mHU55BpNwx4OMy7b5HViGGbZHTbQ1HNe8x5WY9Sc/ieAaaecJEFUlXZ3Hxz988uNLMRNTLhwoPu1VfwrU2krMRJ9fMllVS5m9T5etUxqdm4SxaYfIXXM/M7UgMUoXhtTs+LWYiefpy/SrnaB4utJZaY02rYNXnRgHRz+dDGeL68VAfwAS6MXoCI01tBXdAcNd84Yi0Y3ng7XMsY+d0bFKRS0n32ExRT4fYwzRyrxJ7nA29lCKWVrgkxEv+jNqh9HR5FABj5I3x+8SEc7/OvcY1TvlXRGJqFSGhJ9DzhVHjcxKhOfpoUii3e06S5LfcnOp+9RNvz95dfzD6fHkeXrIPSX208Y4X0sdTfwGqQl3hdCfJ25k1yGkHm8jPN5GeLyN8Me9jRByGpHlaVNJpSndMdDcdInmLHSozhNRGufp980NNTTe2er2lh6HFiWln1wxrcvFrJCVwztA5embLnMewP/iQsJOLUMO7i5JdBlYCOq83l+PxxsHjzcOHnTj4A6PjO+3PNAtN8LrT3Ad4Q57rt3V+NIG/cPcTrjDgPFNjQfa77d2PWGvu/T9ji+j7//nysK+Lf0COj7eYdiD5euXQD7D0o/XGh5+reGODdq4TvIZG/R4w2HXcfs+oN2+zPDf2YI/+a2HPangrl04px9W0TaI2Rld0y5R5mijPuZRlmETZ5KtLuxaG/Mfx2/F7e1/AJJ2PqM= +sidebar_class_name: "get api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must use exchange rates that are communicated to the client application requesting the transaction. When clients make requests to the Platform for these exchange rates, the Platform sends this request to the anchor to fetch it. + +Rates can be [indicative](https://www.investopedia.com/terms/i/indicativequote.asp) or [firm](https://www.investopedia.com/terms/f/firmquote.asp). The anchor must provide an ID and expiration if the client requests a firm rate. + +Anchors can provide discounted rates specific client applications. The Platform includes the `client_id` parameter for this reason. + +Either `sell_amount` or `buy_amount` will be included in requests as parameters, but never both. In the same way, either `sell_delivery_method` and `buy_delivery_method` may be included in requests, but never both, since either `sell_asset` or `buy_asset` is a Stellar asset. + + + +
+ +

+ Query Parameters +

+
+
+
    + + + + + + + + + + +
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
    + + + + rate + + + object + + + +
    + + + + + + +
    + + + + fee + + + object + + + +
    +
    + An object describing the fees added on top + of the rate provided via the `price` + attribute. +
    + + + +
    + + + + details + + + object[] + + + +
    +
  • +
    + Array [ +
    +
  • + + + +
  • +
    + ] +
    +
  • +
    +
    +
    +
    +
    +
    +
    +
    +
    +
+
+
+ + + +
+
+
+
+
+ +
+ Unprocessable Entity. This status should be returned when the anchor + understood the request but cannot return a success response. In these + cases, the Platform will respond to the client application's request + with a `400 Bad Request` and include the error message provided by the + anchor in the response body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
+ Error. The Platform will respond to the client application with the + same response code and body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/api-reference/callbacks/post-event.api.mdx b/ap_versioned_docs/version-2.8/api-reference/callbacks/post-event.api.mdx new file mode 100644 index 0000000000..60a2b0972f --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/callbacks/post-event.api.mdx @@ -0,0 +1,2354 @@ +--- +id: post-event +title: "Receive an Event" +description: "Receive a JSON object representing an event." +sidebar_label: "Receive an Event" +hide_title: true +hide_table_of_contents: true +api: eJylWN9v4jgQ/lcsv+xLCJRWq1XeditO6ulut3f0Xq6tqIknxNvEztpOKUL876exHZIALdDrS4nt+eHxzHyfvaaWLQxN7unkBaQ19DGirwMDlRubTm4Hn2nk/o+vwo/LC1ykKtDMCiVvOE1opYx1CmhEOZhUiwrnaEL/hhTECxBGfp/++E7U/CeklmioNBiQVsgFYZIAysYPkkZUw68ajP2m+Ioma5oqaVFvsqasqgqROqPDnwa1r6lJcygZ/rKrCmhCvQEa0Uqji1aAwVnBO2uM1UIu6CYKA7sTEQVZlxgAq5k0LEWTs1QDs8Bp1Bs1ltnazNKcycXeJGitNI3or1pZ6ChIa2NVCXpWV9wNPe6G7S4H0tHkA0TQzZhcM0nmQJQEojJicyCZKgq1FHKRPMgBeTrg9RMZENbTuGSGhElic63qRe50TSe3BCSvlJDWxAQdqdiqUIwTYYiQblHXxBPJBBQ83jPdDw16gKJ+FD3v+5OjP37p/7LqYo7G3A9SaZWCMZhnth/Ts630TtEH1A31QvkiWBPGyy/k6+3Nm2acbGvApaMowVhWVodyMlO6ZJYmFFNmgEtRJCg+XgGdXeGnkvAjo8n9vhgWoNDAMf8FZquBikb0WUj34Y6PRpSVqpZ2Bq8VpD6rORgrpKvPGUtTnPYC2gKfMYtZboUt0Npd6810cju+opvow56cYuHygm4eN6ESP9wuDBTFzG/8nXlj4PD0vF69J+2m3xSG10poMLjL05NDi/RAf8NMU5YVs7fnXTorfShS/UY1tVAUTN/wT4YwDaHBG2JzZong2OKzFTaUQW1AG8IkJx5FyBQkx7r8KtNcaROReW2JVLaZ99DRWRE/yAf5m9KEuSUXY9I00siXlOChnojJVV1wbJOmzjKRCtc+Fcnqoli1fqFUo6MpzHlthARjPpFvLH0GyXfM7nkejIeUf3JbfCqhVMEZ0/GmNrCr7/PH1ZyUt4egxUUqgMd2/xoWwljQHUDwYY4xI5qKPqp/ImwO2jdBnxwkyBKlyZ/1K/DtAONcgzGNK0oO0pwJSfB47MrZxQictilcSV5YUcP2gB29aHe4FDYnjJic6daJiCxz0ODBqTeD3Xp7HjHdbNrusk17V0wd+HmjcwR4OKN6O8b+ck1r0/KGDzawjsrrRtNmg8N7ndZJtujShaZOj/WUr1FhKiWNNz8ejfDf/hl5HiMMMXWKuOzrMYA0Rl5yooHxFRarDtxRwqsNFNGBaWOKzBVfoTIoq5AtV0cNC/nCCsExFzX8dNh1SCvyTiakcWnhqUQJxrAF+ESAVwvSCCWNA9FnWNGkYc4RdVn4LoPePGJq21w19NlF2+Y0oUMITNqAfgHtDdS6oAnNra1MMhymrCjmLH2Om2Y18GtjeGVlVQBzHSVOVUnRELLlv1tePfGLmjxp8zDkyxustyUndDwaXw1GXwYXV3cXn5PROLm4jC9Gl//SPiHpU46+LcTyhLqYOEBPKIdKGWFbaE+okKlCVy0cYBx4JQho2qoNANopvSAm5JkCqrZnSmQAp0p4LrkTkZbHvBXhK4xwuDQcXdeE7vhKd1AZ6FmouOMSoRa67mvIaslNG4GZHzn7pM4IY8VWpbu2Yon0oyn4bNv+XK/eZtCpys/wI1xaTwhcE5MjCx1ZDY7POnV0aKceIfvfzd4tvGJBdeHnPe9AvkCh+uD0TozDVGMsfGIqq1qnsL0F9GF775LQDe0ZJ7RxTfTDprCDa8mK2S58nx5ZIjjeW/Ptuc52JTrDbwimBXLTGVclwxbVioYJyUrYbx2H+mnnbrI73I9c/yayM7q7tHvveC91wl2iAybdK0ZnW+3Nor+BA0fUj+YBprWj9nhZ9TlUV4UjMUJmjmwi7HruMI6/xFcH6eZ0JdNcK6lqQ64DHhu88RNTQSqy8FRFMtUnw57tk9uCWeR9SH6Qhrhbwft6OWQI9iR0G0NKxoHM/TVmq2+ZiwKIcGSn8/rBGjGSaVUiK3b5RTqvao4HPUhPHj6ZLSMySMZsDgZa0yzL8CGvZ3l3/SET7tKyZaHb7U0dfaERLUQK0rj8Dpn/tWJpDmQcjxD7tjQoGQ6Xy2XM3Gys9GIYRM3wj5vryffpZDCOR3Fuy8IRNuRYJZMdxdunSUkOvl12Hh/Pf8bsFPuwKrC0N8H7deB599TzvMeI5sj/knu6Xs+ZgX90sdng8K8a9Iom949IKLVgcwzaPSJDDoxjCm+Z57X3dHDneXvgn/tPpj3aeftjeodlH55aS8VRRrMlNi62pAml+NAbcGftx9a0YHJRe/D3OvHvPxlRn8s= +sidebar_class_name: "post api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Receive a JSON object representing an event. + + + + + +
+ +

+ 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. +
    + +
    + + + + 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` 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. +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + + 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` 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. +
+
+
+ +
+ The event is invalid or rejected. The response body contains the error + message. +
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/api-reference/callbacks/put-customer.api.mdx b/ap_versioned_docs/version-2.8/api-reference/callbacks/put-customer.api.mdx new file mode 100644 index 0000000000..8400f829a4 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/callbacks/put-customer.api.mdx @@ -0,0 +1,1119 @@ +--- +id: put-customer +title: "Create or Update Customer Info" +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: eJztWltv47YS/isE+9DuwpazblAUfkvTFAh6WgRNgoMiDmSKGkXsUiRLUkmMIP+9GFGyLpacHGALnAX8ksic0dw4M/xE8oV69uDo6o6el87rAqyj9zP6PHdgquHri6v5D3RW/f+0rB+Wp/XD95+QOwXHrTBeaEVX9OPHmxzImeK5tuRKMp9pW5BUgyNKe2LAOuE8YWpLeK2T/PrnOUmZZ9HHj2u1VijAwt8lVHwpseCMVg5Ipi3xuXAEVGq0UJ4wC0SkoLzgTBKvic9hre42V7c3ZNHI39x/l3tv3GqxeBA+L5OI62LhPEjJbPN/bqz2mmu5SKROFgVzHuwCuHZb56FYODDzk5NPy6hIv2kEz03pP6zVqK0pZEJBSoQiIXgRunYuBaDZxkjBGYbMkYJ93vnryJPwOXpBMi2lfhLqYReLRKfbGXnKBc+JcBiNJ2ZTSGu/CauCHtXBd2tVlM6TRyZFyjxU5jXhR3aMODHMOUhnte2+tKqiNR5+68hGpJuI/NHYx7XyTCi0Syu5Jc5bfM4EyBStl3KtEpgyjrCOh5tOGBZ/Oa02lXQMkN8aGFW6VolQzG67Csl79RWl9MIw6xeYlHMMwEDlWtEZ1QZsZdRlSlfUlL4pDjqj9Vz8pNMtXb3Q+mV8HDqDY47nUDB8Qul0RXXyF3BPZ9RY1OIFOKSKFP/2Cwmr4PJnorPehKBDYZ5CbvmqVuqc0xlhxFh4FLp0BGugNjeis8aCMF/0dUYZ57oMtu9rvg5VQbQlv5XPkJKzwE1Y6fNQbx7SNra7Sn8ULCT8yajSAgo9rhEpmKxlU9HZFhOLta5XyhhxObOQktp8LAiwUBnRp2CNbOrnzaQxcRgdswgpGNPKstKF3Gpse9OwfY0zCqossK2KlM5ozlyOPPDs6f1rw3zIEMZxsJ8PwpEEMFC//nmeYhlEa3UNIR53N/jitQEusjo1v3QrRNPmrqvhA0k1LwtQvtv9qt5daGzXKtPRWv2iLQlrCNnqknCm6paJPy3RT6py2zVJjn0qdIJMPJShPjtilqeY+POm64Y82jgwy9P5bh3AYOE8hjLfSwdvmXIhxvFURXZ4iKjzP3TkQdtEN1Efc05zgcUSkf/moCqCLSr7SWZ10Z/OFAyo1JEwzWvV1fcdRA/RrI1iI0W4qs4FJh+GWTL7gJ2iwDR0H8adzYR1PlasgE57asmSHaKyNBWomsmDPBaci6tisNuY63Sc0XnmIdY2NlY/CsXHubjw21GC0c4zOS2+tmOUVuhESIhVWSRgRzmgYELGh2Qkwvo8xhV2nzyjYZboilYMO3Yj2YSfgf5m0BKmPk/HvqLWfeiQdz2+pv9M6HpDism1OhjJiiuxuC4fDPizB4uJVWV+BjZuloz9lJAsOaiSJ2XMpGAHJ7/QCraHpPT4qhxNp/TZrfH6YLbULOPL4M9gLPDQK24dkM14MDZEKOeBpaOLmmfPdfeaIE2njea8NCwYM1oLRuot2GkBO45DIZBMPZTsAaaTW6TTySjSt4tDpLFwroT3V6VIY3g2Iiwr/9NrBxJHmINxcPA8Om4hA2uZnJrFXtOKH8Hult63O9hb7Jgkwkscumpxb43DK/IIhj4i3SPSPSLdrwnpHsHfEfwdwd8R/B3B378G/kyuvcaAZ1YH6DEpMOxo9l5KGP/8zneU9sxuY2YwO5mMdRY3Yt4p4Q2cGqQZq3UWW3AIC8ba16joKYzblamzWCiux7JqPEjNW1I8ghq1evS9/z9c/VuDpVuA/VoZGlBu5djy5GS/V1yXnINz2AK+6A70O78Ggnm1tadjBl6q6tghnOp8OSvBWj3xrTVhf7Mxhlg0vH3fOnVRDTRunO678bv25BddqvRr8KFeP5XDUyW6unuhn2FLV81p3oxWUPF9p3qv9/jN4HNdn4CgF8zndEV3p2oUq9s+4pEh6iqtpCvaQG7OpMQeFiWlE1ij88AbwTMrjIT6qIrrgqIqjOEf7cnKRWBq8rKt6t2HXDsUFtP+73oBCR8fw84w3OXt9IwOKm5HO2C4Y8gQA/dII9C3pY8g3pYYgG77u4dv93T0/O6j2c6XWB/EtoQudqXLk+Xp/OTH+adTOoCpwxem/OqA0sHgEItOkIcT1UOeg+E+4BwQBzizE4oJeNmJfw9VdsZbMLkX8j6GnCC30LEjdIAY9yhD6xp0NxzZC3sXy3UzoQfhRggjpgwAW0vY4bTe0FR2DFBZP9/GANgex36Au7ilU18IOdqfvVV/olwGq/dE7UxwYeNWWQXosRkG2jL6MUK7R7abtornVivctzqvu6QjZ1eXpLe3UN91aLenhjcqjNW4vETNhYlpuWGnwLVXDAqWAkm2/d2sp1xIIKLaSzJWI7wIm1LN7YPqrIoRvneDISI3eFIVWvq3brdJ5+qjeNe53cCyDLjvax7yj6kI2xj1kte6d10tKpilggNCktULrZP7zDCeA1lGJ3TWWZxWi8XT01PEKmqk7cOiftUt/nN5fvH79cV8GZ1EuS9ktfZiAy6Y6gg+t4C3KbQlt6a6V9HgInKJaTCY884VgePVmOPVmK/9akzd8XEnd2EkEwrbX1VdLzVAvKM7gHg/o7l2HsdeXhLm4NbK11cc/rsEu6Wru3sEpVawBOv6DreGc2DVKrlDr+fBhjlu8LYYdvQY4nXWvHTGORjfYd8D7D2Ae3V7g9ihvtNThKUL5VZiZ+0j2vj6+g+SqOe8 +sidebar_class_name: "put api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +**The Anchor Platform does not persist any customer KYC data.** + +The request and response for this endpoint are identical to the [`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) request and response defined in SEP-12. + +Client applications make requests with the following request body, which is forwarded to the anchor. Anchors must validate and persist the data passed, and return the customer's `id`. Requests containing only string fields will be forwarded to the anchor as with the `application/json` content type. Requests containing binary fields will be forwarded to the anchor as with the `multipart/form-data` content type. + + + + + +
+ +

+ Body +

+
+
+
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

+ Body +

+
+
+
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Invalid data.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Not Found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/api-reference/custody/README.mdx b/ap_versioned_docs/version-2.8/api-reference/custody/README.mdx new file mode 100644 index 0000000000..9632f1a96f --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/custody/README.mdx @@ -0,0 +1,19 @@ +--- +title: Custody Server +sidebar_position: 30 +--- + +import { MethodTable } from "@site/src/components/MethodTable"; + +The Custody Server provides a set of endpoints to interact with custody services, such as Fireblocks. + + + +| | | +| -------------------------------------------------------------- | --- | +| [Custody Transaction](./create-custody-transaction.api.mdx) | | +| [Payment](./send-payment.api.mdx) | | +| [Refund](./send-refund.api.mdx) | | +| [Unique address generation](./generate-unique-address.api.mdx) | | + + diff --git a/ap_versioned_docs/version-2.8/api-reference/custody/create-custody-transaction.api.mdx b/ap_versioned_docs/version-2.8/api-reference/custody/create-custody-transaction.api.mdx new file mode 100644 index 0000000000..a683a68837 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/custody/create-custody-transaction.api.mdx @@ -0,0 +1,275 @@ +--- +id: create-custody-transaction +title: "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: eJytV0tv2zgQ/isDXvaiyNnsAwvd0jTFBvuoscme0hzG1NhiQ5EqObJjGP7vxZDyI4obtN31wVZG8358M9momqIOpmPjnarUVR/Z12u4pbCkADoQMkXQA5kDuohamCGQ9qEG4+Dtm1IVyncUUN7c1KpSWXJQd3cQU4ViXERV3e9tHb2N6qFQT2eRusRxez09+1UV6ffi5+Hhpx+FKdCnniK/8fVaVRulvWNyLI/Yddbo5MnkY5SoNirqhlqUJ153pCrlZx9JsypUF8RvNhTlranl+3lKbq+nz+K+eSvRDnoiB+MWaluollr/Uvgvaj0s0fZUADfIYCL0kWpgD6Ymx2a+BuNmvnc1+AC+5/zc4bolx/GLtu4ScWxPqODnIBz/m8VCketbKYipVaEajI3w0BOrh21KIXvt7UtvpsMb8WiUxtesSMlTuaXU20LNg28vtfZ9LvCoPL4PmuCWyVoMgJnvZNrYf1HLW4psXGqar1KF7Wk9l4ku8XJDgDESH8oQyfEkkCazpPoVte/oRGXfEX1VGkWLmD3h27d682jciXn4w0jj5AC/oag1dT4aGbmV4aYOuEKrZI6TA+phmz5CiJ13Mc/jxfn5iYr3WlNMffqdY58t/XJK+Y1jCg7tDgGvQ/Dh+y1loDKBaskBJWUPY9TJ5IPsrgLSsoYtHXA5ezNkip6YXEyoWd1v1COtVbUDz0Il0HkVRLcPgiTceMHrzscEh8iNqtSEjzG5UDElI9vpg1WVapi7WE0mw2Y4yxwlPWHbWUKnGx9K7VslViRL/xwA+zoz7QD30CsZQ5//nXEuI88BaRJGPMOFg9TRmB+Iu4EdU9KsHRHz6BwIeQb23bstlHHzBPSSkNwzF+VvpSR2VKyhhVQxxuiG9gs1DnvWO0eao4A0SQd2wUSCFVpLDF3wS1NTiAXEXjeAEd6ZQDPr9WMsRCaSqwFdDcM47cEc5j4cT2gE4wwbZKphaTAN8WUqFkwt8tyHtoS7JsFDWBpNghToAG0aCxbd7PPsDzD5fjYEIaZmfTSOYqQIq8bL4gHvaAcXse86H8T2PqQSbhxgXZsEvYPqee+St2gNr8HP5xSohtn6pN0iUceHS/I5epijNtYwMr3cdGJOW0OOf4hj1BfH5rD2fVYjgYgZWibBITnFM1Vr3x/EYWWsBQ5msaAACL/f3U1Bo7Uz1I/QYk17kV3OhmYoP7gPbm87ENZraHBJUgbjmBb5ygKB0axg1CYpIQ5Yqqh923lHLiG+8ww7OCqkpI3vF81JJ7L7jvLd4Hy6Gk40C6zEFO7yIBvP69xeyT90LySOb6kV5j0kRnwAGejszrga+2bdq7mc3qRMXfUhkGOb3fPOrk+0mUR/GJnyg5yh1mhyMaGQw1bm9rJD3RBclOeqOIK5ajJZrVYlprelD4vJIBonf95cXf99e312UZ6XDbc2YbZAaYvuSPFVOobhxME7BoejS/a/3OLDIpETbdJZNE6AK0W0GSD+XvHo7G5kA1T3arOZYaR/g91uhfypp7BW1f2DrJRgcCYQdy9nWUNYUzjaPVfZ9bME2fsN9HJfboudxKXW1PGrvMdLavr+9k4VajYc/a2vRSbgSvYsrlSl0v8hOaRqk2kbZdEtelwIb9Ypn880aYvU +sidebar_class_name: "post api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server creates custody transaction record in DB. + + + + + +
+ +

+ Body +

+
+
+
    + + + + + + + + + + +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    +
    + object +
    +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/api-reference/custody/generate-unique-address.api.mdx b/ap_versioned_docs/version-2.8/api-reference/custody/generate-unique-address.api.mdx new file mode 100644 index 0000000000..17db5e93f5 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/custody/generate-unique-address.api.mdx @@ -0,0 +1,209 @@ +--- +id: generate-unique-address +title: "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: eJylVlFT20YQ/is799IXIVMgoaM3AyZhSlKCSZi2yQzn08q65HSr3K1sPIz/e2dPsiGG9qF5kkbe3e+7/b7d84MqMZpgW7bkVaFOu8hUrmCKYYEBjHYuAtcIhnxl513AEswQEzEsrEFggjl6DJoRSmwpWgZdlgFjBO1LaLCh/LP/7M8pNJqBKrjTMSLfQauDbpAxwB7cRUbndCg+Ts9OizcnJ2dHxxfnry9vfz++On53Nvk0Pb29Pj67+nj76fD9n4dnNx8mn84vj96Pb47GH94e/nV5eX45fnX32atMUSt0LPmLUhVqw+6jt987HPfUVKZYz6Mq/t4euv8dNgFfMnW/F7FNMdPJ1d5rlaXnwdHwcvirBAX83mHkEypXqnhQhjyjZ3nVbeusSURGX6M0+EFFU2Oj5Y1XLapC0ewrGlbr9XottWJLPmKUgIP9fXn8qNC0MwZjzFX2f5Ey1QZpENseZtDqOdTZjphMsKytqXtDOIueIdbUuRIi+hKqzpeJ2IAXOVg/V+tMiQWe13+HDcFCuw4z4Fpvi81QILEUwFavGsGZrZ6g/ivGTfq4iyNfxXUS8dNImULfNWIJW6pM1TrWEoP3rL6IgmzZSfibl0x3Pcg7qP3qJYEvPGPw2m1mcBIChZ+SWwxqA5ZCGqWauPZHD/SfH3M3bX1yoGFKEp3Ef50pvGf00ZKXGXlQ33Clis3QZCpJ+5/Ds/4iunFNMqYtxWROzbUq1CitiDgq0nM0eBClbkyN6SG74FShauY2FqPRsJr2+ogc73XTOtTe1BRyQ40SQGnY9ePMTvogVTysM2V9lYwq9Xs5DvLfcqG804ZBHZXtek2s82RByhIl79Fwmh8UcdtgI8JSO4cMbaCFLTHEDGJnatARzm3AmSPzLWaSk2ZLFmlAg3aBG6dGqCgAB+2jNgIfwXrLVjOWsLA62Xiczg5XTnNFocnhprZxu7qtbGjQLjmOpTZTSpv2uxj+mA2HEKhZF61PIsCyJugiAvk0WZISu7alINjbI+Vw4WXArLDblK46n9hqZ3kFVFUol8owdbu4Wfr67FYSzpGg0sY6y3LxUMcz6nz52BymYYZ/iduy2hjqPAuxClbU9WXkIAKDi5Q4NCf7odSKusd0WFrngIOdzzGAhrc3N1fprpxp8w0aXeI2ZdOzwQzpHtxiB9TlCmq9QJHBesZ5f23B0nLdF9ixSWqIBxYVDTUtedlZNoInhs2gZyJpTd28fpFET99jv/c8sa1WL5kFlgKlt5tRx0imt1fip/2zjCduhKUWQM8CQgGqQE1PZ1eNrVm3ZcZXF6lTp10I6Nn19Mi71Qs2k9M/jkye/gA4a1D2bPGgvG5kbsetNjXCQb6vsidboxiNlstlrtOvOYX5aEiNo8uL08n76WTvIN/Pa26cLL1/AFWlP4c= +sidebar_class_name: "post api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server calls the configured custody service to generate deposit address and memo. + +Format of `asset` parameter - `stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5` + + + + + +
+ +

+ Body +

+
+
+
    +
    object
    +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + + + +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/api-reference/custody/send-payment.api.mdx b/ap_versioned_docs/version-2.8/api-reference/custody/send-payment.api.mdx new file mode 100644 index 0000000000..f1b1bcb05b --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/custody/send-payment.api.mdx @@ -0,0 +1,369 @@ +--- +id: 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: eJzNVstu6zYQ/ZUBN90ocuqbFq12aeqiBoo2iL0o0NwFTY0s3lCkyhnZEQz/ezGU/IjjtkC7yUoCyXmcM8Mz3KkSyUTbsg1eFeqhIw5lDwuMG4xgtHMEXCOY4Cu77iKWYMYzhHFjDQIHIPQltLpv0HOuMhVajFpczktVKNl9HDZVplivSRV/qHGF1OdMvd4Qtml1MXu8+VZl6Tu9G38+fS2HIv7ZIfEPoexVsVMmeBaPxU7ptnXWpICTLyRAdopMjY2WP+5bVIUKqy9oWO33+734ojZ4QpID09tb+bxlYtEZg0SC5j9GylQbhQi2Qxhbnp0hjtavVXYRdfbKGL12sPwd5j9CFUNzyXeuBABbduJnceL2acQ0Qry7hmruN9rZEp4GLv8XOqmHjVhK2TDGEKVIbyEPy+9QnwMYO26WTh4yv3uf+aEzl1F70kZWwRL4wFCFzpcfFMr0+7+HshgvUNSM4GxjWRDhq0Es8YMC+uZ6V41dO8pGMvio+X/694JYgs7rjbZOrxx+RCD7TOEroycbvOjmTr1gr4qDkGZqo12H/yio+8+ZapDrIBLdBkqCpblWhZrw6ZLRpLDlpD2IdaYo1XgI2kWnClUzt1RMJqNQ3QwncnzVTetQe1OHmJvQKAkplD2dlHw2HFLFbp8p66sgRIj/oTLT/Ltckr4gYmy0d/K5lEl1JpcywoL3aJhkTKH0aRstIWy1c8jQxrCxJUbKgDpTgyb4yUZcuWBeKDuONu1LiGjQbvAw5giqEOGcKLDestWMJWysTlPzPmGHR6e5CrHJYVlbOg5OS6A9aJcuD4tvDslsweicjvDbagQhoVYdWY9ESLCtA3SEEDxCqJIJdW0bosQ+Qsph7kGXpU1aObquOp+y1c5yD6GqUEb6qr8aN0ur794EkjMFqLSxzrKIV+h4JSJ8IocDGGfR81d0dKuNCZ1nSayCPnSDGwEiYXCTDEdysjeu+tCdzGFrnQOOdr3GCBp+Xi4f00tlpc0LNLrEo8mBs7EZ8mf/7I+xI+qyh1pvUMpgPeN6eLTA1nI9OLhok0SIB5YqmtC0waPnwxg6XPVMSlqHbl1fTWJI3yOWkqYPbKv+WrPAVkLpAw+giYIZ2ivlp/07i7NuhK2WgJ4lSIjDSyKlc1mNY7Me3dw/zhNTD12M6NkN6QXv+ittJuhPVyZ/9ipTzhqUh0ixU143cm/vW21qhGl+q7Iz1Sgmk+12m+u0m4e4noymNPll/jD7dTG7mea3ec2NE9n7C3X2yKY= +sidebar_class_name: "post api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server calls the configured custody service to send payment. + + + + + +
+ +

+ Body +

+
+
+
    +
    object
    +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Invalid Request.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Transaction is not found.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service rate limit is exceeded.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service is unavailable.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/api-reference/custody/send-refund.api.mdx b/ap_versioned_docs/version-2.8/api-reference/custody/send-refund.api.mdx new file mode 100644 index 0000000000..a1a5f2847c --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/custody/send-refund.api.mdx @@ -0,0 +1,411 @@ +--- +id: send-refund +title: "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: eJzNVktv40YM/ivEXHpR5DSbFq1u2ayDGugjiH0o0OxhPKKs2Yxm1CFlRwjy3wuO5Edsd3vYHuKLhXl85Edy+PFFlUgm2pZt8KpQtx1xKHuYY1xjBKOdIzDBV3bVRSzhcN8aBA5A6EuIWHW+zHf7HLUnbQQVIpoQS7AE2lEAE1EzlmA9fPqYq0yFFqOWk7NSFUrgHhKayhTrFaniLzUskPqcqecLwjYtzqf3Fz+qLP1fXY8fH76XQxH/7pD4Yyh7VbwoEzyjZ/nUbeusSeYmX0g4vygyNTZavrhvURUqLL+gYZWpNopzbJFkt8EmyP/bkP2GTYC1dh1mwLVm2FjnYImgyxJLiRDXOAYIWt036Floj7aIo/Ur9Zol+EVaPDYhqxAqkBPfaEQ3oRsi8dbETVo/Ah/wsPwK0h2e8fcOk7t7l84ApJ9kitrgaQjw1eXlKdi8MwaJBOJ/yqMtD86M/mRHVqfPjNFrB4s/YfYJqhgaMGNx01D8uRICbNkJzhx9eT8E/mHkpAaK1+dYzfxaO1vCw1Cp38ROqt1GLOVRYIwhyhN4S3lYPmF9SGB8utN0cuv59ann2ye+OHjilsAHhiqMuX6HVK5+/ncq224WNSM421gWRvhsEMfqf3+EfjhfVWPVjv07XXiv/n/474RYgs7rtbZOLx2+RyKvmcJnRk82eFGlF/WEvSq2MpWppAxflavXz9L7uQ4if22g1LA016pQkwMdpUlhy0kclTBTlFI82OyiU4WqmVsqJpOxT10MJ3J81k3rUHtTh5ib0CixKBF72MvkdDi0l7l9Y9zr0n5tKyPHK0kODkTC+ipJpng6pPgq/ykX9kcRHSv2pA8vanzTd2UoCd6jYRLVQyn4NlpC2GjnkKGNYW1LjJQBdaYGTXBnIy5dME+U7QYWnYYWg3aNW70kqEI8nFwIrLds07Sytjrp2U2KItw7zVWITQ6L2tJWEdKM40G79ApZsEdlnjM6pyP8sRxJiKllR9YjERJs6gAdIQS/U07q2jZEsb2jlMPMi+Lb1HRH6KrzyVvtLPcQqgplUFv2Z+1mafVkyvPDaFZpY51l6YKh42U4GCZStI2z6Pk72sFqYyTr4lgFfegGGCEiZnCdLo7Byd5A9aHbXx8GDo52tcIIGn5ZLO7T7LnU5gkaXeLuyjZmYzHkj/7R72xH1GUPtV6jpMF6xtUwWcLGcj0AHJVJCogHliya0LTBo+etnm17RiYprUO3qs86MbjvcRjEfGBb9eeKBTZiSm/jAJoomKG8kn/an9w4nKM3Wgx6FiMhDiNJcuc4G7ti3cHc3M9SpG67GNGzG9wL3vVnykzY759M/uhVppw1KBNN8aK8buTd3rTa1AhX+aXKDvpPMZlsNptcp908xNVkvEqTX2e309/n04ur/DKvuXHSP/8BrbBp9A== +sidebar_class_name: "post api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server calls configured Custody Service to send refund. Custody transaction record is also created in DB. + + + + + +
+ +

+ Body +

+
+
+
    + + + + +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Invalid Request.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Transaction is not found.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service rate limit is exceeded.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service is unavailable.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/README.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/README.mdx new file mode 100644 index 0000000000..33ec426998 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/README.mdx @@ -0,0 +1,17 @@ +--- +title: Platform Server +sidebar_position: 10 +--- + +import { MethodTable } from "@site/src/components/MethodTable"; + +Data on the Anchor Platform is available through two different APIs: A REST API and a JSON-RPC API. Each of these APIs has associated documentation here. + + + +| | | +| ------------------------------------- | --- | +| [REST API](./transactions/README.mdx) | | +| [JSON-RPC API](./rpc/README.mdx) | | + + diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/README.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/README.mdx new file mode 100644 index 0000000000..60798cab01 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/README.mdx @@ -0,0 +1,10 @@ +--- +title: JSON-RPC API +sidebar_position: 20 +--- + +import DocCardList from "@theme/DocCardList"; + +Interact with your Anchor Platform instance through the use of lightweight, easy-to-use RPC requests. + + diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/anchor-platform.openrpc.json b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/anchor-platform.openrpc.json new file mode 100644 index 0000000000..8d10c9b7e2 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/anchor-platform.openrpc.json @@ -0,0 +1,9298 @@ +{ + "openrpc": "1.2.6", + "info": { + "title": "Anchor Platform", + "description": "The Anchor Platform is a set of tools and APIs that enable developers and businesses to build their own on and off-ramp services for the Stellar network. It provides a standardized interface, including the implementation of several Stellar Ecosystem Proposals (SEPs), to make it easy for businesses to integrate with Stellar-based wallets and exchanges.", + "termsOfService": "https://stellar.org/terms-of-service", + "contact": { + "name": "Stellar Development Foundation", + "url": "https://stellar.org/connect", + "email": "hello@stellar.org" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "3.0.0" + }, + "servers": [ + { + "name": "Platform API", + "url": "https://platform-server.exampleanchor.com", + "summary": "Example URL endpoint for the Platform Server.", + "description": "Example URL endpoint for the Platform Server. Note: This is an example URL only, you must configure your own Platform Server." + } + ], + "methods": [ + { + "name": "do_stellar_payment", + "summary": "Submits a Stellar payment", + "description": "Submits a payment to a stellar network by a custody service.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "do_stellar_paymentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "do_stellar_paymentExample", + "description": "Example request to the `do_stellar_payment` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Do Stellar payment" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "do_stellar_refund", + "summary": "Submits a Stellar refund", + "description": "Submits a refund payment to a stellar network by a custody service", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "refund", + "description": "An object describing refund associated with this transaction.", + "required": false, + "schema": { + "type": "object", + "required": ["amount", "amount_fee"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount to be refunded", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount of assets to refund", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of refund", + "type": "string" + } + } + }, + "amount_fee": { + "title": "amount_fee", + "description": "Amount of fee", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "The amount of fee", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of fee charged by anchor", + "type": "string" + } + } + } + } + } + } + ], + "result": { + "name": "do_stellar_refundResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "do_stellar_refundExample", + "description": "Example request to the `do_stellar_refund` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Do Stellar refund" + }, + { + "name": "refund", + "value": { + "amount": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_amounts_updated", + "summary": "Update transaction amounts", + "description": "Update amount_out and amount_fee values", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + } + ], + "result": { + "name": "notify_amounts_updatedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_amounts_updatedExample", + "description": "Example request to the `notify_amounts_updated` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Amounts updated" + }, + { + "name": "amount_out", + "value": { + "amount": 1 + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_customer_info_updated", + "summary": "Customer info updated", + "description": "Additional customer information was received and updated.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_customer_info_updatedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_customer_info_updatedExample", + "description": "Example request to the `notify_customer_info_updated` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Customer info updated" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_interactive_flow_completed", + "summary": "Interactive flow completed", + "description": "Platform has collected the transaction amounts and fees from the business", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + }, + { + "name": "amount_expected", + "description": "The amount expected in the payment", + "required": false, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "notify_interactive_flow_completedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_interactive_flow_completedExample", + "description": "Example request to the `notify_interactive_flow_completed` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Interactive flow completed successfully." + }, + { + "name": "amount_in", + "value": { + "amount": 1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_available", + "summary": "Offchain funds are available", + "description": "Funds are ready for the user / recipient to pick up.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "notify_offchain_funds_availableResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_availableExample", + "description": "Example request to the `notify_offchain_funds_available` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Offchain funds available" + }, + { + "name": "stellar_transaction_id", + "value": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_pending", + "summary": "Offchain funds pending", + "description": "Payment has been submitted to external network, but is not yet confirmed", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "notify_offchain_funds_pendingResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_pendingExample", + "description": "Example request to the `notify_offchain_funds_pending` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Offchain funds pending" + }, + { + "name": "external_transaction_id", + "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_received", + "summary": "Offchain funds received", + "description": "Payment is being processed internally by anchor", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "funds_received_at", + "description": "The date and time of receiving funds.", + "required": false, + "schema": { + "title": "datetime", + "description": "A date and time.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + } + ], + "result": { + "name": "notify_offchain_funds_receivedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_receivedExample", + "description": "Example request to the `notify_offchain_funds_received` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Funds received successfully" + }, + { + "name": "funds_received_at", + "value": "2023-07-04T12:34:56Z" + }, + { + "name": "external_transaction_id", + "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + }, + { + "name": "amount_in", + "value": { + "amount": 1 + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9 + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1 + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_sent", + "summary": "Offchain funds sent", + "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" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "funds_sent_at", + "description": "The date and time of sending funds.", + "required": false, + "schema": { + "title": "datetime", + "description": "A date and time.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "notify_offchain_funds_sentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_sentExample", + "description": "Example request to the `notify_offchain_funds_sent` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Offchain funds sent" + }, + { + "name": "funds_sent_at", + "value": "2023-07-04T12:34:38Z" + }, + { + "name": "external_transaction_id", + "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_onchain_funds_received", + "summary": "Onchain funds received", + "description": "Notify that the payment is being processed internally by anchor for SEP-6 or SEP-24. For SEP-31, notify that the payment is being processed by the Receiving Anchor. In the request, amount parameters are optional, but have a strict rule of how to set them. Either none, only `amount_in`, or all of fields (`amount_in`, `amount_out`, `amount_fee`) must be specified. ", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "stellar_transaction_id", + "summary": "Transaction ID on Stellar", + "description": "The unique transaction identifier for this transfer on the Stellar network.", + "required": true, + "schema": { + "title": "hash", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + } + ], + "result": { + "name": "notify_onchain_funds_receivedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_onchain_funds_receivedExample", + "description": "Example request to the `notify_onchain_funds_received` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Onchain funds received" + }, + { + "name": "stellar_transaction_id", + "value": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e" + }, + { + "name": "amount_in", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_onchain_funds_sent", + "summary": "Onchain funds sent", + "description": "Transaction flow is fully completed for SEP-6 or SEP-24 deposit", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "stellar_transaction_id", + "summary": "Transaction ID on Stellar", + "description": "The unique transaction identifier for this transfer on the Stellar network.", + "required": true, + "schema": { + "title": "hash", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + } + ], + "result": { + "name": "notify_onchain_funds_sentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_onchain_funds_sentExample", + "description": "Example request to the `notify_onchain_funds_sent` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Onchain funds sent" + }, + { + "name": "stellar_transaction_id", + "value": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_refund_pending", + "summary": "Refund pending", + "description": "Refund has been submitted, but is not yet confirmed", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "refund", + "schema": { + "type": "object", + "required": ["amount", "amount_fee", "id"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount to be refunded", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount of assets to refund", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of refund", + "type": "string" + } + } + }, + "amount_fee": { + "title": "amount_fee", + "description": "Amount of fee", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "The amount of fee", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of fee charged by anchor", + "type": "string" + } + } + }, + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "notify_refund_pendingResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_refund_pendingExample", + "description": "Example request to the `notify_refund_pending` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Refund pending" + }, + { + "name": "refund", + "value": { + "id": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e", + "amount": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_refund_sent", + "summary": "Payment refunded", + "description": "Refund payment completed", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "refund", + "schema": { + "type": "object", + "required": ["amount", "amount_fee", "id"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount to be refunded", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount of assets to refund", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of refund", + "type": "string" + } + } + }, + "amount_fee": { + "title": "amount_fee", + "description": "Amount of fee", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "The amount of fee", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of fee charged by anchor", + "type": "string" + } + } + }, + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "notify_refund_sentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_refund_sentExample", + "description": "Example request to the `notify_refund_sent` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Refund sent" + }, + { + "name": "refund", + "value": { + "id": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e", + "amount": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_error", + "summary": "Transaction processing error", + "description": "There was an error processing transaction", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_errorResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_errorExample", + "description": "Example request to the `notify_transaction_error` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction error" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_expired", + "summary": "Transaction has expired", + "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" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_expiredResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_expiredExample", + "description": "Example request to the `notify_transaction_expired` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction expired" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_on_hold", + "summary": "Transaction transaction is on hold", + "description": "Notify transaction is currently on hold by the anchor (e.g. compliance hold). Anchor should update message to guide user through the steps.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "user_action_required_by", + "description": "Time and date by which user action is required", + "required": false, + "schema": { + "title": "datetime", + "description": "A date and time.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_on_holdResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_on_holdExample", + "description": "Example request to the `notify_transaction_on_hold` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction on hold, please contact customer service to lift the hold." + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_recovery ", + "summary": "Transaction recovery", + "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" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_recoveryResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_recoveryExample", + "description": "Example request to the `notify_transaction_recovery` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction recovered" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_trust_set", + "summary": "Asset trustline set", + "description": "The user has added a trustline for the asset", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "success", + "description": "Flag which indicates if trustline was configured by user.", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "result": { + "name": "notify_trust_setResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_trust_setExample", + "description": "Example request to the `notify_trust_set` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Trustline set" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_customer_info_update", + "summary": "Customer info needed", + "description": "Additional customer information is required", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "request_customer_info_updateResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_customer_info_updateExample", + "description": "Example request to the `request_customer_info_update` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Customer info requested" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_offchain_funds", + "summary": "Request offchain funds", + "description": "The user has to initiate transfer to the anchor", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + }, + { + "name": "amount_expected", + "description": "The amount expected in the payment", + "required": false, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "instructions", + "description": "A set of SEP-9 fields that describe how the user can complete the offchain deposit", + "required": false, + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The SEP-9 field name" + }, + "field": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the field" + }, + "description": { + "type": "string", + "description": "A human readable description of the field" + } + } + } + } + } + } + } + ], + "result": { + "name": "request_offchain_fundsResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_offchain_fundsExample", + "description": "Example request to the `request_offchain_funds` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Request offchain funds" + }, + { + "name": "amount_in", + "value": { + "amount": 1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + }, + { + "name": "instructions", + "value": { + "organization.bank_number": { + "value": "123456789", + "description": "US Bank routing number" + }, + "organization.bank_account_number": { + "value": "123456789", + "description": "US Bank account number" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_onchain_funds", + "summary": "Request onchain funds", + "description": "The user has to initiate transfer to the anchor", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + }, + { + "name": "amount_expected", + "description": "The amount expected in the payment", + "required": false, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "destination_account", + "description": "Destination account", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "memo", + "description": "Value of memo to attach to transaction", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "memo_type", + "description": "Type of memo that anchor should attach to the transaction", + "required": false, + "schema": { + "type": "string" + } + } + ], + "result": { + "name": "request_onchain_fundsResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_onchain_fundsExample", + "description": "Example request to the `request_onchain_funds` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Requesting onchain funds" + }, + { + "name": "amount_in", + "value": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_trust", + "summary": "A trustline to the asset isn't set", + "description": "The user must add a trustline for the asset to complete", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "request_trustResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_trustExample", + "description": "Example request to the `request_trust` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Request trust" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + } + ], + "components": {} +} diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/README.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/README.mdx new file mode 100644 index 0000000000..ff7de768a5 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/README.mdx @@ -0,0 +1,42 @@ +--- +title: JSON-RPC Methods +order: 20 +sidebar_label: Methods +--- + +import { EndpointsTable } from "@site/src/components/EndpointsTable"; + +This section lists the Anchor Platform JSON-RPC API methods that should be called by Stellar clients to update status of the transaction. + +The OpenRPC Specification for JSON-RPC API is available [here](https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/stellar/stellar-docs/main/static/assets/rpc-methods/open-rpc.json). + +Postman collection is available [here](https://documenter.getpostman.com/view/9257637/2s9Y5U1kra) + + + +| | | +| --- | --- | +| | [notify_interactive_flow_completed](notify_interactive_flow_completed.mdx) | +| | [request_offchain_funds](request_offchain_funds.mdx) | +| | [request_onchain_funds](request_onchain_funds.mdx) | +| | [notify_offchain_funds_received](notify_offchain_funds_received.mdx) | +| | [notify_onchain_funds_received](notify_onchain_funds_received.mdx) | +| | [notify_amounts_updated](notify_amounts_updated.mdx) | +| | [notify_refund_pending](notify_refund_pending.mdx) | +| | [notify_refund_sent](notify_refund_sent.mdx) | +| | [do_stellar_payment](do_stellar_payment.mdx) | +| | [do_stellar_refund](do_stellar_refund.mdx) | +| | [notify_onchain_funds_sent](notify_onchain_funds_sent.mdx) | +| | [notify_offchain_funds_sent](notify_offchain_funds_sent.mdx) | +| | [notify_offchain_funds_available](notify_offchain_funds_available.mdx) | +| | [notify_offchain_funds_pending](notify_offchain_funds_pending.mdx) | +| | [request_trust](request_trust.mdx) | +| | [notify_trust_set](notify_trust_set.mdx) | +| | [request_customer_info_update](request_customer_info_update.mdx) | +| | [notify_customer_info_updated](notify_customer_info_updated.mdx) | +| | [notify_transaction_error](notify_transaction_error.mdx) | +| | [notify_transaction_expired](notify_transaction_expired.mdx) | +| | [notify_transaction_recovery](notify_transaction_recovery.mdx) | +| | [notify_transaction_on_hold](notify_transaction_on_hold.mdx) | + + diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/do_stellar_payment.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/do_stellar_payment.mdx new file mode 100644 index 0000000000..3f82ad67fb --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/do_stellar_payment.mdx @@ -0,0 +1,13 @@ +--- +title: do_stellar_payment +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "do_stellar_payment")[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/do_stellar_refund.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/do_stellar_refund.mdx new file mode 100644 index 0000000000..6816862774 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/do_stellar_refund.mdx @@ -0,0 +1,13 @@ +--- +title: do_stellar_refund +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "do_stellar_refund")[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_amounts_updated.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_amounts_updated.mdx new file mode 100644 index 0000000000..8daed8f441 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_amounts_updated.mdx @@ -0,0 +1,13 @@ +--- +title: notify_amounts_updated +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_amounts_updated")[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_customer_info_updated.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_customer_info_updated.mdx new file mode 100644 index 0000000000..ffc4795d88 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_customer_info_updated.mdx @@ -0,0 +1,15 @@ +--- +title: notify_customer_info_updated +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_customer_info_updated", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_interactive_flow_completed.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_interactive_flow_completed.mdx new file mode 100644 index 0000000000..55ba759ec8 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_interactive_flow_completed.mdx @@ -0,0 +1,15 @@ +--- +title: notify_interactive_flow_completed +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_interactive_flow_completed", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_offchain_funds_available.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_offchain_funds_available.mdx new file mode 100644 index 0000000000..9bca880e34 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_offchain_funds_available.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_available +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_available", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_offchain_funds_pending.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_offchain_funds_pending.mdx new file mode 100644 index 0000000000..a7573189ca --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_offchain_funds_pending.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_pending +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_pending", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_offchain_funds_received.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_offchain_funds_received.mdx new file mode 100644 index 0000000000..9e19062eeb --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_offchain_funds_received.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_received +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_received", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_offchain_funds_sent.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_offchain_funds_sent.mdx new file mode 100644 index 0000000000..5478e2b595 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_offchain_funds_sent.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_sent +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_sent", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_onchain_funds_received.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_onchain_funds_received.mdx new file mode 100644 index 0000000000..24ef7eacac --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_onchain_funds_received.mdx @@ -0,0 +1,15 @@ +--- +title: notify_onchain_funds_received +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_onchain_funds_received", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_onchain_funds_sent.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_onchain_funds_sent.mdx new file mode 100644 index 0000000000..1a776c9582 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_onchain_funds_sent.mdx @@ -0,0 +1,15 @@ +--- +title: notify_onchain_funds_sent +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_onchain_funds_sent", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_refund_pending.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_refund_pending.mdx new file mode 100644 index 0000000000..bc24b12291 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_refund_pending.mdx @@ -0,0 +1,13 @@ +--- +title: notify_refund_pending +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_refund_pending")[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_refund_sent.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_refund_sent.mdx new file mode 100644 index 0000000000..fc0255d3fe --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_refund_sent.mdx @@ -0,0 +1,13 @@ +--- +title: notify_refund_sent +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_refund_sent")[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_transaction_error.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_transaction_error.mdx new file mode 100644 index 0000000000..83b48d8f83 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_transaction_error.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_error +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_error", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_transaction_expired.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_transaction_expired.mdx new file mode 100644 index 0000000000..6587a4cf9b --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_transaction_expired.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_expired +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_expired", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_transaction_on_hold.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_transaction_on_hold.mdx new file mode 100644 index 0000000000..bd00841ec1 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_transaction_on_hold.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_on_hold +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_on_hold", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_transaction_recovery.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_transaction_recovery.mdx new file mode 100644 index 0000000000..d134b53937 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_transaction_recovery.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_recovery +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_recovery", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_trust_set.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_trust_set.mdx new file mode 100644 index 0000000000..5968934e5e --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/notify_trust_set.mdx @@ -0,0 +1,11 @@ +--- +title: notify_trust_set +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_trust_set")[0]} +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/request_customer_info_update.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/request_customer_info_update.mdx new file mode 100644 index 0000000000..350b72c00a --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/request_customer_info_update.mdx @@ -0,0 +1,15 @@ +--- +title: request_customer_info_update +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_customer_info_update", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/request_offchain_funds.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/request_offchain_funds.mdx new file mode 100644 index 0000000000..7066f66bbb --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/request_offchain_funds.mdx @@ -0,0 +1,13 @@ +--- +title: request_offchain_funds +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_offchain_funds")[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/request_onchain_funds.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/request_onchain_funds.mdx new file mode 100644 index 0000000000..6c14cd105a --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/request_onchain_funds.mdx @@ -0,0 +1,13 @@ +--- +title: request_onchain_funds +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_onchain_funds")[0] + } +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/request_trust.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/request_trust.mdx new file mode 100644 index 0000000000..62a368d0ae --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/methods/request_trust.mdx @@ -0,0 +1,11 @@ +--- +title: request_trust +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_trust")[0]} +/> diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/rpc/overview.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/overview.mdx new file mode 100644 index 0000000000..aa544d766e --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/rpc/overview.mdx @@ -0,0 +1,16 @@ +--- +title: Overview +sidebar_position: 10 +--- + +JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. + +It's simple and easy to use, as it uses a single HTTP endpoint and a JSON object that contains the method name and parameters. It is transport agnostic in that the concepts can be used within the same process, over sockets, over http, or in many various message passing environments. It uses [JSON](http://www.json.org/) ([RFC 4627](http://www.ietf.org/rfc/rfc4627.txt)) as data format. + +:::note + +All member names exchanged between the Client and the Server that are considered for matching of any kind should be considered to be case-sensitive. + +::: + +You can read more about JSON-RPC protocol [here](https://www.jsonrpc.org/specification). diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/transactions/README.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/transactions/README.mdx new file mode 100644 index 0000000000..3ee4b6728c --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/transactions/README.mdx @@ -0,0 +1,19 @@ +--- +title: Transactions +sidebar_position: 10 +--- + +import { EndpointsTable } from "@site/src/components/EndpointsTable"; + +Transactions are representations of a SEP transaction. It holds information about the protocol being used, and all necessary information passed by an external party (such as wallet or an anchor). + +Should not be confused with stellar [transactions](/docs/learn/glossary#transaction). + + + +| | | +| --- | -------------------------------------------- | +| GET | [/transactions/:id](get-transaction.api.mdx) | +| GET | [/transactions/](./get-transactions.api.mdx) | + + diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/transactions/get-transaction.api.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/transactions/get-transaction.api.mdx new file mode 100644 index 0000000000..504840e254 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/transactions/get-transaction.api.mdx @@ -0,0 +1,3642 @@ +--- +id: get-transaction +title: "Retrieve a Transaction" +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." +sidebar_label: "Retrieve a Transaction" +hide_title: true +hide_table_of_contents: true +api: eJzdlU1v4zYQhv/KYE4toMhZb7AodEsLozBQtEaSnrJBliZHFjcSyZAjJ4ah/14MLSPybhpst4cCPeljhvOldx7tkdUmYXWLN1G5pDRb7xLeFfh8lihky/VidfYBi3ydX4w379+Jkw8UlRxZGqxwQzyJggUaSjrakJ8qXEW/tYYScENgXe1jl8+CI00pqbiD2sdsXffJOkoJ2IMhpthZR9mSWDGBr/MDv2QDa8ixrS0ZWO/gkzWfCjCkrSGwNSi3g9Gx6xPDmoDVAzlJoL1j63qCEL0UYt3my+gFKGckAHiXbRI5We9KLDCoqDopUqa1Ryu9BsUNFuhUR1ihNVhgpMfeRjJYceypwKQb6hRWe+RdEK/E0boNDsOdOKfgXaIk9vn5uVxOpzmZNNS+d0ZKkVbIsXirEFqr84Bnn5Mc2U9Sekd/1LncMblffybNJ2XeHupOFLDAB+vyAyvu0+EmMpl7xaIDttzSaVHXi9UHHIrvTqA63zu+p+dAmskc1MTW5Y7uldZi/sZC5hf/ppJvyfD+HQ53wzAMBV689rV+Vgau6LGnxP/kM31ZcYiycWwPuqAYfXxFQIV084quTjs+nJ50tMgvjk1cvC055/k7ZPcf9TMUSM9MLmW4ieofaIfVkXEFblXb05usk6XsiBs/gi7vPTdY4WzCiTTbWzNkJcXtEQh9bLHChjmkajYLrWJB39nBpaRn1YWWlNONj6X2HUoqwaO0LEEOw5+XP5VS0LG71RgHrnOcr2h70xAcc8EhF9gEyoF1TNGpFrTvgnfkuIQlQ2p83xohY+MTkwHrQEGIdivEdcRPPj5kDo6eIoE1gdIZmuuWoI6+y3hc5hTEJdw0Nh3Tk1PrduT/lPA1sW5y5D4YSXYK+sl4oc90tpzgcrUsP8pPprWaXCKZ1ojby6B0QzAvz7GYTL+azZ6enkqVraWPm9l4NM1+W/6y+P16cTYvz8uGuzaLK/jEnXKTwFfE0dKWQMEbP7r9yz78b/954yoyPbMo2jrZ0jzq/bgXtzj9cFhgZY1sp4hLrPv9WiX6M7bDIK8fe4o7rG7vZBmjFaHk5TE2yb3BqlZtojdG/cPVCIMf4e8KHF8qt3vZeRTiZxpYIwwvsCFlKE4wcak1BZ4c+QpyJ3T4dXGDw/AX+0E5jA== +sidebar_class_name: "get api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/platform/transactions/platform-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +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. + + + +
+ +

+ Path Parameters +

+
+
+
    + +
+
+
+
+
+ + +
Transaction found.
+
+ + + + +
+ + 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. +
    + +
    + + + + 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` 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. +
    + + + +
    +
    +
    +
    +
    +
    +
    + + + + + + +
    + + + + 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` 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
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Transaction not found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/api-reference/platform/transactions/get-transactions.api.mdx b/ap_versioned_docs/version-2.8/api-reference/platform/transactions/get-transactions.api.mdx new file mode 100644 index 0000000000..b1947098f2 --- /dev/null +++ b/ap_versioned_docs/version-2.8/api-reference/platform/transactions/get-transactions.api.mdx @@ -0,0 +1,4275 @@ +--- +id: get-transactions +title: "Retrieve a List of Transactions" +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`." +sidebar_label: "Retrieve a List of Transactions" +hide_title: true +hide_table_of_contents: true +api: eJztWG1P20gQ/iuj/XIgGUNTVJ3yjTulJySuhxr6iaKwscfxlvWuuzPmpVH++2nWTnAIBGilq3TqJzvr2Z1nn3nPXLGekRqeq7OgHemMjXekLhJ1u0dYxy/j0eneO5XE5+Cwe3n7RoR8jUHLluNcDdUMee2UROVIWTC1/FRDdWStvyFgD18bDHdgDTH4Ari3CQofIEcyAXMYj05TOCsNga4NUFPXPjBBrWfGRbUJaJeD4d8Iak9kphZhR5YCZr6q0OWY74rCSl8hVI1lU1uEgF8bJO5B6UMQlQhWE4smBEMQUGcl5nBTogMuEVxTTTEIeLRYoWOR4SY4zGF6F0XQ5bU3jmU/VdpaDMCldlAHf21yzOFSjp+Q+YaXqUpUrYOukDEI63NlhLKITiXK6QrVUBHWKlECX/hRQw4NJoqyEiuthnPFd3UU42DcTCUKXVOJCcV80XRitsVDu5x4f9XU62aYovVuZtxMOGIxgRhDLZLHgfmQY5hMZeV5NFlAzZhPNKtERa0FhknADM11u3whEAvdWFbDvvgG9HGNmSkMEhQGbS4E8/pFboy1MEWICKN1UvjgGZNWljDzLtfhDsiHaKvebjA5GAeaMnS5cHGtbYPpZ3ecYto5g6mQWFd167kD8AEqH3AdhCEwOTo2mbaiGO9WuERt6zQmf4bfF5GrKesCb51FWd9CX1SwxszK11tmDYFrrE1AW/uQYS7jt5ae1c0kghIIONMht0gk0UJe4LbaYOfDp5OTMZwcjc9208/uvQ+At7qqrUDo3CISDJW+A+c58tVBziPf5Kt1qkUhSZy7GRjHHi4fc7BLmKJICOoUjgVX8tilvNu7vxg9tFmbaLqoL0yQ6xZeklxr0C1M3bvN0zYn1twQ0mNm1yFoETWMFT3mDut2Pl0mx/bM5X2EwYcge65kXObFGowqUcvXPCagopHUKrK3dUxFicIQvLho3cbKhBit1f0VvGUMTtveUkMYJisLEevAT37tgVkKaJeVa0o5NPTwBGHUTyodrjAmHO8nMR9371aHWf9MkqrRP7Pzm3U1K8ImxhV+0tS5XkOWNcS+wrD2+SJRbNiKocbREOPR6ZG1arERmO+NlUKwWRrv3T+6QIypzk+iI0uULAtMAkU8JsYCQW5ITy3msNNlBZhiqa+ND7tP+uCqQj3mhMYxziIvqzQzONjMMeYbCkwNZNxMfBB1yMpYW1P4u6EY1rUnw+Yanw6HCKWtuy8Es4nlVOp5V7vZQ0MYSc28Y+Ma31AHLoUomfnGcZsqCDTDQaoWF+L+VHsnkTmcq8HBgTzW9fTaICh84/I0RpBjdCzSuq6tyWILs/+FZMu8dyPv8J8i9gDd3fz0C2bRdzvv6Z1/YojHo9N3kbeXyw8OX7nh7Ru1uFgsxFUPH7vyHzqHj21f9Zq7PgRQB+kp2bTktjllI70tEmXyR5YX/d7ovNvdC7pRXFhe4nC73SSSXm+7n3SfhWRiRkcxhYvrXOGdGi67+ETFjL+1mxfPrpBL37XysSPlUg3V/oP6QBiul11qE6waqpK5puH+fm01Fz5Ue61I2pXzNk2nma9i/EhKlNvKIS3vg/T39LDnfqfdOTCO52zUM2nQl7qg1SUZTjup+bHGgFQL79BxCscMVPrG5pJoSk9Su6WtgzqYa80IDvnGh6tY0DvJrtvQWYZd6SyCr2I/dBxVIHejSacenSRXihLThoyTjoc9FMhZGU9ui0AUkJSNG6OP7JqBYYKj0+P0s1OJsiZDRyhsdWnwqJZRBAbpgUp67A/3929ublIdv6Y+zPa7rbR/cvzn6MN4tDdID9KSq7bc1J640q538EfkYPAaQcNJN5htm+bm9zHxa7DbPth1Uc14yxIhxknAR9PNuxA7V/xg/BY3lfX5fKoJPwW7WMhyWxMl8JbVXA0LbQm3WGfnY5dDduEVk94TsNu00s6hXU5RsZK8HM//bWbbylRvMP5hun7NaD9tRnvext9v4P+6198e2fdD5/f66yv7/a1w+vPHd+L58Z7/eYSrseQe44X8CEZAquG5/OlWohY/uW/OjrIMa+7t2mgt13qyv0ZnarH4F/5foFc= +sidebar_class_name: "get api-method" +info_path: ap_versioned_docs/version-2.8.4/api-reference/platform/transactions/platform-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +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 +

+
+
+
    + + + + + + +
+
+
+
+
+ + +
Transaction found.
+
+ + + + +
+ + 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. +
    + +
    + + + + 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` 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. +
    + + + +
    +
    +
    +
    +
    +
    +
  • +
    + ] +
    +
  • +
    +
    +
    +
    + + +
    + + + + 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` 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
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Transaction not found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.8/assets/SEP24-state-diagram.png b/ap_versioned_docs/version-2.8/assets/SEP24-state-diagram.png new file mode 100644 index 0000000000..65d2bb5363 Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/SEP24-state-diagram.png differ diff --git a/ap_versioned_docs/version-2.8/assets/anchor-platform-architecture-1.png b/ap_versioned_docs/version-2.8/assets/anchor-platform-architecture-1.png new file mode 100644 index 0000000000..0917091187 Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/anchor-platform-architecture-1.png differ diff --git a/ap_versioned_docs/version-2.8/assets/anchor-platform-architecture-2.png b/ap_versioned_docs/version-2.8/assets/anchor-platform-architecture-2.png new file mode 100644 index 0000000000..6e2c1e64b5 Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/anchor-platform-architecture-2.png differ diff --git a/ap_versioned_docs/version-2.8/assets/anchor-platform-sep24-demo-wallet-widget.png b/ap_versioned_docs/version-2.8/assets/anchor-platform-sep24-demo-wallet-widget.png new file mode 100644 index 0000000000..b2461d306e Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/anchor-platform-sep24-demo-wallet-widget.png differ diff --git a/ap_versioned_docs/version-2.8/assets/anchor-platform-sep24-demo-wallet.png b/ap_versioned_docs/version-2.8/assets/anchor-platform-sep24-demo-wallet.png new file mode 100644 index 0000000000..169f450fa3 Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/anchor-platform-sep24-demo-wallet.png differ diff --git a/ap_versioned_docs/version-2.8/assets/anchor-platform-sep31-demo-wallet-widget.png b/ap_versioned_docs/version-2.8/assets/anchor-platform-sep31-demo-wallet-widget.png new file mode 100644 index 0000000000..be483f58c9 Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/anchor-platform-sep31-demo-wallet-widget.png differ diff --git a/ap_versioned_docs/version-2.8/assets/sep24-deposit-flow-diagram.png b/ap_versioned_docs/version-2.8/assets/sep24-deposit-flow-diagram.png new file mode 100644 index 0000000000..6a45a3e108 Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/sep24-deposit-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.8/assets/sep24-withdrawal-flow-diagram.png b/ap_versioned_docs/version-2.8/assets/sep24-withdrawal-flow-diagram.png new file mode 100644 index 0000000000..f69ee06dad Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/sep24-withdrawal-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.8/assets/sep31-transition-diagram.png b/ap_versioned_docs/version-2.8/assets/sep31-transition-diagram.png new file mode 100644 index 0000000000..3944ea0b18 Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/sep31-transition-diagram.png differ diff --git a/ap_versioned_docs/version-2.8/assets/sep6-deposit-flow-diagram.png b/ap_versioned_docs/version-2.8/assets/sep6-deposit-flow-diagram.png new file mode 100644 index 0000000000..75d4d271ac Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/sep6-deposit-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.8/assets/sep6-withdrawal-flow-diagram.png b/ap_versioned_docs/version-2.8/assets/sep6-withdrawal-flow-diagram.png new file mode 100644 index 0000000000..0bf199f47c Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/sep6-withdrawal-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep24_deposit_job.png b/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep24_deposit_job.png new file mode 100644 index 0000000000..30b8059f85 Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep24_deposit_job.png differ diff --git a/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep24_deposit_webhook.png b/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep24_deposit_webhook.png new file mode 100644 index 0000000000..630d9173d0 Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep24_deposit_webhook.png differ diff --git a/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep24_withdrawal_job.png b/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep24_withdrawal_job.png new file mode 100644 index 0000000000..a768c5218f Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep24_withdrawal_job.png differ diff --git a/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep24_withdrawal_webhook.png b/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep24_withdrawal_webhook.png new file mode 100644 index 0000000000..4005a81d27 Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep24_withdrawal_webhook.png differ diff --git a/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep31_receive_job.png b/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep31_receive_job.png new file mode 100644 index 0000000000..3150663fe1 Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep31_receive_job.png differ diff --git a/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep31_receive_webhook.png b/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep31_receive_webhook.png new file mode 100644 index 0000000000..7a66bbdcc9 Binary files /dev/null and b/ap_versioned_docs/version-2.8/assets/sequence_diagram_sep31_receive_webhook.png differ diff --git a/ap_versioned_docs/version-2.9/README.mdx b/ap_versioned_docs/version-2.9/README.mdx new file mode 100644 index 0000000000..6f5587ec14 --- /dev/null +++ b/ap_versioned_docs/version-2.9/README.mdx @@ -0,0 +1,12 @@ +--- +title: Anchor Platform Introduction +sidebar_position: 10 +--- + +# Anchor Platform + +The Anchor Platform is a set of tools and APIs that enable developers and businesses to build their own on and off-ramp services for the Stellar network. It provides a standardized interface, including the implementation of several Stellar Ecosystem Proposals (SEPs), to make it easy for businesses to integrate with Stellar-based wallets and exchanges. + +The platform also includes features for managing assets, transactions, and user accounts, and supports a variety of deployment options, including using Docker or Kubernetes. Overall, the Anchor Platform aims to simplify the process of building and managing a Stellar-based financial service, allowing businesses to focus on providing value to their customers. + +Learn about integrating with the Anchor Platform in the [Admin Guide](./admin-guide/README.mdx) or get API information in the [API Reference](./api-reference/README.mdx). diff --git a/ap_versioned_docs/version-2.9/admin-guide/README.mdx b/ap_versioned_docs/version-2.9/admin-guide/README.mdx new file mode 100644 index 0000000000..d955ccbfc7 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/README.mdx @@ -0,0 +1,10 @@ +--- +title: Admin Guide +sidebar_position: 10 +--- + +import DocCardList from "@theme/DocCardList"; + +All you need to know about setting up, running, and using the Anchor Platform. + + diff --git a/ap_versioned_docs/version-2.9/admin-guide/architecture.mdx b/ap_versioned_docs/version-2.9/admin-guide/architecture.mdx new file mode 100644 index 0000000000..d9abf6435c --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/architecture.mdx @@ -0,0 +1,69 @@ +--- +title: "Architecture" +sidebar_position: 20 +--- + +## Architecture + +Before starting with the Anchor Platform, let's get familiar with the architecture. This section will describe the components involved and how they interact. + +### Fundamental Architecture + +The following architectural components are required for all deployments of the Anchor Platform. + +[![fundamental anchor platform architecture](../assets/anchor-platform-architecture-1.png)](../assets/anchor-platform-architecture-1.png) + +#### Client + +The client is an application, such as a wallet or remittance sender, that acts on behalf of a user and makes requests to the system. Clients make requests to the SEP server component of the Anchor Platform using sets of standards called [SEPs][seps] (Stellar Ecosystem Proposals). + +#### SEP Server + +The SEP server is a client-facing server and therefore needs to be accessible from an external network. The SEP server processes user requests and manages the state of transactions they initiate. When the SEP server needs to provide information it doesn't have to the client, such as the exchange rate for an asset pair or the KYC status of a customer, it makes synchronous [callback][callback-api] requests to the business server and returns the information in a SEP-compliant format. + +:::note + +The SEP server will never store any sensitive information, such as KYC (PII), in the database. + +::: + +#### Business Server + +The business server is a service that you (the business) must implement to connect the Anchor Platform with your internal systems. The business server responds to callback requests sent by the SEP server, such as requests for a quote, receives events sent by event service, such as notification of a received payment to your Stellar account, and provides updates to the platform server when off-chain events occur, such as the initiation of a bank transfer to a customer. + +#### Platform Server + +The platform server is an internal component. It should be hosted in a private network and should not be accessible from the Internet. This server enables the business to fetch and update the state of transactions using its [API][platform-api]. + +#### Database + +The Anchor Platform uses a PostgreSQL database to store Stellar events and entities. It is primary used to store transactions. + +### Complete Architecture + +In addition to the components described above, the Anchor Platform includes several other components that offer additional functionality. Your business can chose to which of the additional components to use, but the diagram below visualizes the architecture of the system if all components are utilized. + +[![complete anchor platform architecture](../assets/anchor-platform-architecture-2.png)](../assets/anchor-platform-architecture-2.png) + +#### Event Service + +The event service enables the Anchor Platform to send HTTP webhooks to registered clients and your business server when the state of transactions change, removing the need for clients and/or your business server to poll the Anchor Platform's APIs. It works by reading events from published to a Kafka topic by the other Anchor Platform components. [Read more][events] about using the event service. + +#### Custody Server + +The custody server connects to enterprise wallet providers, such as Fireblocks, to send and receive payments for transactions initiated via the Anchor Platform. This service is an alternative to the Stellar Observer for businesses who use one of the supported providers. In addition to the functionality offered by the Stellar Observer, the Custody Server can also facilitate outbound payments to client's Stellar accounts. If you also use the [events] service, payments to your accounts will trigger a HTTP callback made to your business server. + +If you already have an integration with your wallet provider, then this component is not required, although your business server will need to notify the Anchor Platform when a payment associated with an Anchor Platform transaction was sent to or from your Stellar accounts via the [Platform API][platform-api]. + +Currently the only supported provider is Fireblocks. + +#### Stellar Observer + +The Stellar observer, an alternative to the custody server pictured above, monitors the Stellar blockchain using Horizon, automatically detects user payments sent to the business, and updates the corresponding transactions in the Anchor Platform's database. If you also use the [events] service, payments to your accounts will trigger a HTTP callback made to your business server. + +If you already have a solution for monitor payments to your Stellar accounts, such as an integration with your exchange, Horizon, or RPC, then this component is not required, although your business server will need to notify the Anchor Platform when a payment associated with an Anchor Platform transaction was made to your one of your Stellar accounts via the [Platform API][platform-api]. + +[seps]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/README.md +[platform-api]: ../api-reference/platform/transactions/README.mdx +[callback-api]: ../api-reference/callbacks/README.mdx +[events]: ./events/README.mdx diff --git a/ap_versioned_docs/version-2.9/admin-guide/component/observer/observer.mdx b/ap_versioned_docs/version-2.9/admin-guide/component/observer/observer.mdx new file mode 100644 index 0000000000..133ac576f2 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/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](../../getting-started.mdx#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](#funds-received-1) 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]: ../../custody-services/fireblocks/README.mdx diff --git a/ap_versioned_docs/version-2.9/admin-guide/component/rpc/error.mdx b/ap_versioned_docs/version-2.9/admin-guide/component/rpc/error.mdx new file mode 100644 index 0000000000..27746e6f0e --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/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/ap_versioned_docs/version-2.9/admin-guide/component/rpc/request.mdx b/ap_versioned_docs/version-2.9/admin-guide/component/rpc/request.mdx new file mode 100644 index 0000000000..9157143afc --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/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/ap_versioned_docs/version-2.9/admin-guide/component/rpc/response.mdx b/ap_versioned_docs/version-2.9/admin-guide/component/rpc/response.mdx new file mode 100644 index 0000000000..02d8081034 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/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/ap_versioned_docs/version-2.9/admin-guide/component/rpc/rpc.mdx b/ap_versioned_docs/version-2.9/admin-guide/component/rpc/rpc.mdx new file mode 100644 index 0000000000..f00b8ee7f5 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/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/ap_versioned_docs/version-2.9/admin-guide/component/security/api_key.mdx b/ap_versioned_docs/version-2.9/admin-guide/component/security/api_key.mdx new file mode 100644 index 0000000000..c994a59941 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/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" +``` + + + +Once enabled, all requests must include a valid `X-Api-Key` header, set to the configured API key. diff --git a/ap_versioned_docs/version-2.9/admin-guide/component/security/jwt.mdx b/ap_versioned_docs/version-2.9/admin-guide/component/security/jwt.mdx new file mode 100644 index 0000000000..50153090a4 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/component/security/jwt.mdx @@ -0,0 +1,16 @@ +To enable JWT authentication, modify your `dev.env` file: + + + +```bash +# dev.env +PLATFORM_SERVER_AUTH_TYPE=jwt +# Will be used to sign the JWT token +SECRET_PLATFORM_API_AUTH_SECRET="your secret that business server will use" +``` + + + +Anchor Platform uses the HMAC SHA-256 (HS256) algorithm to sign JWT tokens. Ensure that `SECRET_PLATFORM_API_AUTH_SECRET` is at least 32 characters long for security. + +Once enabled, all requests must include a valid `Authorization` header with the format `Bearer `. diff --git a/ap_versioned_docs/version-2.9/admin-guide/component/security/security.mdx b/ap_versioned_docs/version-2.9/admin-guide/component/security/security.mdx new file mode 100644 index 0000000000..76a3832c30 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/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/ap_versioned_docs/version-2.9/admin-guide/custody-services/README.mdx b/ap_versioned_docs/version-2.9/admin-guide/custody-services/README.mdx new file mode 100644 index 0000000000..5556776d58 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/custody-services/README.mdx @@ -0,0 +1,10 @@ +--- +title: Custody Services +sidebar_position: 80 +--- + +import DocCardList from "@theme/DocCardList"; + +Using a custody service will allow you to use an outside service to store and manage your wallets. + + diff --git a/ap_versioned_docs/version-2.9/admin-guide/custody-services/configuration.mdx b/ap_versioned_docs/version-2.9/admin-guide/custody-services/configuration.mdx new file mode 100644 index 0000000000..611d9dfa5a --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/custody-services/configuration.mdx @@ -0,0 +1,130 @@ +--- +title: Configuration +sidebar_position: 10 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Custody Server Configuration + +If you want to use an external custody service to store and manage your wallets, then you need to deploy one more service - the Custody Server. + +This service also needs the `STELLAR_ANCHOR_CONFIG` that was previously mentioned. By default, the `anchor-config-default-values.yaml` config file will be used. + +Also, now you don't need to deploy the Stellar Observer since the Custody Server will be responsible for its functionality. + +Update the configuration file of the Anchor Platform with the base URL and port. + + + +```yaml +custody_server: + # The listening port of the Custody Server. + # Default value: 8086 + port: 8086 + # The base URL of the Custody Server. + # Default value: http://localhost:8086 + base_url: http://localhost:8086 +``` + + + +Configure authentication type. + + + +```yaml +custody_server: + auth: + # Type of authentication that is used when the Anchor Platform communicates with the Custody Server. + # Supported values: [none, api_key, jwt] + # Default value: none + type: none +``` + + + +If you set the `api_key` or `jwt` authentication type, then you need to add an environment variable. + + + +```bash +# dev.env +SECRET_CUSTODY_SERVER_AUTH_SECRET="Custody Server auth secret" +``` + + + +Start the Custody Server using Gradle or Docker. + + + +```bash +./gradlew service-runner:bootRun --args=--custody-server +docker run stellar/anchor-platform:2.9.0 --custody-server +``` + + + +## Anchor Platform Configuration + +Update the configuration file of the Anchor Platform with the deposit info generator type for SEP-24 and SEP-31. Also, you need to configure a trustline check, if you use JSON-RPC. + + + +```yaml +sep24: + # Used to choose how the SEP-24 deposit information (deposit address, memo and memo type) will be generated + # Supported value: [self, custody, none] + # Default value: self + deposit_info_generator_type: custody +sep31: + # Used to choose how the SEP-31 deposit information (deposit address, memo and memo type) will be generated + # Supported value: [self, custody, api] + # Default value: self + deposit_info_generator_type: custody + ## Trustline check configuration. Used only when custody integration is enabled +custody: + trustline: + ## @param: checkCronExpression + ## @type: string + ## Cron expression which defines how often a trustline check job runs. By default, a job runs every minute + # + check_cron_expression: "0 * * * * *" + ## @param: checkDuration + ## @type: integer + ## Determines how long (in MINUTES) the trustline will be checked. By default - 1 hour (60 minutes) + # + check_duration: 60 + ## @param: checkTimeoutMessage + ## @type: string + ## The message that will be added to the SEP transaction after the duration check is exceeded + # + check_timeout_message: Trustline check timed out +``` + + + +:::info + +- `self` - memo and memo type are generated in the local code, and the distribution account is used for the deposit address. +- `custody` - memo and memo type are generated through Custody API, for example Fireblocks, as well as the deposit address. +- `none` - deposit address, memo, and memo type should be provided by the business in a PATCH/JSON-RPC request. +- `api` - memo and memo type are generated through calling the anchor's GET /unique_address endpoint. + +::: + +## Kotlin Reference Server Configuration + +Update the configuration file of the Kotlin Reference Server to enable custody integration. + + + +```yaml +app: + # Flag that indicates that the custody integration is enabled and the payment will be submitted using the Custody Server. + # Default value: false + custodyEnabled: true +``` + + diff --git a/ap_versioned_docs/version-2.9/admin-guide/custody-services/fireblocks/README.mdx b/ap_versioned_docs/version-2.9/admin-guide/custody-services/fireblocks/README.mdx new file mode 100644 index 0000000000..43e037461e --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/custody-services/fireblocks/README.mdx @@ -0,0 +1,10 @@ +--- +title: Fireblocks +sidebar_position: 20 +--- + +import DocCardList from "@theme/DocCardList"; + +Configure [Fireblocks](https://fireblocks.io) to act as a custody service that stores and manages your wallets. + + diff --git a/ap_versioned_docs/version-2.9/admin-guide/custody-services/fireblocks/configuration.mdx b/ap_versioned_docs/version-2.9/admin-guide/custody-services/fireblocks/configuration.mdx new file mode 100644 index 0000000000..0df4d0761d --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/custody-services/fireblocks/configuration.mdx @@ -0,0 +1,68 @@ +--- +title: "Configuration" +sidebar_position: 10 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Configure Fireblocks workspace: + +1. [Configure API Co-Signer](https://support.fireblocks.io/hc/en-us/articles/4581830426268) +2. [Add API User](https://support.fireblocks.io/hc/en-us/articles/4407823826194-Adding-new-API-users) +3. [Configure Webhook URL](https://support.fireblocks.io/hc/en-us/articles/4408110107794-Configuring-Webhook-URLs) +4. [Enable One-Time Address feature](https://support.fireblocks.io/hc/en-us/articles/4409104568338) + +Update the configuration file of the Custody Server. + + + +```yaml +custody: + # Default value: none + type: fireblocks + fireblocks: + # The base URL of the Fireblocks API + # Default value: https://api.fireblocks.io + base_url: https://api.fireblocks.io + # ID of Fireblocks vault account that will be used for payments + vault_account_id: "vault_account_id" + # Fireblocks public key that is used to verify a webhook signature + public_key: "public_key" + # Mappings of fireblocks asset codes to stellar asset codes. For example: + # XLM_USDC_T_CEKS stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + # XLM_TEST stellar:native + # Codes should be separated with a space and each pair of codes should be on a new line + asset_mappings: "asset_mappings" + reconciliation: + # Cron expression which defines how often the transaction reconciliation job runs. + # By default, job runs every 15 minutes. + # Default value: 0 0/15 * * * * + cron_expression: "0 0/15 * * * *" + # Determines how many times the transaction reconciliation job will attempt to update the status of the + # transaction before marking it as failed. + # Default value: 10 + max_attempts: 10 + retry_config: + # Determines how many times the Fireblocks client will attempt to send a request before marking a call as failed. + # Default value: 3 + max_attempts: 3 + # Interval between Fireblocks client call attempts (in ms) + # Default value: 1000 + delay: 1000 +``` + + + +Add the environment variables. + + + +```bash +# dev.env +# API key, that will be added to JWT token claims. JWT token will be sent in requests to Fireblocks API +SECRET_CUSTODY_FIREBLOCKS_API_KEY="Fireblocks API key" +# Secret key, that is used to sign JWT token +SECRET_CUSTODY_FIREBLOCKS_SECRET_KEY="Fireblocks secret key" +``` + + diff --git a/ap_versioned_docs/version-2.9/admin-guide/custody-services/fireblocks/example.mdx b/ap_versioned_docs/version-2.9/admin-guide/custody-services/fireblocks/example.mdx new file mode 100644 index 0000000000..613d31bca2 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/custody-services/fireblocks/example.mdx @@ -0,0 +1,50 @@ +--- +title: "Example" +sidebar_position: 10 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +[comment]: # "Sequence diagram definitions are located in /static/definitions folder" +[comment]: # "To updated them, use https://sequencediagram.org" + +### SEP-24 deposit flow with webhook: + +- request_offchain_funds +- notify_offchain_funds_received +- do_stellar_payment +- notify_onchain_funds_sent [![sequence_diagram_sep24_deposit_webhook](../../../assets/sequence_diagram_sep24_deposit_webhook.png)](../../../assets/sequence_diagram_sep24_deposit_webhook.png) +
+ +### SEP-24 deposit flow with reconciliation job: + +- request_offchain_funds +- notify_offchain_funds_received +- do_stellar_payment +- notify_onchain_funds_sent [![sequence_diagram_sep24_deposit_job](../../../assets/sequence_diagram_sep24_deposit_job.png)](../../../assets/sequence_diagram_sep24_deposit_job.png) +
+ +### SEP-24 withdrawal flow with webhook: + +- do_stellar_payment +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep24_withdrawal_webhook](../../../assets/sequence_diagram_sep24_withdrawal_webhook.png)](../../../assets/sequence_diagram_sep24_withdrawal_webhook.png) +
+ +### SEP-24 withdrawal flow with reconciliation job: + +- request_onchain_funds +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep24_withdrawal_job](../../../assets/sequence_diagram_sep24_withdrawal_job.png)](../../../assets/sequence_diagram_sep24_withdrawal_job.png) +
+ +### SEP-31 receive flow with webhook: + +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep31_receive_webhook](../../../assets/sequence_diagram_sep31_receive_webhook.png)](../../../assets/sequence_diagram_sep31_receive_webhook.png) +
+ +### SEP-31 receive flow with reconciliation job: + +- notify_onchain_funds_received +- notify_offchain_funds_sent [![sequence_diagram_sep31_receive_job](../../../assets/sequence_diagram_sep31_receive_job.png)](../../../assets/sequence_diagram_sep31_receive_job.png) diff --git a/ap_versioned_docs/version-2.9/admin-guide/events/README.mdx b/ap_versioned_docs/version-2.9/admin-guide/events/README.mdx new file mode 100644 index 0000000000..43cc58bd93 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/events/README.mdx @@ -0,0 +1,10 @@ +--- +title: Event Handling +sidebar_position: 85 +--- + +import DocCardList from "@theme/DocCardList"; + +Receive transaction updates through HTTP webhook events. + + diff --git a/ap_versioned_docs/version-2.9/admin-guide/events/delivery.mdx b/ap_versioned_docs/version-2.9/admin-guide/events/delivery.mdx new file mode 100644 index 0000000000..cd6d3148e2 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/events/delivery.mdx @@ -0,0 +1,30 @@ +--- +title: "Delivery Guarantees" +sidebar_position: 30 +--- + +## Delivery Guarantees + +Depending on the messaging system you use, there will be different delivery guarantees. the event service uses Kafka as the messaging system, so the delivery guarantees will depend on the producer configuration and the broker configuration that you use. Depending on the number of partitions configured for the `TRANSACTION` topic, the events may be delivered out of order. + +:::caution + +Any transaction logic that depends on the order should use the transaction `status` and the `updated_at` fields to determine the order of the events. + +::: + +Next subsections will describe the delivery guarantees from the client and the business server perspective. + +### Client Delivery Guarantees + +For each client, the event service will attempt to deliver each event up to three times with an exponential backoff. If the event is not delivered after three attempts due to HTTP 4xx or 5xx errors, the event will be skipped. If the client is not reachable after three attempts, the event service will no longer attempt to deliver any events to that client. + +### Business Server Delivery Guarantees + +The event service will attempt to deliver each event to the businesss server up to three times with an exponential backoff. If the event is not delivered after three attempts due to HTTP 4xx or 5xx errors, the event will be skipped. If the business server is not reachable after three attempts, the event service will no longer attempt to deliver any events to the business server. + +:::note + +The business server delivery guarantees are the same as the client delivery guarantees. In the future, the event service will skip the events that are not delivered to clients that are not reachable. + +::: diff --git a/ap_versioned_docs/version-2.9/admin-guide/events/getting-started.mdx b/ap_versioned_docs/version-2.9/admin-guide/events/getting-started.mdx new file mode 100644 index 0000000000..d7c3a3832a --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/events/getting-started.mdx @@ -0,0 +1,8 @@ +--- +title: Getting Started +sidebar_position: 10 +--- + +Anchor Platform provides an event service that allows your business application and client applications such as wallets to receive updates about transaction updates via HTTP webhooks without the need to poll the transactions API. + +By integrating with the event service, you or your clients will be able to receive updates about the status of transactions, including when they are submitted, completed, and failed as well as any quotes created. diff --git a/ap_versioned_docs/version-2.9/admin-guide/events/integration.mdx b/ap_versioned_docs/version-2.9/admin-guide/events/integration.mdx new file mode 100644 index 0000000000..e716f33449 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/events/integration.mdx @@ -0,0 +1,166 @@ +--- +title: "Integration" +sidebar_position: 20 +--- + +This guide will walk you through integrating with the event service to start receiving events. The event service currently only supports Apache Kafka as the backend message broker. + +It assumes familiarity with Kafka and will not cover how to set up a Kafka cluster. + +## Requirements + +Anchor Platform will send events to the `TRANSACTION` Kafka topic. The event service will consume events from this topic and send them to the appropriate endpoints. + +## Configuration + +First, the event service's Kafka producer need to be configured using the `event.queue` section of the configuration file or setting the environment variables. The following is the set of required environment variables needed to configure the event service's Kafka producer: + + + +```bash +# dev.env +EVENTS_ENABLED=true +EVENTS_QUEUE_TYPE=kafka +EVENTS_QUEUE_KAFKA_BOOTSTRAP_SERVER=localhost:9092 +``` + +```yaml +# dev.services.yaml +events: + enabled: true + queue: + type: kafka + kafka: + bootstrap_server: localhost:9092 +``` + + + +Anchor Platform allows a subset of the Kafka producer's client configuration to be set. See the [default values file][default-values-file] for more information what is available. For more information on the Kafka producer's client configuration, see the [Kafka documentation](https://kafka.apache.org/documentation/#producerconfigs). + +Next, the event processor needs to be configured in the `event_processor` section of the Anchor Platform Configuration file or setting the environment variables. + + + +```bash +# dev.env +EVENT_PROCESSOR_CLIENT_STATUS_CALLBACK_ENABLED=true +EVENT_PROCESSOR_CALLBACK_API_REQUEST_ENABLED=true +``` + +```yaml +# dev.services.yaml +event_processor: + client_status_callback: + enabled: true + callback_api_request: + enabled: true +``` + + + +This will enable the event processor to start processing events from `TRANSACTION` topic. In this example, the event processor will send events to client and business server callback endpoints. + +## Receiving Events + +The event service can be used to send events to client and business server callback endpoints. The event service will send events to these endpoints as HTTP POST requests with the event data in the request body. + +### As a Client Application + +Client applications can receive updates whenever the `status` of a SEP transaction changes. + +To receive events as a client application, you will need to expose a callback URL that the event service can send events to. The event service will send a POST request to this endpoint with the event data in the request body. + +Anchor Platform will only send events to clients listed in the client configuration. See the [client configuration documentation][clients-config] for more information. + +#### Callback Signing + +Anchor Platform signs the callback requests it sends to client applications. The signature is included in the `Signature` header of the request. The callback URL signature specification can be found in the corresponding SEP protocol specifications. + +- [SEP-0006](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md#url-callback-signature) +- [SEP-0024](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#url-callback-signature) +- [SEP-0031](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md#url-callback-signature) + +### As a Business Server + +In addition to SEP transaction status updates, business servers can receive events about SEP-31 quote creation or SEP-12 customer information updates. The schema of the event data will depend on the type of event being sent. Visit the [Event API documentation](../../api-reference/callbacks/post-event.api.mdx) for more information about the schema of the event data. + +To receive events as a business server, you will need to expose a callback URL that the event service can send events to. The event service will send a POST request to this endpoint with the event data in the request body. + +#### Configuration + +The event service's callback API can be configured using the `callback_api` section of the Anchor Platform configuration file or setting the environment variables. + +:::caution + +The `--event-processor` will ignore any path segments specified in `callback_api.base_url` and will instead send events to `[scheme]://[host]:[port]/event`. This is a bug, but in order not to disrupt those using the event processor, we will defer the fix of including path segments in version 3 of the Anchor Platform. + +::: + +The following is an example of how to configure the event service's callback API with JWT authentication: + + + +```bash +# dev.env + +# note `/callback` will not be used for event callbacks +# instead events will be sent to `http://localhost:8081/event` +# all other callbacks (rates, customer, etc.) will use the provided `/callback` root path +CALLBACK_API_BASE_URL=http://localhost:8081/callback +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +CALLBACK_API_AUTH_JWT_HTTP_HEADER=Authorization +SECRET_CALLBACK_API_AUTH_SECRET="a secret for signing jwts" +``` + +```yaml +# dev.services.yaml +callback_api: + base_url: http://localhost:8081/callback + auth: + type: jwt + jwt: + expiration_milliseconds: 30000 + http_header: Authorization +``` + + + +The following is an example of how to configure the event service's callback API with API key authentication: + + + +```bash +# dev.env +CALLBACK_API_BASE_URL=http://localhost:8081/callback +CALLBACK_API_AUTH_TYPE=api_key +CALLBACK_API_AUTH_API_KEY_HTTP_HEADER=X-Api-Key +SECRET_CALLBACK_API_AUTH_SECRET="your API key" +``` + +```yaml +# dev.services.yaml +callback_api: + base_url: http://localhost:8081/callback + auth: + type: api_key + api_key: + http_header: X-Api-Key +``` + + + +This configures the event service's callback API that will be used to send events to client and business server callback endpoints. The following are the supported configuration options: + +- `base_url`: The base URL of the business server's callback endpoint. +- `secret`: The secret to be used when sending events to the business server's callback endpoint. This is used to sign the request body when JWT authentication is enabled and it is the API key when API key authentication is enabled. +- `auth`: The authentication method to be used when sending events to the business server's callback endpoint. The following are the supported authentication methods: + - `JWT`: The event service will send a JSON Web Token (JWT) in the `Authorization` header of the request. The following are the supported configuration options: + - `expiration_milliseconds`: The expiration time of the JWT in milliseconds. + - `http_header`: The header in which the JWT will be sent. + - `API_KEY`: The event service will send an API key in the `Authorization` header of the request. The following are the supported configuration options: + - `http_header`: The header in which the API key will be sent. + +[default-values-file]: https://github.com/stellar/java-stellar-anchor-sdk/blob/develop/platform/src/main/resources/config/anchor-config-default-values.yaml +[clients-config]: ../../admin-guide/sep10/README.mdx#config-with-client-attribution diff --git a/ap_versioned_docs/version-2.9/admin-guide/getting-started.mdx b/ap_versioned_docs/version-2.9/admin-guide/getting-started.mdx new file mode 100644 index 0000000000..d373ecaaa1 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/getting-started.mdx @@ -0,0 +1,384 @@ +--- +title: "Getting Started" +sidebar_position: 30 +--- + +## Installation + +import { CodeExample } from "@site/src/components/CodeExample"; + +The easiest way to install the Anchor Platform is to pull the [docker image][anchor-platform-image]. + + + +```bash +docker pull stellar/anchor-platform:2.9.0 +``` + + + +## Set Up the Development Environment + +In this guide we'll use [docker compose][docker-compose] for simplicity, but you can run the Anchor Platform using other tools that support docker as well, such as [minikube] or a full-blown [kubernetes] cluster. + +Let's create a minimal compose file to get started. + + + +```yaml +# docker-compose.yml +services: + sep-server: + image: stellar/anchor-platform:2.9.0 + command: --sep-server + ports: + - "8080:8080" + env_file: + - ./dev.env + volumes: + - ./config:/home + platform-server: + image: stellar/anchor-platform:2.9.0 + command: --platform-server + ports: + - "8085:8085" + env_file: + - ./dev.env + volumes: + - ./config:/home +``` + + + +The `--sep-server` option tells the Anchor Platform to make the API endpoints defined by the SEPs you've enabled via configuration available on port 8080. + +The `--platform-sever` option makes the Platform API available, which is the backend API your service(s) will use to communicate with the Anchor Platform. It will be available on port 8085 + +## Configuration + +The Anchor Platform supports two approaches for configuration: + +- using environment variables +- using a YAML configuration file + +One or a combination of both approaches can be used. Nested variables in the YAML file are expressed using underscores or dots (`_`, `.`) when using environment variables. We'll demonstrate both approaches here, but use enviroment variables exclusively in subsequent sections. See the full set of configuration options in the Anchor Platform's [default values file][ap-default-values]. + +:::info + +The Anchor Platform does not allow application secrets in the YAML configuration file. Instead, application secrets, which all have the `SECRET_` prefix, must be specified in the environment. + +::: + +Lets create the environment file specified in our docker compose file. + + + +```bash +touch dev.env +``` + + + +And if you're using a YAML configuration file, lets create that too. + + + +```bash +mkdir config +touch config/dev.services.yaml +``` + + + +You'll need to inform the Anchor Platform where it can find your config file. So lets add an environment variable for that. + + + +```bash +# dev.env +STELLAR_ANCHOR_CONFIG=/home/dev.services.yaml +``` + + + +Specify the configuration schema version in your YAML file. + + + +```yaml +# dev.services.yaml +version: 1 +``` + + + +### Changing Port of the Platform Server + +For example, let's change port of the platform server. + +Using environment variables, this is simply: + + + +```bash +# dev.env +PLATFORM_SERVER_PORT=8085 +``` + + + +Or if using YAML configuration: + + + +```yaml +# dev.services.yaml +platform_server: + port: 8085 +``` + + + +### Specify Your Service's Assets + +Lets add the assets your Anchor Platform deployment will utilize. This configuration is specified in a YAML file. If you're only using the Anchor Platform for hosting a SEP-1 stellar.toml file or for running SEP-10 Stellar Authentication, you can skip this step. + + + +```bash +touch config/dev.assets.yaml +``` + + + +In this guide we'll build anchor services for Circle's USDC on Stellar's test network. Update the above values based on the assets you'll be issuing. Make sure to specify the testnet `issuer` in your development file, and create your own `distribution_account` using a tool like [Stellar Lab][stellar-lab]. The `distribution_account` will be used by your clients as the destination account for payments to your service. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 +``` + + + +This file needs to be referenced in our configuration so the Anchor Platform can find it. + +Using environment variables: + + + +```bash +# dev.env +ASSETS_TYPE=file +ASSETS_VALUE=/home/dev.assets.yaml +``` + + + +Using a YAML file: + + + +```yaml +# dev.services.yaml +assets: + type: file + value: /home/dev.assets.yaml +``` + + + +### Add Data Persistence + +The Anchor Platform supports [PostgreSQL][postgresql] and [Aurora PostgreSQL][aurora-postgresql] for use in production, but also supports [H2][h2] or [SQLite][sqlite] for use in development. For managing migrations, the Anchor Platform uses [Flyway][flyway]. The latest version of PostgreSQL supported by Flyway is PostgreSQL 14. + +Before we move forward, let's add a database to our development environment so the transactions we initiate persist after stopping the service. + +A database is only needed if using the Anchor Platform to facilitate transactions. + + + +```yaml +# docker-compose.yml +version: "3.8" +services: + sep-server: + image: stellar/anchor-platform:2.9.0 + command: --sep-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8080:8080" + depends_on: + - db + platform-server: + image: stellar/anchor-platform:2.9.0 + command: --platform-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8085:8085" + depends_on: + - db + db: + image: postgres:14 + ports: + - "5432:5432" + env_file: + - ./dev.env + volumes: + - ./init.sql:/docker-entrypoint-initdb.d/init.sql +``` + + + +Now let's update our environment so the platform server can connect to the database server. + + + +```bash +# dev.env +DATA_TYPE=postgres +DATA_SERVER=db +DATA_DATABASE=platform +DATA_FLYWAY_ENABLED=true + +SECRET_DATA_USERNAME=postgres +SECRET_DATA_PASSWORD=password + +POSTGRES_USER=postgres +POSTGRES_PASSWORD=password +``` + + + +If you're using YAML configuration instead, the `POSTGRES_` environment variables should always be in the environment, as they're for your database server, not the Anchor Platform. The secrets must also be specified in environment. + + + +```yaml +# dev.services.yaml +data: + type: postgres + server: db + database: platform + flyway_enabled: true +``` + + + +We have to create the `platform` database before the platform server can connect to it, so let's make a script to create our database. + + + +```bash +touch init.sql +``` + + + + + +```sql +-- init.sql +CREATE DATABASE platform; +``` + + + +Try to run the platform server in addition to the database. + + + +```bash +docker compose up +``` + + + +You should see the logs reporting a successful connection to the postgres database. + +### Configure Platform API Authentication + +To facilitate cross-border payments or deposit & withdrawal transactions, your business will need to fetch and update transaction records from the Anchor Platform's internal API. Currently, the `--sep-server` option makes public SEP APIs, while internal Platform API available on the Platform server, started by `--platform-server` option. Business should make Platform Server accessible only in the internal network, however it's possible to add authentication for accessing the internal Platform API. + +Add the following environment variables. + + + +```bash +# dev.env +PLATFORM_API_BASE_URL=http://platform-server:8085 +PLATFORM_API_AUTH_TYPE=jwt +SECRET_PLATFORM_API_AUTH_SECRET=[your jwt encryption key] +``` + + + +When making requests to the Platform API, add a JWT signed by the secret defined in your environment to the `Authorization` header as a bearer token. + +`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:2.9.0 + 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 +[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://lab.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 diff --git a/ap_versioned_docs/version-2.9/admin-guide/overview.mdx b/ap_versioned_docs/version-2.9/admin-guide/overview.mdx new file mode 100644 index 0000000000..6972fa3b25 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/overview.mdx @@ -0,0 +1,36 @@ +--- +title: "Overview" +sidebar_position: 10 +--- + +The Anchor Platform is the easiest and fastest way to deploy [anchor services](/docs/learn/fundamentals/anchors) compatible with [Stellar Ecosystem Proposals (SEPs)](https://github.com/stellar/stellar-protocol/tree/master/ecosystem). + +The goal of the Anchor Platform is to handle all Stellar-specific functionality and requirements for running an anchor, allowing businesses to focus on the core business logic necessary to provide these services. + +The Anchor Platform accomplishes this by implementing the ecosystem's standardized APIs (SEPs) for wallets, exchanges, and other applications to consume, while offering a set of backend APIs for businesses to provide information specific to them, such as transaction fees, exchange rates, and off-chain transaction statuses. + +Below is a list of SEPs currently supported: + +- [SEP-1][sep-1]: [Stellar Info File][sep1-ap] +- [SEP-6][sep-6]: [Programmatic Deposit and Withdrawal][sep6-ap] +- [SEP-10][sep-10]: [Stellar Authentication][sep10-ap] +- [SEP-12][sep-12]: KYC API +- [SEP-24][sep-24]: [Hosted Deposit and Withdrawal][sep24-ap] +- [SEP-31][sep-31]: [Cross-Border Payments API][sep31-ap] +- [SEP-38][sep-38]: Anchor RFQ API + +The documentation for the Anchor Platform is a work in progress. Developers are welcome to dive into the code and existing documentation on the [GitHub repository][anchor-platform-github], or if you're looking to build an on & off-ramp service compatible with SEP-24, see our [getting started guide][sep24-ap]. + +[sep-1]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md +[sep-6]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md +[sep-10]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md +[sep-12]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md +[sep-24]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md +[sep-31]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md +[sep-38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md +[anchor-platform-github]: https://github.com/stellar/java-stellar-anchor-sdk +[sep1-ap]: ./sep1/README.mdx +[sep6-ap]: ./sep6/README.mdx +[sep10-ap]: ./sep10/README.mdx +[sep24-ap]: ./sep24/README.mdx +[sep31-ap]: ./sep31/README.mdx diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep1/README.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep1/README.mdx new file mode 100644 index 0000000000..8344b44e88 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep1/README.mdx @@ -0,0 +1,66 @@ +--- +title: Stellar Info File +sidebar_position: 40 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Let's enable applications to learn more about your service by hosting a `stellar.toml` file at a standardized URL path. This file allows applications to find information about your business, the assets your services utilize, as well as the root URL paths for these services. We can host this file using the Anchor Platform. + +Let's create a file called `dev.stellar.toml` file using the contents below as a starting point. For the full set of attributes, see the [SEP-1 specification][sep-1]. + + + +```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" + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +Note that you'll 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. + +In your `dev.env` file, specify the following. + + + +```bash +# dev.env +SEP1_ENABLED=true +SEP1_TOML_TYPE=file +SEP1_TOML_VALUE=/home/dev.stellar.toml +``` + + + +This will tell the Anchor Platform that it should host the file specified by `SEP1_TOML_VALUE` at `./well-known/stellar.toml`. + +Alternatively, your `stellar.toml` file could be hosted using a proper static file server like [nginx]. As long as your info file includes the appropriate URLs pointing to the Anchor Platform, this will work just fine. + +[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://lab.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 diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep10/README.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep10/README.mdx new file mode 100644 index 0000000000..1db24083f6 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep10/README.mdx @@ -0,0 +1,156 @@ +--- +title: Stellar Authentication +sidebar_position: 50 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Enable Stellar Authentication + +Stellar-based wallet applications create authenticated sessions with Stellar anchors by proving they, or their users, have sufficient control over a Stellar account. Once authenticated, the wallet application uses a session token provided by the anchor in subsequent requests to the anchor's standardized services. + +The Anchor Platform supports this form of authentication with minimal configuration from the business. + + + +```bash +# dev.env +SEP10_ENABLED=true +SEP10_HOME_DOMAIN=localhost:8080 +SECRET_SEP10_SIGNING_SEED="a Stellar private key" +SECRET_SEP10_JWT_SECRET="a secret encryption key" +``` + + + +`SEP_10_HOME_DOMAIN` is the `home_domain` property used by [sep-10]. The configuration value must be equal to the host of the toml file. If you are hosting toml file via the Platform, (`SEP1_ENABLED` is set to `true`), toml file will be hosted on the SEP server. + +`SECRET_SEP10_SIGNING_SEED` is the private key to the public key you've specified as the `SIGNING_KEY` in your `stellar.toml` file. It will be used to sign authentication challenges presented to wallet applications, providing that you are in possession of the `SIGNING_KEY`. Wallets will check for this signature before signing and sending back the authentication challenge. + +`SECRET_SEP10_JWT_SECRET` is the encryption key that will be used to sign and verify the authentication tokens you issue to wallet applications after they or their users have proven control of their Stellar account. + +:::info + +By default, the Anchor Platform allows anyone with a Stellar account to authenticate with your services. If you'd like to only allow users of a particular wallet application to authenticate, or want to disallow specific users from authenticating, use the following environment variables. This is an optional feature and should only be added if it is a business requirement. + +::: + +## Config With Client Attribution + +`SEP10_CLIENT_ATTRIBUTION_REQUIRED` informs the Anchor Platform whether it should allow users of noncustodial wallets to authenticate without the wallet also identifying itself. + +`CLIENTS` is the list of outside wallet servers or clients for the Anchor server to safely communicate with. + + + +```bash +# dev.env +SEP10_CLIENT_ATTRIBUTION_REQUIRED=true +``` + + + + + +```yaml +clients: + # Each item in the list may contain the following fields: + # - name: (required) the name of the client + # - type: (required) `custodial` or `noncustodial` + # + # If the type is `custodial`, + # - signing_keys: (required) the custodial SEP-10 signing key of the client. + # - callback_url: (optional) the URL of the client's callback API endpoint. + # If one of SEP-specific URLs is also provided, then this URL will be used as a fallback. + # For example, if `callback_url_sep6` is not provided, but `callback_url_sep24` is, + # SEP-6 transactions will use the `callback_url` as the callback URL. This field is + # deprecated and will be removed in 3.0. + # - callback_url_sep6: (optional) the URL of the client's SEP-6 callback API endpoint. + # - callback_url_sep24: (optional) the URL of the client's SEP-24 callback API endpoint. + # - callback_url_sep31: (optional) the URL of the client's SEP-31 callback API endpoint. + # - callback_url_sep12: (optional) the URL of the client's SEP-10 callback API endpoint. + # - allow_any_destination: (optional) default to false. If set to true, allows any destination for deposits. + # - destination_accounts: (optional) list of accounts allowed to be used for the deposit. + # If allows_any_destinations set to true, this configuration option is ignored. + # + # If the type is `noncustodial`, + # - domains: (required) the domains of the client. + # - callback_url: (optional) the URL of the client's callback API endpoint + + # custodial client + - name: custodial-client1 + type: custodial + signing_keys: "the signing key 1 of the client1","the signing key 2 of the client1" + callback_url: https://callback.custodial-client1.com/api/v1/anchor/callback + callback_url_sep6: https://callback.custodial-client1.com/api/v1/anchor/callback/sep6 + callback_url_sep12: https://callback.custodial-client1.com/api/v1/anchor/callback/sep12 + allow_any_destination: false + destination_accounts: destAccount1,destAccount2 + - name: custodial-client2 + type: custodial + signing_keys: "the signing key of the client2", + + # noncustodial client + - name: noncustodial-client1 + type: noncustodial + domains: noncustodial-client1.co,noncustodial-client1.com + callback_url: https://callback.noncustodial-client1.co/api/v2/anchor/callback + callback_url_sep6: https://callback.noncustodial-client1.co/api/v2/anchor/callback/sep6 + callback_url_sep12: https://callback.noncustodial-client1.co/api/v2/anchor/callback/sep12 + - name: noncustodial-client2 + type: noncustodial + domains: noncustodial-client2.com +``` + +```bash +# dev.env +# custodial client +CLIENTS[0]_NAME=custodial-client1 +CLIENTS[0]_TYPE=custodial +CLIENTS[0]_SIGNING_KEYS="the signing key 1 of the client1","the signing key 2 of the client1" +CLIENTS[0]_CALLBACK_URL=https://callback.custodial-client1.com/api/v1/anchor/callback +CLIENTS[0]_ALLOW_ANY_DESTINATION=false +CLIENTS[0]_DESTINATION_ACCOUNTS=destAccount1,destAccount2 +CLIENTS[1]_NAME=custodial-client2 +CLIENTS[1]_TYPE=custodial +CLIENTS[1]_SIGNING_KEYS="the signing key of the client2" + +# noncustodial client +CLIENTS[2]_NAME=noncustodial-client1 +CLIENTS[2]_TYPE=noncustodial +CLIENTS[2]_DOMAINS=noncustodial-client1.co,noncustodial-client1.com +CLIENTS[2]_CALLBACK_URL=https://callback.noncustodial-client1.co/api/v2/anchor/callback +CLIENTS[3]_NAME=noncustodial-client2 +CLIENTS[3]_TYPE=noncustodial +CLIENTS[3]_DOMAINS=noncustodial-client2.com +``` + + + +`SEP10_CLIENT_ATTRIBUTION_REQUIRED` informs the Anchor Platform whether it should allow users of noncustodial wallets to authenticate without the wallet also identifying itself. + +`CLIENTS` is the list of outside wallet servers or clients for the Anchor server to safely communicate with. + +## Modify a Stellar Info File + +Next, let's modify `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-10 functionality is supported by your business. + + + +```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" + +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +[sep1-ap]: ../sep1/README.mdx diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep24/README.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep24/README.mdx new file mode 100644 index 0000000000..4d78a93bbd --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep24/README.mdx @@ -0,0 +1,10 @@ +--- +title: Hosted Deposits and Withdrawals +sidebar_position: 60 +--- + +import DocCardList from "@theme/DocCardList"; + +SEP-24 allows for a means by which wallets and/or exchanges allow the user to directly interact with an on & off-ramp. + + diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep24/configuration.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep24/configuration.mdx new file mode 100644 index 0000000000..09c8dc7090 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep24/configuration.mdx @@ -0,0 +1,190 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Modify a Stellar Info File + +Next, let's modify `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-24 functionality is supported by your business, and they also need to know all 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_SEP0024 = "http://localhost:8080/sep24" +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" + +# Optionally, add support for XLM +[[CURRENCIES]] +code = "native" +status = "test" +is_asset_anchored = false +anchor_asset_type = "crypto" +desc = "XLM, the native token of the Stellar network." + +[DOCUMENTATION] +ORG_NAME = "Your organization" +ORG_URL = "Your website" +ORG_DESCRIPTION = "A description of your organization" +``` + + + +Note that you'll 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 Hosted Deposits & Withdrawals + +Now you're ready to enable hosted deposits and withdrawals via the SEP-24 API. Specify the following in your `dev.assets.yaml` file, and change the values depending on your preferences. This example asset file will enable support for Circle's USDC and a fiat USD. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep24_enabled: true + deposit: + enabled: true + withdraw: + enabled: true + - schema: iso4217 + code: USD + significant_decimals: 2 + deposit: + enabled: true + withdraw: + enabled: true + # Optional support for XLM + - schema: stellar + code: native + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 7 + sep24_enabled: true + deposit: + enabled: true + withdraw: + enabled: true +``` + + + +The information provided for the `assets` value closely maps to the information that will be exposed to the wallet application using the [`GET /info`][sep24-get-info] SEP-24 endpoint. The Anchor Platform also uses this information to validate requests made to your service. + +Add the following variables to your environment file. + + + +```bash +# dev.env +SEP24_ENABLED=true +SEP24_INTERACTIVE_URL_BASE_URL=http://example.com +SEP24_MORE_INFO_URL_BASE_URL=http://example.com +SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET="your encryption key shared with your business server" +SECRET_SEP24_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" +``` + + + +`SEP24_INTERACTIVE_URL_BASE_URL` is the URL that the Anchor Platform will provide to wallet applications when they initiate transactions. Wallet applications will open this URL in a web view inside their app, handing over control of the user experience from the wallet to your business. This URL points to the web widget your business implements. It contains all business-defined logic. We'll dive further into this experience in subsequent sections. + +`SEP24_MORE_INFO_URL_BASE_URL` is the URL that the Anchor Platform will provide to wallet applications when they want to show information about a transaction initiated previously. This URL is most often used by wallets in their transaction history views, and your business can define what information to display about the transaction. + +`SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET` and `SECRET_SEP24_MORE_INFO_URL_JWT_SECRET` are encryption keys that the Anchor Platform will use to generate short-lived tokens it will add to the URLs provided to the wallet. Your business server must also have these keys in its environment so it can verify the token's signature. + +## 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" + +SEP24_ENABLED=true +SEP24_INTERACTIVE_URL_BASE_URL=http://localhost:8081 +SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET="your encryption key shared with your business server" +SECRET_SEP24_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" +``` + + + +To test this out, go to the [Stellar Demo Wallet][stellar-demo-wallet]. + +[![demo wallet connected to the anchor platform](../../assets/anchor-platform-sep24-demo-wallet.png)](../../assets/anchor-platform-sep24-demo-wallet.png) + +Initiate a 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-24 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. However, when the demo wallet attempts to open the URL provided by the Anchor Platform, you'll get a not found page. + +[![demo wallet after initiating a transaction](../../assets/anchor-platform-sep24-demo-wallet-widget.png)](../../assets/anchor-platform-sep24-demo-wallet-widget.png) + +[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://lab.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 +[sep1-ap]: ../sep1/README.mdx diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep24/example.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep24/example.mdx new file mode 100644 index 0000000000..77fb8b9959 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep24/example.mdx @@ -0,0 +1,438 @@ +--- +title: "Example" +sidebar_position: 40 +--- + +Integrating with the Anchor Platform involves three key areas: + +- Building a web-based user experience that can be opened in a mobile web view +- Providing transaction status updates to the Anchor Platform +- Fetching transaction status updates from the Anchor Platform + +## Building a Web-Based User Experience + +The Anchor Platform does not offer a white-label UI that your business can utilize, and instead expects the business to build their own UI and backend system. We won't build an entire on & off-ramp user experience in this guide, but will cover the ways in which your existing product should be updated to be compatible with the Anchor Platform. + +### Authentication + +If your business has an existing on & off-ramp product, you likely have an existing system for user authentication. However, because the Anchor Platform authenticates the user prior to providing the business's URL, requiring the user to go through another form of authentication is actually unnecessary. In this way, the Anchor Platform can be thought of as providing an alternative form of authentication. + +The business is free to continue requiring users to authenticate using their existing system, but the ideal user experience would skip this step and create an authenticated session for the user if they have already authenticated using their Stellar account. + +The Anchor Platform adds a JWT `token` query parameter to the business's URL given to the wallet application. This token is signed by the previously-configured `SECRET_SEP24_INTERACTIVE_URL_JWT_SECRET` value, and includes the information you need to identify the user. The process should look something like this: + +1. Pass the `token` added to the URL of your backend system +2. Verify the signature on the `token` and check its expiration +3. Create an authenticated session for the user identified by `token.sub` + +The decoded contents of the `token` will look something like this: + + + +```json +{ + "jti": "e26cf292-814f-4918-9b40-b4f76a300f98", + "sub": "GB244654NC6YPEFU3AY7L25COGES445P3Q63W6Q76JHR3UBJMLT2XBOB:1234567", + "exp": 1516239022, + "data": { + "first_name": "John", + "last_name": "Doe", + "email": "johndoe@example.com" + } +} +``` + + + +Note that the `sub` value identifies the user using a Stellar account and integer. This is what the value will be when custodial applications that use an omnibus account authenticate with your service. When non-custodial wallets authenticate, the token may look slightly different. + + + +```json +{ + "jti": "e26cf292-814f-4918-9b40-b4f76a300f98", + "sub": "GB244654NC6YPEFU3AY7L25COGES445P3Q63W6Q76JHR3UBJMLT2XBOB", + "exp": 1516239022, + "data": { + "client_domain": "api.vibrantapp.com", + "first_name": "John", + "last_name": "Doe", + "email": "johndoe@example.com" + } +} +``` + + + +The `sub` value here only contains a public key to identify the user, and the `data.client_domain` field identifies the wallet application used to authenticate. + +In both cases, all information in the `data` object is optional, and will only be present if the wallet provides that information. + +Let's add a backend server to our compose file that will be used to verify the token and create authenticated web sessions for users initiating transactions. + + + +```yaml +# docker-compose.yaml +--- +business-server: + build: . + ports: + - "8081:8081" + env_file: + - ./dev.env + depends_on: + - platform-server +``` + + + +Let's create a simple Docker container for our application. + + + +```docker +FROM node:19 + +WORKDIR /home +COPY . . +RUN npm install + +CMD ["node", "server.js"] +``` + + + +Now let's create a minimal NodeJS application. + + + +```bash +yarn init -y +yarn add express jsonwebtoken +touch server.js +``` + + + +Below is an example of a backend server authenticating a user using NodeJS. + + + +```js +# server.js +const express = require("express"); +const jwt = require("jsonwebtoken"); +const app = express(); +const port = process.env.BUSINESS_SERVER_PORT; + +app.use(express.json()); + +/* + * We'll store user session data in memory, but production systems + * should store this data somewhere more persistent. + */ +const sessions = {}; + +/* + * Create an authenticated session for the user. + * + * Return a session token to be used in future requests as well as the + * user data. Note that you may not have a user for the stellar account + * provided, in which case the user should go through your onboarding + * process. + */ +app.post("/session", async (req, res) => { + let decodedPlatformToken; + try { + decodedPlatformToken = validatePlatformToken(req.body.platformToken); + } catch (err) { + res.status = 400; + res.send({ "error": err }); + return; + } + let user = getUser(decodedPlatformToken.sub); + let sessionToken = jwt.sign( + { "jti": decodedPlatformToken.jti }, + process.env.SESSION_JWT_SECRET + ); + sessions[sessionToken] = user; + res.send({ + "token": sessionToken, + "user": user + }); +}); + +/* + * Validate the signature and contents of the platform's token + */ +function validatePlatformToken(token) { + if (!token) { + throw "missing 'platformToken'"; + } + let decodedToken; + try { + decodedToken = jwt.verify(token, process.env.SECRET_SEP10_JWT_SECRET); + } catch { + throw "invalid 'platformToken'"; + } + if (!decodedToken.jti) { + throw "invalid 'platformToken': missing 'jti'"; + } + return decodedToken; +} + +/* + * Query your own database for the user based on account:memo string parameter + */ +function getUser(sub) { + return null; +} + +app.listen(port, () => { + console.log(`business server listening on port ${port}`); +}); +``` + + + +Run this with the platform server and database and initiate a new transaction with the [demo wallet][stellar-demo-wallet]. Then, we'll send the token to our server. + + + +```bash +curl \ + -X POST \ + -H 'Content-Type: application/json' \ + -d '{"platformToken": ""}' \ + http://localhost:8081/session | jq +``` + + + +## Providing Updates to the Platform + +Let's create an endpoint for our business server that accepts the information collected in our UI. + + + +```js +# server.js + +// Production systems should either let the Anchor Platform generate its own memos +// or have your custodial service generate a memo for each transaction. +const transactionMemos = {}; + +app.post("/transaction", async (req, res) => { + let sessionToken; + try { + sessionToken = validateSessionToken(req.headers.get("authorization")); + } catch (err) { + res.status = 400; + res.send({ "error": err }) + return; + } + // assuming this is a withdrawal transaction, we'll provide a memo, which is + // required by our third-party custodian to credit us the payment. When the + // payment is made with this memo, we can match the on-chain payment with the + // transaction in the Anchor Platform's database. + transactionMemos[req.body.transaction.id] = parseInt(Math.random() * 100000); + let rpcRequestBody = [ + { + "id": 1, + "jsonrpc": "2.0", + "method": "request_onchain_funds", + "params": { + "transaction_id": req.body.transaction.id,, + "message": "waiting for the user to provide off-chain funds.", + "amount_in": { + "amount": req.body.amount_in.amount, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": req.body.amount_out.amount, + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": req.body.amount_fee.amount, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "destination_account": "GD...G", + "memo": transactionMemos[req.body.transaction.id], + "memo_type": "id" + } + } + ]; + let platformResponse; + try { + platformResponse = await updatePlatformTransaction(rpcRequestBody); + } catch (err) { + res.status = 500; + res.send({ "error": err }) + return; + } + res.send({ + "transaction": platformResponse.records[0] + }); +}); + +function validateSessionToken(authorizationHeader) { + let parts = authorizationHeader.split(" "); + if (parts.length != 2 || parts[0] != "Bearer") { + throw "invalid authorization header format"; + } + let sessionToken = parts[1]; + try { + jwt.verify(sessionToken, process.env.SESSION_JWT_SECRET); + } catch { + throw "invalid session token"; + } + if (!sessions[sessionToken]) { + throw "expired session"; + } + return sessionToken; +} + +async function updatePlatformTransaction(requestBody) { + let response = await fetch( + `${process.env.PLATFORM_SERVER}`, + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(requestBody) + } + ); + if (response.status != 200) { + throw `unexpected status code: ${response.status}`; + } + return await response.json(); +} +``` + + + +This will update the Anchor Platform's database with the information provided and enable wallet applications to fetch this updated information so it can relay it back to the user. You should have already informed the user of the transaction's amounts and that your business's is waiting for the on-chain payment to arrive, but providing these updates allows users to view their transactions' statuses through their mobile application without opening the business' UI again. + +:::note + +At this time, the Anchor Platform does not send notifications to the wallet application when transaction statuses change, however, it is on our roadmap to add these notifications or "callback requests" so that wallet applications do not have to poll the Anchor Platform for updates. + +::: + +## Fetching Updates from the Platform + +If you only use the Anchor Platform to expose the SEP APIs to wallet applications, then you won't have a strong reason for fetching transaction status updates from the Anchor Platform, mostly because it won't update the transaction status until you make `JSON-RPC API` requests. + +However, if you use the Anchor Platform to monitor the Stellar network for incoming payments (associated with withdrawal transactions), the Anchor Platform will update transaction statuses when payments are received. + +There are two ways to fetch updates from the Anchor Platform, + +- Polling the Platform API's `GET /transactions/:id` endpoint for the transactions you're expecting a payment for +- Streaming transaction status change events from a Kafka cluster + +While streaming transaction status changes from a Kafka cluster may be a more robust and scalable approach, we're going to use the polling method in this guide. Setting up and using a Kafka cluster will be the subject of a different section of the docs. + +First, let's configure the Anchor Platform to observe the Stellar network for incoming payments. + + + +```yaml +# docker-compose.yml +--- +stellar-observer: + image: stellar/anchor-platform:2.9.0 + command: --stellar-observer + env_file: + - ./dev.env + volumes: + - ./config:/home + depends_on: + - db +``` + + + +The `--stellar-observer` command starts a process that monitors the distribution accounts configured in your `config.yaml` file for withdrawal payments. + +If a payment is sent to one of these accounts and the memo attached to the transaction matches a `memo` value provided or generated by the Anchor Platform, the Anchor Platform will consider the transaction that memo is associated with as received and update the transaction's status to `pending_anchor`. It does this by making a `JSON-RPC API` request, so we need to configure the URL it should use. + + + +```bash +# dev.env +PLATFORM_API_BASE_URL=http://platform-server:8085 +``` + + + +Let's make some additions to the `server.js` file so we can poll the Anchor Platform for our expected payments. + + + +```js +// server.js +... +/* + * Fetch the transaction data from the Platform API + * + * Production systems should have proper retry mechanisms. + */ +async function getPlatformTransaction(transactionId) { + let response = await fetch(`${process.env.PLATFORM_SERVER}/transactions/${transactionId}`) + if (response.status != 200) { + throw `unexpected status code: ${response.status}`; + } + return await response.json(); +} + +(async () => { + while (true) { + await new Promise(r => setTimeout(r, 2000)); + let requestPromises; + for (const transactionId in transactionMemos) { + requestPromises.push(getPlatformTransaction(transactionId)) + } + let transactions = await new Promise.all(requestPromises); + for (const transaction in transactions) { + // assuming all requests were successful + if (transaction.status == "pending_anchor") { + // initiate off-chain delivery of funds + console.log(`received payment for transaction ${transaction.id}`); + } + } + } +})() +``` + + + +## Full Example Implementation + +Stellar provides an example business server implementation for SEP-24. It's split into two parts: 1) a web UI, accessible for the end user; and 2) a back-end implementation, used to get and push updates from/to the Anchor Platform. + +The code for web UI can be found [here][sep-24-ref-ui] + +The code for the backend is a part of the Anchor Platform, and is available as a [submodule][sep-24-ref]. + +[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://lab.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 diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep24/faq.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep24/faq.mdx new file mode 100644 index 0000000000..5972a06cf9 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep24/faq.mdx @@ -0,0 +1,39 @@ +--- +title: "FAQ" +sidebar_position: 50 +--- + +### How To Use JWTs? + +As part of the flow, once a user makes a request, i.e. an interactive withdrawal/deposit request, it will be processed by the Anchor Platform and forwarded to your service. The Anchor Platform will make a `GET` call to `?token=`. + +This JWT token will contain: + +1. `exp` is the expiration time of the token. You should check that the provided token has not expired. +2. `sub` is the account associated with this transaction. It can be used to identify the user account. Note that this value may be different from the account that will be used to receive/send funds. +3. `jti` is the hash of the transaction. +4. `data` is the extra payload that has been set by the user. It will always contain the Stellar `asset` wants to deposit or withdraw. If provided by the client, it will also contain the `amount` the user wants to transact, the `client_domain` of the wallet verified during SEP-10 authentication, and `client_name` (defined as 'name' in [clients] configuration if provided), and the `lang` (language) preference of the user. + +### How To Provide Fees? + +Currently, it's recommended to provide fees/exchange rates in the iFrame/web view of your application. + +[SEP-24] standard provides a `/fee` endpoint to allow businesses to set static fees for their transactions. However, it's not currently supported by the Anchor Platform. + +:::note + +/fee endpoint will be deprecated in the future. + +::: + +### How to identify the user account? + +You should use the `sub` field of the JWT token. For custodial wallets, this value will be in the format `account:memo`. Use the memo to identity the user. For noncustodial wallets, simply use the `sub` value itself, which will be equal to the user account. + +### How to identify the wallet? + +Utilize the `data.client_domain` attributes within the JWT token. In the presence of [clients] configuration, the JWT token will additionally incorporate the `data.client_name` field, enabling wallet identification. + +[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 +[clients]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep24/getting-started.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep24/getting-started.mdx new file mode 100644 index 0000000000..ce1d1dbf46 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep24/getting-started.mdx @@ -0,0 +1,33 @@ +--- +title: "Getting Started" +sidebar_position: 10 +--- + +This guide will walk you through configuring and integrating with the Anchor Platform for the purpose of building an on & off-ramp service compatible with [SEP-24][sep-24], the ecosystem's standardized protocol for hosted deposits and withdrawals. + +By leveraging the Anchor Platform's support for SEP-24, businesses make their 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-24: [SEP-1 (Stellar Info File)][sep1-ap] and [SEP-10 (Stellar Authentication)][sep10-ap] + +## The Basic User Experience + +The complete customer experience a deposit and withdrawal goes something like this: + +1. The customer opens the SEP-24 wallet application of their choice +2. The customer selects an asset to deposit and the wallet finds an anchor (clients could also chose 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 (e.g. makes a 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 wallet opens the given interactive URL and allows the customer to enter their transaction information (KYC has already been 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 bank transfer. + +[sep-24]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md +[installation-ap]: ../../admin-guide/getting-started.mdx +[sep1-ap]: ../sep1/README.mdx +[sep10-ap]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep24/integration.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep24/integration.mdx new file mode 100644 index 0000000000..a396e9c44d --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep24/integration.mdx @@ -0,0 +1,1009 @@ +--- +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 Anchor Platform about events related to the transaction. + +In general, you'll want to provide updates for the following events: + +- Your business is processing the KYC information provided by the user +- 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 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 this 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-24 protocol document][sep-24] + +## Securing Platform API + + + +### Using API Key + + + +### Using JWT + + + +## Making JSON-RPC Requests + + + +### JSON-RPC Request + + + +### JSON-RPC Response + + + +### Error Codes + + + +## Updating Deposit Transaction Via JSON-RPC + +SEP-24 deposit flow diagram defines sequence/rules of the transaction's status transition and a set of JSON-RPC methods 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. + +[![sep24 deposit flow](../../assets/sep24-deposit-flow-diagram.png)](../../assets/sep24-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. + +::: + +### Ready to Receive Funds + +The first step of the deposit flow after starting the deposit itself is collecting KYC. It's usually done in the web-app, but can also be optionally provided by the wallet application, using [SEP-9]. Once the necessary KYC is collected, a `request_offchain_funds` JSON-RPC request should be made. + + + +```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 + } + } + } +] +``` + + + +- `amount_in` is the amount the user has to sent 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. + +Information abouts amounts (in/out/fee) is required if you want to move the transaction from the `incomplete` to the `pending_user_transfer_start` status. If transaction status is changed from `pending_anchor` to `pending_user_transfer_start`, you can skip defining the amounts. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh request-offchain-funds.json +``` + + + +:::tip + +When the KYC process is long (for example, ID verification), it's advised to first set the transaction status to `pending_anchor` by using `notify_interactive_flow_completed` JSON-RPC request. This will indicate to the user that KYC is being processed. + +::: + +### Processing KYC Information + +:::tip + +This step is optional. Most businesses don't use it. You can skip it and go to the [next step](#funds-received). + +Using this status is recommended when KYC verification may need to be performed asynchronously. + +::: + +You **must** specify the `amount_x` fields. + + + +```json +// kyc-in-process.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_interactive_flow_completed", + "params": { + "transaction_id": "", + "message": "Interactive flow completed.", + "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 + } + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh kyc-in-process.json +``` + + + +### Funds Received + +If offchain funds were received, you'll want to provide an 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 from previous JSON-RPC requests will be taken. + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh offchain-funds-received.json +``` + + + +### Waiting For User Funds + +In a 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 a user request. After the transaction completion, 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. To make a payment via custody service, it's necessary to 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/learn/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, it's necessary to 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. + +::: + +### 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. + + + +```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 + +It's similar to [Refund sent](#refund-sent), but it handles a 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 a good practice to clean up inactive transactions in the `incomplete` status. To do so, simply change the transaction status to `expired`. + + + +```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. + +::: + +### On-Hold Transaction + +In rare cases, you may want to pause current transaction and request more information from the user (after the transfer has been received). This could be used for compliance use cases. + + + +```json +// transaction-hold.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_transaction_on_hold", + "params": { + "transaction_id": "", + "message": "Transaction is on hold. Please contact customer support to resolve the hold." + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh transaction-hold.json +``` + + + +### 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, it's necessary to 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 Transaction Via JSON-RPC + +This diagram defines a sequence/rules of transaction's status transition for SEP-24 withdrawal flow. + +[![sep24 withdrawal flow](../../assets/sep24-withdrawal-flow-diagram.png)](../../assets/sep24-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 deposit 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 + +Similar to deposit, the next step 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 update will look differently. + + + +```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" + } + } +] +``` + + + +- `memo` Value of memo to attach to the transaction +- `memo_type` Type of memo that the anchor should attach to the transaction +- `destination_account` Destination account + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh request-onchain-funds.json +``` + + + +:::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. + +::: + +### Processing KYC Information + +This step is optional, and it's similar to [Processing KYC Information](#processing-kyc-information) of the deposit flow. + +### 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 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 +``` + + + +### 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 +``` + + + +### 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. + +### On-Hold Transaction + +Works in the same manner as for the deposit flow. For more details, see [On-Hold Transaction](#on-hold-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 + + + +[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 +[json-rpc-methods]: ../../api-reference/platform/rpc/methods/README.mdx diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep24/setting-up-production-server.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep24/setting-up-production-server.mdx new file mode 100644 index 0000000000..f631e5dbf3 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep24/setting-up-production-server.mdx @@ -0,0 +1,112 @@ +--- +title: Set Up a Production Server +sidebar_position: 60 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Once the test server is live and you have tested both deposit and withdraw flows, it's time to get started with the real deploy connected to real KYC and real banking rails providers. Before using any banking APIs, it's critical that you perform a full security audit on the system to make sure that there aren't any vulnerabilities. + +## Deploying a Secure Environment + +Make sure to keep the test server up, and deploy the production (mainnet) system in a separate environment. Having two deploys allows you to validate new features on the testnet before moving them to the final production deploy. You can also have a third staging environment if there's a big team working on this codebase and/or there will be many pushes to be tested internally before sharing with other institutions. + +To switch to Stellar's public (mainnet) network, all you have to do is change the network [passphrase](/docs/learn/encyclopedia/network-configuration/network-passphrases) (for authenticating requests) and [Horizon URL](https://horizon.stellar.org/). + +You can copy your existing development configs to create a production configuration. + +First, you need to change your info file (`stellar.toml`): + + + +```toml +# stellar.toml +NETWORK_PASSPHRASE = "Public Global Stellar Network ; September 2015" +``` + + + +Next, change your Anchor Platform configuration in `production.env` file: + + + +```bash +# production.env +STELLAR_NETWORK_NETWORK="Public" +STELLAR_NETWORK_HORIZON_URL=https://horizon.stellar.org +``` + + + +## Connecting to Real KYC + +Most anchors need to collect [Know Your Customer](https://en.wikipedia.org/wiki/Know_your_customer) information to comply with local regulations before honoring deposits and withdrawals. The KYC flow usually consists of a simple form that gathers relevant information about the user such as name, email, address, age, and government-issued ID number. + +How you handle KYC is up to you: there are many services that provide KYC solutions through APIs and iFrames, and validate the input data and sync with governmental databases to verify requirements. Each jurisdiction has specific KYC requirements, and they differ from jurisdiction to jurisdiction, so it's best to find a country-specific KYC provider that meets your needs. + +Some countries require different KYC fields depending on the amount to be deposited or withdrawn. If that's the case in your jurisdiction and you need to adapt your KYC forms based on the deposit or withdrawal amount, simply add an amount field before the KYC form, and make sure that the KYC fields are updated based on that value. + +KYC information should be linked to the session created through [Stellar Web Authentication](../sep10/README.mdx) and, consequently, to the user, so you only need to ask the user for it once. After the first KYC flow is complete, a user shouldn't have to input the information again. + +Make sure the errors and validation messages are clear and include instructions for what to do next to ensure a good user experience and increase the KYC conversion rate. You should also localize messages based on the user's language and location. + +## Pre-Filling the KYC Form + +Pre-filling the KYC form is a great way to reduce the friction of getting started using an anchor, and wallets usually provide a set of fields that are commonly used throughout the ecosystem. In summary, the anchor can render the KYC form with the user's values that were previously sent by the wallet in the `/transactions/deposit/interactive` and `/transactions/withdraw/interactive` endpoints. + +All fields from [SEP-9](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0009.md) can be sent by wallets in the previously mentioned endpoints, but the most common are: email, first name, last name and phone number. Also, you should still enable the pre-filled fields to be editable, since the user might have inputted a different name in the Wallet's sign-up process, and could want to edit it before finalizing the Anchor's KYC process. + +All SEP-9 data that was sent from the wallet is a part of the [Interactive JWT](./faq.mdx#how-to-use-jwts), send by the Anchor Platform + +## Connecting to Real Banking Rails + +Fiat-backed token issuers are expected to manage a full reserve. That means there's a 1:1 relationship between Stellar-network tokens and money in the bank. Since each fiat token on Stellar is backed by, and can be redeemed for, an underlying, real-world asset, issuers of fiat-backed tokens need to connect to real banking rails to validate user deposits (through bank transfers, credit card payments, etc.) and to complete user withdrawals (generally through bank transfers). If you're an anchor honoring deposits and withdrawals of a token another organization issues, you'll follow a similar process. + +In order to fetch (and identify) a user transfer, issuers usually take one of two approaches: + +- API Polling: this option consists of fetching the bank's API, through a cron job, to check for the updated status of the list of transfers received by (and sent from) the issuer's bank account. Once the system confirms a new transaction and identifies that it relates to a specific deposit, it can send the digital funds to that user's account +- Webhook: not all banking rails support this option, but it's the leanest in terms of back-end logic. In this approach, the bank proactively hits an issuer's endpoint once it receives a new transfer, updating that information on the issuer's database. The issuer can then can match that transaction to an existing in-process deposit, and validate that the user can receive their digital funds + +There are many ways to identify that a specific bank transfer relates to a specific deposit (and, consequently, to a user). Some banks (and countries) have transfer infrastructure that allows the creation of a single bank account per transfer; others require users to add an identification parameter to their transfers. Some banks provide the user ID number in the transaction information so issuers can match that with the information provided in the KYC form. + +Make sure to do a full security audit on your systems when banking rails connections are in place. Some banks provide a testing API that can be used for development and deployment to testnet or staging environments, which means you can test and audit the codebase before moving to a final production-ready bank integration. For better security, some anchors also prefer to add a manual final step before approving withdrawal transfers. In terms of UX, this manual approval is acceptable as long as the wait times align with user expectations, which usually means they aren't longer than a couple of hours. + +## Testing Edge Cases + +Once your application is fully functional, it's a good idea to test different scenarios and edge cases to make sure the system is behaving as expected. Here's a list of testing suggestions that should cover a large amount of the application's edge cases: + +### General Tests + +- Test the interactive flow usability +- Test the interface using different locale information, and check for translated content including error messages, responses, date formatting, and number formatting + +### KYC Tests + +- Check that KYC appears with a new wallet SK +- Check that KYC doesn't accept incorrectly formatted inputs, and that the error messages are comprehensible +- Check that you can use the same KYC information (email, phone number, username, etc) multiple times +- Check that you can go through KYC multiple times with the same Stellar SK. + +### Interactive Test + +- Check that the deposit flow goes through, and that the banking rails are working +- Check that you cannot make a withdrawal with a value higher than the current balance +- Check that the withdrawal flow goes through, and that the banking rails are working + +### Security Tests + +- Make sure platform endpoints are secured + +## Polishing and Internationalization + +Supporting two languages (English and the fiat currency country language) allows users to have a seamless experience while navigating through screens, and supports international institutions (like wallets) that need to test the product before starting new integrations. + +You can support multiple languages in your webapp by using the `Accept-Language` parameter from the http request headers to localize the content and allowing users to change that in a simple way (e.g. a flag icon on the top bar). If a specific wallet doesn't send the header parameter, we recommend showing the user a language selection screen in the beginning of the deposit and withdraw processes. Once a user chooses a language, you can store their selection so you only need to ask them once. In addition to localizing text, make sure to check number formatting, dates, etc. + +Having a group of beta testers is a great way to check if there are any edge cases that need polishing, and to confirm that the system is working well with a variety of user inputs. You can beta test using a soft launch stage before you start putting effort into marketing and distribution. Documenting the testing process with screenshots and videos is very helpful for future security audits, and gives new partners and potential users clarity and confidence in the product. + +## Connecting to Wallets + +All Anchor user interactions are done through a Wallet, so it's vital for Anchors to be connected to Wallets that have a good market penetration in the region where the business is most focused. Connecting to Wallets is a simple process, since both ends of that integration are already compliant with SEPs. + +Stellar.org maintains a [list of wallets](https://www.stellar.org/ecosystem/projects), many of which currently support SEP-24 Sending them a message with more information on an asset and an issuer account is a great way to start getting some real users to the Anchor. diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep31/README.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep31/README.mdx new file mode 100644 index 0000000000..3cf13af916 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep31/README.mdx @@ -0,0 +1,10 @@ +--- +title: Cross-Border Payments +sidebar_position: 70 +--- + +import DocCardList from "@theme/DocCardList"; + +SEP-31 allows for a means by which wallets and/or exchanges interact with Stellar's existing set of send-side services. + + diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep31/configuration.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep31/configuration.mdx new file mode 100644 index 0000000000..d68d781de3 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep31/configuration.mdx @@ -0,0 +1,382 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +## Modify a Stellar Info File + +Let's start by modifying our `stellar.toml` file created [earlier][sep1-ap]. Wallets need to know that SEP-31 functionality is supported by your business, and they also need to know all 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" + +DIRECT_PAYMENT_SERVER = "http://localhost:8080/sep31" +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" + +[[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'll 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 Cross Border Payments + +Now you're ready to enable cross-border payments the SEP-31 API. Specify the following in your `dev.assets.yaml` file. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep31_enabled: true + sep31: + quotes_supported: true + quotes_required: true + fields: + transaction: {} + send: + min_amount: 0 + max_amount: 10000 +``` + + + +The information provided in the `sep31` and `send` objects closely map to the information that will be exposed to the wallet application using the [`GET /info`][sep31-get-info] SEP-31 endpoint. The Anchor Platform also uses this information to validate requests made to your service. `sep31.fields.transaction` should be left empty and will be removed in a future release, but you can adjust the `send.min_amount` and `send.max_amount` values according to your service's limits. + +The `sep31.quotes_supported` and `sep31.quotes_required` determine whether or not sending organizations can and are required to request an FX rate using the [SEP-38 `POST /quote`][sep38-post-quote] endpoint. Almost all senders prefer this approach so that they can communicate the rate to their customers prior to proceeding. + +Add the following variable to your environment file. + + + +```bash +# dev.env +SEP31_ENABLED=true +``` + + + +Senders should now be able to discover, authenticate, and initiate transactions with your service! Run the following command to start the Anchor Platform. + + + +```bash +docker compose up +``` + + + +Check that your API is live. + + + +```bash +curl http://localhost:8080/sep31/info | jq +``` + + + +You should get the following. + + + +```json +{ + "receive": { + "USDC": { + "enabled": true, + "quotes_supported": true, + "quotes_required": true, + "min_amount": 0, + "max_amount": 10000, + "fields": { + "transaction": {} + } + } + } +} +``` + + + +## Enable the Customer KYC API + +Businesses need to collect and validate KYC information on the customers they're facilitating transactions for. Clients determine what KYC information needs to be collected and send that information via a SEP-12 KYC API hosted by the Anchor Platform, but the Anchor Platform never stores personally-identifiable information (PII). Instead, it forwards requests from clients to the business server, and returns the business' responses back to the client, acting as a proxy server. + +See the [Anchor Platform KYC API specification][platform-api-kyc] for details on the endpoints that must be implemented on your business' server. + +To make this API available to clients, lets add the service URL to our Stellar Info File. + + + +```toml +# dev.stellar.toml +KYC_SERVER = "http://localhost:8080/sep12" +``` + + + +Lets enable it in our environment too. + + + +```bash +# dev.env +SEP12_ENABLED=true +``` + + + +Finally, we have to define your business' customer types. Each type of customer requires different a set of KYC information. For example, you can offer your cross-border payments service in two distinct regulatory jurisdictions, so customers in different jurisdictions have different KYC requirements and would be represented using different types. + +:::info + +Currently, customer types must be mutually exclusive, meaning a customer cannot be more than one type. + +This limitation is in place because the Anchor Platform cannot validate whether a customer is approved for a specific type of transaction, such as one sending a large amount. It can only validate that a customer is approved for one of the customer types defined. This limitation will be removed in a future release. + +::: + +In this guide, we'll only have two types, a sending customer type and a receiving customer type. Currently, our customer types are defined in our assets configuration, but this will change in a future release. + + + +```yaml +# dev.assets.yaml +sep31: + sep12: + sender: + types: + sep31-sender: + description: customers sending to recipients + receiver: + types: + sep31-receiver: + description: customers receiving from senders +``` + + + +Let's ping the info endpoint again to verify. After `docker compose up`, run the following command: + + + +```bash +curl http://localhost:8080/sep31/info | jq +``` + + + +You should get the following: + + + +```json +{ + "receive": { + "USDC": { + "enabled": true, + "quotes_supported": true, + "quotes_required": true, + "min_amount": 0, + "max_amount": 10000, + "fields": { + "transaction": {} + }, + "sep12": { + "sender": { + "types": { + "sep31-sender": { + "description": "customers sending to recipients" + } + } + }, + "receiver": { + "types": { + "sep31-receiver": { + "description": "customers receiving from senders" + } + } + } + } + } + } +} +``` + + + +## Enable the RFQ API + +Businesses need to provide their send-side counterparts with a [Rate][get-rates-api] API to check the exchange rates they're offering between the on-chain asset being used for settlement and the fiat asset being used to pay the recipient. If the rate is competitive, senders also need to be able to request a commitment to the rate currently being offered from business for a short period of time. + +The Anchor Platform provides the [SEP-38 RFQ API][sep38] to senders for this purpose. + +To make this API available to clients, lets add the service URL to our Stellar Info File. + + + +```toml +# dev.stellar.toml +DIRECT_PAYMENT_SERVER = "http://localhost:8080/sep31" +WEB_AUTH_ENDPOINT = "http://localhost:8080/auth" +KYC_SERVER = "http://localhost:8080/sep12" +QUOTE_SERVER = "http://localhost:8080/sep38" +``` + + + +Lets enable it in our environment too. + + + +```bash +# dev.env +SEP38_ENABLED=true +``` + + + +We also need to enable USDC to be used in this API, as well as add an off-chain asset it can be exchanged with. + + + +```yaml +# dev.assets.yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep31_enabled: true + sep38_enabled: true + send: + min_amount: 0 + max_amount: 10000 + sep31: + quotes_supported: true + quotes_required: true + fields: + transaction: {} + sep12: + sender: + types: + sep31-sender: + description: customers sending to recipients + receiver: + types: + sep31-receiver: + description: customers receiving from senders + sep38: + exchangeable_assets: + - iso4217:BRL + country_codes: + - BRA + - schema: iso4217 + code: BRL + sep38_enabled: true + sep38: + exchangeable_assets: + - stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + country_codes: + - BRA + significant_decimals: 2 + buy_delivery_methods: + - name: PIX + description: Have BRL sent directly to your bank account. +``` + + + +Lets test that your RFQ API is live! Following `docker compose up`: + + + +```bash +curl http://localhost:8080/sep38/info | jq +``` + + + +You should get the following: + + + +```json +{ + "assets": [ + { + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + { + "asset": "iso4217:BRL", + "country_codes": ["BRA"], + "buy_delivery_methods": [ + { + "name": "PIX", + "description": "Have BRL sent directly to your bank account." + } + ] + } + ] +} +``` + + + +## Configure Callback API Authentication + +Just as your business will need to make requests to the Anchor Platform, the Anchor Platform will need to make requests to your business. Let's add authentication to these requests as well. + + + +```bash +# dev.env +CALLBACK_API_BASE_URL=http://server:8081 +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +SECRET_CALLBACK_API_AUTH_SECRET= +``` + + + +`CALLBACK_API_BASE_URL` uses `server` instead of `localhost` as the host because the Anchor Platform will be making requests to your business server from 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. + +We'll define the server that implements the endpoints defined in the Callback API in the following section. + +:::caution + +Note that as of 2.x path segments are not supported in `CALLBACK_API_BASE_URL` (such as `http://server:8081/myPath`). + +::: + +[sep31-get-info]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md#get-info +[sep1-ap]: ../sep1/README.mdx +[get-rates-api]: ../../api-reference/callbacks/get-rates.api.mdx +[sep38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md +[sep38-post-quote]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#post-quote +[platform-api-kyc]: ../../api-reference/callbacks/get-customer.api.mdx diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep31/getting-started.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep31/getting-started.mdx new file mode 100644 index 0000000000..d6b239c2df --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep31/getting-started.mdx @@ -0,0 +1,21 @@ +--- +title: "Getting Started" +sidebar_position: 10 +--- + +This guide will walk you through configuring and integrating with the Anchor Platform for the purpose of building a cross-border payments recieve-side service compatible with [SEP-31][sep-31], the ecosystem's standardized protocol for cross-border payments. + +By leveraging the Anchor Platform's support for SEP-31, businesses make their service compatible with Stellar's existing set of send-side services. + +:::info + +As we improve the documentation, parts of this guide that are relevant to other use cases may be moved into their own sections. + +::: + +Before continuing with this section, make sure that you have already [installed][installation-ap] the Anchor Platform and configured the necessary features required by SEP-31: [SEP-1 (Stellar Info File)][sep1-ap] and [SEP-10 (Stellar Authentication)][sep10-ap]. + +[sep-31]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md +[installation-ap]: ../../admin-guide/getting-started.mdx +[sep1-ap]: ../sep1/README.mdx +[sep10-ap]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep31/integration.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep31/integration.mdx new file mode 100644 index 0000000000..7eb8443902 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep31/integration.mdx @@ -0,0 +1,664 @@ +--- +title: "Integration" +sidebar_position: 30 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +Integrating with the Anchor Platform for facilitating cross-border payments involves implementing the following, at a minimum: + +- [`GET /customer`][get-customer] & [`PUT /customer`][put-customer] KYC API endpoints to request & collect customers' KYC data +- [`GET /rate`][get-rate] RFQ API endpoint to provide FX rates between the on & off-chain assets supported +- `GET /transactions` requests to fetch updates on the Anchor Platform's transactions' statuses (documentation coming soon) +- [`JSON-RPC`][json-rpc-methods] requests to update the Anchor Platform's transactions' statuses + +The following may also be required depending on your use case: + +- [`GET /fee`][get-fee] if your business wants to provide senders the option to skip the quote creation step +- [`GET /unique_address`][get-unique-address] if your business uses a custody service for on-chain assets +- [`DELETE /customer`][delete-customer] if your business wants or is required to allow senders to request deletion of customer data + +## Create a Business Server + +First, lets create a business server and add it to our docker compose file. + + + +```yaml +version: "3.8" + +services: + sep-server: + image: stellar/anchor-platform:2.9.0 + command: --sep-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8080:8080" + depends_on: + - db + platform-server: + image: stellar/anchor-platform:2.9.0 + command: --platform-server + env_file: + - ./dev.env + volumes: + - ./config:/home + ports: + - "8085:8085" + depends_on: + - db + + server: + build: . + ports: + - "8081:8081" + env_file: + - ./dev.env + db: + image: postgres:14 + ports: + - "5432:5432" + env_file: + - ./dev.env +``` + + + +Next, create a simple web server using your preferred programming language and a `Dockerfile` that starts the server. `docker compose up` should successfully start all three services. + +This guide does not provide an example implementation of the endpoints, but you can find more information about the request and response schemas in the [Anchor Platform API Reference][ap-api], and the sections below will expand on concepts important to understand when implementing the endpoints. + +## Customer Callback Endpoints + +The Anchor Platform never stores your customers' PII, and instead acts as a proxy server between client applications and your business, forwarding requests and responses to the other party. Currently, requests and responses are almost identical to those defined in the [SEP-12 KYC API specification][sep12]. + +### Identifying Customers + +Customers can be identified using two approaches. + +The first approach uses a Stellar account and memo. When using the Anchor Platform for facilitating cross-border payments, the sending organization uses their own Stellar account, the one used to authenticate via [SEP-10 Stellar Authentication][ap-sep10], when registering customers with your business. Memos are used to distinguish unique customers originating from the same sending organization. + +The second approach uses customer IDs generated by your service. For example, if a sending organization is registering a customer, your business will receive a `PUT /customer` request like the following: + + + +```json +{ + "account": "GDJUOFZGW5WYBK4GIETCSSM6MTTIJ4SUMCQITPTLUWMQ6B4UIX2IEX47", + "memo": "780284017", + "type": "sep31-sender", + "first_name": "John", + "last_name": "Doe", + "email": "johndoe@example.com" +} +``` + + + +In this example, the `GDJ...X47` public key identifies the sending organization, and the `780284017` memo identifies the customer. Memos are usually 64-bit integers, but they can also be other data types, so they should be saved as strings. In response, your business should return a customer ID. + + + +```json +{ + "id": "fb5ddc93-1d5d-490d-ba5f-2c361cea41f7" +} +``` + + + +Your business server can use any identifer for customers as long as it is a string. + +Following the registration of a customer, the sending organization can use either approach when checking the customer's status. For example, you may get a `GET /customer` request like the following: + + + +``` +/customer?account=GDJUOFZGW5WYBK4GIETCSSM6MTTIJ4SUMCQITPTLUWMQ6B4UIX2IEX47&memo=780284017&type=sep31-sender +``` + + + +Or, the sending organziation could use the identifier you returned when they originally registered the customer. + + + +``` +/customer?id=fb5ddc93-1d5d-490d-ba5f-2c361cea41f7&type=sep31-sender +``` + + + +Your business will need to maintain a mapping between the account & memo used to originally register the customer and the ID you return in the response, as well as the KYC data provided. In future iterations of the Anchor Platform, we may maintain this mapping for your business so you only have to work with the IDs you generate. + +### Customer Types + +Your business likely requires different sets of KYC information depending on the type of customer. You can define the labels for each of these customer types in your `dev.assets.yaml` file, and your sending organizations will need to understand which label to use when registering or querying the status of customers. + +In `PUT /customer` requests, you should use the type passed to evaluate whether the sender has provided all of the required fields. In `GET /customer` requests, you should use the type to determine the customer's status. + +### Test with the Demo Wallet + +You can test your implementation with the [Stellar Demo Wallet][demo-wallet] following the steps below. + +1. Select "Generate keypair for new account" +2. Select "Create account" +3. Select "Add Asset" and enter the asset code and the Anchor Platform's home domain, `localhost:8080` +4. Select "Add trustline" +5. Fund your account with a balance of the asset +6. Select "SEP-31 Send" in the dropdown menu + +You should see the demo wallet find your service URLs, authenticate, and check which KYC fields it needs to collect. It should then present a form for you to enter the KYC details for the sender and reciever. + +[![demo wallet after initiating a transaction](../../assets/anchor-platform-sep31-demo-wallet-widget.png)](../../assets/anchor-platform-sep31-demo-wallet-widget.png) + +Once you've entered in the information requested, it will send that information to the Anchor Platform, which will send it to your business server. Once the demo wallet has the customers' IDs you generated, it will initiate a transaction which should fail. + +## Rate Callback Endpoint + +Once the sending organization has registered the customers involved in the transaction, it will need to request a quote, or FX rate, from your business. The Anchor Platform requests this information from your business server using the [`GET /rate` endpoint][get-rate]. + +### Firm vs. Indicative Quotes + +Requests for quotes will have a `type` parameter that is either [`indicative`][indicative] or [`firm`][firm]. If `type=firm`, your response must include the `id` & `expires_at` date-time field and reserve the liquidity needed to fulfil this quote until the quote expires. If `type=indicative`, do not return `id` or `expires_at` fields because the rate provided will not be used in a transaction. + +Note that the client may request that the quote expires after a specific date-time using the `expires_after` parameter. Your business must honor this request by returning an `expires_at` value that is at or after the requested date-time or reject the request with a 400 Bad Request response, which will be forwarded to the client. + +### Using the Client ID + +Requests may include a `client_id` parameter that identifies the sending organization requesting the rate. You can use this parameter to adhere to the commercial terms agreed upon with that sending organization, such as offering discounted rates. `client_id` may not be present for indicative requests, in which case your market price should be returned. Currently `client_id` will always be the Stellar public key the sending organization used to authenticate with the Anchor Platform. + +### Delivery Methods + +It is common for businesses' rates and fees to differ depending on the payment rails used to send funds to the recipient. If your delivery methods are configured in your `asset.yaml` file, clients will always provide the payment rail they want your business to use for firm quote requests. + +Because this endpoint is currently only used paying out remittances in off-chain assets, the `buy_delivery_method` will be used. If this endpoint is ever used in other transaction flows such as SEP-24 deposits, then `sell_delivery_method` may also be passed for business that support these types of transactions. + +## Fetching Transaction Status Updates + +To facilitate cross-border payments, you'll need to be able to detect when a sending organization has sent your business an on-chain payment and determine which transaction that payment was meant to fulfil. + +The easiest way to do that is to run the Stellar Observer, which will detect these payments and update the corresponding transaction record with information about the payment. Your business can then detect these updates by polling the `GET /transactions` Platform API endpoint. + +### Running the Stellar Observer + +The Stellar Observer monitors the Stellar ledger for payments made to your account(s) and updates the corresponding transaction records with on-chain payment information. To run the observer, add the following to your docker compose file. + + + +```yaml +services: + ... + observer: + image: stellar/anchor-platform:2.9.0 + command: --stellar-observer + env_file: + - ./dev.env + volumes: + - ./config:/home +``` + + + +### Polling for Received Payments + +The Stellar Observer makes JSON-RPC requests to the Platform API whenever it detects payments received for transactions initiated by sending organizations, thus updating the transaction's `transfer_received_at` date-time. + +Your business should periodically poll the `GET /transactions` Platform API endpoint to detect these updates. You can refer to the following example: + + + +```bash +curl http://localhost:8080/transactions?sep=31&order_by=transfer_received_at&order=desc +``` + + + +The response will include a list of cross-border payment transactions initiated by sending organizations. This list will be ordered according to the time a payment was received for that transaction. For each transaction returned, your business should check whether or not it has already detected the payment for that transaction. If it has, you have detected all payments made to your account(s). + +## Updating Transaction Via JSON-RPC + +SEP-31 flow diagram defines sequence/rules of the transaction's status transition and a set of JSON-RPC methods 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 the request. If the request doesn't contain required attributes, the Anchor Platform will return an error and won't change the status of the transaction. + +[![sep31 flow](../../assets/sep31-transition-diagram.png)](../../assets/sep31-transition-diagram.png) + +:::tip + +Statuses in green are mandatory and define the shortest flow. + +Statuses in yellow are optional and can be skipped. + +Statuses in red mean the transaction is in an error status or it has expired. + +::: + +You can create a [template][sep24-integration-make-json-rpc-request] for making a JSON-RPC requests to the Anchor Platform. + +This chapter also contains information about the format of [request][sep24-integration-rpc-request]/[response][sep24-integration-rpc-response] and [error codes][sep24-integration-error-codes] that might be returned by the Anchor Platform. + +### Ready to Receive Funds + +SEP-31 Transactions should initially be in the `pending_sender` status. The Receiving Anchor waits to receive the payment identified by the stellar_memo included in the POST /transactions response. + +Once your business detects that it has received an on-chain payment for a specific transaction, it has to update the transaction status. + + + +```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 +``` + + + +The transaction status will be changed to `pending_receiver`. + +### Offchain Funds Sent + +To complete the transaction and change its status to `completed`, you need to make a `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 +``` + + + +### Offchain Funds Pending + +Another option is to move the transaction's status to `pending_external`. This status means that payment has been submitted to external network, but it 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 +``` + + + +### Verifying Customer Information + +In some cases, the Receiving Anchor might need to request an updated information from the Sending Anchor. For example, the bank tells the Receiving Anchor that the provided Receiving Client's name is incorrect or missing a middle initial. Since this information was sent via SEP-12, the transaction should go into the `pending_customer_info_update` status until the Sending Anchor makes another SEP-12 `PUT /customer` request to update. The Sending Anchor can check which fields need to be updated by making a SEP-12 `GET /customer` request including the id or account & memo parameters. The Receiving Anchor should respond with a `NEEDS_INFO` status and `last_name` included in the fields described. + +After the Sending Anchor makes a SEP-12 `PUT /customer` request, call the `notify_customer_info_updated` JSON-RPC method againto update the transaction status. Additionally, call this method whenever the SEP-12 status for a customer changes, such as when the customer's information is being validated and the status changes from `NEEDS_INFO` to `PROCESSING`. This ensures that any clients configured with a callback URL are notified of the latest customer status, allowing the client to prompt the user to update their information. + + + +```json +// notify-customer-info-updated.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_customer_info_updated", + "params": { + "transaction_id": "", + "message": "Customer info updated", + "customer_id": "45f8884d-d6e1-477f-a680-503179263359", + "customer_type": "sep31-receiver" // or sep31-sender + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh notify-customer-info-updated.json +``` + + + +### Do Stellar Refund + +Integration with the custody service allows you to do refund via 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 + +You can't do multiple refunds in the SEP-31 flow. For this reason, the total refund amount plus the amount fee should equal `amount_in`. Otherwise, you will get an error. + +::: + +### Refund Sent + +There is a possibility to send all funds back to the `Sending Anchor` (refund). You need to refund the whole sum(full refund). + + + +```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 +``` + + + +:::note + +You can't do multiple refunds in SEP-31 flow. For this reason, the amount to refund plus the amount fee should equal `amount_in`. Otherwise, you will get an error. + +::: + +### 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 details of the error. + + + +```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 those transactions that have been abandoned by the user after some time. It's a good practice to clean up inactive transactions in the `incomplete` status. To do so, simply change the transaction's status to `expired`. + + + +```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 + +The transaction status can be changed from `error/expired` to `pending-anchor`. After recovery, you can refund the received assets or proceed with the processing of the transaction. To recover the transaction, it's necessary to 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 +``` + + + +## Fee Callback Endpoint + +Your business may want to offer sending organizations the option to skip the quote creation process, allowing your business to use a rate determined at the time the funds are paid out to the recipient. In this case, the Anchor Platform will not make a `GET /rate` request, but you will still need to provide the fee your business will charge for these types of transactions using the [`GET /fee`][get-fee] endpoint. + +### Configuration + +You can enable these types of transactions by updating your `assets.yaml` file configuration: + + + +```yaml +assets: + - ... + sep31: + quotes_required: false +``` + + + +## Unique Address Callback Endpoint + +Businesses must provide a unique Stellar account and memo pair for each transaction requested by sending organizations so that the Anchor Platform can identify and map the on-chain payment sent for the specific transaction. The Anchor Platform can generate these account & memo pairs itself, but most businesses use a custodial service to receive on-chain payments. In this case, the business must request the custodian to generate the Stellar account & memo. This is done by using the [`GET /unique_address` endpoint][get-unique-address]. + +### Configuration + +To configure the Anchor Platform to make these requests, add the following to your configuration: + + + +```bash +# dev.env +SEP31_DEPOSIT_INFO_GENERATOR_TYPE=api +``` + + + +:::caution + +This endpoint may be removed during future major version updates of the Anchor Platform, when it adds support for connecting to custodial services and generating these addresses automatically. + +::: + +[ap-api]: ../../README.mdx +[ap-sep10]: ../sep10/README.mdx +[sep12]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md +[demo-wallet]: https://demo-wallet.stellar.org +[indicative]: https://www.investopedia.com/terms/i/indicativequote.asp +[firm]: https://www.investopedia.com/terms/f/firmquote.asp +[get-unique-address]: ../../api-reference/callbacks/gen-address.api.mdx +[get-customer]: ../../api-reference/callbacks/get-customer.api.mdx +[put-customer]: ../../api-reference/callbacks/put-customer.api.mdx +[get-rate]: ../../api-reference/callbacks/get-rates.api.mdx +[get-fee]: ../../api-reference/callbacks/get-fee.api.mdx +[put-customer-callback]: ../../api-reference/callbacks/put-customer.api.mdx +[delete-customer]: ../../api-reference/callbacks/del-customer.api.mdx +[json-rpc-methods]: ../../api-reference/platform/rpc/methods/README.mdx +[sep24-integration-make-json-rpc-request]: ../sep24/integration.mdx#making-json-rpc-requests +[sep24-integration-rpc-request]: ../sep24/integration.mdx#json-rpc-request +[sep24-integration-rpc-response]: ../sep24/integration.mdx#json-rpc-response +[sep24-integration-error-codes]: ../sep24/integration.mdx#error-codes diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep6/README.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep6/README.mdx new file mode 100644 index 0000000000..7af76ff6bd --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep6/README.mdx @@ -0,0 +1,10 @@ +--- +title: Programmatic Deposits and Withdrawals +sidebar_position: 65 +--- + +import DocCardList from "@theme/DocCardList"; + +SEP-6 allows for a means by which wallets and/or exchanges interact with an anchor on behalf of users, never requiring the user to directly interact with the on & off-ramp. + + diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep6/configuration.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep6/configuration.mdx new file mode 100644 index 0000000000..dea7867383 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep6/configuration.mdx @@ -0,0 +1,251 @@ +--- +title: "Configuration" +sidebar_position: 20 +--- + +import { CodeExample } from "@site/src/components/CodeExample"; + +# Configuration + +To enable SEP-6 deposits and withdraws, the Anchor Platform must be configured to do the following: + +- Provide the necessary service URLs for SEP-6, 12, & 38 endpoints in the `stellar.toml` file +- Provide information about the on & off-chain assets, as well as the payment rails, supported by your business via SEP-6 and SEP-38 `/info` endpoints +- Support the endpoints and callbacks required to request KYC information and provide exchange rates + +## Enable Programmatic Deposits & Withdrawals + +Add the following variables to your environment file. + + + +```bash +# dev.env +SEP6_ENABLED=true +SEP12_ENABLED=true +SEP38_ENABLED=true +``` + + + +### Modify a Stellar Info File + +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 Stellar assets 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" +KYC_SERVER = "http://localhost:8080/sep12" +ANCHOR_QUOTE_SERVER = "http://localhost:8080/sep38" + +# 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. + +### Modify the Assets Configuration File + +Now you're ready to 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 `sep38` sections are methods that will be exposed by the SEP-38 [`GET /info`][sep38] endpoint. + +The methods specified in the `deposit` and `withdraw` sections are the methods that will be exposed by the SEP-6 [`GET /info`][sep-6] endpoint. The methods listed should match the methods defined in the SEP-38 section of the file. + +Also note that fiat assets, those with the `schema: iso4217`, do not need the `sep6_enabled`, `deposit`, or `withdraw` configuration objects specified. In the same way, Stellar assets, those with `schema: stellar`, do not need the `sep38.sell_delivery_methods` or `sep38.buy_delivery_methods` configuration objects specified. + + + +```yaml +assets: + - schema: stellar + code: USDC + issuer: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + distribution_account: GBLSAHONJRODSFTLOV225NZR4LHICH63RIFQTQN37L5CRTR2IMQ5UEK7 + significant_decimals: 2 + sep6_enabled: true + sep38_enabled: true + sep38: + exchangeable_assets: + - iso4217:USD + deposit: + enabled: true + methods: + - ACH + withdraw: + enabled: true + methods: + - ACH + - schema: iso4217 + code: USD + significant_decimals: 2 + sep38_enabled: true + sep38: + exchangeable_assets: + - stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 + buy_delivery_methods: + - name: ACH + description: ACH debits for US bank accounts + sell_delivery_methods: + - name: ACH + description: ACH credit for US bank accounts +``` + + + +### Managing Distribution Accounts + +Note that the example above lists a `distribution_account` attribute for the USDC entry. If specified, this account will be provided along with a randomly generated and unique-per-transaction memo to clients as the address to send funds to for withdrawal transactions. The transaction's memo is how you or the Anchor Platform will match the funds received with a transaction record in the Anchor Platform's database. + +If you do not have your own Stellar account and instead use a third party that provides you a Stellar account and memo so they can receive funds on your behalf, such as an exchange or custodian, you should omit the `distribution_account` field from your assets config file. Instead, you'll need to provide the Stellar account and memo you'd like to use to receive funds through a request to the Anchor Platform's [`request_onchain_funds`][request-onchain-funds] on a per-transaction basis. + +To configure the Anchor Platform to expect the Stellar account and memo to be provided via API instead of configured via the assets file, specify the following environment variable. + + + +```bash +# dev.env +SEP6_DEPOSIT_INFO_GENERATOR_TYPE=none +``` + + + +If you use a wallet provider supported by the Anchor Platform's custody service, such as Fireblocks, you can also configure the Anchor Platform to connect directly to your wallet provider to fetch your distribution accounts and memos. If this is configured, the Anchor Platform will also use the wallet provider to send funds to customers. See the [custody services] section for more information about configuring this feature, but first you'll need to specify a different value for the above-mentioned environment variable. + + + +```bash +# dev.env +SEP6_DEPOSIT_INFO_GENERATOR_TYPE=custody +``` + + + +### Enable Callbacks to the Business Server + +Businesses need to collect and validate KYC information on the customers they're facilitating transactions for. Clients ask your business what KYC information needs to be collected and sends that information via the SEP-12 KYC API hosted by the Anchor Platform, but the Anchor Platform never stores personally-identifiable information (PII). Instead, it forwards requests from clients to the business server, and returns the business' responses back to the client, acting as a proxy server. + +Additionally, businesses need to provide clients with a [Rates][get-rates-api] API to check the exchange rates they're offering between the onchain and offchain assets supported by the business. If the rate is competitive, clients also need to be able to request a commitment to the rate currently being offered from business for a short period of time. Similarly to the KYC API, the Anchor Platform makes requests to your business server to fetch exchange rates and quotes and returns them to clients. + +To enable these requests to your business server, first you'll need to add your business server to the docker compose file. Then, to support requests to your business server from the Anchor Platform, you need to enable callbacks. + + + +```bash +# dev.env +CALLBACK_API_BASE_URL=http://business-server:3000/callbacks +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +CALLBACK_API_AUTH_JWT_HTTP_HEADER=Authorization +SECRET_CALLBACK_API_AUTH_SECRET="a secret used to sign JWTs" +``` + + + +The above tells the Anchor Platform to include a [JWT][how-to-use-jwt], signed with the configured secret, in the `Authorization` header of requests made to `/callbacks/` so your server can authenticate the Anchor Platform before processing requests. + +`more_info_url` is an optional URL provided by your business server for wallet applications to display information about previously initiated transactions. This URL is typically used by wallets in their transaction history views, and your business can specify the information to be displayed about the transaction. + + + +```bash +# dev.env +SEP6_MORE_INFO_URL_BASE_URL=http://example.com +SECRET_SEP6_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" +``` + + + +See the [KYC API][platform-api-kyc] and [Rates API][sep38] for details on the endpoints that must be implemented on your business server. + +## 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 something 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 + +SEP6_ENABLED=true +SEP6_DEPOSIT_INFO_GENERATOR_TYPE=none +SEP6_MORE_INFO_URL_BASE_URL=http://example.com +SECRET_SEP6_MORE_INFO_URL_JWT_SECRET="your encryption key shared with your business server" + +SEP10_ENABLED=true +SEP10_HOME_DOMAIN=localhost:8080 +SECRET_SEP10_SIGNING_SEED="a Stellar private key" +SECRET_SEP10_JWT_SECRET="a secret used to sign JWTs" + +SEP12_ENABLED=true + +SEP38_ENABLED=true + +CALLBACK_API_BASE_URL=http://business-server:3000/callbacks +CALLBACK_API_AUTH_TYPE=jwt +CALLBACK_API_AUTH_JWT_EXPIRATION_MILLISECONDS=30000 +CALLBACK_API_AUTH_JWT_HTTP_HEADER=Authorization +SECRET_CALLBACK_API_AUTH_SECRET="a secret used to sign JWTs" +``` + + + +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]: ../sep1/README.mdx +[stellar-demo-wallet]: https://demo-wallet.stellar.org/ +[get-rates-api]: ../../api-reference/callbacks/get-rates.api.mdx +[sep38]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md +[platform-api-kyc]: ../../api-reference/callbacks/get-customer.api.mdx +[request-onchain-funds]: ../../api-reference/platform/rpc/methods/request_onchain_funds.mdx +[how-to-use-jwt]: ../sep24/faq.mdx diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep6/getting-started.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep6/getting-started.mdx new file mode 100644 index 0000000000..3a1d875e92 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep6/getting-started.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]: ../../admin-guide/getting-started.mdx +[sep1-ap]: ../sep1/README.mdx +[sep10-ap]: ../sep10/README.mdx diff --git a/ap_versioned_docs/version-2.9/admin-guide/sep6/integration.mdx b/ap_versioned_docs/version-2.9/admin-guide/sep6/integration.mdx new file mode 100644 index 0000000000..2d24140610 --- /dev/null +++ b/ap_versioned_docs/version-2.9/admin-guide/sep6/integration.mdx @@ -0,0 +1,975 @@ +--- +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 require determine if a transaction requires the customer to update their information. The required SEP-9 fields can be communicated to the user by returning a `NEEDS_INFO` status with the required fields in the `fields` attribute. + +After the user has submitted their KYC information, call the `notify_customer_info_updated` JSON-RPC method againto update the transaction status. Additionally, call this method whenever the SEP-12 status for a customer changes, such as when the customer's information is being validated and the status changes from `NEEDS_INFO` to `PROCESSING`. This ensures that any clients configured with a callback URL are notified of the latest customer status, allowing the client to prompt the user to update their information. + + + +```json +// notify-customer-info-updated.json +[ + { + "id": 1, + "jsonrpc": "2.0", + "method": "notify_customer_info_updated", + "params": { + "transaction_id": "", + "message": "Customer info updated", + "customer_id": "45f8884d-d6e1-477f-a680-503179263359", + "customer_type": "sep6-deposit" // or sep6-withdrawal + } + } +] +``` + + + +To execute this, you need to run: + + + +```bash +./call-json-rpc.sh notify-customer-info-updated.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](../custody-services/fireblocks/README.mdx). 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/learn/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-reference/platform/transactions/get-transactions.api.mdx diff --git a/ap_versioned_docs/version-2.9/api-reference/README.mdx b/ap_versioned_docs/version-2.9/api-reference/README.mdx new file mode 100644 index 0000000000..1a9f52ea6c --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/README.mdx @@ -0,0 +1,10 @@ +--- +title: API Reference +sidebar_position: 20 +--- + +import DocCardList from "@theme/DocCardList"; + +View all Anchor Platform API information. + + diff --git a/ap_versioned_docs/version-2.9/api-reference/_category_.json b/ap_versioned_docs/version-2.9/api-reference/_category_.json new file mode 100644 index 0000000000..0d44758281 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/_category_.json @@ -0,0 +1,3 @@ +{ + "collapsed": false +} diff --git a/ap_versioned_docs/version-2.9/api-reference/callbacks/README.mdx b/ap_versioned_docs/version-2.9/api-reference/callbacks/README.mdx new file mode 100644 index 0000000000..54cf2996c5 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/callbacks/README.mdx @@ -0,0 +1,22 @@ +--- +title: Callbacks Server +sidebar_position: 20 +--- + +import { EndpointsTable } from "@site/src/components/EndpointsTable"; + +The Anchor Platform provides several callback functionalities for your business server. + + + +| | | +| ------ | ---------------------------------------- | +| GET | [/customer](./get-customer.api.mdx) | +| PUT | [/customer](./put-customer.api.mdx) | +| DELETE | [/customer/:id](./del-customer.api.mdx) | +| POST | [/event](./post-event.api.mdx) | +| GET | [/fee](./get-fee.api.mdx) | +| GET | [/rate](./get-rates.api.mdx) | +| GET | [/unique_address](./gen-address.api.mdx) | + + diff --git a/ap_versioned_docs/version-2.9/api-reference/callbacks/del-customer.api.mdx b/ap_versioned_docs/version-2.9/api-reference/callbacks/del-customer.api.mdx new file mode 100644 index 0000000000..07d817a0eb --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/callbacks/del-customer.api.mdx @@ -0,0 +1,144 @@ +--- +id: del-customer +title: "Delete Customer Data" +description: "The request for this endpoint is identical to the" +sidebar_label: "Delete Customer Data" +hide_title: true +hide_table_of_contents: true +api: eJztVE1v2zAM/SsCd9gGOHaa7eRb0eZQYBiKpTslASZLTKxNllSRXhsY/u+DHLtptmy/YL7Ypvgh8j2+DljuCco13LTEvsFIsM3geUYYBvNqeT+7WkA2fHy4SocaSUUT2HgHJTzUKCI+tkgsdj4Krg0JdDp441gYEkajY6OkFewF17hx62+3y0/Lh6Uo1Fj02/ZdzRyoLIq94bqtcuWbghitlXF6z0L07JW3RWV9VTSSGGOBytOBGJuCMMzm86tF3ug3U+KZRouM7zduuqPGnXGohXHi2Fu+cRt3O7il64kp9C0JLVkKH8Vji+354XiWGh4qGO/yjYMMfMAo0++dhhI02mmukEGQUTbIacblugOTxhck15CBkw1CCUZDBqRqbCSUHfAhJCtxNG4PfQapCRNRQ8mxxX6bLBS8I6Tkv5h/TK9zgFatUkiUp/iPlxymGwrnE4St0zlkoLxjdJzcZQjWqKGr4julmO7PS/rqOypOXcY0AzbHK2GMPl7sxegL5rMe12P0NgM2bJPfcjD06ckAnxkdGe+O8/yBBygn6mbwU9oWL1I4za1Brv0IETIO6HANJbxwsuiM7hMcGH9OkLXRQgkTVZW0tpLqR161ZBwSzY6+OT7LJliUTtU+JipDKmnczqeWU7bj5D/k83wOlzZqdXCqjt75lsTNWIbE9f2doIDK7EY4xo1DsTquiLgeSop7K3nnYyNC9AmWgeP/znvcC5p2mUQjNYrqMKR/yfdUG4vCDIsdok/EMm4v5EkCom+EFMoadCxeMScXD2n3jzN5m+qMxB1lgfBUWu52qPi88u/+l0oMGzhR5dTeakAFMrBGoSNMIIwLdx2kqlEsBhhO6JZF8fT0lMvhNPdxX4yhVHy6u1l+Xi1ni3ye19zYgbPBEzfSvUo8CsrLbt1Klr8j3Z2W7L+MnsvoKAuMz1wEK41LijHg042LugZ1UtbS6KQStSdOJ11XScKv0fZ9Mj+2GA9QrrdJFKKRVeLHugNtKH1rKHfSEv4DnXdfRlF6L/52udEo3eGkPQDZqEpGQ7/tM6hRaoyv5OpaKQz8KuQPsT1TqyPi0Pe/AB/asHM= +sidebar_class_name: "delete api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +The request for this endpoint is identical to the [`DELETE /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-delete) request defined in SEP-12. + +Delete the customer's data or queue the customers data for deletion. + + + +
+ +

+ Path Parameters +

+
+
+
    + +
+
+
+
+
+ + +
Success.
+
+
+ +
Customer not found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/callbacks/gen-address.api.mdx b/ap_versioned_docs/version-2.9/api-reference/callbacks/gen-address.api.mdx new file mode 100644 index 0000000000..d294ffb4ab --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/callbacks/gen-address.api.mdx @@ -0,0 +1,259 @@ +--- +id: gen-address +title: "Generate Unique Address" +description: "If the platform is configured with `depositInfoGeneratorType: api`, the Platform make this request to" +sidebar_label: "Generate Unique Address" +hide_title: true +hide_table_of_contents: true +api: eJztWFlz6joS/isa34c5OYVZQwK8cYBwCIQQtpCtiJAaW2BLRpIBJ5X/fks2JGS5d6amZh6mKnlJIrW7W+pF39fPFgVFJAs0E9yqWK050i6gwMN6LqSPmEJE8DlzQgkUbZh20SOFQCimW3wumsBBYi3kMAqggnDAHlOxgt5egY+XgLTLFJKwCkFppMU9NyJVTlwh0QyTJXCKYA0yQpr5gDDSEnOFiXHKuMA40wxroGgWIYyIx4BrhIPAYwQbofQ9v+fDN6V+qDRyQiwx12DsYx275YMvkAQdSg4UMf7eM6ZQyNkqhBRSAjGNCOZoBsjHQQAU5Wwt7BzSAuHX891zCUqEkgBSIXERVgiju0GjZxdyDz9crQNVyWSUBs/DMi2kkwmk0IIIL6MgsAu5o8Ozxsf4DRKMK67YJO7NPbFBGxF61DgTKqBoLiTqAwG2ZtzZHVolx+QA1PhIJGBtjg5M7o6FHn9gQkTIdSq+iaNHFGAm1T0XoVaMwrvYp1CojPYak8SDinHt7h93b4fyQfqY0TTjywzznUyAl6IC3ZU3JjrMP1Wvpuejs2GUY5cbN2qUqyM3DLOX/avczZr6rXb9fDwa3LS86wFzGzfTNYT9i7Dn/sbDcY2Ux4te/Ri20dPNYBzVO35pZHf7YbWw7ZdoxybNk6pY4YutcxmcZuVJ2SnKxXZS7Xt1ul2Fx+1xzZlc5MfBRvYp6bRgGJZy3qx/5fYm1eD3RExvt83gmB0LMQjC6nJTxypHj50LvCKbRb2VFbPLzmlQUKPV+Yko1rsX3apdpDAprrxuq2VfN7brhe13xlNSuOwfK88p+erEOZ38PlkHK7Ll+cnaad1EYe180HP4r/zm+Next2w13as2y+drNRXR8eJ0wupndhO3T67r5fbEG86Xw41oqnnpnKzrNyvHni7ydHk2r+ccOKtHg2LgzfKjrM/r/VYt23NIt3Z92hj9GpOmXtXqvdFKnZYv19PbQQk2Ue5ie3whWbUtpk9Fv00vb7xbhgEuyl5Y3Iy9cifH87f85MottkazYvual6OT6/z1qFOsD0aDNb2VZ+fb05msO1GvTmkJjsEf5Ton21M+l0+82xsu+p2u9p/CKp/kO5O8Gk4n7dZ5YTTdzubli1nhmrbqTad2XmQlp9WuecXxWa11rqFEbK80WaxhUco3+ZZ2cTMa/Sb5aSnXWNzOSM/tdzZP4Sh/dXqzbY8WS9loeUs3u4iqZVZak3KwXd/iM5qvXUZ2bdYvF1i9PsB+uRC63V6zbpPF5LQaBroxI8AbOXqOPft2sBr1et2+XTr/vZzmi/3r4/aQNW36ZBfEQDzxKPt0vl2c9cUZy49/NW019XJRd3p7sZou2+VeKXt1+lSFcNsIvV+DYbDMbQo2Pzsrs8nldRYXGrxLTroX86W7XC2i/GXg8JGKTnk+37ws1fnsZFYddpxVuG2XBeS64eppXFrnO63c0eea8tgaMkCZ/uO7qr6r6ruq/pOquudWyhKBwSdM8Ba1KpYDvEqpBKWslKWxo6zKnTVK3sb9xkPK2toKgngvecjNWoAl9kGDNOvPFjNgaRWCjKyUxbEPVsU6eMinjFqpD9BqeIirFMg1SLRhnocUXu9eXqEMxjkEP5hTFGCl4v3H9xYekXalCB03gQnAaSAY1+l7vkNxOAFDG6ZcUAYTJMjn0IBNIQBODZxKMMIUJ/eQOtTg4wjFh40X7x6bjSHKHGhRj6/WkZi/B4DVXuutv1FYg2diotLvMNFOWGUSg/Z+IYMDZkuYgwROILPHWirjgLYPHDhKx9FWxAUfW5VnS0eBCYnSknHHeklZBuMxCdSqaBnCy4NZUYHgCpSRz2ez5tf7iA1CQkCptJWyiOAauDYyB7Azs1BG8PmzYTFbANFWygqkOa5miZn3d/zZYpWj5EuDujVm3AAwc517ALe7tb2GioFxCYpLgKEWiJlosrkByhSUZjxByCbj/9a3D6q/cA49NtPp9CPaSaKdJBISYfR4Ee/d+eEW6EeRf5kBVBCV8QBLngFOImJEKMPvksxWARCGPfYENBMI4QG1d3hW2bHZg3/BF+qP94tHJjcxRz9/wpaZi3F+/kS7zYQLABrs/OagN0IuD27tLZWM7s+3M9zTC8MPtMbENX8d6gxw5APXf6lzmqx+pdjsGO//LQPoh4atTiEXKzdlgsPo0WejKQt46JsmZ6StlGXErZTFqPXw8q5g7j6lxsNL/JOyil+VTUNKIdNoeNgF4kaXVBzdu/2ZxiUE0+wp7APaVygigkLcCmeCRv/FcgTj6ZftgtEvlj/cSvL1Q8rSTHuwP7i1uxrYauDK5G38YCwhsir7lyVlrbEXwuELYzqSD9oVyTsV+4q1a1WszIemkbKSxyPRG0rPqlj76iLY8wyhTs8MdwOl7EQ2DVvsBx4k7TVNhG8Zg4zP40w22pLYFdLZdPbLp2sQceJKwUWoUG1nRpnujuKynO9DaKjpYVLuGPlrJgRSmFi8Mva/1kthbs6wp+cK+ZiCmQC8e182LvPAkHWmjG7TsE3TxK+sfi6F//XQwKToPU/u5J/qNd3ULkEVvJnG87npyu8sf5T/ei5hveXH2/EGcVSslOUxAlzFVb9DEdUAExdQPg7DW3Qrmcxms0njeDdumbtPVabTqjW6g4adT2fTrva9OFENlvAxP1C8m9UA+gB4PgT7+a24vqdB39Og72nQN2/95q3f06Dvqvquqv/nqkqAWILnDeExMwfGDdSPMdbzDm3ffaToDynLFUqbnefnGVYwkt7Li1lOpj8Gg1Om8MwzpGCOPQV/A6h+9Hf84Qh9j4P+5+OgL8OdELFPs7odIbNiXrTGkpmIWpW7h5eU5QKmIA9oXJUQCPTBV59I6Ds612wMrZeXPwEbr0K4 +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +If the platform is configured with `depositInfoGeneratorType: api`, the Platform make this request to the Anchor backend every time a transaction is initiated by a client application. + +The Anchor must guarantee that the memo returned in this request is unique, so it can be mapped 1-to-1 to a Platform resource such as a [SEP-31](https://stellar.org/protocol/sep-31) transaction. + +Here is how this flow would be used for Receiving Anchors that need to create their unique `(account, memo)` pairs outside the platform, using Circle: + +[![](https://mermaid.ink/img/pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1)](https://mermaid.live/edit#pako:eNqlVctu2zAQ_JUFTy1iOwhyE9AUhuu0ORQ1YvdmIKDJVUSYIlWSihEY_veuRMuPhHaTVCc9VjPD4exyzYSVyDLm8U-NRuA3xR8dL-cG6AoqaMxgOp70r69g5rjxXARlDdxqu4KVCgXM2VpwrRdcLIeTu81lbRQhPXApHXo_ZxGp4i4ooSpuAkwDas1d4gMaqcwjDI0obOL7p3sUqJ6o5DNMNA-5deX5qlNII-WExvj-mLV_c3OR4slg8ms6g7XH6vpqcxn2XvgIYyuCJSPgnB2w4B4lkIGhQKi22CCsydVj7XiDF-GaK6WD9KXlTfkTwoGsf8JcvDYqg-_j2dkFfD1geFDyS5plb2U0mnDRIC0PgcNCW7EUBVcGtqCDPUqs79Ov_ZS8ewy1Mx4MriAKo_z5mKdOYlZiaeeM9lu5wVl9L1n2Zn6Qh5IUb5KWn9y6W2WUL5DSUSvdZrFJx7brDgyPDdd8e4emU1L6x7nfrznNPTjRLNtmzuAnX2LX2sT_XKIJ3U_xbf9Mb3WdIDGgCJ5i8gIKCl5VFCIJte8c-l8Xjvej82GnxdNaGyUHc2_81EjZbcPhRLwzuU2Q7YxKUjkrEIlkh0jyA9i8vc9pxvZaFd2COy-CbR93iDDSam93uhNPGD-cjX7AuptEbcenE1dJal-ZSqUPPNR-8JHk_25RW4KTiG-dz-3oSozny0zJxjFRoFi2VBG-s_l1yN_ZMq_kK9P80Q7zAeuxEulBSTpk1w3-nFF9iXOW0a3EnNc6NMfkhkqjy2OpgnUsy7n22GO8Dnb6bATLgquxK9oe1NuqzV8v2LI1) + + + +
+ +

+ Query Parameters +

+
+
+
    + +
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
    + + + + unique_address + + + object + + + +
    +
    + An object containing the unique + `stellar_address:memo` pair used to identify a + destination. +
    + + + +
    +
    +
    +
+
+
+ + + +
+
+
+
+
+ +
+ Error. The Platform will respond to the client application with the + same response code and body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/callbacks/get-customer.api.mdx b/ap_versioned_docs/version-2.9/api-reference/callbacks/get-customer.api.mdx new file mode 100644 index 0000000000..932d7ad907 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/callbacks/get-customer.api.mdx @@ -0,0 +1,563 @@ +--- +id: get-customer +title: "Retrieve Customer's Info" +description: "The request and response for this endpoint is identical to the" +sidebar_label: "Retrieve Customer's Info" +hide_title: true +hide_table_of_contents: true +api: eJztWG1z2zYS/is7uA9pZihKdtJco28eRcnp2jo+y+lNx/bYELES0YAAC4CWNR7995sFSImyGbu13ZvLTfzFFAksnt199gV7wwS6zMrSS6PZkJ3kCBZ/r9B54FqARVca7RDmxoLPpQPUojRSe5AOpEDtZcYVeAM+xzN9evlhfAL9rHLeFGgvz7/LvS/dsN9fSJ9XszQzRd95VIrb5n+vtMabzKj+TJlZv+DOo+1jZtzKeSz6DsveYLC3nxbib43g3gL9yzPdCVXgXGoUIDVMx0e9vf30TJ/pkx3wXCmzdJApido78GZIawD2UniPPstJG5hLVMKFR4f2Cm0wjbToSLaxAi0pbnEhCTJw0LiEBiJcSQ68hkCWOfr0X7FMWfmXjQ9Jqcm8rYEw6EAbDzm/QuBbtI0WKGpfI5Tc8gI9WgcOyeM6vK5lJyA9uNxUimzvK6sjBWqr1aYS213RPSkQxxwvtq8aKTOsBaGAZY4atGlj4BYDjjS6aj+FUY7Z56id575yYOZtlXzOPRR8BVxZ5GIVD2jU3JDiDhcgC3KXOfocoykameT5ubEFp3iBJXfAswxLjyIBi79hFp6MBeelUqARhYPCWAz70tve6FwV9rcWxc9VKbgP5tyc3+0BuOWA9EyzhHm+cGx4ykaNIuw8Ydc9h2V4TSx9wxIW2Vo/vNqjRaZEG46bCDZkC/SNCJawrXfY8PSGSUohv1doVyxhmhfIhkwKlnQkmck7clbbtMDd1v23SBMdW1q8kqZyQJFUszBlCXNZjgVnwxvmVyWd6byVesHW66QbE88yU2nfCWwaQ4988HN1jQIO4mLglc9juiM3LKWPSeJIcU8eCeEezDd4FKYCC9MJiD7AFVcV1vl2vpJ60eZ5wMLB5ZzirVYuIf5ajETa+UKZ+7J+vnw01ouwtgswfSCHBeCVQ0Eh1UB/EPd9gBKGuiqIr4FVOXc5URuvPTv/ItgHcfIsBPMOF6WDGZKZf/x1FBJiClPEusad0MZpiZmcExuk0c+dzAlaz7VPeHmmhcmqArW/Vdoe40BvuXZR74svBGhrCcia78tc1qWxMdSLmBDJXtw5k0kKjhT+Tdm7nSnn1hS7FhZYohYOTF022ud9h+kiTbYZsZEiW2WFipTidkGJoyDiuJePs4XigVm7FniHc16pWA0uUV+m8BPXi4ovEDIjEGrfoIDKEU0m04/w5tXb3l4K/6gKroEKDp8p6kY2cl0CWW5khi6hjuVMF+gcX6BrFcCQ+KQDVR/3kIPPE9YkSUff9wcD+rerzS9cSbHJmNAkcEAZClxTHvFaOu+a6rONhRi6pOxsdbsxkC40PdSAFRU1HKU1V1LgthLF3OVqQ8w6kvvMiFUKx62fEmO5v91gQjRE0+KdaanhNEbCX9ppRi9kRnvUnuzLy1LVkdn/zZGRb+46ycyoIWDkoUhaylyxU6HCWloqrV5Gx0nR4d6kWX5PKjwYjcZHJ+N3LGFHxx9H4+l0cviBJexwPH43vZgcvv/IEnY8/ud4RIvO1wmLDUIXUC6EJJ24OtoB11agI5/eUSbK/TLmzYuZ1DwGY1XMQktBXU5AuUPhDsvUodT6xq3lJEt6LDpMtl5TMxPVa32dGaOQa7Ze04KavuLim5E6jfQURm5ImLBfxseT95PRwcnk4+HF8fhfnybHNTnRWmO7cBGyOmF2w/bSK3r1YduiNjmFcOM1L0oVbTGtsgyd+/HXUQjcqijIwLHwZdxhvH60WpWcU0OAGlzcOa+UWlFz8EKE3MdLIg5SKQ3proloJvYy3J+//qH3aj7f671++73ovd1/Pej9nX8/ED8M3mTzsKkxatt2HVScS+v8RSxct5P8yW5ZDkshLE3ueOruceuEKf5HZdPKPyUaCy7VBRfConMPig+roVn9h46o/xL2uqv+jYlT6VMy+G7kfomjSXcWX+9WgLj7fEvYAI81+F/fxX9oPLw3lRZfgw4h1DxqRx1PuBZ+Roqt+rK5CZB7Lp3U1RToc1PfOMNN0+dsyDbzE6JBuB7HIyqr2JA1HUDGlZrx7HM6o+4MnevFtWmdA7jOcmOpQ2B0FLWYpDJJiwZ/lQ7SQff1cKWz3BpN19BRfYyDg6MJ7LTrmxlKc508CEdub4ulNeSWejR1n9zY67imfXNQcIFNJ7aRt8ylQpoHSEeyKUfFW2IzIgsdOK+nHNBiThjInOlokxdu05a5uudyuD2az+eY+d2Tb6/vOiKOIGqqbNWbBq+whCmZIaXp4U3TlR+UPMsR9oMbtt4d9vvL5TLl4Wtq7KJfb3X9nyaj8eF03NtPB2nuCxU4WxrnC65bgo/RW4lXuOmCXziYEAHuFNNNoH2bin6bin6biv5fTkVjkaMJUr9UXIYGN2Sbm7rinLJNxTlPWG6cp3c3NzPu8JNV6zW9jhMFqkNCOrr1Czacc+XwgZzynEPQTlVi5ZWttpQxmoP8OZjPNBK9B+F2IPsEmH/9oPQeDerx7RPgP31s+gC8ZmL7DBi//pHpPbZ6BjN9pbPT+4xye2L8SPP8jw1W79G4ngtv9TynH1bS4Wx4SrOKHLlA27rjHISy19p154a2c7X5MD5h6/V/AIMyEEU= +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +The request and response for this endpoint is identical to the [`GET /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-get) request and response defined in SEP-12. + +This endpoint allows clients to: + +1. Fetch the fields the server requires in order to register a new customer via a SEP-12 [`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) request + +If the server does not have a customer registered for the parameters sent in the request, it should return the fields required in the response. The same response should be returned when no parameters are sent. + +2. Check the status of a customer that may already be registered + +This allows clients to check whether the customers information was accepted, rejected, or still needs more info. If the server still needs more info, or the server needs updated information, it should return the fields required. + + + +
+ +

+ Query Parameters +

+
+
+
    + + + + + + + +
+
+
+
+
+ + +
+ Valid request. Customer either already exists or the customer + identified by the parameters is new and must provide the field values + described in the response body. Response bodies are identical to the + schema defined in + [SEP-12](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-get). +
+
+ + + + +
+ + Schema + +
+
    + + + +
    + + + + fields + + + object + + + +
    + +
    + + + + property name* + + + + +
    + + + + +
    +
    +
    +
    +
    +
    + +
    + + + + provided_fields + + + object + + + +
    + +
    + + + + property name* + + + + +
    + + + + + + +
    +
    +
    +
    +
    +
    + +
+
+
+ + + + + + The case when a customer has been successfully KYC'd and + approved + + + +
+
+
+
+
+ +
Error.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Not Found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/callbacks/get-fee.api.mdx b/ap_versioned_docs/version-2.9/api-reference/callbacks/get-fee.api.mdx new file mode 100644 index 0000000000..aa52875ec0 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/callbacks/get-fee.api.mdx @@ -0,0 +1,354 @@ +--- +id: get-fee +title: "Retrieve Fees" +description: "The Platform will make this request to the anchor every time a transaction is initiated by a client application" +sidebar_label: "Retrieve Fees" +hide_title: true +hide_table_of_contents: true +api: eJztWFuP27YS/isD9qEt4JXdTQsUfvNJN4XRog2yKQ4O1ouYpkYWuxKpkKN1DMP/vRhSsmRbyZ6k26KXfTJMkXP55j47kaJXTlekrRFT8TpHeFlIyqwrYaOLAkp5h0C59uDwbY2egCxQjiCNyq0DvEe3BdIlggRy0nipmBhoD9po0pIwhdUWJKhCoyGQVVVoJfnSwmw05bYmkLB8W1vCNzpdJguzMCzJLLIoa0+AxteOJZEU2Hs0qTZrkCYFhwr1Pf9TtSdbovPgK1Q605iCNuFBK36JGCn88L/n4VA7LNGQXxiDCr2XrI+FSjpi3ZvnfdUiZqsz2gfBZU9wh1S7eC1DBE0RV5VLt0bIrDslH6jMmxc11Q5H0QBo0spqQ1DKLawQao9pkNTZe50ioCddBrgzRM9fzhH3UDnNPG1rHYatx90nC/PfHE1kqXJp1si2LGUa5OiA9CrHUkZtVggylRVFgXxdVdZFlGuPoKTHZGHESJBcezG9ES8QvbgdiXcXHqtwcn318uLZV3xmK3RB1nkqpmKN9AJRjEQlnSyR0PH1ndDsrm9rdFsxEkaWKKaCfeKN9B5JjAYcO3wJQp3jEtVgAif+rQ3guwYGNtYyOhtGPkvQZmFuZoHyPEVDOmspvrCulHT7RU5U+el4vNaU16tE2XLsCYtCuvb3onKWrLLFeFXY1biUntCNUVm/9YTl2GN1MZk8+zYp088C2wt9xOoiC6y+jBhHu4jpTtC2CrCQ02Yt9iPRuHsqpuRq3I+GYTzS8AEkD/HYwNXBeAZcZ51/JGpRvdLW5j2YhU9gs2MkHnTHBxwwgZ8N9qgGLsuFOboZDyNRWWzk1nPEaqOKOj3PYjDP3idWl1X7CTuYU5M/SpLKYXzTkB3BylLewDCYnzN0aBSmEAgfEkvFiqYPWOlBX/6/DHMS2x/t18PGAOsW5s80BmiuZn89Y0Qd3uj0zA4zA21wojsUxQGdS3kXClYfoddcqebfgZKmXxZtlqGDVGdBFToUxe4k0ueKN2t5zb/jCs3kr2OWAalU6x+y13WwV0xhbiAWrlgalwcNl+BzWxcplJJUHj2pT+jO2E379oRq74k1nTqyppwRUpIQ7rUMj7+aPGL2QjdkGg6RwOry0F0xSjY7asNqj+5xy88nCNP1gZ8izi2f+Moaj57vX04m/HMswHWtuEdMxEgoawgN8Z2eh45/9Xxxd87Yrn5FxSmoctzikI5sMsShS51wN+KQvGJFvj0l0Xwf0jG+GApRQZoKPprF1/2jF4ivGijEfs9fvr68PAfjF1M5G1rmVYFwZUjTtglHT5Jq3wbBCps2GFPYxObykFlrdjxP1qZH3eWqJg5oY2lhmhZago/oQ2unBGacjWVZFTEZbw6da3sFlE0RNq0YsmLoHE8lYULpvBjdwkiTjq2D1gP5hrEEFbpSU9PctkPNybjDg0yk1WXlmF0TiM180wj70cLQ2ZgVxT00n+eZ7/NuAAusJCy/nkzgPzKFV/F8GWahpo4wlYVB5zifsIXW2M4JYRo77nAj8A1gK5tuY+w8kocHKQa9U6fDrtl3/vj6tnPOq3AQ3fKboRgNF9gPPxrknhVliSc+xOgGbP4GyOxHAt8RGs8TXZiX7nArpu28NRL3sqixP3dx+iuRctsMXWHiolxMxTgL85dHd98OX7UrxFS0LbqSRbGS6i5Z1V4b9P4i3k2ayIx+xi28YC7aZJaVY2rRYM+SSTIZzvVbo3Jnja09PG/YeJi9nLdh1tit7Rjaot1sDg7mr5xlAxwG9PfTTTFjHdpgi4NvGzGdO+W6CLO85oE65MBQwA8xmjlbDq48gl9ypmEBP+/ylG+80mPHWmYZKjrmfHp/iEUctRun6NS7DlYRI1FohZzap7u25s4qqXKEy2CGzrrT8Xiz2SQyfE2sW4+bp3784/z51U/XVxeXySTJqSyCd1bWUylNj/ArJKfxHiFM/Ccm3nVx9LR5eto8/bGbp5hKCd/RuCqkNpxlg6fvmkR3E1qx25HIrSf+u9utpMdfXLHf83FsUzn9pTp0PKmYZrLw+AGv/uJVk6+/hH/RBmoQ61iAjlZ0TRESgkeBRwD1H7OM+gCAp8u5T8TwaSP1SEuQB329nd0ex1BPG6pHMs7ZYvD3J6OnJdbvW2J9wFr9zeHjVI2PWWk9EOPtquqPFmxovfWwh58Jd8t/nGbpxPTmdj8SOcoUXW9MnCmFVT8ozobco3Hx+6vXYr//DYJ81Kk= +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +The Platform will make this request to the anchor every time a transaction is initiated by a client application without a `quote_id`. + +The Anchor must ensure that the sending and receiving customers specified in the request meet the KYC requirements necessary to partake in the transaction described in the request. + +The anchor must return the fee it will charge for the transaction. + +In the future, this endpoint may be used to provide estimated fees to client applications prior to initiating transactions. When this change is made, the request schema will be adapted to support the use case. + + + +
+ +

+ Query Parameters +

+
+
+
    + + + + + + + +
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
    + + + + fee + + + object + + + +
    + + +
    +
    +
    +
+
+
+ + + +
+
+
+
+
+ +
+ Unprocessable Entity. This status should be returned when the anchor + understood the request but cannot return a success response. An + example for when this response code would be appropriate is if the + sender and/or receiver is not permitted to initiate a transaction with + the specified amounts. In these cases, the Platform will respond to + the client application's request with a `400 Bad Request` and include + the error message provided by the anchor in the response body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
+ Error. The Platform will respond to the client application with the + same response code and body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/callbacks/get-rates.api.mdx b/ap_versioned_docs/version-2.9/api-reference/callbacks/get-rates.api.mdx new file mode 100644 index 0000000000..9ad8d94bb4 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/callbacks/get-rates.api.mdx @@ -0,0 +1,593 @@ +--- +id: get-rates +title: "Retrieve Rates" +description: "Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must" +sidebar_label: "Retrieve Rates" +hide_title: true +hide_table_of_contents: true +api: eJztW+tv3DYS/1cGOuBi32m1TtIWxQL54CZua+CuDWIb/eD1ebnSyGIjkQpJ7WbPcP/2wwypxz78qJO768Of1pJIDuf9myF9HWVoUyNrJ7WKJtGpEcqKlJ4suEI4kGqhywWCW2pQWo3wQyMXokTlQCv4K+g8H6WFkAqEtegs7NkmLUBYODt585rGnDgsS2FAqAxyKRwcnb3bh6qxbqoai4Af00KoKwQjHAaqwiCkuqoaJVPhMAOnwRUIaSmJsqjrkj5IrcDghwatk+qKR7iegwR+KlCFORYq8R6nKgy37YpvS+FybSrItaEXWxuK14dZVBltUtqWcruSUGlBa2jI0aUFSJdM1VS9Y65SoWCOcC5Vxhtf4MVe4VxtJ+PxcrlMpFqgdbrGTIok1dXYoansWI77CR8a7TARtt4HbabqPJemetAi+ZiG9tMTOO23S3qA2uiFzOgdHL9hReHHWhovYJkTe1MVZN8JUAAty0JiRg95Qc9qu2AmbaobRRr02rU1pjKX6Q5NWr+vTtJSpWWTsUUgzPz4S5nNoBZGVOjQTJVXGutCWK14H0fSFWhgZrEsL0VF5GegDczmzap7XsqyJIUEIhlINeDM9jRsDPPGgcIFGphrVyRwrHhLVlQIS7GKpwqHJDMs5QLN6rJCV+hsxvJk4ltfKrG6bRObZGOwUqUIntRUBfbI5wbc+UdJyuncjt6xYKbqrGaHSVEuWn8xaGutLHoz9zrsdcBiWohSZsKht3IWIPNUG5ki6HxtHaZ07N+FiWREuZDlpivx4n7eHQ7+rHe0pXQFCPj+9PQtWCdcY6cq1RnvYfblwQv4RmTwnXC4FKsZb4QMas0Q4jUziGHGTMxir6Qcccaxp2U5I1vIdVnqpZ3QgiNyhxnbPA/Gj5KUNVUAo/59EhTBzlWIBYKAWltJbkxrN37LVl4pcgah3GWGqaxEaWeQYS6VNwYWOC0FqVa5vGq8Syab5Jx2ogzk8EMjylactqmYUjcyQ0eaSIIAwkrexTf3D69eee8emFq8Jk745VWwgr9BL1b4O7BsPPe6zMCZBh9GqrfiGG4ltbdJa38HsU1NZRotKO28yh7Cx45Fg0X98oqdrNWUsF7q0q3YRsmNdaMy8jE0RhvmHTi8rX/YWGX2/OBfe6NdZrE/m6oojpy4stHkPOKkEl3E0ceRxZpfnRy9Hb18HsX+j6/po67RG8xxFk2iK3R+Whz10S2anF9HklL/hwbNKoojJSqMJpFb1RjFm/CAEuyqZuslybaeiVkCxznMKCHM4rV44GUYIlzQh2yDIj9xqkF7KdwsieLIpgVWIppc+y1MIuuMVFdRHKFqKuK0T4lRHBHJ6OImjmgr0mAWTUhXN/Futro0ssXboQKZoXIyl2haNLALcFTifR88mX1KXNJS6gxpvrEesug8RwOZpB9aJkdk4NG/CeCETeu1p3X8xnbpiYi0gbxu5qVM4T2u+PXgsSUnGlcQBwSZYCEFkCk8P0igTc0+QCjbGJwqBlobK4X03EefNvRWwqUFUl4ZjH6v9FIR4TmWmkQSgg56C/cII3iNHORUz55WJWe/Ac18KHPKYgOGsp0ckcC9A8GyQM7C2pCbT9VgMsMYn0fIRFi7DNJom705eYySwLctrrEgyqVYdTNhfc2EffI2g725zQb7cLrTwXxAvMX4WHIk4A3UKVUPW/NNOKCm6vyQVz0OFh5W+1abSrgeRF5JVzRzho7WW137O6qNdjrV5Xhe6vm4EtahGWOq7co6rMYW69HBwcuvkyr7C5MdyTVSo5xJ7d8jsoe6ccfdPRLsbDyIqRfflsCGeOoPKLFBttstM58IGZYMJHGvGd5heAn8RMMo57YxkQSbavVzk4ZlXLEGyB7pUf0K9/E2cItfbRY7+YGenany/Azx5iMZ4qLJrC4J3e5k6fz45Ed4+fyrr0bPQZR1IUYve6NElSzle+nrQG2uxvQ0Pj758dLPuAwz9qFFzySLxqJ5ZiFtDGcmkWUGLWWmNtbaQjcll4aYOl929SGds0Bb93Eo16pbOrQGwtO8WY1JRlALyQiIuwIECKSbKgr7CyFLMS+Rs9BSU0ivNLcESCwS7SPF6qHGpcgdmp1i9ab+jECZ5UwxG6AT4CKI9ulkhR1E4MLaR5ph+udkJq0vxrhS9hW4xwpellM1p9Lg/Oz0NZBCv/7q4PlGSW81a1BaPaKvI9rDSKhsRHsIMSIpXFXug+e+z41BXwZdYxTMvjg4oAJpqt75nD6jLQo1LPWZQa1I3iyjIQSgBMyVSypUcIFW25+SBzdq4p1a8Z+GsUgbNlfvuNREIlDlV9qIX3pQ1wbZezao9hZ57k0Zp2oghr647Thk7M4TrVdv13noXWCA5dvaba2M3azh7o4mg+C42Tf4hCj5ieIW1Ehr4aZvJOBaUM2Nrn7nEt/ZxLlP5BeUh33FY+n7i4MD+lkX7kmTphRSozhKtXKoHI0ZbHn8s6WB19uE9PxnTCm71YaqOic9GQKp94+S2a5yan1vx2/a8DyMVT/8eApnJ0dvCFwrmNESr3q8PEsIf/QRchcVH6GiScSBi4LWFumj3g7WYurDyLPZ3M8fR3etFmgsEWp7V1SGZTBfDdEAbYKSV6PkFmggM6Om6iZQitl4dNOWulRYULXnu4VGZJL2IUrIpRIqxXht1SUH6jnF2hyNCdWc73zOhW0RLdfMw+gWhvgWa9vqY8chsTelWO9yjGhL8JBWB+ydG8w/N8xluqOwNbu/z/obAtMHafEOpDqEc7ej0mNqpwWBD2rzNnKtN457RLNWEMeQYR3qXK2g0Etf3FPzkB26t6oQCYnXAU79tazeAVzbZvsQfT6Q1aEFfFZOc9wZl7ZaLv4L+Pfztq/iCWS0GU0NhrrrMhNA6TZKDQFmwzdxQThn5LxxmGyFQO6QPkzoPJQ9xWPawCSz5WvOh+muK0JpqbahkxbCXLGME/gnuRw7fW3QIp+SSAW/mcKTGA794gHLwhhBoEI6rOz9ucdjj4cIjEZ2OQgxZsfFj6KqS4TZ4evvuascw+wbI/4tSyk4d6f0l88d/usJmgWFN/+ILg18DMjdt5tDcPhxl1F6G3iUA4cIHmzJd0v7fjy3k1u7pt50U+1tt+v3Zy2mn6PvOFu/iu//JwT9Bu2Acy/8bscXceSkK2nL1Aj+FvENL/8uAJfoZnO+95rW7LfnD2auT/RJOd7oOgzC3wXNGK423MRNHH3x4sU2fjpTtdGEoLg2PFJOulVbT/Fx0EA8vurBzEOHQchsVIbGOh0QbtvgpNM2X9nQGTFXTAKsB2zDwy1/+GepDLJbh8OPPdFqazNoS7Op4nI4dM1pGX9cUBHzV4MQuI5cusgdeu9zna08cv1MeJN3sbMLtQtjblqFnz0woyN+4TX+5S7EzAM2zoUfJmQv2u6cthMJdzxIuCyb34FkGGE7VARb/XHNe1xFk/bkJ464Rtp5AkRVSajz+PiHT35cEU2iMRcO5J9m0Z4CNaaMJlGbX1JRlnORvk/mjZUKrR35sUmIyKG5n+oqIjJS5ZrYDPg6mkQvk4PkYGdQPFmptDBa6cbC60DGwuHb4+52wHox0B6AbB5O10aTKrpjudvX9UWi7U/4K5Fh6zu9YRWSWk4uxGLyfD7G6LyVcZPYYWxsoeSztMFnfbxob5lYHFwu6CrgnvLm+F0k/PlfMI+evRPWShRHpUyR4meXc6PDWqQFwgtWQ6/d0FkS/JWbS2GqHf/j+PXRDydHoxfJAfeU2E5rbV0l1GDhd0hNuAVCe564kV07l3q6T/R0n+jpPtHTfaKn+0RP94me7hP9Fu8TeVRK5e64LoVUBFgZKlwHqHjue8wXcVRo6+j5+ppakmemvLmh1/6QgQBkJrkwy6JJLkqLd8CCvXcB++7D/+JK0U4uPYoO15wCho4iOjt5OB9Pd4ae7gw96s7QHRY5vKH2SLPccK8/wYWiO+S5dtvqcwv0D3O/6A4BDu9aPVJ+v7ULRveaS9ux/Dz8/n8uHd2n0s/A49MtpHti+fo1rk+Q9NPFpMdfTLpDQRsXwj5BQU93lHZdmLkv0G5fR/rvqOBPfm/pnlRwlxYu6MFIUkM0Oad/tChQZGgGJxGHaYr1MJNsnaOsHUR8d3Qa3dz8B08O754= +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Transactions that involve two non-equivalent on & off-chain assets (such as USDC on Stellar and fiat EUR) must use exchange rates that are communicated to the client application requesting the transaction. When clients make requests to the Platform for these exchange rates, the Platform sends this request to the anchor to fetch it. + +Rates can be [indicative](https://www.investopedia.com/terms/i/indicativequote.asp) or [firm](https://www.investopedia.com/terms/f/firmquote.asp). The anchor must provide an ID and expiration if the client requests a firm rate. + +Anchors can provide discounted rates specific client applications. The Platform includes the `client_id` parameter for this reason. + +Either `sell_amount` or `buy_amount` will be included in requests as parameters, but never both. In the same way, either `sell_delivery_method` and `buy_delivery_method` may be included in requests, but never both, since either `sell_asset` or `buy_asset` is a Stellar asset. + +Upon receiving the response, the Anchor Platform will validate the amount and price of the response. + +If the validation fails, the Platform will respond to the client application's request with a HTTP status code of `502 Bad Gateway`. + +The `sell_amount`, `buy_amount`, `price`, and `fee` are validated as follows: + +- if `rate.fee` exists, + - `rate.fee.asset` must have a positive value of `significant_decimals` defined in the asset configuration. + - `rate.fee.total` must equal to the sum of `rate.fee.details.amount`. + - if the `rate.fee.asset == rate.sell_asset`, `sell_amount ~= price * buy_amount + fee` must hold true. + - if the `rate.fee.asset == rate.buy_asset`, `sell_amount ~= price * (buy_amount + fee)` must hold true. +- if `rate.fee` does not exist, `sell_amount ~= price * buy_amount` must hold true. + +The `~=` is defined as equality within rounding error. The rounding error is defined as `10^(-significant_decimals)` + + + +
+ +

+ Query Parameters +

+
+
+
    + + + + + + + + + + +
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
    + + + + rate + + + object + + + +
    + + + + + + +
    + + + + fee + + + object + + + +
    +
    + An object describing the fees added on top + of the rate provided via the `price` + attribute. +
    + + + +
    + + + + details + + + object[] + + + +
    +
  • +
    + Array [ +
    +
  • + + + +
  • +
    + ] +
    +
  • +
    +
    +
    +
    +
    +
    +
    +
    +
    +
+
+
+ + + +
+
+
+
+
+ +
+ Unprocessable Entity. This status should be returned when the anchor + understood the request but cannot return a success response. In these + cases, the Platform will respond to the client application's request + with a `400 Bad Request` and include the error message provided by the + anchor in the response body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
+ Error. The Platform will respond to the client application with the + same response code and body. +
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/callbacks/post-event.api.mdx b/ap_versioned_docs/version-2.9/api-reference/callbacks/post-event.api.mdx new file mode 100644 index 0000000000..0bb1897fd2 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/callbacks/post-event.api.mdx @@ -0,0 +1,2354 @@ +--- +id: post-event +title: "Receive an Event" +description: "Receive a JSON object representing an event." +sidebar_label: "Receive an Event" +hide_title: true +hide_table_of_contents: true +api: eJylWEtz2zgS/isoXHKhJEf2ZLK8ZVyeqmztTDwj72VtlwwRTREJCTBo0LJKpf++1QAokpL8kMcXi2j0A41+fI0Nd2KJPL3lV4+gHfL7hD+NEGq/Nru6Hn3iif8/vYg/zj/SJlODFU4Z/VXylNcGnRfAEy4BM6tqovGU/w0ZqEdggv179u1PZhbfIXPMQm0BQTull0xoBsQ7vtM84RZ+NoDuNyPXPN3wzGhHctMNF3VdqswrnXxHkr7hmBVQCfrl1jXwlAcFPOG1JROdAiSqkr096KzSS75N4sI+IeGgm4oc4KzQKDJSOc8sCAeSJ4NVdMI1OM8KoZcHRLDWWJ7wn41x0BOQNehMBXbe1NIv3e+77aYA1pMUHMTIzDG7FJotgBkNzOTMFcByU5ZmpfQyvdMj9nDE6gc2YmIgcSWQRSJzhTXNsvCyZlfXDLSsjdIOx4wMqcW6NEIyhUxpv6mv4oHlCko5PlA9dA1ZQKxhlSwf2lOQPWHrP9LqfU7K/A9WW5MBIsWZG/r0ZC2DWwwO9UsDVz4q0brx/DP7cv31WTWet1Pgw1FVgE5U9bGYzI2thOMpp5AZ0VZiiYJfz4DeqejTaPiW8/T2kI0SUFmQFP+KohWh5gn/obT/8NfHEy4q02g3h6cashDVEtAp7fNzLrKMyIHBOpBz4SjKnXIlabvprJldXU8v+DZ5tyVv0XD+kW/vtzET310uEMpyHg7+Ah0RjpMXzfolbk9+lhmeamUB6ZRvDw6rsiP1jSLNOFHOn6f7cDb2mKeGhWrmoCyF/So/IBMWYoFH5grhmJJU4vM1FZRRg2CRCS1Z6CJsBlpSXn7RWWEsJmzROKaNa+mhdfR2jO/0nf7dWCb8lo9T1hbSJKSUkjGfGBamKSWVSWzyXGXKl0/D8qYs151dxNXKaBNz0aDSgPiB/SayH6DlntoDy6PyGPIP/ogPFVQmGoM9axqEfXmf3i/mTXF7rLV4T8XmsTu/haVCB7bXEIKbxxQRbUa/Kv9KuQJsKIIhOFjkZcayP5onkLsFIaUFxNYUo0dZIZRmdD1u7fWSB952KNrJHkXZwO6CPbzoTrhSrmCCYSFsZ0TCVgVYCM1pQKFqvbuPMd9uu+qyC3ufTL3280zliO3hhOztKfvLF61thxveWcB6Ii9bSdstLR9UWs/ZdZd+a+rV2AD5WhFYG41B/fTsjP4d3lHAMQoZNhn15ZCPsUmT57VkFoRcU7LaiB01PLkIEX0zbVWxhZFrEgZVHaPl4lXFSj+KUkmKRQvffe86JpVwp1AafVgEKFEBolhCCAR4cqBRGY2+if6ANU9b5JxwH4UvIujtPYW2K0wLn723XcFTPoGIpBHsI9igoLElT3nhXI3pZJKJslyI7Me4LVajsHcMT6KqSxC+oowzU3FSRGj57w5XX4VNbZx0cRjj5RnU24ETPj2bXozOPo+mn24+fk7PL9LpdPzLv379Hx8CkiHkGOqiXp5y7xPf0FMuoTaoXNfaU650ZshUB0cQB40EsZt2YmMD7aVeZFP6RAbTuBM5coC3cgQsueeRDsc85+HP5OE4NLy6r3Xd6zv9ReVg5zHjXueIudA330LeaImdB+Zh5eSbOsGNtVhXfmylFBl6U8n5rvz5Wr2LoLcKP8GOOLS+wXGtT17Z6MFqNHzey6NjJw0dcvjdnt3BEyVUv/28ZB3oRyjNsDm94ONIapXFTwpl09gMdlPAsG0fDAl9155wQ1tfRN+tiiq41aKc77fvt3uWKUlza7G71/k+R2/5GcasJGw6l6YSVKI61kjQooLD0nGsnvZmk/3loeeGk8je6v7W/tzxUujEWaLXTPojRu9Y3WQxPMCRKxp68wjS2hP7eloNMVRfhAcxSucebFLbDdjhfHw2PjsKN2drnRXWaNMgu4z9GGniZ1hDpvL4VMVyMwTDAe2z61I4wn0EfgiG+KngZbkScmr2LFYbZJWQwBZhjNnJWxWqBKY82Om9foiWjeXWVISKfXyx3quax0F3OoCHD7hDREhgzBWA0KkWeU4PeQPN+/uPqfBDyw6F7o438/CFJ7xUGWj08R0j/0stsgLY1F9DB4PSyWS1Wo2Fp46NXU4iK07+8/Xy6s/Z1Wg6PhsXrio9YCOMVQndE7x7mtTs6Ntl7/Hx9GfMXrJP6pJSexut30Scd8sDzrtPeEH4L73lm81CIPzXltstLf9swK55entPgNIqsSCn3VJnKEBICuEd8rwMlo5uAm6P+PPwyXQAO6+/zW4o7eNTa2Uk8VixosIlVjzlnB56Y9/ZhLUNL4VeNqH5B5n0939tl6DO +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Receive a JSON object representing an event. + + + + + +
+ +

+ 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. +
    + +
    + + + + 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` 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. +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + + 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` 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. +
+
+
+ +
+ The event is invalid or rejected. The response body contains the error + message. +
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/callbacks/put-customer.api.mdx b/ap_versioned_docs/version-2.9/api-reference/callbacks/put-customer.api.mdx new file mode 100644 index 0000000000..7143f1fb83 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/callbacks/put-customer.api.mdx @@ -0,0 +1,1119 @@ +--- +id: put-customer +title: "Create or Update Customer Info" +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: eJztWm1v4zYS/isE70O7C1v2ukFx8LdcugWCXougSXAo4kCmqFHErkSyJJXECPLfiyEl68WSkwP2gFvAXxKZM5o3zgwfkXyhjj1Yur6jF5V1qgRj6f2MPs8taD98/flq/iOd+f+fVvXD6qx++OETcqdguRHaCSXpmn78eJMDOZc8V4ZcFcxlypQkVWCJVI5oMFZYR5jcEV7rJL/8cUFS5lj08eNGbiQKMPBXBZ4vJQasVtICyZQhLheWgEy1EtIRZoCIFKQTnBXEKeJy2Mi77dXtDVk08rf33+fOabteLB6Ey6sk4qpcWAdFwUzzf66NcoqrYpEUKlmUzDowC+DK7qyDcmFBz5fLT6uoTP/RCJ7ryn3YyFFbU8iEhJQISULwInTtohCAZmtdCM4wZJaU7MveX0uehMvRC5KpolBPQj7sY5GodDcjT7ngOREWo/HETApp7TdhPuhRHXy7kWVlHXlkhUiZA29eE35kx4gTzayFdFbb7iojPa3x8DtLtiLdRuT3xj6upGNCol1KFjtincHnTECRovVFsZEJTBlHWMfDbScMiz+tklsvHQPkdhpGlW5kIiQzu65C8l59ZVU4oZlxC0zKOQZgoHIj6YwqDcYbdZnSNdWVa4qDzmg9F/9S6Y6uX2j9Mj4OncExy3MoGT6hdLqmKvkTuKMzqg1qcQIsUkWKf/uFhFVw+RNRWW9C0KEwTyG3nK+VOudURhjRBh6FqizBGqjNjeissSDMF32dUca5qoLth5qvQ1UQZciv1TOk5DxwE1a5PNSbg7SN7b7SHwULCb8cVVpCqcY1IgWTtWoqOtthYrHWda+MEZszAympzceCAAPeiD4Fa2RbP28njYnD6JhFSMGYessqG3Krse1Nww41zijIqsS2KlI6ozmzOfLAs6P3rw3zMUMYx8F+PghLEsBA/fLHRYplEG3kNYR43N3gi9cauMjq1PzarRBNm9uuhg8kVbwqQbpu9/O9u1TYrmWmoo38WRkS1hCyUxXhTNYtE38aop6kd9s2SY59KnSCTDxUoT47YlZnmPjzpuuGPNpa0Kuz+X4dwGDhPIYyP0gHZ5i0IcbxVEV2eIio8z905EHbRDdRH7NWcYHFEpH/5CA9wZTefpIZVfanMwUNMrUkTPNGdvV9D9FDNGuj2EgR1te5wOTDMBfMPGCnKDEN7YdxZzNhrIslK6HTnlpywY5RWZoKVM2KozwGrI19MZhdzFU6zmgdcxArE2ujHoXk41xcuN0oQSvrWDEtvrZjlFaqRBQQy6pMwIxyQMlEER+TkQjj8hhX2EPyjIZZomvqGfbsumATfgb6m0FLmPwyHXtPrfvQMe96fE3/mdD1hhSdK3k0kp4rMbguHw34swODieUzPwMTN0vGYUoULDmqkidVzArBjk5+qSTsjknp8fkcTaf0mZ126mi21Czjy+BPoA3w0CtuLZDteDC2REjrgKWji5pjz3X3miBNp43ivNIsGDNaC7pQOzDTAvYcx0JQMPlQsQeYTm6RTiejSN8uDpHGwtoK3l+VIo3hWYuwrPxXrx1JHKGPxsHC8+i4gQyMYcXULPaaVvwIZr/0vt3B3mLHJBGuwKGrFvfWONyTRzD0CemekO4J6X5LSPcE/k7g7wT+TuDvBP7+Z+BP58opDHhmVIAekwLDjmbvpYTxL+98RyrHzC5mGrOTFbHK4kbMOyW8gVODNG2UymIDFmHBWPsaFT2FcbsyVRYLydVYVo0HqXmrEI8gR60efe//D1f/2mDpFmC/ekMDyvWOrZbLw15xXXEO1mIL+Ko70O/8Ggjm1daejRl4Kf2xQzjV+XpWgjFq4ltrwv5mYwyxaHj7vnXqsx9o3Dg7dOM35cjPqpLpt+BDvX5Ki6dKdH33Qr/Ajq6b07wZ9VDxfad6r/f4zeByVZ+AoBfM5XRN96dqFKvbPOKRIeqqTEHXtIHcnBUF9rAoqazAGp0H3gieWakLqI+quCopqsIY/t6erHwOTE1etlW9/5Brh8Ji2v9dLyDh42PYGYa7vJ2e0UHF7WgHDHcMGWLgHmkE+rb0EcTbEgPQbX/38O2Bjp7ffTTb+RLrg9iW0MWudLVcnc2X/5yvfqQDmDp8YcqvDigdDA6x6AR5OFE95DkY7gPOAXGAMzuhmICXnfj3UGVnvAWTByHvY8gJcgsdO0IHiPGAMrSuQXfDkYOwd7FcNxN6EG6EMGLKALC1hD1O6w1NZccAlfXzbQyAHXAcBriLWzr1hZCj/dlb9SfKZbB6T9TOBBc2bpl5QI/NMNB+iJbRkg7vRvjtpp3kuVES960u6i5pyfnVJentLdR3HdrtqeGNCm0ULi9Rc2FiWm7YKbDtFYOSpUCSXX836ykXBRDh95K0UQgvwqZUc/vAn1Uxwg9uMETkBk+qQkv/zu436Wx9FG87txtYlgF3fc1D/jEVYRujXvJa9679ooJZKjggJFm/0Dq5zzXjOZCVn4Z2cVovFk9PTxHz1EiZh0X9ql38+/Li82/Xn+eraBnlriz82osNuGSyI/jCAN6mUIbcan+vosFF5BLTYDDnnSsCp6sxp6sx3/rVmLrj407uQhdMSGx/vrpeaoB4R/cA8X5Gc2Udjr28JMzCrSleX3H4rwrMjq7v7hGUGsESrOs73BrOgflVco9eL4INc9zgbTHs6DHE66x56Zxz0K7DfgDYewD36vYGsUN9p6cMSxfK9WJn7SPa+Pr6N5WB57o= +sidebar_class_name: "put api-method" +info_path: platforms/anchor-platform/api-reference/callbacks/callbacks-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +**The Anchor Platform does not persist any customer KYC data.** + +The request and response for this endpoint are identical to the [`PUT /customer`](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md#customer-put) request and response defined in SEP-12. + +Client applications make requests with the following request body, which is forwarded to the anchor. Anchors must validate and persist the data passed, and return the customer's `id`. Requests containing only string fields will be forwarded to the anchor as with the `application/json` content type. Requests containing binary fields will be forwarded to the anchor as with the `multipart/form-data` content type. + + + + + +
+ +

+ Body +

+
+
+
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +

+ Body +

+
+
+
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Invalid data.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Not Found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/callbacks/versions.json b/ap_versioned_docs/version-2.9/api-reference/callbacks/versions.json new file mode 100644 index 0000000000..66775e886a --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/callbacks/versions.json @@ -0,0 +1,12 @@ +[ + { + "version": "3.0.0", + "label": "v3.0.0", + "baseUrl": "/platforms/anchor-platform/next/api-reference/callbacks" + }, + { + "version": "2.9.0", + "label": "v2.9.0", + "baseUrl": "/platforms/anchor-platform/api-reference/callbacks" + } +] diff --git a/ap_versioned_docs/version-2.9/api-reference/custody/README.mdx b/ap_versioned_docs/version-2.9/api-reference/custody/README.mdx new file mode 100644 index 0000000000..9632f1a96f --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/custody/README.mdx @@ -0,0 +1,19 @@ +--- +title: Custody Server +sidebar_position: 30 +--- + +import { MethodTable } from "@site/src/components/MethodTable"; + +The Custody Server provides a set of endpoints to interact with custody services, such as Fireblocks. + + + +| | | +| -------------------------------------------------------------- | --- | +| [Custody Transaction](./create-custody-transaction.api.mdx) | | +| [Payment](./send-payment.api.mdx) | | +| [Refund](./send-refund.api.mdx) | | +| [Unique address generation](./generate-unique-address.api.mdx) | | + + diff --git a/ap_versioned_docs/version-2.9/api-reference/custody/create-custody-transaction.api.mdx b/ap_versioned_docs/version-2.9/api-reference/custody/create-custody-transaction.api.mdx new file mode 100644 index 0000000000..9b03be5755 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/custody/create-custody-transaction.api.mdx @@ -0,0 +1,275 @@ +--- +id: create-custody-transaction +title: "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: eJytV0tz2zYQ/is7uPRCS67T9sCb4zhTTx/R1O7J8WEFrkTEIMAAS8kcjf57ZgFKlGXFk6TVQaKX+358u96oiqIOpmXjnSrVVRfZVz3cUlhRAB0ImSLogcwBXUQtzBBI+1CBcfDu7UQVyrcUUN7cVKpUWXJQdzeKqUIxLqMq7/e2Dt5G9VCop7NIbeK4vZ6d/aaK9Hvxy/Dw5mdhCvS5o8hvfdWrcqO0d0yO5RHb1hqdPJl+ihLVRkVdU4PyxH1LqlR+/ok0q0K1QfxmQ1Hemkq+n6fk9nr2LO6bdxLtoCdyMG6ptoVqqPEvhf+ixsMKbUcFcI0MJkIXqQL2YCpybBY9GDf3navAB/Ad5+cW+4Ycx6/aukvEY3tCBb8A4fjfLBaKXNdIQUylClVjrIWHnlg9bFMK2WtvX3ozG96IR0dpfM2KlDyVW0q9LdQi+OZSa9/lAh+Vx3dBE9wyWYsBMPOdTBv7r2p5R5GNS03zTaqwOa3nMtElXq4JMEbisQyRHE8DaTIrql5R+55OVPY90TelUbSI2RO+fa83j8admIc/jDRODvA7ilpR66ORkVsbrquAa7RK5jg5oB626SOE2HoX8zxenJ+fqHinNcXUpz849tnSr6eU3zim4NDuEPA6BB9+3FIGKhOokhxQUvZwjDqZPMruKiAta9jSiMvZmyFT9MTkYkLN8n6jHqlX5Q48C5VA51UQ3T4IknDtBa9bHxMcIteqVFM+xORCxZSMbKcLVpWqZm5jOZ0Om+Esc0zoCZvWEjpd+zDRvlFiRbL0zwjY15lpB7hjr2QMff53xrmMPCPSJIx4hguj1MGYj8TdwB5T0qwdEPPojIQ8A/vu3RbKuEUCeklI7pk3k/PJuXpRrKGFVHGM0TXtF2oc9qx3jjRHAWmSDmyDiQRrtJYY2uBXpqIQC4idrgEjvDeB5tbrx1iITCRXAboKhnHagzksfDic0AjGGTbIVMHKYBriy1QsmFnkhQ/NBO7qBA9hZTQJUqADtGksWHSzz7M/wOSH+RCEmJp30TiKkSKsay+LB7yjHVzErm19ENv7kCZw4wCryiToHVQvOpe8RWu4B79YUKAK5v1Ju0WiHh8uyefoYYHaWMPI9HLTiTltDTn+KR6jvji2gN53WY0EImZolQSH5BTPVPW+G8VhbawFDma5pAAIv9/dzUCjtXPUj9BgRXuRXc6GZph8dB/d3nYgrHqocUVSBuOYlvnKAoHRrOCoTVJCHLBUUfum9Y5cQnznGXZwVEhJa98t65NOZPcd5bvB+XQ1nGgWWIsp3OVBNp7Xub2Sf+heSBzeUmvMe0iM+AAy0Nmd42rsm3Wv5nJ2kzJ11YVAjm12zzvbn2gziX4cmclHOUOt0eRiQiGHjcztZYu6JrhIwzzCXDmdrtfrCaa3Ex+W00E0Tv+8ubr++/b67GJyPqm5sQmzBUobdAeKr9IxDCcO3mNwOLhk/8stPiwSOdGmrUXjBLhSRJsB4u8VH53dtWyA8l5tNnOM9G+w262QP3cUelXeP8hKCQbnAnH3cpbVhBWFg91zlV0/S5C930Av9+W22Elcak0tv8p7uKRmH27vVKHmw9Hf+EpkAq5lz+JalSr9H5JDKjeZtlEW3bLDpfBmnfL5AvWzi8k= +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server creates custody transaction record in DB. + + + + + +
+ +

+ Body +

+
+
+
    + + + + + + + + + + +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    +
    + object +
    +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/custody/generate-unique-address.api.mdx b/ap_versioned_docs/version-2.9/api-reference/custody/generate-unique-address.api.mdx new file mode 100644 index 0000000000..1119bd8a6e --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/custody/generate-unique-address.api.mdx @@ -0,0 +1,209 @@ +--- +id: generate-unique-address +title: "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: eJylVsFS20gQ/ZWuuexFyCyQUKWbAyahlmQJJlC7G6oYj1rWhNG0MtOycVH+91SPZEOA3cPmJJXc3e9Nv9c9flAlRhNsy5a8KtRRF5nKFUwxLDCA0c5F4BrBkK/svAtYghliIoaFNQhMMEePQTNCiS1Fy6DLMmCMoH0JDTaUf/Vf/QmFRjNQBbc6RuRbaHXQDTIG2IHbyOicDsWX6fFR8f7du+ODw9OTt2fXfxyeH348nlxNj64vDo/Pv1xf7X/6a//48vPk6uTs4NP48mD8+cP+32dnJ2fjN7dfvcoUtULHkj8tVaE27L54+73DcU9NZYr1PKrin+2h+99hE3CTqfudiG2KmU7Od96qLD33DoaX/d8lKOD3DiO/o3KligdlyDN6llfdts6aRGT0LUqDH1Q0NTZa3njVoioUzb6hYbVer9dSK7bkI0YJ2NvdlcfPCk07YzDGXGX/FylTbZAGse1hBq1eQh0/E5MJlrU1dW8IZ9EzxJo6V0JEX0LV+TIRG/AiB+vnap0pscDL+h+xIVho12EGXOttsRkKJJYC2OpVIziz1RPUf8W4TB+f48hXcZ1E/DJSptB3jVjClipTtY61xOA9qxtRkC07CX//mukuBnkHtd+8JvCpZwxeu80MTkKg8Etyi0FtwFJIo1QT1/7sgf7zY+6mrU8ONExJopP4rzOF94w+WvIyIw/qDleq2AxNppK0/zk86xvRjWuSMW0pJnNqrlWhRmlFxFGRnqPBgyh1Y2pMD9kFpwpVM7exGI2G1bTTR+R4r5vWofamppAbapQASsMuHmd20gep4mGdKeurZFSp38uxn+/mu+pFGwZ1VPbca2KdJwtSlih5j4bT/KCI2wYbEZbaOWRoAy1siSFmEDtTg45wYgPOHJm7mElOmi1ZpAEN2gVunBqhogActI/aCHwE6y1bzVjCwupk43E6O5w7zRWFJofL2sbt6rayoUG75DiW2kwpbdrvYvhzNhxCoGZdtD6JAMuaoIsI5NNkSUrs2paCYG+PlMOplwGzwm5Tuup8Yqud5RVQVaFcKsPUPcfN0tcXt5JwjgSVNtZZlouHOp5R58vH5jANM/xb3JbVxlDnWYhVsKKuLyMHERhcpMShOdlPpVbUPabD0joHHOx8jgE0fLi8PE935UybO2h0iduUTc8GM6R7cIsdUJcrqPUCRQbrGef9tQVLy3Vf4JlNUkM8sKhoqGnJy86yETwxbAY9E0lr6ub1qyR6+h77veeJbbV6zSywFCi93Yw6RjK9vRI/7V9kPHEjLLUAehYQClAFano6z9XYmnVbZnx+mjp11IWAnl1Pj7xbvWIzOf3jyOTpD4CzBmXPFg/K60bmdtxqUyPspWF+3BrFaLRcLnOdfs0pzEdDahydnR5NPk0nO3v5bl5z42Tp/QApKz98 +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server calls the configured custody service to generate deposit address and memo. + +Format of `asset` parameter - `stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5` + + + + + +
+ +

+ Body +

+
+
+
    +
    object
    +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + + + +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/custody/send-payment.api.mdx b/ap_versioned_docs/version-2.9/api-reference/custody/send-payment.api.mdx new file mode 100644 index 0000000000..35c005a45e --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/custody/send-payment.api.mdx @@ -0,0 +1,369 @@ +--- +id: 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: eJzNVk1v4zYQ/SsDXnpRZDdJC1S3NHVRA0UbxD4s0OyBpkYWNxSpckZ2BMP/vRhKtpPY3QXaS04SSM7HezN8w50qkUy0LdvgVaHuO+JQ9rDAuMEIRjtHwDWCCb6y6y5iCWY8Qxg31iBwAEJfQqv7Bj3nKlOhxajF5bxUhZLdh2FTZYr1mlTxlxpXSH3O1MsVYZtWF7OHqx9Vlr7Xt+PPzfdyKOLfHRL/HMpeFTtlgmfxWOyUbltnTQo4+UICZKfI1Nho+eO+RVWosPqChtV+v9+LL2qDJyQ5cD2dyuctE4vOGCQSNP8xUqbaKESwHcLY8tUZ4mj9WmXvos5eGKPXDpafYP4LVDE07/nOlQBgy078LE7cPo6YRoi3l1DN/UY7W8LjwOX/Qif1sBFLKRvGGKIU6S3kYfkM9WsAY8fN0slD5rfnmR86cxm1J21kFSyBDwxV6Hz5QaFc//TvUBbjBYqaEZxtLAsifDGIJX5QQD9c7qqxa0fZSAYfNf+bbxfEEnReb7R1euXwIwLZZwpfGD3Z4EU3d+oZe1UchDRTG+06/Kqg7j9nqkGug0h0GygJluZaFWrCp0tGk8KWk/Yg1pmiVOMhaBedKlTN3FIxmYxCdTWcyPFFN61D7U0dYm5CoySkUPZ4UvLZcEgVu32mrK+CECH+h8rc5NN8qs6IGBvtTD6XMqleyaWMsOA9GiYZUyh92kZLCFvtHDK0MWxsiZEyoM7UoAl+tRFXLphnyo6jTfsSIhq0GzyMOYIqRHhNFFhv2WrGEjZWp6l5l7DDg9NchdjksKwtHQenJdAetEuXh8U3h2S2YHROR/hzNYKQUKuOrEciJNjWATpCCB4hVMmEurYNUWIfIeUw96DL0iatHF1XnU/Zame5h1BVKCN91V+Mm6XVszeB5EwBKm2ssyziFTpeiQifyOEAxln0/B0d3WpjQudZEqugD93gRoBIGNwkw5Gc7I2rPnQnc9ha54CjXa8xgobflsuH9FJZafMMjS7xaHLgbGyG/Mk/+WPsiLrsodYblDJYz7geHi2wtVwPDt61SSLEA0sVTWja4NHzYQwdrnomJa1Dt64vJjGk7xFLSdMHtlV/qVlgK6H0gQfQRMEM7ZXy0/7M4lU3wlZLQM8SJMThJZHSeV+NY7Me3dw9zBNT912M6NkN6QXv+gttJuhPVyZ/8ipTzhqUh0ixU143cm/vWm1qhOt0mU+qUUwm2+0212k3D3E9GU1p8vv8fvbHYnZ1nU/zmhsnsvcPSXzImw== +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server calls the configured custody service to send payment. + + + + + +
+ +

+ Body +

+
+
+
    +
    object
    +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Invalid Request.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Transaction is not found.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service rate limit is exceeded.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service is unavailable.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/custody/send-refund.api.mdx b/ap_versioned_docs/version-2.9/api-reference/custody/send-refund.api.mdx new file mode 100644 index 0000000000..8e8e80f876 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/custody/send-refund.api.mdx @@ -0,0 +1,411 @@ +--- +id: send-refund +title: "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: eJzNVktv4zYQ/isDXnpR5DRJC1S3bNZBDfQRxD4UaPZAUyOLG4pUOSM7QrD/fTGU/Ijtbg/bQ3yxMCRn5pvXN6+qRDLRtmyDV4W664hD2cMc4xojGO0cgQm+sqsuYgmH59YgcABCX0LEqvNlvjvnqD1pI1ohogmxBEugHQUwETVjCdbDxw+5ylRoMWq5OStVoUTdY9KmMsV6Rar4Ww0CUp8y9XJB2CbhfPpw8bPK0v/Vzfhx/aNcivhPh8QfQtmr4lWZ4Bk9y6duW2dNMjf5TIL5VZGpsdHyxX2LqlBh+RkNq0y1UZxjiySnDTZB/t+G7HdsAqy16zADrjXDxjoHSwRdllhKhLjGMUDQ6r5BzwJ7tEUcrV+pL1lSv0jCYxMihVCB3PhOI7oJ3RCJtyZuk/xI+aAPy29ouscz/t5jcnfv0hkF6SeZojZ4GgJ8dXl5qmzeGYNEouJ/yqMtD+6M/mRHVqcvjNFrB4u/YPYRqhgaMGNx01D8uRIAbNmJnjn68mEI/OOISQ0Qb86hmvm1draEx6FSvwudVLuNWEpTYIwhSgu8hTyIT1AfAhhbd5pubj2/OfV82+KLgxa3BD4wVGHM9TuEcvXLv0PZTrOoGcHZxrIgwheDOFb/+wP00/mqGqt2nN/pwXv1//q/E2IJOq/X2jq9dPgegXzJFL4werLBCyu9qmfsVbGlqUwlZvgmXX35JLOf6yD01wZKA0tzrQo1OeBRmhS2nMSRCTNFKcWDzS46VaiauaViMhnn1MVwI8cX3bQOtTd1iLkJjRKLErHHPU1Oh0t7mtsPxj0v7WVbGjmWJDo4IAnrq0SZ4umQ4uv8Mr9UJxEdK/ZkDi9qfDN3ZSkJ3qNhEtZDKfg2WkLYaOeQoY1hbUuMlAF1pgZNcG8jLl0wz5TtFhadlhaDdo1bviSoQjzcXAist2zTtrK2OvHZbYoiPDjNVYhNDova0pYR0o7jQbvUhSy6R2aeMzqnI/y5HEGIqWVH1iMREmzqAB0hBL9jTuraNkSxvYOUw8wL49s0dEfVVeeTt9pZ7iFUFcqituzP2s2S9GTL88NqVmljnWWZgqHjZThYJlK0jbPo+QfaqdXGSNbFsQr60A1qBIiYwXV6OAYne6OqD93++bBwcLSrFUbQ8Oti8ZB2z6U2z9DoEndPtjEbiyF/8k9+ZzuiLnuo9RolDdYzrobNEjaW60HBUZmkgHhgyaIJTRs8et7y2XZmZJLSOnSr+qwTg/seh0XMB7ZVf65YYCOm9DYOoImCGcor+af9yYvDPXqjxaBnMRLisJIkd46zsSvWnZrbh1mK1F0XI3p2g3vBu/5MmQn6fcvkT15lylmDstEUr8rrRvr2ttWmRrhKzbyfP8Vkstlscp1O8xBXk/EpTX6b3U3/mE8vrvLLvObGyfz8CoE2aek= +sidebar_class_name: "post api-method" +info_path: platforms/anchor-platform/api-reference/custody/custody-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +Custody Server calls configured Custody Service to send refund. Custody transaction record is also created in DB. + + + + + +
+ +

+ Body +

+
+
+
    + + + + +
+
+
+
+
+
+ + +
Success.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Invalid Request.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Transaction is not found.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service rate limit is exceeded.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Internal Server Error.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+ +
Custody Service is unavailable.
+
+ + + + +
+ + Schema + +
+
    + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/custody/versions.json b/ap_versioned_docs/version-2.9/api-reference/custody/versions.json new file mode 100644 index 0000000000..9ebd617878 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/custody/versions.json @@ -0,0 +1,12 @@ +[ + { + "version": "3.0.0", + "label": "v3.0.0", + "baseUrl": "/platforms/anchor-platform/next/api-reference/custody" + }, + { + "version": "2.9.0", + "label": "v2.9.0", + "baseUrl": "/platforms/anchor-platform/api-reference/custody" + } +] diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/README.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/README.mdx new file mode 100644 index 0000000000..33ec426998 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/README.mdx @@ -0,0 +1,17 @@ +--- +title: Platform Server +sidebar_position: 10 +--- + +import { MethodTable } from "@site/src/components/MethodTable"; + +Data on the Anchor Platform is available through two different APIs: A REST API and a JSON-RPC API. Each of these APIs has associated documentation here. + + + +| | | +| ------------------------------------- | --- | +| [REST API](./transactions/README.mdx) | | +| [JSON-RPC API](./rpc/README.mdx) | | + + diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/README.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/README.mdx new file mode 100644 index 0000000000..60798cab01 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/README.mdx @@ -0,0 +1,10 @@ +--- +title: JSON-RPC API +sidebar_position: 20 +--- + +import DocCardList from "@theme/DocCardList"; + +Interact with your Anchor Platform instance through the use of lightweight, easy-to-use RPC requests. + + diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/anchor-platform.openrpc.json b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/anchor-platform.openrpc.json new file mode 100644 index 0000000000..f7ac3463a6 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/anchor-platform.openrpc.json @@ -0,0 +1,8955 @@ +{ + "openrpc": "1.2.6", + "info": { + "title": "Anchor Platform", + "description": "The Anchor Platform is a set of tools and APIs that enable developers and businesses to build their own on and off-ramp services for the Stellar network. It provides a standardized interface, including the implementation of several Stellar Ecosystem Proposals (SEPs), to make it easy for businesses to integrate with Stellar-based wallets and exchanges.", + "termsOfService": "https://stellar.org/terms-of-service", + "contact": { + "name": "Stellar Development Foundation", + "url": "https://stellar.org/connect", + "email": "hello@stellar.org" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "2.9.0" + }, + "servers": [ + { + "name": "Platform API", + "url": "https://platform-server.exampleanchor.com", + "summary": "Example URL endpoint for the Platform Server.", + "description": "Example URL endpoint for the Platform Server. Note: This is an example URL only, you must configure your own Platform Server." + } + ], + "methods": [ + { + "name": "do_stellar_payment", + "summary": "Submits a Stellar payment", + "description": "Submits a payment to a stellar network by a custody service.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "do_stellar_paymentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "do_stellar_paymentExample", + "description": "Example request to the `do_stellar_payment` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Do Stellar payment" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "do_stellar_refund", + "summary": "Submits a Stellar refund", + "description": "Submits a refund payment to a stellar network by a custody service", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "refund", + "description": "An object describing refund associated with this transaction.", + "required": false, + "schema": { + "type": "object", + "required": ["amount", "amount_fee"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount to be refunded", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount of assets to refund", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of refund", + "type": "string" + } + } + }, + "amount_fee": { + "title": "amount_fee", + "description": "Amount of fee", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "The amount of fee", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of fee charged by anchor", + "type": "string" + } + } + } + } + } + } + ], + "result": { + "name": "do_stellar_refundResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "do_stellar_refundExample", + "description": "Example request to the `do_stellar_refund` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Do Stellar refund" + }, + { + "name": "refund", + "value": { + "amount": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_amounts_updated", + "summary": "Update transaction amounts", + "description": "Update amount_out and amount_fee values", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + } + ], + "result": { + "name": "notify_amounts_updatedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_amounts_updatedExample", + "description": "Example request to the `notify_amounts_updated` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Amounts updated" + }, + { + "name": "amount_out", + "value": { + "amount": 1 + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_customer_info_updated", + "summary": "Customer info updated", + "description": "The customer's status for the transaction has been updated. Use this method to notify the wallet of the status change. If `customer_id` and `customer_type` are provided, the transaction status will reflect the customer's status. If not, the transaction status will default to the standard pending status for the SEP.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "customer_id", + "description": "The SEP-12 ID of the customer", + "required": "false", + "schema": { + "type": "string" + } + }, + { + "name": "customer_type", + "description": "The SEP-12 type of the customer", + "required": "false", + "schema": { + "type": "string" + } + } + ], + "result": { + "name": "notify_customer_info_updatedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_customer_info_updatedExample", + "description": "Example request to the `notify_customer_info_updated` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Customer info updated" + }, + { + "name": "customer_id", + "value": "45f8884d-d6e1-477f-a680-503179263359" + }, + { + "name": "customer_type", + "value": "sep31-receiver" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_interactive_flow_completed", + "summary": "Interactive flow completed", + "description": "Platform has collected the transaction amounts and fees from the business", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + }, + { + "name": "amount_expected", + "description": "The amount expected in the payment", + "required": false, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "notify_interactive_flow_completedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_interactive_flow_completedExample", + "description": "Example request to the `notify_interactive_flow_completed` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Interactive flow completed successfully." + }, + { + "name": "amount_in", + "value": { + "amount": 1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_available", + "summary": "Offchain funds are available", + "description": "Funds are ready for the user / recipient to pick up.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "notify_offchain_funds_availableResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_availableExample", + "description": "Example request to the `notify_offchain_funds_available` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Offchain funds available" + }, + { + "name": "stellar_transaction_id", + "value": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_pending", + "summary": "Offchain funds pending", + "description": "Payment has been submitted to external network, but is not yet confirmed", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "notify_offchain_funds_pendingResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_pendingExample", + "description": "Example request to the `notify_offchain_funds_pending` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Offchain funds pending" + }, + { + "name": "external_transaction_id", + "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_received", + "summary": "Offchain funds received", + "description": "Payment is being processed internally by anchor", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "funds_received_at", + "description": "The date and time of receiving funds.", + "required": false, + "schema": { + "title": "datetime", + "description": "A date and time.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + } + ], + "result": { + "name": "notify_offchain_funds_receivedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_receivedExample", + "description": "Example request to the `notify_offchain_funds_received` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Funds received successfully" + }, + { + "name": "funds_received_at", + "value": "2023-07-04T12:34:56Z" + }, + { + "name": "external_transaction_id", + "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + }, + { + "name": "amount_in", + "value": { + "amount": 1 + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9 + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1 + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_offchain_funds_sent", + "summary": "Offchain funds sent", + "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" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "funds_sent_at", + "description": "The date and time of sending funds.", + "required": false, + "schema": { + "title": "datetime", + "description": "A date and time.", + "type": "string" + } + }, + { + "name": "external_transaction_id", + "summary": "ID of the transaction on external network", + "description": "The unique identifier of this transaction on the external network.", + "required": false, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + } + ], + "result": { + "name": "notify_offchain_funds_sentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_offchain_funds_sentExample", + "description": "Example request to the `notify_offchain_funds_sent` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Offchain funds sent" + }, + { + "name": "funds_sent_at", + "value": "2023-07-04T12:34:38Z" + }, + { + "name": "external_transaction_id", + "value": "3320c6faad48c3cf39b6d4ac15ed50b6e5868b62551e69cde15df2d66c8ca360" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_onchain_funds_received", + "summary": "Onchain funds received", + "description": "Notify that the payment is being processed internally by anchor for SEP-6 or SEP-24. For SEP-31, notify that the payment is being processed by the Receiving Anchor. In the request, amount parameters are optional, but have a strict rule of how to set them. Either none, only `amount_in`, or all of fields (`amount_in`, `amount_out`, `amount_fee`) must be specified. ", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "stellar_transaction_id", + "summary": "Transaction ID on Stellar", + "description": "The unique transaction identifier for this transfer on the Stellar network.", + "required": true, + "schema": { + "title": "hash", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "Amount sent by anchor to user", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + } + ], + "result": { + "name": "notify_onchain_funds_receivedResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_onchain_funds_receivedExample", + "description": "Example request to the `notify_onchain_funds_received` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Onchain funds received" + }, + { + "name": "stellar_transaction_id", + "value": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e" + }, + { + "name": "amount_in", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_onchain_funds_sent", + "summary": "Onchain funds sent", + "description": "Transaction flow is fully completed for SEP-6 or SEP-24 deposit", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "stellar_transaction_id", + "summary": "Transaction ID on Stellar", + "description": "The unique transaction identifier for this transfer on the Stellar network.", + "required": true, + "schema": { + "title": "hash", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + } + ], + "result": { + "name": "notify_onchain_funds_sentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_onchain_funds_sentExample", + "description": "Example request to the `notify_onchain_funds_sent` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Onchain funds sent" + }, + { + "name": "stellar_transaction_id", + "value": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_refund_pending", + "summary": "Refund pending", + "description": "Refund has been submitted, but is not yet confirmed", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "refund", + "schema": { + "type": "object", + "required": ["amount", "amount_fee", "id"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount to be refunded", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount of assets to refund", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of refund", + "type": "string" + } + } + }, + "amount_fee": { + "title": "amount_fee", + "description": "Amount of fee", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "The amount of fee", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of fee charged by anchor", + "type": "string" + } + } + }, + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "notify_refund_pendingResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_refund_pendingExample", + "description": "Example request to the `notify_refund_pending` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Refund pending" + }, + { + "name": "refund", + "value": { + "id": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e", + "amount": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_refund_sent", + "summary": "Payment refunded", + "description": "Refund payment completed", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "refund", + "schema": { + "type": "object", + "required": ["amount", "amount_fee", "id"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount to be refunded", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "Amount of assets to refund", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of refund", + "type": "string" + } + } + }, + "amount_fee": { + "title": "amount_fee", + "description": "Amount of fee", + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "The amount of fee", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset of fee charged by anchor", + "type": "string" + } + } + }, + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + } + } + } + } + ], + "result": { + "name": "notify_refund_sentResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_refund_sentExample", + "description": "Example request to the `notify_refund_sent` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Refund sent" + }, + { + "name": "refund", + "value": { + "id": "ab295bf48920f2bab4aa7cfe31f488eed779d42e57a243aacdff2e6e96ec484e", + "amount": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_fee": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_error", + "summary": "Transaction processing error", + "description": "There was an error processing transaction", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_errorResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_errorExample", + "description": "Example request to the `notify_transaction_error` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction error" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_expired", + "summary": "Transaction has expired", + "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" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_expiredResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_expiredExample", + "description": "Example request to the `notify_transaction_expired` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction expired" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_on_hold", + "summary": "Transaction transaction is on hold", + "description": "Notify transaction is currently on hold by the anchor (e.g. compliance hold). Anchor should update message to guide user through the steps.", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "user_action_required_by", + "description": "Time and date by which user action is required", + "required": false, + "schema": { + "title": "datetime", + "description": "A date and time.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_on_holdResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_on_holdExample", + "description": "Example request to the `notify_transaction_on_hold` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction on hold, please contact customer service to lift the hold." + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_transaction_recovery ", + "summary": "Transaction recovery", + "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" + }, + { + "name": "SEP-31" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "notify_transaction_recoveryResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_transaction_recoveryExample", + "description": "Example request to the `notify_transaction_recovery` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Transaction recovered" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "notify_trust_set", + "summary": "Asset trustline set", + "description": "The user has added a trustline for the asset", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "success", + "description": "Flag which indicates if trustline was configured by user.", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "result": { + "name": "notify_trust_setResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "notify_trust_setExample", + "description": "Example request to the `notify_trust_set` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Trustline set" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_offchain_funds", + "summary": "Request offchain funds", + "description": "The user has to initiate transfer to the anchor", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "This is required if the transaction is associated with a firm quote and for transactions where `amount_in.asset` and `amount_out.asset` are the same.", + "required": false, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + }, + { + "name": "amount_expected", + "description": "The amount expected in the payment", + "required": false, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "instructions", + "description": "A set of SEP-9 fields that describe how the user can complete the offchain deposit", + "required": false, + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The SEP-9 field name" + }, + "field": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the field" + }, + "description": { + "type": "string", + "description": "A human readable description of the field" + } + } + } + } + } + } + } + ], + "result": { + "name": "request_offchain_fundsResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_offchain_fundsExample", + "description": "Example request to the `request_offchain_funds` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Request offchain funds" + }, + { + "name": "amount_in", + "value": { + "amount": 1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + }, + { + "name": "instructions", + "value": { + "organization.bank_number": { + "value": "123456789", + "description": "US Bank routing number" + }, + "organization.bank_account_number": { + "value": "123456789", + "description": "US Bank account number" + } + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_onchain_funds", + "summary": "Request onchain funds", + "description": "The user has to initiate transfer to the anchor", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + }, + { + "name": "amount_in", + "description": "The amount expected in the payment", + "required": true, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be received by the Anchor", + "type": "string" + } + } + } + }, + { + "name": "amount_out", + "description": "This is required if the transaction is associated with a firm quote and for transactions where `amount_in.asset` and `amount_out.asset` are the same.", + "required": false, + "schema": { + "type": "object", + "required": ["amount", "asset"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "The asset to be sent by anchor to user at end of transaction", + "type": "string" + } + } + } + }, + { + "name": "amount_fee", + "description": "DEPRECATED in favor of fee_details. Amount of fee charged by anchor", + "required": false, + "deprecated": true, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "fee_details", + "description": "Description of fees charged by the anchor", + "required": true, + "schema": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + } + }, + { + "name": "amount_expected", + "description": "The amount expected in the payment", + "required": false, + "schema": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + } + } + } + }, + { + "name": "destination_account", + "description": "Destination account", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "memo", + "description": "Value of memo to attach to transaction", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "memo_type", + "description": "Type of memo that anchor should attach to the transaction", + "required": false, + "schema": { + "type": "string" + } + } + ], + "result": { + "name": "request_onchain_fundsResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_onchain_fundsExample", + "description": "Example request to the `request_onchain_funds` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Requesting onchain funds" + }, + { + "name": "amount_in", + "value": { + "amount": 1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_out", + "value": { + "amount": 0.9, + "asset": "iso4217:USD" + } + }, + { + "name": "amount_fee", + "value": { + "amount": 0.1, + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + } + }, + { + "name": "amount_expected", + "value": { + "amount": 1 + } + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + }, + { + "name": "request_trust", + "summary": "A trustline to the asset isn't set", + "description": "The user must add a trustline for the asset to complete", + "paramStructure": "by-name", + "tags": [ + { + "name": "SEP-6" + }, + { + "name": "SEP-24" + } + ], + "params": [ + { + "name": "transaction_id", + "summary": "ID of the transaction.", + "description": "The unique identifier of this transaction.", + "required": true, + "schema": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + } + }, + { + "name": "message", + "summary": "Human readable explanation.", + "description": "Human readable explanation of transaction status.", + "required": false, + "schema": { + "title": "message", + "description": "A human readable message.", + "type": "string" + } + } + ], + "result": { + "name": "request_trustResponse", + "schema": { + "name": "response", + "type": "object", + "properties": { + "id": { + "title": "transaction_id", + "description": "A unique transaction identifier.", + "type": "string" + }, + "sep": { + "title": "sep", + "description": "Protocol of the transaction.", + "type": "integer", + "enum": [6, 24, 31] + }, + "kind": { + "title": "kind", + "description": "The kind of transaction that is desired.", + "type": "string", + "enum": [ + "undefined", + "receive", + "deposit", + "deposit-exchange", + "withdrawal", + "withdrawal-exchange" + ] + }, + "status": { + "title": "status", + "description": "Processing status of the transaction.", + "type": "string", + "enum": [ + "pending_anchor", + "pending_trust", + "pending_user", + "pending_user_transfer_start", + "pending_user_transfer_complete", + "incomplete", + "no_market", + "too_small", + "too_large", + "pending_sender", + "pending_receiver", + "pending_transaction_info_update", + "pending_customer_info_update", + "completed", + "refunded", + "expired", + "error", + "pending_external", + "pending_stellar" + ] + }, + "amount_expected": { + "type": "object", + "title": "amount_expected", + "description": "The amount expected in the payment.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_in": { + "type": "object", + "title": "amount_in", + "description": "Amount expected/received by anchor.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_out": { + "type": "object", + "title": "amount_out", + "description": "The amount expected to be sent by anchor to user at end of transaction.", + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "title": "amount_fee", + "description": "DEPRECATED in favour of fee_details. The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "deprecated": true, + "properties": { + "amount": { + "title": "amount", + "description": "A stringified amount of an asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee_details": { + "title": "fee_details", + "description": "Description of fee charged by the anchor.", + "type": "object", + "required": ["total", "asset"], + "properties": { + "total": { + "type": "number" + }, + "asset": { + "type": "string" + }, + "details": { + "type": "array", + "description": "Details about fee charged.", + "items": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "amount": { + "type": "number" + } + } + } + } + } + }, + "quote_id": { + "title": "quote_id", + "description": "The id returned from a SEP-38 POST /quote response", + "type": "string" + }, + "started_at": { + "title": "started_at", + "description": "Start date and time of transaction.", + "type": "string" + }, + "updated_at": { + "title": "updated_at", + "description": "The date and time of transaction reaching the current status.", + "type": "string" + }, + "completed_at": { + "title": "completed_at", + "description": "The date and time of transaction reaching completed or refunded status.", + "type": "string" + }, + "transfer_received_at": { + "title": "transfer_received_at", + "description": "The date and time of receiving transfer.", + "type": "string" + }, + "message": { + "title": "message", + "description": "Human readable explanation of transaction status", + "type": "string" + }, + "refunds": { + "title": "refunds", + "description": "An object describing any on or offchain refund associated with this transaction.", + "type": "object", + "properties": { + "amount_refunded": { + "type": "object", + "description": "The total amount refunded in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "amount_fee": { + "type": "object", + "description": "The total amount charged in fees for processing all refund payments, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "payments": { + "type": "array", + "description": "A list of objects containing information on the individual payments made back as refunds.", + "items": { + "properties": { + "id": { + "title": "id", + "description": "The Stellar transaction hash of the transaction that included the refund payment.", + "type": "string" + }, + "id_type": { + "type": "string" + }, + "amount": { + "type": "object", + "description": "The amount sent back for the payment identified by id, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "fee": { + "type": "object", + "description": "The amount charged as a fee for processing the refund, in units of amount_in_asset.", + "properties": { + "amount": { + "title": "amount", + "description": "A numerical representation of an amount of some asset.", + "type": "string" + }, + "asset": { + "title": "asset", + "description": "An asset.", + "type": "string" + } + } + }, + "requested_at": { + "title": "datetime", + "description": "The date and time of requesting refund.", + "type": "string" + }, + "refunded_at": { + "title": "datetime", + "description": "The date and time of making refund.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "examples": [ + { + "name": "request_trustExample", + "description": "Example request to the `request_trust` method.", + "params": [ + { + "name": "transaction_id", + "value": "1c186184-09ee-486c-82a7-aa7a0ab1119d" + }, + { + "name": "message", + "value": "Request trust" + } + ], + "result": { + "name": "AnchorPlatformResponse", + "value": { + "id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", + "sep": "24", + "kind": "deposit", + "status": "completed", + "amount_expected": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_in": { + "amount": "1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "amount_out": { + "amount": "0.9", + "asset": "iso4217:USD" + }, + "amount_fee": { + "amount": "0.1", + "asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" + }, + "started_at": "2023-08-04T10:04:06.280923Z", + "updated_at": "2023-08-04T10:04:15.716233Z", + "message": "Transaction complete", + "source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", + "destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" + } + } + } + ] + } + ], + "components": {} +} diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/README.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/README.mdx new file mode 100644 index 0000000000..af6f303020 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/README.mdx @@ -0,0 +1,41 @@ +--- +title: JSON-RPC Methods +order: 20 +sidebar_label: Methods +--- + +import { EndpointsTable } from "@site/src/components/EndpointsTable"; + +This section lists the Anchor Platform JSON-RPC API methods that should be called by Stellar clients to update status of the transaction. + +The OpenRPC Specification for JSON-RPC API is available [here](https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/stellar/stellar-docs/main/static/assets/rpc-methods/open-rpc.json). + +Postman collection is available [here](https://documenter.getpostman.com/view/9257637/2s9Y5U1kra) + + + +| | | +| --- | --- | +| | [notify_interactive_flow_completed](notify_interactive_flow_completed.mdx) | +| | [request_offchain_funds](request_offchain_funds.mdx) | +| | [request_onchain_funds](request_onchain_funds.mdx) | +| | [notify_offchain_funds_received](notify_offchain_funds_received.mdx) | +| | [notify_onchain_funds_received](notify_onchain_funds_received.mdx) | +| | [notify_amounts_updated](notify_amounts_updated.mdx) | +| | [notify_refund_pending](notify_refund_pending.mdx) | +| | [notify_refund_sent](notify_refund_sent.mdx) | +| | [do_stellar_payment](do_stellar_payment.mdx) | +| | [do_stellar_refund](do_stellar_refund.mdx) | +| | [notify_onchain_funds_sent](notify_onchain_funds_sent.mdx) | +| | [notify_offchain_funds_sent](notify_offchain_funds_sent.mdx) | +| | [notify_offchain_funds_available](notify_offchain_funds_available.mdx) | +| | [notify_offchain_funds_pending](notify_offchain_funds_pending.mdx) | +| | [request_trust](request_trust.mdx) | +| | [notify_trust_set](notify_trust_set.mdx) | +| | [notify_customer_info_updated](notify_customer_info_updated.mdx) | +| | [notify_transaction_error](notify_transaction_error.mdx) | +| | [notify_transaction_expired](notify_transaction_expired.mdx) | +| | [notify_transaction_recovery](notify_transaction_recovery.mdx) | +| | [notify_transaction_on_hold](notify_transaction_on_hold.mdx) | + + diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/do_stellar_payment.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/do_stellar_payment.mdx new file mode 100644 index 0000000000..3f82ad67fb --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/do_stellar_payment.mdx @@ -0,0 +1,13 @@ +--- +title: do_stellar_payment +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "do_stellar_payment")[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/do_stellar_refund.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/do_stellar_refund.mdx new file mode 100644 index 0000000000..6816862774 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/do_stellar_refund.mdx @@ -0,0 +1,13 @@ +--- +title: do_stellar_refund +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "do_stellar_refund")[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_amounts_updated.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_amounts_updated.mdx new file mode 100644 index 0000000000..8daed8f441 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_amounts_updated.mdx @@ -0,0 +1,13 @@ +--- +title: notify_amounts_updated +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_amounts_updated")[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_customer_info_updated.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_customer_info_updated.mdx new file mode 100644 index 0000000000..ffc4795d88 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_customer_info_updated.mdx @@ -0,0 +1,15 @@ +--- +title: notify_customer_info_updated +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_customer_info_updated", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_interactive_flow_completed.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_interactive_flow_completed.mdx new file mode 100644 index 0000000000..55ba759ec8 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_interactive_flow_completed.mdx @@ -0,0 +1,15 @@ +--- +title: notify_interactive_flow_completed +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_interactive_flow_completed", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_offchain_funds_available.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_offchain_funds_available.mdx new file mode 100644 index 0000000000..9bca880e34 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_offchain_funds_available.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_available +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_available", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_offchain_funds_pending.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_offchain_funds_pending.mdx new file mode 100644 index 0000000000..a7573189ca --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_offchain_funds_pending.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_pending +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_pending", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_offchain_funds_received.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_offchain_funds_received.mdx new file mode 100644 index 0000000000..9e19062eeb --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_offchain_funds_received.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_received +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_received", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_offchain_funds_sent.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_offchain_funds_sent.mdx new file mode 100644 index 0000000000..5478e2b595 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_offchain_funds_sent.mdx @@ -0,0 +1,15 @@ +--- +title: notify_offchain_funds_sent +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_offchain_funds_sent", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_onchain_funds_received.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_onchain_funds_received.mdx new file mode 100644 index 0000000000..24ef7eacac --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_onchain_funds_received.mdx @@ -0,0 +1,15 @@ +--- +title: notify_onchain_funds_received +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_onchain_funds_received", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_onchain_funds_sent.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_onchain_funds_sent.mdx new file mode 100644 index 0000000000..1a776c9582 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_onchain_funds_sent.mdx @@ -0,0 +1,15 @@ +--- +title: notify_onchain_funds_sent +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_onchain_funds_sent", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_refund_pending.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_refund_pending.mdx new file mode 100644 index 0000000000..bc24b12291 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_refund_pending.mdx @@ -0,0 +1,13 @@ +--- +title: notify_refund_pending +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_refund_pending")[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_refund_sent.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_refund_sent.mdx new file mode 100644 index 0000000000..fc0255d3fe --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_refund_sent.mdx @@ -0,0 +1,13 @@ +--- +title: notify_refund_sent +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_refund_sent")[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_transaction_error.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_transaction_error.mdx new file mode 100644 index 0000000000..83b48d8f83 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_transaction_error.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_error +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_error", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_transaction_expired.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_transaction_expired.mdx new file mode 100644 index 0000000000..6587a4cf9b --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_transaction_expired.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_expired +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_expired", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_transaction_on_hold.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_transaction_on_hold.mdx new file mode 100644 index 0000000000..bd00841ec1 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_transaction_on_hold.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_on_hold +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_on_hold", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_transaction_recovery.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_transaction_recovery.mdx new file mode 100644 index 0000000000..d134b53937 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_transaction_recovery.mdx @@ -0,0 +1,15 @@ +--- +title: notify_transaction_recovery +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_transaction_recovery", + )[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_trust_set.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_trust_set.mdx new file mode 100644 index 0000000000..5968934e5e --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/notify_trust_set.mdx @@ -0,0 +1,11 @@ +--- +title: notify_trust_set +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "notify_trust_set")[0]} +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/request_offchain_funds.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/request_offchain_funds.mdx new file mode 100644 index 0000000000..7066f66bbb --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/request_offchain_funds.mdx @@ -0,0 +1,13 @@ +--- +title: request_offchain_funds +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_offchain_funds")[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/request_onchain_funds.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/request_onchain_funds.mdx new file mode 100644 index 0000000000..6c14cd105a --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/request_onchain_funds.mdx @@ -0,0 +1,13 @@ +--- +title: request_onchain_funds +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_onchain_funds")[0] + } +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/request_trust.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/request_trust.mdx new file mode 100644 index 0000000000..62a368d0ae --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/methods/request_trust.mdx @@ -0,0 +1,11 @@ +--- +title: request_trust +hide_title: true +--- + +import { RpcMethod } from "@site/src/components/RpcMethod"; +import rpcSpec from "../anchor-platform.openrpc.json"; + + meth.name === "request_trust")[0]} +/> diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/rpc/overview.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/overview.mdx new file mode 100644 index 0000000000..aa544d766e --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/rpc/overview.mdx @@ -0,0 +1,16 @@ +--- +title: Overview +sidebar_position: 10 +--- + +JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. + +It's simple and easy to use, as it uses a single HTTP endpoint and a JSON object that contains the method name and parameters. It is transport agnostic in that the concepts can be used within the same process, over sockets, over http, or in many various message passing environments. It uses [JSON](http://www.json.org/) ([RFC 4627](http://www.ietf.org/rfc/rfc4627.txt)) as data format. + +:::note + +All member names exchanged between the Client and the Server that are considered for matching of any kind should be considered to be case-sensitive. + +::: + +You can read more about JSON-RPC protocol [here](https://www.jsonrpc.org/specification). diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/transactions/README.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/transactions/README.mdx new file mode 100644 index 0000000000..3ee4b6728c --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/transactions/README.mdx @@ -0,0 +1,19 @@ +--- +title: Transactions +sidebar_position: 10 +--- + +import { EndpointsTable } from "@site/src/components/EndpointsTable"; + +Transactions are representations of a SEP transaction. It holds information about the protocol being used, and all necessary information passed by an external party (such as wallet or an anchor). + +Should not be confused with stellar [transactions](/docs/learn/glossary#transaction). + + + +| | | +| --- | -------------------------------------------- | +| GET | [/transactions/:id](get-transaction.api.mdx) | +| GET | [/transactions/](./get-transactions.api.mdx) | + + diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/transactions/get-transaction.api.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/transactions/get-transaction.api.mdx new file mode 100644 index 0000000000..0ec826764d --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/transactions/get-transaction.api.mdx @@ -0,0 +1,3642 @@ +--- +id: get-transaction +title: "Retrieve a Transaction" +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." +sidebar_label: "Retrieve a Transaction" +hide_title: true +hide_table_of_contents: true +api: eJzdlU1v4zYQhv/KYE4toMheJ9iDbmlhFAaK1kjSUxpkaXJscSORDDlyYhj678XQMizvpsF2eyjQkz5mOF9659EeWW0SVvd4F5VLSrP1LuFDga8XiUK23M6XFx+xyNfZ1XBz+UGcfKCo5MjCYIUb4lEULNBQ0tGG/FThMvqtNZSAawLr1j62+Sw40pSSijtY+5itqy5ZRykBezDEFFvrKFsSKybw6/zAp2xgDTm2a0sGVjv4ZM2nAgxpawjsGpTbweDYdolhRcDqiZwk0N6xdR1BiF4KsW7zZfQClDMSALzLNomcrHclFhhUVK0UKdPao5Veg+IaC3SqJazQGiww0nNnIxmsOHZUYNI1tQqrPfIuiFfiaN0G+/5BnFPwLlES+2w6lcv5NEeThrXvnJFSpBVyLN4qhMbqPODJ5yRH9qOU3tHv61zukNyvPpPmszLvD3UnCljgk3X5gRV36XATmcyjYtEBW27ovKjb+fIj9sV3J1Ct7xw/0msgzWQOamLrckePSmsxf2Mhs6t/U8m3ZLj8gP1D3/d9gVdvfa2flIEbeu4o8T/5TF9WHKJsHNuDLihGH98QUCHdvKGr844Pp0cdzfOLYxNX70vOef4O2f1H/fQF0iuTSxluovon2mF1ZFyBW9V09C7rZClb4toPoMt7zzVWOBlxIk321vRZSXF7BEIXG6ywZg6pmkxCo1jQd3FwKelVtaEh5XTtY6l9i5JK8CgtS5DD8C/LaTnFU3fLIQ7c5jhf0fauJjjmgkMusAmUA+uYolMNaN8G78hxCQuGVPuuMULG2icmA9aBghDtVojriF98fMocHDxFAisCpTM0Vw3BOvo243GRUxCXcFfbdExPTq2agf9jwq+JdZ0jd8FIsnPQj8YLXaaz5QTXy0X5p/xkGqvJJZJpDbi9DkrXBLM8r9P0q8nk5eWlVNla+riZDEfT5NfFz/PfbucXs3Ja1tw2WVzBJ26VGwW+IY6WtgQK3vnR7U/78L/95w2ryPTKomjrZEvzqPfDXtzj+MNhgZU1sp0iLrHu9yuV6I/Y9L28fu4o7rC6f5BljFaEkpfH2CT3Bqu1ahK9M+ofbgYY/Ah/V+DwUrndaedRiJ9pYI0wvMCalKE4wsS11hR4dOQryJ3R4Zf5Hfb9X9LROYE= +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/platform/transactions/platform-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + + + + + +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. + + + +
+ +

+ Path Parameters +

+
+
+
    + +
+
+
+
+
+ + +
Transaction found.
+
+ + + + +
+ + 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. +
    + +
    + + + + 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` 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. +
    + + + +
    +
    +
    +
    +
    +
    +
    + + + + + + +
    + + + + 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` 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
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Transaction not found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/transactions/get-transactions.api.mdx b/ap_versioned_docs/version-2.9/api-reference/platform/transactions/get-transactions.api.mdx new file mode 100644 index 0000000000..3bf2323413 --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/transactions/get-transactions.api.mdx @@ -0,0 +1,4275 @@ +--- +id: get-transactions +title: "Retrieve a List of Transactions" +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`." +sidebar_label: "Retrieve a List of Transactions" +hide_title: true +hide_table_of_contents: true +api: eJztWN9P20gQ/ldG+3IgGUMpuoe8cSd6QuJ6qGmfKAobexxvWe+6O+MAjfK/n2btJA4JAVrpKp36ZGc9u/PtN78zU6wnpAZX6mPQjnTGxjtS14m6PyCs45fh2eXB7yqJz+OT7uXtGxHyNQYtW85zNVAT5LVTEpUjZcHU8lMN1Km1/o6APXxtMDyANcTgC+DeJih8gBzJBMxheHaZwsfSEOjaADV17QMT1HpiXFSbgHY5GP6NoPZEZmwR9mQpYOarCl2O+b4orPQtQtVYNrVFCPi1QeIelD4EUYlgNbFoQjAEAXVWYg53JTrgEsE11RiDgEeLFToWGW6CwxzGD1EEXV5741j2U6WtxQBcagd18FOTYw43cvyIzDe8SVWiah10hYxBWJ8pI5RFdCpRTleoBoqwVokS+MKPGnBoMFGUlVhpNZgpfqijGAfjJipR6JpKTCjmi6YTs80f2+XC+9umXjfDGK13E+MmwhGLCcQYap5sB+ZDjmE0lpXn0WQBNWM+0qwSFbUWGEYBMzTTdvlaIBa6sawGffEN6MMaM1MYJCgM2lwI5vWL3BlrYYwQEUbrpPDeMyatLGHmXa7DA5AP0Va93WByMA40Zehy4WKqbYPpZ3eeYto5g6mQWFd167nH4ANUPuA6CENgcnRsMm1FMT4scYna1mlM/gy/LyJXU9YF3jqLsr6DvqhgjZmlr7fMGgLXWJuAtvYxw1zGby09y5tJBCUQcKJDbpFIooW8wG21wd77TxcXQ7g4HX7cTz+7dz4A3uuqtgKhc4tIMFT6AZznyFcHOY98k6/WqRaFJHHuJmAce7jZ5mA3MEaRENQpnAuuZNulvDtYXYwe26xNNF3UFybIdQsvSa416A6mVm7ztM2JNTeEtM3sOgQtooaxom3usG7ny0VybM9c3EcYfAyy50rGZV6swagStXjNYwIqGkmtIntfx1SUKAzBi4vWbayMiNFa3V/Be8bgtO0tNYRhtLQQsQ785NcemIWAdlm5ppRDQ49PEEb9qNLhFmPC8X4U83H3bnWY9M8kqRr9Mzu/WVezJGxkXOFHTZ3rNWRZQ+wrDGufrxPFhq0YahgNMTy7PLVWzTcC852xUgg2S+PK/aMLxJjq/CQ6skTJosAkUMRjYiwQ5Ib02GIOe11WgDGWemp82H/SB5cVapsTGsc4ibws08zx0WaOMd9QYGog4ybig6hDVsbamsLfDcWwrj0ZNlN8OhwilLbuvhDMJpZLqedd7WYPDWEkNfOOjWt8Qx24FKJk5hvHbaog0AxHqZpfi/tT7Z1E5mCmjo+O5LGup9cGQeEbl6cxghyjY5HWdW1NFluYwy8kW2a9G3mH/xSxB+ju5sdfMIu+23lP7/wLQzw8u/w98vZy+eOTV254+0bNr+dzcdWTbVf+Q+fwoe2rXnPXxwDqID0lm5bcNqdspLd5oky+ZXne742uut29oDuLC4tLnOy2m0TS6233k+4zl0zM6CimcHGdW3xQg0UXn6iY8Xd28+LZFXLpu1Y+dqRcqoE6fFQfCMN00aU2waqBKplrGhwe1lZz4UN10IqkXTlv03Sa+SrGj6REua0c0vL+Nj1Kj3rud9mdA8N4zkY9kwZ9oQtaXZLhtJOaH2sMSLXwDh2ncM5ApW9sLomm9CS1W9o6qIOZakZwyHc+3MaC3kl23YbOMuxKZxF8Ffuh86gCuRtNOvXoJLlSlBg3ZJx0POyhQM7KeHJbBKKApGzcGH1k1wQME5xenqefnUqUNRk6QmGrS4OntYwicBz5WrE/ODy8u7tLdfya+jA57LbS4cX5n2fvh2cHx+lRWnLVlpvaE1fa9Q7+gBwMThE0XHSD2a5pbraKiV+D3e7BrotqxnuWCDFOAj6abtaF2JXiR+O3uKmsz2ZjTfgp2PlcltuaKIG3qOZqUGhLuMM6ex+6HLIPr5j0noDdppV2Du1yioqV5OV4/m8z206meoPxD9P1a0b7aTPa8zb+fgP/173+7sheDZ3f66+v7Pd3wunPH9+J58d7/ucRLseSFcZr+RGMgFSDK/nTrUQtfrJqzk6zDGvu7dpoLdd6sr/OPqr5/F+ZpqBM +sidebar_class_name: "get api-method" +info_path: platforms/anchor-platform/api-reference/platform/transactions/platform-server +custom_edit_url: null +hide_send_button: true +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import Heading from "@theme/Heading"; +import OperationTabs from "@theme/OperationTabs"; +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 +

+
+
+
    + + + + + + +
+
+
+
+
+ + +
Transaction found.
+
+ + + + +
+ + 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. +
    + +
    + + + + 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` 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. +
    + + + +
    +
    +
    +
    +
    +
    +
  • +
    + ] +
    +
  • +
    +
    +
    +
    + + +
    + + + + 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` 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
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+ +
Transaction not found.
+
+ + + + +
+ + Schema + +
+
    + + +
+
+
+ + + +
+
+
+
+
+
+
+
diff --git a/ap_versioned_docs/version-2.9/api-reference/platform/transactions/versions.json b/ap_versioned_docs/version-2.9/api-reference/platform/transactions/versions.json new file mode 100644 index 0000000000..92fc50bfcd --- /dev/null +++ b/ap_versioned_docs/version-2.9/api-reference/platform/transactions/versions.json @@ -0,0 +1,12 @@ +[ + { + "version": "3.0.0", + "label": "v3.0.0", + "baseUrl": "/platforms/anchor-platform/next/api-reference/platform/transactions" + }, + { + "version": "2.9.0", + "label": "v2.9.0", + "baseUrl": "/platforms/anchor-platform/api-reference/platform/transactions" + } +] diff --git a/ap_versioned_docs/version-2.9/assets/SEP24-state-diagram.png b/ap_versioned_docs/version-2.9/assets/SEP24-state-diagram.png new file mode 100644 index 0000000000..65d2bb5363 Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/SEP24-state-diagram.png differ diff --git a/ap_versioned_docs/version-2.9/assets/anchor-platform-architecture-1.png b/ap_versioned_docs/version-2.9/assets/anchor-platform-architecture-1.png new file mode 100644 index 0000000000..0917091187 Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/anchor-platform-architecture-1.png differ diff --git a/ap_versioned_docs/version-2.9/assets/anchor-platform-architecture-2.png b/ap_versioned_docs/version-2.9/assets/anchor-platform-architecture-2.png new file mode 100644 index 0000000000..6e2c1e64b5 Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/anchor-platform-architecture-2.png differ diff --git a/ap_versioned_docs/version-2.9/assets/anchor-platform-sep24-demo-wallet-widget.png b/ap_versioned_docs/version-2.9/assets/anchor-platform-sep24-demo-wallet-widget.png new file mode 100644 index 0000000000..b2461d306e Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/anchor-platform-sep24-demo-wallet-widget.png differ diff --git a/ap_versioned_docs/version-2.9/assets/anchor-platform-sep24-demo-wallet.png b/ap_versioned_docs/version-2.9/assets/anchor-platform-sep24-demo-wallet.png new file mode 100644 index 0000000000..169f450fa3 Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/anchor-platform-sep24-demo-wallet.png differ diff --git a/ap_versioned_docs/version-2.9/assets/anchor-platform-sep31-demo-wallet-widget.png b/ap_versioned_docs/version-2.9/assets/anchor-platform-sep31-demo-wallet-widget.png new file mode 100644 index 0000000000..be483f58c9 Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/anchor-platform-sep31-demo-wallet-widget.png differ diff --git a/ap_versioned_docs/version-2.9/assets/sep24-deposit-flow-diagram.png b/ap_versioned_docs/version-2.9/assets/sep24-deposit-flow-diagram.png new file mode 100644 index 0000000000..6a45a3e108 Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/sep24-deposit-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.9/assets/sep24-withdrawal-flow-diagram.png b/ap_versioned_docs/version-2.9/assets/sep24-withdrawal-flow-diagram.png new file mode 100644 index 0000000000..f69ee06dad Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/sep24-withdrawal-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.9/assets/sep31-transition-diagram.png b/ap_versioned_docs/version-2.9/assets/sep31-transition-diagram.png new file mode 100644 index 0000000000..8dae3cd7b0 Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/sep31-transition-diagram.png differ diff --git a/ap_versioned_docs/version-2.9/assets/sep6-deposit-flow-diagram.png b/ap_versioned_docs/version-2.9/assets/sep6-deposit-flow-diagram.png new file mode 100644 index 0000000000..fa947373ae Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/sep6-deposit-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.9/assets/sep6-withdrawal-flow-diagram.png b/ap_versioned_docs/version-2.9/assets/sep6-withdrawal-flow-diagram.png new file mode 100644 index 0000000000..187b871aac Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/sep6-withdrawal-flow-diagram.png differ diff --git a/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep24_deposit_job.png b/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep24_deposit_job.png new file mode 100644 index 0000000000..30b8059f85 Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep24_deposit_job.png differ diff --git a/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep24_deposit_webhook.png b/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep24_deposit_webhook.png new file mode 100644 index 0000000000..630d9173d0 Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep24_deposit_webhook.png differ diff --git a/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep24_withdrawal_job.png b/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep24_withdrawal_job.png new file mode 100644 index 0000000000..a768c5218f Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep24_withdrawal_job.png differ diff --git a/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep24_withdrawal_webhook.png b/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep24_withdrawal_webhook.png new file mode 100644 index 0000000000..4005a81d27 Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep24_withdrawal_webhook.png differ diff --git a/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep31_receive_job.png b/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep31_receive_job.png new file mode 100644 index 0000000000..3150663fe1 Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep31_receive_job.png differ diff --git a/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep31_receive_webhook.png b/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep31_receive_webhook.png new file mode 100644 index 0000000000..7a66bbdcc9 Binary files /dev/null and b/ap_versioned_docs/version-2.9/assets/sequence_diagram_sep31_receive_webhook.png differ diff --git a/ap_versioned_sidebars/version-2.10-sidebars.json b/ap_versioned_sidebars/version-2.10-sidebars.json new file mode 100644 index 0000000000..956f979c6f --- /dev/null +++ b/ap_versioned_sidebars/version-2.10-sidebars.json @@ -0,0 +1,18 @@ +{ + "anchor_platform": [ + { + "type": "category", + "label": "Anchor Platform", + "link": { + "type": "doc", + "id": "README" + }, + "items": [ + { + "type": "autogenerated", + "dirName": "." + } + ] + } + ] +} diff --git a/ap_versioned_sidebars/version-2.11-sidebars.json b/ap_versioned_sidebars/version-2.11-sidebars.json new file mode 100644 index 0000000000..956f979c6f --- /dev/null +++ b/ap_versioned_sidebars/version-2.11-sidebars.json @@ -0,0 +1,18 @@ +{ + "anchor_platform": [ + { + "type": "category", + "label": "Anchor Platform", + "link": { + "type": "doc", + "id": "README" + }, + "items": [ + { + "type": "autogenerated", + "dirName": "." + } + ] + } + ] +} diff --git a/ap_versioned_sidebars/version-2.8-sidebars.json b/ap_versioned_sidebars/version-2.8-sidebars.json new file mode 100644 index 0000000000..956f979c6f --- /dev/null +++ b/ap_versioned_sidebars/version-2.8-sidebars.json @@ -0,0 +1,18 @@ +{ + "anchor_platform": [ + { + "type": "category", + "label": "Anchor Platform", + "link": { + "type": "doc", + "id": "README" + }, + "items": [ + { + "type": "autogenerated", + "dirName": "." + } + ] + } + ] +} diff --git a/ap_versioned_sidebars/version-2.9-sidebars.json b/ap_versioned_sidebars/version-2.9-sidebars.json new file mode 100644 index 0000000000..956f979c6f --- /dev/null +++ b/ap_versioned_sidebars/version-2.9-sidebars.json @@ -0,0 +1,18 @@ +{ + "anchor_platform": [ + { + "type": "category", + "label": "Anchor Platform", + "link": { + "type": "doc", + "id": "README" + }, + "items": [ + { + "type": "autogenerated", + "dirName": "." + } + ] + } + ] +} diff --git a/ap_versions.json b/ap_versions.json new file mode 100644 index 0000000000..0a629630cf --- /dev/null +++ b/ap_versions.json @@ -0,0 +1,6 @@ +[ + "2.11", + "2.10", + "2.9", + "2.8" +] diff --git a/config/anchorPlatform.config.ts b/config/anchorPlatform.config.ts new file mode 100644 index 0000000000..65b9267242 --- /dev/null +++ b/config/anchorPlatform.config.ts @@ -0,0 +1,93 @@ +import type { PluginConfig } from '@docusaurus/types'; +import versions from '../ap_versions.json' +import { makeEditUrl } from './constants'; + +import type * as Plugin from '@docusaurus/types/src/plugin'; +import type * as OpenApiPlugin from 'docusaurus-plugin-openapi-docs'; +import type { APIVersionOptions } from 'docusaurus-plugin-openapi-docs/src/types'; + +const anchorPlatformNextVersion: string = "3.0.0" + +export const anchorPlatformPluginInstances: PluginConfig[] = [ + [ + "docusaurus-plugin-openapi-docs", + { + id: "ap-apis", + docsPluginId: 'ap', + config: { + ap_platform: { + specPath: "openapi/anchor-platform/bundled-platform.yaml", + outputDir: "platforms/anchor-platform/api-reference/platform/transactions", + hideSendButton: true, + template: "src/template.mustache", + version: anchorPlatformNextVersion, + label: `v${anchorPlatformNextVersion}`, + baseUrl: '/platforms/anchor-platform/next/api-reference/platform/transactions', + versions: makeVersions('platform') + } satisfies OpenApiPlugin.Options, + ap_callbacks: { + specPath: "openapi/anchor-platform/bundled-callbacks.yaml", + outputDir: "platforms/anchor-platform/api-reference/callbacks", + hideSendButton: true, + template: "src/template.mustache", + version: anchorPlatformNextVersion, + label: `v${anchorPlatformNextVersion}`, + baseUrl: "/platforms/anchor-platform/next/api-reference/callbacks", + versions: makeVersions('callbacks') + } satisfies OpenApiPlugin.Options, + ap_custody: { + specPath: "openapi/anchor-platform/bundled-custody.yaml", + outputDir: "platforms/anchor-platform/api-reference/custody", + hideSendButton: true, + template: "src/template.mustache", + version: anchorPlatformNextVersion, + label: `v${anchorPlatformNextVersion}`, + baseUrl: "/platforms/anchor-platform/next/api-reference/custody", + versions: makeVersions('custody') + } satisfies OpenApiPlugin.Options, + } satisfies Plugin.PluginOptions, + }, + ], + [ + "@docusaurus/plugin-content-docs", + { + id: "ap", + path: "platforms/anchor-platform", + routeBasePath: "/platforms/anchor-platform", + docItemComponent: "@theme/ApiItem", + sidebarPath: "config/anchorPlatform.sidebar.ts", + editUrl: makeEditUrl, + exclude: ['**/component/**', '**/README.md'], + showLastUpdateTime: true, + showLastUpdateAuthor: true, + }, + ], +]; + +/** + * Dynamically make the versions object for each of the AP servers. + * + * These all follow a nearly identical patterns, so it's a lot of duplicated + * config to individually declare everything in the plugins. This function will + * read the "released" versions from the `ap_versions.json` file and generate + * the correct configuration for each of the versions found in that array. + */ +function makeVersions(server: ('platform'|'callbacks'|'custody')): {[key: string]: APIVersionOptions} { + const baseUrls = { + platform: "/platforms/anchor-platform/api-reference/platform/transactions", + callbacks: "/platforms/anchor-platform/api-reference/callbacks", + custody: "/platforms/anchor-platform/api-reference/custody", + } + + const versionsObject: {[key: string]: APIVersionOptions} = {} + versions.forEach((vString) => { + versionsObject[vString] = { + specPath: `openapi/anchor-platform/versions/${server}-${vString}.yaml`, + outputDir: `ap_versioned_docs/version-${vString}/api-reference/${server === 'platform' ? 'platform/transactions': server}`, + label: `v${vString}`, + baseUrl: baseUrls[server] + } + }) + + return versionsObject +} diff --git a/config/anchorPlatform.sidebar.ts b/config/anchorPlatform.sidebar.ts new file mode 100644 index 0000000000..4efc14e375 --- /dev/null +++ b/config/anchorPlatform.sidebar.ts @@ -0,0 +1,22 @@ +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; + +const sidebars: SidebarsConfig = { + anchor_platform: [ + { + type: 'category', + label: 'Anchor Platform', + link: { + type: 'doc', + id: 'README', + }, + items: [ + { + type: 'autogenerated', + dirName: '.', + } + ], + }, + ], +} + +export default sidebars; diff --git a/config/constants.ts b/config/constants.ts new file mode 100644 index 0000000000..abe2625224 --- /dev/null +++ b/config/constants.ts @@ -0,0 +1,11 @@ +export const DEFAULT_LOCALE: string = 'en'; +export const LOCALE_FULL_CODE: Record = { + es: 'es-ES', +}; + +export const makeEditUrl = ({ locale, versionDocsDirPath, docPath }) => { + if (locale !== DEFAULT_LOCALE) { + return `https://crowdin.com/project/stellar-dev-docs/${LOCALE_FULL_CODE[locale]}` + } + return `https://github.com/stellar/stellar-docs/edit/main/${versionDocsDirPath}/${docPath}` +}; diff --git a/config/disbursementPlatform.config.ts b/config/disbursementPlatform.config.ts new file mode 100644 index 0000000000..6e729bc0d7 --- /dev/null +++ b/config/disbursementPlatform.config.ts @@ -0,0 +1,40 @@ +import { makeEditUrl } from './constants'; + +import type { PluginConfig } from '@docusaurus/types'; +import type * as Plugin from '@docusaurus/types/src/plugin'; +import type * as OpenApiPlugin from 'docusaurus-plugin-openapi-docs'; + +export const disbursementPlatformPluginInstances: PluginConfig[] = [ + [ + "docusaurus-plugin-openapi-docs", + { + id: "sdp-apis", + docsPluginId: 'sdp', + config: { + stellar_disbursement_platform: { + specPath: "openapi/stellar-disbursement-platform/bundled.yaml", + outputDir: "platforms/stellar-disbursement-platform/api-reference", + sidebarOptions: { + groupPathsBy: "tag", + categoryLinkSource: 'tag', + }, + template: "src/template.mustache", + } satisfies OpenApiPlugin.Options, + } satisfies Plugin.PluginOptions, + }, + ], + [ + "@docusaurus/plugin-content-docs", + { + id: "sdp", + path: "platforms/stellar-disbursement-platform", + routeBasePath: "/platforms/stellar-disbursement-platform", + docItemComponent: "@theme/ApiItem", + sidebarPath: "config/disbursementPlatform.sidebar.ts", + editUrl: makeEditUrl, + exclude: ['**/component/**', '**/README.md'], + showLastUpdateTime: true, + showLastUpdateAuthor: true, + }, + ], +]; diff --git a/config/disbursementPlatform.sidebar.ts b/config/disbursementPlatform.sidebar.ts new file mode 100644 index 0000000000..dd4ff2a744 --- /dev/null +++ b/config/disbursementPlatform.sidebar.ts @@ -0,0 +1,46 @@ +import type { SidebarsConfig } from "@docusaurus/plugin-content-docs"; + +import sdpSidebar from '../platforms/stellar-disbursement-platform/api-reference/sidebar' + +const sidebars: SidebarsConfig = { + stellar_disbursement_platform: [ + { + type: "category", + label: "Stellar Disbursement Platform", + link: { + type: 'doc', + id: 'README', + }, + items: [ + 'README', + { + type: 'category', + label: "Admin Guide", + link: { + description: "All you need to know about setting up, running, and using the Anchor Platform.", + type: 'generated-index', + slug: '/admin-guide', + }, + items: [ + { type: "autogenerated", dirName: "admin-guide" } + ] + }, + { + type: 'category', + label: 'API Reference', + collapsed: false, + link: { + description: 'View all Stellar Disbursement Platform API information.', + type: 'generated-index', + slug: '/api-reference', + }, + items: [ + ...sdpSidebar.filter((item) => item.type === 'category'), + ], + }, + ], + }, + ], +}; + +export default sidebars; diff --git a/config/sidebars.ts b/config/sidebars.ts new file mode 100644 index 0000000000..cb74975504 --- /dev/null +++ b/config/sidebars.ts @@ -0,0 +1,92 @@ +import { SidebarsConfig } from "@docusaurus/plugin-content-docs"; + +const sidebars: SidebarsConfig = { + build: [ + { + type: 'autogenerated', + dirName: 'build', + }, + ], + learn: [ + { + type: 'autogenerated', + dirName: 'learn', + }, + ], + tokens: [ + { + type: 'autogenerated', + dirName: 'tokens', + }, + ], + data_overview: [ + 'data/README', + 'data/requirements', + { type: 'html', value: 'Data Availability', defaultStyle: true, className: 'networkMenuHtmlItem'}, + { type: 'ref', id: 'data/rpc/README', label: 'Soroban RPC'}, + { type: 'ref', id: 'data/hubble/README', label: 'Hubble'}, + { type: 'ref', id: 'data/horizon/README', label: 'Horizon'}, + ], + tools: [ + { + type: 'autogenerated', + dirName: 'tools', + }, + { type: 'html', value: 'SDF Platforms', defaultStyle: true, className: 'networkMenuHtmlItem'}, + { type: 'link', href: '/platforms/anchor-platform', label: 'Anchor Platform'}, + { type: 'link', href: '/platforms/stellar-disbursement-platform', label: 'Stellar Disbursement Platform'}, + ], + networks: [ + { + type: 'autogenerated', + dirName: 'networks', + }, + ], + validators: [ + { + type: 'autogenerated', + dirName: 'validators', + }, + ], + horizon: [ + { + type: 'category', + label: 'Horizon', + items: [ + { + type: "autogenerated", + dirName: "data/horizon", + }, + ], + collapsible: false, + }, + ], + hubble: [ + { + type: 'category', + label: 'Hubble', + items: [ + { + type: "autogenerated", + dirName: "data/hubble", + }, + ], + collapsible: false, + }, + ], + soroban_rpc: [ + { + type: "category", + label: "Soroban RPC", + items: [ + { + type: 'autogenerated', + dirName: 'data/rpc', + }, + ], + collapsible: false, + }, + ], +}; + +export default sidebars; diff --git a/crowdin.yaml b/crowdin.yaml new file mode 100644 index 0000000000..f36f4526fe --- /dev/null +++ b/crowdin.yaml @@ -0,0 +1,37 @@ +# Crowdin credentials +project_id: '669532' +api_token_env: CROWDIN_PERSONAL_TOKEN + +# Choose file structure in Crowdin +# e.g. true or false +preserve_hierarchy: true + +# Files configuration +files: + # JSON translation files + - source: /i18n/en/**/* + translation: /i18n/%two_letters_code%/**/%original_file_name% + # Docs Markdown files + - source: /docs/**/* + translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/current/**/%original_file_name% + ignore : ['**/*.api.mdx', '**/*.info.mdx', '**/*.tag.mdx', '**/*.schema.mdx', '**/*.json'] + # Stellar Disbursement Platform Docs Markdown files + - source: /platforms/stellar-disbursement-platform/**/* + translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs-sdp/current/**/%original_file_name% + ignore : ['**/*.api.mdx', '**/*.info.mdx', '**/*.tag.mdx', '**/*.schema.mdx', '**/*.json'] + # Anchor Platform Docs Markdown files + - source: /platforms/anchor-platform/**/* + translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs-ap/current/**/%original_file_name% + ignore : ['**/*.api.mdx', '**/*.info.mdx', '**/*.tag.mdx', '**/*.schema.mdx', '**/*.json'] + # Anchor Platform versioned docs + - source: /ap_versioned_docs/**/* + translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs-ap/**/%original_file_name% + ignore : ['**/*.api.mdx', '**/*.info.mdx', '**/*.tag.mdx', '**/*.schema.mdx', '**/*.json'] + # Meeting Notes Blog Markdown files + - source: /meeting-notes/**/* + translation: /i18n/%two_letters_code%/docusaurus-plugin-content-blog/**/%original_file_name% + # Pages Markdown files + - source: /src/pages/**/* + translation: /i18n/%two_letters_code%/docusaurus-plugin-content-pages/**/%original_file_name% + ignore: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.css'] + type: 'mdx_v2' diff --git a/docs/README.mdx b/docs/README.mdx new file mode 100644 index 0000000000..befea2d477 --- /dev/null +++ b/docs/README.mdx @@ -0,0 +1,35 @@ +--- +title: Stellar Developer Docs +displayed_sidebar: build +hide_table_of_contents: true +--- + +## Navigating the docs + +### [Build](./build/README.mdx) + +Contains tutorials and how-to guides for writing smart contracts, building applications, interacting with the network, and more. + +### [Learn](./learn/fundamentals/README.mdx) + +Find all informational and conceptual content here. Learn about Stellar fundamentals like how accounts and transactions function, dive deeper into the functionality of each operation, discover how fees work, and more. + +### [Tokens](./tokens/README.mdx) + +Information on how to issue assets on the Stellar network and create custom smart contract tokens. + +### [Data](./data/README.mdx) + +Discover various data availability options: RPC, Hubble, and Horizon. + +### [Tools](./tools/README.mdx) + +Learn about all the available tools at your disposal for building on, interacting with, or just watching the Stellar network. Also, find information on how to use the Anchor Platform or Stellar Disbursement Platform. + +### [Networks](./networks/README.mdx) + +Information about deployed networks (Mainnet, Testnet, and Futurenet), current software versions, and resource limitations and fees. + +### [Validators](./validators/README.mdx) + +Everything you'll need to know if you want to run, operate, and maintain a core validator node on the Stellar network. diff --git a/docs/anchoring-assets/_category_.json b/docs/anchoring-assets/_category_.json deleted file mode 100644 index 116958ac7c..0000000000 --- a/docs/anchoring-assets/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "position": 40, - "label": "Anchor Assets", - "link": { - "type": "doc", "id": "index" - } -} \ No newline at end of file diff --git a/docs/anchoring-assets/enabling-cross-border-payments/_category_.json b/docs/anchoring-assets/enabling-cross-border-payments/_category_.json deleted file mode 100644 index e05b3bb192..0000000000 --- a/docs/anchoring-assets/enabling-cross-border-payments/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "position": 20, - "label": "Enable Cross-border Payments", - "link": { - "type": "doc", "id": "index" - } -} \ No newline at end of file diff --git a/docs/anchoring-assets/enabling-cross-border-payments/index.mdx b/docs/anchoring-assets/enabling-cross-border-payments/index.mdx deleted file mode 100644 index 9b78cd88c2..0000000000 --- a/docs/anchoring-assets/enabling-cross-border-payments/index.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Overview -sidebar_position: 10 ---- - -import { Alert } from "@site/src/components/Alert"; - -Supporting cross-border payments of an asset through the Stellar network requires cooperation between a sending anchor (**SA**) and receiving anchor (**RA**). In this section, we'll only go over the steps necessary for building a SEP-31 receiving anchor, but documentation for building a sending anchor is in development. - -Specifically, we will go over the SDF's [Tools and References](./reference-implementations.mdx) as well as all three stages of the development process: - -1. [Setting up a test server](./setting-up-test-server.mdx) -1. [Setting up a production server](./setting-up-production-server.mdx) -1. [Launching](./launch.mdx) - -## The Basic User Experience - -Unlike with SEP-24, SEP-31 involves a sending user (**SU**) and receiving user (**RU**), so both users' experience is described [here](../../anchoring-assets/enabling-cross-border-payments/setting-up-test-server/#stellar-docsearch-form). - - - -Note: **SA**'s are not necessarily wallet applications. This means the **SU** may not interact with a mobile application, but could go to a website or physical remittance location instead. Obviously, this affects the **SU** experience. - - - -Generally, the experience of the SU and RU would look something like this: - -1. The **SU** opens an app, website, or goes to a physical remittance location -1. The **SU** specifies the asset and amount to send, and the asset that should be received -1. The **SA** finds the appropriate **RA** for the asset, authenticates with the **RA**, and parses the **RA**'s requirements for sending payments -1. The **SA** collects both the **SU** and **RU** KYC information requested by the **RA** from the **SU**, as well as the transaction information - - **RU**'s should not have to take any action to receive a cross-border payment - - However, it is possible to require action from the **RU** if absolutely necessary -1. The **SA** registers the **RU** and potentially **SU** with the **RA** via [SEP-12](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md) -1. Once the **RA** is ready to receive the payment, the **SA** makes the Stellar path payment to the **RA** using the **SU** and **RU** assets -1. Once the **RA** receives the path payment, it attempts make the associated off-chain transfer (usually bank transfer) using the KYC and transaction information sent by the **SA** -1. If the transfer to the **RU** fails, the **SU** will be notified by the **SA** to update the invalid or missing fields, and the **RA** will retry once the **SA** sends the updated info. - -The **RU** should then receive the funds sent by the **SA** once the **RA** has the necessary to make the final transfer. - - - -Note: The final off-chain transfer by the **RA** may not be a bank transfer. For example, the destination could be a mobile money account managed by the **RA**. The methods used to transfer the payment off-chain to the **RU** is up to the **RA**, and **SA**s should be aware of the off-chain transfer methods of their partner **RA**s. - - - -## Interoperability and Stellar Ecosystem Proposals - -As mentioned, this section will outline how to implement a [SEP-31](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md) receiver, but these servers require [SEP-1](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md), [10](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md), and [12](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md) to be implemented as well. SEP-1 is described in [this guide](../../issuing-assets/publishing-asset-info.mdx), and SEP-10 & 12 are described [here](../../anchoring-assets/enabling-cross-border-payments/setting-up-test-server.mdx#authentication). diff --git a/docs/anchoring-assets/enabling-cross-border-payments/launch.mdx b/docs/anchoring-assets/enabling-cross-border-payments/launch.mdx deleted file mode 100644 index 2f9cedc572..0000000000 --- a/docs/anchoring-assets/enabling-cross-border-payments/launch.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Launch -sidebar_position: 50 ---- - -Once the testnet and mainnet servers are deployed, KYC collection conforms to regulations, banking rails are integrated, and the whole system is audited, it's time to prepare for launch. - -## Market Making - -It is critical for an anchored asset to have liquid trading markets with XLM and ideally partner **SA** assets. Without a deep orderbook, its impossible to facilitate path payments at rates competivtive with equivalent off-chain fiat assets. - -The SDF maintains a trading bot called [Kelp](https://kelpbot.io/) that supports many trading and market making strategies out of the box, all of which are described in [Kelp's Github Repo](https://github.com/stellar/kelp#kelp). You can use Kelp for free and start automating the order placement process in a matter of minutes. - -Once the order placement is automatic, you should track the health of your token's market with these two parameters: - -- Bid/Ask Amounts: Both sides of the order book should have at least 25k USD -- Spread Size: The average price of the bids and asks should be within 4% of each other. - -The 25k USD value is relative to a new anchor that is still developing its business. Once the volume of traded assets (and the total supply) grows, this value should be increased. - -## Creating an Anchor Website - -A website allows wallets and consumers to find information about your team and your business, get in contact with questions and feedback, and understand how your service works. Your issuing account should link to that website so there's a clear connection between the Stellar asset and the URL. To do that, usee the `set options`, and choose the URL as the home domain. You can find more information about how that process works [in our guide to publishing asset information](../../issuing-assets/publishing-asset-info.mdx). - -Here is a list of requirements to make sure users have a great experience navigating through your website: - -### Branding Visuals - -Users should feel that they are in the company's domain based on the branding of the webpage. The brand universe can include many aspects, such as: company logo or symbol, slogan, colors, fonts, icons, etc... - -### Company Description - -Users want to know who you are and what you do before they'll trust your service or hold your asset. Your website should describe your business, clarify your mission, and outline your vision. Giving more information about your company's executive team, or about your team in general, is a great way to increase users' confidence, and conversions. - -Describing how are you integrated with the Stellar Network (and with which wallets) is also a great way to show users that the system is reliable, and that it conforms to the best protocols and practices of the financial industry. - -Finally, make sure to describe what your asset represents, how it's backed (e.g. it's 1:1 with a fiat reserve), how users can redeem it, and who can use it (anyone, just for retail, etc). - -### Customer Support - -Your webpage is also where users will go to report problems and reach out with questions and feedback. Make sure you clearly describe the process for contacting you, and for reporting bugs, and have a plan in place to offer necessary support.Adding a FAQ section once is a great way to defray support tickets and get information to users faster. - -You should also have a contact email so customers can get in touch, report inconsistencies, and open tickets. Once you get those tickets, you need to answer them in a reasonable amount of time. - -## Connecting to Sending Anchors - -All **RA**s must connect with **SA**s that have transaction volume to send. The SDF works with strategic partners to build and improve these relationships, and the ultimate goal is for there to be an entire ecosystem (or network) of **SA**s and **RA**s globally. - -Stellar.org does not yet host any resources documenting existing SEP-31 anchors, but it is coming. diff --git a/docs/anchoring-assets/enabling-cross-border-payments/reference-implementations.mdx b/docs/anchoring-assets/enabling-cross-border-payments/reference-implementations.mdx deleted file mode 100644 index 005ca0a19e..0000000000 --- a/docs/anchoring-assets/enabling-cross-border-payments/reference-implementations.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Tools and References -sidebar_position: 20 ---- - -These docs walk through the steps necessary to set up and launch both a test server and a production server for SEP-31 cross-border payments, but before you get any deeper, it's worth noting: you don't have to start from scratch. SDF offers some tools that make it easy to implement those servers, and test them from the sending anchor (**SA**) side. - -## Anchor Server Reference Implementation - -To help with server setup, SDF created [Polaris](https://github.com/stellar/django-polaris), an extendable django reusable-app that comes with fully-implemented endpoints, templates, and database models. It's built in Python using the community-supported [Stellar Python SDK](https://github.com/StellarCN/py-stellar-base), and is compliant with the Stellar Ecosystem Protocols mentioned in the previous section. - -TODO: REPLACE PNG ![Screenshots of the reference implementation](/assets/polaris.png) - -Polaris modularizes the parts of the codebase that interface with the Stellar network, and provides clear methods for developers to integrate their own customer registrations, banking connections, and KYC and transcation processing. That means you can focus on implementing the business- and country-related aspects of your product without having to spend much time defining how to connect the server to the Stellar Network. - -If you choose to use Polaris, you can jumpstart your deployment, and connect local rails to Stellar in weeks instead of months. - -## Demo Client & Deployed Example - -Once you have a server set up, SDF also maintains a [Demo Wallet Project](https://demo-wallet.stellar.org/) that makes it easy to test your implementation on both the testnet and the pubnet. - -This allows you to run through your receiving anchor's flow by entering information to a fake wallet application like a real sending user would. - -![Screenshot of the demo client](/assets/demo-wallet-sep31.png) - -With the demo client, you can test your payment flows, and get information about the transactions that are created during those processes. It gives a clear step-by-step visual example of how the functionalities work along with insightful information about the requests, protocols, and possible validation messages. To start testing the deploys, simply update the settings of the Demo Client (click the gear button on the bottom right) to include your project's information. - -## Anchor Validation Suite - -The Anchor Validation Suite is a set of tests that helps confirming if your anchor implementation is compliant with the latest specifications of the SEP-31 standard. This is a great resource for people that are getting started building an anchor and want to check what's still missing in their implementation, or for teams that have already finalized the anchor development and want an extra validation on the codebase. Also, the Anchor Validation Suite doesn't replace the necessity of having a professional security auditor reviewing the whole project. - -TODO: REPLACE PNG ![Screenshot of the Anchor Validation Suite's UI](/assets/anchor-validation-suite.png) - -The Anchor Validation Suite codebase is available in an open-sourced [Github Repository](https://github.com/stellar/transfer-server-validator/), where you can check in details exactly how all tests work. SDF also maintains a [deployed version of the Validation Suite](http://anchor-validator.stellar.org/) with a UI for running the tests without the need to setup your own infrastructure. In order to also test the interactive parts of SEP-24, you'll need to add test values to all the required interactive flow fields. The [Github Repository Readme file](https://github.com/stellar/transfer-server-validator/#providing-field-values) has more information on how exactly those fields need to be added. Finally, you can also trigger the tests directly from a Continuous Integration tool (like CircleCI or Jenkins), in order to have continuous monitoring of your anchor infrastructure. diff --git a/docs/anchoring-assets/enabling-cross-border-payments/setting-up-production-server.mdx b/docs/anchoring-assets/enabling-cross-border-payments/setting-up-production-server.mdx deleted file mode 100644 index 5dce63de5a..0000000000 --- a/docs/anchoring-assets/enabling-cross-border-payments/setting-up-production-server.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: Deploy a Production Version on Mainnet -sidebar_position: 40 ---- - -import { Alert } from "@site/src/components/Alert"; - -Once the test server is live and you have tested the payment flow with a **SA**, it's time to deploy a productionized version of the test server on mainnet. - -The **RA** server code deployed to each environment should be the same, and additional functionality offered in production should be enabled via environment variables. This is called _code parity_, which significantly reduces operational and deployment complexity. It also allows **RA**s to use the Testnet service as a staging environment for debugging or new features and allows the **SA**s to test their client code before integrating with the **RA**'s mainnet service. - -## Deploying a Secure Environment - -Make sure to keep the test server up, and deploy the production (mainnet) system in a separate environment. Having two deployments allows you to validate new features on the testnet before deploying to production. - -To switch to Stellar's public (mainnet) network, all you have to do is change the network [passphrase](../../encyclopedia/network-passphrases.mdx) (for authenticating requests) and the [Horizon URL](https://horizon.stellar.org/). Stellar SDKs have all the built-in logic to switch from test to public with minor changes to the codebase. - -If you're issuing your own asset in addition of offering an on/off ramp, make sure you follow [best practices for asset issuance](../../issuing-assets/how-to-issue-an-asset.mdx) by creating a distribution account that is separate from the issuing account before distributing real assets on the public network. The issuing account secret key should be highly secured via means such as cold storage or multi-signature, and should only be used to send (and, consequently, issue) assets to the distribution account. The distribution account will be used by the **RA** server to receive assets from other accounts programmatically. - -Since the distribution account will be managed programmatically, it should only have a balance necessary to keep operations running for a short period of time. The issuing account should send small amounts of an asset to the distribution account frequently to represent the expected deposit volume for a given period. You should set up the transfer from the issuing account to the distribution account once day (or once a week week) to make sure the distribution account only has the minimum necessary balance to keep the operation functional in that short period. - -## Validating Real KYC - -Most anchors need to collect [Know Your Customer](https://en.wikipedia.org/wiki/Know_your_customer) information to comply with local regulations before honoring payments. In SEP-31, the **SA** controls the UX for the **SU**. Typically, the **SA** will offer an online or in-app UX, but physical remittance locations are also acceptable. Its also important for **SA**s to be able to contact **SU**s when information must be updated or when the transaction succeeded. - -How the **RA** complies with their local regulations by validating KYC information is up the **RA**: there are many services that provide KYC solutions through APIs that validate the input data against governmental databases to verify requirements. Each jurisdiction has specific KYC requirements, and they differ from jurisdiction to jurisdiction, so it's best to find a country-specific KYC provider that meets your needs. Many **RA** organizations can validiate the KYC data collected without using a third-party service. - -Some countries require different KYC fields depending on the payment amount. If that's the case in an **RA**'s jurisdiction, the **RA** needs to expect and support different KYC `type` values in `GET /customer` requests. Only one `type` value can be specified in the `/info` response per-customer, so a different large-payment `type` value will have to be documented and communicated to the **RA**'s partner **SA**s outside the SEP. - -KYC information should be linked to the `id` returned by the `PUT /customer` calls, so you only need to ask the **SU** for it once as long as the data provided is valid. - - - -Note: The SDF encourages anchors to have the same KYC collection process on the Testnet server and Mainnet server. However, _validation_ of KYC data on Testnet is unnecessary and prevents third parties from testing your service. KYC validation should only be supported on Mainnet unless the field uses a well-known format like email addresses. - - - -## Connecting to Real Banking Rails - -Fiat-backed token anchors are expected to manage a full reserve. That means there's a 1:1 relationship between Stellar-network tokens and money in the bank. Since each fiat token on Stellar is backed by, and can be redeemed for, an underlying, real-world asset, anchors of fiat-backed tokens need to connect to real banking rails to make payments to receiving users (generally through bank transfers). This applies to both issuing and non-issuing anchors. - -Once Stellar payment transactions have been detected and matched to an internal transaction record using the memo of the payment, **RA**s must attempt the off-chain payment (typically using a bank transfer). - -Make sure to do a full security audit on your systems when banking rails connections are in place. Some banks provide a testing API that can be used for development and deployment to testnet or staging environments, which means you can test and audit the codebase before moving to a final production-ready bank integration. - -## Testing - -Once your application is fully functional, it's a good idea to test different scenarios and edge cases to make sure the system is behaving as expected. - -The SDF offers an [anchor validation test suite](https://anchor-validator.stellar.org/) and UI for testnet and mainnet testing. SEP-24 and SEP-31 are supported, containing a growing list of tests to assess your service's compliance with the protocol. While the coverage is good, the SDF does not claim that it is complete. - -Below are some tests that the suite does not and will not cover. - -### General Tests - -- Check that the issuing account is set up with the correct home domain, and that the website on that home domain has branding visuals, content about your company, clear language telling users how to report problems, and a method for contacting you to seek support. - -### Security Tests - -- Ensure distribution is done through a dedicated distribution account (not the issuing account) -- Ensure market making is done through a dedicated account (not the issuing account) -- Make sure all authenticated endpoints are not accessible without the JWT token diff --git a/docs/anchoring-assets/enabling-cross-border-payments/setting-up-test-server.mdx b/docs/anchoring-assets/enabling-cross-border-payments/setting-up-test-server.mdx deleted file mode 100644 index bf6e260550..0000000000 --- a/docs/anchoring-assets/enabling-cross-border-payments/setting-up-test-server.mdx +++ /dev/null @@ -1,317 +0,0 @@ ---- -title: Build a SEP-31 Anchor on Testnet -sidebar_position: 30 ---- - -import { CodeExample } from "@site/src/components/CodeExample"; -import { Alert } from "@site/src/components/Alert"; - -Before setting up a server that connects to live banking rails and real money, you should build out a test rig connected to the [Stellar test network](../../fundamentals-and-concepts/testnet-and-pubnet). The testnet works just like the main Stellar network, but it uses test data and allows you to fund test accounts for free using a tool called [Friendbot](../../fundamentals-and-concepts/testnet-and-pubnet#friendbot). - - - -Note: the testnet is reset every three months, so when building on it, make sure you have a plan to recreate necessary accounts and other data. For more info, check out the [best practices for using the testnet](../../fundamentals-and-concepts/testnet-and-pubnet). - - - -At the end of this section, you should have a sandboxed system capable of interfacing with the Stellar testnet that you can easily convert into a production-ready deployment on the main Stellar network. You should always keep a testnet deployment up and running — even once you have a production version — so that wallets can test your implementation without the risk of losing real user funds. - -You can also find an outline of the basic steps anchors need to complete in the [intro to SEP-31](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md#payment-flow) section of the cross-border payment standard. - -## Prerequisites - -Before you start building infrastructure to connect a Stellar-network token to banking rails, you need to: - -1. Issue an asset on the network – which you can find out how to do in the [Issue Assets](../../issuing-assets) section — or find another trustworthy issuer and coordinate with them to broker their asset. -1. Add meta-information about the asset (if you issue one) and define the location of your `DIRECT_PAYMENT_SERVER` in your `stellar.toml` so that wallets know where to find the server and relevant endpoints. You can consult [this guide](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md) for help completing your `stellar.toml`. - -Once you've taken those steps, you're ready to implement an `/info` endpoint. - -## Implementing the `/info` Endpoint - -The `/info` endpoint allows receiving anchors to communicate basic information to sending anchors, exchange interfaces, and other Stellar apps. It responds to client queries with a JSON object detailing which currencies the anchor supports and specifically what pieces of information are required for the sender to collect and provide to the receiver in future requests. - -For example, the SDF's reference server has the following `/info` response: - - - -```json -{ - "receive": { - "SRT": { - "enabled": true, - "min_amount": 10.0, - "max_amount": 10000.0, - "sender_sep12_type": "sep31-sender", - "receiver_sep12_type": "sep31-receiver", - "fee_fixed": 1.0, - "fee_percent": 0.01, - "fields": { - "transaction": { - "routing_number": { - "description": "routing number of the destination bank account" - }, - "account_number": { - "description": "bank account number of the destination" - } - } - } - } - } -} -``` - - - -It has a single `SRT` asset enabled with minimum and maximum amounts and both fixed rate and percetage fees taken from the amount received. If the receiving anchor has a complex fee structure that can't be expressed with the fee attributes from `/info`, sending anchors can support a `/fee` endpoint. Unfortunately, this endpoint is a pending change to the SEP that has not yet been approved. An update will be made when the `/fee` endpoint specification is finalized. - -The `sender_sep12_type` and `receiver_sep12_type` keys signal to the to the **SA** application that [SEP-12](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md) customer registration is required for both the **SU** and **RU**. The values of these attributes are the values the **SA** should include in the `GET /customer?type=` request for each user. In this context, users are synonymous with customers. - -The `fields` object contains the single `transaction` key-value pair, which contains the custom fields the **RA** requires from the **SA**. Typically, these attributes are off-chain rails-related attributes like routing and banking numbers. **SA**s should be aware of their partner **RA**'s `fields.transaction` required attributes and should ideally validate the collected information from the **SU** prior to making the `POST /transaction` API call on the **RA**'s server. - - - -Note: Generally, **RA**s should require the KYC fields of the **SU** and **RU** to be sent via SEP-12 and per-transaction information via SEP-31's `POST /transaction` endpoint in the `forms.transactions` object. Be aware that **SU**s must be able to understand what fields to collect for your service and ideally how to validate. Vauge descriptions or poorly named attributes will cause confusion. - - - -## Authentication - -Stellar Web Authentication ([SEP-10](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md)) is a protocol for verifying that a user controls a Stellar private key for a given account, and for creating a persistent session for that user. It relies on a variation of mutual challenge-response, and uses Stellar transactions to encode challenges and responses: the auth server provides a 'challenge' transaction; the client signs it on behalf of the user and returns it to the anchor; the anchor checks that the signature is valid, and if it is, issues a JWT. - -In the context of SEP-31, the client _and_ key holder is the sending anchor (**SA**). Receiving anchors (**RA**s) should have a list of approved sending anchors and their public keys used in SEP-10 authentication. If an authentication request is made with an unknown Stellar public key address, the receiving anchor should reject the request. - -Once received, the JWT then acts as a reusable key for the **SA** to perform an action on behalf of a **SU**. It can contain an arbitrary amount of information, and is signed by the provider — in this case the asset anchor — to ensure validity. - -### Requesting a Challenge - -To start the authentication flow, the client requests a challenge, which is a Stellar transaction with the sequence number set to 0. A transaction with a sequence number of 0 is, by definition, invalid, so it can't actually be submitted to the network. The issuer can, however, verify that the transaction is signed correctly (which is what happens in the next step). - -The only information needed to request a challenge is the client's public key, passed as the `account` parameter. Here's an example: `GET ?account=GXXXXXX` - -### Exchanging the Signed Challenge - -Once the client signs the challenge transaction on behalf of the user using standard [Stellar SDK tools](../../tools-and-sdks#sdk-library), it sends the signed transaction back to the provider. Using those same Stellar SDKs, the provider then checks to see if the transaction is properly signed, and if it is, offers the client a JWT. - -This JWT should be created with the claims that are appropriate given the account that signed the challenge. It can be created with any existing JWT library. - -Here are the fields included in the JWT: - -- The `sub` key contains the account of the authenticated user -- The `exp` key contains the expiration of the JWT. Some JWTs should be short-lived if the claims inside of it are expected to change, or if the JWT is used in less secure environments -- Other keys can contain any type of claim or data the Anchor wishes. - -Since the `sub` field contains the address of the authenticated user, it's kind of like a username. The JWT authenticates said user. - -Since some tokens are used in less secure environments, such as as query parameters in URLs, you may want to create a short-lived or one-time use token to prevent a JWT from falling into the wrong hands. - -## Customer Registration - -Once you have implemented an `/info` endpoint and set up SEP-10 authentication, your next step is to build out [SEP-12](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md). This SEP is a standard for communicating user KYC information between clients and servers running Stellar services. - -In the context of SEP-31, the **SA** collects the information the **RA** specifies as required in the response to `GET /customer?type=` and makes a `PUT /customer` request containing that information back to the **RA**. - -SEP-12 uses the standardized fields defined in [SEP-9](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0009.md), so **SA**s should be familiar with the descriptions and formats of the fields used by the **RA**. - -On testnet, KYC validation is discouraged in order to lower the barrier for other to test your service. However, if information passed to an **RA** turns out to be invalid after attempting to validate it on mainnet, specific customers (**SU**s or **RU**s) can be placed in a `pending_customer_info_update` status. - -This signals to the **SA** that the fields should be updated by the **SU** and resent. The problematic fields can be identified using the `GET /customer?id=` API call. These fields should be included in the future `PUT /customer` request. - -**RA**s should also respect the `DELETE /customer` requests made by the **SA**. - - - -Note: Ideally, **RA**s validate KYC data passed by **SA**s during the request/response cycle instead of reporting KYC issues via the transaction's status later in the process. - - - -**SA**s should poll the `GET /transactions/:id` endpoint(s) provided by their partner **RA**(s) and ensure the transactions initiated are always carried out to completion by fetching updated info from the **SU** when necessary. - -The two diagram below outline a potential flow between a **SA** and **RA** including all possible SEP-12 states: - -```mermaid -sequenceDiagram - participant SU - participant SA Client - participant RA Server - note right of SA Client: After SEP-10 auth - SA Client->>RA Server: [SEP-31 GET /info] - activate RA Server - RA Server-->>SA Client: sender_sep12_type, receiver_sep12_type - deactivate RA Server - SA Client->>RA Server: [SEP-12 GET /customer?type={sender_sep12_type value}] - activate RA Server - RA Server-->>SA Client: NEEDS_INFO, fields - deactivate RA Server - SA Client->>RA Server: [SEP-12 GET /customer?type={receiver_sep12_type value}] - activate RA Server - RA Server-->>SA Client: NEEDS_INFO, fields - deactivate RA Server - SA Client->>SU: Requests fields returned from [SEP-12 GET]s - activate SU - SU-->>SA Client: Provides field values - deactivate SU - note right of SA Client: Register SU KYC - SA Client->>RA Server: [SEP-12 PUT /customer] - activate RA Server - RA Server-->>SA Client: ID, 202 Accepted - deactivate RA Server - note right of SA Client: Register RU KYC - SA Client->>RA Server: [SEP-12 PUT /customer] - activate RA Server - RA Server-->>SA Client: 400 Bad Request - deactivate RA Server - SA Client->>SU: Requests field(s) returned from [SEP-12 GET receiver] - activate SU - SU-->>SA Client: Provides field values - deactivate SU - note right of SA Client: Retry RU registration - SA Client->>RA Server: [SEP-12 PUT /customer] - activate RA Server - RA Server-->>SA Client: ID, 202 Accepted - deactivate RA Server -``` - -Now that both the **SU** and **RU** are registered with the **RA**, the **SA** must initiate the transaction request with the **RA**. This process is described in the section below. Assuming the **SA** made a successful `POST /transaction` request after collecting the KYC and transaction info, a potential update-flow could look something this: - -```mermaid -sequenceDiagram - participant SU - participant SA Client - participant RA Server - participant RU - note right of RA Server: After [SEP-31 POST /transaction] - RA Server->>RU: [SEP-31 off-chain transfer attempt] - activate RU - RU-->>RA Server: transfer failed due to KYC field X, Y - deactivate RU - note right of SA Client: After failed transfer attempt - SA Client->>RA Server: [SEP-31 GET /transaction/:id] - activate RA Server - RA Server-->>SA Client: receiver pending_customer_info_update - deactivate RA Server - SA Client->>RA Server: [SEP-12 GET /customer?id={receiver ID}] - activate RA Server - RA Server-->>SA Client: NEEDS_INFO, fields - deactivate RA Server - SA Client->>SU: Requests updated field values - activate SU - SU-->>SA Client: Provides updated values - deactivate SU - SA Client->>RA Server: [SEP-12 PUT /customer] - activate RA Server - RA Server-->>SA Client: ID, 202 Accepted - deactivate RA Server - RA Server->>RU: [SEP-31 off-chain transfer retry] - activate RU - RU-->>RA Server: transfer successful! - note right of SA Client: Detect success & notify SU - SA Client->>RA Server: [SEP-31 GET /transactions/:id] - activate RA Server - RA Server-->>SA Client: completed - deactivate RA Server - SA Client->>SU: transfer successful! -``` - -
- - - -Note: It is perfectly acceptable for **RA**s to only require KYC information on the **RU**. To do this, simply omit the `sender_sep12_type` key from the `GET /info` response. This signals to the **SA** to make one `GET` and `PUT` for receiver fields and registration, respectively. - - - -## Transaction Processing - -After registering the receiving and potentially sending user, _but prior to any update flow_, the **SA** must initiate the transaction creation process by making a `POST /transactions` request including the `receiver_id` (and `sender_id`) as well as the `fields.transaction` object containing the per-transaction level fields defined by the **RA** in `/info`. - -On a successful response, the **SA** then makes the path payment on Stellar between the deposited asset from the **SU** to the asset anchored by **RA**. The transaction _must_ contain a memo of type `stellar_memo_type` with a value of `stellar_memo`. These attributes are returned in the **RA**'s `POST /transactions` response. - - - -Note: the payment transaction _can_ be a normal strict-receive payment transaction instead of a path payment. Typically, cross-border payments will involve a cross-currency transaction. - - - -The **RA** should be polling or streaming incoming payment transactions on their Stellar distribution account. Once detected and matched with the transaction record created by the **SA**'s `POST /transactions` request, the **RA** will attempt to transfer the value received off-chain to the associated **RU**. - -The following diagram outlines the process for a successful transaction initiation request and an update flow that differs from the SEP-12 `pending_customer_info_update` process. Most of the time, **SA**s will not have to collect and provide updated transaction information. This is only in the case of data entry error by the **SU**. - - - -Note: If the **SU** and **RU** are already registered, only the per-transaction information defined in the `GET /info` `forms.transaction` object needs to be collected. If SEP-12 registration has not happened or an update is required, it is recommended to collect both KYC and per-transaction field values from the **SU** at the same time. - - -
- -Due to the separate documentation sections outlining the KYC and transaction API calls, we'll ask the **SU** for information a second time for per-transaction attributes. - -```mermaid -sequenceDiagram - participant SU - participant SA Client - participant Horizon - participant RA Server - participant RU - note right of SA Client: After customer registration - SA Client->>RA Server: [SEP-31 GET /info] - activate RA Server - RA Server-->>SA Client: fields.transaction descriptions - deactivate RA Server - SA Client->>SU: Request the transaction fields - activate SU - SU-->>SA Client: Provide transaction fields - deactivate SU - note right of SA Client: Make path payment - SA Client->>Horizon: Stellar path payment including memo - Horizon->>RA Server: Stream and match path payment - RA Server->>RU: Off-chain transfer attempt - activate RU - RU-->RA Server: transfer failed due to TX fields X, Y - deactivate RU - SA Client->>RA Server: [SEP-31 GET /transactions/:id] - activate RA Server - RA Server-->>SA Client: pending_transaction_info_update, required_info_updates - deactivate RA Server - note left of SA Client: recollect required_info_updates fields - SA Client->>SU: Request valid transaction X, Y values - activate SU - SU-->SA Client: Provide valid X, Y - deactivate SU - SA Client->>RA Server: [SEP-31 PATCH /transactions/:id] - activate RA Server - RA Server-->>SA Client: 200 Success - deactivate RA Server - RA Server->>RU: Off-chain transfer retry attempt - activate RU - RU-->>RA Server: transfer success! - deactivate RU - note right of SA Client: Detect and notify SU - SA Client->>RA Server: [GET /transactions/:id] - activate RA Server - RA Server-->SA Client: pending_external - deactivate RA Server - note right of SA Client: After RA rails completion - SA Client->>RA Server: [GET /transactions/:id] - activate RA Server - RA Server-->SA Client: completed - deactivate RA Server - SA Client->>SU: transaction success! -``` - -
- -### Transactions Endpoint - -As demonstrated in the diagram from the previous section, the `/transactions` endpoint provides a way for **SA**s to initiate (`POST`), poll (`GET :id`), and update (`PATCH :id`) transactions with an **RA**. - -Check out the [SEP-31 standard](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md) for the API request and response specifications for the `/transactions` endpoint. - -## Streaming Incoming Path Payments - -Receving anchors (**RA**s) must be able to detect and match incoming Stellar path payment transactions with receiving users. This can be done one of two ways: - -- Polling: this option consists of periodically fetching the transactions submitted _after_ an already-seen transaction's `paging_id` that should be updated after each iteration. -- Streaming: this option consists of maintaining a persistent process that streams incoming transactions from the anchored asset's distribution account, which allows detection and transaction matching in close to real time. - -For more information on path payment transactions, checkout the [operation definition](https://developers.stellar.org/api/resources/operations/object/path-payment-strict-receive/). diff --git a/docs/anchoring-assets/enabling-deposit-and-withdrawal/_category_.json b/docs/anchoring-assets/enabling-deposit-and-withdrawal/_category_.json deleted file mode 100644 index cedf70c2c5..0000000000 --- a/docs/anchoring-assets/enabling-deposit-and-withdrawal/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "position": 30, - "label": "Enable Deposits and Withdrawals", - "link": { - "type": "doc", "id": "index" - } -} \ No newline at end of file diff --git a/docs/anchoring-assets/enabling-deposit-and-withdrawal/index.mdx b/docs/anchoring-assets/enabling-deposit-and-withdrawal/index.mdx deleted file mode 100644 index 86016a80b5..0000000000 --- a/docs/anchoring-assets/enabling-deposit-and-withdrawal/index.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: "SEP-24: Deposits & Withdrawals" -sidebar_position: 10 ---- - -Supporting deposits and withdrawals of an asset on and off the Stellar network requires cooperation between wallet (client) and anchor (server) applications. In this section, we'll only go over the steps necessary for building a SEP-24 server, but we also have documentation for [building a wallet](../../building-apps/index.mdx). - -Specifically, we will go over SDF's [Tools and References](./reference-implementations.mdx) as well as all three stages of the development process: - -1. [Setting up a test server](./setting-up-test-server.mdx) -1. [Setting up a production server](./setting-up-production-server.mdx) -1. [Launching](./launch.mdx) - -## The Basic User Experience - -The complete customer experience from deposit to withdrawal goes something like this: - -1. The customer opens the SEP-24 wallet application of their choice -1. The customer selects an asset to deposit and the wallet finds an anchor (clients could also chose the specific anchor) -1. Once the wallet authenticates with the anchor, the customer begins entering their KYC and transaction information requested by the anchor -1. The wallet provides instructions, and the customer deposits real fiat currency with the anchor (e.g. makes a bank transfer) -1. 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 -1. The customer selects the asset for withdrawal and wallet finds the anchor -1. After authenticating with the anchor, the wallet opens the given interactive URL and allows the customer to enter their transaction information (KYC has already been collected) -1. 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 -1. Once the anchor receives the payment, the customer receives the withdrawn funds via bank transfer. - -## Interoperability and Stellar Ecosystem Proposals - -As already mentioned, this guide will focus on the **Interactive Anchor/Wallet Asset Transfer** SEP (aka [SEP-24](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md)), but SEP-24 requires [SEP-1](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md), which links meta-information to organizations and assets (which we go over in detail with [this guide](../../issuing-assets/publishing-asset-info.mdx)), and [SEP-10](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md), which creates authenticated user session. diff --git a/docs/anchoring-assets/enabling-deposit-and-withdrawal/launch.mdx b/docs/anchoring-assets/enabling-deposit-and-withdrawal/launch.mdx deleted file mode 100644 index 10096333c5..0000000000 --- a/docs/anchoring-assets/enabling-deposit-and-withdrawal/launch.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: Launch -sidebar_position: 50 ---- - -Once the testnet and mainnet servers are deployed, KYC collection conforms to regulations, banking rails are integrated, and the whole system is audited, it's time to prepare for launch. - -## Polishing and Internationalization - -Supporting two languages (English and the fiat currency country language) allows users to have a seamless experience while navigating through screens, and supports international institutions (like wallets) that need to test the product before starting new integrations. - -You can support multiple languages in your webapp by using the `Accept-Language` parameter from the http request headers to localize the content and allowing users to change that in a simple way (e.g. a flag icon on the top bar). If a specific wallet doesn't send the header parameter, we recommend showing the user a language selection screen in the beginning of the deposit and withdraw processes. Once a user chooses a language, you can store their selection so you only need to ask them once. In addition to localizing text, make sure to check number formatting, dates, etc. - -Having a group of beta testers is a great way to check if there are any edge cases that need polishing, and to confirm that the system is working well with a variety of user inputs. You can beta test using a soft launch stage before you start putting effort into marketing and distribution. Documenting the testing process with screenshots and videos is very helpful for future security audits, and gives new partners and potential users clarity and confidence in the product. - -## Market Making - -Once your asset is available for in - app deposit and withdrawal, its order book will start to fill up with user buy and sell orders. To make sure these orders have liquidity — in other words, to make sure people can actually buy and sell your asset if and when they want to—it's essential to have a healthy market with a small spread and a deep set of orders on both sides. - -SDF maintains a trading bot called [Kelp](https://kelpbot.io/) that supports many trading and market making strategies out of the box, all of which are described in [Kelp's Github Repo](https://github.com/stellar/kelp#kelp). You can use Kelp for free and start automating the order placement process in a matter of minutes. - -Once the order placement is automatic, you should track the health of your token's market with these two parameters: - -- Bid/Ask Amounts: Both sides of the order book should have at least 25k USD -- Spread Size: The average price of the bids and asks should be within 4% of each other. - -The 25k USD value is relative to a new anchor that is still developing its business. Once the volume of traded assets (and the total supply) grows, this value should be increased. - -## Creating an Anchor Website - -A website allows wallets and consumers to find information about your team and your business, get in contact with questions and feedback, and understand how your service works. Your issuing account should link to that website so there's a clear connection between the Stellar asset and the URL. To do that, usee the `set options`, and choose the URL as the home domain. You can find more information about how that process works [in our guide to publishing asset information](../../issuing-assets/publishing-asset-info.mdx). - -Here is a list of requirements to make sure users have a great experience navigating through your website: - -### Branding Visuals - -Users should feel that they are in the company's domain based on the branding of the webpage. The brand universe can include many aspects, such as: company logo or symbol, slogan, colors, fonts, icons, etc... - -### Company Description - -Users want to know who you are and what you do before they'll trust your service or hold your asset. Your website should describe your business, clarify your mission, and outline your vision. Giving more information about your company's executive team, or about your team in general, is a great way to increase users' confidence, and conversions. - -Describing how are you integrated with the Stellar Network (and with which wallets) is also a great way to show users that the system is reliable, and that it conforms to the best protocols and practices of the financial industry. - -Finally, make sure to describe what your asset represents, how it's backed (e.g. it's 1:1 with a fiat reserve), how users can redeem it, and who can use it (anyone, just for retail, etc). - -### Customer Support - -Your webpage is also where users will go to report problems and reach out with questions and feedback. Make sure you clearly describe the process for contacting you, and for reporting bugs, and have a plan in place to offer necessary support.Adding a FAQ section once is a great way to defray support tickets and get information to users faster. - -You should also have a contact email so customers can get in touch, report inconsistencies, and open tickets. Once you get those tickets, you need to answer them in a reasonable amount of time. - -## Connecting to Wallets - -All Anchor user interactions are done through a Wallet (or Exchange), so it's vital for Anchors to be connected to Wallets that have a good market penetration in the region where the business is most focused. Connecting to Wallets is a simple process, since both ends of that integration are already compliant with SEPs. - -Stellar.org maintains a [list of wallets](https://www.stellar.org/ecosystem/projects), many of which currently support SEP-24 Sending them a message with more information on an asset and an issuer account is a great way to start getting some real users to the Anchor. diff --git a/docs/anchoring-assets/enabling-deposit-and-withdrawal/reference-implementations.mdx b/docs/anchoring-assets/enabling-deposit-and-withdrawal/reference-implementations.mdx deleted file mode 100644 index d3312aa9b1..0000000000 --- a/docs/anchoring-assets/enabling-deposit-and-withdrawal/reference-implementations.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Tools and References -sidebar_position: 20 ---- - -These docs walk through the steps necessary to set up and launch both a test server and a production server to handle deposits and withdrawals, but before you get any deeper, it's worth noting: you don't have to start from scratch. SDF offers some tools that make it easy to implement those servers, and test them from the client side. - -## Anchor Server Reference Implementation - -To help with server setup, SDF created [Polaris](https://github.com/stellar/django-polaris), an extendable django reusable-app that comes with fully-implemented endpoints, templates, and database models. It's built in Python using the community-supported [Stellar Python SDK](https://github.com/StellarCN/py-stellar-base), and is compliant with the Stellar Ecosystem Protocols mentioned in the previous section. - -![Screenshots of the reference implementation](/assets/polaris.png) - -Polaris modularizes the parts of the codebase that interface with the Stellar network, and provides clear methods for developers to integrate their own deposit and withdrawal forms, KYC process, and banking rails connections. That means you can focus on implementing the business- and country-related aspects of your product without having to spend much time defining how to connect the server to the Stellar Network. - -If you choose to use Polaris, you can jumpstart your deployment, and connect local rails to Stellar in weeks instead of months. - -## Demo Client & Deployed Example - -Once you have a server set up, SDF also maintains a [Demo Wallet Project](https://demo-wallet.stellar.org/) that makes it easy to test your implementation on both the testnet and the pubnet. - -This allows you to run those tests with a UI without needing to set up a new hosting infrastructure for that project. - -![Screenshot of the demo wallet](/assets/demo_wallet_sep24dep.png) - -With the demo client, you can test your deposit and withdraw flows, and get information about the transactions that are created during those processes. It gives a clear step-by-step visual example of how the functionalities work along with insightful information about the requests, protocols, and possible validation messages. To start testing the deploys, simply update the settings of the Demo Client (click the gear button on the bottom right) to include your project's information. - -## Anchor Validation Suite - -The SEP-24 Anchor Validation Suite is a set of tests that helps confirming if your anchor implementation is compliant with the latest specifications of the SEP-24 standard. This is a great resource for people that are getting started building an anchor and want to check what's still missing in their implementation, or for teams that have already finalized the anchor development and want an extra validation on the codebase. Also, the Anchor Validation Suite doesn't replace the necessity of having a professional security auditor reviewing the whole project. - -![Screenshot of the Anchor Validation Suite's UI](/assets/anchor-validation-suite.png) - -The SEP-24 Anchor Validation Suite codebase is available in an open-sourced [Github Repository](https://github.com/stellar/transfer-server-validator/), where you can check in details exactly how all tests work. SDF also maintains a [deployed version of the Validation Suite](http://anchor-validator.stellar.org/) with a UI for running the tests without the need to setup your own infrastructure. In order to also test the interactive parts of SEP-24, you'll need to add test values to all the required interactive flow fields. The [Github Repository Readme file](https://github.com/stellar/transfer-server-validator/#providing-field-values) has more information on how exactly those fields need to be added. Finally, you can also trigger the tests directly from a Continuous Integration tool (like CircleCI or Jenkins), in order to have continuous monitoring of your anchor infrastructure. diff --git a/docs/anchoring-assets/enabling-deposit-and-withdrawal/setting-up-test-server.mdx b/docs/anchoring-assets/enabling-deposit-and-withdrawal/setting-up-test-server.mdx deleted file mode 100644 index ee64d19169..0000000000 --- a/docs/anchoring-assets/enabling-deposit-and-withdrawal/setting-up-test-server.mdx +++ /dev/null @@ -1,246 +0,0 @@ ---- -title: Set Up a Test Server -sidebar_position: 30 ---- - -import { CodeExample } from "@site/src/components/CodeExample"; -import { Alert } from "@site/src/components/Alert"; - -Before setting up a server that connects to live banking rails and real money, you should build out a test rig connected to the [Stellar test network](../../fundamentals-and-concepts/testnet-and-pubnet.mdx). The testnet works just like the main Stellar network, but it uses test data and allows you to fund test accounts for free using a tool called [Friendbot](../../fundamentals-and-concepts/testnet-and-pubnet.mdx#friendbot). - - - -Note: the testnet is reset every three months, so when building on it, make sure you have a plan to recreate necessary accounts and other data. For more info, check out the [best practices for using the testnet](../../fundamentals-and-concepts/testnet-and-pubnet.mdx). - - - -At the end of this section, you should have a sandboxed system capable of interfacing with the Stellar testnet that you can easily convert into a production-ready deployment on the main Stellar network. You should always keep a testnet deployment up and running — even once you have a production version — so that wallets can test your implementation without the risk of losing real user funds. - -You can also find an outline of the basic steps anchors need to complete in the [intro to SEP-24](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#basic-anchor-implementation), the interactive deposit and withdrawal specification. - -## Prerequisites - -Before you start building infrastructure to connect a Stellar-network token to banking rails, you need to: - -1. Issue an asset on the network – which you can find out how to do in the [Issue Assets](../../issuing-assets) section — or find another trustworthy issuer and coordinate with them to broker their asset. -1. Add meta-information about the asset (if you issue one) and define the location of your `TRANSFER_SERVER_SEP0024` in your `stellar.toml` so that wallets know where to find the server and relevant endpoints. You can consult [this guide](../../issuing-assets/publishing-asset-info) for help completing your `stellar.toml`. - -Once you've taken those steps, you're ready to implement an `/info` endpoint. - -## Implementing the `/info` Endpoint - -The `/info` endpoint allows anchors to communicate basic information to wallets, exchange interfaces, and other Stellar apps. It responds to client queries with a JSON object detailing which currencies the anchor supports for deposit and withdrawal, and laying out the fee structure for each currency. - -Generally, anchors structure fees one of two ways: - -- Fixed Fees: a fixed value that is applied to the transactions -- Fee Percent: a percentage of the transaction value - -Since those are both pretty straightforward, the `/info` endpoint can convey those structures directly. If, however, you use a more complicated fee structure, you’ll need to use the `/fee` endpoint, and indicate it’s enabled in the `/info` response. - -Here's an example `/info` response: - - - -```json -{ - "deposit": { - "USD": { - "enabled": true, - "fee_fixed": 5, - "fee_percent": 1, - "min_amount": 0.1, - "max_amount": 1000 - }, - "ETH": { - "enabled": true, - "fee_fixed": 0.002, - "fee_percent": 0 - } - }, - "withdraw": { - "USD": { - "enabled": true, - "authentication_required": true, - "fee_minimum": 5, - "fee_percent": 0.5, - "min_amount": 0.1, - "max_amount": 1000 - }, - "ETH": { - "enabled": false - } - }, - "fee": { - "enabled": false - } -} -``` - - - -You can find the complete parameters for the `/info` endpoint in the Interactive Anchor/Wallet Asset Transfer Server spec (aka [SEP-24](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md)). - -## Authentication - -To provide a simpler experience for wallet users, anchors (aka on/off ramps) can authenticate individuals with their Stellar accounts instead of requiring usernames and passwords. The method for doing that is specified in the Stellar Web Authentication SEP (aka [SEP-10](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md)). - -Stellar Web Authentication is a protocol for verifying that a user controls a Stellar private key for a given account, and for creating a persistent session for that user. It relies on a variation of mutual challenge-response, and uses Stellar transactions to encode challenges and responses: an asset issuer provides a 'challenge' transaction; the client signs it on behalf of the user and returns it to the issuer; the issuer checks that the signature is valid, and if it is, issues a JWT. - -The JWT then acts as a reusable key for a client to perform an action on behalf of a user. It can contain an arbitrary amount of information, and is signed by the provider — in this case the asset issuer — to ensure validity. You can read the full spec [here](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md). - -### Requesting a Challenge - -To start the authentication flow, the client requests a challenge, which is a Stellar transaction with the sequence number set to 0. A transaction with a sequence number of 0 is, by definition, invalid, so it can't actually be submitted to the network. The issuer can, however, verify that the transaction is signed correctly (which is what happens in the next step). - -The only information needed to request a challenge is the client's public key, passed as the `account` parameter. Here's an example: `GET ?account=GXXXXXX` - -### Exchanging the Signed Challenge - -Once the client signs the challenge transaction on behalf of the user using standard [Stellar SDK tools](../../tools-and-sdks.mdx#sdk-library), it sends the signed transaction back to the provider. Using those same Stellar SDKs, the provider then checks to see if the transaction is properly signed, and if it is, offers the client a JWT. - -This JWT should be created with the claims that are appropriate given the account that signed the challenge. It can be created with any existing JWT library. - -Here are the fields included in the JWT: - -- The `sub` key contains the account of the authenticated user -- The `exp` key contains the expiration of the JWT. Some JWTs should be short-lived if the claims inside of it are expected to change, or if the JWT is used in less secure environments -- Other keys can contain any type of claim or data the Anchor wishes. - -Since the `sub` field contains the address of the authenticated user, it's kind of like a username. The JWT authenticates said user. - -Since some tokens are used in less secure environments, such as as query parameters in URLs, you may want to create a short-lived or one-time use token to prevent a JWT from falling into the wrong hands. - -## Deposit Flow - -Once you have implemented an `/info` endpoint and set up for user authentication, your next step is to set up a deposit flow. The deposit flow is the on-ramp to the Stellar Network. In it, a user transfers funds via local rails to a stablecoin issuer in return for a digital version of those funds on the Stellar Network. This section will go through all the steps necessary to implement a working deposit functionality. - -Deposit flows involve a back-and-forth between an issuer's server and a wallet's client that starts with the wallet polling the `/info` endpoint and setting up an authenticated user session as described in the previous sections. The general sequence of deposit events looks like this: - -```mermaid -sequenceDiagram - participant Wallet - participant Anchor - participant Anchor webapp - participant Stellar - note left of Wallet: Initiate Deposit - Wallet->>Anchor: [SEP-24] GET /info - Anchor-->>Wallet: Authentication required! - Wallet-->>Anchor: [SEP-10] GET /auth_challenge - Wallet-->>Anchor: [SEP-10] POST auth_challenge - Anchor-->>Wallet: [SEP-10] auth JWT - Wallet->>Anchor webapp: [SEP-24] Open URL + Callback + JWT - note right of Anchor: Interactive deposit
-----------------------
Choose amount
Collect KYC info
Deposit method - Anchor webapp->>Wallet: Callback (how + URL) - Wallet->>Anchor webapp: [SEP-24] Open more_info_url - note left of Anchor webapp: Show deposit info - Wallet->>Anchor: Deposit (off-chain) - note left of Anchor: Deposit confirmed - Anchor->>Stellar: POST /transaction [Horizon] - Stellar->>Anchor: Transaction result [Horizon] - Stellar->>Wallet: Transaction result -``` - -### The POST `/transactions/deposit/interactive` Endpoint - -To start a new deposit transaction, the wallet POSTs to the `/transactions/deposit/interactive` endpoint and lets the issuer know the user’s Stellar account via the `account` parameter, and what type of asset the user plans to deposit via the `asset_code` parameter. - -Those are the only required fields to initiate a deposit request, so that’s all we’ll cover here. To find out about other optional parameters you should support, check the [complete spec](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#deposit). - -### Initiate Interactive Flow - -In the interactive flow, the anchor’s server responds to the wallet’s POST with the `interactive customer information needed` response detailed [here](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#2-interactive-customer-information-needed). That response is a JSON object containing a URL that the wallet uses to open an issuer-hosted webapp, which is what the issuer uses to collect the information it needs from a user to complete a deposit. The reason this flow relies on an issuer-hosted webapp is that wallets can’t predict what type of information an issuer will need. - -If authentication is required, it should be handled before kicking off the deposit by the server hosting the interactive flow, usually using a one-time-use JWT to start a backend persistent session as described in the [previous section](./#authentication). If you use [Polaris](./reference-implementations.mdx), authentication is handled for you. - -When the flow is finished, the webapp should respond to the callback given by the client. This can be either a javascript `postMessage` call or a call to a wallet-provided URL. In native apps, this URL can have a custom protocol to call back to the opening app. - -### Webapp Interface - -The webapp is an interface that collects any information you need from the user, including KYC requirements and deposit information, such as amount. It doesn’t have to be complicated, but to provide a seamless user experience that aligns with wallets’ expectations, it should follow the UX guidelines described in this [Github repo](https://github.com/stellar/anchor-ux-guidelines). If you’ve already collected information from this user, you can either skip these screens or pre-fill them. - -For testing purposes, it's important that the staging infrastructure allows third parties to complete the flow without a real bank account or phone number, and without transferring any real money. Each screen should be properly internationalized using either an existing customer's preferences or the optional `lang` parameter from the initial `POST /transactions/deposit/interactive` call. - -### More_info_url - -The `more_info_url` is a parameter returned by the `/transactions/deposit/interactive` endpoint that is vital to complete deposits that require a bank transfer. It is automatically opened by wallets once the interactive flow is complete, and should have information on the bank account that the user should send the funds to. - -After the Anchor confirms that the user has sent the transfer, this page can be used to show more information about the transaction. The `more_info_url` is relative to a single transaction, and it's used throughout the endpoints as a way for users to get more data on that specific entry. - -The `more_info_url` should be a standalone page that users can also visit after the interactive flow is complete (not necessarily right after), since it's common for people to only be able to start the actual bank transfer a while after they've started the deposit process in the webapp and wallet interfaces. - -## Transaction(s) Endpoints - -The `/transaction` and `/transactions` endpoints provide a way for wallets to fetch information about a single transaction (to check its status) and about all transactions that belong to a user account (in order to show a historical view of their operations) respectively. - -Wallets poll the `/transaction` endpoint when waiting for a transaction’s status to change. For example, when a user has initiated a withdrawal, the wallet will poll the relevant transaction after sending all the required information to the issuer for processing. Once the transaction is completed on the Stellar network, the transaction’s status will update from “pending_stellar” to “completed.” Through polling, the wallet knows to notify the user of the successful withdrawal. - -Wallets need access to the transactions associated with the user’s account for displaying history or past activity. This can be accomplished with a `/transactions` endpoint. Wallets may also use this endpoint after making a POST request to `/transactions/deposit/interactive` to make sure a transaction was successfully created. - -![Status Diagram of SEP-24 transactions](/assets/SEP24-state-diagram.png) - -### Transactions History Endpoint - -The `/transactions` endpoint should accept a number of parameters for filtering the transactions returned in the response. Refer to the [transaction history section of the SEP](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#transaction-history) for a complete list of parameters and response values. - -It should also be noted that the JSON object representation of a particular transaction should be the same in response to both `/transaction` and `/transactions`. - -### Single Historical Transaction Endpoint - -The `/transaction` endpoint should return a single JSON object representing the specified transaction. Unlike the filtering parameters for `/transactions`, this endpoint should accept the various identifiers for a particular transaction. Again, refer to the [SEP](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#single-historical-transaction) for a complete spec. - -## Withdrawal Flow - -The withdrawal flow is the off-ramp from the Stellar Network. In it, a user makes a payment on the Stellar network to return digital assets to an anchor, and receives the equivalent value as fiat currency from the anchor in their bank account in return. This section will go through all the steps necessary to implement working withdrawal functionality. - -Like deposit flows, withdraw flows involve a back-and-forth between an anchor’s server and a wallet’s client that starts with the wallet polling the `/info` endpoint and setting up an authenticated user session as described in the previous sections. The general sequence of deposit events looks like this: - -```mermaid -sequenceDiagram - participant Wallet - participant Anchor - participant Anchor webapp - participant Stellar - note left of Wallet: Initiate Withdraw - Wallet->>Anchor: [SEP-24] GET /info - Anchor-->>Wallet: Authentication required! - Wallet-->>Anchor: [SEP-10] GET /auth_challenge - Wallet-->>Anchor: [SEP-10] POST auth_challenge - Anchor-->>Wallet: [SEP-10] auth JWT - Wallet->>Anchor webapp: [SEP-24] Open URL + Callback + JWT - note right of Anchor: Interactive withdraw
-----------------------
Choose amount
Collect KYC info
Withdraw method - Anchor webapp->>Wallet: Callback (how + URL) - note left of Wallet: Show withdraw info - Wallet->>Stellar: Withdraw Transaction - note left of Anchor: Withdraw confirmed - Stellar->>Anchor: Transaction result [Horizon] - Stellar->>Wallet: Transaction result -``` - -### `/transactions/withdraw/interactive` Endpoint - -Before initiating a withdrawal, a wallet hits the anchor’s `/info` endpoint and creates an authenticated user session as described in the [previous section](./#authentication). Once that’s done, a wallet makes a POST request to an issuer’s `/transactions/withdraw/interactive` endpoint to start a withdrawal, which creates a new but incomplete transaction record in the issuer’s database. The issuer’s response to the request should contain the transaction’s ID as well as the URL that should be requested to begin the interactive flow. - -The webapp then collects the information necessary to complete the transaction. - -The only required parameter for a withdraw query is `asset_code`, however you will likely want to collect `account` as well. Another notable parameter is `lang`. This parameter can be used on the deposit and info endpoints as well, and should be supported if you intend to serve users who speak different languages. Polaris supports English, Spanish, and Portuguese out of the box. - -For an exhaustive list of the parameters and response values check out the [withdraw section](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#withdraw) of the Interactive Anchor/Wallet Transfer Server SEP. - -### Initiate Interactive Flow - -The response to the wallet’s POST request to the `/transactions/withdraw/interactive` endpoint provides a URL. Since this URL will be requested as if in a browser (via popup or iframe), authentication headers cannot be added. DO NOT include the SEP-10 JWT token in the URL for authentication for the interactive flow, as this is considered insecure. - -[Polaris](./reference-implementations.mdx) gets around this issue by adding a short-lived JWT token to the URL and using session cookies for the remainder of the interactive flow to identify the authenticated user. If you’re not using Polaris, feel free to implement your own authentication mechanisms for the interactive flows, but reference [SEP-24](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#authentication) for guidance. - -### Mocked Interface - -There are a number of UI pages that should be served to the user while walking through the withdraw flow. These pages can be divided into three separate categories or phases. - -- Mocked KYC: When starting a withdrawal, the anchor may be legally obligated to collect specific information from the user. In the testing phase, you don’t need to store this information permanently, but you still need to provide the interface to collect it. There is no restriction on the number of pages used, but often, you can get all you need with a single page. Make sure you understand relevant legal requirements before implementing this phase of the process. -- Withdrawal information: The issuer needs to collect the numerical amount of the asset to transfer. There may be other pieces of data you want to collect as well. Make sure you have all the information necessary to submit a successful transaction to the stellar network. -- Waiting for transfer: Once the issuer has collected all the information needed for a withdrawal, the last page rendered in the interactive flow should make a `postMessage` call to the Wallet, notifying the wallet that it has all the information it needs. - -The wallet then submits the transaction to the Stellar network that sends tokens from the user’s Stellar account to the issuer’s Stellar account, andl begins polling the issuer’s `/transaction` endpoint until the relevant transaction has the expected status. For withdrawals, the expected status is “complete.” - -The issuer should detect that the wallet has submitted a withdrawal transaction by streaming transaction events for the user’s account. Once a matching transaction has been detected, the issuer should mark the transaction as “complete” if it succeeds on the Stellar network, or “error” if there was a problem. diff --git a/docs/anchoring-assets/index.mdx b/docs/anchoring-assets/index.mdx deleted file mode 100644 index 685ed293d4..0000000000 --- a/docs/anchoring-assets/index.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: Overview -sidebar_position: 0 ---- - -_Stellar Anchors_ are the on/off ramps of the Stellar network: they accept deposits of fiat currencies (such as USD, CNY, and BRL) via existing rails (such as bank deposits or cash-in points), and send a user the equivalent digital tokens representing those deposits on the Stellar network. On the flipside, they allow holders to redeem those tokens for the real-world assets they represent. To read more about the kinds of things you can do with digital fiat currency, check out [this explainer](https://www.stellar.org/learn/the-power-of-stellar). - -Stellar Anchors can issue their own assets (in which case, they earn the title _Issuing Anchors_), or they can honor assets that already exist on the network. So if you want to build an on/off ramp for Stellar, you can consult the [Issue Assets](../issuing-assets/index.mdx) section and issue your own token to offer customers _or_ you can find another organization that issues a Stellar-network asset and arrange to broker their token. - -This section covers how anchors can provide services for: - -1. [Deposits & withdrawals on and off Stellar](./enabling-deposit-and-withdrawal/index.mdx) -1. [Cross-border payments through Stellar](./enabling-cross-border-payments/index.mdx) - -This section doesn't cover the basic steps for issuing an asset on the network — you can find those [here](../issuing-assets/index.mdx) — rather, it explains how developers can _connect_ the Stellar Network to their country's banking system and regulatory processes such as [KYC](https://en.wikipedia.org/wiki/Know_your_customer) and [AML](https://en.wikipedia.org/wiki/Money_laundering#Anti-money_laundering). It will walk through the flow, features, and protocol specifications used in each case above, and offer examples and tools to make the process easier to implement and test. - -## Interoperability and Stellar Ecosystem Proposals - -Stellar is a completely open network, and its important that the organizations providing services on Stellar are built in such a way that allow new products to integrate with these existing services quickly. The SDF ensures this is done by defining standards that network participants implement. - -Those standards are specified in Stellar Ecosystem Proposals (SEPs), which are publicly created, open-source documents that live in a [Github repository](https://github.com/stellar/stellar-protocol/tree/master/ecosystem#stellar-ecosystem-proposals-seps). They define how different institutions (such as asset issuers, wallets, exchanges, and service providers) should interact and interoperate. - -There are many use cases covered by the existing SEPs — including regulated assets ([SEP-8](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0008.md)) and federated user identification ([SEP-2](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0002.md)) — and new SEPs are proposed and discussed on Github all the time. We encourage you to participate in those discussions and help build new standards that will make the financial services easier and more accessible. - -## Implementing SEP-24 and/or SEP-31 - -Each of the backend services described in these protocols can be implemented using a three-phase process: - -1. Building the service from the ground up on Stellar's Testnet network -1. Deploying the same service on Stellar's Mainnet network and connecting the anchor's existing off-chain rails -1. Integrating with existing wallets or anchors on Stellar and launching the product - -See the [Enabling Deposits and Withdrawals](./enabling-deposit-and-withdrawal/index.mdx) or [Enabling Cross-Border Payments](./enabling-cross-border-payments/index.mdx) sections for SEP-24 or 31, repectively. diff --git a/docs/build/README.mdx b/docs/build/README.mdx new file mode 100644 index 0000000000..473f1e882f --- /dev/null +++ b/docs/build/README.mdx @@ -0,0 +1,33 @@ +--- +title: Introduction +sidebar_position: 0 +hide_table_of_contents: true +--- + +The Build section is split into three parts: 1) writing smart contracts, 2) building applications, and 3) how-to guides. + +Find explanations on what each section contains below. + +## Smart contracts + +Smart contracts are self-executing programs with the terms of an agreement written directly into the code. They automatically enforce and execute the terms of the contract when predefined conditions are met. Developers must define the rules and logic of the contract while also ensuring security. Once written and tested, smart contracts are deployed to the blockchain, where they become immutable and publicly accessible. + +This section will walk you through how to get set up to write smart contracts on Stellar, plus an introduction to testing, storing data, and deploying your contracts. It also provides an array of example contracts for use. + +## Applications + +Applications interact with the blockchain and can use smart contracts as the backend. They provide user interfaces, manage user interactions, and can integrate with smart contracts to operate. Users can interact with the blockchain using the application interface. Writing smart contracts focuses on the backend logic and rules enforced on the blockchain while building applications involves creating the front end and integrating it with these smart contracts to provide a complete user experience. + +:::note + +You can create applications on Stellar without using smart contracts, as demonstrated in the [Wallet SDK tutorial](./apps/wallet/overview.mdx) or the [JS SDK Payment Application tutorial](./apps/example-application-tutorial/overview.mdx). + +::: + +This section walks you through design considerations for applications and tutorials for building applications with or without smart contracts. + +## How-To Guides + +This section provides step-by-step instructions to help users complete specific tasks associated with developing on Stellar. These tasks can include instructions for aspects of writing contracts, interacting with contracts, building applications, using Stellar operations, setting up infrastructure, and more. + +How-to guides assume that the user has some experience and knowledge with building on Stellar and are not typically for beginners. diff --git a/docs/build/apps/README.mdx b/docs/build/apps/README.mdx new file mode 100644 index 0000000000..552fe5d9c9 --- /dev/null +++ b/docs/build/apps/README.mdx @@ -0,0 +1,10 @@ +--- +title: Build Applications +sidebar_position: 30 +--- + +import DocCardList from "@theme/DocCardList"; + +This section walks you through design considerations for applications and tutorials for building applications with or without smart contracts. + + diff --git a/docs/build/apps/application-design-considerations.mdx b/docs/build/apps/application-design-considerations.mdx new file mode 100644 index 0000000000..2ccedc965a --- /dev/null +++ b/docs/build/apps/application-design-considerations.mdx @@ -0,0 +1,110 @@ +--- +title: Application Design Considerations +sidebar_position: 10 +--- + +## Custody models + +When building an application, one of the first things you have to decide is how your users’ secret keys will be secured and stored. Stellar applications give users access to their accounts that are stored on the ledger, and access to these accounts is controlled by the account’s secret key. That secret key proves that the user has custody or “owns” the account. + +There are four custody options to consider: + +- Non-custodial service - the user of the application stores their own secret key +- Custodial service - the service provider (application) stores the users’ secret keys +- Mixture of both - with the use of [multisig](../../learn/encyclopedia/security/signatures-multisig.mdx), this option is useful for maintaining non-custodial status while still allowing for account recovery +- Third-party key management services - integrate a third-party custodial service into your application that can store your users’ secret keys + +### Non-custodial service + +In a non-custodial service, the user of the application stores the secret key for their account and permissions the application to send requests to delegate transaction signing. There are some potential usability issues as the user has to know how to securely store their own account credentials and safely navigate transaction signing on their end. If they lose their secret key, they will also lose access to their account. + +Typically, non-custodial applications create or import a pre-existing Stellar account for each user. + +### Custodial service + +With a custodial service, the service provider (an application such as a centralized exchange) stores the users’ secret keys and delegates usage rights to the user. + +Many custodial services choose to use a single pooled Stellar account (called shared, omnibus, or [pooled accounts](../../learn/encyclopedia/transactions-specialized/pooled-accounts-muxed-accounts-memos.mdx)) to handle transactions on behalf of their users instead of creating a new Stellar account for each user. To distinguish between individual users in a pooled account, we encourage the implementation of [muxed accounts](../../learn/encyclopedia/transactions-specialized/pooled-accounts-muxed-accounts-memos.mdx#muxed-accounts). + +### A mixture of non-custodial and custodial + +Building an application with [multi-signature](../../learn/encyclopedia/security/signatures-multisig.mdx) capabilities allows you to have a non-custodial service with account recovery. If the user loses their secret key, they can still sign transactions with other authorized signatures, granted the signature threshold is high enough. + +### Third-party key management services​ + +There are several apps and services that specialize in adding additional security layers to users' accounts. Check them out if you're interested in integrating a third-party key management service: + +- [StellarAuth](https://stellarauth.com/) +- [Ledger](https://www.ledger.com/) +- [Trezor](https://trezor.io/) +- [StellarGuard](https://stellarguard.me/) +- [LobstrVault](https://vault.lobstr.co/) + +## Application security + +Even though wallets can operate client-side, they deal with a user’s secret keys, which give direct access to their account, and to any value they hold. That’s why it’s essential to require all web traffic to flow over strong TLS methods. Even when developing locally, use a non-signed localhost certificate to develop secure habits from the very beginning. Stellar is a powerful money-moving software — don’t skimp on security. + +For more information, check out our guide to [securing web-based products](https://www.stellar.org/developers/guides/walkthroughs/securing-web-projects.html). + +## Wallet services + +A wallet typically has these basic functions: key storage, account creation, transaction signing, and queries to the Stellar database. There are some services that take care of all of these functions for you, so you can build whatever you’d like around it. Check out some of these wallet services below. + +- [Albedo](https://albedo.link/) +- [Freighter](https://www.freighter.app/) + +## Account creation strategies + +In this section, we will go over the new user account creation flow between non-custodial wallets and anchors with SEP-24 and/or SEP-6 implementations. A Stellar account is created with a keypair (a public key and private key) and the minimum balance of XLM. + +When a new customer downloads the wallet application and goes through the deposit flow for the first time, their Stellar account can be created by either the user’s wallet application or the anchor facilitating the first deposit. This section describes each of these strategies. + +### Option 1: The anchor creates and funds the Stellar account​ + +For this option, the wallet needs to allow users to initiate their first deposit without having to add an asset/establish a trustline. The wallet then prompts the user to add the trustline once funds are received by the anchor. The flow looks like this: + +1. The wallet registers a new user and issues a keypair. +2. The wallet initiates the first deposit on behalf of the user without requiring the user to add the asset/create the trustline. +3. The anchor provides deposit instructions to the customer. +4. The user transfers money from a bank account to the anchor’s bank account. +5. Once the anchor receives the transfer, the anchor creates and funds the Stellar account for the customer. +6. The wallet detects that the account has been created and a trustline must be established. +7. The wallet prompts the user to add the asset/create the trustline. +8. Finally, the anchor sends the deposit funds to the user’s Stellar account. + +:::info + +An anchor should always maintain a healthy amount of XLM in its distribution account to support new account creations. If doing so becomes unsustainable, it’s recommended that the anchor collaborates with wallets to determine a strategy based on the number of account creation requests. The recommended amount is 2XLM per user account creation (1XLM to meet the minimum balance requirement, and 1XLM for establishing trustlines and covering transaction fees). + +::: + +With the flow described above, the wallet and the anchor have to facilitate listening for and responding to the trustline status, which can create user experience frictions when waiting for the trustline to be established. To address this issue, Protocol 15 introduced claimable balances, which enhance the flow by allowing users to start using the wallet without having to secure XLM. Both the wallet and the anchor have to implement claimable balance support in order to make this flow work. + +The flow with Claimable Balances looks like this: + +1. The wallet registers a new user, and generates a keypair. +2. The wallet initiates a deposit on behalf of a user. +3. The anchor provides deposit instructions to the wallet. +4. The user transfers money from a bank account to the anchor’s account. +5. The anchor creates and funds the user's Stellar account plus the amount required for trustlines and transaction fees. Again, we suggest 2 XLM to start. +6. The anchor creates a Claimable Balance. +7. The wallet detects the Claimable Balance for the account, claims the funds, and posts it in the wallet. + +### Option 2: the wallet creates and funds the Stellar account upon user sign-up​ + +For this option, the wallet creates and funds the Stellar account upon every new user sign-up with the minimum requirement of 1XLM, plus the .5XLM reserve for establishing the first trustline, plus a bit more to cover transaction fees. For more information on minimum balances, check out the [Lumens section](../../learn/fundamentals/lumens.mdx#minimum-balance). + +The flow looks like this: + +1. Upon a new user signup, the wallet issues a keypair, then creates and funds the user's Stellar account with 2XLM. +2. Then the wallet creates a trustline, and initiates the first deposit. +3. Once the deposit request is sent to the anchor, the anchor provides instructions for the deposit. +4. The customer transfer funds from a personal bank account to the anchor’s account. +5. The anchor receives the funds, then sends them to the user’s Stellar account. +6. The wallet detects that funds were sent and notifies the user. + +:::note + +In the examples above, we suggest having the anchor or wallet cover minimum balance and trustline XLM requirements by depositing funds directly into a user's account. We made that suggestion for the sake of simplicity, but in all cases, the anchor or wallet could instead use sponsored reserves to ensure that when a user closes a trustline or merges their account, the reserve reverts to the sponsoring account rather than to the user's account. + +::: diff --git a/docs/build/apps/dapp-frontend.mdx b/docs/build/apps/dapp-frontend.mdx new file mode 100644 index 0000000000..4479adbbba --- /dev/null +++ b/docs/build/apps/dapp-frontend.mdx @@ -0,0 +1,499 @@ +--- +sidebar_position: 70 +title: Build a Dapp Frontend +description: Make a frontend web app that interacts with your smart contracts. +pagination_prev: build/smart-contracts/getting-started/deploy-increment-contract +--- + +This is a continuation of the [Getting Started tutorial](../smart-contracts/getting-started/README.mdx), where you should have deployed two smart contracts to the public network. In this section, we'll create a web app that interacts with the contracts via RPC calls. + +Let's get started. + +## Initialize a frontend toolchain + +You can build a Soroban app with any frontend toolchain or integrate it into any existing full-stack app. For this tutorial, we're going to use [Astro](https://astro.build/). Astro works with React, Vue, Svelte, any other UI library, or no UI library at all. In this tutorial, we're not using a UI library. The Soroban-specific parts of this tutorial will be similar no matter what frontend toolchain you use. + +If you're new to frontend, don't worry. We won't go too deep. But it will be useful for you to see and experience the frontend development process used by Soroban apps. We'll cover the relevant bits of JavaScript and Astro, but teaching all of frontend development and Astro is beyond the scope of this tutorial. + +Let's get started. + +You're going to need [Node.js](https://nodejs.org/en/download/package-manager/) v18.14.1 or greater. If you haven't yet, install it now. + +We want to initialize our current project as an Astro project. To do this, we can again turn to the `stellar contract init` command, which has a `--frontend-template` flag that allows us to pass the url of a frontend template repository. As we learned in [Storing Data](../smart-contracts/getting-started/storing-data.mdx#adding-the-increment-contract), `stellar contract init` will not overwrite existing files, and is safe to use to add to an existing project. + +From our `soroban-hello-world` directory, run the following command to add the Astro template files. + +```sh +stellar contract init ./ \ + --frontend-template https://github.com/stellar/soroban-astro-template +``` + +This will add the following to your project, which we'll go over in more detail below. + +```bash +├── CONTRIBUTING.md +├── initialize.js +├── package-lock.json +├── package.json +├── packages +├── public +│   └── favicon.svg +├── src +│   ├── components +│   │   └── Card.astro +│   ├── env.d.ts +│   ├── layouts +│   │   └── Layout.astro +│   └── pages +│   └── index.astro +└── tsconfig.json +``` + +## Generate an NPM package for the Hello World contract + +Before we open the new frontend files, let's generate an NPM package for the Hello World contract. This is our suggested way to interact with contracts from frontends. These generated libraries work with any JavaScript project (not a specific UI like React), and make it easy to work with some of the trickiest bits of Soroban, like encoding [XDR](../../learn/encyclopedia/contract-development/types/fully-typed-contracts.mdx). + +This is going to use the CLI command `stellar contract bindings typescript`: + +```bash +stellar contract bindings typescript \ + --network testnet \ + --contract-id $(cat .stellar/contract-ids/hello_world.txt) \ + --output-dir packages/hello_world +``` + +This project is set up as an NPM Workspace, and so the `hello_world` client library was generated in the `packages` directory at `packages/hello_world`. + +We attempt to keep the code in these generated libraries readable, so go ahead and look around. Open up the new `packages/hello_world` directory in your editor. If you've built or contributed to Node projects, it will all look familiar. You'll see a `package.json` file, a `src` directory, a `tsconfig.json`, and even a README. + +## Generate an NPM package for the Increment contract + +Though we can run `soroban contract bindings typescript` for each of our contracts individually, the [soroban-template-astro](https://github.com/stellar/soroban-astro-template) that we used as our template includes a very handy `initialize.js` script that will handle this for all of the contracts in our `contracts` directory. + +In addition to generating the NPM packages, `initialize.js` will also: + +- Generate and fund our Stellar account +- Build all of the contracts in the `contracts` dir +- Deploy our contracts +- Create handy contract clients for each contract + +We have already taken care of the first three bullet points in earlier steps of this tutorial, so those tasks will be noops when we run `initialize.js`. + +### Configure initialize.js + +We need to make sure that `initialize.js` has all of the environment variables it needs before we do anything else. Copy the `.env.example` file over to `.env`. The environment variables set in `.env` are used by the `initialize.js` script. + +```bash +cp .env.example .env +``` + +Let's take a look at the contents of the `.env` file: + +``` +# Prefix with "PUBLIC_" to make available in Astro frontend files +PUBLIC_SOROBAN_NETWORK_PASSPHRASE="Standalone Network ; February 2017" +PUBLIC_SOROBAN_RPC_URL="http://localhost:8000/soroban/rpc" + +SOROBAN_ACCOUNT="me" +SOROBAN_NETWORK="standalone" + +# env vars that begin with PUBLIC_ will be available to the client +PUBLIC_SOROBAN_RPC_URL=$SOROBAN_RPC_URL +``` + +This `.env` file defaults to connecting to a locally running network, but we want to configure our project to communicate with Testnet, since that is where we deployed our contracts. To do that, let's update the `.env` file to look like this: + +```diff +# Prefix with "PUBLIC_" to make available in Astro frontend files +-PUBLIC_SOROBAN_NETWORK_PASSPHRASE="Standalone Network ; February 2017" ++PUBLIC_SOROBAN_NETWORK_PASSPHRASE="Test SDF Network ; September 2015" +-PUBLIC_SOROBAN_RPC_URL="http://localhost:8000/soroban/rpc" ++PUBLIC_SOROBAN_RPC_URL="https://soroban-testnet.stellar.org:443" + +-SOROBAN_ACCOUNT="me" ++SOROBAN_ACCOUNT="alice" +-SOROBAN_NETWORK="standalone" ++SOROBAN_NETWORK="testnet" +``` + +:::info + +This `.env` file is used in the `initialize.js` script. When using the CLI, we can still use the network configuration we set up in the [Setup](../smart-contracts/getting-started/setup.mdx) step, or by passing the `--rpc-url` and `--network-passphrase` flags. + +::: + +### Run `initialize.js` + +First let's install the Javascript dependencies: + +```bash +npm install +``` + +And then let's run `initialize.js`: + +```bash +npm run init +``` + +As mentioned above, this script attempts to build and deploy our contracts, which we have already done. The script is smart enough to check if a step has already been taken care of, and is a no-op in that case, so it is safe to run more than once. + +### Call the contract from the frontend + +Now let's open up `src/pages/index.astro` and take a look at how the frontend code integrates with the NPM package we created for our contracts. + +Here we can see that we're importing our generated `helloWorld` client from `../contracts/hello_world`. We're then invoking the `hello` method and adding the result to the page. + +```ts title="src/pages/index.astro" +--- +import Layout from "../layouts/Layout.astro"; +import Card from "../components/Card.astro"; +import helloWorld from "../contracts/hello_world"; +const { result } = await helloWorld.hello({ to: "you" }); +const greeting = result.join(" "); +--- + + ... + +

{greeting}

+``` + +Let's see it in action! Start the dev server: + +```bash +npm run dev +``` + +And open [localhost:4321](http://localhost:4321) in your browser. You should see the greeting from the contract! + +You can try updating the `{ to: 'Soroban' }` argument. When you save the file, the page will automatically update. + +:::info + +When you start up the dev server with `npm run dev`, you will see similar output in your terminal as when you ran `npm run init`. This is because the `dev` script in package.json is set up to run `npm run init` and `astro dev`, so that you can ensure that your deployed contract and your generated NPM pacakage are always in sync. If you want to just start the dev server without the initialize.js script, you can run `npm run astro dev`. + +::: + +### What's happening here? + +If you inspect the page (right-click, inspect) and refresh, you'll see a couple interesting things: + +- The "Network" tab shows that there are no Fetch/XHR requests made. But RPC calls happen via Fetch/XHR! So how is the frontend calling the contract? +- There's no JavaScript on the page. But we just wrote some JavaScript! How is it working? + +This is part of Astro's philosophy: the frontend should ship with as few assets as possible. Preferably zero JavaScript. When you put JavaScript in the [frontmatter](https://docs.astro.build/en/core-concepts/astro-components/), Astro will run it at build time, and then replace anything in the `{...}` curly brackets with the output. + +When using the development server with `npm run dev`, it runs the frontmatter code on the server, and injects the resulting values into the page on the client. + +You can try building to see this more dramatically: + +```bash +npm run build +``` + +Then check the `dist` folder. You'll see that it built an HTML and CSS file, but no JavaScript. And if you look at the HTML file, you'll see a static "Hello Soroban" in the `

`. + +During the build, Astro made a single call to your contract, then injected the static result into the page. This is great for contract methods that don't change, but probably won't work for most contract methods. Let's integrate with the `incrementor` contract to see how to handle interactive methods in Astro. --> + +## Call the incrementor contract from the frontend + +While `hello` is a simple view-only/read method, `increment` changes on-chain state. This means that someone needs to sign the transaction. So we'll need to add transaction-signing capabilities to the frontend. + +The way signing works in a browser is with a _wallet_. Wallets can be web apps, browser extensions, standalone apps, or even separate hardware devices. + +### Install Freighter Extension + +Right now, the wallet that best supports Soroban is [Freighter](../guides/freighter/README.mdx). It is available as a Firefox Add-on, as well as extensions for Chrome and Brave. Go ahead and [install it now](https://freighter.app). + +Once it's installed, open it up by clicking the extension icon. If this is your first time using Freighter, you will need to create a new wallet. Go through the prompts to create a password and save your recovery passphrase. + +Go to Settings (the gear icon) → Preferences and toggle the switch to Enable Experimental Mode. Then go back to its home screen and select "Test Net" from the top-right dropdown. Finally, if it shows the message that your Stellar address is not funded, go ahead and click the "Fund with Friendbot" button. + +Now you're all set up to use Freighter as a user, and you can add it to your app. + +### Add the StellarWalletsKit and set it up + +Even though we're using Freighter to test our app, there are more wallets that support signing smart contract transactions. To make their integration easier, we are using the `StellarWalletsKit` library which allows us support all Stellar Wallets with a single library. + +To install this kit we are going to include the next package: + +```shell +npm install @creit.tech/stellar-wallets-kit +``` + +With the package installed, we are going to create a new simple file where our instantiated kit and simple state will be located. Create the file `src/stellar-wallets-kit.ts` and paste this: + +```ts title="src/stellar-wallets-kit.ts" +import { + allowAllModules, + FREIGHTER_ID, + StellarWalletsKit, + WalletNetwork, +} from "@creit.tech/stellar-wallets-kit"; + +const kit: StellarWalletsKit = new StellarWalletsKit({ + modules: allowAllModules(), + network: WalletNetwork.TESTNET, + selectedWalletId: FREIGHTER_ID, +}); + +const connectionState: { publicKey: string | undefined } = { + publicKey: undefined, +}; + +function loadedPublicKey(): string | undefined { + return connectionState.publicKey; +} + +function setPublicKey(data: string): void { + connectionState.publicKey = data; +} + +export { kit, loadedPublicKey, setPublicKey }; +``` + +In the code above, we created an instance of the kit and two simple functions that will take care of "setting" and "loading" the public key of the user. This lets us use the user's public key elsewhere in our code. The kit is started with Freighter as the default wallet, and the Testnet network as the default network. You can learn more about how the kit works in [the StellarWalletsKit documentation](https://stellarwalletskit.dev/) + +Now we're going to add a "Connect" button to the page which will open the kit's built in modal, and prompt the user to use their preferred wallet. Once the user picks their preferred wallet and grants permission to accept requests from the website, we will fetch the public key and the "Connect" button will be replaced with a message saying, "Signed in as [their public key]". + +Now let's add a new component to the `src/components` directory called `ConnectWallet.astro` with the following content: + +```html title="src/components/ConnectWallet.astro" +
+
+ +
+
+ + + + +``` + +Some of this may look surprising. `