Documentation ¶
Index ¶
- Variables
- func CreateDogeWallet(compress bool) error
- func GetBalanceDoge(addr string) (result resultBalance, err error)
- func GetDogeMainNetParams() chaincfg.Params
- func HexPrivateKeyToScript(addr string, params chaincfg.Params, privateKeyHex string) (pkScript []byte, privateKey *btcec.PrivateKey, compress bool, e error)
- func VinScriptSigToAddress(sig *btcjson.ScriptSig, params chaincfg.Params) (string, string, error)
- type BaseRequest
- func (b *BaseRequest) DecodeRawTransaction(raw string) (e error)
- func (b *BaseRequest) EstimateFee() (fee float64, e error)
- func (b *BaseRequest) GetBlock(hash string) (block BlockInfo, e error)
- func (b *BaseRequest) GetBlockChainInfo() (data BlockChainInfo, e error)
- func (b *BaseRequest) GetBlockHash(blockNumber uint64) (hash string, e error)
- func (b *BaseRequest) GetRawTransaction(hash string) (data btcjson.TxRawResult, e error)
- func (b *BaseRequest) Request(method RpcMethod, params []interface{}, result interface{}) error
- func (b *BaseRequest) SendRawTransaction(raw string) (hash string, e error)
- type BaseResponse
- type BlockChainInfo
- type BlockInfo
- type DustLimit
- type Error
- type RemoteSignMethod
- type ReqJsonRpc
- type RpcMethod
- type TxTool
- func (t *TxTool) GetUnspentOutputsDoge(addr, privateKey string, value int64) (int64, []UnspentOutputs, error)
- func (t *TxTool) LocalSignTx(tx *wire.MsgTx, uos []UnspentOutputs) (string, error)
- func (t *TxTool) NewTx(uos []UnspentOutputs, addresses []string, values []int64, opReturn string) (*wire.MsgTx, error)
- func (t *TxTool) RemoteSignTx(method RemoteSignMethod, tx *wire.MsgTx, uos []UnspentOutputs) (*wire.MsgTx, error)
- func (t *TxTool) SendTx(tx *wire.MsgTx) (hash string, err error)
- type UnspentOutputs
Constants ¶
This section is empty.
Variables ¶
var (
InsufficientBalanceError = errors.New("InsufficientBalanceError")
)
Functions ¶
func CreateDogeWallet ¶
func GetBalanceDoge ¶
func HexPrivateKeyToScript ¶
Types ¶
type BaseRequest ¶
BaseRequest
func (*BaseRequest) DecodeRawTransaction ¶
func (b *BaseRequest) DecodeRawTransaction(raw string) (e error)
'{"jsonrpc":"2.0","id":"0","method":"decoderawtransaction","params":[""]}' -H 'Content-Type: application/json'
func (*BaseRequest) EstimateFee ¶
func (b *BaseRequest) EstimateFee() (fee float64, e error)
'{"jsonrpc":"2.0","id":"0","method":"estimatefee","params":[10]}' -H 'Content-Type: application/json'
func (*BaseRequest) GetBlock ¶
func (b *BaseRequest) GetBlock(hash string) (block BlockInfo, e error)
func (*BaseRequest) GetBlockChainInfo ¶
func (b *BaseRequest) GetBlockChainInfo() (data BlockChainInfo, e error)
func (*BaseRequest) GetBlockHash ¶
func (b *BaseRequest) GetBlockHash(blockNumber uint64) (hash string, e error)
'{"jsonrpc":"2.0","id":"0","method":"getblockhash","params":[4600472]}' -H 'Content-Type: application/json'
func (*BaseRequest) GetRawTransaction ¶
func (b *BaseRequest) GetRawTransaction(hash string) (data btcjson.TxRawResult, e error)
'{"jsonrpc":"2.0","id":"0","method":"getrawtransaction","params":["c9b477a5afabbd6ff7afea9a2b0dce9687e1dc56a452b72e336b2961126fe411",true]}' -H 'Content-Type: application/json'
func (*BaseRequest) Request ¶
func (b *BaseRequest) Request(method RpcMethod, params []interface{}, result interface{}) error
func (*BaseRequest) SendRawTransaction ¶
func (b *BaseRequest) SendRawTransaction(raw string) (hash string, e error)
'{"jsonrpc":"2.0","id":"0","method":"sendrawtransaction","params":["",false]}' -H 'Content-Type: application/json'
type BaseResponse ¶
type BaseResponse struct { JsonRpc string `json:"jsonrpc"` Id string `json:"id"` Result interface{} `json:"result"` Error Error `json:"error"` }
BaseResponse
type BlockChainInfo ¶
type BlockChainInfo struct { BestBlockHash string `json:"bestblockhash"` Blocks uint64 `json:"blocks"` Chain string `json:"chain"` ChainWork string `json:"chainwork"` Headers uint64 `json:"headers"` MedianTime uint64 `json:"mediantime"` }
'{"jsonrpc":"2.0","id":"0","method":"getblockchaininfo"}' -H 'Content-Type: application/json'
type BlockInfo ¶
type BlockInfo struct { ChainWork string `json:"chainwork"` Confirmations uint64 `json:"confirmations"` Hash string `json:"hash"` Height uint64 `json:"height"` MedianTime uint64 `json:"mediantime"` NextBlockHash string `json:"nextblockhash"` PreviousBlockHash string `json:"previousblockhash"` Time uint64 `json:"time"` Tx []string `json:"tx"` }
'{"jsonrpc":"2.0","id":"0","method":"getblock","params":["5d0954672b3d7bc9becbfa017f7cb47714c39ef74ab99c969217ee2af0d40a82"]}' -H 'Content-Type: application/json'
type RemoteSignMethod ¶
type RemoteSignMethod = string
const (
RemoteSignMethodDogeTx RemoteSignMethod = "wallet_dogSignMsg"
)
type ReqJsonRpc ¶
type RpcMethod ¶
type RpcMethod string
const ( RpcMethodGetBlockChainInfo RpcMethod = "getblockchaininfo" RpcMethodGetBlockHash RpcMethod = "getblockhash" RpcMethodGetBlock RpcMethod = "getblock" RpcMethodGetRawTransaction RpcMethod = "getrawtransaction" RpcMethodSendRawTransaction RpcMethod = "sendrawtransaction" RpcMethodEstimateFee RpcMethod = "estimatefee" RpcMethodDecodeRawTransaction RpcMethod = "decoderawtransaction" )
type TxTool ¶
type TxTool struct { RpcClient *BaseRequest Ctx context.Context RemoteSignClient rpc.Client DustLimit DustLimit Params chaincfg.Params }
func (*TxTool) GetUnspentOutputsDoge ¶
func (*TxTool) LocalSignTx ¶
func (*TxTool) RemoteSignTx ¶
func (t *TxTool) RemoteSignTx(method RemoteSignMethod, tx *wire.MsgTx, uos []UnspentOutputs) (*wire.MsgTx, error)