Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions docs/build/tools/clients/fcl-js/cross-vm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,45 @@ description: FCL packages for cross-VM (Flow + EVM) applications.

# FCL Cross-VM Packages

These packages enable you to leverage Flow’s Cadence-Owned Account (COA) within Ethereum tooling (e.g., Wagmi, RainbowKit). They provide a unified approach for cross-VM apps on Flow and EVM, letting you perform EVM-like operations using Cadence accounts.
These packages allow you to leverage Flow’s Cadence-Owned Account (COA) within Ethereum tooling (for example, Wagmi, RainbowKit). They provide a unified approach for cross-VM apps on Flow and EVM, which lets you perform EVM-like operations will Cadence accounts.

For background and motivation, see the [FCL Ethereum Provider for Cross-VM Apps FLIP #316](https://github.com/onflow/flips/blob/c0fe9b71a9afb85fe70a69cf7c0870b5d327e679/application/20241223-fcl-ethereum-provider.md).
For background and motivation, see the [FCL Ethereum Provider for Cross-VM Apps FLIP #316].

| Package | Purpose |
|-----------------------------------------------|-------------------------------------------------------------------------------------------------|
| [@onflow/fcl-ethereum-provider](#onflowfcl-ethereum-provider) | Provides an EIP-1193-compliant Ethereum provider backed by an FCL-authenticated COA. |
| [@onflow/fcl-wagmi-adapter](#onflowfcl-wagmi-adapter) | Integrates Flow-based COAs with Wagmi, exposing them as Ethereum accounts in your dApp. |
| [@onflow/fcl-rainbowkit-adapter](#onflowfcl-rainbowkit-adapter)| Enables a Flow-based wallet option in your RainbowKit wallet selection modal. |
| [@onflow/fcl-ethereum-provider] | Provides an EIP-1193-compliant Ethereum provider backed by an FCL-authenticated COA. |
| [@onflow/fcl-wagmi-adapter] | Integrates Flow-based COAs with Wagmi, and exposes them as Ethereum accounts in your dApp. |
| [@onflow/fcl-rainbowkit-adapter]| Allows a Flow-based wallet option in your RainbowKit wallet selection modal. |

## `@onflow/fcl-ethereum-provider`

- **Description**: A drop-in EIP-1193 provider that authenticates users via [FCL](https://developers.flow.com/) and lets them sign transactions/messages with their COA.
- **Description**: A drop-in EIP-1193 provider that authenticates users via [Flow Client Library (FCL)] and lets them sign transactions and messages with their COA.
- **Use Cases**:
- Integrate Flow EVM with any generic EVM library or framework.
- Direct control over JSON-RPC calls (e.g., `provider.request({ method: 'eth_sendTransaction' })`).
- **Link to Docs**: [Read the @onflow/fcl-ethereum-provider Reference »](ethereum-provider.mdx)
- Direct control over JSON-RPC calls (for example, `provider.request({ method: 'eth_sendTransaction' })`).
- **Link to Docs**: [Read the @onflow/fcl-ethereum-provider Reference »]

## `@onflow/fcl-wagmi-adapter`

- **Description**: A Wagmi connector that uses `@onflow/fcl-ethereum-provider` under the hood so you can sign in with your COA through standard Wagmi flows.
- **Use Cases**:
- Add Flow-based COAs to an existing Wagmi-powered dApp as if they were Ethereum wallets.
- **Link to Docs**: [Read the @onflow/fcl-wagmi-adapter Reference »](wagmi-adapter.mdx)
- Add Flow-based COAs to a current Wagmi-powered dApp as if they were Ethereum wallets.
- **Link to Docs**: [Read the @onflow/fcl-wagmi-adapter Reference »]

## `@onflow/fcl-rainbowkit-adapter`

- **Description**: A RainbowKit adapter that surfaces a Flow-based wallet in the wallet selection modal, making it easy to sign transactions via COAs in a RainbowKit environment.
- **Description**: A RainbowKit adapter that surfaces a Flow-based wallet in the wallet selection modal, wheich makes it easy to sign transactions via COAs in a RainbowKit environment.
- **Use Cases**:
- Offer Flow-based wallets (e.g., Flow Wallet) alongside popular Ethereum wallets in RainbowKit.
- **Link to Docs**: [Read the @onflow/fcl-rainbowkit-adapter Reference »](rainbowkit-adapter.mdx)
- Offer Flow-based wallets (such as Flow Wallet) alongside popular Ethereum wallets in RainbowKit.
- **Link to Docs**: [Read the @onflow/fcl-rainbowkit-adapter Reference »]

<!-- Relative links, will not render on page -->

[FCL Ethereum Provider for Cross-VM Apps FLIP #316]: https://github.com/onflow/flips/blob/c0fe9b71a9afb85fe70a69cf7c0870b5d327e679/application/20241223-fcl-ethereum-provider.md
[@onflow/fcl-ethereum-provider]: #onflowfcl-ethereum-provider
[@onflow/fcl-wagmi-adapter]: #onflowfcl-wagmi-adapter
[@onflow/fcl-rainbowkit-adapter]: #onflowfcl-rainbowkit-adapter
[Flow Client Library (FCL)]: https://developers.flow.com/
[Read the @onflow/fcl-ethereum-provider Reference »]: ethereum-provider.mdx
[Read the @onflow/fcl-wagmi-adapter Reference »]: wagmi-adapter.mdx
[Read the @onflow/fcl-rainbowkit-adapter Reference »]: rainbowkit-adapter.mdx
56 changes: 28 additions & 28 deletions docs/build/tools/emulator/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,23 @@ This starts a local Flow network with:
- REST API on `http://localhost:8888`
- Admin API on port `8080`

## Available Commands
## Available commands

- `snapshot`: Create/Load/List emulator snapshots. See: [Create Emulator Snapshot]

## Key Flags
## Key flags

- **Networking**
- `--host <string>`: Host to listen on for gRPC/REST/Admin (default: all interfaces)
- `--host <string>`: Host to listen on for gRPC, REST, and Admin (default: all interfaces)
- `--port, -p <int>`: gRPC port (default `3569`)
- `--rest-port <int>`: REST API port (default `8888`)
- `--admin-port <int>`: Admin API port (default `8080`)
- `--debugger-port <int>`: Debug Adapter Protocol port (default `2345`)
- `--grpc-debug`: Enable gRPC server reflection
- `--rest-debug`: Enable REST API debug output
- `--grpc-debug`: Turn on gRPC server reflection
- `--rest-debug`: Turn on REST API debug output

- **State & Persistence**
- `--persist`: Enable persistent storage (default disabled)
- **State and Persistence**
- `--persist`: Turn on persistent storage (default disabled)
- `--dbpath <path>`: Directory for on-disk state (default `./flowdb`)
- `--sqlite-url <url>`: Use SQLite storage backend
- `--redis-url <url>`: Use Redis storage backend
Expand All @@ -87,15 +87,15 @@ This starts a local Flow network with:

- **Forking**
- `--fork <string>`: Start the emulator in fork mode using a network from `flow.json`. If provided without a value, defaults to `mainnet`.
- `--fork-host <host>`: Access node to query when forking Mainnet/Testnet
- `--fork-height <uint>`: Starting block height when forking

- **Cadence & VM**
- `--block-time, -b <duration>`: Time between sealed blocks (e.g. `1s`, `300ms`)
- `--coverage-reporting`: Enable code coverage reporting
- `--computation-reporting`: Enable computation reporting
- `--legacy-upgrade`: Enable legacy contract upgrade behavior
- `--scheduled-transactions`: Enable scheduled transactions (default true)
- `--fork-host <host>`: Access node to query when you fork Mainnet or Testnet
- `--fork-height <uint>`: Starting block height when you fork

- **Cadence and VM**
- `--block-time, -b <duration>`: Time between sealed blocks (for exxample, `1s`, `300ms`)
- `--coverage-reporting`: Turn on code coverage reporting
- `--computation-reporting`: Turn on computation reporting
- `--legacy-upgrade`: Turn on legacy contract upgrade behavior
- `--scheduled-transactions`: Turn on scheduled transactions (default true)
- `--script-compute-limit <int>`: Compute unit limit for scripts (default `100000`)
- `--transaction-max-compute-limit <int>`: Max transaction compute unit limit (default `9999`)
- `--transaction-expiry <int>`: Transaction expiry in blocks (default `10`)
Expand All @@ -104,21 +104,21 @@ This starts a local Flow network with:
- `--storage-limit`: Enforce account storage limit (default true)
- `--storage-per-flow <decimal>`: MB of storage per 1 FLOW token
- `--token-supply <decimal>`: Initial FLOW token supply (default `1000000000.0`)
- `--transaction-fees`: Enable transaction fees
- `--transaction-fees`: Turn on transaction fees
- `--setup-evm`: Deploy EVM contracts (default true)
- `--setup-vm-bridge`: Deploy VM Bridge contracts (default true)

- **Service Account & Identity**
- **Service Account and Identity**
- `--chain-id <emulator|testnet|mainnet>`: Address generation chain (default `emulator`)
- `--service-priv-key <hex>` / `--service-pub-key <hex>`: Service account keys
- `--service-sig-algo <ECDSA_P256|ECDSA_secp256k1>`: Service key signature algo (default `ECDSA_P256`)
- `--service-hash-algo <SHA3_256|SHA2_256>`: Service key hash algo (default `SHA3_256`)
- `--min-account-balance <decimal>`: Minimum account balance / account creation cost
- `--min-account-balance <decimal>`: Minimum account balance or account creation cost
- `--contracts`: Deploy common contracts on start
- `--contract-removal`: Allow contract removal for development (default true)
- `--init`: Initialize a new account profile

- **Logging & Output**
- **Logging and Output**
- `--verbose, -v`: Verbose logging
- `--log-format <text|JSON>`: Logging output format (default `text`)

Expand Down Expand Up @@ -168,15 +168,15 @@ For the complete and current list of flags, run:
flow emulator --help
```

## Debugging & Testing
## Debugging and Testing

- **Code Coverage**: Add `--coverage-reporting` flag and visit `http://localhost:8080/emulator/codeCoverage`
- **Debugging**: Use `#debugger()` pragma in Cadence code for breakpoints
- **Fork mode note**: When using `flow emulator --fork`, only Flow chain state is available. External oracles/APIs and cross-chain reads are not live; mock these or run local stub services for E2E.
- **Fork mode note**: When you use `flow emulator --fork`, only Flow chain state is available. External oracles/APIs and cross-chain reads are not live; mock these or run local stub services for E2E.

## Snapshots

The Flow CLI provides a command to create emulator snapshots, which are points in blockchain history you can later jump to and reset the state to that moment. This can be useful for testing where you establish a beginning state, run tests and after revert back to the initial state.
The Flow CLI provides a command to create emulator snapshots, which are points in blockchain history you can later jump to and reset the state to that moment. This can be useful to test where you establish a beginning state, run tests and after revert back to the initial state.

### Quick snapshot workflow

Expand All @@ -201,25 +201,25 @@ Create a new emulator snapshot at the current block with a name of `myInitialSta
flow emulator snapshot create myInitialState
```

### Load an existing snapshot
### Load a current snapshot

To jump to a previously created snapshot we use the load command in combination with the name.

```shell
flow emulator snapshot load myInitialState
```

### List all existing snapshots
### List all snapshots

To list all the existing snapshots we previously created and can load to run:
To list all the snapshots we previously created and can load to run:

```shell
flow emulator list
```

## Additional Resources
## Additional resources

To learn more about using the Emulator, please have a look at the [public GitHub repository].
To learn more about how to use the Emulator, have a look at the [public GitHub repository].

<!-- Reference-style links -->

Expand Down
38 changes: 20 additions & 18 deletions docs/build/tools/flow-cli/accounts/account-add-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ title: Deploy a Contract
sidebar_position: 3
---

Deploy a new contract to a Flow account using the Flow CLI.
Deploy a new contract to a Flow account with the Flow CLI.

```shell
flow accounts add-contract <filename> [<argument> <argument>...] [flags]
```

⚠️ Deprecation notice: using name argument in adding contract command will be deprecated soon.
⚠️ Deprecation notice: we will deprecate the name argument in adding contract command soon.
```shell
flow accounts add-contract <name> <filename> [<argument> <argument>...] [flags]
```

## Example Usage
## Example usage

```shell
> flow accounts add-contract ./FungibleToken.cdc
Expand All @@ -36,7 +36,7 @@ Key 0 Public Key 640a5a359bf3536d15192f18d872d57c98a96cb871b92b70cecb0739c2d5c
Contracts Deployed: 1
Contract: 'FungibleToken'
```
**Testnet Example**
**Testnet example**
```
> flow accounts add-contract ./FungibleToken.cdc --signer alice --network testnet

Expand Down Expand Up @@ -79,10 +79,10 @@ Path to the file containing the contract source code.

### Arguments
- Name: `argument`
- Valid inputs: valid [cadence values](https://cadencelang.dev/docs/1.0/json-cadence-spec)
matching argument type in transaction code.
- Valid inputs: valid [cadence values]
that match argument type in transaction code.

Input arguments values matching corresponding types in the source code and passed in the same order.
Input arguments values that match corresponding types in the source code and passed in the same order.

Example:
```shell
Expand Down Expand Up @@ -113,9 +113,9 @@ Specify the name of the account that will be used to sign the transaction.

Arguments passed to the Cadence transaction in Cadence JSON format.
Cadence JSON format contains `type` and `value` keys and is
[documented here](https://cadencelang.dev/docs/1.0/json-cadence-spec).
[documented here].

### Include Fields
### Include fields

- Flag: `--include`
- Valid inputs: `contracts`
Expand All @@ -129,17 +129,14 @@ Specify fields to include in the result output. Applies only to the text output.
- Valid inputs: an IP address or hostname.
- Default: `127.0.0.1:3569` (Flow Emulator)

Specify the hostname of the Access API that will be
used to execute the command. This flag overrides
any host defined by the `--network` flag.
Specify the hostname of the Access API that will be used to execute the command. This flag overrides any host defined by the `--network` flag.

### Network Key
### Network key

- Flag: `--network-key`
- Valid inputs: A valid network public key of the host in hex string format

Specify the network public key of the Access API that will be
used to create a secure GRPC client when executing the command.
Specify the network public key of the Access API that will be used to create a secure GRPC client when you execute the command.

### Network

Expand Down Expand Up @@ -191,12 +188,17 @@ Specify the log level. Control how much output you want to see during command ex
- Default: `flow.json`

Specify the path to the `flow.json` configuration file.
You can use the `-f` flag multiple times to merge
several configuration files.

### Version Check
You can use the `-f` flag multiple times to merge several configuration files.

### Version check

- Flag: `--skip-version-check`
- Default: `false`

Skip version check during start up to speed up process for slow connections.

<!-- Relative links, will not render on page -->

[cadence values]: https://cadencelang.dev/docs/1.0/json-cadence-spec
[documented here]: https://cadencelang.dev/docs/1.0/json-cadence-spec
19 changes: 12 additions & 7 deletions docs/build/tools/flow-cli/accounts/account-fund.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ sidebar_position: 7

:::info

The [Flow Testnet Faucet](https://testnet-faucet.onflow.org/) allows users to create accounts and receive 1,000 Testnet FLOW tokens for testing and development purposes. You can also fund an existing Testnet accounts without needing to create one through the site, or through the CLI.
The [Flow Testnet Faucet] allows users to create accounts and receive 1,000 Testnet FLOW tokens for testing and development purposes. You can also fund a current Testnet account without the need to create one through the site, or through the CLI.

:::

Fund a valid Testnet Flow Account using the Flow CLI.
Fund a valid Testnet Flow Account with the Flow CLI.

```shell
flow accounts fund [address|name]
```

## Example Usage
## Example usage

### Fund by Address
### Fund by address

```
> flow accounts fund 8e94eaa81771313a
Expand All @@ -29,7 +29,7 @@ If there is an issue, please use this link instead: https://testnet-faucet.onflo

```

### Fund by Account Name
### Fund by account name

```
> flow accounts fund testnet-account
Expand All @@ -40,7 +40,7 @@ If there is an issue, please use this link instead: https://testnet-faucet.onflo

```

### Interactive Prompt
### Interactive prompt

```
> flow accounts fund
Expand All @@ -53,7 +53,7 @@ If there is an issue, please use this link instead: https://testnet-faucet.onflo

## Arguments

### Address or Account Name (Optional)
### Address or account name (optional)

- Name: `address|name`
- Valid Input: Flow Testnet account address or account name from `flow.json`
Expand All @@ -62,3 +62,8 @@ You can provide:
- A Flow [account address](../../../cadence/basics/accounts.md) (prefixed with `0x` or not)
- An account name configured in your `flow.json`
- No argument to get an interactive prompt for account selection

<!-- Relative links, will not render on page -->

[Flow Testnet Faucet]: https://testnet-faucet.onflow.org/
[account address]: ../../../cadence/basics/accounts.md
Loading