client

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

A Client provides methods for interacting with a bus.

func New

func New(addr, password string) *Client

New returns a new bus client.

func (*Client) AbortMultipartUpload

func (c *Client) AbortMultipartUpload(ctx context.Context, bucket, path string, uploadID string) (err error)

AbortMultipartUpload aborts a multipart upload.

func (*Client) AcceptBlock

func (c *Client) AcceptBlock(ctx context.Context, b types.Block) (err error)

AcceptBlock submits a block to the consensus manager.

func (*Client) Account

func (c *Client) Account(ctx context.Context, id rhpv3.Account, hostKey types.PublicKey) (account api.Account, err error)

Account returns the account for given id.

func (*Client) Accounts

func (c *Client) Accounts(ctx context.Context) (accounts []api.Account, err error)

Accounts returns all accounts.

func (*Client) AcquireContract

func (c *Client) AcquireContract(ctx context.Context, contractID types.FileContractID, priority int, d time.Duration) (lockID uint64, err error)

AcquireContract acquires a contract for a given amount of time unless released manually before that time.

func (*Client) AddBalance

func (c *Client) AddBalance(ctx context.Context, id rhpv3.Account, hostKey types.PublicKey, amount *big.Int) (err error)

AddBalance adds the given amount to an account's balance, the amount can be negative.

func (*Client) AddContract

func (c *Client) AddContract(ctx context.Context, contract rhpv2.ContractRevision, contractPrice, totalCost types.Currency, startHeight uint64, state string) (added api.ContractMetadata, err error)

AddContract adds the provided contract to the metadata store.

func (*Client) AddMultipartPart

func (c *Client) AddMultipartPart(ctx context.Context, bucket, path, contractSet, eTag, uploadID string, partNumber int, slices []object.SlabSlice) (err error)

AddMultipartPart adds a part to a multipart upload.

func (*Client) AddObject

func (c *Client) AddObject(ctx context.Context, bucket, path, contractSet string, o object.Object, opts api.AddObjectOptions) (err error)

AddObject stores the provided object under the given path.

func (*Client) AddPartialSlab

func (c *Client) AddPartialSlab(ctx context.Context, data []byte, minShards, totalShards uint8, contractSet string) (slabs []object.SlabSlice, slabBufferMaxSizeSoftReached bool, err error)

AddPartialSlab adds a partial slab to the bus.

func (*Client) AddRenewedContract

func (c *Client) AddRenewedContract(ctx context.Context, contract rhpv2.ContractRevision, contractPrice, totalCost types.Currency, startHeight uint64, renewedFrom types.FileContractID, state string) (renewed api.ContractMetadata, err error)

AddRenewedContract adds the provided contract to the metadata store.

func (*Client) AddUploadingSector

func (c *Client) AddUploadingSector(ctx context.Context, uID api.UploadID, id types.FileContractID, root types.Hash256) (err error)

AddUploadingSector adds the given sector to the upload with given id.

func (*Client) Alerts

func (c *Client) Alerts(ctx context.Context, opts alerts.AlertsOpts) (resp alerts.AlertsResponse, err error)

Alerts fetches the active alerts from the bus.

func (*Client) AncestorContracts

func (c *Client) AncestorContracts(ctx context.Context, contractID types.FileContractID, minStartHeight uint64) (contracts []api.ArchivedContract, err error)

AncestorContracts returns any ancestors of a given contract.

func (*Client) ArchiveContracts

func (c *Client) ArchiveContracts(ctx context.Context, toArchive map[types.FileContractID]string) (err error)

ArchiveContracts archives the contracts with the given IDs and archival reason.

func (*Client) Autopilot

func (c *Client) Autopilot(ctx context.Context, id string) (autopilot api.Autopilot, err error)

Autopilot returns the autopilot with the given ID.

func (*Client) Autopilots

func (c *Client) Autopilots(ctx context.Context) (autopilots []api.Autopilot, err error)

