Documentation ¶
Overview ¶
* Copyright (C) 2020 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2020 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2020 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.
Index ¶
- func BuildData(toChainId uint64, ccFee int64, toAddr string) ([]byte, error)
- func GetAccountByPassword(sdk *poly_go_sdk.PolySdk, path string, pwd []byte) (*poly_go_sdk.Account, error)
- func HexStringReverse(value string) string
- func LenOfSyncMap(sm *sync.Map) int64
- func RandomInt64(min, max int64) int64
- func ReverseHexString(b string) string
- func SetUpPoly(poly *poly_go_sdk.PolySdk, rpcAddr string) error
- type BtcInvoker
- func (invoker *BtcInvoker) BindBtcTxParam(feeRate, minChange uint64, vendor *Vendor) (common.Uint256, error)
- func (invoker *BtcInvoker) BindBtcxWithVendor(btcx string, btcxChainId uint64, vendor *Vendor) (common.Uint256, error)
- func (invoker *BtcInvoker) GenerateVendor(n, require int) (*Vendor, error)
- func (invoker *BtcInvoker) GetAccInfo() (string, error)
- type BtcItem
- type BtcSigner
- type BuildCrossChainTxParam
- type Builder
- type FromBtcItem
- type Request
- type Response
- type RestCli
- func (cli *RestCli) BroadcastTx(tx string) (string, error)
- func (cli *RestCli) GenerateToAddr(n int, addr string) ([]string, error)
- func (cli *RestCli) GetBlockCount() (int64, error)
- func (cli *RestCli) GetBlockHeight(hash string) (int32, error)
- func (cli *RestCli) GetCurrentHeightAndHash() (int32, string, error)
- func (cli *RestCli) GetHeader(h int32) (*wire.BlockHeader, error)
- func (cli *RestCli) GetMempoolInfo() (int32, error)
- func (cli *RestCli) GetProof(txids []string) (string, error)
- func (cli *RestCli) GetRawTransaction(txid string) (string, error)
- func (cli *RestCli) GetTxOutVal(txid string, idx uint32) (int64, error)
- func (cli *RestCli) GetTxsInBlock(hash string) ([]*wire.MsgTx, string, error)
- func (cli *RestCli) ImportAddress(addr string) error
- func (cli *RestCli) ListUnspent(minConfs, maxConfs int64, addr string) ([]*Utxo, error)
- func (cli *RestCli) SendRawTx(rawTx string) (string, error)
- type ToBtcItem
- type Utxo
- type UtxoItem
- type UtxoList
- type Vendor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAccountByPassword ¶
func HexStringReverse ¶
func LenOfSyncMap ¶
func RandomInt64 ¶
func ReverseHexString ¶
Types ¶
type BtcInvoker ¶
type BtcInvoker struct { RChain *poly_go_sdk.PolySdk RChainAcc *poly_go_sdk.Account FromChainId int32 BtcCli *RestCli Signer *BtcSigner }
func NewBtcInvoker ¶
func NewBtcInvoker(rpc, wallet, pwd, btcRpc, btcUser, btcPwd, privk string) (*BtcInvoker, error)
func (*BtcInvoker) BindBtcTxParam ¶
func (*BtcInvoker) BindBtcxWithVendor ¶
func (*BtcInvoker) GenerateVendor ¶
func (invoker *BtcInvoker) GenerateVendor(n, require int) (*Vendor, error)
* Generate 3/5, 4/7 Vendors
func (*BtcInvoker) GetAccInfo ¶
func (invoker *BtcInvoker) GetAccInfo() (string, error)
type BtcSigner ¶
func NewBtcSigner ¶
type BuildCrossChainTxParam ¶
type Builder ¶
type Builder struct { NetParam *chaincfg.Params PrevPkScript []byte PrivKey *btcec.PrivateKey PubKey *btcec.PublicKey Tx *wire.MsgTx IsSigned bool RedeemScript []byte Privks map[string]*btcec.PrivateKey }
func NewBuilder ¶
func NewBuilder(param *BuildCrossChainTxParam) (b *Builder, err error)
type FromBtcItem ¶
func (*FromBtcItem) String ¶
func (item *FromBtcItem) String() string
type RestCli ¶
Get tx in block; Get proof;
func NewRestCli ¶
func (*RestCli) GenerateToAddr ¶
func (*RestCli) GetBlockCount ¶
func (*RestCli) GetCurrentHeightAndHash ¶
func (*RestCli) GetMempoolInfo ¶
func (*RestCli) GetRawTransaction ¶
func (*RestCli) GetTxOutVal ¶
func (*RestCli) GetTxsInBlock ¶
func (*RestCli) ImportAddress ¶
func (*RestCli) ListUnspent ¶
type Vendor ¶
type Vendor struct { PrivateKeys []*btcutil.WIF AddressSet []*btcutil.AddressPubKey Redeem []byte HashKey []byte P2shAddr *btcutil.AddressScriptHash P2wshAddr *btcutil.AddressWitnessScriptHash }