https://github.com/metachris/flashbots-ethers-example
Flashbots Ethers TypeScript example for Node.js and browser
https://github.com/metachris/flashbots-ethers-example
ethereum ethers ethersjs flashbots javascript typescript
Last synced: about 1 year ago
JSON representation
Flashbots Ethers TypeScript example for Node.js and browser
- Host: GitHub
- URL: https://github.com/metachris/flashbots-ethers-example
- Owner: metachris
- License: mit
- Created: 2022-04-23T10:10:14.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-25T12:33:14.000Z (about 4 years ago)
- Last Synced: 2025-04-30T10:14:36.563Z (about 1 year ago)
- Topics: ethereum, ethers, ethersjs, flashbots, javascript, typescript
- Language: TypeScript
- Homepage:
- Size: 365 KB
- Stars: 40
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flashbots Ethers Example
This project shows how to use Ethers to interact with Flashbots from JavaScript/TypeScript. The examples can be run in Node.js and the browser.
References:
* https://github.com/ethers-io/ethers.js
* https://github.com/flashbots/ethers-provider-flashbots-bundle
## Project structure
* There's four iterative examples in [`src/main1.ts`](https://github.com/metachris/flashbots-ethers-example/blob/master/src/main1.ts) (Ethers setup) to [`src/main4.ts`](https://github.com/metachris/flashbots-ethers-example/blob/master/src/main4.ts) (sending bundles and more).
* They are imported from [`src/cli.ts`](https://github.com/metachris/flashbots-ethers-example/blob/master/src/cli.ts) and [`src/browser.ts`](https://github.com/metachris/flashbots-ethers-example/blob/master/src/browser.ts), for running in the terminal/browser respectively.
## Getting started
Clone the repository and install the dependencies:
```bash
git clone git@github.com:metachris/flashbots-ethers-example.git
cd flashbots-ethers-example
yarn
```
Run the code in Node.js:
```yarn cli```
Run the code in the browser:
* `yarn esbuild-browser:watch`
* open `browser-test.html` in your browser
To change between examples, update the imports in `src/cli.ts` and `src/browser.ts`.
## License
The code is free to use however you want, no attribution necessary.
## Feedback
Feel free to reach out via Github issues on this repository, or via Twitter [@metachris](https://twitter.com/metachris).