Versions in this module Expand all Collapse all v0 v0.4.0 Apr 4, 2024 Changes in this version + type RpcClient interface + GetBill func(ctx context.Context, unitID types.UnitID, includeStateProof bool) (*api.Bill, error) + GetFeeCreditRecord func(ctx context.Context, unitID types.UnitID, includeStateProof bool) (*api.FeeCreditBill, error) + GetRoundNumber func(ctx context.Context) (uint64, error) + GetTransactionProof func(ctx context.Context, txHash types.Bytes) (*types.TransactionRecord, *types.TxProof, error) + GetUnitsByOwnerID func(ctx context.Context, ownerID types.Bytes) ([]types.UnitID, error) + SendTransaction func(ctx context.Context, tx *types.TransactionOrder) ([]byte, error) v0.3.0 Feb 28, 2024 Changes in this version + const FeeManagerDBFileName + const MinimumFeeAmount + var ErrInsufficientBalance = errors.New("insufficient balance for transaction") + var ErrInvalidPartition = errors.New("pending fee credit process for another partition") + var ErrMinimumFeeAmount = errors.New("insufficient fee amount") + type AddFeeCmd struct + AccountIndex uint64 + Amount uint64 + DisableLocking bool + type AddFeeCmdResponse struct + Proofs []*AddFeeTxProofs + type AddFeeCreditCtx struct + AddFCProof *wallet.Proof + AddFCTx *types.TransactionOrder + LockFCProof *wallet.Proof + LockFCTx *types.TransactionOrder + LockingDisabled bool + TargetAmount uint64 + TargetBillBacklink []byte + TargetBillID []byte + TargetPartitionID types.SystemID + TransferFCProof *wallet.Proof + TransferFCTx *types.TransactionOrder + type AddFeeTxProofs struct + AddFC *wallet.Proof + LockFC *wallet.Proof + TransferFC *wallet.Proof + func (p *AddFeeTxProofs) GetFees() uint64 + type BoltStore struct + func NewBoltStore(dbFile string) (*BoltStore, error) + func NewFeeManagerDB(dir string) (*BoltStore, error) + func (s *BoltStore) Close() error + func (s *BoltStore) DeleteAddFeeContext(accountID []byte) error + func (s *BoltStore) DeleteReclaimFeeContext(accountID []byte) error + func (s *BoltStore) GetAddFeeContext(accountID []byte) (*AddFeeCreditCtx, error) + func (s *BoltStore) GetReclaimFeeContext(accountID []byte) (*ReclaimFeeCreditCtx, error) + func (s *BoltStore) SetAddFeeContext(accountID []byte, feeCtx *AddFeeCreditCtx) error + func (s *BoltStore) SetReclaimFeeContext(accountID []byte, feeCtx *ReclaimFeeCreditCtx) error + type FeeManager struct + func NewFeeManager(am account.Manager, db FeeManagerDB, moneySystemID types.SystemID, ...) *FeeManager + func (w *FeeManager) AddFeeCredit(ctx context.Context, cmd AddFeeCmd) (*AddFeeCmdResponse, error) + func (w *FeeManager) Close() + func (w *FeeManager) GetFeeCredit(ctx context.Context, cmd GetFeeCreditCmd) (*wallet.Bill, error) + func (w *FeeManager) LockFeeCredit(ctx context.Context, cmd LockFeeCreditCmd) (*wallet.Proof, error) + func (w *FeeManager) ReclaimFeeCredit(ctx context.Context, cmd ReclaimFeeCmd) (*ReclaimFeeCmdResponse, error) + func (w *FeeManager) UnlockFeeCredit(ctx context.Context, cmd UnlockFeeCreditCmd) (*wallet.Proof, error) + type FeeManagerDB interface + Close func() error + DeleteAddFeeContext func(accountID []byte) error + DeleteReclaimFeeContext func(accountID []byte) error + GetAddFeeContext func(accountID []byte) (*AddFeeCreditCtx, error) + GetReclaimFeeContext func(accountID []byte) (*ReclaimFeeCreditCtx, error) + SetAddFeeContext func(accountID []byte, feeCtx *AddFeeCreditCtx) error + SetReclaimFeeContext func(accountID []byte, feeCtx *ReclaimFeeCreditCtx) error + type GenerateFcrIDFromPublicKey func(shardPart, pubKey []byte) types.UnitID + type GetFeeCreditCmd struct + AccountIndex uint64 + type LockFeeCreditCmd struct + AccountIndex uint64 + LockStatus uint64 + type MoneyClient interface + GetBills func(ctx context.Context, pubKey []byte) ([]*wallet.Bill, error) + type PartitionDataProvider interface + GetFeeCreditBill func(ctx context.Context, unitID types.UnitID) (*wallet.Bill, error) + GetRoundNumber func(ctx context.Context) (*wallet.RoundNumber, error) + GetTxProof func(ctx context.Context, unitID types.UnitID, txHash wallet.TxHash) (*wallet.Proof, error) + type ReclaimFeeCmd struct + AccountIndex uint64 + DisableLocking bool + type ReclaimFeeCmdResponse struct + Proofs *ReclaimFeeTxProofs + type ReclaimFeeCreditCtx struct + CloseFCProof *wallet.Proof + CloseFCTx *types.TransactionOrder + LockTx *types.TransactionOrder + LockTxProof *wallet.Proof + LockingDisabled bool + ReclaimFCProof *wallet.Proof + ReclaimFCTx *types.TransactionOrder + TargetBillBacklink []byte + TargetBillID []byte + TargetPartitionID types.SystemID + type ReclaimFeeTxProofs struct + CloseFC *wallet.Proof + Lock *wallet.Proof + ReclaimFC *wallet.Proof + func (p *ReclaimFeeTxProofs) GetFees() uint64 + type TxPublisher interface + Close func() + SendTx func(ctx context.Context, tx *types.TransactionOrder, senderPubKey []byte) (*wallet.Proof, error) + type UnlockFeeCreditCmd struct + AccountIndex uint64