Giter Club home page Giter Club logo

dappxinvokerandroid's Introduction

Android CocosWallet SDK Access Documentation

Instructions & Support

-This SDK is used to pull up the Dappx client and complete the interaction between Dapp and Dappx Client for related action operations of cocosbcx.

Start access

  • Add mavenUrl to the project root build.gradle file
allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}
  • module relys on sdk, build.gralde file adds dependencies as follows
implementation 'com.github.linktodappx:DappxInvokerAndroid:1.0.3'

Instructions

1.Login Authorize (Authorize)

Authorize authorize = new Authorize();
authorize.setDappName("DappName"); // dapp name
authorize.setDappIcon("https://logoicon.png");// dapp icon
authorize.setActionId("web-99784c28-70f0-49ff-3654-f27b137b3502");// action ID (uuid)
authorize.setExpired(1537157808L); // Expired time
authorize.setDesc("desc content"); // Description
DpInvokerManager.getInstance().authorize(context, authorize, new CocosListener() {
	@Override
	public void onSuccess(String data) {
	}

	@Override
	public void onError(String data) {
	}

	@Override
	public void onCancel(String data) {
	}
});

2.Transfer (Transfer)

Transfer transfer = new Transfer();
transfer.setDappName("Newdex");// dapp name
transfer.setDappIcon("https://newdex.io/static/logoicon.png");
transfer.setActionId("web-99784c28-70f0-49ff-3654-f27b137b3502");
transfer.setExpired(1537157808L);
transfer.setDesc("desc content");
transfer.setFrom("gnkhandsome1");
transfer.setTo("gnkhandsome2");
transfer.setAmount(0.0001);
transfer.setSymbol("COCOS");
transfer.setPrecision(5);
transfer.setMemo("test");
DpInvokerManager.getInstance().transfer(context, transfer, new CocosListener() {
	@Override
	public void onSuccess(String data) {
	}

	@Override
	public void onError(String data) {
	}

	@Override
	public void onCancel(String data) {
	}
});

3.Calling contract (Contract)

Contract contract = new Contract();
contract.setDappName("Newdex");
contract.setDappIcon("https://newdex.io/static/logoicon.png");
contract.setActionId("web-99784c28-70f0-49ff-3654-f27b137b3502");
contract.setExpired(1537157808L);
contract.setDesc("desc content");
contract.setContractNameOrId("1.16.13");
contract.setFunctionName("1.16.13");
contract.setValueList(new ArrayList());
DpInvokerManager.getInstance().callContract(context, contract, new CocosListener() {
	@Override
	public void onSuccess(String data) {
	}

	@Override
	public void onError(String data) {
	}

	@Override
	public void onCancel(String data) {
	}
});

4.SignMessage (Signature)

SignMessage signMessage = new SignMessage();
signMessage.setDappName("Newdex");
signMessage.setDappIcon("https://newdex.io/static/logoicon.png");
signMessage.setActionId("web-99784c28-70f0-49ff-3654-f27b137b3502");
signMessage.setExpired(1537157808L);
signMessage.setDesc("desc content");
signMessage.setMessage("test sign message");
DpInvokerManager.getInstance().callContract(context, signMessage, new CocosListener() {
	@Override
	public void onSuccess(String data) {
	}

	@Override
	public void onError(String data) {
	}

	@Override
	public void onCancel(String data) {
	}
});

dappxinvokerandroid's People

Contributors

sunhongkao avatar

Watchers

James Cloos avatar

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.