xrpl.js

A JavaScript/TypeScript API for interacting with the XRP Ledger in Node.js and the browser

Downloads
1.8M
Stars
1.2K
Committers
139

Bot releases are hidden (Show)

xrpl.js - 1.4.2 (2019-11-14)

Published by intelliot almost 5 years ago

  • Add support for tick size (#1090) (thanks @RareData)
  • Update email hash default to allow proper clearing (#1089) (thanks @RareData)
  • Fix Unhandled Promise Rejection Warning on message _send (thanks @nickewansmith)
    • Add an immediate catch to the _send promise passed to _whenReady in case there is rejection before async handlers are added (#1092)
  • Docs improvements
    • Add XRP Toolkit reference (#1088)
  • Internal improvements
    • Add a prettier config
    • Update Node.js Testing Versions (#1085)
xrpl.js - 1.4.1 (2019-11-06)

Published by intelliot almost 5 years ago

  • Compatibility: Change TypeScript compile target back to es6 (#1071)
    • WARNING: This allows for the use of Node v6, which is no longer supported by Node.js, as it was end-of-life'd in April 2019
    • We recommend updating to Node v8/v10 ASAP in order to get security updates and fixes from the Node.js team
    • We are not actively running tests against Node v6 (ref #1076)
  • Docs: getAccountObjects doc fix
  • Dependencies:
    • Update bignumber.js
    • Update ripple-keypairs
    • Update ws
  • Build process: Update webpack flow
xrpl.js - 1.4.0 (2019-10-28)

Published by intelliot almost 5 years ago

  • Unref timer so it does not hang the Node.js process (#773)
  • Add a 2-second timeout for connect() (#1044)
  • Improve getTransaction() error when tx has not been validated yet (#1046)
  • Add support for the new X-address format (1041)
  • Fix error in Safari, Chrome 78, Firefox 70 (#869)
  • Some error messages have changed slightly. For example:
    • -instance.Account is not of a type(s) string,instance.Account does not conform to the "address" format
    • +instance.Account is not of a type(s) string,instance.Account is not exactly one from <xAddress>,<classicAddress>

Internal improvements

  • Reduce dependency size
  • Move tests to TypeScript
  • Replace tslint with eslint
  • Update https-proxy-agent
  • Add tests
xrpl.js - 1.3.4 (2019-10-18)

Published by intelliot about 5 years ago

  • Update ripple-lib-transactionparser
  • Improve error message when signing fails (e.g. due to trailing zeros)
  • Integrate ripple-hashes (in TypeScript with improved naming and docs)
  • Add multi-signing example to sign() method docs
  • Update TypeScript
xrpl.js - 1.3.3 (2019-09-10)

Published by intelliot about 5 years ago

xrpl.js - 1.3.2 (2019-09-03)

Published by intelliot about 5 years ago

  • Export and document rippleTimeToISO8601() method
  • Add type for isValidAddress (fixes error TS7016, #1032)
  • Docs: update recommended Node.js version (#1031)

When using this release with rippled, we recommend using rippled version 1.3.1 or later.

xrpl.js - 1.3.1 (2019-08-26)

Published by intelliot about 5 years ago

  • Upgrade to gulp 4 (#1030)
  • Remove http server (unused)
  • Update dependencies

There are no changes in the browser version with this release. The npm package for Node.js should be slightly smaller.

When using this release with rippled, we recommend using rippled version 1.3.1.

xrpl.js - 1.3.0 (2019-08-16)

Published by intelliot about 5 years ago

Bug fixes:

  • Breaking change: Fix getServerInfo (#1012)

Before:

{
  // ...
  "load": {
    "jobTypes": {
      "0": {"jobType": "untrustedValidation", "perSecond": 10},
      "1": {"jobType": "ledgerData", "peakTime": 2, "perSecond": 2},
      "2": {"inProgress": 1, "jobType": "clientCommand", "perSecond": 1},
      "3": {"jobType": "transaction", "perSecond": 1},
      // ...
    },
    "threads": 6
  },
  // ...
}

After:

{
  // ...
  "load": {
    "jobTypes": [
      {
        "jobType": "untrustedValidation",
        "perSecond": 8
      },
      {
        "avgTime": 2,
        "jobType": "ledgerData",
        "peakTime": 72,
        "perSecond": 2
      },
      {
        "inProgress": 1,
        "jobType": "clientCommand",
        "perSecond": 1
      },
      {
        "jobType": "transaction",
        "perSecond": 1
      },
      // ...
    ],
    "threads": 6
  },
  // ...
}
  • Sign method - verify accurate encoding (#1026)
    • In previous versions, the following could be encoded incorrectly:
      • Amounts of XRP with more than 6 decimal places
      • Amounts of XRP drops with any decimal places
    • In versions 1.2.5 and 1.3.0, amounts that are invalid in this way will throw an error
  • Expand APIOptions by extending ConnectionOptions (#1018, fixes #1017)
  • Fix docs for destination.address (#1011)

New features:

  • Support removing a signer list (#1021)
  • Export setCanonicalFlag method from src/transaction/utils

Improvements:

  • Clean up phrasing in schema descriptions (#1023)
  • Improve docs
  • Update dependencies

Since this release fixes a bug that could cause transactions to be serialized incorrectly during the signing process, it has also been simultaneously released as version 1.2.5 (patch release).

When using this release with rippled, we recommend using rippled version 1.3.1.

xrpl.js - 1.2.5 (2019-08-16)

Published by intelliot about 5 years ago

Bug fixes:

  • Breaking change: Fix getServerInfo (#1012)

Before:

{
  // ...
  "load": {
    "jobTypes": {
      "0": {"jobType": "untrustedValidation", "perSecond": 10},
      "1": {"jobType": "ledgerData", "peakTime": 2, "perSecond": 2},
      "2": {"inProgress": 1, "jobType": "clientCommand", "perSecond": 1},
      "3": {"jobType": "transaction", "perSecond": 1},
      // ...
    },
    "threads": 6
  },
  // ...
}

After:

{
  // ...
  "load": {
    "jobTypes": [
      {
        "jobType": "untrustedValidation",
        "perSecond": 8
      },
      {
        "avgTime": 2,
        "jobType": "ledgerData",
        "peakTime": 72,
        "perSecond": 2
      },
      {
        "inProgress": 1,
        "jobType": "clientCommand",
        "perSecond": 1
      },
      {
        "jobType": "transaction",
        "perSecond": 1
      },
      // ...
    ],
    "threads": 6
  },
  // ...
}
  • Sign method - verify accurate encoding (#1026)
    • In previous versions, the following could be encoded incorrectly:
      • Amounts of XRP with more than 6 decimal places
      • Amounts of XRP drops with any decimal places
    • In versions 1.2.5 and 1.3.0, amounts that are invalid in this way will throw an error
  • Expand APIOptions by extending ConnectionOptions (#1018, fixes #1017)
  • Fix docs for destination.address (#1011)

New features:

  • Support removing a signer list (#1021)
  • Export setCanonicalFlag method from src/transaction/utils

Improvements:

  • Clean up phrasing in schema descriptions (#1023)
  • Improve docs
  • Update dependencies
xrpl.js - 1.2.4 (2019-06-06)

Published by intelliot over 5 years ago

  • Update README.md
  • Clarify docs
  • Update dependencies
  • Fix typos
  • Fix types
xrpl.js - 1.2.3 (2019-04-30)

Published by intelliot over 5 years ago

  • Fix browser builds

Below are recent changes that were also included in ripple-lib 1.2.2:

  • Prevent prepareTransaction from overwriting Fee and/or LastLedgerSequence (#997)
  • Add deliveredAmount as optional field for type Outcome (#996)
  • Fix build failure with TS strict checks (#993)
xrpl.js - 1.2.2 (2019-04-15)

Published by mDuo13 over 5 years ago

  • Prevent prepareTransaction from overwriting Fee and/or LastLedgerSequence (#997)
  • Add deliveredAmount as optional field for type Outcome (#996)
  • Fix build failure with TS strict checks (#993)

Minor changes:

  • Use TypeScript project references
  • Travis: Drop node 9 and add node 11 for testing
  • Bump versions of devDependencies
xrpl.js - Add support for tecKILLED

Published by intelliot over 5 years ago

1.2.1 (2019-03-23)

  • Update ripple-binary-codec to 0.2.1 to support tecKILLED
xrpl.js - 1.2.0 (2019-03-19)

Published by intelliot over 5 years ago

1.2.0 (2019-03-19)

This release:

  • changes the way you handle errors for the prepare* methods.
  • improves the message field of RippledErrors.
  • allows Sequence to be set in the transaction JSON provided to
    prepareTransaction.

For details, continue reading:

[BREAKING CHANGE] prepare* methods reject the Promise on error

The prepare* methods now always reject the Promise when an error occurs, instead of throwing.

Previously, the methods would synchronously throw on validation errors, despite being asynchronous methods that return Promises.

In other words, to handle errors in the past, you would need to use a try/catch block:

// OBSOLETE - no need for try/catch anymore
try {
  api.preparePayment(address, payment, instructions).then(prepared => {
    res.send(prepared.txJSON);
  }).catch(error => {
    // Handle asynchronous error
  });
} catch (error) {
    // Handle synchronous error
}

Now, you can rely on the Promise's catch handler, which is called with the error when the Promise is rejected:

api.preparePayment(address, payment, instructions).then(prepared => {
  res.send(prepared.txJSON);
}).catch(error => {
  // Handle error
});

This applies to:

  • preparePayment
  • prepareTrustline
  • prepareOrder
  • prepareOrderCancellation
  • prepareSettings
  • prepareEscrowCreation
  • prepareEscrowExecution
  • prepareCheckCreate
  • prepareCheckCash
  • prepareCheckCancel
  • preparePaymentChannelCreate
  • preparePaymentChannelClaim
  • preparePaymentChannelFund

Improved RippledError message

Previously, RippledErrors (errors from rippled) used rippled's error field as the message.

Now, the error_message field is used as the message.

This helps to surface the specific cause of an error.

For example, before:

[RippledError(invalidParams, { error: 'invalidParams',
  error_code: 31,
  error_message: 'Missing field \'account\'.',
  id: 3,
  request: { command: 'account_info', id: 3 },
  status: 'error',
  type: 'response' })]

After:

[RippledError(Missing field 'account'., { error: 'invalidParams',
  error_code: 31,
  error_message: 'Missing field \'account\'.',
  id: 3,
  request: { command: 'account_info', id: 3 },
  status: 'error',
  type: 'response' })]

In this case, you can see at a glance that account is the missing field.

The error field is still available in errorObject.data.error.

When error_message is not set (as with e.g. error 'entryNotFound'), the error field is used as the message.

[BUG FIX] prepareTransaction does not overwrite the Sequence field

The prepareTransaction method now allows Sequence to be set in the Transaction JSON object, instead of overwriting it with the account's expected sequence based on the state of the ledger.

Previously, you had to use the sequence field in the instructions object to manually set a transaction's sequence number.

New in rippled 1.2.1

As this is the first release of ripple-lib following the release of rippled 1.2.1, we would like to highlight the following API improvements:

  1. The delivered_amount field has been added to the ledger method, and to transaction subscriptions.

     api.getLedger({includeTransactions: true, includeAllData: true, ledgerVersion: 17718771}).then(...)
    

    You can also call ledger directly:

     request('ledger', {...}).then(...)
    
  2. Support for Ed25519 seeds encoded using ripple-lib

You have access to these improvements when you use a rippled server running version 1.2.1 or later. At the time of writing, we recommend using rippled version 1.2.2 or later.

xrpl.js - 1.1.2

Published by intelliot almost 6 years ago

1.1.2 (2018-12-12)

  • Update submit response (#978)
    • Includes the full object returned by rippled, while keeping the existing
      fields for backward compatibility
  • Add getLedger option for ledger hash (#980)
    • Use the ledgerHash option to get a specific ledger by hash
xrpl.js - 1.1.1 - Fix getOrderbook

Published by intelliot almost 6 years ago

1.1.1 (2018-11-27)

  • Fix getOrderbook offer sorting (#970)
    • BREAKING CHANGE: The ordering of offers returned by getOrderbook has
      been changed so that offers with the best quality are sorted first
  • Add new helper methods for working with the rippled APIs:
    • formatBidsAndAsks: Takes offers and returns a formatted order book object
      with bids and asks
    • renameCounterpartyToIssuer: Takes an object and renames the counterparty
      field to issuer
  • TypeScript: Add return type for generateAddress (#968)

When using ripple-lib with rippled, we recommend using rippled version 1.1.1 or
later.

xrpl.js - 1.1.0 - DepositPreauth support

Published by intelliot almost 6 years ago

1.1.0 (2018-10-31)

  • Add support for Node.js v10 LTS (#964)
  • Add DepositPreauth (#958)
  • In FormattedTransactionType, the Outcome's balanceChanges property had
    the wrong type. This is now fixed (#955)
  • Add/fix docs for: xrpToDrops, dropsToXrp, iso8601ToRippleTime, schemaValidator, isValidAddress, isValidSecret, deriveKeypair, deriveAddress

When using this library online with rippled, we recommend using rippled version 1.1.1 or later.

xrpl.js - 1.0.2

Published by intelliot about 6 years ago

1.0.2 (2018-10-16)

  • Fix #954: Exclude SendMax from all XRP to XRP payments (thanks @jefftrudeau)
  • TypeScript
    • book_offers returns offers type OfferLedgerEntry (#951)
    • Use object (#936)
xrpl.js - 1.0.1

Published by intelliot about 6 years ago

1.0.1 (2018-09-27)

  • Add address/secret/key validation and derivation methods (#932)
    • isValidAddress(address: string) : boolean: Checks if the specified string contains a valid address.
    • isValidSecret(secret: string): boolean: Checks if the specified string contains a valid secret.
    • deriveKeypair(seed: string): {privateKey: string, publicKey: string}: Derive a public and private key from a seed.
    • deriveAddress(publicKey: string): string: Derive an XRP Ledger address from a public key.
  • To derive an address from a secret:
    1. Derive the public key from the secret.
    2. Derive the address from the public key.
    • Example: const address = api.deriveAddress(api.deriveKeypair(secret).publicKey)
  • Update server regex to accommodate UDS (#944)
  • Include memos when parsing trustlines (#949)
  • Add remaining LedgerEntry types (#943)
xrpl.js - 1.0.0 (2018-09-10)

Published by intelliot about 6 years ago

We are pleased to announce the release of ripple-lib version 1.0.0.

This version features a range of changes and improvements that make the library
more capable and flexible. It includes new methods for accessing rippled APIs,
including subscriptions.

When using this version with rippled for online functionality, we recommend
using rippled version 1.0.1 or later.

Here is a summary of the changes since ripple-lib version 0.22.0, which was
the last non-beta version.

New Features

Data Validation and Errors

Breaking Changes

The following changes were introduced in 1.0.0.

  • getTransaction() and getTransactions()
    • The specification.destination.amount field has been removed from the parsed transaction response.
    • To determine the amount that a transaction delivered, use outcome.deliveredAmount.
    • If you require the provisional requested Amount from the original transaction:
      • Use getTransaction's includeRawTransaction option, or
      • Use getTransactions's includeRawTransactions option, or
      • Use the rippled APIs directly with request. For example, call the API methods tx, account_tx, etc.
  • getLedger() response object
    • The rawTransactions field has been removed (for consistency with getTransaction() and getTransactions()).
    • Instead, within each transaction, use the new rawTransaction JSON string.
    • The metaData field has been renamed to meta for consistency with rippled's tx method.
    • ledger_index has been added to each raw transaction.