![Dojo logo](https://raw.githubusercontent.com/rsodre/create-burner/main/.github/burner.png)
Note: Starknet Burner Accounts are currently in pre-alpha. Expect breaking changes frequently.
Warning: You should provide your users with warning explaning that these Accounts are not secure and should not be used for storing large amounts of funds. The keypair is stored in local storage and can be exploited by malicious actors.
Easily manage, create, and interact with burner accounts on Starknets using this library.
- Initialize and manage burner accounts.
- Abstracts away intricacies related to creating, fetching, and setting active burner accounts.
- Easily integrate with React apps using the provided hook.
- Vanilla JS support.
You can install create-burner
using yarn, pnpm, or npm:
yarn add @dojoengine/create-burner starknet
After installation, you can easily integrate it into your React app:
import { useBurner } from "@dojoengine/create-burner";
const YourComponent = () => {
const { get, list, select, create, account } = useBurner(options);
// Rest of your component
};
For non-React apps, initialize and manage burners using the BurnerManager
class:
import { BurnerManager } from "@dojoengine/create-burner";
const manager = new BurnerManager(options);
manager.init();
const activeAccount = manager.getActiveAccount();
-
useBurner: A React hook that provides functionalities like creating burners, selecting them, and more.
get(address: string)
: Get a burner account based on its address.list()
: List all burners.select(address: string)
: Set a burner as the active account.create()
: Create a new burner.account
: The active burner account.isDeploying
: A boolean that indicates whether a burner is being deployed.listConnectors()
: List all available connectors that can be used with Starknet React.
-
BurnerManager: A class for vanilla JS that offers methods to manage burner accounts.
init()
: Initializes the manager.getActiveAccount()
: Retrieves the active burner account.get(address: string)
: Get a burner account based on its address.list()
: List all burners.select(address: string)
: Set a burner as the active account.create()
: Create a new burner.account
: The active burner account.isDeploying
: A boolean that indicates whether a burner is being deployed.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/my-new-feature
). - Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin feature/my-new-feature
). - Open a pull request.
This project is licensed under the MIT License.