service

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ClaimKeyPrefix          = "Claim/"
	ConfirmedClaimKeyPrefix = "ConfirmedClaim/"
	CountKey                = "Count"
)

Variables

This section is empty.

Functions

func ClaimKey

func ClaimKey(id int) []byte

func ConfirmedClaimKey

func ConfirmedClaimKey(id int) []byte

func InitDB

func InitDB(cfg *config.Config) (db *leveldb.DB, err error)

func KeyPrefix

func KeyPrefix(p string) []byte

Types

type IPlanetmintClient added in v0.2.3

type IPlanetmintClient interface {
	SendConfirmation(claimID int, beneficiary string) (txResponse sdk.TxResponse, err error)
}

type PlanetmintClient added in v0.2.3

type PlanetmintClient struct{}

func NewPlanetmintClient added in v0.2.3

func NewPlanetmintClient() *PlanetmintClient

func (*PlanetmintClient) SendConfirmation added in v0.2.3

func (pc *PlanetmintClient) SendConfirmation(claimID int, beneficiary string) (txResponse sdk.TxResponse, err error)

type RDDLClaimService

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

func NewRDDLClaimService

func NewRDDLClaimService(db *leveldb.DB, router *gin.Engine, shamir client.IShamirCoordinatorClient, logger log.AppLogger, pmClient IPlanetmintClient) *RDDLClaimService

func (*RDDLClaimService) ConfirmClaim

func (rcs *RDDLClaimService) ConfirmClaim(id int) (err error)

func (*RDDLClaimService) CreateUnconfirmedClaim

func (rcs *RDDLClaimService) CreateUnconfirmedClaim(rc RedeemClaim) (id int, err error)

func (*RDDLClaimService) DeleteUnconfirmedClaim

func (rcs *RDDLClaimService) DeleteUnconfirmedClaim(id int) (err error)

func (*RDDLClaimService) GetAllConfirmedClaims

func (rcs *RDDLClaimService) GetAllConfirmedClaims() (claims []RedeemClaim, err error)

func (*RDDLClaimService) GetAllUnconfirmedClaims

func (rcs *RDDLClaimService) GetAllUnconfirmedClaims() (claims []RedeemClaim, err error)

func (*RDDLClaimService) GetConfirmedClaim

func (rcs *RDDLClaimService) GetConfirmedClaim(id int) (claim RedeemClaim, err error)

func (*RDDLClaimService) GetUnconfirmedClaim

func (rcs *RDDLClaimService) GetUnconfirmedClaim(id int) (claim RedeemClaim, err error)

func (*RDDLClaimService) Run

func (rcs *RDDLClaimService) Run(cfg *config.Config)

type RedeemClaim

type RedeemClaim struct {
	ID           int    `json:"id"`
	Beneficiary  string `json:"beneficiary"`
	Amount       uint64 `json:"amount"`
	LiquidTXHash string `json:"liquid-tx-hash"`
	ClaimID      int    `json:"claim-id"`
}

Jump to

Keyboard shortcuts

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