Giter Site home page Giter Site logo

bluesign / fcl-dev-wallet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from onflow/fcl-dev-wallet

0.0 0.0 0.0 25.66 MB

A Flow wallet for development purposes. To be used with the Flow Emulator.

License: Apache License 2.0

Shell 0.68% JavaScript 9.33% Go 2.62% TypeScript 68.09% CSS 2.90% Cadence 16.38%

fcl-dev-wallet's Introduction


Logo

A Flow wallet for effortless development, to be used with the Flow Emulator and FCL.
FCL docs»

Report Bug · Getting Started



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

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.

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: https://docs.onflow.org/flow-cli/install/

Create a flow.json file

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

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:

flow emulator start
flow project deploy --network emulator

Start the dev wallet

PORT=8701 npm run dev

Note: 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.

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.

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")

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.

fcl-dev-wallet's People

Contributors

10thfloor avatar alse avatar axvn avatar bartolomej avatar bluesign avatar chasefleming avatar gregsantos avatar huyndo avatar jeffreydoyle avatar jribbink avatar justinbarry avatar neil-and-void avatar orodio avatar psiemens avatar sideninja avatar srinjoyc avatar sukantoraymond avatar turbolent avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.