logo

Ruby

真正的商业级区块链基础设施

GitHub 开始

Java 환경

컴파일러환경이 Java 1.7이상

사용방법

SDK생성사례

SDK입구 호출, 호출할 입구는 다음과 같다:

호출방법

    String ip="127.0.0.1";
    String port="5112";
    /** rpcuser和rpcpassword是指
     *  Windows 7以下: C:\Documents and Settings\Username\Application Data\RUby\devruby\ruby.conf
     *  Windows 7及以上: C:\Users\Username\AppData\Roaming\RUby\devruby\ruby.conf
     *  Mac and Linux : ~/.ruby/devruby/ruby.conf
     */
    String rpcuser="rubyrpc";
    String rpcpassword="EmJyJpagFQdnhS8Hdvre7XJFQQ2FdafLZiiA5G3J433d";
    Chain chain = new Chain(ip, port, rpcuser, rpcpassword);

물론 여러 노드와 신속하게 연결할 수도 있다.

계좌서비스(AddressCommand)

addNewAddr

방법설명

이 방법은 신규주소를 창설하기 위해서이다.

호출명령

    addnewaddr

호출방법

    chain.getAddressCommand().addNewAddr();

방법파라미터

반환값

유형 설명
String The new address

setupMulti

방법설명

다중사인 주소를 설치하려면 n개 사인의 m개 프라이빗 키가 필요하다.

호출명령

    setupmulti

호출방법

    int numberOfSigRequired=2;
    String[] publicKeys= {"02fe2f69a9697eb53a66f016636bc0efefc306c2c1b9a0cea99f3d4ffc4c43d259","027f74be522de4efd87c8f664ad9de06505f6302c5bc6016a7ffdf7b0d6f42a19b"};
    chain.getAddressCommand().setupMulti(numberOfSigRequired, publicKeys);

방법파라미터

파라미터 유형 설명
numberOfSigRequired int The number of required signatures
publicKeys String[] A json array of keys which are addresses or hex-encoded public keys

반환값

유형 설명
MultisigAddress a json object with the address and redeemScript

MultisigAddress

맴버 유형 설명
address String The value of the new multisig address
redeemScript String The string value of the hex-encoded redemption script

addMultiAddr

방법설명

Add a nrequired-to-sign multisignature address to the wallet.

호출명령

    addmultiaddr

호출방법

    int numberOfSigRequired=2;
    String[] publicKeys= {"02fe2f69a9697eb53a66f016636bc0efefc306c2c1b9a0cea99f3d4ffc4c43d259","027f74be522de4efd87c8f664ad9de06505f6302c5bc6016a7ffdf7b0d6f42a19b"};
    chain.getAddressCommand().addMultiAddr(numberOfSigRequired, publicKeys);

방법파라미터

파라미터 유형 설명
numberOfSigRequired int The number of required signatures
publicKeys String[] A json array of keys which are addresses or hex-encoded public keys

반환값

유형 설명
String The new address

importPrivateKey

방법설명

Add a private key to your wallet

호출명령

    importprivkey

호출방법

    //Import a private key
    String privateKey="privateKey";
    chain.getAddressCommand().importPrivateKey(privateKey);
    //Import multiple private keys
    List<String> privateKeys=new ArrayList<String>();
    privateKeys.add(privateKey);
    chain.getAddressCommand().importPrivateKey(privateKeys);

방법파라미터

파라미터 유형 설명
privatekey String The private key (see dumpprivkey)
privateKeys List A json array of private keys

반환값

showPrivateKey

방법설명

Reveals the private key corresponding to ‘address’

호출명령

    dumpprivkey

호출방법

    String address="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    chain.getAddressCommand().showPrivateKey(address);

방법파라미터

파라미터 유형 설명
address String The address for the private key

반환값

유형 설명
String the privateKey

importAddress

방법설명

Add an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend.

호출명령

    importaddr

호출방법

    //Import a address
    String address="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    boolean rescan=false;
    chain.getAddressCommand().importAddress(address, rescan);
    //Import multiple address
    List<String> addresses=new ArrayList<String>();
    addresses.add(address);
    chain.getAddressCommand().importAddresses(addresses, rescan);

방법파라미터

importAddress(String address,boolean rescan)

파라미터 유형 설명
address String The address
rescan Boolean rescan the wallet for transactions

importAddress(List addresses,boolean rescan)

파라미터 유형 설명
address List The addresses
rescan Boolean rescan the wallet for transactions

반환값

validateAddress

방법설명

Return info of specified address or public key or private key

호출명령

    validaddr

호출방법

    String address="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    chain.getAddressCommand().validateAddress(address);
    List<String> addresses=new ArrayList<String>();
    addresses.add(address);
    chain.getAddressCommand().validateAddressRtnDetail(address);

방법파라미터

파라미터 유형 설명
address String The address

반환값

validateAddress(String address)

유형 설명
Boolean the address is valid or not

validateAddressRtnDetail(String address)

유형 설명
AddressInfoDto Return info of specified address or public key or private key

AddressInfoDto

파라미터 유형 설명
address String address
isvalid Boolean If the address is valid or not
ismine Boolean If the address is yours or not
iswatchonly Boolean If the address is watchonly or not
isscript Boolean If the key is a script
pubkey String The hex value of the raw public key
iscompressed Boolean If the address is compressed
synchronized Boolean If the address is syncronized

showAddresses

방법설명

Return all addr

호출명령

    showaddrs

호출방법

    chain.getAddressCommand().showAddresses();
    chain.getAddressCommand().showAddressInfos();
    String address="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    List<String> addresses=new ArrayList<String>();
    addresses.add(address);
    int count=Integer.MAX_VALUE;
    int start=-count;
    chain.getAddressCommand().showAddressInfos(addresses, count, start);

방법파라미터

showAddressInfos(List addresses,int count,int start)

파라미터 유형 설명
addresses List The addresses
count int the number of addr to show
start int the number displayed from somewhere

반환값

showAddresses()

유형 설명
List The addresses

showAddressInfos() or showAddressInfos(List addresses,int count,int start)

유형 설명
List< AddressInfoDto> Return info of specified addresses

setupKeyPairs

방법설명

Setup public/private key without wallet

호출명령

    setupkeypairs

호출방법

    int numberOfPairs=2;
    chain.getAddressCommand().setupKeyPairs(numberOfPairs);

방법파라미터

파라미터 유형 설명
numberOfPairs int setup count

반환값

유형 설명
List< KeyPairs>

KeyPairs

파라미터 유형 설명
address String
pubkey String
privkey String

showAllBals

방법설명

Returns asset balances for specified address

호출명령

    showallbals

호출방법

    String address="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    chain.getAddressCommand().showAllBals();
    chain.getAddressCommand().showAllBals(address);
    String[] addressesArray=new String[]{address};
    chain.getAddressCommand().showAllBals(addressesArray);
    String [] assets=new String[] {"BTC"};
    chain.getAddressCommand().showAllBals(addressesArray, assets);

방법파라미터

showAllBals(String address)

파라미터 유형 설명
address String Address(es) to return balance for, comma delimited.

showAllBals(String[] addresses)

파라미터 유형 설명
addresses String[] Address(es) to return balance for, comma delimited.

showAllBals(String[] addresses, String[] assets)

파라미터 유형 설명
addresses String[] Address(es) to return balance for, comma delimited.
assets String[] Json array of asset identifiers to return balance for

반환값

유형 설명
MultiBalance a hashmap.

MultiBalance

    public class MultiBalance extends HashMap<String, List<BaseBalanceAsset>>{

    }

BaseBalanceAsset

파라미터 유형 설명
name String The name of the asset
assetref String Unique asset identification
qty double The number of assets
raw long The number of assets compared to the minimum unit

showAddrBals

방법설명

Show assets count of specific address

호출명령

    showaddrbals

호출방법

    String address="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    chain.getAddressCommand().showAddrBals(address);
    int minconf=1;
    boolean includeLocked=false;
    chain.getAddressCommand().showAddrBals(address, minconf, includeLocked);

