Creates a new Client with a websocket connection to a rippled server.
URL of the server to connect to.
Options for client settings.
Optional ledger_Optional ledger_Optional limit?: numberOptional peer?: stringOptional ledger_Optional ledger_Optional limit?: numberOptional taker?: null | stringOptional ledger_Optional ledger_Optional signersCount: numberOptional Optional opts: { Optional
Optional autofill?: booleanOptional failOptional wallet?: WalletReadonly feeFactor to multiply estimated fee by to provide a cushion in case the required fee rises during submission of a transaction. Defaults to 1.2.
Readonly maxMaximum transaction cost to allow, in decimal XRP. Must be a string-encoded number. Defaults to '2'.
Get the url that the client is connected to.
The URL of the server this client is connected to.
Tells the Client instance to connect to its rippled server.
A promise that resolves with a void value when a connection is established.
Client.connect() establishes a connection between a Client object and the server.
const { Client } = require('xrpl')
const client = new Client('wss://s.altnet.rippletest.net:51233')
await client.connect()
// do something with the client
await client.disconnect()
If you open a client connection, be sure to close it with await client.disconnect()
before exiting your application.
Disconnects the XRPL client from the server and cancels all pending requests and subscriptions. Call when you want to disconnect the client from the server, such as when you're finished using the client or when you need to switch to a different server.
A promise that resolves with a void value when a connection is destroyed.
To use the disconnect() method, you first need to create a new Client object and connect it to a server:
const { Client } = require('xrpl')
const client = new Client('wss://s.altnet.rippletest.net:51233')
await client.connect()
// do something with the client
await client.disconnect()
Event handler for subscription streams.
const api = new Client('wss://s.altnet.rippletest.net:51233')
api.on('transaction', (tx: TransactionStream) => {
console.log("Received Transaction")
console.log(tx)
})
await api.connect()
const response = await api.request({
command: 'subscribe',
streams: ['transactions_proposed']
})
Event handler for subscription streams.
Function to run on event.
This, because it inherits from EventEmitter.
Event handler for subscription streams.
Function to run on event.
This, because it inherits from EventEmitter.
Event handler for subscription streams.
Function to run on event.
This, because it inherits from EventEmitter.
Event handler for subscription streams.
Function to run on event.
This, because it inherits from EventEmitter.
Event handler for subscription streams.
Function to run on event.
This, because it inherits from EventEmitter.
Event handler for subscription streams.
Function to run on event.
This, because it inherits from EventEmitter.
Event handler for subscription streams.
Function to run on event.
This, because it inherits from EventEmitter.
Event handler for subscription streams.
Function to run on event.
This, because it inherits from EventEmitter.
Event handler for subscription streams.
Function to run on event.
Rest ...err: any[]Rest This, because it inherits from EventEmitter.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes a request to the client with the given command and additional request body parameters.
The response from the server.
Makes multiple paged requests to the client to return a given number of
resources. Multiple paged requests will be made until the limit
number of resources is reached (if no limit is provided, a single request
will be made).
If the command is unknown, an additional collect property is required to
know which response key contains the array of resources.
NOTE: This command is used by existing methods and is not recommended for general use. Instead, use rippled's built-in pagination and make multiple requests as needed.
The array of all responses.
ValidationError if there is no collection key (either from a known command or for the unknown command).
Makes multiple paged requests to the client to return a given number of
resources. Multiple paged requests will be made until the limit
number of resources is reached (if no limit is provided, a single request
will be made).
If the command is unknown, an additional collect property is required to
know which response key contains the array of resources.
NOTE: This command is used by existing methods and is not recommended for general use. Instead, use rippled's built-in pagination and make multiple requests as needed.
The array of all responses.
ValidationError if there is no collection key (either from a known command or for the unknown command).
Makes multiple paged requests to the client to return a given number of
resources. Multiple paged requests will be made until the limit
number of resources is reached (if no limit is provided, a single request
will be made).
If the command is unknown, an additional collect property is required to
know which response key contains the array of resources.
NOTE: This command is used by existing methods and is not recommended for general use. Instead, use rippled's built-in pagination and make multiple requests as needed.
The array of all responses.
ValidationError if there is no collection key (either from a known command or for the unknown command).
Makes multiple paged requests to the client to return a given number of
resources. Multiple paged requests will be made until the limit
number of resources is reached (if no limit is provided, a single request
will be made).
If the command is unknown, an additional collect property is required to
know which response key contains the array of resources.
NOTE: This command is used by existing methods and is not recommended for general use. Instead, use rippled's built-in pagination and make multiple requests as needed.
The array of all responses.
ValidationError if there is no collection key (either from a known command or for the unknown command).
Makes multiple paged requests to the client to return a given number of
resources. Multiple paged requests will be made until the limit
number of resources is reached (if no limit is provided, a single request
will be made).
If the command is unknown, an additional collect property is required to
know which response key contains the array of resources.
NOTE: This command is used by existing methods and is not recommended for general use. Instead, use rippled's built-in pagination and make multiple requests as needed.
The array of all responses.
ValidationError if there is no collection key (either from a known command or for the unknown command).
Makes multiple paged requests to the client to return a given number of
resources. Multiple paged requests will be made until the limit
number of resources is reached (if no limit is provided, a single request
will be made).
If the command is unknown, an additional collect property is required to
know which response key contains the array of resources.
NOTE: This command is used by existing methods and is not recommended for general use. Instead, use rippled's built-in pagination and make multiple requests as needed.
The array of all responses.
ValidationError if there is no collection key (either from a known command or for the unknown command).
Requests the next page of data.
Request to send.
Response with the marker to use in the request.
The response with the next page of data.
Requests the next page of data.
Request to send.
Response with the marker to use in the request.
The response with the next page of data.
Requests the next page of data.
Request to send.
Response with the marker to use in the request.
The response with the next page of data.
Requests the next page of data.
Request to send.
Response with the marker to use in the request.
The response with the next page of data.
Requests the next page of data.
Request to send.
Response with the marker to use in the request.
The response with the next page of data.
Rippled Version used by the server this client is connected to
Readonly connectionNetwork ID of the server this client is connected to
Optional signersCount: numberOptional Use autofill instead, provided for users familiar with v1
Static Readonly captureStatic captureSets or gets the default captureRejection value for all emitters.
Static defaultStatic Readonly errorThis symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error' listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error' event is emitted, therefore the process will still crash if no
regular 'error' listener is installed.
Static listenerStatic onStatic onceGenerated using TypeDoc
Client for interacting with rippled servers.