Giter Club home page Giter Club logo

java-stellar-anchor-sdk's Introduction

License GitHub Version Docker Develop Branch

Stellar
Creating equitable access to the global financial system

Stellar Anchor Platform

The Anchor Platform is the easiest and fastest way to deploy a SEP-compatible anchor service.

It implements the majority of standardized API (SEP) endpoints that wallets, exchanges, and other applications use, and provides a set of backend HTTPS APIs & callbacks for the anchor to integrate with for specifying fees, exchange rates, and off-chain transaction status updates.

The goal of the Anchor Platform is to abstract all Stellar-specific functionality and requirements for running an anchor, allowing businesses to focus on the core business logic necessary to provide these services.

Getting Started

To get started, visit the Anchor Platform documentation. Release notes can be found on the project's releases page.

Contributing

Please refer to our How to contribute guide for more information on how to contribute to this project.

Directory Layout

  • docs: Contains the documentation for the Anchor Platform.
  • api_schema: Contains the Java classes and interfaces that represent the API schema.
  • core: Contains the core Anchor Platform implementation. Most of the SEP business logics are implemented here. No infrastructures, such as database, configuration, queue, or logging implementations are assumed in this sub-project.
  • platform: Contains the Anchor Platform implementation that uses Spring Boot as the underlying framework. This sub-project is responsible for providing the infrastructure implementations, such as database, configuration, queue, and logging. The sep-server, platform-server, custody-server, event-processor and stellar-observer services are also implemented here.
  • kotlin_reference_server: Contains the anchor's reference server implementation in Kotlin.
  • wallet_reference_server: Contains the wallet's reference server implementation in Kotlin.
  • service_runner: Contains the service runner implementation that runs services, such as SEP, platform, payment observer, and reference servers, etc. It also contains the main entry point of the Anchor Platform.
  • essential-tests: Contains the essential integration tests and end-2-end tests for the Anchor Platform.
  • extended-tests: Contains the extended integration tests and end-2-end tests for the Anchor Platform.

Quickstart

Anchor Platform can be run locally using Docker Compose. This will start an instance of the Anchor Platform and the Kotlin reference server.

docker build --build-arg BASE_IMAGE=gradle:7.6.4-jdk17 -t anchor-platform:local ./
docker compose -f service-runner/src/main/resources/docker-compose.yaml up -d

The Stellar Demo Wallet can be used to interact with the Anchor Platform. To get started, create and fund a new account, then add a new asset with the following parameters.

Parameter Value
Asset Code USDC
Anchor Home Domain localhost:8080
Issuer Public Key GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP

Now you can deposit and withdraw USDC using the Stellar Demo Wallet.

References

SEP-1: Stellar Info File

SEP-6: Deposit and Withdrawal API

SEP-10: Stellar Web Authentication

SEP-12: KYC API

SEP-24: Hosted Deposit and Withdrawal

SEP-31: Cross-Border Payments API

SEP-38: Anchor RFQ API

java-stellar-anchor-sdk's People

Contributors

dependabot[bot] avatar erika-sdf avatar ifropc avatar jakeurban avatar jiahuiwho avatar kanwalpreetd avatar leighmcculloch avatar lijamie98 avatar marcelosalloum avatar mazurakihor avatar paulormnas avatar philipliu avatar reecexlm avatar rkharevych avatar satyamz avatar stellar-terraform avatar stfung77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-stellar-anchor-sdk's Issues

paymentservice.circle: handle unexpected response body

What problem does your feature solve?

When a call to the Circle API returns an unexpected response body with an ok status code, it's treated as a successful API call.

What would you like to see?

Unexpected response bodies should be detected and handled as an internal error.

What alternatives are there?

N/A

Cc @JakeUrban