Autopilots returns all autopilots in the autopilots store.

func (*Client) BroadcastAction

func (c *Client) BroadcastAction(ctx context.Context, action webhooks.Event) error

BroadcastAction broadcasts an action that triggers a webhook.

func (*Client) BroadcastTransaction

func (c *Client) BroadcastTransaction(ctx context.Context, txns []types.Transaction) error

BroadcastTransaction broadcasts the transaction set to the network.

func (*Client) Bucket

func (c *Client) Bucket(ctx context.Context, bucketName string) (resp api.Bucket, err error)

Bucket returns information about a specific bucket.

func (*Client) CompleteMultipartUpload

func (c *Client) CompleteMultipartUpload(ctx context.Context, bucket, path, uploadID string, parts []api.MultipartCompletedPart, opts api.CompleteMultipartOptions) (resp api.MultipartCompleteResponse, err error)

CompleteMultipartUpload completes a multipart upload.

func (*Client) ConsensusNetwork

func (c *Client) ConsensusNetwork(ctx context.Context) (resp api.ConsensusNetwork, err error)

ConsensusNetwork returns information about the consensus network.

func (*Client) ConsensusState

func (c *Client) ConsensusState(ctx context.Context) (resp api.ConsensusState, err error)

ConsensusState returns the current block height and whether the node is synced.

func (*Client) Contract

func (c *Client) Contract(ctx context.Context, id types.FileContractID) (contract api.ContractMetadata, err error)

Contract returns the contract with the given ID.

func (*Client) ContractMetrics

func (c *Client) ContractMetrics(ctx context.Context, start time.Time, n uint64, interval time.Duration, opts api.ContractMetricsQueryOpts) ([]api.ContractMetric, error)

func (*Client) ContractPruneMetrics

func (c *Client) ContractPruneMetrics(ctx context.Context, start time.Time, n uint64, interval time.Duration, opts api.ContractPruneMetricsQueryOpts) ([]api.ContractPruneMetric, error)

func (*Client) ContractRoots

func (c *Client) ContractRoots(ctx context.Context, contractID types.FileContractID) (roots, uploading []types.Hash256, err error)

ContractRoots returns the sector roots, as well as the ones that are still uploading, for the contract with given id.

func (*Client) ContractSetChurnMetrics

func (c *Client) ContractSetChurnMetrics(ctx context.Context, start time.Time, n uint64, interval time.Duration, opts api.ContractSetChurnMetricsQueryOpts) ([]api.ContractSetChurnMetric, error)

func (*Client) ContractSetMetrics

func (c *Client) ContractSetMetrics(ctx context.Context, start time.Time, n uint64, interval time.Duration, opts api.ContractSetMetricsQueryOpts) ([]api.ContractSetMetric, error)

func (*Client) ContractSetSettings

func (c *Client) ContractSetSettings(ctx context.Context) (gs api.ContractSetSetting, err error)

ContractSetSettings returns the contract set settings.

func (*Client) ContractSets

func (c *Client) ContractSets(ctx context.Context) (sets []string, err error)

ContractSets returns the contract sets of the bus.

func (*Client) ContractSize

func (c *Client) ContractSize(ctx context.Context, contractID types.FileContractID) (size api.ContractSize, err error)

ContractSize returns the contract's size.

func (*Client) Contracts

func (c *Client) Contracts(ctx context.Context, opts api.ContractsOpts) (contracts []api.ContractMetadata, err error)

Contracts retrieves contracts from the metadata store. If no filter is set, all contracts are returned.

func (*Client) CopyObject

func (c *Client) CopyObject(ctx context.Context, srcBucket, dstBucket, srcPath, dstPath string, opts api.CopyObjectOptions) (om api.ObjectMetadata, err error)

CopyObject copies the object from the source bucket and path to the destination bucket and path.

func (*Client) CreateBucket

func (c *Client) CreateBucket(ctx context.Context, bucketName string, opts api.CreateBucketOptions) error

