https://github.com/onflow/flowkit
https://github.com/onflow/flowkit
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/onflow/flowkit
- Owner: onflow
- License: apache-2.0
- Created: 2024-02-01T18:48:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-30T15:59:14.000Z (4 months ago)
- Last Synced: 2026-01-31T08:54:43.024Z (4 months ago)
- Language: Go
- Size: 1.13 MB
- Stars: 8
- Watchers: 19
- Forks: 11
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
- Security: SECURITY.md
- Notice: NOTICE
Awesome Lists containing this project
README
# Flowkit
Flowkit is a Go library for building applications that interact with the Flow blockchain. It provides high-level APIs for managing Flow projects, including working with `flow.json` configurations, deploying contracts, executing scripts, and building transactions.
## Features
- **Project Management** - Load and manage Flow project configurations (`flow.json`)
- **Contract Deployment** - Deploy Cadence contracts to different networks
- **Import Resolution** - Automatically resolve contract imports to blockchain addresses
- **Multi-Network Support** - Work seamlessly with emulator, testnet, and mainnet
- **Account Management** - Manage Flow accounts and signing keys
- **Script Execution** - Execute Cadence scripts and build transactions
## Installation
```bash
go get github.com/onflow/flowkit/v2
```
## Quick Example
```go
import "github.com/onflow/flowkit/v2"
// Load your Flow project
state, err := flowkit.Load([]string{"flow.json"}, afero.Afero{Fs: afero.NewOsFs()})
// Get contracts for a network
contracts, err := state.DeploymentContractsByNetwork(config.TestnetNetwork)
// Resolve imports in your Cadence code
importReplacer := project.NewImportReplacer(contracts, state.AliasesForNetwork(network))
resolvedProgram, err := importReplacer.Replace(program)
```
## Documentation
For comprehensive guides and examples, visit the [Flowkit documentation](https://developers.flow.com/build/tools/clients/flow-go-sdk/flowkit).
## Package Structure
Flowkit contains multiple subpackages:
- **config** - Parsing and storing of `flow.json` values, as well as validation
- **gateway** - Implementation of Flow Access Node methods, uses emulator and Go SDK to communicate with ANs
- **project** - Stateful operations on top of `flow.json`, including import resolution for contract deployments
- **accounts** - Account and key management
- **transactions** - Transaction building and signing
The main Flowkit interface is defined in [services.go](services.go).