mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
* Add request interface & typings - src/api: add basic implementation of request/requestAll() - src/ledgers/account_info: refactor to simplify with request() - src/ledgers/balances: refactor to simplify with request() - src/ledgers/orderbook: refactor to simplify with requestAll() - src/ledgers/orders: refactor to simplify with requestAll() - src/ledgers/trustlines: refactor to simplify with requestAll() * standardize on Formatted prefix
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
|
|
import {Amount} from '../common/types/objects'
|
|
|
|
export type OrderSpecification = {
|
|
direction: string,
|
|
quantity: Amount,
|
|
totalPrice: Amount,
|
|
immediateOrCancel?: boolean,
|
|
fillOrKill?: boolean,
|
|
// If enabled, the offer will not consume offers that exactly match it, and
|
|
// instead becomes an Offer node in the ledger. It will still consume offers
|
|
// that cross it.
|
|
passive?: boolean
|
|
}
|
|
|
|
export type Order = {
|
|
specification: OrderSpecification,
|
|
properties: {
|
|
maker: string,
|
|
sequence: number,
|
|
makerExchangeRate: string
|
|
}
|
|
}
|
|
|
|
export type GetLedger = {
|
|
// TODO: properties in type don't match response object. Fix!
|
|
// accepted: boolean,
|
|
// closed: boolean,
|
|
stateHash: string,
|
|
closeTime: string,
|
|
closeTimeResolution: number,
|
|
closeFlags: number,
|
|
ledgerHash: string,
|
|
ledgerVersion: number,
|
|
parentLedgerHash: string,
|
|
parentCloseTime: string,
|
|
totalDrops: string,
|
|
transactionHash: string,
|
|
transactions?: Array<Object>,
|
|
rawTransactions?: string,
|
|
transactionHashes?: Array<string>,
|
|
rawState?: string,
|
|
stateHashes?: Array<string>
|
|
}
|