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.

index.d.ts 6.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /// <reference types="node" />
  2. import { EventEmitter } from 'events';
  3. import { AccountChannelsRequest, AccountChannelsResponse, AccountCurrenciesRequest, AccountCurrenciesResponse, AccountInfoRequest, AccountInfoResponse, AccountLinesRequest, AccountLinesResponse, AccountNFTsRequest, AccountNFTsResponse, AccountObjectsRequest, AccountObjectsResponse, AccountOffersRequest, AccountOffersResponse, AccountTxRequest, AccountTxResponse, GatewayBalancesRequest, GatewayBalancesResponse, NoRippleCheckRequest, NoRippleCheckResponse, LedgerRequest, LedgerResponse, LedgerClosedRequest, LedgerClosedResponse, LedgerCurrentRequest, LedgerCurrentResponse, LedgerDataRequest, LedgerDataResponse, LedgerEntryRequest, LedgerEntryResponse, SubmitRequest, SubmitResponse, SubmitMultisignedRequest, SubmitMultisignedResponse, TransactionEntryRequest, TransactionEntryResponse, TxRequest, TxResponse, BookOffersRequest, BookOffersResponse, DepositAuthorizedRequest, DepositAuthorizedResponse, PathFindRequest, PathFindResponse, RipplePathFindRequest, RipplePathFindResponse, ChannelVerifyRequest, ChannelVerifyResponse, FeeRequest, FeeResponse, ManifestRequest, ManifestResponse, ServerInfoRequest, ServerInfoResponse, ServerStateRequest, ServerStateResponse, PingRequest, PingResponse, RandomRequest, RandomResponse, LedgerStream, ValidationStream, TransactionStream, PathFindStream, PeerStatusStream, ConsensusStream, SubscribeRequest, SubscribeResponse, UnsubscribeRequest, UnsubscribeResponse, NFTBuyOffersRequest, NFTBuyOffersResponse, NFTSellOffersRequest, NFTSellOffersResponse } from '../models/methods';
  4. import { BaseRequest, BaseResponse } from '../models/methods/baseMethod';
  5. import { autofill, getLedgerIndex, getOrderbook, getBalances, getXrpBalance, submit, submitAndWait } from '../sugar';
  6. import fundWallet from '../Wallet/fundWallet';
  7. import { Connection, ConnectionUserOptions } from './connection';
  8. export interface ClientOptions extends ConnectionUserOptions {
  9. feeCushion?: number;
  10. maxFeeXRP?: string;
  11. proxy?: string;
  12. timeout?: number;
  13. }
  14. declare class Client extends EventEmitter {
  15. readonly connection: Connection;
  16. readonly feeCushion: number;
  17. readonly maxFeeXRP: string;
  18. constructor(server: string, options?: ClientOptions);
  19. get url(): string;
  20. request(r: AccountChannelsRequest): Promise<AccountChannelsResponse>;
  21. request(r: AccountCurrenciesRequest): Promise<AccountCurrenciesResponse>;
  22. request(r: AccountInfoRequest): Promise<AccountInfoResponse>;
  23. request(r: AccountLinesRequest): Promise<AccountLinesResponse>;
  24. request(r: AccountNFTsRequest): Promise<AccountNFTsResponse>;
  25. request(r: AccountObjectsRequest): Promise<AccountObjectsResponse>;
  26. request(r: AccountOffersRequest): Promise<AccountOffersResponse>;
  27. request(r: AccountTxRequest): Promise<AccountTxResponse>;
  28. request(r: BookOffersRequest): Promise<BookOffersResponse>;
  29. request(r: ChannelVerifyRequest): Promise<ChannelVerifyResponse>;
  30. request(r: DepositAuthorizedRequest): Promise<DepositAuthorizedResponse>;
  31. request(r: FeeRequest): Promise<FeeResponse>;
  32. request(r: GatewayBalancesRequest): Promise<GatewayBalancesResponse>;
  33. request(r: LedgerRequest): Promise<LedgerResponse>;
  34. request(r: LedgerClosedRequest): Promise<LedgerClosedResponse>;
  35. request(r: LedgerCurrentRequest): Promise<LedgerCurrentResponse>;
  36. request(r: LedgerDataRequest): Promise<LedgerDataResponse>;
  37. request(r: LedgerEntryRequest): Promise<LedgerEntryResponse>;
  38. request(r: ManifestRequest): Promise<ManifestResponse>;
  39. request(r: NFTBuyOffersRequest): Promise<NFTBuyOffersResponse>;
  40. request(r: NFTSellOffersRequest): Promise<NFTSellOffersResponse>;
  41. request(r: NoRippleCheckRequest): Promise<NoRippleCheckResponse>;
  42. request(r: PathFindRequest): Promise<PathFindResponse>;
  43. request(r: PingRequest): Promise<PingResponse>;
  44. request(r: RandomRequest): Promise<RandomResponse>;
  45. request(r: RipplePathFindRequest): Promise<RipplePathFindResponse>;
  46. request(r: ServerInfoRequest): Promise<ServerInfoResponse>;
  47. request(r: ServerStateRequest): Promise<ServerStateResponse>;
  48. request(r: SubmitRequest): Promise<SubmitResponse>;
  49. request(r: SubmitMultisignedRequest): Promise<SubmitMultisignedResponse>;
  50. request(r: SubscribeRequest): Promise<SubscribeResponse>;
  51. request(r: UnsubscribeRequest): Promise<UnsubscribeResponse>;
  52. request(r: TransactionEntryRequest): Promise<TransactionEntryResponse>;
  53. request(r: TxRequest): Promise<TxResponse>;
  54. request<R extends BaseRequest, T extends BaseResponse>(r: R): Promise<T>;
  55. requestNextPage(req: AccountChannelsRequest, resp: AccountChannelsResponse): Promise<AccountChannelsResponse>;
  56. requestNextPage(req: AccountLinesRequest, resp: AccountLinesResponse): Promise<AccountLinesResponse>;
  57. requestNextPage(req: AccountObjectsRequest, resp: AccountObjectsResponse): Promise<AccountObjectsResponse>;
  58. requestNextPage(req: AccountOffersRequest, resp: AccountOffersResponse): Promise<AccountOffersResponse>;
  59. requestNextPage(req: AccountTxRequest, resp: AccountTxResponse): Promise<AccountTxResponse>;
  60. requestNextPage(req: LedgerDataRequest, resp: LedgerDataResponse): Promise<LedgerDataResponse>;
  61. on(event: 'connected', listener: () => void): this;
  62. on(event: 'disconnected', listener: (code: number) => void): this;
  63. on(event: 'ledgerClosed', listener: (ledger: LedgerStream) => void): this;
  64. on(event: 'validationReceived', listener: (validation: ValidationStream) => void): this;
  65. on(event: 'transaction', listener: (tx: TransactionStream) => void): this;
  66. on(event: 'peerStatusChange', listener: (status: PeerStatusStream) => void): this;
  67. on(event: 'consensusPhase', listener: (phase: ConsensusStream) => void): this;
  68. on(event: 'manifestReceived', listener: (manifest: ManifestResponse) => void): this;
  69. on(event: 'path_find', listener: (path: PathFindStream) => void): this;
  70. on(event: 'error', listener: (...err: any[]) => void): this;
  71. requestAll(req: AccountChannelsRequest): Promise<AccountChannelsResponse[]>;
  72. requestAll(req: AccountLinesRequest): Promise<AccountLinesResponse[]>;
  73. requestAll(req: AccountObjectsRequest): Promise<AccountObjectsResponse[]>;
  74. requestAll(req: AccountOffersRequest): Promise<AccountOffersResponse[]>;
  75. requestAll(req: AccountTxRequest): Promise<AccountTxResponse[]>;
  76. requestAll(req: BookOffersRequest): Promise<BookOffersResponse[]>;
  77. requestAll(req: LedgerDataRequest): Promise<LedgerDataResponse[]>;
  78. connect(): Promise<void>;
  79. disconnect(): Promise<void>;
  80. isConnected(): boolean;
  81. autofill: typeof autofill;
  82. submit: typeof submit;
  83. submitAndWait: typeof submitAndWait;
  84. prepareTransaction: typeof autofill;
  85. getXrpBalance: typeof getXrpBalance;
  86. getBalances: typeof getBalances;
  87. getOrderbook: typeof getOrderbook;
  88. getLedgerIndex: typeof getLedgerIndex;
  89. fundWallet: typeof fundWallet;
  90. }
  91. export { Client };
  92. //# sourceMappingURL=index.d.ts.map