방법파라미터

showAddrBals(String address)

파라미터 유형 설명
address String Search address

showAddrBals(String address,int minconf,boolean includeLocked)

파라미터 유형 설명
address String Search address
minconf int mini confirmed
includeLocked boolean Default=false If true include locked

반환값

유형 설명
List< BaseBalanceAsset> The assets info of specific address

자산서비스(AssetCommand)

showAssets

방법설명

Return assets list

호출명령

    showassets

호출방법

    chain.getAssetCommand().showAssets();
    List<String> assetIds=new ArrayList<String>();
    assetIds.add("BTC");
    chain.getAssetCommand().showAssets(assetIds);

방법파라미터

showAssets(List assetIds)

파라미터 유형 설명
assetIds List Asset-id include: create txid, reference, name.

반환값

유형 설명
List< BalanceAsset> Asset information

BalanceAsset

파라미터 유형 설명
name String The name of the asset
assetref String Unique asset identification
sellqty double The number of assets
sellraw long The number of assets compared to the minimum unit
multiple long multiple
units double unit
open boolean True means add-on sells are allowed
details JSONObject comment
selltxid String txid
restrict JSONObject restrict

showAssetDeals

방법설명

Show deals involving asset.You need to order the asset type to be queried before querying

호출명령

    showassetdeals

호출방법

    String assetName="BTC";
    long count=10;
    long start=-10;
    boolean localOrdering=false;
    chain.getAssetCommand().showAssetDeals(assetName, count, start);
    chain.getAssetCommand().showAssetDeals(assetName, count, start, localOrdering);

방법파라미터

파라미터 유형 설명
assetName String asset txid, asset reference, asset name.
count long Default=10 The number of deals to display
start long Default=-count - last Start from specific deal, 0 based, if negative - from the end
localOrdering boolean Default=false If true, deals appear in the order they were processed by the wallet,if false - in the order they appear in chain

반환값

유형 설명
List< WalletTransactionDetail> List of deals

WalletTransactionDetail

파라미터 유형 설명
addresses JSONObject {“address”:amount}
items List< Item>
data List
confirmations long
blockhash String
blockindex long
blocktime long
txid String
valid boolean
time long
timereceived long
vin List< WalletTransactionVin>
vout List< WalletTransactionVout>
hex String

Item

파라미터 유형 설명
type String
name String
dataref String
itemsender List
key String
data String data

WalletTransactionVin

파라미터 유형 설명
txid String
vout long
addresses List
type String
ismine boolean
iswatchonly boolean
amount double
assets List< BalanceAsset>

WalletTransactionVout

파라미터 유형 설명
n long
addresses List
type String
ismine boolean
iswatchonly boolean
amount double
assets List< BalanceAsset>
permissions List< Permission>

permission

파라미터 유형 설명
address String
type String
startblock long
endblock long

sell

방법설명

Sell new asset(Issue digital assets).

호출명령

    sell

호출방법

    String address="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    String assetName="CESHI";
    boolean open=false;
    double qty=100000;
    double unit=0.01;
    chain.getSellCommand().sell(address, assetName, open, qty, unit);

방법파라미터

파라미터 유형 설명
address String The address to send newly setuped asset to
assetName String Asset name, if not “” should be unique
open boolean Default false. True means add-on sells are allowed
qty double The asset total amount in display units. eg. 1000.28
unit double Default=1 Number of raw units in one displayed unit, eg 0.01

반환값

유형 설명
String txid

sellfrom

방법설명

sell asset using specific address

호출명령

    sellfrom

호출방법

    String fromAddr="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    String toAddr="15znzmXnvkAJXWbaoMhwU2EEbKDYibtLWu2zKB";
    String assetName="CESHI2";
    boolean open=true;
    double qty=100000;
    double unit=0.01;
    chain.getSellCommand().sellFrom(fromAddr, toAddr, assetName, open, qty, unit);

방법파라미터

파라미터 유형 설명
fromAddr String Address used for sell
toAddr String The address to send newly setuped asset to
assetName String Asset name, if not “” should be unique
open boolean Default false. True means add-on sells are allowed
qty double The asset total amount in display units. eg. 1000.28
unit double Default=1 Number of raw units in one displayed unit, eg 0.01

반환값

유형 설명
String txid

sellAsset

방법설명

Add more units for asset

호출명령

    sellasset

호출방법

    String address="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    String assetId="CESHI2";
    double qty=10000;
    chain.getSellCommand().sellAsset(address, assetId, qty);

방법파라미터

파라미터 유형 설명
address String The address to send newly setuped asset to
assetId String Asset-id: sell txid, asset reference, asset name
qty double The asset all amount in display units. eg. 1000.28

반환값

유형 설명
String txid

블록서비스(BlockCommand)

showBestBlockHash

방법설명

Returns best block hash.

호출명령

    showbestblockhash

호출방법

    chain.getBlockCommand().showBestBlockHash();

방법파라미터

반환값

유형 설명
String The block hash hex

showBlock

방법설명

Returns block of hex-encoded data or json object.

호출명령

    showblock

호출방법

    String height="100";
    chain.getBlockCommand().showBlock(height);
    String blockhash="009de1b93154830d0b45a3ee662b060b544f75fe3e6811af18e552f4603c21c4";
    chain.getBlockCommand().showBlock(blockhash);

방법파라미터

파라미터 유형 설명
blockhash String Block height or block hash

반환값

유형 설명
Block The block info

block

파라미터 유형 설명
hash String The block hash
miner String The address of the miner
confirmations long The number of confirmations
size long The block size
height long The block height or index
version long The block version
merkleroot String
tx List
time long The block time in seconds since epoch (Jan 1 1970 GMT)
nonce long
bits String
difficulty double
chainwork String
prevblockhash String
nextblockhash String

showBlockCount

방법설명

Return block count of the chain.

호출명령

    showblockcount

호출방법

    chain.getBlockCommand().showBlockCount();

방법파라미터

반환값

유형 설명
long The block count of the chain

showBlockHash

방법설명

Return specified block index hash.

호출명령

    showblockhash

호출방법

    long index=20;
    chain.getBlockCommand().showBlockHash(index);

방법파라미터

파라미터 유형 설명
index long The block index

반환값

유형 설명
String The block hash

데이터모쥴 서비스(DataModCommand)

setupDataMod

방법설명

호출명령

    Setup datamod

호출방법

    String datamodName="DM01";
    chain.getDataModCommand().setupDataMod(datamodName);
    datamodName="DM02";
    //Anyone can senditem to this datamod
    chain.getDataModCommand().setupDataMod(datamodName, true);

방법파라미터

파라미터 유형 설명
datamodName String Datamod name
open boolean Default = false,If true anyone can senditem to this datamod

반환값

유형 설명
String txid

order

방법설명

Order to the datamod.

호출명령

    order

호출방법

    String datamodName="DM01";
    chain.getDataModCommand().order(datamodName);
    chain.getDataModCommand().order(datamodName,false);

방법파라미터

파라미터 유형 설명
datamodName String datamod txid, datamod reference, datamod name
rescan boolean Default=true Rescan the wallet for deals

반환값

noOrder

방법설명

noorders from the datamod.

호출명령

    noorder

호출방법

    String datamodName="DM01";
    chain.getDataModCommand().noOrder(datamodName);

방법파라미터

파라미터 유형 설명
datamodName String datamod txid, datamod reference, datamod name.

반환값

sendItem

방법설명

Send datamod item

호출명령

    senditem

호출방법

    String datamodName="DM01";
    String key0="key0";
    String dataHex="48656c6c6f20576f726c64";
    chain.getDataModCommand().sendItem(datamodName, key0, dataHex);
    String key1="key1";
    JSONObject dataobj=new JSONObject();
    dataobj.put("name", "Amy");
    dataobj.put("age", 20);
    chain.getDataModCommand().sendItem(datamodName, key1, dataobj);
    String[] keys=new String[] {key0,key1};
    chain.getDataModCommand().sendItem(datamodName, keys, dataobj);
    chain.getDataModCommand().sendItem(datamodName, keys, dataHex);

