transfers

package
v0.0.1-alpha-7 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService(
	hederaNode client.HederaNode,
	mirrorNode client.MirrorNode,
	contractsService service.Contracts,
	fees service.Fees,
	signer service.Signer,
	transferRepository repository.Transfer,
	topicID string,
) *Service

func (*Service) InitiateNewTransfer

func (ts *Service) InitiateNewTransfer(tm model.Transfer) (*entity.Transfer, error)

InitiateNewTransfer Stores the incoming transfer message into the Database aware of already processed transfers

func (*Service) ProcessTransfer

func (ts *Service) ProcessTransfer(tm model.Transfer) error

func (*Service) SanityCheckTransfer

func (ts *Service) SanityCheckTransfer(tx mirror_node.Transaction) (*memo.Memo, error)

SanityCheck performs validation on the memo and state proof for the transaction

func (*Service) SaveRecoveredTxn

func (ts *Service) SaveRecoveredTxn(txId, amount, nativeToken, wrappedToken string, m memo.Memo) error

SaveRecoveredTxn creates new Transaction record persisting the recovered Transfer TXn

func (*Service) TransferData

func (ts *Service) TransferData(txId string) (service.TransferData, error)

TransferData returns from the database the given transfer, its signatures and calculates if its messages have reached super majority

func (*Service) VerifyFee

func (ts *Service) VerifyFee(tm model.Transfer) error

VerifyFee verifies that the provided TX reimbursement fee is enough using the Fee Calculator and updates the Transaction Record to Insufficient Fee if necessary

Jump to

Keyboard shortcuts

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