-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows a list of swap IDs to be queried from the backend. A filter by swap status and a limit for how many entries should be queried can be applied.
- Loading branch information
1 parent
3b652be
commit c6e2e4b
Showing
18 changed files
with
1,060 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Arguments } from 'yargs'; | ||
import { ListSwapsRequest } from '../../proto/boltzrpc_pb'; | ||
import { ApiType, BuilderTypes } from '../BuilderComponents'; | ||
import { callback, loadBoltzClient } from '../Command'; | ||
|
||
export const command = 'listswaps [status] [limit]'; | ||
|
||
export const describe = 'lists swaps'; | ||
|
||
export const builder = { | ||
status: { | ||
type: 'string', | ||
describe: 'status of the swaps to list', | ||
}, | ||
limit: { | ||
type: 'number', | ||
describe: 'limit of the swaps to list per type', | ||
default: 100, | ||
}, | ||
}; | ||
|
||
export const handler = ( | ||
argv: Arguments<BuilderTypes<typeof builder> & ApiType>, | ||
): void => { | ||
const request = new ListSwapsRequest(); | ||
|
||
request.setLimit(argv.limit); | ||
|
||
if (argv.status) { | ||
request.setStatus(argv.status); | ||
} | ||
|
||
loadBoltzClient(argv).listSwaps(request, callback()); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { ServerInterceptingCall, ServerInterceptor } from '@grpc/grpc-js'; | ||
import Logger from '../Logger'; | ||
|
||
export const loggingInterceptor = | ||
(logger: Logger): ServerInterceptor => | ||
(methodDescriptor, call) => | ||
new ServerInterceptingCall(call, { | ||
start: (next) => { | ||
logger.debug(`Got gRPC call ${methodDescriptor.path}`); | ||
return next(); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.