arc

package
v1.0.0-beta.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusNotExtendedFormat             = 460
	StatusFeeTooLow                     = 465
	StatusCumulativeFeeValidationFailed = 473
)

Custom ARC defined http status codes

Variables

This section is empty.

Functions

This section is empty.

Types

type FeeAmount

type FeeAmount struct {
	Bytes    int          `json:"bytes"`
	Satoshis bsv.Satoshis `json:"satoshis"`
}

FeeAmount indicating how many satoshis are paid for the given number of bytes in the transaction.

type Policy

type Policy struct {
	Content   PolicyContent `json:"policy"`
	Timestamp time.Time     `json:"timestamp"`
}

Policy is the policy model returned from ARC

type PolicyContent

type PolicyContent struct {
	MaxScriptSizePolicy     int       `json:"maxscriptsizepolicy"`
	MaxTXSigOPSCountsPolicy int64     `json:"maxtxsigopscountspolicy"`
	MaxTXSizePolicy         int       `json:"maxtxsizepolicy"`
	MiningFee               FeeAmount `json:"miningFee"`
}

PolicyContent is the actual policy values returned from ARC

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service for arc requests.

func NewARCService

func NewARCService(logger zerolog.Logger, httpClient *resty.Client, arcCfg chainmodels.ARCConfig) *Service

NewARCService creates a new arc service.

func (*Service) Broadcast

func (s *Service) Broadcast(ctx context.Context, tx *sdk.Transaction) (*chainmodels.TXInfo, error)

Broadcast submits a transaction to the ARC server and returns the transaction info.

func (*Service) GetPolicy

func (s *Service) GetPolicy(ctx context.Context) (*Policy, error)

GetPolicy returns the current policy from the ARC server.

func (*Service) QueryTransaction

func (s *Service) QueryTransaction(ctx context.Context, txID string) (*chainmodels.TXInfo, error)

QueryTransaction a transaction.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL