cuhelper

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfAlreadySettled

func CheckIfAlreadySettled(ctx context.Context, db *harmonydb.DB, providerID int64, latestNonce int64) (bool, error)

CheckIfAlreadySettled checks if the latest payment is already settled

func RecordSettlement

func RecordSettlement(ctx context.Context, tx *harmonydb.Tx, providerID int64, paymentNonce int64, settleCid cid.Cid) error

RecordSettlement records the settlement in the database

func SettleProvider

func SettleProvider(
	ctx context.Context,
	db *harmonydb.DB,
	chain api.FullNode,
	sendFunc func(ctx context.Context, msg *types.Message, mss *api.MessageSendSpec) (cid.Cid, error),
	providerID int64,
) (cid.Cid, error)

SettleProvider performs the settlement for a provider

Types

type ProviderPaymentInfo

type ProviderPaymentInfo struct {
	ProviderID       int64
	LatestNonce      int64
	CumulativeAmount string
	Signature        []byte
}

ProviderPaymentInfo holds the payment information for a provider

func GetProviderPaymentInfo

func GetProviderPaymentInfo(ctx context.Context, db *harmonydb.DB, providerID int64) (*ProviderPaymentInfo, error)

GetProviderPaymentInfo fetches the latest payment info for a provider

Jump to

Keyboard shortcuts

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