Documentation ¶
Index ¶
- Constants
- func CreateSimpleSendTransaction(propertyID int, propertyDivisible bool, btcUnspentList *btc.BTCUnspent, ...) (btctx *btc.BTCTransaction, err error)
- func CreaterawtxChange(rawtx string, prevtxs []PreviousDependentTxOutputAmount, destination string, ...) (string, error)
- func CreaterawtxOpreturn(rawtx, payload string) (string, error)
- func CreaterawtxReference(rawtx, destination string, amount *float64) (string, error)
- func GetClassCOpreturnDataScript(propertyID uint, amount float64, divisible bool) ([]byte, error)
- func New(seed []byte, testNet bool) (c *omni, err error)
- func NewWithOptions(path string, seed []byte, testNet bool, options map[string]interface{}) (c *omni, err error)
- func UtilCreatePayloadSimpleSend(propertyID uint, amount float64, divisible bool) (string, error)
- type PreviousDependentTxOutputAmount
Constants ¶
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 )
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 CreaterawtxChange ¶
func CreaterawtxChange(rawtx string, prevtxs []PreviousDependentTxOutputAmount, destination string, fee float64) (string, error)
CreaterawtxChange Impl: https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md#omni_createrawtx_change
func CreaterawtxOpreturn ¶
CreaterawtxOpreturn Impl: https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md#omni_createrawtx_opreturn
func CreaterawtxReference ¶
CreaterawtxReference amount:btc, Impl: https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md#omni_createrawtx_reference
func GetClassCOpreturnDataScript ¶
GetClassCOpreturnDataScript Create a payload with class C (op-return) encoding to pkScript. Used to create tx out.
func NewWithOptions ¶
Types ¶
type PreviousDependentTxOutputAmount ¶
PreviousDependentTxOutputAmount .