CreateBucket creates a new bucket.

func (*Client) CreateMultipartUpload

func (c *Client) CreateMultipartUpload(ctx context.Context, bucket, path string, opts api.CreateMultipartOptions) (resp api.MultipartCreateResponse, err error)

CreateMultipartUpload creates a new multipart upload.

func (*Client) DeleteAllContracts

func (c *Client) DeleteAllContracts(ctx context.Context) (err error)

DeleteAllContracts deletes all contracts from the bus.

func (*Client) DeleteBucket

func (c *Client) DeleteBucket(ctx context.Context, bucketName string) error

DeleteBucket deletes an existing bucket. Fails if the bucket isn't empty.

func (*Client) DeleteContract

func (c *Client) DeleteContract(ctx context.Context, id types.FileContractID) (err error)

DeleteContract deletes the contract with the given ID.

func (*Client) DeleteContractSet

func (c *Client) DeleteContractSet(ctx context.Context, set string) (err error)

DeleteContractSet removes the contract set from the bus.

func (*Client) DeleteContracts

func (c *Client) DeleteContracts(ctx context.Context, ids []types.FileContractID) error

DeleteContracts deletes the contracts with the given IDs.

func (*Client) DeleteHostSector

func (c *Client) DeleteHostSector(ctx context.Context, hostKey types.PublicKey, sectorRoot types.Hash256) error

DeleteHostSector deletes the given sector on host with given host key.

func (*Client) DeleteObject

func (c *Client) DeleteObject(ctx context.Context, bucket, path string, opts api.DeleteObjectOptions) (err error)

DeleteObject either deletes the object at the given path or if batch=true deletes all objects that start with the given path.

func (*Client) DeleteSetting

func (c *Client) DeleteSetting(ctx context.Context, key string) error

DeleteSetting will delete the setting with given key.

func (*Client) DeleteWebhook

func (c *Client) DeleteWebhook(ctx context.Context, url, module, event string) error

DeleteWebhook deletes the webhook with the given ID.

func (*Client) DismissAlerts

func (c *Client) DismissAlerts(ctx context.Context, ids ...types.Hash256) error

DismissAlerts dimisses the alerts with the given IDs.

func (*Client) FetchPartialSlab

func (c *Client) FetchPartialSlab(ctx context.Context, key object.EncryptionKey, offset, length uint32) ([]byte, error)

FetchPartialSlab fetches a partial slab from the bus.

func (*Client) FileContractTax

func (c *Client) FileContractTax(ctx context.Context, payout types.Currency) (tax types.Currency, err error)

FileContractTax asks the bus for the siafund fee that has to be paid for a contract with a given payout.

func (*Client) FinishUpload

func (c *Client) FinishUpload(ctx context.Context, uID api.UploadID) (err error)

FinishUpload marks the given upload as finished.

func (*Client) GougingParams

func (c *Client) GougingParams(ctx context.Context) (gp api.GougingParams, err error)

GougingParams returns parameters used for performing gouging checks.

func (*Client) GougingSettings

func (c *Client) GougingSettings(ctx context.Context) (gs api.GougingSettings, err error)

GougingSettings returns the gouging settings.

func (*Client) Host

func (c *Client) Host(ctx context.Context, hostKey types.PublicKey) (h api.Host, err error)

Host returns information about a particular host known to the server.

func (*Client) HostAllowlist

func (c *Client) HostAllowlist(ctx context.Context) (allowlist []types.PublicKey, err error)

HostAllowlist returns the allowlist.

func (*Client) HostBlocklist

func (c *Client) HostBlocklist(ctx context.Context) (blocklist []string, err error)

HostBlocklist returns a host blocklist.

func (*Client) Hosts

func (c *Client) Hosts(ctx context.Context, opts api.GetHostsOptions) (hosts []api.Host, err error)

Hosts returns 'limit' hosts at given 'offset'.

