Skip to content

Latest commit

 

History

History
601 lines (394 loc) · 17.4 KB

TransactionsAPI.md

File metadata and controls

601 lines (394 loc) · 17.4 KB

\TransactionsAPI

All URIs are relative to https://api-mainnet.celenium.io/v1

Method HTTP request Description
GetTransaction Get /tx/{hash} Get transaction by hash
GetTransactionEvents Get /tx/{hash}/events Get transaction events
GetTransactionMessages Get /tx/{hash}/messages Get transaction messages
GetTransactionsCount Get /tx/count Get count of transactions in network
ListGenesisTransactions Get /tx/genesis List genesis transactions info
ListTransactionBlobs Get /tx/{hash}/blobs List blobs which was pushed by transaction
ListTransactions Get /tx List transactions info
TransactionBlobsCount Get /tx/{hash}/blobs/count Count of blobs which was pushed by transaction

GetTransaction

ResponsesTx GetTransaction(ctx, hash).Execute()

Get transaction by hash

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/celenium-io/celenium-api-go"
)

func main() {
	hash := "hash_example" // string | Transaction hash in hexadecimal

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
hash string Transaction hash in hexadecimal

Other Parameters

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

Name Type Description Notes

Return type

ResponsesTx

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetTransactionEvents

[]ResponsesEvent GetTransactionEvents(ctx, hash).Limit(limit).Offset(offset).Execute()

Get transaction events

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/celenium-io/celenium-api-go"
)

