You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

utils.d.ts 1.7KB

123456789101112131415161718192021222324252627282930313233
  1. import * as _ from 'lodash';
  2. import * as common from '../common';
  3. import { Connection } from '../common';
  4. import { FormattedTransactionType } from '../transaction/types';
  5. import { Issue } from '../common/types/objects';
  6. import { RippleAPI } from '..';
  7. export declare type RecursiveData = {
  8. marker: string;
  9. results: Array<any>;
  10. };
  11. export declare type Getter = (marker?: string, limit?: number) => Promise<RecursiveData>;
  12. declare function clamp(value: number, min: number, max: number): number;
  13. declare function getXRPBalance(connection: Connection, address: string, ledgerVersion?: number): Promise<string>;
  14. declare function getRecursive(getter: Getter, limit?: number): Promise<Array<any>>;
  15. declare function renameCounterpartyToIssuer<T>(obj: T & {
  16. counterparty?: string;
  17. issuer?: string;
  18. }): T & {
  19. issuer?: string;
  20. };
  21. export declare type RequestBookOffersArgs = {
  22. taker_gets: Issue;
  23. taker_pays: Issue;
  24. };
  25. declare function renameCounterpartyToIssuerInOrder(order: RequestBookOffersArgs): RequestBookOffersArgs & _.Dictionary<Issue & {
  26. issuer?: string;
  27. }>;
  28. declare function compareTransactions(first: FormattedTransactionType, second: FormattedTransactionType): number;
  29. declare function hasCompleteLedgerRange(connection: Connection, minLedgerVersion?: number, maxLedgerVersion?: number): Promise<boolean>;
  30. declare function isPendingLedgerVersion(connection: Connection, maxLedgerVersion?: number): Promise<boolean>;
  31. declare function ensureLedgerVersion(this: RippleAPI, options: any): Promise<object>;
  32. export { getXRPBalance, ensureLedgerVersion, compareTransactions, renameCounterpartyToIssuer, renameCounterpartyToIssuerInOrder, getRecursive, hasCompleteLedgerRange, isPendingLedgerVersion, clamp, common };
  33. //# sourceMappingURL=utils.d.ts.map