Skip to content

Instantly share code, notes, and snippets.

@djuang1
Created May 22, 2018 18:05
Show Gist options
  • Save djuang1/06f2f279802153c55cc6833085a36f55 to your computer and use it in GitHub Desktop.
Save djuang1/06f2f279802153c55cc6833085a36f55 to your computer and use it in GitHub Desktop.
Call Multichain Java SDK in Mule 3.x
package com.dejim;
import java.util.List;
import org.mule.api.MuleEventContext;
import org.mule.api.lifecycle.Callable;
import multichain.command.IssueCommand;
import multichain.command.MultiChainCommand;
import multichain.command.MultichainException;
import multichain.object.BalanceAsset;
public class MultiChainTest implements Callable {
@Override
public Object onCall(MuleEventContext eventContext) throws Exception {
// TODO Auto-generated method stub
MultiChainCommand multiChainCommand = new MultiChainCommand("34.202.166.170", "7736", "multichainrpc","9wbcNf1QiadfadKr6J7jos2XraktctieAuySwCaYd9Rj");
IssueCommand issueCommand = new IssueCommand("34.202.166.170", "7736", "multichainrpc","9wbcNf1QiadfadKr6J7jos2XraktctieAuySwCaYd9Rj");
List<BalanceAsset> result = null;
try {
//result = multiChainCommand.getAddressCommand().getAddresses();
//result = multiChainCommand.getBalanceCommand().getTotalBalances().get(1);
result = issueCommand.listAssets("62-265-23667");
} catch (MultichainException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment