-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #829 from BoltzExchange/pending-evm-txs-grpc
feat: gRPC method to get pending EVM transactions
- Loading branch information
Showing
24 changed files
with
1,566 additions
and
267 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
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,27 @@ | ||
import { Arguments } from 'yargs'; | ||
import { getHexString } from '../../Utils'; | ||
import { GetPendingEvmTransactionsRequest } from '../../proto/boltzrpc_pb'; | ||
import { ApiType, BuilderTypes } from '../BuilderComponents'; | ||
import { callback, loadBoltzClient } from '../Command'; | ||
|
||
export const command = 'pendingevmtransactions'; | ||
|
||
export const describe = 'get pending EVM transactions'; | ||
|
||
export const builder = {}; | ||
|
||
export const handler = ( | ||
argv: Arguments<BuilderTypes<typeof builder> & ApiType>, | ||
) => { | ||
const request = new GetPendingEvmTransactionsRequest(); | ||
loadBoltzClient(argv).getPendingEvmTransactions( | ||
request, | ||
callback((res) => { | ||
return res.getTransactionsList().map((tx) => ({ | ||
...tx.toObject(), | ||
hash: getHexString(Buffer.from(tx.getHash() as string, 'base64')), | ||
hex: getHexString(Buffer.from(tx.getHex() as string, 'base64')), | ||
})); | ||
}), | ||
); | ||
}; |
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
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.
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.