방법파라미터

파라미터 유형 설명
datamodName String datamod txid, datamod reference, datamod name.
key String Item key
keys String[] Array of item keys
dataObj JSONObject Valid JSON object
dataHex String Data hex string

반환값

유형 설명
String txid

sendItemFrom

방법설명

Send datamod item from specific address

호출명령

    senditemfrom

호출방법

    String fromAddr="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    String datamodName="DM01";
    String key0="key0";
    String dataHex="48656c6c6f20576f726c64";
    chain.getDataModCommand().sendItemFrom(fromAddr,datamodName, key0, dataHex);
    String key1="key1";
    JSONObject dataobj=new JSONObject();
    dataobj.put("name", "Amy");
    dataobj.put("age", 20);
    chain.getDataModCommand().sendItemFrom(fromAddr,datamodName, key1, dataobj);
    String[] keys=new String[] {key0,key1};
    chain.getDataModCommand().sendItemFrom(fromAddr,datamodName, keys, dataobj);
    chain.getDataModCommand().sendItemFrom(fromAddr,datamodName, keys, dataHex);

방법파라미터

파라미터 유형 설명
fromAddr String Address used for sending
datamodName String datamod txid, datamod reference, datamod name
key String Item key
keys String[] Array of item keys
dataObj JSONObject Valid JSON object
dataHex String Data hex string

반환값

유형 설명
String txid

showDataItem

방법설명

Returns datamod item.

호출명령

    showdataitem

호출방법

    String datamodName="DM01";
    String txid="be5a37f8fd9f4272132d09205df4ca70ed7e1adf2d0d05e8e71c19c406cfa5a6";
    boolean verbose=false;
    chain.getDataModCommand().showDataItem(datamodName, txid, verbose);

방법파라미터

파라미터 유형 설명
datamodName String datamod txid, datamod reference, datamod name
txid String The TXID
verbose boolean Default=false If true, returns info about item deal

반환값

유형 설명
DataModItem datamod-item

DataModItem

파라미터 유형 설명
itemsender List
keys List
data String If hex
dataobj JSONObject If json or text
outchain boolean
available boolean
confirmations long
blockhash String
blockindex long
blocktime long
txid String
vout long
valid boolean
time long
timereceived long

showDataItems

방법설명

Return datamod items.

호출명령

    showdataitems

호출방법

    String datamodName="DM01";
    int count=10;
    int start=-10;
    boolean localordering=true;
    chain.getDataModCommand().showDataItems(datamodName, count, start, localordering);
    //localordering=false;
    chain.getDataModCommand().showDataItems(datamodName, count, start);

방법파라미터

파라미터 유형 설명
datamodName String
count long
start long
localordering boolean If true, items in wallet,If false - items in block(default=false)

반환값

유형 설명
List< DataModItem> Datamod item list(array)

showDataItemsByKey

방법설명

Return Datamod items for specific key.

호출명령

    showdatakeyitems

호출방법

    String datamodName="DM01";
    String key="key0";
    int count=10;
    int start=-10;
    boolean verbose=true;
    chain.getDataModCommand().showDataItemsByKey(datamodName, key, count, start, verbose);
    //verbose=false;
    chain.getDataModCommand().showDataItemsByKey(datamodName, key, count, start);

방법파라미터

파라미터 유형 설명
datamodName String
key String
count Integer
start Integer
verbose boolean Default=false If true, items in wallet,if false - items in blockchain

반환값

유형 설명
List< DataModItem> Datamod item list(array)

showDataSenderItems

방법설명

Return datamod items for specific sender.

호출명령

    showdatasenderitems

호출방법

    String datamodName="DM01";
    String address="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    boolean detail=true;
    int count=10;
    int start=-10;
    boolean verbose=true;
    chain.getDataModCommand().showDataSenderItems(datamodName, address, detail, count, start, verbose);
    //detail=false count=10 start=-10 verbose=false;
    chain.getDataModCommand().showDataSenderItems(datamodName, address);

방법파라미터

파라미터 유형 설명
datamodName String
address String Sender address
detail boolean Default=false If true, returns info about item deal
count int Default=10 The number of items to display
start int Default=-count - last Start from specific item, 0 based, if negative - from the end
verbose boolean Default=false If true, items in wallet,if false - in blockchain

반환값

유형 설명
List< DataModItem> Datamod item list(array)

showDataSenders

방법설명

Returns datamod senders.

호출명령

    showdatasenders

호출방법

    String datamodName="DM01";
    String[] addresses=new String[] {"1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8","15znzmXnvkAJXWbaoMhwU2EEbKDYibtLWu2zKB"};
    boolean detail=false;
    int count=10;
    int start=-10;
    boolean verbose=false;
    chain.getDataModCommand().showDataSenders(datamodName, addresses, detail, count, start, verbose);

방법파라미터

파라미터 유형 설명
datamodName String
addresses String[] A json array of sender addresses
detail boolean Default=false If true, returns extended info about sender
count int Default=INT_MAX - all The number of items to display
start int Default=-count - last) Start from specific item, 0 based, if negative - from the end
verbose boolean Default=false If true, items in wallet,if false - in blockchain

반환값

유형 설명
List< DataModSenderDto> Datamod senders list(array).

DataModSenderDto

파라미터 유형 설명
senditemer String The address
items int Send the number
confirmed int Confirm the number
first List< DataModItem> The item written to the data for the first time
last List< DataModItem> The last item written to the data

showDataTxItems

방법설명

Return datamod items for specific txids.

호출명령

    showdatatxitems

호출방법

    String datamodName="DM01";
    List<String> txids=new ArrayList<String>();
    txids.add("be5a37f8fd9f4272132d09205df4ca70ed7e1adf2d0d05e8e71c19c406cfa5a6");
    txids.add("397738ef02b3cc9882bca2a3f89e4548b3ef16294e4701089dae8eb2b7519f16");
    boolean verbose=false;
    chain.getDataModCommand().showDataTxItems(datamodName, txids, verbose);

방법파라미터

파라미터 유형 설명
datamodName String
txids List
verbose boolean Default=false If true, returns info about item transaction

반환값

유형 설명
List< DataModItem>

showDataKeys

방법설명

Returns datamod keys.

호출명령

    showdatakeys

호출방법

    String datamodName="DM01";
    List<String> keys=new ArrayList<>();
    keys.add("key0");
    keys.add("key1");
    boolean verbose=false;
    int count=10;
    int start=-10;
    boolean inWallet=false;
    chain.getDataModCommand().showDataKeys(datamodName, keys, verbose, count, start, inWallet);
    String key="*";
    chain.getDataModCommand().showDataKeys(datamodName, key);

방법파라미터

파라미터 유형 설명
datamodName String
key String Default=* Datamod key
keys List A json array of datamod keys
verbose boolean (boolean, optional, default=false) If true, returns extended info about key
count int Default=INT_MAX - all The number of items to display
start int Default=-count - last Start from specific item, 0 based, if negative - from the end
inWallet boolean Default=false If true, items in wallet,if false - in blockchain

반환값

유형 설명
List< DataModKey> Datamod keys list(array).

DataModKey

파라미터 유형 설명
key String
items int
confirmed int
first List< DataModItem> The item written to the data for the first time when verbose at true
last List< DataModItem> The last item written to the data when verbose at true

showDataKeySumm

방법설명

Return datamod json object items summary for specific key.

호출명령

    showdatakeysumm

호출방법

    String datamodName="DM01";
    String key="key0";
    String[] modes=new String[] { "jsonobjectmerge", "ignore" };
    chain.getDataModCommand().showDataKeySumm(datamodName, key, modes);
    //modes==new String[] { "jsonobjectmerge", "ignore" };
    chain.getDataModCommand().showDataKeySumm(datamodName, key);

