Mig
>0.3.8

Description

This page will discuss the changes and migration steps in order to upgrade to sdk version 0.3.8.


What's Changed?

The package has been reconstructed to offer better separation between the synchronous and asynchronous methods. The new structure correlates with the documentation and aims to make it easier for developers to manage the different method responses.

Additonally, we have expanded the sdk to support more than one extension build. We are introducing a experimental version of Crossmark, called "Embark". To reuse large parts of the codebase, the sdk had to be upgraded to differentiate between the differnet building using a project identifier field.


New Structure

All Methods

sdk.method;

Examples

let { request, response, createdAt, resolvedAt } = sdk.methods.signAndWait({
  TransactionType: 'Payment',
  Account: 'rUmoi1vt8apeKsqFYKMRSiMvWixFDMC8Jz',
  Destination: 'rK8jihXBZCFWZqX95SET3CCi1WdRgZQwex',
  Amount: '1000000', // XRP in drops
});
let id = sdk.methods.sign({
  TransactionType: 'Payment',
  Account: 'rUmoi1vt8apeKsqFYKMRSiMvWixFDMC8Jz',
  Destination: 'rK8jihXBZCFWZqX95SET3CCi1WdRgZQwex',
  Amount: '1000000', // XRP in drops
});

Asynchronous Methods

sdk.async;

Example

let { request, response, createdAt, resolvedAt } = sdk.async.signAndWait({
  TransactionType: 'Payment',
  Account: 'rUmoi1vt8apeKsqFYKMRSiMvWixFDMC8Jz',
  Destination: 'rK8jihXBZCFWZqX95SET3CCi1WdRgZQwex',
  Amount: '1000000', // XRP in drops
});

Synchronous Methods

sdk.sync;

Example

let id = sdk.sync.sign({
  TransactionType: 'Payment',
  Account: 'rUmoi1vt8apeKsqFYKMRSiMvWixFDMC8Jz',
  Destination: 'rK8jihXBZCFWZqX95SET3CCi1WdRgZQwex',
  Amount: '1000000', // XRP in drops
});