func (*Client) HostsForScanning

func (c *Client) HostsForScanning(ctx context.Context, opts api.HostsForScanningOptions) (hosts []api.HostAddress, err error)

HostsForScanning returns 'limit' host addresses at given 'offset' which haven't been scanned after lastScan.

func (*Client) KeepaliveContract

func (c *Client) KeepaliveContract(ctx context.Context, contractID types.FileContractID, lockID uint64, d time.Duration) (err error)

KeepaliveContract extends the duration on an already acquired lock on a contract.

func (*Client) ListBuckets

func (c *Client) ListBuckets(ctx context.Context) (buckets []api.Bucket, err error)

ListBuckets lists all available buckets.

func (*Client) ListObjects

func (c *Client) ListObjects(ctx context.Context, bucket string, opts api.ListObjectOptions) (resp api.ObjectsListResponse, err error)

ListOBjects lists objects in the given bucket.

func (*Client) LockAccount

func (c *Client) LockAccount(ctx context.Context, id rhpv3.Account, hostKey types.PublicKey, exclusive bool, duration time.Duration) (account api.Account, lockID uint64, err error)

LockAccount locks an account.

func (*Client) MarkPackedSlabsUploaded

func (c *Client) MarkPackedSlabsUploaded(ctx context.Context, slabs []api.UploadedPackedSlab) (err error)

MarkPackedSlabsUploaded marks the given slabs as uploaded.

func (*Client) MultipartUpload

func (c *Client) MultipartUpload(ctx context.Context, uploadID string) (resp api.MultipartUpload, err error)

MultipartUpload returns information about a specific multipart upload.

func (*Client) MultipartUploadParts

func (c *Client) MultipartUploadParts(ctx context.Context, bucket, path string, uploadID string, partNumberMarker int, limit int64) (resp api.MultipartListPartsResponse, err error)

MultipartUploadParts returns information about all parts of a multipart upload.

func (*Client) MultipartUploads

func (c *Client) MultipartUploads(ctx context.Context, bucket, prefix, keyMarker, uploadIDMarker string, maxUploads int) (resp api.MultipartListUploadsResponse, err error)

MultipartUploads returns information about all multipart uploads.

func (*Client) Object

func (c *Client) Object(ctx context.Context, bucket, path string, opts api.GetObjectOptions) (res api.ObjectsResponse, err error)

Objects returns the object at given path.

func (*Client) ObjectsBySlabKey

func (c *Client) ObjectsBySlabKey(ctx context.Context, bucket string, key object.EncryptionKey) (objects []api.ObjectMetadata, err error)

ObjectsBySlabKey returns all objects that reference a given slab.

func (*Client) ObjectsStats

func (c *Client) ObjectsStats(ctx context.Context, opts api.ObjectsStatsOpts) (osr api.ObjectsStatsResponse, err error)

ObjectsStats returns information about the number of objects and their size.

func (*Client) PackedSlabsForUpload

func (c *Client) PackedSlabsForUpload(ctx context.Context, lockingDuration time.Duration, minShards, totalShards uint8, set string, limit int) (slabs []api.PackedSlab, err error)

PackedSlabsForUpload returns packed slabs that are ready to upload.

func (*Client) PrunableData

func (c *Client) PrunableData(ctx context.Context) (prunableData api.ContractsPrunableDataResponse, err error)

PrunableData returns an overview of all contract sizes, the total size and the amount of data that can be pruned.

func (*Client) PruneMetrics

func (c *Client) PruneMetrics(ctx context.Context, metric string, cutoff time.Time) error

func (*Client) RecommendedFee

func (c *Client) RecommendedFee(ctx context.Context) (fee types.Currency, err error)

RecommendedFee returns the recommended fee for a txn.

func (*Client) RecordContractPruneMetric

func (c *Client) RecordContractPruneMetric(ctx context.Context, metrics ...api.ContractPruneMetric) error

