A complete, compact and simple library for Ethereum and ilk, written in TypeScript.
Features
- Keep your private keys in your client, safe and sound
- Import and export JSON wallets (Geth, Parity and crowdsale)
- Import and export BIP 39 mnemonic phrases (12 word backup phrases) and HD Wallets (English as well as Czech, French, Italian, Japanese, Korean, Simplified Chinese, Spanish, Traditional Chinese)
- Meta-classes create JavaScript objects from any contract ABI, including ABIv2 and Human-Readable ABI
- Connect to Ethereum nodes over JSON-RPC, INFURA, quaiscan, Alchemy, Ankr or MetaMask
- ENS names are first-class citizens; they can be used anywhere an Ethereum addresses can be used
- Small (~144kb compressed; 460kb uncompressed)
- Tree-shaking focused; include only what you need during bundling
- Complete functionality for all your Ethereum desires
- Extensive documentation
- Large collection of test cases which are maintained and added to
- Fully written in TypeScript, with strict types for security and safety
- MIT License (including ALL dependencies); completely open source to do with as you please
For advisories and important notices, follow @quaisproject on Twitter (low-traffic, non-marketing, important information only) as well as watch this GitHub project.
For more general news, discussions, and feedback, follow or DM me, @ricmoo on Twitter or on the quais Discord.
For the latest changes, see the CHANGELOG.
Summaries
- August 2023
- September 2022
- June 2022
- March 2022
- December 2021
- September 2021
- May 2021
- March 2021
- December 2020
NodeJS
/home/ricmoo/some_project> npm install quais
Browser (ESM)
The bundled library is available in the ./dist/
folder in this repo.
<script type="module">
import { quais } from "./dist/quais.min.js";
</script>
For developers looking to contribute to quais or integrate it into their projects with local modifications, setting up a local development environment is essential. This section guides you through the process of building quais and linking it to another project on your machine using npm link.
Prepare quais for Symbolic Linking
-
Clone the quais repository and navigate into it.
git clone https://github.com/dominant-strategies/quais-6.js.git cd quais-6.js
-
Install dependencies.
npm install
-
Create a global symbolic link for quais. This makes the quais package available to link in any other project. Whenever a local change is made to quais that you want to test in another project, you must run this command again to update the symbolic link.
npm run update-symlink
Caution - The
update-symlink
command updates the globally available symbolic link to the build of the current branch you are on when the command is run. This can potentially lead to incompatible version usage if quais is linked to multiple projects locally.
Linking quais to Another Project
After setting up quais for local development, you can link it to another project to test changes or develop features that depend on quais.
- Navigate to your project.
cd path/to/your/project
- Link the globally linked quais package to your project. This replaces the npm-installed quais package with the symlinked version.
npm link quais
- Build your project: Depending on your project's setup, you may need to rebuild it to ensure that the linked quais library is correctly integrated. npm run build
Testing Changes
With quais linked to your project, any changes made to the quais library can be immediately tested within the context of your project. Remember to rebuild quais (npm run update-symlink
) after making changes to ensure they are reflected in your project.
Reverting to the Published Package
If you need to revert back to the official quais package published on npm, you can unlink quais and reinstall the package.
-
Unlink quais by removing the symlink.
npm unlink quais
-
Reinstall quais: Install the quais package from npm to use the published version.
npm install quais
Browse the documentation online:
quais works closely with an ever-growing list of third-party providers to ensure getting started is quick and easy, by providing default keys to each service.
These built-in keys mean you can use quais.getDefaultProvider()
and
start developing right away.
However, the API keys provided to quais are also shared and are intentionally throttled to encourage developers to eventually get their own keys, which unlock many other features, such as faster responses, more capacity, analytics and other features like archival data.
When you are ready to sign up and start using for your own keys, please check out the Provider API Keys in the documentation.
A special thanks to these services for providing community resources:
The quais
package only includes the most common and most core
functionality to interact with Ethereum. There are many other
packages designed to further enhance the functionality and experience.
- MulticallProvider - A Provider which bundles multiple call requests into a single
call
to reduce latency and backend request capacity - MulticoinPlugin - A Provider plugin to expand the support of ENS coin types
- GanaceProvider - A Provider for in-memory node instances, for fast debugging, testing and simulating blockchain operations
- Optimism Utilities - A collection of Optimism utilities
- LedgerSigner - A Signer to interact directly with Ledger Hardware Wallets
MIT License (including all dependencies).