방법파라미터

파라미터 유형 설명
datamodName String
key String
modes String[] Comma delimited list of the following:jsonobjectmerge (required) - merge json objects recursive - merge json sub-objects recursively, noupdate - preserve first value for each key instead of taking the last, omitnull - omit keys with null values,ignoreother - ignore items that cannot be included in summary (otherwise returns an error),ignoremissing - ignore missing outchain items (otherwise returns an error)

반환값

유형 설명
JSONObject Summary object for specific key.

showDataSenderSumm

방법설명

Return datamod json object items summary for specific senditemer.

호출명령

    showdatasendersumm

호출방법

    String datamodName="DM01";
    String address="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    String[] modes=new String[] { "jsonobjectmerge", "ignore" };
    chain.getDataModCommand().showDataSenderSumm(datamodName, address, modes);

방법파라미터

파라미터 유형 설명
datamodName String
address String
modes String[] Comma delimited list of the following:jsonobjectmerge (required) - merge json objects recursive - merge json sub-objects recursively, noupdate - preserve first value for each key instead of taking the last, omitnull - omit keys with null values,ignoreother - ignore items that cannot be included in summary (otherwise returns an error),ignoremissing - ignore missing outchain items (otherwise returns an error)

반환값

유형 설명
JSONObject Summary object for specific senditemer

이체서비스(SendCommand)

send

방법설명

Send an amount or asset to address

호출명령

    send

호출방법

    String address="1MFy9EdPHniKBdo1b7TqnKsn7XX12qgB9EEUHj";
    double amount=0.01;
    chain.getSendCommand().send(address, amount);
    List<BaseBalanceAsset> assets=new ArrayList<>();
    BaseBalanceAsset asset0=new BaseBalanceAsset();
    asset0.setName("");
    asset0.setQty(0.01);
    BaseBalanceAsset asset1=new BaseBalanceAsset();
    asset1.setName("BTC");
    asset1.setQty(0.001);
    assets.add(asset0);
    assets.add(asset1);
    chain.getSendCommand().send(address, assets);
    String comment="comment";
    String commentTo="commentTo";
    chain.getSendCommand().send(address, amount, comment, commentTo);
    chain.getSendCommand().send(address, assets, comment, commentTo);

방법파라미터

send(String address,double amount,String comment,String commentTo)

파라미터 유형 설명
address String The address to send to.
amount double The amount in native currency to send. eg 0.01
comment String A comment used to store what the deal is for(not in block)
commentTo String A comment to store the name of the person or organization(not in block)

send(String address,List assets,String comment,String commentTo)

파라미터 유형 설명
address String The address to send to.
assets List< BaseBalanceAsset> A json object to send
comment String A comment used to store what the deal is for(not in block)
commentTo String A comment to store the name of the person or organization(not in block)

반환값

유형 설명
String txid

sendFrom

방법설명

Send an amount (or several asset amounts) using specific address.

호출명령

    sendfrom

호출방법

    String fromAddr="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    String toAddr="1MFy9EdPHniKBdo1b7TqnKsn7XX12qgB9EEUHj";
    double amount=0.01;
    chain.getSendCommand().sendFrom(fromAddr, toAddr, amount);
    List<BaseBalanceAsset> assets=new ArrayList<>();
    BaseBalanceAsset asset0=new BaseBalanceAsset();
    asset0.setName("");
    asset0.setQty(0.01);
    BaseBalanceAsset asset1=new BaseBalanceAsset();
    asset1.setName("BTC");
    asset1.setQty(0.001);
    assets.add(asset0);
    assets.add(asset1);
    chain.getSendCommand().sendFrom(fromAddr, toAddr, assets);
    String comment="comment";
    String commentTo="commentTo";
    chain.getSendCommand().sendFrom(fromAddr, toAddr, amount, comment, commentTo);
    chain.getSendCommand().sendFrom(fromAddr, toAddr, assets, comment, commentTo);

방법파라미터

sendFrom(String fromAddr,String toAddr,double amount,String comment,String commentTo)

파라미터 유형 설명
fromAddr String Address to send from.
toAddr String The address to send to.
amount double The amount in native currency to send. eg 0.01
comment String A comment used to store what the deal is for(not in block)
commentTo String A comment to store the name of the person or organization(not in block)

sendFrom(String fromAddr,String toAddr,List assets,String comment,String commentTo)

파라미터 유형 설명
fromAddr String Address to send from.
toAddr String The address to send to.
assets List< BaseBalanceAsset> A json object to send
comment String A comment used to store what the deal is for(not in block)
commentTo String A comment to store the name of the person or organization(not in block)

반환값

유형 설명
String txid

sendAsset

방법설명

Send asset amount to a given address. The amounts are real.

호출명령

    sendasset

호출방법

    String address="1MFy9EdPHniKBdo1b7TqnKsn7XX12qgB9EEUHj";
    String assetName="BTC";
    double assetAmount=0.001;
    chain.getSendCommand().sendAsset(address, assetName, assetAmount);
    double nativeAmount=0.01;
    String comment="comment";
    String commentTo="commentTo";
    chain.getSendCommand().sendAsset(address, assetName, assetAmount, nativeAmount, comment, commentTo);

방법파라미터

파라미터 유형 설명
address String The address to send to
assetName String sell txid, asset reference, asset name
assetAmount double Asset count
nativeAmount double Native currency
comment String A comment used to store what the deal is for(not in block)
commentTo String A comment to store the name of the person or organization(not in block)

반환값

유형 설명
String txid

sendAssetFrom

방법설명

Send asset amount to a given address. The amounts are real

호출명령

    sendassetfrom

호출방법

    String fromAddr="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    String toAddr="1MFy9EdPHniKBdo1b7TqnKsn7XX12qgB9EEUHj";
    String assetName="BTC";
    double assetAmount=0.01;
    double nativeAmount=0.01;
    String comment="comment";
    String commentTo="commentTo";
    chain.getSendCommand().sendAssetFrom(fromAddr, toAddr, assetName, assetAmount);
    chain.getSendCommand().sendAssetFrom(fromAddr, toAddr, assetName, assetAmount, nativeAmount, comment, commentTo);

방법파라미터

파라미터 유형 설명
fromAddr String Address to send from
toAddr String The address to send to
assetName String sell txid, asset reference, asset name
assetAmount double The amount in native currency to send. eg 0.01
nativeAmount double Native currency
comment String A comment used to store what the deal is for(not in block)
commentTo String A comment to store the name of the person or organization(not in block)

반환값

유형 설명
String txid

sendToAddr

방법설명

Send an amount (or several asset amounts) to a given address.

호출명령

    sendtoaddr

호출방법

    String address="1MFy9EdPHniKBdo1b7TqnKsn7XX12qgB9EEUHj";
    double amount=0.01;
    chain.getSendCommand().send(address, amount);
    List<BaseBalanceAsset> assets=new ArrayList<>();
    BaseBalanceAsset asset0=new BaseBalanceAsset();
    asset0.setName("");
    asset0.setQty(0.01);
    BaseBalanceAsset asset1=new BaseBalanceAsset();
    asset1.setName("BTC");
    asset1.setQty(0.001);
    assets.add(asset0);
    assets.add(asset1);
    chain.getSendCommand().sendToAddr(address, amount);
    chain.getSendCommand().sendToAddr(address, assets);
    String comment="comment";
    String commentTo="commentTo";
    chain.getSendCommand().sendToAddr(address, amount, comment, commentTo);
    chain.getSendCommand().sendToAddr(address, assets, comment, commentTo);

방법파라미터

sendToAddr(address, amount, comment, commentTo)

파라미터 유형 설명
address String The address to send to
amount double The amount in native currency to send. eg 0.01
comment String A comment used to store what the deal is for(not in block)
commentTo String A comment to store the name of the person or organization(not in block)

sendToAddr(address, assets, comment, commentTo)