func main() {
	hash := "hash_example" // string | Transaction hash in hexadecimal
	limit := int32(56) // int32 | Count of requested entities (optional)
	offset := int32(56) // int32 | Offset (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TransactionsAPI.GetTransactionEvents(context.Background(), hash).Limit(limit).Offset(offset).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TransactionsAPI.GetTransactionEvents``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetTransactionEvents`: []ResponsesEvent
	fmt.Fprintf(os.Stdout, "Response from `TransactionsAPI.GetTransactionEvents`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
hash string Transaction hash in hexadecimal

Other Parameters

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

Name Type Description Notes

limit | int32 | Count of requested entities | offset | int32 | Offset |

Return type

[]ResponsesEvent

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetTransactionMessages

[]ResponsesMessage GetTransactionMessages(ctx, hash).Limit(limit).Offset(offset).Execute()

Get transaction messages

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/celenium-io/celenium-api-go"
)

func main() {
	hash := "hash_example" // string | Transaction hash in hexadecimal
	limit := int32(56) // int32 | Count of requested entities (optional)
	offset := int32(56) // int32 | Offset (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TransactionsAPI.GetTransactionMessages(context.Background(), hash).Limit(limit).Offset(offset).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TransactionsAPI.GetTransactionMessages``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetTransactionMessages`: []ResponsesMessage
	fmt.Fprintf(os.Stdout, "Response from `TransactionsAPI.GetTransactionMessages`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
hash string Transaction hash in hexadecimal

Other Parameters

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

Name Type Description Notes

limit | int32 | Count of requested entities | offset | int32 | Offset |

Return type

[]ResponsesMessage

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetTransactionsCount

int64 GetTransactionsCount(ctx).Execute()

Get count of transactions in network

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/celenium-io/celenium-api-go"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

int64

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

ListGenesisTransactions

[]ResponsesTx ListGenesisTransactions(ctx).Limit(limit).Offset(offset).Sort(sort).Execute()

List genesis transactions info

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/celenium-io/celenium-api-go"
)

func main() {
	limit := int32(56) // int32 | Count of requested entities (optional)
	offset := int32(56) // int32 | Offset (optional)
	sort := "sort_example" // string | Sort order (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TransactionsAPI.ListGenesisTransactions(context.Background()).Limit(limit).Offset(offset).Sort(sort).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TransactionsAPI.ListGenesisTransactions``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListGenesisTransactions`: []ResponsesTx
	fmt.Fprintf(os.Stdout, "Response from `TransactionsAPI.ListGenesisTransactions`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
limit int32 Count of requested entities
offset int32 Offset
sort string Sort order

Return type

[]ResponsesTx

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

ListTransactionBlobs

[]ResponsesBlobLog ListTransactionBlobs(ctx, hash).Limit(limit).Offset(offset).Sort(sort).SortBy(sortBy).Source(source).Execute()

List blobs which was pushed by transaction

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/celenium-io/celenium-api-go"
)

func main() {
	hash := "hash_example" // string | Transaction hash in hexadecimal
	limit := int32(56) // int32 | Count of requested entities (optional)
	offset := int32(56) // int32 | Offset (optional)
	sort := "sort_example" // string | Sort order. Default: desc (optional)
	sortBy := "sortBy_example" // string | Sort field. If it's empty internal id is used (optional)
	source := "source_example" // string | Blob source. If it's empty both sources are returned (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TransactionsAPI.ListTransactionBlobs(context.Background(), hash).Limit(limit).Offset(offset).Sort(sort).SortBy(sortBy).Source(source).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TransactionsAPI.ListTransactionBlobs``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListTransactionBlobs`: []ResponsesBlobLog
	fmt.Fprintf(os.Stdout, "Response from `TransactionsAPI.ListTransactionBlobs`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
hash string Transaction hash in hexadecimal

Other Parameters

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

Name Type Description Notes

limit | int32 | Count of requested entities | offset | int32 | Offset | sort | string | Sort order. Default: desc | sortBy | string | Sort field. If it's empty internal id is used | source | string | Blob source. If it's empty both sources are returned |

Return type

[]ResponsesBlobLog

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

ListTransactions

[]ResponsesTx ListTransactions(ctx).Limit(limit).Offset(offset).Sort(sort).Status(status).MsgType(msgType).ExcludedMsgType(excludedMsgType).From(from).To(to).Height(height).Messages(messages).Cursor(cursor).Execute()

List transactions info

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/celenium-io/celenium-api-go"
)

func main() {
	limit := int32(56) // int32 | Count of requested entities (optional)
	offset := int32(56) // int32 | Offset (optional)
	sort := "sort_example" // string | Sort order (optional)
	status := []string{"Status_example"} // []string | Comma-separated status list (optional)
	msgType := []string{"MsgType_example"} // []string | Comma-separated message types list (optional)
	excludedMsgType := []string{"ExcludedMsgType_example"} // []string | Comma-separated message types list which should be excluded (optional)
	from := int64(789) // int64 | Time from in unix timestamp (optional)
	to := int64(789) // int64 | Time to in unix timestamp (optional)
	height := int64(789) // int64 | Block number (optional)
	messages := true // bool | If true join messages (optional)
	cursor := int64(789) // int64 | Last entity id which is used for cursor pagination (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TransactionsAPI.ListTransactions(context.Background()).Limit(limit).Offset(offset).Sort(sort).Status(status).MsgType(msgType).ExcludedMsgType(excludedMsgType).From(from).To(to).Height(height).Messages(messages).Cursor(cursor).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TransactionsAPI.ListTransactions``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListTransactions`: []ResponsesTx
	fmt.Fprintf(os.Stdout, "Response from `TransactionsAPI.ListTransactions`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
limit int32 Count of requested entities
offset int32 Offset
sort string Sort order
status []string Comma-separated status list
msgType []string Comma-separated message types list
excludedMsgType []string Comma-separated message types list which should be excluded
from int64 Time from in unix timestamp
to int64 Time to in unix timestamp
height int64 Block number
messages bool If true join messages
cursor int64 Last entity id which is used for cursor pagination

Return type

[]ResponsesTx

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

TransactionBlobsCount

int64 TransactionBlobsCount(ctx, hash).Execute()

Count of blobs which was pushed by transaction

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/celenium-io/celenium-api-go"
)

func main() {
	hash := "hash_example" // string | Transaction hash in hexadecimal

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
hash string Transaction hash in hexadecimal

Other Parameters

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

Name Type Description Notes

Return type

int64

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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