tron.go 820 B

123456789101112131415161718192021222324
  1. package service
  2. import (
  3. "github.com/fbsobreira/gotron-sdk/pkg/client"
  4. "github.com/fbsobreira/gotron-sdk/pkg/proto/api"
  5. "math/big"
  6. )
  7. const (
  8. tronUsdt = "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
  9. tronUsdc = "TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8"
  10. )
  11. func buildTransferTrx(tronClient *client.GrpcClient, from, to string, amount int64) (*api.TransactionExtention, error) {
  12. return tronClient.Transfer(from, to, amount)
  13. }
  14. func buildTransferUsdtOfTron(tronClient *client.GrpcClient, from, to string, amount *big.Int) (*api.TransactionExtention, error) {
  15. return tronClient.TRC20Send(from, to, tronUsdt, amount, 100000000)
  16. }
  17. func buildTransferUsdcOfTron(tronClient *client.GrpcClient, from, to string, amount *big.Int) (*api.TransactionExtention, error) {
  18. return tronClient.TRC20Send(from, to, tronUsdc, amount, 100000000)
  19. }