Helpful info to implement Lens into your projects
-
- This is about as basic as it gets. Querys balance of wallet address.
-
- Restore key, build transaction, broadcast transaction
-
- Index block info at given height and log in PostgreSQL.
Note: This is only necessary if you are importing Lens into your project. These steps have already been taken in the above examples.
Because Lens replaces some modules in its mod file, manual steps are needed to properly import Lens into a project.
First, install lens to your GOPATH/pkg/mod
directory. Run:
go install github.com/strangelove-ventures/lens@latest
Add the following lines to your mod file:
require github.com/gogo/protobuf v1.3.3
replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.2-alpha.regen.4
Tidy your mod file. Run:
go mod tidy
Now you can properly import lens to your go file:
import (
lens "github.com/strangelove-ventures/lens/client"
registry "github.com/strangelove-ventures/lens/client/chain_registry"
)