Documentation ¶
Index ¶
- func GetMinerFee() float64
- func GetOmniDustBtc() float64
- type Client
- func (client *Client) AddMultiSigAddress(minSignNum int, keys []string) (result string, err error)
- func (client *Client) BtcCreateAndSignAndSendRawTransaction(fromBitCoinAddress string, privkeys []string, ...) (txId string, err error)
- func (client *Client) BtcCreateAndSignRawTransaction(fromBitCoinAddress string, privkeys []string, ...) (txid string, hex string, err error)
- func (client *Client) BtcCreateAndSignRawTransactionForUnsendInputTx(fromBitCoinAddress string, privkeys []string, ...) (txid string, hex string, err error)
- func (client *Client) BtcSignAndSendRawTransaction(hex string, privKey string) (string, string, error)
- func (client *Client) BtcSignRawTransaction(hex string, privKey string) (string, string, error)
- func (client *Client) BtcSignRawTransactionForUnsend(hex string, inputItems []TransactionInputItem, privKey string) (string, string, error)
- func (client *Client) CheckVersion() error
- func (client *Client) CreateMultiSig(minSignNum int, keys []string) (result string, err error)
- func (client *Client) CreateRawTransaction(inputs []map[string]interface{}, outputs map[string]interface{}) (result string, err error)
- func (client *Client) DecodeRawTransaction(hex string) (result string, err error)
- func (client *Client) DecodeScript(hexString string) (result string, err error)
- func (client *Client) DumpPrivKey(address string) (result string, err error)
- func (client *Client) GetAddressInfo(address string) (json string, err error)
- func (client *Client) GetBalanceByAddress(address string) (balance decimal.Decimal, err error)
- func (client *Client) GetBlockCount() (result int, err error)
- func (client *Client) GetDifficulty() (result string, err error)
- func (client *Client) GetMiningInfo() (result string, err error)
- func (client *Client) GetNetworkInfo() (result string, err error)
- func (client *Client) GetNewAddress(label string) (address string, err error)
- func (client *Client) GetTransactionById(txid string) (result string, err error)
- func (client *Client) GetTxOut(txid string, num int) (result string, err error)
- func (client *Client) ImportPrivKey(privkey string) (result string, err error)
- func (client *Client) ListUnspent(address string) (result string, err error)
- func (client *Client) NextID() uint64
- func (client *Client) OmniCreateAndSignRawTransaction(fromBitCoinAddress string, privkeys []string, toBitCoinAddress string, ...) (txid, hex string, err error)
- func (client *Client) OmniCreateAndSignRawTransactionUseRestInput(txType int, fromBitCoinAddress string, usedTxid string, privkeys []string, ...) (txid, hex string, err error)
- func (client *Client) OmniCreateAndSignRawTransactionUseSingleInput(txType int, fromBitCoinAddress string, privkeys []string, ...) (txid, hex string, currUseTxid string, err error)
- func (client *Client) OmniCreateAndSignRawTransactionUseUnsendInput(fromBitCoinAddress string, privkeys []string, ...) (txid string, hex string, err error)
- func (client *Client) OmniDecodeTransaction(hex string) (result string, err error)
- func (client *Client) OmniDecodeTransactionWithPrevTxs(hex string, prevtxs []TransactionInputItem) (result string, err error)
- func (client *Client) OmniGetAllBalancesForAddress(address string) (result string, err error)
- func (client *Client) OmniGetProperty(propertyId int64) (result string, err error)
- func (client *Client) OmniGetbalance(address string, propertyId int) (result string, err error)
- func (client *Client) OmniGetinfo() (result string, err error)
- func (client *Client) OmniGettransaction(txid string) (result string, err error)
- func (client *Client) OmniListProperties() (result string, err error)
- func (client *Client) OmniListTransactions(count int, skip int) (result string, err error)
- func (client *Client) OmniRawTransaction(fromBitCoinAddress string, privkeys []string, toBitCoinAddress string, ...) (txid string, err error)
- func (client *Client) OmniSend(fromAddress string, toAddress string, propertyId int, amount float64) (result string, err error)
- func (client *Client) OmniSendGrant(fromAddress string, propertyId int64, amount float64, memo string) (result string, err error)
- func (client *Client) OmniSendIssuanceFixed(fromAddress string, ecosystem int, divisibleType int, name string, data string, ...) (result string, err error)
- func (client *Client) OmniSendIssuanceManaged(fromAddress string, ecosystem int, divisibleType int, name string, data string) (result string, err error)
- func (client *Client) OmniSendRevoke(fromAddress string, propertyId int64, amount float64, memo string) (result string, err error)
- func (client *Client) OmniSignRawTransactionForUnsend(hex string, inputItems []TransactionInputItem, privKey string) (string, string, error)
- func (client *Client) SendRawTransaction(hex string) (result string, err error)
- func (client *Client) SignMessageWithPrivKey(privkey string, message string) (result string, err error)
- func (client *Client) SignRawTransactionWithKey(hex string, privkeys []string, prevtxs []map[string]interface{}, ...) (result string, err error)
- func (client *Client) TestMemPoolAccept(signedhex string) (result string, err error)
- func (client *Client) ValidateAddress(address string) (isValid bool, err error)
- func (client *Client) VerifyMessage(address string, signature string, message string) (result string, err error)
- type ConnConfig
- type RPCError
- type Request
- type TransactionInputItem
- type TransactionOutputItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMinerFee ¶
func GetMinerFee() float64
ins*150 + outs*34 + 10 + 80 = transaction size https://shimo.im/docs/5w9Fi1c9vm8yp1ly
func GetOmniDustBtc ¶
func GetOmniDustBtc() float64
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddMultiSigAddress ¶
func (*Client) BtcCreateAndSignAndSendRawTransaction ¶
func (client *Client) BtcCreateAndSignAndSendRawTransaction(fromBitCoinAddress string, privkeys []string, outputItems []TransactionOutputItem, minerFee float64, sequence int) (txId string, err error)
create a transaction and signature and send to the network
func (*Client) BtcCreateAndSignRawTransaction ¶
func (client *Client) BtcCreateAndSignRawTransaction(fromBitCoinAddress string, privkeys []string, outputItems []TransactionOutputItem, minerFee float64, sequence int, redeemScript *string) (txid string, hex string, err error)
create a transaction and just signnature , not send to the network,get the hash of signature
func (*Client) BtcCreateAndSignRawTransactionForUnsendInputTx ¶
func (client *Client) BtcCreateAndSignRawTransactionForUnsendInputTx(fromBitCoinAddress string, privkeys []string, inputItems []TransactionInputItem, outputItems []TransactionOutputItem, minerFee float64, sequence int, redeemScript *string) (txid string, hex string, err error)
创建btc的raw交易:输入为未广播的预交易,输出为交易hex,支持单签和多签,如果是单签,就需要后续步骤再签名
func (*Client) BtcSignAndSendRawTransaction ¶
func (*Client) BtcSignRawTransaction ¶
func (*Client) BtcSignRawTransactionForUnsend ¶
func (*Client) CheckVersion ¶
func (*Client) CreateRawTransaction ¶
func (*Client) DecodeRawTransaction ¶
func (*Client) DecodeScript ¶
func (*Client) DumpPrivKey ¶
func (*Client) GetAddressInfo ¶
func (*Client) GetBalanceByAddress ¶
func (*Client) GetBlockCount ¶
func (*Client) GetDifficulty ¶
func (*Client) GetMiningInfo ¶
func (*Client) GetNetworkInfo ¶
func (*Client) GetNewAddress ¶
func (*Client) GetTransactionById ¶
func (*Client) ImportPrivKey ¶
func (*Client) ListUnspent ¶
func (*Client) OmniCreateAndSignRawTransaction ¶
func (*Client) OmniCreateAndSignRawTransactionUseRestInput ¶
func (client *Client) OmniCreateAndSignRawTransactionUseRestInput(txType int, fromBitCoinAddress string, usedTxid string, privkeys []string, toBitCoinAddress, changeToAddress string, propertyId int64, amount float64, minerFee float64, sequence int, redeemScript *string) (txid, hex string, err error)
func (*Client) OmniCreateAndSignRawTransactionUseSingleInput ¶
func (client *Client) OmniCreateAndSignRawTransactionUseSingleInput(txType int, fromBitCoinAddress string, privkeys []string, toBitCoinAddress string, propertyId int64, amount float64, minerFee float64, sequence int, redeemScript *string, usedTxid string) (txid, hex string, currUseTxid string, err error)
From channelAddress to temp multi address, to Create CommitmentTx
func (*Client) OmniCreateAndSignRawTransactionUseUnsendInput ¶
func (client *Client) OmniCreateAndSignRawTransactionUseUnsendInput(fromBitCoinAddress string, privkeys []string, inputItems []TransactionInputItem, toBitCoinAddress, changeToAddress string, propertyId int64, amount float64, minerFee float64, sequence int, redeemScript *string) (txid string, hex string, err error)
func (*Client) OmniDecodeTransaction ¶
func (*Client) OmniDecodeTransactionWithPrevTxs ¶
func (client *Client) OmniDecodeTransactionWithPrevTxs(hex string, prevtxs []TransactionInputItem) (result string, err error)
func (*Client) OmniGetAllBalancesForAddress ¶
func (*Client) OmniGetProperty ¶
Get detailed information about an Omni transaction.
func (*Client) OmniGetbalance ¶
func (*Client) OmniGetinfo ¶
https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md Returns various state information of the client and protocol.
func (*Client) OmniGettransaction ¶
Get detailed information about an Omni transaction.
func (*Client) OmniListProperties ¶
Get detailed information about an Omni transaction.
func (*Client) OmniListTransactions ¶
List wallet transactions, optionally filtered by an address and block boundaries.
func (*Client) OmniRawTransaction ¶
func (*Client) OmniSend ¶
func (client *Client) OmniSend(fromAddress string, toAddress string, propertyId int, amount float64) (result string, err error)
Create and broadcast a simple send transaction.
func (*Client) OmniSendGrant ¶
func (client *Client) OmniSendGrant(fromAddress string, propertyId int64, amount float64, memo string) (result string, err error)
Issue or grant new units of managed tokens. https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md#omni_sendgrant
func (*Client) OmniSendIssuanceFixed ¶
func (client *Client) OmniSendIssuanceFixed(fromAddress string, ecosystem int, divisibleType int, name string, data string, amount float64) (result string, err error)
Create new tokens with manageable supply. https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md#omni_sendissuancemanaged
func (*Client) OmniSendIssuanceManaged ¶
func (client *Client) OmniSendIssuanceManaged(fromAddress string, ecosystem int, divisibleType int, name string, data string) (result string, err error)
Create new tokens with manageable supply. https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md#omni_sendissuancemanaged
func (*Client) OmniSendRevoke ¶
func (client *Client) OmniSendRevoke(fromAddress string, propertyId int64, amount float64, memo string) (result string, err error)
Revoke units of managed tokens. https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md#omni_sendrevoke
func (*Client) OmniSignRawTransactionForUnsend ¶
func (*Client) SendRawTransaction ¶
func (*Client) SignMessageWithPrivKey ¶
func (*Client) SignRawTransactionWithKey ¶
func (*Client) ValidateAddress ¶
type ConnConfig ¶
type Request ¶
type Request struct { Jsonrpc string `json:"jsonrpc"` ID interface{} `json:"id"` Method string `json:"method"` Params []json.RawMessage `json:"params"` }