omni

package
v1.10.0-beta.20201225 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MinNondustOutput Any standard (ie P2PKH) output smaller than this value (in satoshis) will most likely be rejected by the network.
	// This is calculated by assuming a standard output will be 34 bytes
	MinNondustOutput = 546 // satoshis

	OptionShareAccountWithParentChain = "shareAccountWithParentChain"
)

Variables

This section is empty.

Functions

func CreateSimpleSendTransaction

func CreateSimpleSendTransaction(
	propertyID int,
	propertyDivisible bool,
	btcUnspentList *btc.BTCUnspent,
	sendToAddress *btc.BTCAddress,
	omniAmount float64,
	changeAddress *btc.BTCAddress,
	btcFeeRate int64,
	chainID int,
) (btctx *btc.BTCTransaction, err error)

CreateSimpleSendTransaction 创建基于btc的omni交易,该方法构建比特币交易输出,包括: 1. omni layer Class c opreturn data (`propertyID`,`omniAmount` here) 2. dust (amount 546 satoshis) output to `sendToAddress` 3. change output to `changeAddress`

`propertyID`, `propertyDivisible` 资产id,token是否可分 `btcUnspentList` bitcoin utxo list, `sendToAddress` omni token收款方

ref: (usdt: https://omniexplorer.info/asset/31) **Note**:不要把找零地址和转账地址传错了,找零地址通常是发送方地址

func CreaterawtxReference

func CreaterawtxReference(rawtx, destination string, amount *float64) (string, error)

CreaterawtxReference amount:btc, Impl: https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md#omni_createrawtx_reference

func GetClassCOpreturnDataScript

func GetClassCOpreturnDataScript(propertyID uint, amount float64, divisible bool) ([]byte, error)

GetClassCOpreturnDataScript Create a payload with class C (op-return) encoding to pkScript. Used to create tx out.

func New

func New(seed []byte, testNet bool) (c *omni, err error)

func NewWithOptions

func NewWithOptions(path string, seed []byte, testNet bool, options map[string]interface{}) (c *omni, err error)

func UtilCreatePayloadSimpleSend

func UtilCreatePayloadSimpleSend(propertyID uint, amount float64, divisible bool) (string, error)

UtilCreatePayloadSimpleSend 对于可分的币会 *1e8 (btcutil.SatoshiPerBitcoin)

Types

type PreviousDependentTxOutputAmount

type PreviousDependentTxOutputAmount struct {
	TxID   string
	Vout   uint32
	Amount float64
}

PreviousDependentTxOutputAmount .

Jump to

Keyboard shortcuts

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