provider

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = log.Println

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(storage *db.Storage, api ton.APIClientWrapped, provider *transport.Client) *Client

func (*Client) BuildAddProviderTransaction

func (c *Client) BuildAddProviderTransaction(ctx context.Context, torrentHash []byte, owner *address.Address, providers []NewProviderData) (addr *address.Address, bodyData, stateInit []byte, err error)

func (*Client) BuildWithdrawalTransaction

func (c *Client) BuildWithdrawalTransaction(torrentHash []byte, owner *address.Address) (addr *address.Address, bodyData []byte, err error)

func (*Client) FetchProviderContract

func (c *Client) FetchProviderContract(ctx context.Context, torrentHash []byte, owner *address.Address) (*ProviderContractData, error)

func (*Client) FetchProviderRates

func (c *Client) FetchProviderRates(ctx context.Context, torrentHash, providerKey []byte) (*ProviderRates, error)

func (*Client) RequestProviderStorageInfo

func (c *Client) RequestProviderStorageInfo(ctx context.Context, torrentHash, providerKey []byte, owner *address.Address) (*ProviderStorageInfo, error)

type NewProviderData

type NewProviderData struct {
	Address       *address.Address
	MaxSpan       uint32
	PricePerMBDay tlb.Coins
}

type ProviderContractData

type ProviderContractData struct {
	Size      uint64
	Address   *address.Address
	Providers []contract.ProviderDataV1
	Balance   tlb.Coins
}

type ProviderRates

type ProviderRates struct {
	Available        bool
	RatePerMBDay     tlb.Coins
	MinBounty        tlb.Coins
	SpaceAvailableMB uint64
	MinSpan          uint32
	MaxSpan          uint32

	Size uint64
}

type ProviderStorageInfo

type ProviderStorageInfo struct {
	StorageADNL string
	Status      string
	Reason      string
	Progress    float64

	Context   context.Context
	FetchedAt time.Time
}

Jump to

Keyboard shortcuts

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