
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
github.com/distributed-lab/tron-sdk
The TRON SDK is a Go client library designed to simplify interaction with the TRON blockchain's API, specifically the TronGrid service. TronGrid is a public API service provided by the TRON Foundation that offers various endpoints for querying TRON blockchain data.
To install the tron-api SDK, you can use the go get
command:
go get -u github.com/distributed-lab/tron-api
package main
import (
"fmt"
"time"
"github.com/distributed-lab/tron-sdk/tron_api"
)
func main() {
apiKey := "your-api-key"
httpApiURL := "https://api.trongrid.io"
grpcURL := "grpc.trongrid.io:50051"
client := tron_api.NewTronClient(httpApiURL, grpcURL, apiKey)
blockNumber, err := client.GetNowBlock()
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Latest Block Number:", blockNumber)
// Perform other operations using the provided methods
// ...
}
This SDK interacts with the TRON blockchain through the TronGrid service, which offers a range of methods to retrieve blockchain data. Some of the key methods utilized by this SDK include:
GetNowBlock()
: Retrieve the latest block number.GetTransactionInfoByBlockNum(block int64)
: Get transaction information by block number.GetTransactionResultById(id string)
: Fetch the result of a transaction by its ID.GetTxInfo(id string)
: Obtain detailed transaction information by ID.BalanceOf(address address.Address, tokenAddress string)
: Check account balances for native tokens and TRC20 tokens.GetContractOwner(c address.Address)
: Retrieve the owner of a smart contract.For more details on these methods and other available endpoints, refer to the official TronGrid API documentation.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.