Skip to main content

overview

Introduction

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


_10
This project implements an FCL compatible
_10
interface, but should **not** be used as a reference for
_10
building a production grade wallet.
_10
_10
This project should only be used in aid of local
_10
development against a locally run instance of the Flow
_10
blockchain like the Flow emulator, and should never be used in
_10
conjunction with Flow Mainnet, Testnet, Canarynet or any
_10
other instances of Flow.

Getting started

Before using the dev wallet, you'll need to start the Flow emulator.

Install the flow-cli

The Flow emulator is bundles with the Flow CLI. Instructions for installing the CLI can be found here: flow-cli/install/

Create a flow.json file

Run this command to create flow.json file (typically in your project's root directory):


_10
flow init

Start the emulator

Start the emulator and deploy the contracts by running the following command from the directory containing flow.json in your project:


_10
flow emulator start
_10
flow project deploy --network emulator

Configuring your JavaScript application

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.


_10
import * as fcl from "@onflow/fcl"
_10
_10
fcl
_10
.config()
_10
// Point App at Emulator REST API
_10
.put("accessNode.api", "http://localhost:8888")
_10
// Point FCL at dev-wallet (default port)
_10
.put("discovery.wallet", "http://localhost:8701/fcl/authn")

Test harness

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

Contributing

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 seperate update PR on the CLI should be created.