Gathering detailed insights and metrics for @onflow/rlp
Gathering detailed insights and metrics for @onflow/rlp
Gathering detailed insights and metrics for @onflow/rlp
Gathering detailed insights and metrics for @onflow/rlp
FCL (Flow Client Library) - The best tool for building JavaScript (browser & NodeJS) applications on Flow 🌊
npm install @onflow/rlp
@onflow/util-template@1.2.3
Published on 27 Nov 2024
@onflow/util-semver@1.0.3
Published on 27 Nov 2024
@onflow/util-uid@1.2.3
Published on 27 Nov 2024
@onflow/util-rpc@0.0.2
Published on 27 Nov 2024
@onflow/util-logger@1.3.3
Published on 27 Nov 2024
@onflow/util-invariant@1.2.4
Published on 27 Nov 2024
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
323 Stars
2,055 Commits
117 Forks
46 Watching
175 Branches
82 Contributors
Updated on 27 Nov 2024
JavaScript (84.73%)
TypeScript (15.21%)
Makefile (0.06%)
CSS (0.01%)
Cumulative downloads
Total Downloads
Last day
-8.6%
2,623
Compared to previous day
Last week
-2.9%
12,725
Compared to previous week
Last month
-10.1%
63,972
Compared to previous month
Last year
-1.9%
743,479
Compared to previous year
Connect your dapp to users, their wallets and Flow.
Quickstart
·
Report Bug
·
Contribute
The Flow Client Library (FCL) JS is a package used to interact with user wallets and the Flow blockchain. When using FCL for authentication, dapps are able to support all FCL-compatible wallets on Flow and their users without any custom integrations or changes needed to the dapp code.
It was created to make developing applications that connect to the Flow blockchain easy and secure. It defines a standardized set of communication patterns between wallets, applications, and users that is used to perform a wide variety of actions for your dapp. FCL also offers a full featured SDK and utilities to interact with the Flow blockchain.
While FCL itself is a concept and standard, FCL JS is the javascript implementation of FCL and can be used in both browser and server environments. All functionality for connecting and communicating with wallet providers is restricted to the browser. We also have FCL Swift implementation for iOS, see FCL Swift contributed by @lmcmz.
v12.0.0 or higher
.1npm i 2npm run build
Packages stable versions releases are controlled by changesets from the master
branch
In order to create an alpha
(pre-)release
release-<VERSION>
as a branch namenpm run changeset pre enter alpha
npm run changeset version
npm run changeset publish
NOTE: you need to have an npm account and be a member of OnFlow organization
changeset
commands should preferably be run from the release
branch and not from feature branches in order to avoid merge conflicts with other feature branches
when the release is ready to be published as stable run from the release branch
npm run changeset pre exit
and merge release-<VERSION>
branch to master
To use the FCL JS in your application, install using yarn or npm
1npm i -S @onflow/fcl
1yarn add @onflow/fcl
ES6
1import * as fcl from "@onflow/fcl";
Node.js
1const fcl = require("@onflow/fcl");
1// in the browser 2import * as fcl from "@onflow/fcl" 3 4fcl.config({ 5 "discovery.wallet": "https://fcl-discovery.onflow.org/testnet/authn", // Endpoint set to Testnet 6}) 7 8fcl.authenticate()
Note: A Dapper Wallet developer account is required. To enable Dapper Wallet inside FCL, you need to follow this guide.
Learn more about wallet interactions >
1import * as fcl from "@onflow/fcl"; 2 3const result = await fcl.query({ 4 cadence: ` 5 pub fun main(a: Int, b: Int, addr: Address): Int { 6 log(addr) 7 return a + b 8 } 9 `, 10 args: (arg, t) => [ 11 arg(7, t.Int), // a: Int 12 arg(6, t.Int), // b: Int 13 arg("0xba1132bc08f82fe2", t.Address), // addr: Address 14 ], 15}); 16console.log(result); // 13
1import * as fcl from "@onflow/fcl"; 2// in the browser, FCL will automatically connect to the user's wallet to request signatures to run the transaction 3const txId = await fcl.mutate({ 4 cadence: ` 5 import Profile from 0xba1132bc08f82fe2 6 7 transaction(name: String) { 8 prepare(account: AuthAccount) { 9 account.borrow<&{Profile.Owner}>(from: Profile.privatePath)!.setName(name) 10 } 11 } 12 `, 13 args: (arg, t) => [arg("myName", t.String)], 14});
Learn more about on-chain interactions >
FCL JS supports TypeScript. If you need to import specific types, you can do so via the @onflow/typedefs package.
1import {CurrentUser} from "@onflow/typedefs" 2 3const newUser: CurrentUser = { 4 addr: null, 5 cid: null, 6 expiresAt: null, 7 f_type: 'User', 8 f_vsn: '1.0.0', 9 loggedIn: null, 10 services: [] 11}
For all type definitions available, see this file
See the Flow App Quick Start.
See the full API Reference for all FCL functionality.
Learn Flow's smart contract language to build any script or transactions: Cadence.
Explore all of Flow docs and tools.
Wallet providers on Flow have the flexibility to build their user interactions and UI through a variety of ways:
FCL is agnostic to the communication channel and be configured to create both custodial and non-custodial wallets. This enables users to interact with wallet providers without needing to download an app or extension.
The communication channels involve responding to a set of pre-defined FCL messages to deliver the requested information to the dapp. Implementing a FCL compatible wallet on Flow is as simple as filling in the responses with the appropriate data when FCL requests them. If using any of the front-channel communication methods, FCL also provides a set of wallet utilities to simplify this process.
It can be difficult to get users to discover new wallets on a chain. To solve this, we created a wallet discovery service that can be configured and accessed through FCL to display all available Flow wallet providers to the user. This means:
The discovery feature can be used via API allowing you to customize your own UI or you can use the default UI without any additional configuration.
Note: To get your wallet added to the discovery service, make a PR in fcl-discovery.
Notice a problem or want to request a feature? Add an issue.
Discuss FCL with the community on the forum.
Join the Flow community on Discord to keep up to date and to talk to the team.
No vulnerabilities found.
No security vulnerabilities found.