From cdd269e017eb81f14f1109baf928cd08a98ca510 Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Fri, 12 Feb 2016 12:52:45 -0800 Subject: [PATCH] update RippleAPI to 0.16.7 --- rippleapi.html | 180 +++++++++++++++++++++++++++++++++++++++++++----- tool/pages.json | 2 +- 2 files changed, 165 insertions(+), 17 deletions(-) diff --git a/rippleapi.html b/rippleapi.html index e3bc5e86d3..1fdb9184f7 100644 --- a/rippleapi.html +++ b/rippleapi.html @@ -244,7 +244,7 @@ The "error" event is emitted whenever an error occurs that cannot be associated
  1. Install NodeJS and the Node Package Manager (npm). Most Linux distros have a package for NodeJS, but make sure you have version 0.12.0 or higher.
  2. Use npm to install Babel globally: - npm install -g babel
  3. + npm install -g babel-cli
  4. Use npm to install RippleAPI: npm install ripple-lib
@@ -392,7 +392,7 @@ const api = new RippleAPI();
  • prepareSuspendedPaymentExecution
  • -
  • Sign - Cryptographically sign the transaction locally and save the transaction ID. Signing is how the owner of an account authorizes a transaction to take place.
  • +
  • Sign - Cryptographically sign the transaction locally and save the transaction ID. Signing is how the owner of an account authorizes a transaction to take place. For multisignature transactions, the signedTransaction fields returned by sign must be collected and passed to the combine method.
  • Submit - Submit the transaction to the connected server.
  • Verify - Verify that the transaction got validated by querying with getTransaction. This is necessary because transactions may fail even if they were successfully submitted.
  • @@ -435,6 +435,11 @@ const api = new RippleAPI(); sequence Optional The initiating account's sequence number for this transaction. + +signersCount +integer +Optional Number of signers that will be signing this transaction. +

    We recommended that you specify a maxLedgerVersion so that you can quickly determine that a failed transaction will never succeeed in the future. It is impossible for a transaction to succeed after the network ledger version exceeds the transaction's maxLedgerVersion. If you omit maxLedgerVersion, the "prepare" method automatically supplies a maxLedgerVersion equal to the current ledger plus 3, which it includes in the return value from the "prepare" method.

    @@ -846,6 +851,36 @@ const api = new RippleAPI(); Optional Requires incoming payments to specify a destination tag. +signers +object +Optional Settings that determine what sets of accounts can be used to sign a transaction on behalf of this account using multisigning. + + +signers. threshold +integer +Optional A target number for the signer weights. A multi-signature from this list is valid only if the sum weights of the signatures provided is equal or greater than this value. To delete the signers setting, use the value 0. + + +signers. weights +array +Optional Weights of signatures for each signer. + + +signers. weights[] +object +An association of an address and a weight. + + +signers.weights[]. address +address +A Ripple account address + + +signers.weights[]. weight +integer +The weight that the signature of this account counts as towards the threshold. + + transferRate number,null Optional The fee to charge when users transfer this account’s issuances, represented as billionths of a unit. Use null to set no fee. @@ -1408,6 +1443,11 @@ const api = new RippleAPI(); The ordering index of the transaction in the ledger. +outcome. deliveredAmount +amount +Optional For payment transactions, it is impossible to reliably compute the actual delivered amount from the balanceChanges due to fixed precision. If the payment is not a partial payment and the transaction succeeded, the deliveredAmount should always be considered to be the amount specified in the transaction. + + outcome. timestamp date-time string Optional The timestamp when the transaction was validated. (May be missing when requesting transactions in binary mode.) @@ -1446,6 +1486,11 @@ return api.getTransaction(id).then(transaction => { "result": "tesSUCCESS", "timestamp": "2013-03-12T23:56:50.000Z", "fee": "0.00001", + "deliveredAmount": { + "currency": "USD", + "value": "0.001", + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, "balanceChanges": { "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo": [ { @@ -1623,6 +1668,11 @@ return api.getTransactions(address).then(transaction => { "outcome": { "result": "tesSUCCESS", "fee": "0.00001", + "deliveredAmount": { + "currency": "USD", + "value": "0.001", + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, "balanceChanges": { "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo": [ { @@ -1715,6 +1765,11 @@ return api.getTransactions(address).then(transaction => { "outcome": { "result": "tesSUCCESS", "fee": "0.00001", + "deliveredAmount": { + "currency": "USD", + "value": "0.001", + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, "balanceChanges": { "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo": [ { @@ -3736,6 +3791,36 @@ return api.getOrderbook(address, orderbook) Optional Requires incoming payments to specify a destination tag. +signers +object +Optional Settings that determine what sets of accounts can be used to sign a transaction on behalf of this account using multisigning. + + +signers. threshold +integer +Optional A target number for the signer weights. A multi-signature from this list is valid only if the sum weights of the signatures provided is equal or greater than this value. To delete the signers setting, use the value 0. + + +signers. weights +array +Optional Weights of signatures for each signer. + + +signers. weights[] +object +An association of an address and a weight. + + +signers.weights[]. address +address +A Ripple account address + + +signers.weights[]. weight +integer +The weight that the signature of this account counts as towards the threshold. + + transferRate number,null Optional The fee to charge when users transfer this account’s issuances, represented as billionths of a unit. Use null to set no fee. @@ -4761,7 +4846,7 @@ return api.prepareSuspendedPaymentExecution(address, suspendedPaymentExecution). }

    sign

    -

    sign(txJSON: string, secret: string): {signedTransaction: string, id: string}

    +

    sign(txJSON: string, secret: string, options: Object): {signedTransaction: string, id: string}

    Sign a prepared transaction. The signed transaction must subsequently be submitted.

    Parameters

    @@ -4783,6 +4868,16 @@ return api.prepareSuspendedPaymentExecution(address, suspendedPaymentExecution). + + + + + + + + + +
    secret string The secret of the account that is initiating the transaction.
    optionsobjectOptional Options that control the type of signature that will be generated.
    options. signAsaddressOptional The account that the signature should count for in multisigning.

    Return Value

    @@ -4818,10 +4913,63 @@ return api.sign(txJSON, secret); "id": "02ACE87F1996E3A23690A5BB7F1774BF71CCBA68F79805831B42ABAD5913D6F4" } +

    combine

    +

    combine(signedTransactions: Array<string>): {signedTransaction: string, id: string}

    +

    Combines signed transactions from multiple accounts for a multisignature transaction. The signed transaction must subsequently be submitted.

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    signedTransactionsarray\<string>An array of signed transactions (from the output of sign) to combine.
    +

    Return Value

    +

    This method returns an object with the following structure:

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    signedTransactionstringThe signed transaction represented as an uppercase hexadecimal string.
    ididThe Transaction ID of the signed transaction.
    +

    Example

    +
    const signedTransactions = [ "12000322800000002400000004201B000000116840000000000F42407300770B6578616D706C652E636F6D811407C532442A675C881BA1235354D4AB9D023243A6F3E0107321026C784C1987F83BACBF02CD3E484AFC84ADE5CA6B36ED4DCA06D5BA233B9D382774473045022100E484F54FF909469FA2033E22EFF3DF8EDFE62217062680BB2F3EDF2F185074FE0220350DB29001C710F0450DAF466C5D819DC6D6A3340602DE9B6CB7DA8E17C90F798114FE9337B0574213FA5BCC0A319DBB4A7AC0CCA894E1F1",
    +  "12000322800000002400000004201B000000116840000000000F42407300770B6578616D706C652E636F6D811407C532442A675C881BA1235354D4AB9D023243A6F3E01073210287AAAB8FBE8C4C4A47F6F1228C6E5123A7ED844BFE88A9B22C2F7CC34279EEAA74473045022100B09DDF23144595B5A9523B20E605E138DC6549F5CA7B5984D7C32B0E3469DF6B022018845CA6C203D4B6288C87DDA439134C83E7ADF8358BD41A8A9141A9B631419F8114517D9B9609229E0CDFE2428B586738C5B2E84D45E1F1" ];
    +return api.combine(signedTransactions);
    +
    +
    {
    +  "signedTransaction": "12000322800000002400000004201B000000116840000000000F42407300770B6578616D706C652E636F6D811407C532442A675C881BA1235354D4AB9D023243A6F3E01073210287AAAB8FBE8C4C4A47F6F1228C6E5123A7ED844BFE88A9B22C2F7CC34279EEAA74473045022100B09DDF23144595B5A9523B20E605E138DC6549F5CA7B5984D7C32B0E3469DF6B022018845CA6C203D4B6288C87DDA439134C83E7ADF8358BD41A8A9141A9B631419F8114517D9B9609229E0CDFE2428B586738C5B2E84D45E1E0107321026C784C1987F83BACBF02CD3E484AFC84ADE5CA6B36ED4DCA06D5BA233B9D382774473045022100E484F54FF909469FA2033E22EFF3DF8EDFE62217062680BB2F3EDF2F185074FE0220350DB29001C710F0450DAF466C5D819DC6D6A3340602DE9B6CB7DA8E17C90F798114FE9337B0574213FA5BCC0A319DBB4A7AC0CCA894E1F1",
    +  "id": "8A3BFD2214B4C8271ED62648FCE9ADE4EE82EF01827CF7D1F7ED497549A368CC"
    +}
    +

    submit

    submit(signedTransaction: string): Promise<Object>

    Submits a signed transaction. The transaction is not guaranteed to succeed; it must be verified with getTransaction.

    -

    Parameters

    +

    Parameters

    @@ -4838,7 +4986,7 @@ return api.sign(txJSON, secret);
    -

    Return Value

    +

    Return Value

    This method returns an object with the following structure:

    @@ -4861,7 +5009,7 @@ return api.sign(txJSON, secret);
    -

    Example

    +

    Example

    const signedTransaction = '12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304';
     return api.submit(signedTransaction)
       .then(result => {/* ... */});
    @@ -4874,7 +5022,7 @@ return api.submit(signedTransaction)
     

    generateAddress

    generateAddress(): {address: string, secret: string}

    Generate a new Ripple address and corresponding secret.

    -

    Parameters

    +

    Parameters

    @@ -4901,7 +5049,7 @@ return api.submit(signedTransaction)
    -

    Return Value

    +

    Return Value

    This method returns an object with the following structure:

    @@ -4924,7 +5072,7 @@ return api.submit(signedTransaction)
    -

    Example

    +

    Example

    return api.generateAddress();
     
    {
    @@ -4935,7 +5083,7 @@ return api.submit(signedTransaction)
     

    computeLedgerHash

    computeLedgerHash(ledger: Object): string

    Compute the hash of a ledger.

    -

    Parameters

    +

    Parameters

    @@ -5030,9 +5178,9 @@ The parameter to this method has the same structure as the return value of getLe -

    Return Value

    +

    Return Value

    This method returns an uppercase hexadecimal string representing the hash of the ledger.

    -

    Example

    +

    Example

    const ledger = {
       "stateHash": "D9ABF622DA26EEEE48203085D4BC23B0F77DC6F8724AC33D975DA3CA492D2E44",
       "closeTime": "2015-08-12T01:01:10.000Z",
    @@ -5051,7 +5199,7 @@ return api.computeLedgerHash(ledger);
     

    API Events

    ledger

    This event is emitted whenever a new ledger version is validated on the connected server.

    -

    Return Value

    +

    Return Value

    @@ -5103,7 +5251,7 @@ return api.computeLedgerHash(ledger);
    -

    Example

    +

    Example

    api.on('ledger', ledger => {
       console.log(JSON.stringify(ledger, null, 2));
     });
    @@ -5121,7 +5269,7 @@ return api.computeLedgerHash(ledger);
     

    error

    This event is emitted when there is an error on the connection to the server that cannot be associated to a specific request.

    -

    Return Value

    +

    Return Value

    The first parameter is a string indicating the error type: badMessage - rippled returned a malformed message websocket - the websocket library emitted an error @@ -5131,7 +5279,7 @@ return api.computeLedgerHash(ledger); the message that caused the error for badMessage the error object emitted for websocket * the parsed response for rippled errors

    -

    Example

    +

    Example

    api.on('error', (errorCode, errorMessage, data) => {
       console.log(errorCode + ': ' + errorMessage);
     });
    diff --git a/tool/pages.json b/tool/pages.json
    index 8973697f9d..fb3587354e 100644
    --- a/tool/pages.json
    +++ b/tool/pages.json
    @@ -111,7 +111,7 @@
         },
         {
             "name": "RippleAPI",
    -        "md": "https://raw.githubusercontent.com/ripple/ripple-lib/0.16.2/docs/index.md",
    +        "md": "https://raw.githubusercontent.com/ripple/ripple-lib/0.16.7/docs/index.md",
             "html": "rippleapi.html",
             "ripple.com": "https://ripple.com/build/rippleapi/",
             "category": "References"