func (*Client) RecordContractSetChurnMetric

func (c *Client) RecordContractSetChurnMetric(ctx context.Context, metrics ...api.ContractSetChurnMetric) error

func (*Client) RecordContractSpending

func (c *Client) RecordContractSpending(ctx context.Context, records []api.ContractSpendingRecord) (err error)

RecordContractSpending records contract spending metrics for contracts.

func (*Client) RecordHostScans

func (c *Client) RecordHostScans(ctx context.Context, scans []api.HostScan) (err error)

RecordHostInteraction records an interaction for the supplied host.

func (*Client) RecordPriceTables

func (c *Client) RecordPriceTables(ctx context.Context, priceTableUpdates []api.HostPriceTableUpdate) (err error)

RecordHostInteraction records an interaction for the supplied host.

func (*Client) RedundancySettings

func (c *Client) RedundancySettings(ctx context.Context) (rs api.RedundancySettings, err error)

RedundancySettings returns the redundancy settings.

func (*Client) RefreshHealth

func (c *Client) RefreshHealth(ctx context.Context) error

RefreshHealth recomputes the cached health of all slabs.

func (*Client) RegisterAlert

func (c *Client) RegisterAlert(ctx context.Context, alert alerts.Alert) error

RegisterAlert registers the given alert.

func (*Client) RegisterWebhook

func (c *Client) RegisterWebhook(ctx context.Context, url, module, event string) error

RegisterWebhook registers a new webhook for the given URL.

func (*Client) ReleaseContract

func (c *Client) ReleaseContract(ctx context.Context, contractID types.FileContractID, lockID uint64) (err error)

ReleaseContract releases a contract that was previously acquired using AcquireContract.

func (*Client) RemoveOfflineHosts

func (c *Client) RemoveOfflineHosts(ctx context.Context, minRecentScanFailures uint64, maxDowntime time.Duration) (removed uint64, err error)

RemoveOfflineHosts removes all hosts that have been offline for longer than the given max downtime.

func (*Client) RenameObject

func (c *Client) RenameObject(ctx context.Context, bucket, from, to string, force bool) (err error)

RenameObject renames a single object.

func (*Client) RenameObjects

func (c *Client) RenameObjects(ctx context.Context, bucket, from, to string, force bool) (err error)

RenameObjects renames all objects with the prefix 'from' to the prefix 'to'.

func (*Client) RenewedContract

func (c *Client) RenewedContract(ctx context.Context, renewedFrom types.FileContractID) (contract api.ContractMetadata, err error)

RenewedContract returns the renewed contract for the given ID.

func (*Client) ResetDrift

func (c *Client) ResetDrift(ctx context.Context, id rhpv3.Account) (err error)

ResetDrift resets the drift of an account to zero.

func (*Client) ResetLostSectors

func (c *Client) ResetLostSectors(ctx context.Context, hostKey types.PublicKey) (err error)

ResetLostSectors resets the lost sector count for a host.

func (*Client) S3AuthenticationSettings

func (c *Client) S3AuthenticationSettings(ctx context.Context) (as api.S3AuthenticationSettings, err error)

S3AuthenticationSettings returns the S3 authentication settings.

func (*Client) ScheduleSync

func (c *Client) ScheduleSync(ctx context.Context, id rhpv3.Account, hostKey types.PublicKey) (err error)

ScheduleSync sets the requiresSync flag of an account.

func (*Client) SearchHosts

func (c *Client) SearchHosts(ctx context.Context, opts api.SearchHostOptions) (hosts []api.Host, err error)

SearchHosts returns all hosts that match certain search criteria.

func (*Client) SearchObjects

func (c *Client) SearchObjects(ctx context.Context, bucket string, opts api.SearchObjectOptions) (entries []api.ObjectMetadata, err error)

SearchObjects returns all objects that contains a sub-string in their key.

func (*Client) SendSiacoins

func (c *Client) SendSiacoins(ctx context.Context, scos []types.SiacoinOutput, useUnconfirmedTxns bool) (err error)

SendSiacoins is a helper method that sends siacoins to the given outputs.

func (*Client) SetBalance

func (c *Client) SetBalance(ctx context.Context, id rhpv3.Account, hostKey types.PublicKey, amount *big.Int) (err error)

SetBalance sets the given account's balance to a certain amount.

func (*Client) SetContractSet

func (c *Client) SetContractSet(ctx context.Context, set string, contracts []types.FileContractID) (err error)

SetContractSet adds the given contracts to the given set.

func (*Client) Setting

func (c *Client) Setting(ctx context.Context, key string, value interface{}) (err error)

Setting returns the value for the setting with given key.

func (*Client) Settings

func (c *Client) Settings(ctx context.Context) (settings []string, err error)

Settings returns the keys of all settings.

func (*Client) Slab

func (c *Client) Slab(ctx context.Context, key object.EncryptionKey) (slab object.Slab, err error)

Slab returns the slab with the given key from the bus.

func (*Client) SlabBuffers

func (c *Client) SlabBuffers() (buffers []api.SlabBuffer, err error)

SlabBuffers returns information about the number of objects and their size.

func (*Client) SlabsForMigration

func (c *Client) SlabsForMigration(ctx context.Context, healthCutoff float64, set string, limit int) (slabs []api.UnhealthySlab, err error)

SlabsForMigration returns up to 'limit' slabs which require migration. A slab needs to be migrated if it has sectors on contracts that are not part of the given 'set'.

func (*Client) State

func (c *Client) State() (state api.BusStateResponse, err error)

State returns the current state of the bus.

func (*Client) SyncerAddress

func (c *Client) SyncerAddress(ctx context.Context) (addr string, err error)

SyncerAddress returns the address the syncer is listening on.

func (*Client) SyncerConnect

func (c *Client) SyncerConnect(ctx context.Context, addr string) (err error)

SyncerConnect adds the address as a peer of the syncer.

func (*Client) SyncerPeers

func (c *Client) SyncerPeers(ctx context.Context) (resp []string, err error)

SyncerPeers returns the current peers of the syncer.

func (*Client) TrackUpload

func (c *Client) TrackUpload(ctx context.Context, uID api.UploadID) (err error)

TrackUpload tracks the upload with given id in the bus.

func (*Client) TransactionPool

func (c *Client) TransactionPool(ctx context.Context) (txns []types.Transaction, err error)

TransactionPool returns the transactions currently in the pool.

func (*Client) UnlockAccount

func (c *Client) UnlockAccount(ctx context.Context, id rhpv3.Account, lockID uint64) (err error)

UnlockAccount unlocks an account.

func (*Client) UpdateAutopilot

func (c *Client) UpdateAutopilot(ctx context.Context, autopilot api.Autopilot) (err error)

UpdateAutopilot updates the given autopilot in the store.

func (*Client) UpdateBucketPolicy

func (c *Client) UpdateBucketPolicy(ctx context.Context, bucketName string, policy api.BucketPolicy) error

UpdateBucketPolicy updates the policy of an existing bucket.

func (*Client) UpdateHostAllowlist

func (c *Client) UpdateHostAllowlist(ctx context.Context, add, remove []types.PublicKey, clear bool) (err error)

UpdateHostAllowlist updates the host allowlist, adding and removing the given entries.

func (*Client) UpdateHostBlocklist

func (c *Client) UpdateHostBlocklist(ctx context.Context, add, remove []string, clear bool) (err error)

UpdateHostBlocklist updates the host blocklist, adding and removing the given entries.

func (*Client) UpdateHostCheck added in v1.0.7

func (c *Client) UpdateHostCheck(ctx context.Context, autopilotID string, hostKey types.PublicKey, hostCheck api.HostCheck) (err error)

UpdateHostCheck updates the host with the most recent check performed by the autopilot with given id.