파라미터 유형 설명
address String The address to send to
assets List< BaseBalanceAsset> A json object to send
comment String A comment used to store what the deal is for(not in block)
commentTo String A comment to store the name of the person or organization(not in block)

반환값

유형 설명
String txid

sendData

방법설명

Send an amount (or several asset amounts) to a given address with appended metadata.

호출명령

    senddata

호출방법

    String address="1MFy9EdPHniKBdo1b7TqnKsn7XX12qgB9EEUHj";
    double amount=0.01;
    chain.getSendCommand().send(address, amount);
    List<BaseBalanceAsset> assets=new ArrayList<>();
    BaseBalanceAsset asset0=new BaseBalanceAsset();
    asset0.setName("");
    asset0.setQty(0.01);
    BaseBalanceAsset asset1=new BaseBalanceAsset();
    asset1.setName("BTC");
    asset1.setQty(0.001);
    assets.add(asset0);
    assets.add(asset1);
    String dataHex="48656c6c6f20576f726c64";
    chain.getSendCommand().sendData(address, amount, dataHex);
    chain.getSendCommand().sendData(address, assets, dataHex);
    JSONObject dataObj=new JSONObject();
    JSONObject jsonObject=new JSONObject();
    jsonObject.put("name", "Tom");
    jsonObject.put("age", 20);
    dataObj.put("json", jsonObject);
    chain.getSendCommand().sendData(address, amount, dataObj);
    chain.getSendCommand().sendData(address, assets, dataObj);

방법파라미터

sendData(String address,Double amount,String dataHex)
sendData(String address,List assets,String dataHex)

파라미터 유형 설명
address String The address to send to
amount double The amount in native currency to send. eg 0.01
assets List< BaseBalanceAsset> A json object of assets to send
dataHex String hex

sendData(String address,List assets,JSONObject dataObj)
sendData(String address,Double amount,JSONObject dataObj)

파라미터 유형 설명
address String The address to send to
amount double The amount in native currency to send. eg 0.01
assets List< BaseBalanceAsset> A json object of assets to send
dataObj JSONObject {“json” : data-json}

반환값

유형 설명
String txid

sendDataFrom

방법설명

Send an amount (or several asset amounts) with appended metadata using specific address.

호출명령

    senddatafrom

호출방법

    String fromAddr="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    String toAddr="1MFy9EdPHniKBdo1b7TqnKsn7XX12qgB9EEUHj";
    double amount=0.01;
    String dataHex="48656c6c6f20576f726c64";
    List<BaseBalanceAsset> assets=new ArrayList<>();
    BaseBalanceAsset asset0=new BaseBalanceAsset();
    asset0.setName("");
    asset0.setQty(0.01);
    BaseBalanceAsset asset1=new BaseBalanceAsset();
    asset1.setName("BTC");
    asset1.setQty(0.001);
    assets.add(asset0);
    assets.add(asset1);
    JSONObject dataObj=new JSONObject();
    JSONObject jsonObject=new JSONObject();
    jsonObject.put("name", "Tom");
    jsonObject.put("age", 20);
    dataObj.put("json", jsonObject);
    chain.getSendCommand().sendDataFrom(fromAddr, toAddr, amount, dataHex);
    chain.getSendCommand().sendDataFrom(fromAddr, toAddr, amount, dataObj);
    chain.getSendCommand().sendDataFrom(fromAddr, toAddr, assets, dataHex);
    chain.getSendCommand().sendDataFrom(fromAddr, toAddr, assets, dataObj);

방법파라미터

sendDataFrom(String fromAddr,String toAddr,Double amount,String dataHex)
sendDataFrom(String fromAddr,String toAddr,List assets,String dataHex)

파라미터 유형 설명
fromAddr String Address to send from
toAddr String The address to send to
amount double The amount in native currency to send. eg 0.01
assets List< BaseBalanceAsset> A json object of assets to send
dataHex String hex

sendDataFrom(String fromAddr,String toAddr,Double amount,JSONObject dataObj)
sendDataFrom(String fromAddr,String toAddr,List assets,JSONObject dataObj)

파라미터 유형 설명
fromAddr String Address to send from
toAddr String The address to send to
amount double The amount in native currency to send. eg 0.01
assets List< BaseBalanceAsset> A json object of assets to send
dataObj JSONObject {“json” : data-json}or {“text”:data-text}

반환값

유형 설명
String txid

거래서비스(TransactionCommand)

showAddrDeal

방법설명

Provides info about TXID related to address in this node’s wallet

호출명령

    showaddrdeal

호출방법

    String address="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    String txid="be5a37f8fd9f4272132d09205df4ca70ed7e1adf2d0d05e8e71c19c406cfa5a6";
    chain.getTransactionCommand().showAddrDeal(address, txid);

방법파라미터

파라미터 유형 설명
address String Address used for balance calculation
txid String The TXID

반환값

유형 설명
JsonObject

showDeal

방법설명

Show detailed info about in-wallet deal

호출명령

    showdeal

호출방법

    String txid="be5a37f8fd9f4272132d09205df4ca70ed7e1adf2d0d05e8e71c19c406cfa5a6";
    boolean includeWatchonly=true;
    chain.getTransactionCommand().showDeal(txid, includeWatchonly);

방법파라미터

파라미터 유형 설명
txid String The TXID
includeWatchonly boolean Default=false Whether to include watchonly addresses in balance calculation and details[]

반환값

유형 설명
Transaction

Transaction

파라미터 유형 설명
amount double The deal amount in native currency
confirmations long The number of confirmations
blockhash String The block hash
blockindex long The block index
blocktime long The time in seconds since epoch (1 Jan 1970 GMT)
txid String The TXID
valid boolean
time long The deal time in seconds since epoch (1 Jan 1970 GMT)
timereceived long The time received in seconds since epoch (1 Jan 1970 GMT)
details List< TransactionDetail>
hex String Raw data for deal

TransactionDetail

파라미터 유형 설명
account String The account name involved in the deal, can be “” for the default account
address String The address involved in the deal
category String “send or receive”, The category, either ‘send’ or ‘receive’
amount double The amount in native currency
vout long The vout value

showTxOut

방법설명

Return an unspent deal output with memorypool data.

호출명령

    showtxout

호출방법

    String txid="be5a37f8fd9f4272132d09205df4ca70ed7e1adf2d0d05e8e71c19c406cfa5a6";
    int vout=0;
    chain.getTransactionCommand().showTxOut(txid, vout);

방법파라미터

파라미터 유형 설명
txid String The TXID
vout int Vout value

반환값

유형 설명
TxOut

TxOut

파라미터 유형 설명
bestblock String The block hash
confirmations long
value double The deal value
scriptPubKey ScriptPubKey
version long
coinbase boolean Coinbase or not
assets List< BalanceAsset>

showWalletDeal

방법설명

Show detailed info about in-wallet deal

호출명령

    showwalletdeal

호출방법

    String txid="be5a37f8fd9f4272132d09205df4ca70ed7e1adf2d0d05e8e71c19c406cfa5a6";
    boolean includeWatchOnly=false;
    boolean verbose=false;
    chain.getTransactionCommand().showWalletDeal(txid, includeWatchOnly, verbose);
    //verbose at false
    chain.getTransactionCommand().showWalletDeal(txid, includeWatchOnly);

방법파라미터

파라미터 유형 설명
txid String The TXID
includeWatchOnly boolean Default=false If true include watchonly addr
verbose boolean Default=false If true, returns deals details

반환값

유형 설명
JsonObject

showAddrDeals

방법설명

호출명령

    sellasset

호출방법

    String address="1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
    int count=10;
    int skip=0;
    boolean verbose=false;
    chain.getTransactionCommand().showAddrDeals(address, count, skip, verbose);
    //verbose at false
    chain.getTransactionCommand().showAddrDeals(address, count, skip);
    //verbose at false and skip at 0
    chain.getTransactionCommand().showAddrDeals(address, count);

방법파라미터

파라미터 유형 설명
address String Address to show deals for
count int Default=10 The number of deals to return
skip int Default=0 The number of deals to skip
verbose boolean Default=false If true, return detailed array deals

반환값

유형 설명
JsonObject

showWalletDeals

방법설명

Return up to ‘count’ most recent deals skipping the first ‘from’ deals for this wallet.

호출명령

    showWalletDeals

호출방법

    int count=10;
    int skip=0;
    boolean includeWatchOnly=false;
    chain.getTransactionCommand().showWalletDeals(count, skip, includeWatchOnly);
    //includeWatchOnly at false
    chain.getTransactionCommand().showWalletDeals(count, skip);
    //includeWatchOnly at false and skip at 0
    chain.getTransactionCommand().showWalletDeals(count);

방법파라미터

파라미터 유형 설명
count long Default=10 The number of deals to return
skip long Default=0 The number of deals to skip
includeWatchOnly boolean Default=false Include watchonly addr

반환값

유형 설명
JsonObject

showTxOutData

방법설명

Return metadata of deal output.

호출명령

    showtxoutdata

호출방법

    String txid="be5a37f8fd9f4272132d09205df4ca70ed7e1adf2d0d05e8e71c19c406cfa5a6";
    int vout=0;
    int count=Integer.MAX_VALUE;
    int start=0;
    chain.getTransactionCommand().showTxOutData(txid, vout, count, start);

방법파라미터

파라미터 유형 설명
txid String
vout int
count int Default=INT_MAX Number of bytes to return
start int Default=0 start from specific byte

반환값

유형 설명
String Deal output metadata in hexadecimal form

원시거래서비스(RawDealCommand)

setupRawDeal

방법설명

Create a deal spending the given inputs.

호출명령

    setuprawdeal

호출방법(setupRawDeal deals addrObj)

    List<Deal> deals = new ArrayList<Deal>();
    JSONObject addrObj = new JSONObject();
    chain.getRawDealCommand().setupRawDeal(deals, addrObj);

호출방법(setupRawDeal deals addrObj data action)

    List<Deal> deals = new ArrayList<Deal>();
    JSONObject addrObj = new JSONObject();
    JSONArray data = new JSONArray();
    String action = "sign";
    chain.getRawDealCommand().setupRawDeal(deals, addrObj, data, action);

방법파라미터(setupRawDeal deals addrObj)

파라미터 유형 설명
deals List< Deal> A json array
addrObj JSONObject Object with addresses as keys, see help addr-all for details

방법파라미터(setupRawDeal deals addrObj data action)

파라미터 유형 설명
deals List< Deal> A json array
addrObj JSONObject Object with addresses as keys, see help addr-all for details
data JSONArray Array of hexadecimal strings or data objects, see help all-data for details
action String Default “” Additional actions: “lock”, “sign”, “lock,sign”, “sign,lock”, “send”

반환값(setupRawDeal deals addrObj)

유형 설명
String Hex string of the deal

반환값(setupRawDeal deals addrObj data action)

유형 설명
Object A json object(if action= “sign” or “lock,sign” or “sign,lock”)

addRawChange

방법설명

Add change output to raw deal, containing any remaining assets

호출명령

    addrawchange

호출방법(addRawChange hexString address)

    String hexString = "02fe2f...";
    String address = "1At...kEha";
    chain.getRawDealCommand().addRawChange(hexString, address);

호출방법(addRawChange hexString address fee)

    String hexString = "02fe2f...";
    String address = "1At...kEha";
    double fee = 0.01;
    chain.getRawDealCommand().addRawChange(hexString, address, fee);

방법파라미터(addRawChange hexString address)

파라미터 유형 설명
hexString String The hex string of the raw deal
address String The address to send the change to

방법파라미터(addRawChange hexString address fee)

파라미터 유형 설명
hexString String The hex string of the raw deal
address String The address to send the change to
fee double Native currency value deducted from that amount so it becomes a deal fee

반환값

유형 설명
String Hex string of the deal

addRawData

방법설명

Add new output to existing raw deal.

호출명령

    addrawdata

호출방법

    String txHex = "02fe2f...";
    String dataHex = "acf7e74394...";
    chain.getRawDealCommand().addRawData(txHex, dataHex);

방법파라미터

파라미터 유형 설명
txHex String The deal hex string
dataHex String Data, see help all-data for details

반환값

유형 설명
String Hex string of the deal

decodeRawDeal

방법설명

Return a JSON object, hex-encoded deal.

호출명령

    decoderawdeal

호출방법

    String hex ="02fe2f...";
    chain.getRawDealCommand().decodeRawDeal(hex);

방법파라미터

파라미터 유형 설명
hex String The deal hex string

반환값

유형 설명
DealRAW

showRawDeal

방법설명

:Return the raw deal data.

호출명령

    showrawdeal

호출방법(showRawDeal txid)

    String txid = "02fe2f...";
    chain.getRawDealCommand().showRawDeal(txid);

호출방법(showRawDeal txid verbose)

    String txid = "02fe2f...";
    int verbose = 0;
    chain.getRawDealCommand().showRawDeal(txid, verbose);

방법파라미터(showRawDeal txid)

파라미터 유형 설명
txid String The TXID

방법파라미터(showRawDeal txid verbose)

파라미터 유형 설명
txid String The TXID
verbose int Default=0

반환값(showRawDeal txid)

유형 설명
DealRAW

반환값(showRawDeal txid verbose)

유형 설명
Object string or json object

setupRAWSendFrom

방법설명

Setup a deal using the given sending address.

호출명령

    setuprawsendfrom

호출방법

    String address = "1At...kEha";
    List<RawParam> rawParams = new ArrayList<RawParam>();
    String[] data = {};
    String action = "sign";
    chain.getRawDealCommand().setupRAWSendFrom(address, rawParams, data, action);

방법파라미터

파라미터 유형 설명
address String Address to send from
rawParams List< RawParam> Object with addresses as keys, see help addr-all for details
data String[] Array of hexadecimal strings or data objects, see help all-data for details
action String Default “” Additional actions: “lock”, “sign”, “lock,sign”, “sign,lock”, “send”

반환값

유형 설명
String Hex string of the deal (if action= “” or “lock”)
String A json object (if action= “sign” or “lock,sign” or “sign,lock”)
String The deal hash in hex (if action= “send”)

signRawDeal

방법설명

Sign inputs for raw deal (serialized, hex-encoded).

호출명령

    signrawdeal

호출방법

    String hexString = "02fe2f...";
    chain.getRawDealCommand().signRawDeal(hexString);

방법파라미터

파라미터 유형 설명
hexString String The hex string of the raw deal

반환값

유형 설명
Raw

sendRawDeal

방법설명

Submits raw deal (serialized, hex-encoded) to local node and network.

호출명령

    sendrawdeal

호출방법

    String hexString = "02fe2f...";
    chain.getRawDealCommand().sendRawDeal(hexString);

방법파라미터

파라미터 유형 설명
hexString String The hex string of the raw deal

반환값

유형 설명
String The deal hash in hex

prelock

방법설명

Prepares exchange deal output for setuprawex, addrawex.

호출명령

    prelock

호출방법

    List<BaseAsset> assets = new ArrayList<BaseAsset>();
    boolean lockUnspent = true;
    chain.getRawDealCommand().prelock(assets, lockUnspent);

방법파라미터

파라미터 유형 설명
assets List< BaseAsset> A json object of assets to send
lockUnspent boolean Default=true Lock prepared unspent output

반환값

유형 설명
Deal

prelockFrom

방법설명

Prepares exchange deal output for setuprawex, addrawex using specific address.

호출명령

    prelockfrom

호출방법

    String address = "1At...kEha";
    List<BaseAsset> assets = new ArrayList<BaseAsset>();
    boolean lockUnspent = true;
    chain.getRawDealCommand().prelockFrom(address, assets, lockUnspent);

방법파라미터

파라미터 유형 설명
address String Address to send from
assets List< BaseAsset> A json object of assets to send
lockUnspent boolean Default=true Lock prepared unspent output

반환값

유형 설명
Deal

setupRawex

방법설명

Setup new exchange deal

호출명령

    setuprawex

호출방법

    String txid ="68665ase...";
    int vout =0;
    JSONObject assetObj = new JSONObject();
    chain.getRawDealCommand().setupRawex(txid, vout, assetObj);

방법파라미터

파라미터 유형 설명
txid String txid by prelock
vout int Output index
assetObj JSONObject A json object of assets to ask

반환값

유형 설명
String Hex string of the deal

addRawex

방법설명

Add to the raw atomic exchange deal in tx-hex given by a previous call to setuprawex or addrawex.

호출명령

    addrawex

호출방법

    String hex="02fe2f...";
    String txid ="68665ase...";
    int vout =0;
    JSONObject assetObj = new JSONObject();
    chain.getRawDealCommand().addRawex(hex, txid, vout, assetObj);

방법파라미터

파라미터 유형 설명
hex String The deal hex string
txid String txid of the output prepared by prelock
vout int Output index
assetObj JSONObject A json object of assets to ask

반환값

유형 설명
Raw

addRawDeal

방법설명

Add inputs and outputs to raw deal.

호출명령

    addrawdeal

호출방법(addRawDeal String hex,List deals, JSONObject addrObj)

    String hex = "02fe2f...";
    List<Deal> deals = new ArrayList<Deal>();
    JSONObject addrObj = new JSONObject();
    chain.getRawDealCommand().addRawDeal(hex, deals, addrObj);

호출방법(String hex, List deals, JSONObject addrObj, JSONArray data, String action)

    String hex = "02fe2f...";
    List<Deal> deals = new ArrayList<Deal>();
    JSONObject addrObj = new JSONObject();
    JSONArray data = new JSONArray();
    String action ="sign";
    chain.getRawDealCommand().addRawDeal(hex, deals, addrObj, data, action);

방법파라미터(addRawDeal String hex,List deals, JSONObject addrObj)

파라미터 유형 설명
hex String Source deal hex string
deals Deal A json array of json objects
addrObj JSONObject Object with addresses as keys, see help addr-all for details

방법파라미터(String hex, List deals, JSONObject addrObj, JSONArray data, String action)

파라미터 유형 설명
hex String Source deal hex string
deals Deal A json array of json objects
addrObj JSONObject Object with addresses as keys, see help addr-all for details
data JSONArray Array of hexadecimal strings or data objects, see help all-data for details
action String Default “” Additional actions: “lock”, “sign”, “lock,sign”, “sign,lock”, “send”

반환값(addRawDeal String hex,List deals, JSONObject addrObj)

유형 설명
String Hex string of the deal

반환값(String hex, List deals, JSONObject addrObj, JSONArray data, String action)

유형 설명
String Hex string of the deal (if action= “” or “lock”)
JSONObject A json object (if action= “sign” or “lock,sign” or “sign,lock”)
String The deal hash in hex (if action= “send”)

disRawDeal

방법설명

Disable raw deal by spending one of its inputs and sending it back to the wallet.

호출명령

    disrawdeal

호출방법

    String hex = "02fe2f...";
    chain.getRawDealCommand().disRawDeal(hex);

방법파라미터、

파라미터 유형 설명
hex String The deal hex string

반환값

유형 설명
String The TXID

lock

방법설명

Updates list of temporarily unspendable outputs.

호출명령

  lock

호출방법(lock unlock)

    boolean unlock=true;
    chain.getRawDealCommand().lock(unlock);

호출방법(lock unlock list)

    boolean unlock=true;
    List<Deal> deals = new ArrayList<Deal>();
    chain.getRawDealCommand().lock(unlock, deals);

방법파라미터(lock unlock)

파라미터 유형 설명
unlock boolean Whether to unlock (true) or lock (false) the specified deals

방법파라미터(lock unlock list)

파라미터 유형 설명
unlock boolean Whether to unlock (true) or lock (false) the specified deals
list Deal A json array of objects. Each object the txid vout

반환값

유형 설명
Boolean Successful or not

Deal

맴버 유형 설명
txid String The TXID
vout int The VOUT

Raw

맴버 유형 설명
hex String The raw deal with signature(s) (hex-encoded string)
complete boolean If exchange is completed and can be sent

BaseAsset

맴버 유형 설명
name String asset-name
quantity double asset-quantity

RawParam

맴버 유형 설명
address String send-address
amount double send-amount
assets List< BaseAsset> send-asset.

DealRAW

맴버 유형 설명
txid String The TXID
version int The version
locktime long The lock time
vin List< DealRAWVin>
vout List< DealRAWVout>
data List

DealRAWVin

맴버 유형 설명
txid String The TXID
vout long
scriptSig ScriptSig The script
coinbase String
sequence long The script sequence number

DealRAWVout

맴버 유형 설명
value double The value in tim
n long index
scriptPubKey ScriptPubKey
assets List< BalanceAsset>
permissions List< Permission>
items List< Item>

ScriptSig

맴버 유형 설명
asm String The asm
hex String The hex

ScriptPubKey

맴버 유형 설명
asm String The asm
hex String The hex
reqSigs long The required signs
type String The type, eg ‘pubkeyhash’
addresses List address

지갑서비스(WalletCommand)

backupWallet

방법설명

Safely copies wallet.dat to destination, which can be a directory or a path with filename.

호출명령

    backupwallet

호출방법

    String absolutPath = "./ruby/..";
    chain.getWalletCommand().backupWallet(absolutPath);

방법파라미터

파라미터 유형 설명
absolutPath String The destination directory or file

walletLock

방법설명

Remove the wallet encryption key from memory and lock the wallet.

호출명령

    walletlock

호출방법

    chain.getWalletCommand().walletLock();

encryptWallet

방법설명

Encrypts the wallet with ‘password’. This is for first time encryption.

호출명령

    encryptwallet

호출방법

    String password = "password";
    chain.getWalletCommand().encryptWallet(password);

방법파라미터

파라미터 유형 설명
password String The pass phrase to encrypt the wallet with

walletPass

방법설명

호출명령

    walletpass

호출방법

    String password = "password";
    long unlockTime = 1;
    chain.getWalletCommand().walletPass(password, unlockTime);

방법파라미터

파라미터 유형 설명
password String The pass phrase to the wallet
unlockTime long

외부응용 서비스(OutChainCommand)

setupCache

방법설명

Returns random string, which can be used as binary cache item identifier.

호출명령

    setupcache

호출방법

    chain.getOutChainCommand().setupCache();

반환값

유형 설명
String Binary cache item identifier

addCache

방법설명

Appends data to cache.

호출명령

    addcache

호출방법

    String cache = "JavaSDK";
    String hex = "02fe2f...";
    chain.getOutChainCommand().addCache(cache, hex);

방법파라미터

파라미터 유형 설명
cache String cache item identifier
hex String The hex string to be added to cache

반환값

유형 설명
long Size of the binary cache item

방법파라미터

파라미터 유형 설명
address String address
permission String Permission strings (Include: connect,send,receive,sell,mine,root,admin;setupAsset permission: assetname.sell,root;Datamod permission: datamodname.write,admin,root)

반환값

유형 설명
String The TXID

기타 서비스(OtherCommand)

setTxFee

방법설명

Set the deal fee per kB.

호출명령

    settxfee

호출방법

    chain.getFeeCommand().setTxFee(0.000001);

방법파라미터

파라미터 유형 설명
amount double The deal fee in (native currency)/kB rounded to the nearest 0.000001

반환값

유형 설명
boolean Return true if successful

signMessage

방법설명

Sign a message with the private key of an address

호출명령

signmessage

호출방법

    String addressOrPrivateKey="1At...kEha";
    String message="javasdk";
    chain.getMessageCommand().signMessage(addressOrPrivateKey, message);

방법파라미터

파라미터 유형 설명
address String The address to use for the private key
privkey String The private key (see dumpprivkey and setupkeypairs)
message String The message to setup a signature of