Implement payments gateway interface for the Circle API

  • Implement ping() method.
  • Implement getDistributionAccountAddress() method.
  • Implement getAccount(String accountId) method.
  • Implement createAccount(String accountId) method.
  • #40
    • Payment history for CircleWallet->CircleWallet transfers.
    • Payment history for CircleWallet->Stellar transfers.
    • Payment history for Stellar->CircleWallet transfers.
    • Payment history for CircleWallet->BankWire transfers.
    • #87
    • Pagination
  • Implement sendPayment(Account sourceAccount, Account destinationAccount, String currencyName, BigDecimal amount) method.
  • #57
    • Instructions to receive CircleWallet<-CircleWallet deposits.
    • Instructions to receive CircleWallet<-Stellar deposits.
    • Instructions to receive CircleWallet<-BankWire deposits.
  • Polishes
  • #65

EPIC: Events

Implement writing of Events to a queue (Kafka/SQS) in the anchor platform
Implement reading of Events from a queue (Kafka/SQS) in the anchor reference server
Deploy single instance Kafka in SDF K8s env for the anchor platform to utilize

GanttStart: 2022-02-22
GanttDue: 2022-03-12

Improve assertThrows in unit tests

From @marcelosalloum :
FYI: assertThrows will return an instance of the thrown exception that you could use to verify the exception values, like in:

val thrown = assertThrows<HttpException> { request.block() }
assertEquals(HttpException(400, "Request body contains unprocessable entity.", "2"), thrown)
Also, assertEquals only works if the Exception implements the .equals(Object) method, which can be generated by @lombok.Data.

@lijamie98 would like to review all assertThrows in the tests.

EPIC: SEP-31

Core Module, Reference Server Implementation and Callbacks
GanttStart: 2022-03-14
GanttDue: 2022-04-15

Scaffold anchor reference server

Scaffold Spring application with the following features.

  1. Spring application
  2. Enable property configuration read from application.properties
  3. Stubbed sep-12 controller
  4. Stubbed sep-12 service layer
  5. Stubbed sep-12 DTOs (request and response)
  6. JPA access
  7. SQLite driver

Add jitpack and Github CI badges

Add the jitpack badge to show the latest version available on jitpack.io
Add the Github workflow CI badge to show the latest status of GH CI.

paymentservice: add `Account.loadBalances()` & `Account.loadCapabilities()`

What problem does your feature solve?

The Account class is used in two contexts:

  • the id (and idTag) attributes be used as an identifier
  • the Account's data (balances & capabilities) is needed for processing

The payment service package does not communicate whether Account objects used throughout the package's API contract require or will contain the account's data.

This means that users of the package, and the package's other methods, must commonly check for whether or not this data is present and load it if necessary.

To make this situation easier, we should do the following:

  • Ensure methods using Account objects always have documentation on whether the account's data will be present
  • Provide helper methods that load this data when necessary

What would you like to see?

Added Account.loadBalances() and Account.loadCapabilities() methods.

There also must be a way to indicate that this data has not been loaded. One way to do this is to make Account.balances and Account.capabilities nullable. However, because some types of accounts can have no balances, using this as a condition of whether or not data has been loaded will not suffice.

EPIC: Anchor Platform Config Management

as an anchor platform developer I would like a common interface and management library for configure management using different config sources. This should initially support file based configuration.

EPIC: SEP-12 Core Module

As an Anchor Engineering developer, I want to implement SEP12 protocol core module for clients to upload KYC (or other) information to anchors integrating with the Anchor Platform.
GanttStart: 2022-02-22
GanttDue: 2022-03-12

Anchor Platform Config Interface

Create the anchor platform configuration management interface so development of modules can begin using without configuration management backend implementations.

Anchor Platform, Callback, & Event API Schema

Implement the Java classes necessary to represent the schemas for the APIs mentioned in the title.

These classes will belong to its own subproject so they can be reused by anchors who must implement the other side of the given API. @lijamie98 will create the subproject.

JWT validation

Currently, the JWT is only validated against the signature. The Sep10TokenFilter should validate more values in the JWT.

  1. CLIENT_DOMAIN should match if it exists.
  2. TransactionId should exist.
  3. The issuer should match host_url.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.