Skip to content

Latest commit

 

History

History
397 lines (257 loc) · 11.7 KB

TransactionsApi.md

File metadata and controls

397 lines (257 loc) · 11.7 KB

\TransactionsApi

All URIs are relative to http://127.0.0.1:12973

Method HTTP request Description
GetTransactionsStatus Get /transactions/status Get tx status
GetTransactionsUnconfirmed Get /transactions/unconfirmed List unconfirmed transactions
PostTransactionsBuild Post /transactions/build Build an unsigned transaction to a number of recipients
PostTransactionsDecodeUnsignedTx Post /transactions/decode-unsigned-tx Decode an unsigned transaction
PostTransactionsSubmit Post /transactions/submit Submit a signed transaction
PostTransactionsSweepAddressBuild Post /transactions/sweep-address/build Build unsigned transactions to send all unlocked balanced of one address to another address

GetTransactionsStatus

TxStatus GetTransactionsStatus(ctx).TxId(txId).FromGroup(fromGroup).ToGroup(toGroup).Execute()

Get tx status

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    txId := "txId_example" // string | 
    fromGroup := int32(56) // int32 |  (optional)
    toGroup := int32(56) // int32 |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.TransactionsApi.GetTransactionsStatus(context.Background()).TxId(txId).FromGroup(fromGroup).ToGroup(toGroup).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TransactionsApi.GetTransactionsStatus``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetTransactionsStatus`: TxStatus
    fmt.Fprintf(os.Stdout, "Response from `TransactionsApi.GetTransactionsStatus`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
txId string
fromGroup int32
toGroup int32

Return type

TxStatus

Authorization

No authorization required

HTTP request headers

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

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

GetTransactionsUnconfirmed

[]UnconfirmedTransactions GetTransactionsUnconfirmed(ctx).Execute()

List unconfirmed transactions

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]UnconfirmedTransactions

Authorization

No authorization required

HTTP request headers

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

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

PostTransactionsBuild

BuildTransactionResult PostTransactionsBuild(ctx).BuildTransaction(buildTransaction).Execute()

Build an unsigned transaction to a number of recipients

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    buildTransaction := *openapiclient.NewBuildTransaction("FromPublicKey_example", []openapiclient.Destination{*openapiclient.NewDestination("Address_example", "AttoAlphAmount_example")}) // BuildTransaction | Format 1: `1000000000000000000`  Format 2: `x.y ALPH`, where `1 ALPH = 1000000000000000000`

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

Path Parameters

Other Parameters

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

Name Type Description Notes
buildTransaction BuildTransaction Format 1: `1000000000000000000` Format 2: `x.y ALPH`, where `1 ALPH = 1000000000000000000`

Return type

BuildTransactionResult

Authorization

No authorization required

HTTP request headers

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

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

PostTransactionsDecodeUnsignedTx

DecodeUnsignedTxResult PostTransactionsDecodeUnsignedTx(ctx).DecodeUnsignedTx(decodeUnsignedTx).Execute()

Decode an unsigned transaction

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    decodeUnsignedTx := *openapiclient.NewDecodeUnsignedTx("UnsignedTx_example") // DecodeUnsignedTx | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
decodeUnsignedTx DecodeUnsignedTx

Return type

DecodeUnsignedTxResult

Authorization

No authorization required

HTTP request headers

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

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

PostTransactionsSubmit

SubmitTxResult PostTransactionsSubmit(ctx).SubmitTransaction(submitTransaction).Execute()

Submit a signed transaction

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    submitTransaction := *openapiclient.NewSubmitTransaction("UnsignedTx_example", "Signature_example") // SubmitTransaction | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
submitTransaction SubmitTransaction

Return type

SubmitTxResult

Authorization

No authorization required

HTTP request headers

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

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

PostTransactionsSweepAddressBuild

BuildSweepAddressTransactionsResult PostTransactionsSweepAddressBuild(ctx).BuildSweepAddressTransactions(buildSweepAddressTransactions).Execute()

Build unsigned transactions to send all unlocked balanced of one address to another address

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    buildSweepAddressTransactions := *openapiclient.NewBuildSweepAddressTransactions("FromPublicKey_example", "ToAddress_example") // BuildSweepAddressTransactions | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
buildSweepAddressTransactions BuildSweepAddressTransactions

Return type

BuildSweepAddressTransactionsResult

Authorization

No authorization required

HTTP request headers

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

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