ubiquitytx

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignPolkadotTransaction added in v1.3.0

func SignPolkadotTransaction(seedPhrase, rawTx, rawSigningPayload string, network PolkadotNetwork) (string, error)

Types

type BitcoinTransaction

type BitcoinTransaction struct {
	Network string
	From    []TxInput
	To      []TxOutput
	// Fee        int64
	// ChangeAddr string
	PrivateKey string
}

BitcoinTransaction *Important* make sure to properly calculate the difference between INs and OUTs since it will be automatically payed as a Fee. In the future we may include UTXO and Fee calculation into the service.

type EthereumTransaction

type EthereumTransaction struct {
	Network    string
	PrivateKey string
	To         string
	Amount     *big.Int // In wei
	GasLimit   uint64   // Optional, 21000 by default
	GasPrice   *big.Int // Optional, in wei, estimated using "eth_gasPrice" if not set
	Nonce      uint64   // Current transaction count
}

type PolkadotNetwork added in v1.3.0

type PolkadotNetwork uint8
const (
	PolkadotMainnet PolkadotNetwork = 0
	PolkadotWestend PolkadotNetwork = 42
)

type PolkadotTransaction added in v1.3.0

type PolkadotTransaction struct {
	Network    string
	To         string
	Amount     *big.Int
	Tip        uint64
	SeedPhrase string
}

type SendTxResult added in v1.3.0

type SendTxResult struct {
	TxHash string
	TxID   string
}

type TxInput

type TxInput struct {
	Source string // UTXO, input transaction id
	Index  uint32 // UTXO, input index
}

type TxOutput

type TxOutput struct {
	Destination string // Destination address
	Amount      int64  // In sat.
}

type UbiquityTransactionService

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

UbiquityTransactionService provides API to send various protocol transactions. So far it supports BTC and ETH.

func (UbiquityTransactionService) SendBTC

SendBTC creates, signs and sends BTC transaction. Under the hood it uses Ubiquity TxSend API.

func (UbiquityTransactionService) SendDOT added in v1.3.0

SendDOT creates, signs and sends DOT transaction. Under the hood it uses Ubiquity TxCreate and TxSend API.

func (UbiquityTransactionService) SendETH

SendETH creates, signs and sends ETH transaction. Under the hood it uses Ubiquity TxSend API.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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