\ProofOfTransferAPI

July 14, 2024 ยท View on GitHub

MethodHTTP requestDescription
GetPoxCycleGet /extended/v2/pox/cycles/{cycle_number}Get PoX cycle
GetPoxCycleSignerGet /extended/v2/pox/cycles/{cycle_number}/signers/{signer_key}Get signer in PoX cycle
GetPoxCycleSignerStackersGet /extended/v2/pox/cycles/{cycle_number}/signers/{signer_key}/stackersGet stackers for signer in PoX cycle
GetPoxCycleSignersGet /extended/v2/pox/cycles/{cycle_number}/signersGet signers in PoX cycle
GetPoxCyclesGet /extended/v2/pox/cyclesGet PoX cycles

GetPoxCycle

PoxCycle GetPoxCycle(ctx, cycleNumber).Execute()

Get PoX cycle

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/cbadawi/go-stacks"
)

func main() {
	cycleNumber := int32(56) // int32 | PoX cycle number

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

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
cycleNumberint32PoX cycle number

Other Parameters

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

NameTypeDescriptionNotes

Return type

PoxCycle

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]

GetPoxCycleSigner

PoxSigner GetPoxCycleSigner(ctx, cycleNumber, signerKey).Execute()

Get signer in PoX cycle

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/cbadawi/go-stacks"
)

func main() {
	cycleNumber := int32(56) // int32 | PoX cycle number
	signerKey := "0x038e3c4529395611be9abf6fa3b6987e81d402385e3d605a073f42f407565a4a3d" // string | Signer key

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

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
cycleNumberint32PoX cycle number
signerKeystringSigner key

Other Parameters

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

NameTypeDescriptionNotes

Return type

PoxSigner

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]

GetPoxCycleSignerStackers

PoxCycleSignerStackersListResponse GetPoxCycleSignerStackers(ctx, cycleNumber, signerKey).Execute()

Get stackers for signer in PoX cycle

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/cbadawi/go-stacks"
)

func main() {
	cycleNumber := int32(56) // int32 | PoX cycle number
	signerKey := "0x038e3c4529395611be9abf6fa3b6987e81d402385e3d605a073f42f407565a4a3d" // string | Signer key

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

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
cycleNumberint32PoX cycle number
signerKeystringSigner key

Other Parameters

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

NameTypeDescriptionNotes

Return type

PoxCycleSignerStackersListResponse

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]

GetPoxCycleSigners

PoxCycleSignersListResponse GetPoxCycleSigners(ctx, cycleNumber).Execute()

Get signers in PoX cycle

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/cbadawi/go-stacks"
)

func main() {
	cycleNumber := int32(56) // int32 | PoX cycle number

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

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
cycleNumberint32PoX cycle number

Other Parameters

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

NameTypeDescriptionNotes

Return type

PoxCycleSignersListResponse

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]

GetPoxCycles

PoxCycleListResponse GetPoxCycles(ctx).Limit(limit).Offset(offset).Execute()

Get PoX cycles

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/cbadawi/go-stacks"
)

func main() {
	limit := int32(56) // int32 | max number of cycles to fetch (optional) (default to 20)
	offset := int32(20) // int32 | index of first cycle to fetch (optional)

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

Path Parameters

Other Parameters

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

NameTypeDescriptionNotes
limitint32max number of cycles to fetch[default to 20]
offsetint32index of first cycle to fetch

Return type

PoxCycleListResponse

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]