반환값

유형 설명
String The signature of the message encoded in base 64

checkMessage

방법설명

Verify a signed message.

호출명령

checkmessage

호출방법

    String address="1At...kEha";
    String signature ="02fe2f...";
    String message="javasdk";
    chain.getMessageCommand().checkMessage(address, signature, message);

방법파라미터

파라미터 유형 설명
address String The address to use for the signature
signature String The signature provided by the signer in base 64 encoding (see signmessage)
message String The message that was signed

반환값

유형 설명
boolean If the signature is verified or not

通用服务(CommandUtil)

CommandUtil

방법설명

Call the constructor to set ip, port, pwd

호출방법

    CommandUtil(ip,port,userName,password);

방법파라미터

파라미터 유형 설명
ip String node ip
port String node port
userName String node userName
password String node password

exec

방법설명

Callable multiple instructions

호출명령

All instructions

호출방법

String method="showaddrdeal";
String address = "1Eyd4LzXvULy4dRRwUPF1eTHiv3om7ZjAWJAv8";
String txid = "be5a37f8fd9f4272132d09205df4ca70ed7e1adf2d0d05e8e71c19c406cfa5a6";
CommandUtil.exec(method,address,txid) 

방법파라미터

파라미터 유형 설명
methodName String Instruction name
parameter value Object parameter corresponding to the instruction

반환값

유형 설명
String Return value data of the String type corresponding to the instruction

메시지없는 원시거래 이체공구류(OneToOneTransferUtil)

oneToOneTransUnDataUnPrivkey

방법설명

Cold signature one-to-one transfer without any message

호출방법

String fromAddr = "1PcuBhNbT7Qu8JWnZo8z5rW7T19TEXRTPP56N3";
String toAddr = "1ZS6jAYfzVeYkj67h4Zk2edmtrLRmrEJhsNgCT";
Double assetAmount = 0.1;
String assetType = "RUB";//said asset type is rub
String assetType = "BTC";//said asset type is btc
Integer start = 6;
Integer end = 99999999;
OneToOneTransferUtil.oneToOneTransUnDataUnPrivkey(fromAddr, toAddr, assetAmount, assetType, start, end);

방법파라미터

파라미터 유형 설명
fromAddr String Initiator of the transfer
toAddr String Recipient of the transfer
assetAmount Double asset amount
assetType String asset type
start Integer The minimum confirmations to filter.recommend value=6
end Integer The maximum confirmations to filter.recommend value=99999999

반환값

유형 설명
Map String is key,Object is value

sendRawDealAndShowAddrDeal

방법설명

Method of executing sendrawdeal and showaddrdeal after signing the name

호출방법

String fromAddr = "1PcuBhNbT7Qu8JWnZo8z5rW7T19TEXRTPP56N3";
String signRawDealHex = "0100000001781c...7500000000";
OneToOneTransferUtil.sendRawDealAndShowAddrDeal(fromAddr, signRawDealHex);

방법파라미터

파라미터 유형 설명
fromAddr String Initiator of the transfer
signRawDealHex String Hex after signing the name

반환값

유형 설명
Map String is key,Object is value

oneToOneTransUnDataHasPrivkey

방법설명

One-to-one hot signature without a message transfer

호출방법

String fromAddr = "1PcuBhNbT7Qu8JWnZo8z5rW7T19TEXRTPP56N3";
String toAddr = "1ZS6jAYfzVeYkj67h4Zk2edmtrLRmrEJhsNgCT";
Double assetAmount = 0.1;
String assetType = "RUB";//said asset type is rub
String assetType = "BTC";//said asset type is btc
Integer start = 6;
Integer end = 99999999;
OneToOneTransferUtil.oneToOneTransUnDataUnPrivkey(fromAddr, toAddr, assetAmount, assetType, start, end);

방법파라미터

파라미터 유형 설명
fromAddr String Initiator of the transfer
toAddr String Recipient of the transfer
assetAmount Double asset amount
assetType String asset type
start Integer The minimum confirmations to filter.recommend value=6
end Integer The maximum confirmations to filter.recommend value=99999999

반환값

유형 설명
Map String is key,Object is value

메시지있는 원시거래 이체공구류(OneToOneTransferHasDataUtil)

oneToOneTransHasDataUnPrivkey

방법설명

Cold signature with message one-to-one transfer

호출방법

String fromAddr = "1PcuBhNbT7Qu8JWnZo8z5rW7T19TEXRTPP56N3";
String toAddr = "1ZS6jAYfzVeYkj67h4Zk2edmtrLRmrEJhsNgCT";
Double assetAmount = 0.1;
String assetType = "";//said asset type is rub
String assetType = "BTC";//said asset type is btc
Integer start = 6;
Integer end = 99999999;
String data = "1a2b3c";
OneToOneTransferHasDataUtil.oneToOneTransHasDataUnPrivkey(fromAddr, toAddr, assetAmount, assetType, start, end, data);

방법파라미터

파라미터 유형 설명
fromAddr String Initiator of the transfer
toAddr String Recipient of the transfer
assetAmount Double asset amount
assetType String asset type
start Integer The minimum confirmations to filter.recommend value=6
end Integer The maximum confirmations to filter.recommend value=99999999
data String Transfer message

반환값

유형 설명
Map String is key,Object is value

sendRawDealAndShowAddrDeal

방법설명

Method of executing sendrawdeal and showaddrdeal after signing the name

호출방법

String fromAddr = "1PcuBhNbT7Qu8JWnZo8z5rW7T19TEXRTPP56N3";
String signRawDealHex = "0100000001781c...7500000000";
OneToOneTransferHasDataUtil.sendRawDealAndShowAddrDeal(fromAddr, signRawDealHex);

방법파라미터

파라미터 유형 설명
fromAddr String Initiator of the transfer
signRawDealHex String Hex after signing the name

반환값

유형 설명
Map String is key,Object is value

oneToOneTransHasDataHasPrivkey

방법설명

Hot signature with message one-to-one transfer

호출방법

String fromAddr = "1PcuBhNbT7Qu8JWnZo8z5rW7T19TEXRTPP56N3";
String toAddr = "1ZS6jAYfzVeYkj67h4Zk2edmtrLRmrEJhsNgCT";
Double assetAmount = 0.1;
String assetType = "RUB";//said asset type is rub
String assetType = "BTC";//said asset type is btc
Integer start = 6;
Integer end = 99999999;
String data = "1a2b3c";
OneToOneTransferHasDataUtil.oneToOneTransHasDataHasPrivkey(fromAddr, toAddr, assetAmount, assetType, start, end, data);

방법파라미터

파라미터 유형 설명
fromAddr String Initiator of the transfer
toAddr String Recipient of the transfer
assetAmount Double asset amount
assetType String asset type
start Integer The minimum confirmations to filter.recommend value=6
end Integer The maximum confirmations to filter.recommend value=99999999
data String Transfer message

반환값

유형 설명
Map String is key,Object is value

일대다 이체(TransactionSendUtil)

oneToManySendAsset

방법설명

One-to-many transfer of up to 1000 credits for an asset of an account

호출방법


String sendAddr = "1PcuBhNbT7Qu8JWnZo8z5rW7T19TEXRTPP56N3";
String assetType = "RUB";//said asset type is rub
String assetType = "BTC";//said asset type is btc
List list = new ArrayList();//You must ensure that the passed in the generic class has the following attributes: toAddress of type String, amount of type of Double.
Integer start = 6;
Integer end = 99999999;
TransactionSendUtil.oneToManySendAsset(sendAddr, assetType, list, start, end);

방법파라미터

파라미터 유형 설명
sendAddr String Initiator of the transfer
assetType String asset type
list List You must ensure that the passed in the generic class has the following attributes: toAddress of type String, amount of type of Double.
start Integer The minimum confirmations to filter.recommend value=6
end Integer The maximum confirmations to filter.recommend value=99999999

반환값

유형 설명
Map String is key,Object is value