Skip to content

NEMPH/nem-mpspdf-ws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MPSP/DF - Web Service

A sample web service app written using Spring Boot to showcase sending a Swift Transaction and as well as decoding them.

Pre-requisites

Java 1.8 nem-apps-lib

Clone and Build nem-apps-lib

git clone https://github.com/NEMPH/nem-apps-lib.git
cd nem-apps-lib
mvn clean install

Import it as a maven dependency

<dependency>
    <groupId>io.nem.apps</groupId>
    <artifactId>nem-apps-lib</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>

Usage

Configuration

Go to Application.java to set the configuration.
ConfigurationBuilder.nodeNetworkName("mijinnet").nodeNetworkProtocol("http")
.nodeNetworkUri("a1.dfintech.com").nodeNetworkPort("7895")
.setup();

Create Swift Message MultisigTransaction

Method: POST  
Endpoint URL: mpmsf/transaction/transfer/multisig/announce

Post Parameter format:

{"multisigPrivateKey":"<multisig account private key>","senderPrivateKey":"<sender private key>","recepientPublicKey":"<recepient public key>","accountNumber":"<bank account number>","swiftMessage":"<Swift>"}

Cosign a Swift Message MultisigTransaction

Method: POST  
Endpoint URL: mpmsf/transaction/transfer/multisig/cosign

Post Parameter format:

{"signers":[{"<signer private key1>","<signer private key2>"},"multisigHash":"<multisig hash>","multisigPublicKey":"<multisig account public key>"}

Output: Transaction Hash	

Create Swift Message Transaction

Method: POST  
Endpoint URL: mpmsf/transaction/transfer/announce 

Post Parameter format:

{"senderPrivateKey":"<sender private key>","recepientPublicKey":"<recepient public key>","accountNumber":"<bank account number>","swiftMessage":"<Swift>"}

Output: Transaction Hash

Decode Swift Message Transaction

Method: POST  
Endpoint URL: mpmsf/transaction/hash/decode

Post Parameter format:

{"senderPrivateKey":"<sender private key>","recepientPublicKey":"<recepient public key>","hash":"<transaction hash>"}

Output: Decoded Transaction Message (Swift Message)

Test locally

The project is a Spring Boot Web Service Project. It can be excuted by running the spring boot command to bring up the embedded tomcat.

Build and Deploy

mvn clean install

Copyright (c) 2017

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages