Содержание

Description

The LibreMoney API allows interaction with LibreMoney nodes using HTTP GET requests (Except for a few calls that need to be POST). Responses are returned as JSON objects.

API calls are made by communicating with LibreMoney nodes on port 7876. In all the examples here, the node is represented as "localhost". Examples and responses are all formatted for easy reading; line breaks and spaces are not actually used in requests or responses.

Many API calls make reference to the Genesis block. FYI, the genesis block's ID is 2680262203532249785

All the API calls can be seen and tested at http://localhost:7876/test Specific API calls can be seen and tested at http://localhost:7876/test?requestType=<specificRequestType> where <specificRequestType> is the name of specific API call you are looking for

General Notes

All http API requests that create a new transaction will accept either a secretPhrase or a publicKey parameter:

All API calls that require an account numbers can have the account number as either account id's or Reed-Solomon addresses

Account operations

Get Account

Retrieves the account information associated with a supplied account number.

Request

http://localhost:1400/api?
     requestType=getAccount&
     account=ACCOUNTNUM

Where:

Response

{
    "publicKey": "PUBKEY",
    "assetBalances": [
        {
            [ARRAY_OF_ASSETs]
        }
    ],
    "balance": "BALANCE",
    "accountRS": "ACCOUNTRS",
    "unconfirmedAssetBalances": [
        {
            [ARRAY_OF_UNCONFIRMED_ASSETs]
        }
    ],
    "account": "ACCOUNT",
    "effectiveBalance": EFFBALANCE,
    "unconfirmedBalance": "UNCONFBALANCE",
    "forgedBalance": "FORGEDBAL"
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getAccount&
     account=7898870630272254992

Response:

{
    "publicKey": "ce0fc0f2fed0645f7018e251493a8af1e1ecfb444a4603902e71bfd2a4b41558",
    "assetBalances": [
        {
            "asset": "1013693125509851736",
            "balanceQNT": "48"
        }
    ],
    "balance": "1000700000000",
    "accountRS": "LMA-BK2J-ZMY4-93UY-8EM9V",
    "unconfirmedAssetBalances": [
        {
            "unconfirmedBalanceQNT": "48",
            "asset": "1013693125509851736"
        }
    ],
    "account": "7898870630272254992",
    "effectiveBalance": 9932,
    "unconfirmedBalance": "1000700000000",
    "forgedBalance": "0"
}

Verified 5/12/14

Get Account ID

Retrieves the account number associated with a supplied passphrase.

Request

http://localhost:1400/api?
     requestType=getAccountId&
     secretPhrase=PASSPHRASE

Where:

Response

{
     "accountId":       "ACCOUNTNUM"
     "accountRS":       "ACCOUNTRS"
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getAccountId&
     secretPhrase=mySuperSecretPassphraseThatYouCanNeverGuess

Response:

{
     "accountId":       "4357314498768237104"
     "accountRS":       "LMA-UWKJ-GFEV-AGY4-5C4YS"
}

Note: You will get errorCode:1 if you don't make this request through a POST
Verified 5/13/14

Get Account Block IDs

Retrieves the blockIDs for all blocks generated by a supplied account. Results are sorted chronologically.

Request

http://localhost:1400/api?
     requestType=getAccountBlockIds&
     account=ACCOUNT
     timestamp=TIME

Where:

Response

{
     "blockIds":
          [ARRAY_OF_BLOCK_IDs]
}

Note: Results are sorted chronologically (earlier block IDs are displayed first)

Example

Request:

http://localhost:1400/api?
     requestType=getAccountBlockIds&
     account=387977119245692429
     timestamp=0

Response:

{
     "blockIds":
          [
               "932115710792099523"
          ]
}

Verified 5/1/14

Get Account Public Key

Retrieves the public key associated with a supplied account number.

Request

http://localhost:1400/api?
     requestType=getAccountPublicKey&
     account=ACCOUNTNUM

Where:

Response

{
     "publicKey":       "PUBKEY"
}

Where:

Note: If the supplied account number is unknown, you will receive error code 5. If the account exists but no transaction has ever been sent from the account, you will receive an empty tuple: {}

Example

Request:

http://localhost:1400/api?
     requestType=getAccountPublicKey&
     account=6483973064837388393

Response:

{
     "publicKey":       "29592749cd26f5c1c4bf0225f8ab225f289449b4978495e6fec09d486ae2d217"
}

Verified 5/1/14

Get Account Transaction IDs

Retrieves the transaction IDs associated with a supplied account number. The timestamp parameter determines how far back you'd like to go in the transaction list; a value of 0 will give you every transaction for the account since the genesis block.

Request

http://localhost:1400/api?
     requestType=getAccountTransactionIds&
     account=ACCOUNT&
     timestamp=TIME&
     type=TYPE&
     subtype=SUBTYPE

Where:

Response

{
     "transactionIds":
          [ARRAY_OF_IDs]
}

Where:

Note: Results are sorted by timestamp (earliest transactionIDs are displayed first)

Example

Request:

http://localhost:1400/api?
     requestType=getAccountTransactionIds&
     account=25940420118693217452&
     timestamp=0

Response:

{
     "transactionIds":
          [
               "17484500871708980634",
               "51938275284739120529"
          ]
}

Verified 5/5/14

Get Balance

Retrieves the balance of an account.

Request

http://localhost:1400/api?
     requestType=getBalance&
     account=ACCOUNT

Where:

Response

{
    "guaranteedBalance":  "GUARANTEED_BALANCE",
    "balance":            "BALANCE",
    "effectiveBalance":    EFFBALANCE,
    "unconfirmedBalance": "UNCONFBALANCE",
    "forgedBalance":      "FORGEDBAL"
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getBalance&
     account=7898870630272254992

Response:

{
    "guaranteedBalance":  "0",
    "balance":            "1000700000000",
    "effectiveBalance":   9932,
    "unconfirmedBalance": "1000700000000",
    "forgedBalance":      "0"
}

Verified 5/12/14

Get Guaranteed Balance

Retrieves the balance of an account that is confirmed at least a specified number of times. Implemented in software version 0.5.5

Request

http://localhost:1400/api?
     requestType=getGuaranteedBalance&
     account=ACCOUNT&
     numberOfConfirmations=CONFIRMATIONS

Where:

Response

{
     "guaranteedBalance":       GUARANTEED_BALANCE
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getGuaranteedBalance&
     account=3847997711292454692&
     numberOfConfirmations=15

Response:

{
     "guaranteedBalance":       1303400000000
}

Verified 5/1/14

Lease Balance

Lease your balance of MilliLm to another account.

Request

http://localhost:1400/api?
     requestType=leaseBalance&
     period=PERIOD&
     recipient=REC&
     secretPhrase=SECRET&
     fee=FEE&
     deadline=DEADLINE&
     referencedTransaction=REFTXID&
     broadcast=BROAD

Where:

Response

{
     "fullHash":                 "FULLHASH", 
     "signatureHash":            "SIGHASH", 
     "transactionBytes":         "TXBYTES", 
     "hash":                     "HASH", 
     "transaction":              "TX", 
     "broadcasted":              BROAD, 
     "unsignedTransactionBytes": "UNTXBYTES" 
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=leaseBalance&
     period=2880&
     recipient=1562462127635514638&
     secretPhrase=123&
     fee=100000000&
     deadline=1440

Response:

{
     "fullHash":                 "e4d1f83e1cf26ee71d8566d00077510c4a641e04174e7ec3893d7e5aafc82e65", 
     "signatureHash":            "48cab5351b4c08ac2816b5e13e9d238fa910085a0d07a16e1c7d7986222fc444", 
     "transactionBytes":         "0400401adb00a005668683e673274c671802492d6f5...", 
     "hash":                     "9b64d859cecdf63773d0696777c2783892616f3a793794544531e4fd7b8a66b2", 
     "transaction":              "16676532673329025508", 
     "broadcasted":              true, 
     "unsignedTransactionBytes": "0400401adb00a005668683e673274c671802492d6f54cdc..." 
}

Verified 5/9/14

Start / Stop / Get Forging

Start or stop forging with an account, or check to see if an account is forging. An account will "forge" when its secret passphrase (private key) is supplied to a LibreMoney server/node.

Request

http://localhost:1400/api?
     requestType=START_OR_STOP_OR_GET&
     secretPhrase=SECRET

Where:

Response

For "startForging" and "getForging":

{
     "deadline":       DEADLINE
}

Where:

For "stopForging":

{
     "foundAndStopped":       TRUE_OR_FALSE
}

Example

Request:

http://localhost:1400/api?
     requestType=startForging&
     secretPhrase=MySuperSecretPasswordThatIsNotActuallyPostedHereOrIsEvenRealSoDoNotEvenTryIt

Response:

{
     "deadline":       1036742
}

Verified 5/5/14

Set Account Information

Set your account information

Request

http://localhost:1400/api?
     requestType=setAccountInfo&
     secretPhrase=SECRET&
     name=NAME&
     description=DESCRIPT&
     publicKey=PUBKEY&	
     fee=FEE&
     deadline=DEADLINE&
     referencedTransactionFullHash=REFTXHASH&
     broadcast=BROAD

Where:

Response

{
     "fullHash":                 "FULLHASH", 
     "signatureHash":            "SIGHASH", 
     "transactionBytes":         "TXBYTES", 
     "hash":                     "HASH", 
     "transaction":              "TX", 
     "broadcasted":              BROAD, 
     "unsignedTransactionBytes": "UNTXBYTES" 
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=setAccountInfo&
     secretPhrase=MySuperSecretPasswordThatIsNotActuallyPostedHereOrIsEvenRealSoDoNotEvenTryIt&
     fee=100000000&
     deadline=1440

Response:

{ 
     "fullHash":                 "93e8bba270eed8693f62576e13b45b45a848dd475e510fdb1e4026712829b734", 
     "signatureHash":            "5487681f5a828d379864cbbdba9b1f4f2c6f7035c8cf2f272dc323147aea5eac", 
     "transactionBytes":         "0105c84ad700a005668683e673274c671802492d6f54cdc33d247aa426e7...", 
     "hash":                     "6b6ec6ad2f06119493caca546b6561069cd5341b41884d5be068e0b1d9ce7748", 
     "transaction":              "7627108136485906579", 
     "broadcasted":              true, 
     "unsignedTransactionBytes": "0105c84ad700a005668683e673274c671802492d6f54cdc33d247aa4..." 
}

Verified 5/6/14

Alias operations

Create/assign alias

Allows you to create an alias with a single request. If the alias has already been created, this request will assign a new URI to the alias.

Request

http://localhost:1400/api?
     requestType=setAlias&
     secretPhrase=SECRET&
     aliasName=ALIAS&
     aliasURI=URI&
     fee=FEE&
     deadline=DEADLINE&
     publicKey=PUBKEY&
     referencedTransactionFullHash=TRANSFULLHASH&
     broadcast=BROAD

Where:

Response

{
     "transactionId":       "TXID"
}
{ 
     "fullHash":                 "FULLHASH", 
     "signatureHash":            "SIGHASH", 
     "transactionBytes":         "TXBYTES", 
     "hash":                     "HASH", 
     "transaction":              "TX", 
     "broadcasted":              BROAD, 
     "unsignedTransactionBytes": "UNTXBYTES" 
}

Example

Request:

http://localhost:1400/api?
     requestType=setAlias&
     secretPhrase=123&
     aliasName=Google&
     aliasURI=http://google.com&
     fee=100000000&
     deadline=1440

Response:

{ 
     "fullHash":                 "645853ddc55daa2c948f46520b0630d964ce0f40c0ee03515faffce6259d0bae", 
     "signatureHash":            "1e622a64292f8b1fcb1ccf155a42a37a99b89cbcaa725f1200ab55b5ec5f1ca8", 
     "transactionBytes":         "0101fe21d700a005668683e673274c671802492d6f54cdc33d247aa426e7ce...", 
     "hash":                     "580c1bb70d7bcb1eb967c4e86c6c9bfc481641dcce84300a579caf35840e662a", 
     "transaction":              "3218487988112808036", 
     "broadcasted":              true, 
     "unsignedTransactionBytes": "0101fe21d700a005668683e673274c671802492d6f54cdc33d247a..." 
}

Verified 5/20/14

Get alias

Retries information about the alias id or alias name that is provided

Request

https://localhost:1400/api?
     requestType=getAlias&
     alias=ALIAS_ID&
     aliasName=ALIAS_NAME

Where:

Response

{
     "timestamp":  TIMESTAMP, 
     "aliasName":      "ALIAS", 
     "account":    "ACCOUNT",
     "accountRS":  "ACCOUNTRS",
     "aliasURI":        "URI",
     "alias":      "ALIAS_ID"
}

Where:

Example

Request:

https://localhost:1400/api?
     requestType=getAlias&
     alias=15515279700680480368

Response:

{
     "timestamp": 2409343, 
     "aliasName":     "google", 
     "account":   "5629477397208681336",
     "accountRS": "LMA-FLVS-VRBV-LDPD-6DZ9W",
     "aliasURI":       "http://google.com",
     "alias": "15515279700680480368"
}

Verified 5/22/14


Get aliases

Retries information on all alias for a given account (since timestamp if provided)

Request

https://localhost:1400/api?
     requestType=getAliases&
     account=ACCOUNT&
     timestamp=TIMESTAMP

Where:

Response

{
     "aliases": [
     {
          "timestamp":  TIMESTAMP, 
          "aliasName":      "ALIAS", 
          "account":    "ACCOUNT",
          "accountRS":  "ACCOUNTRS",
          "aliasURI":        "URI",
          "alias":      "ALIAS_ID"
     },
     {
          ...
     }]
}

Where:

Example

Request:

https://localhost:1400/api?
     requestType=getAliases&
     account=5629477397208681336

Response:

{
    "aliases": [
        {
            "timestamp": 2409602,
            "aliasName": "promotion",
            "alias": "11086300057073013586",
            "aliasURI": "",
            "accountRS": "LMA-FLVS-VRBV-LDPD-6DZ9W",
            "account": "5629477397208681336"
        },
        {
            ...
        }]
}

Verified 5/22/14

Get alias ID (Depreciated)

Retries the alias ID for a specific alias. Implemented in version 0.5.4e. Depreciated in version 1.1.4

Request

https://localhost:1400/api?
     requestType=getAliasId&
     alias=ALIAS

Where:

Response

{
     "id":       "ALIAS_ID"
}

Example

Request:

https://localhost:1400/api?
     requestType=getAliasId&
     alias=google

Response:

{
     "id":       "15515279700680480368"
}

Verified 5/20/14

Get alias IDs (Depreciated)

Tells you all transactionIDs of aliases after a specified time in the blockchain. Depreciated in version 1.1.4.

Request

https://localhost:1400/api?
     requestType=getAliasIds&
     timestamp=TIMESTAMP

Where:

Response

{
     "aliasIds":       [ARRAY_OF_ALIAS_IDs]
}

Example

Request:

https://localhost:1400/api?
     requestType=getAliasIds&
     timestamp=30000

Response:

{
     "aliasIds":
               ["12219820415480193342",
               "2284413548488744428",
               "6882945328050210195"...]
}

Verified 5/20/14

Get alias URI (Depreciated)

Tells you the target URI of an alias. Depreciated in version 1.1.4.

Request

http://localhost:1400/api?
     requestType=getAliasURI&
     alias=ALIAS

Where:

Response

{
     "uri":       "URI_ASSIGNED_TO_ALIAS"
}

Note: Returned URIs will be escaped!

Example

Request:

http://localhost:1400/api?
     requestType=getAliasURI&
     alias=Google

Response:

{
     "uri":       "http:\/\/google.com"
}

Verified 5/20/14

List Aliases (Depreciated)

Gives you a list of aliases owned by an account. Depreciated in version 1.1.4.

Request

http://localhost:1400/api?
     requestType=listAccountAliases&
     account=ACCOUNT

Where:

Response

{
     "aliases": 
          [ 
               { 
                    "alias":        "ALIAS",  
                    "uri":          "URI",
                    "account":      "ACCOUNT",
                    "timestamp":    "TIMESTAMP"
               } 
          ] 
}

Example

Request:

http://localhost:1400/api?
     requestType=listAccountAliases&
     account=17157779854388545959

Response:

{
     "aliases":
          [
               {
                    "alias":     "testalias",
                    "uri":       "1337",
                    "account":   "17157779854388545959",
                    "timestamp":  2920016
               }
          ]
}

Verified 5/20/14

Arbitrary Message System Operations

Send Message

Creates an Arbitrary Message transaction.

Request

http://localhost:1400/api?
     requestType=sendMessage&
     secretPhrase=SECRET&
     recipient=RECIP_ACCOUNT&
     fee=FEE&
     message=HEX_STRING&
     deadline=DEADLINE&
     referencedTransaction=REFTXID&
     broadcast=BROAD

Where:

Response

{
     "fullHash":                 "FULLHASH", 
     "signatureHash":            "SIGHASH", 
     "transactionBytes":         "TXBYTES", 
     "hash":                     "HASH", 
     "transaction":              "TX", 
     "broadcasted":              BROAD, 
     "unsignedTransactionBytes": "UNTXBYTES" 
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=sendMessage&
     secretPhrase=MySuperSecretPasswordThatYouDoNotKnow&
     recipient=501860284368&
     message= 6602b1611f921092bdf2a89fc97148ec9684066776b83fd3&
     deadline=720&
     referencedTransaction=8815617645011985536

Response:

{ 
     "fullHash":                 "d56ade2c322083d76ebcdb9f9ef18d7d52c6d105f67be040cc423c7a41a47aea", 
     "signatureHash":            "458514e72f4272c789f99201c27cff611460de10fe484b474166c1199c23e754", 
     "transactionBytes":         "0100471ddb00a005668683e673274c671802492d6f54cdc33d247aa426e7cef...", 
     "hash":                     "36a0dc90736d95ad5302f078d5db6fc48e5c087b76da65944f7fe2836b73abcd", 
     "transaction":              "15529291339976829653", 
     "broadcasted":              true, 
     "unsignedTransactionBytes": "0100471ddb00a005668683e673274c671802492d6f54cdc33d247aa4..." 
}

Verified 5/9/14

Block operations

Get Block

Retrieves block data.

Request

http://localhost:1400/api?
     requestType=getBlock&
     block=BLOCKADDRESS

Where:

Response

{
     "generatorRS": "ACCOUNTRS",
     "previousBlockHash":"32BytesRepresentedInHexadecimalForm",
     "payloadLength":PAYLOADLEN,
     "totalAmount":TOTAL,
     "generationSignature":"64BytesRepresentedInHexadecimalForm",
     "generator":"ACCOUNT",
     "baseTarget":"BASETARGET",
     "payloadHash":"32BytesRepresentedInHexadecimalForm",
     "nextBlock":"NEXTBLOCK",
     "numberOfTransactions":NUMTX,
     "blockSignature":"64BytesRepresentedInHexadecimalForm",
     "transactions":
          [
               "TRANSACTION1",
               "TRANSACTION2"
          ],
     "version":VERSION,
     "totalFee":"FEE",
     "previousBlock":"PREVBLOCK",
     "height":HEIGHT,
     "timestamp":TIME
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getBlock&
     block=3081264592726137683

Response:

{
     "generatorRS": "LMA-25TQ-G377-8TJ9-EVPAD",
     "previousBlockHash":"d2df42de82c3fbc808715ce9738630b31bece282864fafd164b0d4cf5b0e9e3e",
     "payloadLength":256,
     "totalAmount":"16400300000000",
     "generationSignature":"5beac191d5a20b443b9fdd83cfeb3abddfb31294c1999a85c75955a4c99b3f3c",
     "generator":"14241151062656421686",
     "baseTarget":"191236740",
     "payloadHash":"fc153c1f3d18af9e5a60be42bee896b19089a4b1e391179c98c2a9d2d383275f",
     "nextBlock":"5728643978405745233",
     "numberOfTransactions":2,
     "blockSignature":"5bf8d6f39c6303815dbf591667d613175e916520052f21ffaddec818e2e4ab0cca07f17b0dea8352e837aa89e774cd95dbeb5a2bdab1f1f50f5955d1a3718375",
     "transactions":
          [
               "10431005438877942947",
               "16244324356084723003"
          ],
     "version":2,
     "totalFee":"200000000",
     "previousBlock":"14482383993582051282",
     "height":115147,
     "timestamp":12439666
}

Verified 5/1/14

Asset exchange operations

Issue asset

Creates an asset on the exchange

Request

http://localhost:1400/api?
     requestType=issueAsset& 
     secretPhrase=SECRET& 
     name=ASSETNAME& 
     description=DESCRIPTION& 
     quantityQNT=QTY&
     decimals=DECIMALS&
     fee=FEE&
     deadline=DEADLINE& 
     referencedTransaction=REFTX&
     broadcast=BROAD

Where:

Response

The response returns a transaction ID, which is also the asset ID.

{
     "fullHash":                 "FULLHASH", 
     "signatureHash":            "SIGHASH", 
     "transactionBytes":         "TXBYTES", 
     "hash":                     "HASH", 
     "transaction":              "TX", 
     "broadcasted":              BROAD, 
     "unsignedTransactionBytes": "UNTXBYTES" 
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=issueAsset&
     secretPhrase=123&
     name=turtleCoin&
     description=This+is+Turtlecoin+issued+by+Tommy-Turtle&
     quantityQNT=500& 
     deadline=1440&
     fee=1000

Response:

{ 
     "fullHash":                 "ebccb29dc4286a4a55ad9f0a4334cd3b0df75c26fcaf4a6ee3b62832f8f1a403", 
     "signatureHash":            "adb63682ac9598b7ea951df09535ee662b4b2f977e4f8a3f1a1aa0fd1f3e3da1", 
     "transactionBytes":         "0200701fdb00a005668683e673274c671802492d6f54cdc33d247aa426e7cef83776...", 
     "hash":                     "f1fa3f7b8ca5dd38d529e9f9a052aac0f96a7e5a4ef57cdabb0e4633cb4fcd89", 
     "transaction":              "5362143131262438635", 
     "broadcasted":              true, 
     "unsignedTransactionBytes": "0200701fdb00a005668683e673274c671802492d6f54cdc33d247aa426e7ce..." 
}

Verified 5/9/14

Get asset IDs

Obtain a list of all of the asset IDs on the exchange

Request

http://localhost:1400/api?
     requestType=getAssetIds

Response

{
     "assetIds":       [ARRAY_OF_ASSET_IDs]
}

Example

Request:

http://localhost:1400/api?
     requestType=getAssetIds

Response:

{
     "assetIds":
          [
               "923860986719836", 
               "46556984592384756298", 
               "87918658237693184156",
               ...
          ]
}

Verified 5/6/14

Get asset

Obtain information associated with an asset ID

Request

http://localhost:1400/api?
     requestType=getAsset& 
     asset=ASSETID

Where:

Response

{
     "account":          "ACCOUNT", 
     "accountRS":        "ACCOUNTRS",
     "name":             "NAME", 
     "description":      "DESCRIPTION", 
     "quantityQNT":       QTY,
     "asset":             ASSETID,
     "decimals":          DECIMALS, 
     "numberOfTrades":    NUMTRADES
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getAsset& 
     asset=46556984592384756298

Response:

{
     "account":           "334765832685676",
     "accountRS":         "LMA-DE2F-W76R-GL25-HMFPR",
     "name":              "cfbBTCx1", 
     "description":       "This is BTC issued by Come-from-Beyond", 
     "quantityQNT":       500,
     "asset":             46556984592384756298,
     "decimals":          6, 
     "numberOfTrades":    0
}

Verified 5/13/14

Get assets

Obtain information associated with some asset IDs

Request

http://localhost:1400/api?
     requestType=getAssets& 
     assets=ASSETID&
     assets=ASSETID&
     ...

Where:

Response

{
     "assets": [ {
          "account":          "ACCOUNT", 
          "accountRS":        "ACCOUNTRS",
          "name":             "NAME", 
          "description":      "DESCRIPTION", 
          "quantityQNT":       QTY,
          "asset":             ASSETID,
          "decimals":          DECIMALS, 
          "numberOfTrades":    NUMTRADES
     },
     {
          ...
     }]
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getAssets& 
     assets=46556984592384756298

Response:

{
     "assets": [ {
          "account":           "334765832685676", 
          "accountRS":         "LMA-DE2F-W76R-GL25-HMFPR",
          "name":              "cfbBTCx1", 
          "description":       "This is BTC issued by Come-from-Beyond", 
          "quantityQNT":       500,
          "asset":             46556984592384756298,
          "decimals":          6, 
          "numberOfTrades":    0
     } ]
}

Verified 5/13/14

Get all assets

Obtain information associated with all the assets in the exchange

Request

http://localhost:1400/api?
     requestType=getAllAssets

Response

{
     "assets": 
     [ { 
          "account":           "ACCOUNT", 
          "accountRS":         "ACCOUNTRS"
          "name":              "NAME", 
          "description":       "DESCRIPTION", 
          "quantityQNT":       QTY,
          "asset":             ASSETID,
          "decimals":          DECIMALS, 
          "numberOfTrades":    NUMTRADES
     } ] 
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getAllAssets

Response:

{
     "assets": 
     [ { 
          "decimals":       7, 
          "numberOfTrades": 0, 
          "asset":          "3283533989023503499", 
          "quantityQNT":    "132249500000000", 
          "description":    "CCGGUQMJKOMUCLBIEGGTKCQVSBSJAZSE", 
          "name":           "GZSHFQY", 
          "account":        "14136559604731496960",
          "accountRS":      "LMA-KRDB-ZFA3-RNDV-AALNT"
       },
       { 
          "decimals":       6, 
          "numberOfTrades": 0, 
          "asset":          "5008310702202713285", 
          "quantityQNT":    "994512000000000", 
          "description":    "QESZUYEJCGBGHBVXIRC", 
          "name":           "GWNU", 
          "account":        "14136559604731496960",
          "accountRS":      "LMA-UWKJ-GFEV-AGY4-5C4YS"
       },
       ...
     ]
}

Verified 5/13/14

Get assets by name (Depreciated)

Obtain information associated with an asset name. Depreciated in version 1.1.4

Request

http://localhost:1400/api?
     requestType=getAssetsByName& 
     assetName=ASSET

Where:

Response

{
     "assets": 
     [ { 
          "account":           "ACCOUNT",
          "accountRS":         "ACCOUNTRS"
          "name":              "NAME", 
          "description":       "DESCRIPTION", 
          "quantityQNT":       QTY,
          "asset":             ASSETID,
          "decimals":          DECIMALS, 
          "numberOfTrades":    NUMTRADES
     } ] 
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getAssetsByName& 
     assetName=GZSHFQY

Response:

{
     "assets": 
     [ { 
          "decimals":       7, 
          "numberOfTrades": 0, 
          "asset":          "3283533989023503499", 
          "quantityQNT":    "132249500000000", 
          "description":    "CCGGUQMJKOMUCLBIEGGTKCQVSBSJAZSE", 
          "name":           "GZSHFQY", 
          "account":        "14136559604731496960",
          "accountRS":      "LMA-UWKJ-GFEV-AGY4-5C4YS"
     } ] 
}

Verified 5/20/14

Get assets by issuer

Get all assets that a specified account has created

Request

http://localhost:1400/api?
     requestType=getAssetsByIssuer& 
     account=ACCOUNT

Where:

Response

{
     "assets": 
     [ { 
          "account":         "ACCOUNT", 
          "accountRS":       "ACCOUNTRS",
          "name":            "NAME", 
          "description":     "DESCRIPTION", 
          "quantityQNT":     QTY,
          "asset":           ASSETID,
          "decimals":        DECIMALS, 
          "numberOfTrades":  NUMTRADES
     } ] 
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getAssetsByIssuer& 
     account=1562462127635514638

Response:

{
     "assets": 
     [ { 
          "decimals":           7, 
          "numberOfTrades":     0, 
          "asset":             "3283533989023503499", 
          "quantityQNT":       "132249500000000", 
          "description":       "CCGGUQMJKOMUCLBIEGGTKCQVSBSJAZSE", 
          "name":              "GZSHFQY", 
          "accountRS":         "LMA-GKAG-2VGD-U473-3VRDD",
          "account":           "1562462127635514638"
     } ] 
}

Verified 5/9/14

Get all trades

Obtain all trades starting from a specified time

Request

http://localhost:1400/api?
     requestType=getAllTrades& 
     timestamp=TIME

Where:

Response

{
     "trades": [
     { 
          "timestamp":   TIME, 
          "price":    "PRICE", 
          "asset":       "ASSETID", 
          "quantityQNT": "QTY", 
          "block":       "BLOCK", 
          "askOrder":    "ASK", 
          "bidOrder":    "BID" 
     },
     {
          ...
     }
     ]
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getAllTrades

Response:

{
     "trades": [ 
     { 
          "timestamp":   13530463, 
          "price":    "2500000000", 
          "asset":       "13920592454636198263", 
          "quantityQNT": "2", 
          "block":       "1942829179466651543", 
          "askOrder":    "16791208091984728819", 
          "bidOrder":    "12730658526877674075" 
     },
     {
          ...
     }
     ]
}

Verified 5/8/14

Get trades

Obtain trade information associated with a specified asset ID

Request

http://localhost:1400/api?
     requestType=getTrades& 
     asset=ASSETID&
     firstIndex=RANGE_START
     lastIndex=RANGE_END

Where:

Response

{
     "trades": [
     { 
          "timestamp":   TIME, 
          "price":    "PRICE", 
          "asset":       "ASSETID", 
          "quantityQNT": "QTY", 
          "block":       "BLOCK", 
          "askOrder":    "ASK", 
          "bidOrder":    "BID" 
     },
     {
          ...
     }
     ]
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getTrades& 
     asset=14269709746849295412&
     firstIndex=0

Response:

{
     "trades": [
     { 
          "timestamp":   13386268, 
          "price":    "100000000", 
          "asset":       "13388701969217905199", 
          "quantityQNT": "12", 
          "block":       "15363991879367428772", 
          "askOrder":    "9028610672087970547", 
          "bidOrder":    "7785235474459518056" 
     },
     {
          ...
     }
     ] 
}

Verified 5/9/14

Transfer asset

Used to transfer a quantity of asset from one account to another

Request

http://localhost:1400/api?
     requestType=transferAsset&
     secretPhrase=SECRET&
     recipient=RECIPIENT& 
     asset=ASSETID&
     comment=COMMENT&
     quantityQNT=QTY&
     fee=FEE&
     deadline=DEADLINE& 
     referencedTransaction=REFTXID&
     broadcast=BROAD

Where:

Response

{
     "fullHash":                 "FULLHASH", 
     "signatureHash":            "SIGHASH", 
     "transactionBytes":         "TXBYTES", 
     "hash":                     "HASH", 
     "transaction":              "TX", 
     "broadcasted":              BROAD, 
     "unsignedTransactionBytes": "UNTXBYTES" 
}

Where

Example

Request:

http://localhost:1400/api?
     requestType=transferAsset&
     secretPhrase=123&
     recipient=81623458239475&
     asset=46556984592384756298&
     quantityQNT=45&
     fee=100000000&
     deadline=1440

Response:

{ 
     "fullHash":                 "9bd14e7a93d228a85e82a98071f1bd96c158dda856311722e6feafb1a36e71e2", 
     "signatureHash":            "540a2963aac95e63c5e4d13b452be02160e5ecd9cb1c3e8306eed4b47975b9ba", 
     "transactionBytes":         "0201f120db00a005668683e673274c671802492d6f54cdc33d247a...", 
     "hash":                     "8633ca65458bb9895ef53c3875ff59dd4b85ddf922dcaae3f276796932d33731", 
     "transaction":              "12117166328294330779", 
     "broadcasted":              true, 
     "unsignedTransactionBytes": "0201f120db00a005668683e673274c671802492d6f54cdc33d2..." 
}

Verified 5/9/14

Place order

Places an "ask" or "bid" order for an asset onto the exchange.

Request

http://localhost:1400/api?
     requestType=BID_OR_ASK&
     secretPhrase=SECRET&
     asset=ASSETID&
     quantityQNT=QTY&
     price=PRICE&
     fee=FEE&
     deadline=DEADLINE&
     referencedTransaction=REFTXID&
     broadcast=BROAD

Where:

Response

{
     "fullHash":                 "FULLHASH", 
     "signatureHash":            "SIGHASH", 
     "transactionBytes":         "TXBYTES", 
     "hash":                     "HASH", 
     "transaction":              "TX", 
     "broadcasted":              BROAD, 
     "unsignedTransactionBytes": "UNTXBYTES" 
}

Where

Example

Request:

http://localhost:1400/api?
     requestType=placeBidOrder&
     secretPhrase=123&
     asset=46556984592384756298&
     quantityQNT=70&
     price=145&
     fee=100000000&
     deadline=1440&
     referencedTransaction=65374835678

Response:

{
     "fullHash":                 "a797ff58c5ed5c6f53c708dbe137812495c6af0eb280a3d001bb1917eb6a5561", 
     "signatureHash":            "751c9df738e1894ef550bf9e0725188168d4febf48a4da51b1efafaaa840dbcb", 
     "transactionBytes":         "02035d0fdb00a005668683e673274c671802492d6f54cdc33d247aa426e7cef83776...", 
     "hash":                     "4785247b3238fda4fe53d47bc8a97a2b3acf974a02854792b59b092f3473eecd", 
     "transaction":              "8024550067924866983", 
     "broadcasted":              true, 
     "unsignedTransactionBytes": "02035d0fdb00a005668683e673274c671802492d6f54cdc33d247aa426e7cef..." 
}

Verified 5/9/14

Get order IDs

Obtain order IDs for a specified asset's bid/ask orders

Request

http://localhost:1400/api?
     requestType=GET_BID_OR_ASK&
     asset=ASSETID

Where:

Response

Returns an array of all ask/bid orders:

{
     "GET_BID_OR_ASK": [ARRAY_OF_ORDER_IDs]
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getAskOrderIds&
     asset=14269709746849295412

Response:

{
     "askOrderIds":
          [
               "3467356724512", 
               "824756987236452"
          ]
}

Verified 5/8/14

Get orders

Obtain orders for a specified asset's bid/ask orders

Request

http://localhost:1400/api?
     requestType=GET_BID_OR_ASK&
     asset=ASSETID&
     limit=LIMIT

Where:

Response

Returns an array of all ask/bid orders:

{
     "GET_BID_OR_ASK": [ARRAY_OF_ORDERs]
}

Example

Request:

http://localhost:1400/api?
     requestType=getAskOrders
     asset=15680163033397272955

Response:

{
    "askOrders": [
        {
            "height": 90703,
            "price": "78932342",
            "asset": "15680163033397272955",
            "order": "4529944714996630823",
            "quantityQNT": "20",
            "accountRS": "LMA-JNYK-TP3W-VDBB-9FRVB",
            "account": "8425933418718057425",
            "type": "ask"
        },
        {
            "height": 77415,
            "price": "99000000",
            "asset": "15680163033397272955",
            "order": "3158651792442050495",
            "quantityQNT": "39",
            "accountRS": "LMA-AMPQ-B6ZZ-S8TL-EFDBH",
            "account": "14386024746077933238",
            "type": "ask"
        },
        {
            "height": 78822,
            "price": "150000000",
            "asset": "15680163033397272955",
            "order": "954178876942447633",
            "quantityQNT": "1",
            "accountRS": "LMA-FVXE-SLB6-KL5V-A2Q75",
            "account": "9337862827899547564",
            "type": "ask"
        }
    ]
}

Verified 5/12/14

Get current account order IDs

Obtain current order IDs for bid or ask orders for a specific account, optionally filtered by an an assetID. Implemented in version 0.5.9.

Request

http://localhost:1400/api?
     requestType=GET_BID_OR_ASK&
     account=ACCOUNT&
     asset=ASSETID

Where:

Response

Returns an array of all ask/bid order IDs:

{
     "GET_BID_OR_ASK_IDs": 
          [ARRAY_OF_ORDER_IDs]
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getAccountCurrentAskOrderIds&
     account=1189524830352486657&
     asset=2438729719254516952

Response:

{
     "askOrderIds":
          [
               "3467356725412", 
               "824756987456452
          ]
}

Verified 5/18/14

Get order

Obtain a specific bid or ask order

Request

http://localhost:1400/api?
     requestType=GET_BID_OR_ASK&
     order=ORDERID

Where:

Response

{
     "account":       "ACCOUNT",
     "accountRS":     "ACCOUNTRS",
     "height":        HEIGHT,
     "asset":         "ASSETID", 
     "quantityQNT":   QTY, 
     "price":      PRICE,
     "order":         "ORDER",
     "type":          "TYPE"
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getBidOrder&
     order=17936094171153028796

Response:

{
     "height":        90703, 
     "price":      "78932342", 
     "asset":         "15680163033397272955", 
     "order":         "17936094171153028796", 
     "quantityQNT":   "20", 
     "account":       "8425933418718057425",
     "accountRS":     "LMA-7HL4-WMNR-XGFL-ASVHV", 
     "type":          "ask"
}

Verified 5/13/14

Get all open orders

Obtain information on all open orders

Request

http://localhost:1400/api?
     requestType=getAllOpenOrders

Response

{
     "height":        HEIGHT,
     "account":       "ACCOUNT",
     "accountRS":     "ACCOUNTRS",
     "asset":         "ASSETID",
     "order":         "ORDER",
     "quantityQNT":   QTY, 
     "price":      PRICE,
     "type":          TYPE
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getAllOpenOrders

Response:

{ 
     "openOrders": 
     [ { 
          "height":      90703, 
          "price":    "78932342", 
          "asset":       "15680163033397272955", 
          "order":       "17936094171153028796", 
          "quantityQNT": "20", 
          "account":     "8425933418718057425", 
          "accountRS":   "LMA-2UKS-7VYN-Q73Y-EKE8Y",
          "type":        "ask" 
     }, 
     {
          ...
     }
     ]
}

Verified 5/13/14

Cancel order

Issue a cancel for an existing order

Request

http://localhost:1400/api?
     requestType=BID_OR_ASK&
     secretPhrase=SECRET&
     order=ORDERID&
     fee=FEE&
     deadline=DEADLINE&
     referencedTransaction=REFTXID&
     broadcast=BROAD

Where:

Response

{
     "fullHash":                 "FULLHASH", 
     "signatureHash":            "SIGHASH", 
     "transactionBytes":         "TXBYTES", 
     "hash":                     "HASH", 
     "transaction":              "TX", 
     "broadcasted":              BROAD, 
     "unsignedTransactionBytes": "UNTXBYTES" 
}

Where

Example

Request:

http://localhost:1400/api?
     requestType=cancelAskOrder&
     secretPhrase=123&
     order=3467356724512& 
     fee=100000000&
     deadline=1440

Response:

{
     "fullHash":                 "e9c821547e851998f05ef39a39dc196b27f5e3069c1bf516fffaf53359304cc4", 
     "signatureHash":            "a5bf7481f5ad02be69f5fff7cd73c3dd7e443a4335721511e9e79198bc6f0324", 
     "transactionBytes":         "02051316db00a005668683e673274c671802492d6f54cdc33d247aa...", 
     "hash":                     "10ffcff771db618ca243b561943e09fd4098ade100efb2dc68f7861705f6262d", 
     "transaction":              "10959937945806686441", 
     "broadcasted":              true, 
     "unsignedTransactionBytes": "02051316db00a005668683e673274c671802492d6f54cdc33d247aa426e7c..." 
}

Verified 5/9/14

Poll operations

Create Poll

Create a new poll

Request

http://localhost:1400/api?
     requestType=createPoll& 
     name=NAME&
     description=DESCRIP&
     minNumberOfOptions=MINOPTIONS&
     maxNumberOfOptions=MAXOPTIONS&
     optionsAreBinary=BINARY&
     option1=OPTION1&
     option2=OPTION2&
     option3=OPTION3&
     secretPhrase=SECRET&
     fee=FEE&
     deadline=DEADLINE&
     referencedTransactionFullHash=REFTXHASH&
     broadcast=BROAD

Where:

Response

{
     "fullHash":                 "FULLHASH", 
     "signatureHash":            "SIGHASH", 
     "transactionBytes":         "TXBYTES", 
     "hash":                     "HASH", 
     "transaction":              "TX", 
     "broadcasted":              BROAD, 
     "unsignedTransactionBytes": "UNTXBYTES" 
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=createPoll& 
     name=Testing123&
     description=Testing&
     minNumberOfOptions=1&
     maxNumberOfOptions=1&
     option1=yes&
     option2=no&
     secretPhrase=MySuperSecretPasswordThatIsNotActuallyPostedHereOrIsEvenRealSoDoNotEvenTryIt&
     fee=100000000&
     deadline=1440

Response:

{ 
     "fullHash":                 "7ef9e19d0c7943002fd98a7ae08f1b4a1d473c67796f89225b167fd4913ce73f", 
     "signatureHash":            "a76722be0652d5c88cb7292d1cb04ea299eaea74c35ad726e868d08799946c38", 
     "transactionBytes":         "010234fbda00a005668683e673274c671802492d6f54cdc33d247aa426e...", 
     "hash":                     "940383ff1bf177d4e4fee05c78865b12ace2570152c64570219dfc0aa10c246b", 
     "transaction":              "18991918535014782", 
     "broadcasted":              true, 
     "unsignedTransactionBytes": "010234fbda00a005668683e673274c671802492d6f54cdc33d247..." 
}

Verified 5/9/14

Get Poll

Gets information about requested poll

Request

http://localhost:1400/api?
     requestType=getPoll& 
     poll=POLL

Where:

Response

{ 
     "description":        "DESCRIP", 
     "name":               "NAME", 
     "maxNumberOfOptions": MAXOPTIONS, 
     "optionsAreBinary":   BINARY, 
     "voters":             [VOTERS], 
     "minNumberOfOptions": MINOPTIONS, 
     "options":            [OPTIONS] 
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getPoll& 
     poll=15826354927269615782

Response:

{ 
     "description":        "Does this work?", 
     "name":               "Test", 
     "maxNumberOfOptions": 1, 
     "optionsAreBinary":   false, 
     "voters":             [], 
     "minNumberOfOptions": 1, 
     "options":            [ "Yes", "No", "I don't know" ] 
}

Verified 5/8/14

Get Poll IDs

Returns the IDs of all the polls

Request

http://localhost:1400/api?
     requestType=getPollIds

Response

{ 
     "pollIds": 
     [ 
          "POLLID", 
          ...
     ]
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getPollIds

Response:

{ 
     "pollIds": 
     [ 
          "15826354927269615782", 
          "8883605113950920958" 
     ]
}

Verified 5/8/14

Cast Vote

Cast your vote on a poll

Request

http://localhost:1400/api?
     requestType=castVote& 
     poll=NAME&
     vote1=VOTE1&
     vote2=VOTE2&
     vote3=VOTE3&
     secretPhrase=SECRET&
     fee=FEE&
     deadline=DEADLINE&
     referencedTransactionFullHash=REFTXHASH&
     broadcast=BROAD

Where:

Response

{
     "fullHash":                 "FULLHASH", 
     "signatureHash":            "SIGHASH", 
     "transactionBytes":         "TXBYTES", 
     "hash":                     "HASH", 
     "transaction":              "TX", 
     "broadcasted":              BROAD, 
     "unsignedTransactionBytes": "UNTXBYTES" 
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=castVote& 
     poll=18991918535014782&
     vote1=yes&
     secretPhrase=MySuperSecretPasswordThatIsNotActuallyPostedHereOrIsEvenRealSoDoNotEvenTryIt&
     fee=100000000&
     deadline=1440

Response:

{ 
     "fullHash":                 "637ea3215258adef61f7fc5a90eff6435d1a7ad8c3790d5855c6943b9aff1daf", 
     "signatureHash":            "a6745e26165e9c7870c85bd174348e4e72c825378cfb71760e04f08e30879fa6", 
     "transactionBytes":         "010314feda00a005668683e673274c671802492d6f54cdc33...", 
     "hash":                     "10ee68836162f6a8e2559a6dbcbc41c4db4b7441e6ff321f01b268d761c6916d", 
     "transaction":              "17270557255810645603", 
     "broadcasted":              true, 
     "unsignedTransactionBytes": "010314feda00a005668683e673274c671802492d6f54cdc33d247aa426e7..." 
}

Verified 5/9/14

Server software operations

Get Constants

Returns all of the constant values used by a server.

Request

http://localhost:1400/api?
     requestType=getConstants

Response

{
     "maxBlockPayloadLength":40800,
     "genesisAccountId":"GENESISACC",
     "genesisBlockId":"GENESISBLK",
     "transactionTypes":
     [
          {
               "description":"Payment","value":0,"subtypes":
               [
                    {"description":"Ordinary payment","value":0}
               ]
          },
          {
               "description":"Messaging","value":1,"subtypes":
               [
                    {"description":"Arbitrary message","value":0},
                    {"description":"Alias assignment","value":1},
                    {"description":"Poll creation","value":2},
                    {"description":"Vote casting","value":3},
                    {"description":"Hub terminal announcement","value":4},
                    {"description":"Account info","value":5}
               ]
          },
          {
               "description":"Colored coins","value":2,"subtypes":
               [
                    {"description":"Asset issuance","value":0},
                    {"description":"Asset transfer","value":1},
                    {"description":"Ask order placement","value":2},
                    {"description":"Bid order placement","value":3},
                    {"description":"Ask order cancellation","value":4},
                    {"description":"Bid order cancellation","value":5}
               ]
          },
          {
               "description":"Digital goods","value":3,"subtypes":
               [
                    {"description":"Listing","value":0},
                    {"description":"Delisting","value":1},
                    {"description":"Price change","value":2},
                    {"description":"Quantity change","value":3},
                    {"description":"Purchase","value":4},
                    {"description":"Delivery","value":5},
                    {"description":"Feedback","value":6},
                    {"description":"Refund","value":7}
               ]
          },
          {
               "description":"Account Control","value":4,"subtypes":
               [
                    {"description":"Effective balance leasing","value":0}
               ]
          }
     ],
     "peerStates":
          [
               {"description":"Non-connected","value":0},
               {"description":"Connected","value":1},
               {"description":"Disconnected","value":2}
          ]
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getConstants

Response:

{
     "maxBlockPayloadLength":40800,
     "genesisAccountId":"1739068987193023818",
     "genesisBlockId":"2680262203532249785",
     "transactionTypes":
     [
          {
               "description":"Payment","value":0,"subtypes":
               [
                    {"description":"Ordinary payment","value":0}
               ]
          },
          {
               "description":"Messaging","value":1,"subtypes":
               [
                    {"description":"Arbitrary message","value":0},
                    {"description":"Alias assignment","value":1},
                    {"description":"Poll creation","value":2},
                    {"description":"Vote casting","value":3},
                    {"description":"Hub terminal announcement","value":4},
                    {"description":"Account info","value":5}
               ]
          },
          {
               "description":"Colored coins","value":2,"subtypes":
               [
                    {"description":"Asset issuance","value":0},
                    {"description":"Asset transfer","value":1},
                    {"description":"Ask order placement","value":2},
                    {"description":"Bid order placement","value":3},
                    {"description":"Ask order cancellation","value":4},
                    {"description":"Bid order cancellation","value":5}
               ]
          },
          {
               "description":"Digital goods","value":3,"subtypes":
               [
                    {"description":"Listing","value":0},
                    {"description":"Delisting","value":1},
                    {"description":"Price change","value":2},
                    {"description":"Quantity change","value":3},
                    {"description":"Purchase","value":4},
                    {"description":"Delivery","value":5},
                    {"description":"Feedback","value":6},
                    {"description":"Refund","value":7}
               ]
          },
          {
               "description":"Account Control","value":4,"subtypes":
               [
                    {"description":"Effective balance leasing","value":0}
               ]
          }
     ],
     "peerStates":
     [
          {"description":"Non-connected","value":0},
          {"description":"Connected","value":1},
          {"description":"Disconnected","value":2}
     ],
     "maxArbitraryMessageLength":1000
}

Verified 5/1/14

Get My Info

Returns server host and address information.

Request

http://localhost:1400/api?
     requestType=getMyInfo

Response

{
     "host":       "HOSTNAME",
     "address":       "ADDRESS"
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getMyInfo

Response:

{
     "host":       "127.0.0.1",
     "address":    "127.0.0.1"
}

Verified 5/1/14

Get Peer

Retrieves information on a specific peer.

Request

http://localhost:1400/api?
     requestType=getPeer&
     peer=PEERNAME

Where:

Response:

{
     "platform":          "PLATFORM",
     "blacklisted":       BLACKLIST,
     "shareAddress":      SHAREADD
     "application":       "LIBREMONEY",
     "weight":            WEIGHT,
     "hallmark":          "HALLMARK",
     "state":             STATE,
     "announcedAddress":  "ANNOUNCED",
     "downloadedVolume":  DLBYTES,
     "version":           "VERSION",
     "uploadedVolume":    ULBYTES
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getPeer&
     peer=23.88.104.217

Response:

{
     "hallmark":           "ea53f569819ad8c40d62dd7e4c1f4895b2a3...",
     "downloadedVolume":  115001,
     "blacklisted":       false,
     "announcedAddress":  "node.libremoney.com",
     "application":       "LIBREMONEY",
     "weight":            911527,
     "uploadedVolume":    4707,
     "state":             1,
     "version":           "0.9.9",
     "platform":          "lm.now.im",
     "shareAddress":      true
}

Verified 5/1/14

Get Peers

Retrieves a list of all peers known to the server. Returns ALL peers, regardless of state.

Request

http://localhost:1400/api?
     requestType=getPeers

Response:

An array of peer names/addresses:

{
     "peers":
          [
               "PEER",
               "PEER",
               "PEER"...
          ]
}

Example

Request:

http://localhost:1400/api?
     requestType=getPeers

Response:

{
     "peers":
     [
          "188.226.176.151",
          "88.202.37.38",
          "87.211.164.253"...
     ]
}

Verified 5/1/14

Get State

Returns information on the status of the server being queried.

Request

http://localhost:1400/api?
     requestType=getState

Response

{
     "numberOfPolls":             NUMPOLLS,
     "numberOfVotes":             NUMVOTES,
     "numberOfTrades":            NUMTRADES,
     "lastBlock":                 "LASTBLOCKID",
     "numberOfAliases":           NUMALIASES,
     "lastBlockchainFeeder":      "FEEDERPEER",
     "numberOfBlocks":            HEIGHT,
     "numberOfPeers":             NUMPEERS
     "totalMemory":               CURMEMORY,
     "freeMemory":                FREEMEMORY,
     "maxMemory":                 MAXMEMORY,
     "numberOfTransactions":      NUMTRANS,
     "numberOfUnlockedAccounts":  NUMUSERS,
     "version":                   "VERSION",
     "numberOfOrders":            NUMORDERS,
     "totalEffectiveBalance":  EFFECTIVEBALANCE
     "time":                      TIME,
     "availableProcessors":       NUMPROCESSORS,
     "numberOfAssets":            NUMASSETS,
     "cumulativeDifficulty":      "CUMEDIFF"
     "numberOfAccounts":          NUMACCOUNTS
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getState

Response:

{
     "numberOfPeers":868,
     "numberOfPolls":0,
     "numberOfVotes":0,
     "availableProcessors":4,
     "totalEffectiveBalance":991634266,
     "numberOfAccounts":33172,
     "numberOfUnlockedAccounts":0,
     "numberOfBlocks":126493,
     "numberOfOrders":0,
     "numberOfTransactions":182379,
     "version":"1.0.0",
     "maxMemory":477626368,
     "lastBlock":"4329081735143326181",
     "totalMemory":466092032,
     "numberOfAliases":85657,
     "cumulativeDifficulty":"3936422822105943",
     "numberOfTrades":0,
     "time":13671770,
     "numberOfAssets":0,
     "lastBlockchainFeeder":"cubie-solar.mjke.de",
     "freeMemory":135007384
}

Verified 5/1/14

Get Time

Retrieves the current time. In LibreMoney, time is measured in seconds since the genesis block.

Request

http://localhost:1400/api?
     requestType=getTime

Response

{
     "time":       TIME
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getTime

Response:

{
     "time":       417
}

Verified 5/1/14

Get Blockchain Status

Retrieves the current status of the blockchain

Request

http://localhost:1400/api?
     requestType=getBlockchainStatus

Response

{
    "lastBlock": "LASTBLK",
    "lastBlockchainFeederHeight": LASTHEIGHT,
    "time": TIME,
    "lastBlockchainFeeder": "FEEDERPEER",
    "numberOfBlocks": NUMBLKS,
    "isScanning": SCAN,
    "cumulativeDifficulty": "CUMDIF",
    "version": "VER"
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getBlockchainStatus

Response:

{
    "lastBlock": "3153685344875873318",
    "lastBlockchainFeederHeight": 95337,
    "time": 14604616,
    "lastBlockchainFeeder": "192.241.223.132",
    "numberOfBlocks": 95339,
    "isScanning": false,
    "cumulativeDifficulty": "2406110597084752",
    "version": "1.1.0"
}

Verified 5/12/14

Hallmark operations

Decode Hallmark

Decodes a node hallmark.

Request

http://localhost:1400/api?
     requestType=decodeHallmark&
     hallmark=HEXSTRING

Where:

Response

{
     "valid":        VALID,
     "weight":       WEIGHT,
     "host":         "HOSTIP",
     "account":      "ACCOUNT",
     "accountRS":    "ACCOUNTRS",
     "date":         "DATE"
}

Where:

Example

Request:

http://127.0.0.1:1400/api?
     requestType=decodeHallmark&
     hallmark=d67f03a47cd91fc...8b9e30f371a9fcc8f

Response:

{
     "valid":      true,
     "weight":     1000,
     "host":       "162.23.47.189",
     "account":    "123124126674545462232",
     "accountRS":  "LMA-5EGB-HKFP-NQUT-DKYFH",
     "date":       "2013-12-09"
}

Verified 5/13/14

Generate Hallmark

Generates a node hallmark.

Request

http://localhost:1400/api?
     requestType=markHost&
     secretPhrase=MY_SECRET&
     host=MY_HOST&
     weight=WEIGHT&
     date=CURRENT_DATE

Where:

Response

{
     "hallmark":       "HEXSTRING"
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=markHost&
     secretPhrase=MySuperSecretPasswordThatIsNotEasy&
     host=node23.nodesrus.com&
     weight=100&
     date=2014-01-01

Response:

{
     "hallmark":       "d67f03a47cd91fc1...fd49f66b462daa1f14ae8"
}

Verified 5/5/14

Token operations

Decode Token

Decodes an authorization token. This is used to authorize an account on a specific web site without requiring the transmission of a secret passphrase.

Request

http://localhost:1400/api?
     requestType=decodeToken&
     website=WEBSITE&
     token=AUTHSTRING

Where:

Response

{
     "account":       "ACCOUNT", 
     "timestamp":     TIME, 
     "valid":         BOOLEAN
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=decodeToken&
     website=www.domain.com&
     token=StringOf160Chars

Response:

{
     "account":       "398532577100249608", 
     "timestamp":     622, 
     "valid":         true 
}

Verified 5/9/14

Generate Token

Creates an authorization token. Tokens can be used to authorize an account on a specific web site without requiring the transmission of a secret passphrase.

Request

http://localhost:1400/api?
     requestType=generateToken&
     secretPhrase=SECRET&
     website=WEBSITE

Where:

Response

{
     "token":       StringOf160Chars 
}

Example

Request:

http://localhost:1400/api?
     requestType=generateToken&
     secretPhrase=ItWasABrightColdDayInAprilAndTheClocksWereStrikingThirteen&
     website=www.genesisblock.com

Response:

{
     "token":       "7dstcbs4fnbq614faea405ga3dj...etb0n9f0k6uvlku4d751kftqlb128t4"
}

Verified 5/9/14

Transaction operations

Broadcast Transaction

Broadcasts a transaction to the network

Request

http://localhost:1400/api?
     requestType=broadcastTransaction&
     transactionBytes=TX_BYTECODE

Where:

Response

{
     "transaction":       "TRANSACTION_ID"
}

Example

Request:

http://localhost:1400/api?
     requestType=broadcastTransaction&
     transactionBytes= 000022e22800e8036653833f4272604d...

Response:

{
     "transaction":       "17484500871708980634"
}

Verified 5/6/14

Calculate Full Hash

Calculates the full hash of a transaction

Request

http://localhost:1400/api?
     requestType=calculateFullHash&
     unsignedTransactionBytes=UNTXBYTES&
     signatureHash=SIGHASH

Where:

Response

{
     "fullHash": "FULLHASH" 
}

Example

Request:

http://localhost:1400/api?
     requestType=calculateFullHash&
     unsignedTransactionBytes=01016e23d700a005668683e673274c67...&
     signatureHash=07afbcfb72b4fa91d8e22f8f47950404270edc1d250d2c6edad7a58679fbe1cf

Response:

{ 
     "fullHash": "cc98e57a065610d17c6ba6a6406e4930b9a740bf1737847ab2e96e3733233984" 
}

Verified 5/6/14

Get Account Transaction IDs

Retrieves a list of transaction IDs associated with a LibreMoney account

Request

http://localhost:1400/api?
     requestType=getAccountTransactionIds&
     account=ACCOUNT&
     timestamp=TIME

Where:

Response

{
     "transactionIds":
          [ARRAY_OF_IDs]
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getAccountTransactionIds&
     account=6331110009135084386&
     timestamp=0

Response:

{
     "transactionIds":
          [
               "17484500871708980634"
          ]
}

Get Unconfirmed Account Transaction IDs

Retrieves a list of unconfirmed transaction IDs associated with a LibreMoney account

Request

http://localhost:1400/api?
     requestType=getUnconfirmedTransactionIds&
     account=ACCOUNT

Where:

Response

{
     "unconfirmedTransactionIds":
          [ARRAY_OF_IDs]
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getUnconfirmedTransactionIds&
     account=6331110009135084386

Response:

{
     "unconfirmedTransactionIds":
          [
               "17484500871708980634"
          ]
}

Verified 5/5/14

Get Transaction

Retrieves transaction data. Can provide either the transaction ID, hash, or full hash of the transaction.

Request

http://localhost:1400/api?
     requestType=getTransaction&
     transaction=TRANSID&
     hash=HASH&
     fullHash=FULLHASH

Where:

Response

{
     "sender":          "SENDERACCOUNT",
     "senderRS":        "SENDERACCOUNTRS",
     "fee":          "FEE",
     "amount":       "AMOUNT",
     "timestamp":       TIME,
     "referencedTransaction":       REFTX,
     "confirmations":   CONFIRMS,
     "subtype":         SUBTYPE,
     "block":           "BLOCKID",
     "senderPublicKey": "PUBKEY",
     "type":            TYPE,
     "deadline":        DEADLINE,
     "signature":       "SIGNATURE",
     "recipient":       "RECIPACCOUNT",
     "recipientRS":     "RECIPACCOUNTRS",
     "fullHash":        "FULLHASH", 
     "signatureHash":   "SIGHASH", 
     "hash":            "HASH", 
     "transaction":     "TRANSID", 
     "attachment":
     {
          ATTACHMENT
     }
}

Where:

Note: Data from an unconfirmed transaction does not contain "block" or "confirmations" parameters. Double-spending transactions are not retrieved.

Example

Request:

http://localhost:1400/api?
     requestType=getTransaction&
     transaction=16244659048134841060

Response:

{
     "sender":       "14336428216306750617",
     "senderRS":     "LMA-6DWM-GFYD-A7PS-72P3P",
     "fee":       "100000000",
     "amount":       "0",
     "timestamp":       7376798,
     "referencedTransaction":       "0",
     "confirmations":       6,
     "subtype":       1,
     "block":       "16385359704305994802",
     "blockTimestamp":       7376860,
     "attachment":
     {
          "alias":"LmApi",
          "uri":"http:\/\/libremoney.org/"
     },
     "senderPublicKey":       "64f103fbf0cc41045b1544cda6624eecfb8212b021fba22029a461c4b40c5d79",
     "type":       1,
     "deadline":       1,
     "signature":       "0cdf64cb06ea21396180a6f201b6a...",
     "recipient":       "1739068987193023818",
     "recipientRS":     "LMA-BK2J-ZMY4-93UY-8EM9V",
     "fullHash": "a3c47c4a2e60c2907efc9c4b9310066cabdf3e2137e67814aa57cb960ad2dfe1", 
     "signatureHash": "95cc276d1608dc0c14942a5efc82ccc701a56e873746ef1bfd37995c37ef5991", 
     "hash": "15a86f71e1ac267dce35791cefafb71460f458920784ea0d10894844f05894b0", 
     "transaction": "10431005438877942947"
}

Verified 5/13/14

Parse Transaction

Retrieves transaction data.

Request

http://localhost:1400/api?
     requestType=parseTransaction&
     transactionBytes=TRANSBYTES

Where:

Response

{
     "sender":          "SENDERACCOUNT",
     "senderRS":        "SENDERACCOUNTRS",
     "fee":          "FEE",
     "amount":       "AMOUNT",
     "timestamp":       TIME,
     "referencedTransaction":       REFTX,
     "confirmations":   CONFIRMS,
     "subtype":         SUBTYPE,
     "block":           "BLOCKID",
     "senderPublicKey": "PUBKEY",
     "type":            TYPE,
     "deadline":        DEADLINE,
     "signature":       "SIGNATURE",
     "recipient":       "RECIPACCOUNT",
     "recipientRS":     "RECIPACCOUNTRS",
     "fullHash":        "FULLHASH", 
     "signatureHash":   "SIGHASH", 
     "hash":            "HASH", 
     "transaction":     "TRANSID", 
     "attachment":
     {
          ATTACHMENT
     }
}

Where:

Note: Data from an unconfirmed transaction does not contain "block" or "confirmations" parameters. Double-spending transactions are not retrieved.

Example

Request:

http://localhost:1400/api?
     requestType=parseTransaction&
     transactionBytes=000022e22800e8036653833f4272604d5d3ef39...

Response:

{
     "sender":       "14336428216306750617",
     "senderRS":     "LMA-6DWM-GFYD-A7PS-72P3P",
     "fee":       "100000000",
     "amount":       "0",
     "timestamp":       7376798,
     "referencedTransaction":       "0",
     "confirmations":       6,
     "subtype":       1,
     "block":       "16385359704305994802",
     "blockTimestamp":       7376860,
     "senderPublicKey":       "64f103fbf0cc41045b1544cda6624eecfb8212b021fba22029a461c4b40c5d79",
     "type":       1,
     "deadline":       1,
     "signature":       "0cdf64cb06ea21396180a6f201b6a...",
     "recipient":       "1739068987193023818",
     "recipientRS":     "LMA-BK2J-ZMY4-93UY-8EM9V",
     "fullHash": "a3c47c4a2e60c2907efc9c4b9310066cabdf3e2137e67814aa57cb960ad2dfe1", 
     "signatureHash": "95cc276d1608dc0c14942a5efc82ccc701a56e873746ef1bfd37995c37ef5991", 
     "hash": "15a86f71e1ac267dce35791cefafb71460f458920784ea0d10894844f05894b0", 
     "transaction": "10431005438877942947"
}

Verified 5/13/14

Get Transaction Bytes

Retrieves bytecode of a transaction.

Request

http://localhost:1400/api?
     requestType=getTransactionBytes&
     transaction=TXID

Where:

Response

{
     "confirmations":            CONFS,
     "transactionBytes":         "BYTECODE",
     "unsignedTransactionBytes": "UNBYTECODE"
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=getTransactionBytes&
     transaction=17484500871708980634

Response:

{
     "confirmations":       4462,
     "transactionBytes":         "000022e22800e8036653833f4272604d5...",
     "unsignedTransactionBytes": "000022e22800e8036653833f42..." 
}

Verified 5/5/14

Send Lm

Sends LibreMoney to an account.

Request

http://localhost:1400/api?
     requestType=sendMoney&
     secretPhrase=SECRET&
     recipient=RECIPACCOUNT& 
     amount=AMOUNT& 
     fee=FEE& 
     deadline=DEADLINE& 
     referencedTransaction=REFTRANSACTION&
     publicKey=PUBKEY

Where:

Response

{ 
     "transaction":        "TRANSACTIONID" 
}

Where:

Note: "deadline" is specified in minutes. "referencedTransaction" can be omitted.

Example

Request:

http://localhost:1400/api?
     requestType=sendMoney&
     secretPhrase=IWontTellYou&
     recipient=398532577100249608&
     amount=1500&
     fee=5&
     deadline=900&
     referencedTransaction=13689168149259791567

Response:

{ 
     "transaction":        "16244659048134841060" 
}

Verified 5/5/14


Sign Transation

Calculates the full hash, signature hash, and transaction from the unsigned transaction

Request

http://localhost:1400/api?
     requestType=signTransaction&
     unsignedTransactionBytes=UNTXBYTES&
     secretPhrase=SECRET

Where:

Response

{
     "fullHash":                 "FULLHASH", 
     "signatureHash":            "SIGHASH", 
     "transactionBytes":         "TXBYTES", 
     "transaction":              "TX", 
     "verify":                   "VERIFY"
}

Where:

Example

Request:

http://localhost:1400/api?
     requestType=signTransaction&
     unsignedTransactionBytes=01016e23d700a005668683e673274c67...&
     secretPhrase=0123456789

Response:

{ 
     "fullHash":         "d56ade2c322083d76ebcdb9f9ef18d7d52c6d105f67be040cc423c7a41a47aea", 
     "signatureHash":    "458514e72f4272c789f99201c27cff611460de10fe484b474166c1199c23e754", 
     "transactionBytes": "0100471ddb00a005668683e673274c67180240...", 
     "transaction":      "15529291339976829653", 
     "verify":           true 
}

Verified 5/9/14

Error Codes