client

package
v0.6.2-testnet Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 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 base.TransactionID, maxDepth ...int) (lrbID base.TransactionID, foundAtDepth int, err 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 *base.OutputID, o *ledger.Output) bool) ([]*ledger.OutputWithID, *base.TransactionID, error)

GetAccountOutputs returns all UTXOs in the account

func (*APIClient) GetAccountOutputsExt

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

func (*APIClient) GetAccountParsedOutputs

func (c *APIClient) GetAccountParsedOutputs(account ledger.Accountable, maxOutputs int, sortOption ...string) (*api.ParsedOutputList, error)

func (*APIClient) GetAllChains

func (c *APIClient) GetAllChains() ([]*ledger.OutputWithChainID, *base.TransactionID, error)

func (*APIClient) GetAllSequencerOutputs

func (c *APIClient) GetAllSequencerOutputs() (map[base.ChainID]ledger.OutputWithSequencerData, *base.TransactionID, error)

func (*APIClient) GetChainOutput

func (c *APIClient) GetChainOutput(chainID base.ChainID) (*ledger.OutputWithChainID, byte, base.TransactionID, 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 base.ChainID) (*ledger.OutputDataWithID, base.TransactionID, error)

func (*APIClient) GetChainedOutputs

func (c *APIClient) GetChainedOutputs(accountable ledger.Accountable) ([]*ledger.OutputWithChainID, *base.TransactionID, error)

GetChainedOutputs fetches all outputs of the account. Optionally sorts them on the server

func (*APIClient) GetDelegationOutputs

func (c *APIClient) GetDelegationOutputs(accountable ledger.Accountable) ([]ledger.DelegationOutput, *base.TransactionID, error)

GetDelegationOutputs fetches all delegation outputs of the account. Optionally sorts them on the server

func (*APIClient) GetLastKnownSequencerData

func (c *APIClient) GetLastKnownSequencerData() (map[string]tippool.LatestSequencerTipDataJSONAble, error)

func (*APIClient) GetLatestReliableBranch

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

GetLatestReliableBranch retrieves latest reliable branch info from the node

func (*APIClient) GetLedgerIdentityData

func (c *APIClient) GetLedgerIdentityData() ([]byte, error)

GetLedgerIdentityData retrieves raw ledger identity YAML from server

func (*APIClient) GetNodeInfo

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

func (*APIClient) GetNonChainBalance

func (c *APIClient) GetNonChainBalance(addr ledger.Accountable) (uint64, *base.TransactionID, error)

GetNonChainBalance total of outputs locked in the account but without chain constraint

func (*APIClient) GetOutputData

func (c *APIClient) GetOutputData(oid *base.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) GetOutputsForAmount

func (c *APIClient) GetOutputsForAmount(addr ledger.AddressED25519, amount uint64) ([]*ledger.OutputWithID, *base.TransactionID, uint64, error)

GetOutputsForAmount returns all UTXOs locked in the specified ED25519 address, which ar not chain outputs

func (*APIClient) GetPeersInfo

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

func (*APIClient) GetSequencerData

func (c *APIClient) GetSequencerData(chainID base.ChainID) (ret seqdata.SequencerData, err error)

func (*APIClient) GetSimpleSigLockedOutputs

func (c *APIClient) GetSimpleSigLockedOutputs(addr ledger.AddressED25519, maxOutputs int, sort ...string) ([]*ledger.OutputWithID, *base.TransactionID, error)

func (*APIClient) GetSnapshotBranchID

func (c *APIClient) GetSnapshotBranchID() (ret base.TransactionID, err 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, *base.TransactionID, uint64, error)

GetTransferableOutputs returns a reasonable maximum number of outputs owned by accountable with only 2 constraints and returns total

func (*APIClient) MakeChainOrigin

func (*APIClient) MakeCompactTransaction

func (c *APIClient) MakeCompactTransaction(walletPrivateKey ed25519.PrivateKey, tagAlongSeqID *base.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) MakeSendOutputTransaction

func (c *APIClient) MakeSendOutputTransaction(o *ledger.Output, privateKey ed25519.PrivateKey, ts base.LedgerTime) ([]byte, base.TransactionID, string, error)

func (*APIClient) SubmitTransaction

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

func (*APIClient) TransferFromED25519Wallet

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

type MakeTransferTransactionParams

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

type SequencerData

type SequencerData struct {
	ledger.OutputWithChainID
	NumDelegations int
}

type TransferFromED25519WalletParams

type TransferFromED25519WalletParams struct {
	WalletPrivateKey ed25519.PrivateKey
	TagAlongSeqID    *base.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