func (*Client) UpdateSetting

func (c *Client) UpdateSetting(ctx context.Context, key string, value interface{}) error

UpdateSetting will update the given setting under the given key.

func (*Client) UpdateSlab

func (c *Client) UpdateSlab(ctx context.Context, slab object.Slab, contractSet string) (err error)

UpdateSlab updates the given slab in the database.

func (*Client) UploadPackingSettings

func (c *Client) UploadPackingSettings(ctx context.Context) (ups api.UploadPackingSettings, err error)

UploadPackingSettings returns the upload packing settings.

func (*Client) UploadParams

func (c *Client) UploadParams(ctx context.Context) (up api.UploadParams, err error)

UploadParams returns parameters used for uploading slabs.

func (*Client) Wallet

func (c *Client) Wallet(ctx context.Context) (resp api.WalletResponse, err error)

Wallet calls the /wallet endpoint on the bus.

func (*Client) WalletDiscard

func (c *Client) WalletDiscard(ctx context.Context, txn types.Transaction) error

WalletDiscard discards the provided txn, make its inputs usable again. This should only be called on transactions that will never be broadcast.

func (*Client) WalletFund

func (c *Client) WalletFund(ctx context.Context, txn *types.Transaction, amount types.Currency, useUnconfirmedTransactions bool) ([]types.Hash256, []types.Transaction, error)

WalletFund funds txn using inputs controlled by the wallet.

func (*Client) WalletMetrics

func (c *Client) WalletMetrics(ctx context.Context, start time.Time, n uint64, interval time.Duration, opts api.WalletMetricsQueryOpts) ([]api.WalletMetric, error)

func (*Client) WalletOutputs

func (c *Client) WalletOutputs(ctx context.Context) (resp []wallet.SiacoinElement, err error)

WalletOutputs returns the set of unspent outputs controlled by the wallet.

func (*Client) WalletPending

func (c *Client) WalletPending(ctx context.Context) (resp []types.Transaction, err error)

WalletPending returns the txpool transactions that are relevant to the wallet.

func (*Client) WalletPrepareForm

func (c *Client) WalletPrepareForm(ctx context.Context, renterAddress types.Address, renterKey types.PublicKey, renterFunds, hostCollateral types.Currency, hostKey types.PublicKey, hostSettings rhpv2.HostSettings, endHeight uint64) (txns []types.Transaction, err error)

WalletPrepareForm funds and signs a contract transaction.

func (*Client) WalletPrepareRenew

func (c *Client) WalletPrepareRenew(ctx context.Context, revision types.FileContractRevision, hostAddress, renterAddress types.Address, renterKey types.PrivateKey, renterFunds, minNewCollateral types.Currency, pt rhpv3.HostPriceTable, endHeight, windowSize, expectedStorage uint64) (api.WalletPrepareRenewResponse, error)

WalletPrepareRenew funds and signs a contract renewal transaction.

func (*Client) WalletRedistribute

func (c *Client) WalletRedistribute(ctx context.Context, outputs int, amount types.Currency) (ids []types.TransactionID, err error)

WalletRedistribute broadcasts a transaction that redistributes the money in the wallet in the desired number of outputs of given amount. If the transaction was successfully broadcasted it will return the transaction ID.

func (*Client) WalletSign

func (c *Client) WalletSign(ctx context.Context, txn *types.Transaction, toSign []types.Hash256, cf types.CoveredFields) error

WalletSign signs txn using the wallet's private key.

func (*Client) WalletTransactions

func (c *Client) WalletTransactions(ctx context.Context, opts ...api.WalletTransactionsOption) (resp []wallet.Transaction, err error)

WalletTransactions returns all transactions relevant to the wallet.

func (*Client) Webhooks

func (c *Client) Webhooks(ctx context.Context) (resp api.WebHookResponse, err error)

Webhooks returns all webhooks currently registered.

Jump to

Keyboard shortcuts

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