submit

package
v0.0.0-...-9190965 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package submit contains a type and logic for submitting transactions that need to be fee bumped.

The Submitter type can be used to wrap any submission logic, and it will check if the transactions fee is below a threshold that indicates it needs to be fee bumped, and if so, it will wrap it in a fee bump transaction before submission.

This package is intended for use in example payment channel implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SubmitTxer

type SubmitTxer interface {
	SubmitTx(xdr string) error
}

SubmitTxer is an implementation of submitting transaction XDR to the network.

type Submitter

type Submitter struct {
	SubmitTxer        SubmitTxer
	NetworkPassphrase string
	BaseFee           int64
	FeeAccount        *keypair.FromAddress
	FeeAccountSigners []*keypair.Full
}

Submitter submits transactions to the network via Horizon. If a transaction has a base fee below the submitters base fee, the transaction is wrapped in a fee bump transaction. This means fee-less transactions are wrapped in fee bump transaction.

The BaseFee is the base fee that will be used for any submission where the transaction has a lower base fee.

func (*Submitter) SubmitTx

func (s *Submitter) SubmitTx(tx *txnbuild.Transaction) error

SubmitTx submits the transaction. If the transaction has a base fee that is lower than the submitters base fee it is wrapped in a fee bump transaction with the Submitter's FeeAccount as the fee account.

Jump to

Keyboard shortcuts

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