trxapi

package
v0.0.0-...-d80814a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrEvmToTron

func AddrEvmToTron(address string) string

func AddrTronToEvm

func AddrTronToEvm(address string) string

func CreateTRONAddress

func CreateTRONAddress() (string, string, error)

Types

type Client

type Client struct {
	ApiURL  string
	RpcURL  string
	GrpcURL string
	APIKey  string
	// contains filtered or unexported fields
}

func (*Client) Balance

func (c *Client) Balance(addr string) (*big.Int, error)

func (*Client) CheckBalance

func (c *Client) CheckBalance(addr string, fee *big.Int) error

func (*Client) Conn

func (c *Client) Conn()

func (*Client) GetTRC20Transfers

func (c *Client) GetTRC20Transfers(addr string) (*TRC20TransfersResp, error)

func (*Client) SignTx

func (c *Client) SignTx(prk *ecdsa.PrivateKey, tx *core.Transaction) (*core.Transaction, error)

func (*Client) SunpumpLaunchpadCreateAndInitPurchase

func (c *Client) SunpumpLaunchpadCreateAndInitPurchase(contractAddr string, prkHex string, symbol string, name string) (string, error)

func (*Client) SystemPromptManagerMint

func (c *Client) SystemPromptManagerMint(contractAddr string, prkHex string, to common.Address, uri string, data []byte, fee *big.Int) (string, error)

func (*Client) TRC20ApproveMax

func (c *Client) TRC20ApproveMax(contractAddr string, prkHex string, toAddr string) (string, error)

func (*Client) TRC20Call

func (c *Client) TRC20Call(from, contractAddress, data string, constant bool, value, feeLimit int64) (*api.TransactionExtention, error)

func (*Client) Trc20Balance

func (c *Client) Trc20Balance(erc20Addr string, addr string) (*big.Int, error)

type TRC20TransfersResp

type TRC20TransfersResp struct {
	Data []struct {
		BlockNumber           int    `json:"block_number"`
		BlockTimestamp        int64  `json:"block_timestamp"`
		CallerContractAddress string `json:"caller_contract_address"`
		ContractAddress       string `json:"contract_address"`
		EventIndex            int    `json:"event_index"`
		EventName             string `json:"event_name"`
		Result                struct {
			Num0  string         `json:"0"`
			Num1  string         `json:"1"`
			Num2  string         `json:"2"`
			From  string         `json:"from"`
			To    string         `json:"to"`
			Value numeric.BigInt `json:"value"`
		} `json:"result"`
		ResultType struct {
			From  string `json:"from"`
			To    string `json:"to"`
			Value string `json:"value"`
		} `json:"result_type"`
		Event         string `json:"event"`
		TransactionID string `json:"transaction_id"`
	} `json:"data"`
	Success bool `json:"success"`
	Meta    struct {
		At       int64 `json:"at"`
		PageSize int   `json:"page_size"`
	} `json:"meta"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL