service

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: AGPL-3.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConversion added in v0.3.2

func GetConversion(rddl uint64) (plmnt uint64)

TODO: Constant rate to be replaced with conversion rate monitor Cut away the PLMNT fractions as planetmint only works with natural numbers

func VerifyAddress added in v0.3.0

func VerifyAddress(address string) (valid bool, err error)

verifyAddress verifies the integrity and prefix of a given address.

Types

type ConversionRequest

type ConversionRequest struct {
	ConfidentialAddress string `binding:"required" json:"confidential-address"`
	PlanetmintAddress   string `binding:"required" json:"planetmint-address"`
	Timestamp           int64  `binding:"required" json:"timestamp"`
}

type ElementsClient

type ElementsClient struct{}

func NewElementsClient

func NewElementsClient() *ElementsClient

func (*ElementsClient) GetNewAddress

func (ec *ElementsClient) GetNewAddress(url string, params []string) (address string, err error)

func (*ElementsClient) ListReceivedByAddress

func (ec *ElementsClient) ListReceivedByAddress(url string, params []string) (receivedTx []types.ListReceivedByAddressResult, err error)

type IElementsClient

type IElementsClient interface {
	GetNewAddress(url string, params []string) (address string, err error)
	ListReceivedByAddress(url string, params []string) (receivedTx []types.ListReceivedByAddressResult, err error)
}

type IPlanetmintClient

type IPlanetmintClient interface {
	MintPLMNT(beneficiary string, amount uint64, liquidTxHash string) (err error)
	CheckMintRequest(txhash string) (mintRequest *daotypes.QueryGetMintRequestsByHashResponse, err error)
}

type PlanetmintClient

type PlanetmintClient struct{}

func NewPlanetmintClient

func NewPlanetmintClient() *PlanetmintClient

func (*PlanetmintClient) CheckMintRequest

func (pmc *PlanetmintClient) CheckMintRequest(txhash string) (mintRequest *daotypes.QueryGetMintRequestsByHashResponse, err error)

func (*PlanetmintClient) MintPLMNT

func (pmc *PlanetmintClient) MintPLMNT(beneficiary string, amount uint64, liquidTxHash string) (err error)

type R2PService

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

func NewR2PService

func NewR2PService(router *gin.Engine, pmClient IPlanetmintClient, eClient IElementsClient, db *leveldb.DB, logger log.AppLogger) *R2PService

func (*R2PService) ExecutePotentialConversion

func (r2p *R2PService) ExecutePotentialConversion(conversion ConversionRequest) (deleteEntry bool, err error)

func (*R2PService) Run

func (r2p *R2PService) Run(config *viper.Viper) (err error)

type ReceiveAddressResponse added in v0.3.0

type ReceiveAddressResponse struct {
	LiquidAddress         string `binding:"required" json:"liquid-address"`
	PlanetmintBeneficiary string `binding:"required" json:"planetmint-beneficiary"`
}

Jump to

Keyboard shortcuts

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