\StackingRewardsAPI

July 14, 2024 ยท View on GitHub

MethodHTTP requestDescription
GetBurnchainRewardListGet /extended/v1/burnchain/rewardsGet recent burnchain reward recipients
GetBurnchainRewardListByAddressGet /extended/v1/burnchain/rewards/{address}Get recent burnchain reward for the given recipient
GetBurnchainRewardSlotHoldersGet /extended/v1/burnchain/reward_slot_holdersGet recent reward slot holders
GetBurnchainRewardSlotHoldersByAddressGet /extended/v1/burnchain/reward_slot_holders/{address}Get recent reward slot holder entries for the given address
GetBurnchainRewardsTotalByAddressGet /extended/v1/burnchain/rewards/{address}/totalGet total burnchain rewards for the given recipient

GetBurnchainRewardList

BurnchainRewardListResponse GetBurnchainRewardList(ctx).Limit(limit).Offset(offset).Execute()

Get recent burnchain reward recipients

Example

package main

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

func main() {
	limit := int32(56) // int32 | max number of rewards to fetch (optional) (default to 96)
	offset := int32(42000) // int32 | index of first rewards to fetch (optional)

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

Path Parameters

Other Parameters

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

NameTypeDescriptionNotes
limitint32max number of rewards to fetch[default to 96]
offsetint32index of first rewards to fetch

Return type

BurnchainRewardListResponse

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]

GetBurnchainRewardListByAddress

BurnchainRewardListResponse GetBurnchainRewardListByAddress(ctx, address).Limit(limit).Offset(offset).Execute()

Get recent burnchain reward for the given recipient

Example

package main

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

func main() {
	address := "36hQtSEXBMevo5chpxhfAGiCTSC34QKgda" // string | Reward recipient address. Should either be in the native burnchain's format (e.g. B58 for Bitcoin), or if a STX principal address is provided it will be encoded as into the equivalent burnchain format
	limit := int32(56) // int32 | max number of rewards to fetch (optional)
	offset := int32(42000) // int32 | index of first rewards to fetch (optional)

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

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
addressstringReward recipient address. Should either be in the native burnchain's format (e.g. B58 for Bitcoin), or if a STX principal address is provided it will be encoded as into the equivalent burnchain format

Other Parameters

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

NameTypeDescriptionNotes

limit | int32 | max number of rewards to fetch | offset | int32 | index of first rewards to fetch |

Return type

BurnchainRewardListResponse

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]

GetBurnchainRewardSlotHolders

BurnchainRewardSlotHolderListResponse GetBurnchainRewardSlotHolders(ctx).Limit(limit).Offset(offset).Execute()

Get recent reward slot holders

Example

package main

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

func main() {
	limit := int32(56) // int32 | max number of items to fetch (optional) (default to 96)
	offset := int32(42000) // int32 | index of the first items to fetch (optional)

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

Path Parameters

Other Parameters

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

NameTypeDescriptionNotes
limitint32max number of items to fetch[default to 96]
offsetint32index of the first items to fetch

Return type

BurnchainRewardSlotHolderListResponse

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]

GetBurnchainRewardSlotHoldersByAddress

BurnchainRewardSlotHolderListResponse GetBurnchainRewardSlotHoldersByAddress(ctx, address).Limit(limit).Offset(offset).Execute()

Get recent reward slot holder entries for the given address

Example

package main

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

func main() {
	address := "36hQtSEXBMevo5chpxhfAGiCTSC34QKgda" // string | Reward slot holder recipient address. Should either be in the native burnchain's format (e.g. B58 for Bitcoin), or if a STX principal address is provided it will be encoded as into the equivalent burnchain format
	limit := int32(56) // int32 | max number of items to fetch (optional)
	offset := int32(42000) // int32 | index of the first items to fetch (optional)

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

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
addressstringReward slot holder recipient address. Should either be in the native burnchain's format (e.g. B58 for Bitcoin), or if a STX principal address is provided it will be encoded as into the equivalent burnchain format

Other Parameters

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

NameTypeDescriptionNotes

limit | int32 | max number of items to fetch | offset | int32 | index of the first items to fetch |

Return type

BurnchainRewardSlotHolderListResponse

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]

GetBurnchainRewardsTotalByAddress

BurnchainRewardsTotal GetBurnchainRewardsTotalByAddress(ctx, address).Execute()

Get total burnchain rewards for the given recipient

Example

package main

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

func main() {
	address := "36hQtSEXBMevo5chpxhfAGiCTSC34QKgda" // string | Reward recipient address. Should either be in the native burnchain's format (e.g. B58 for Bitcoin), or if a STX principal address is provided it will be encoded as into the equivalent burnchain format

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

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
addressstringReward recipient address. Should either be in the native burnchain's format (e.g. B58 for Bitcoin), or if a STX principal address is provided it will be encoded as into the equivalent burnchain format

Other Parameters

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

NameTypeDescriptionNotes

Return type

BurnchainRewardsTotal

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]