This repository contains example scripts that leverage Blockdaemon's DEFI API using the Go SDK. These examples demonstrate how to interact with various DeFi functionalities across different blockchain networks.
- Go 1.21 or higher
- A Blockdaemon API Key
- Clone the repository:
git clone https://github.com/your-username/defi-examples-go
cd defi-examples-go
- Install dependencies:
go mod tidy
- Set up your environment:
cp .env.example .env
- Add your Blockdaemon API Key to the
.env
file:
BLOCKDAEMON_API_KEY=your_api_key_here
DEFI_API_BASE_PATH=https://svc.blockdaemon.com/defi/v1
chains
: Lists supported blockchain networks
Run any example using go run
:
go run examples/chains/main.go # Get supported blockchain networks
The following environment variables are required:
BLOCKDAEMON_API_KEY
: Your Blockdaemon API keyDEFI_API_BASE_PATH
: API base URL (defaults to https://svc.blockdaemon.com/defi/v1)
These example applications are provided as learning resources for the DEFI API. They are experimental and should not be used in production environments. For more information, please contact our team through our support page.
- Ensure your API key is correctly set in the
.env
file - Verify your API key has the necessary permissions
To enable more verbose logging, set the log level in your code:
log.SetFlags(log.LstdFlags | log.Lshortfile)
Contact us through email or our support page for any assistance you may need.