\TronAPI

All URIs are relative to https://beta.usemoon.ai

Method
HTTP request
Description

CreateTronAccount

Post /tron

GetTronAccount

Get /tron/{accountName}

ListTronAccounts

Get /tron

SignTronTransaction

Post /tron/{accountName}/sign-tx

CreateTronAccount

AccountAPIResponse CreateTronAccount(ctx).Authorization(authorization).TronInput(tronInput).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/moon-up/moon-sdk-go"
)

func main() {
	authorization := "authorization_example" // string | 
	tronInput := *openapiclient.NewTronInput() // TronInput | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TronAPI.CreateTronAccount(context.Background()).Authorization(authorization).TronInput(tronInput).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TronAPI.CreateTronAccount``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateTronAccount`: AccountAPIResponse
	fmt.Fprintf(os.Stdout, "Response from `TronAPI.CreateTronAccount`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateTronAccountRequest struct via the builder pattern

Name
Type
Description
Notes

authorization

string

tronInput

TronInput

Return type

AccountAPIResponse

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetTronAccount

AccountAPIResponse GetTronAccount(ctx, accountName).Authorization(authorization).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/moon-up/moon-sdk-go"
)

func main() {
	authorization := "authorization_example" // string | 
	accountName := "accountName_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TronAPI.GetTronAccount(context.Background(), accountName).Authorization(authorization).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TronAPI.GetTronAccount``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetTronAccount`: AccountAPIResponse
	fmt.Fprintf(os.Stdout, "Response from `TronAPI.GetTronAccount`: %v\n", resp)
}

Path Parameters

Name
Type
Description
Notes

ctx

context.Context

context for authentication, logging, cancellation, deadlines, tracing, etc.

accountName

string

Other Parameters

Other parameters are passed through a pointer to a apiGetTronAccountRequest struct via the builder pattern

Name
Type
Description
Notes

authorization

string

Return type

AccountAPIResponse

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListTronAccounts

AccountAPIResponse ListTronAccounts(ctx).Authorization(authorization).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/moon-up/moon-sdk-go"
)

func main() {
	authorization := "authorization_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TronAPI.ListTronAccounts(context.Background()).Authorization(authorization).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TronAPI.ListTronAccounts``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListTronAccounts`: AccountAPIResponse
	fmt.Fprintf(os.Stdout, "Response from `TronAPI.ListTronAccounts`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListTronAccountsRequest struct via the builder pattern

Name
Type
Description
Notes

authorization

string

Return type

AccountAPIResponse

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SignTronTransaction

TronAPIResponse SignTronTransaction(ctx, accountName).Authorization(authorization).TronTransactionInput(tronTransactionInput).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/moon-up/moon-sdk-go"
)

func main() {
	authorization := "authorization_example" // string | 
	accountName := "accountName_example" // string | 
	tronTransactionInput := *openapiclient.NewTronTransactionInput() // TronTransactionInput | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TronAPI.SignTronTransaction(context.Background(), accountName).Authorization(authorization).TronTransactionInput(tronTransactionInput).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TronAPI.SignTronTransaction``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SignTronTransaction`: TronAPIResponse
	fmt.Fprintf(os.Stdout, "Response from `TronAPI.SignTronTransaction`: %v\n", resp)
}

Path Parameters

Name
Type
Description
Notes

ctx

context.Context

context for authentication, logging, cancellation, deadlines, tracing, etc.

accountName

string

Other Parameters

Other parameters are passed through a pointer to a apiSignTronTransactionRequest struct via the builder pattern

Name
Type
Description
Notes

authorization

string

tronTransactionInput | TronTransactionInput | |

Return type

TronAPIResponse

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]