Skip to content

Using Nem-sdk with Nodejs express, to transfer Xem and Mosaics

Notifications You must be signed in to change notification settings

AnthonyLaw/nem-transfer-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nem Transfer Xem and Mosaic

  • This project showing example how to do transfer Xem and mosaic.
  • Using Nodejs, Express, nem-sdk
  • please check on more info on nem-sdk.

Usage

  • this is endpoint

For Xem: /transfer/xem/TargetAddress/Amount

For Mosaic: /transfer/mosaic/TargetAddress/Amount

Example : curl http://localhost:3000/transfer/xem/TCPVKPCPGMDH7KCQQR6JWIGQ5RM6C2FRB2LALJ4V/25

Install

npm install

npm start

Function in transfer.js

Password and PrivateKey required

var common = nem.model.objects.create('common')('Password', 'PrivateKey');

replace namespace and Mosaic name required

var mosaicAttachment = nem.model.objects.create('mosaicAttachment')(
  'Namespace',
  'masaicName',
  amount
);

Replace mosaic name

var neededDefinition = nem.utils.helpers.searchMosaicDefinitionArray(res.data, [
  'masaicName',
]);

About

Using Nem-sdk with Nodejs express, to transfer Xem and Mosaics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published