Skip to content

corda/corda5-token-sdk

Repository files navigation

Corda

Corda Token SDK

Reminder

This project is open source under an Apache 2.0 licence. That means you can submit PRs to fix bugs and add new features if they are not currently available.

What is the token SDK?

The token SDK exists to make it easy for CorDapp developers to create CorDapps which use tokens. Functionality is provided to create token types, then issue, move and redeem tokens of a particular type.

The tokens SDK comprises three CorDapp JARs:

  1. Contracts which contains the base types, states and contracts
  2. Workflows which contains flows for issuing, moving and redeeming tokens as well as utilities for the above operations.
  3. Token Builder which contains builder classes and utility functions for creating token objects
  4. Selection that contains both database and in memory token selection of fungible tokens

The token SDK is intended to replace the "finance module" from the core Corda repository.

For more details behind the token SDK's design, see here.

How to use the SDK?

Tokens SDK binaries for the current Developer Preview version of Corda 5 are published to R3's corda-lib Artifactory and can be used from there.

Adding token SDK dependencies to an existing CorDapp

  1. Add a repository definition for R3's corda-lib Artifactory:
    repositories {
        maven { url 'https://software.r3.com/artifactory/corda-lib' }
    }
  1. Add a variable for the tokens release group and the version you wish to use.
   buildscript {
       ext {
           tokens_release_version = '2.0.0-DevPreview-1.0'
           tokens_release_group = 'com.r3.corda.lib.tokens'
       }
   }
  1. Now, you can add the token-sdk dependencies to the dependencies block in each module of your CorDapp.

    For contract modules add:

     cordapp "$tokens_release_group:tokens-contracts:$tokens_release_version"
    

    In your workflow build.gradle add:

     cordapp "$tokens_release_group:tokens-workflows:$tokens_release_version"
    

    You can also add the token selection and token builder to your workflows:

     cordapp "$tokens_release_group:tokens-selection:$tokens_release_version"
     cordapp "$tokens_release_group:tokens-builder:$tokens_release_version"
    

Building locally and installing the token SDK binaries

If you wish to build the token-sdk from source then do the following to publish binaries to your local maven repository:

git clone http://github.com/corda/corda5-token-sdk
cd corda5-token-sdk
./gradlew clean install

You then need to add maven-local() to your repositories and reference the version you published locally in your CorDapp build configuration to use your local build.

Where to go next?

Official documentation

Introduction to token SDK

Most common tasks

Simple delivery versus payment tutorial

Other useful links

Token SDK Design

Experimental in memory token selection

Changelog

Contributing

Contributors

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages