mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-06-04 01:06:42 +00:00
Implements TypeScript types for utility method requests/responses (#1516)
* ping * random * export
This commit is contained in:
@@ -12,6 +12,8 @@ import { NoRippleCheckRequest, NoRippleCheckResponse } from "./norippleCheck";
|
||||
import { ConsensusStream, LedgerStream, OrderBookStream, PeerStatusStream, Stream, SubscribeRequest, SubscribeResponse, TransactionStream, ValidationStream } from "./subscribe";
|
||||
import { UnsubscribeRequest, UnsubscribeResponse } from "./unsubscribe";
|
||||
import { PathFindRequest, PathFindResponse } from "./pathFind";
|
||||
import { PingRequest, PingResponse } from "./ping";
|
||||
import { RandomRequest, RandomResponse } from "./random";
|
||||
import { RipplePathFindRequest, RipplePathFindResponse } from "./ripplePathFind";
|
||||
|
||||
type Request = // account methods
|
||||
@@ -32,6 +34,9 @@ type Request = // account methods
|
||||
// subscription methods
|
||||
| SubscribeRequest
|
||||
| UnsubscribeRequest
|
||||
// utility methods
|
||||
| PingRequest
|
||||
| RandomRequest
|
||||
|
||||
type Response = // account methods
|
||||
AccountChannelsResponse
|
||||
@@ -51,6 +56,9 @@ type Response = // account methods
|
||||
// subscription methods
|
||||
| SubscribeResponse
|
||||
| UnsubscribeResponse
|
||||
// utility methods
|
||||
| PingResponse
|
||||
| RandomResponse
|
||||
|
||||
export {
|
||||
Request,
|
||||
@@ -94,5 +102,10 @@ export {
|
||||
OrderBookStream,
|
||||
ConsensusStream,
|
||||
UnsubscribeRequest,
|
||||
UnsubscribeResponse
|
||||
UnsubscribeResponse,
|
||||
// utility methods
|
||||
PingRequest,
|
||||
PingResponse,
|
||||
RandomRequest,
|
||||
RandomResponse
|
||||
}
|
||||
|
||||
9
src/models/methods/ping.ts
Normal file
9
src/models/methods/ping.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { BaseRequest, BaseResponse } from "./baseMethod";
|
||||
|
||||
export interface PingRequest extends BaseRequest {
|
||||
command: "ping"
|
||||
}
|
||||
|
||||
export interface PingResponse extends BaseResponse {
|
||||
result: {}
|
||||
}
|
||||
11
src/models/methods/random.ts
Normal file
11
src/models/methods/random.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { BaseRequest, BaseResponse } from "./baseMethod";
|
||||
|
||||
export interface RandomRequest extends BaseRequest {
|
||||
command: "random"
|
||||
}
|
||||
|
||||
export interface RandomResponse extends BaseResponse {
|
||||
result: {
|
||||
random: string
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user