mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-16 18:35:50 +00:00
* Add support for all rippled APIs, including subscriptions. * Add support for arbitrary stream message types. * Note that rippled APIs take amounts in drops. * request() will be available in ripple-lib version 1.0.0+
28 lines
786 B
TypeScript
28 lines
786 B
TypeScript
import {removeUndefined} from '../common'
|
|
import {RippleAPI} from '../api'
|
|
import {
|
|
GetAccountObjectsOptions,
|
|
AccountObjectsResponse
|
|
} from '../common/types/commands/account_objects'
|
|
|
|
export default async function getAccountObjects(
|
|
this: RippleAPI,
|
|
address: string,
|
|
options: GetAccountObjectsOptions = {}
|
|
): Promise<AccountObjectsResponse> {
|
|
// Don't validate the options so that new types can be passed
|
|
// through to rippled. rippled validates requests.
|
|
|
|
// Make Request
|
|
const response = await this.request('account_objects', removeUndefined({
|
|
account: address,
|
|
type: options.type,
|
|
ledger_hash: options.ledgerHash,
|
|
ledger_index: options.ledgerIndex,
|
|
limit: options.limit,
|
|
marker: options.marker
|
|
}))
|
|
// Return Response
|
|
return response
|
|
}
|