Documentation
¶
Overview ¶
Package tron provides convenience constructors that bind a GrpcClient to the builder packages (txbuilder, contract, trc20). This avoids boilerplate and gives developers a single entry point to the SDK.
conn := client.NewGrpcClient("grpc.trongrid.io:50051")
conn.Start(grpc.WithTransportCredentials(insecure.NewCredentials()))
t := tron.New(conn)
t.TxBuilder().Transfer(from, to, amount).Send(ctx, signer)
t.Contract(addr).Method("transfer").From(from).Params(json).Send(ctx, signer)
t.TRC20(addr).Transfer(from, to, amount).Send(ctx, signer)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SDK ¶
type SDK struct {
// contains filtered or unexported fields
}
SDK wraps a GrpcClient and provides builder constructors.
func New ¶
func New(conn *client.GrpcClient) *SDK
New creates an SDK instance bound to the given GrpcClient.
func (*SDK) Client ¶
func (s *SDK) Client() *client.GrpcClient
Client returns the underlying GrpcClient.
func (*SDK) Contract ¶
func (s *SDK) Contract(contractAddress string) *contract.ContractCall
Contract returns a contract call builder for the given address.
Click to show internal directories.
Click to hide internal directories.