client

package
v0.1.3-testnet Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeTransferTransaction

func MakeTransferTransaction(par MakeTransferTransactionParams) ([]byte, error)

Types

type APIClient

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

func NewWithGoogleDNS

func NewWithGoogleDNS(serverURL string, timeout ...time.Duration) *APIClient

NewWithGoogleDNS following ChatGPT suggestion to use GoogleDNS to speed up DNS name resolution Otherwise it takes too long in Proxi

func (*APIClient) CheckTransactionIDInLRB

func (c *APIClient) CheckTransactionIDInLRB(txid ledger.TransactionID) (lrbID ledger.TransactionID, included bool, err error)

func (*APIClient) DeleteChainOrigin

func (c *APIClient) DeleteChainOrigin(par DeleteChainOriginParams) (*transaction.TxContext, error)

func (*APIClient) Get

func (c *APIClient) Get(path string) ([]byte, error)

func (*APIClient) GetAccountOutputs

func (c *APIClient) GetAccountOutputs(account ledger.Accountable, filter ...func(oid *ledger.OutputID, o *ledger.Output) bool) ([]*ledger.OutputWithID, *ledger.TransactionID, error)

func (*APIClient) GetAccountOutputsExt

func (c *APIClient) GetAccountOutputsExt(account ledger.Accountable, maxOutputs int, sortOption string, filter ...func(oid *ledger.OutputID, o *ledger.Output) bool) ([]*ledger.OutputWithID, *ledger.TransactionID, error)

func (*APIClient) GetChainOutput

func (c *APIClient) GetChainOutput(chainID ledger.ChainID) (*ledger.OutputWithChainID, byte, error)

GetChainOutput returns parsed output for the chain ID and index of the chain constraint in it

func (*APIClient) GetChainOutputData

func (c *APIClient) GetChainOutputData(chainID ledger.ChainID) (*ledger.OutputDataWithID, error)

func (*APIClient) GetLatestReliableBranch

func (c *APIClient) GetLatestReliableBranch() (*multistate.RootRecord, *ledger.TransactionID, error)

GetLatestReliableBranch retrieves lates reliable branch info from the node

func (*APIClient) GetLedgerID

func (c *APIClient) GetLedgerID() (*ledger.IdentityData, error)

GetLedgerID retrieves ledger ID from server

func (*APIClient) GetMilestoneData

func (c *APIClient) GetMilestoneData(chainID ledger.ChainID) (*ledger.MilestoneData, error)

func (*APIClient) GetNodeInfo

func (c *APIClient) GetNodeInfo() (*global.NodeInfo, error)

func (*APIClient) GetOutputData

func (c *APIClient) GetOutputData(oid *ledger.OutputID) ([]byte, error)

GetOutputData returns output data from the LRB state, if it exists there Returns nil, nil if output does not exist

func (*APIClient) GetPeersInfo

func (c *APIClient) GetPeersInfo() (*api.PeersInfo, error)

func (*APIClient) GetSyncInfo

func (c *APIClient) GetSyncInfo() (*api.SyncInfo, error)

func (*APIClient) GetTransferableOutputs

func (c *APIClient) GetTransferableOutputs(account ledger.Accountable, maxOutputs ...int) ([]*ledger.OutputWithID, *ledger.TransactionID, uint64, error)

GetTransferableOutputs returns reasonable maximum number of outputs with only 2 constraints and returns total

func (*APIClient) MakeChainOrigin

func (*APIClient) MakeCompactTransaction

func (c *APIClient) MakeCompactTransaction(walletPrivateKey ed25519.PrivateKey, tagAlongSeqID *ledger.ChainID, tagAlongFee uint64, maxInputs ...int) (*transaction.TxContext, error)

MakeCompactTransaction requests server and creates a compact transaction for ED25519 outputs in the form of transaction context. Does not submit it

func (*APIClient) QueryTxIDStatus

func (c *APIClient) QueryTxIDStatus(txid ledger.TransactionID, slotSpan int) (*vertex.TxIDStatus, *multistate.TxInclusion, error)

func (*APIClient) QueryTxInclusionScore

func (c *APIClient) QueryTxInclusionScore(txid ledger.TransactionID, thresholdNumerator, thresholdDenominator, slotSpan int) (*api.TxInclusionScore, error)

func (*APIClient) SubmitTransaction

func (c *APIClient) SubmitTransaction(txBytes []byte) error

func (*APIClient) TransferFromED25519Wallet

func (c *APIClient) TransferFromED25519Wallet(par TransferFromED25519WalletParams) (*transaction.TxContext, error)

type DeleteChainOriginParams

type DeleteChainOriginParams struct {
	WalletPrivateKey ed25519.PrivateKey
	TagAlongSeqID    *ledger.ChainID
	TagAlongFee      uint64 // 0 means no fee output will be produced
	ChainID          *ledger.ChainID
	TraceTx          bool
}

type MakeTransferTransactionParams

type MakeTransferTransactionParams struct {
	Inputs        []*ledger.OutputWithID
	Target        ledger.Lock
	Amount        uint64
	Remainder     ledger.Lock
	PrivateKey    ed25519.PrivateKey
	TagAlongSeqID *ledger.ChainID
	TagAlongFee   uint64
	Timestamp     ledger.Time
}

type TransferFromED25519WalletParams

type TransferFromED25519WalletParams struct {
	WalletPrivateKey ed25519.PrivateKey
	TagAlongSeqID    *ledger.ChainID
	TagAlongFee      uint64 // 0 means no fee output will be produced
	Amount           uint64
	Target           ledger.Lock
	MaxOutputs       int
}

Jump to

Keyboard shortcuts

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