A Flow wallet for effortless development, to be used with the Flow Emulator and FCL.
FCL docs»
Report Bug
·
Getting Started
The FCL dev wallet is a mock Flow wallet that simulates the protocols used by FCL to interact with the Flow blockchain on behalf of simulated user accounts.
IMPORTANT
Warning
This project implements an FCL compatible interface, but should not be used as a reference for building a production grade wallet.
This project should only be used in aid of local development against a locally run instance of the Flow blockchain like the Flow emulator, and should never be used in conjunction with Flow Mainnet, Testnet, Canarynet or any other instances of Flow.
Before using the dev wallet, you'll need to start the Flow emulator.
The Flow emulator is bundles with the Flow CLI. Instructions for installing the CLI can be found here: https://docs.onflow.org/flow-cli/install/
Run this command to create flow.json file (typically in your project's root directory):
flow initStart the emulator and deploy the contracts by running the following command from the directory containing flow.json in your project:
flow emulator start
flow project deploy --network emulatorPORT=8701 npm run devNote: The following variables should match the emulator-account defined in your project's flow.json file.
For details about flow.json visit the flow-cli configuration reference.
The FCL dev wallet is designed to be used with @onflow/fcl version 1.0.0 or higher. The FCL package can be installed with: npm install @onflow/fcl or yarn add @onflow/fcl.
To use the dev wallet, configure FCL to point to the address of a locally running Flow emulator and the dev wallet endpoint.
import * as fcl from "@onflow/fcl"
fcl
.config()
// Point App at Emulator REST API
.put("accessNode.api", "http://localhost:8888")
// Point FCL at dev-wallet (default port)
.put("discovery.wallet", "http://localhost:8701/fcl/authn")It's easy to use this FCL harness app as a barebones app to interact with the dev-wallet during development:
Navigate to http://localhost:8701/harness
When the dev wallet detects it's connected to a mainnet or testnet access node (instead of the local emulator), it automatically enters "fork mode". In fork mode:
- Transaction signature validation is assumed to be disabled on the network
- Users can authenticate with any existing account address on the network
- This is useful for testing against forked mainnet/testnet environments where signatures are not validated
Learn more about forking mainnet/testnet with the Flow Emulator. 🚀
Releasing a new version of Dev Wallet is as simple as tagging and creating a release, a Github Action will then build a bundle of the Dev Wallet that can be used in other tools (such as CLI). If the update of the Dev Wallet is required in the CLI, a separate update PR on the CLI should be created.