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/>.
Index ¶
- func CalcCosmosFees(gasPrice types.DecCoins, gas uint64) (types.Coins, error)
- func NewCodec() *codec.Codec
- type CosmosAcc
- type CosmosInvoker
- func (invoker *CosmosInvoker) BindAsset(sourceAsset string, toChainId uint64, toAssetHash []byte) (*coretypes.ResultBroadcastTx, error)
- func (invoker *CosmosInvoker) BindProxy(toChainId uint64, proxy []byte) (*coretypes.ResultBroadcastTx, error)
- func (invoker *CosmosInvoker) BtcxBindAsset(sourceAsset string, toChainId uint64, toAssetHash []byte) (*coretypes.ResultBroadcastTx, error)
- func (invoker *CosmosInvoker) CreateAsset(denom, amt string, lockProxy []byte) (*coretypes.ResultBroadcastTx, error)
- func (invoker *CosmosInvoker) CreateLockProxy() (*coretypes.ResultBroadcastTx, error)
- func (invoker *CosmosInvoker) CreateValidator(keyFile, stateFile, coin string, amt int64) (*coretypes.ResultBroadcastTx, error)
- func (invoker *CosmosInvoker) DelegateValidator(coin string, amt int64) (*coretypes.ResultBroadcastTx, error)
- func (invoker *CosmosInvoker) GetAccInfo() (string, error)
- func (invoker *CosmosInvoker) SendAsset(asset string, toChainId uint64, value int64, toAddr, lockProxy []byte) (*coretypes.ResultBroadcastTx, error)
- func (invoker *CosmosInvoker) SetupAllAssets(proxy []byte) error
- func (invoker *CosmosInvoker) SetupBtcx(denom, redeem string) error
- func (invoker *CosmosInvoker) SyncPolyGenesisHdr(syner types.AccAddress, rawHdr []byte) (*coretypes.ResultBroadcastTx, error)
- func (invoker *CosmosInvoker) TransferCoins(toAddr, denom string, amt int64) (*coretypes.ResultBroadcastTx, error)
- func (invoker *CosmosInvoker) WaitTx(txhash bytes.HexBytes)
- type CosmosSeq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CosmosAcc ¶
type CosmosInvoker ¶
type CosmosInvoker struct { RpcCli *http.HTTP Acc *CosmosAcc CosmosChainId string CMGas uint64 CMFees types.Coins CMCdc *codec.Codec }
func NewCosmosInvoker ¶
func NewCosmosInvoker() (*CosmosInvoker, error)
func (*CosmosInvoker) BindAsset ¶
func (invoker *CosmosInvoker) BindAsset(sourceAsset string, toChainId uint64, toAssetHash []byte) (*coretypes.ResultBroadcastTx, error)
func (*CosmosInvoker) BindProxy ¶
func (invoker *CosmosInvoker) BindProxy(toChainId uint64, proxy []byte) (*coretypes.ResultBroadcastTx, error)
func (*CosmosInvoker) BtcxBindAsset ¶
func (invoker *CosmosInvoker) BtcxBindAsset(sourceAsset string, toChainId uint64, toAssetHash []byte) (*coretypes.ResultBroadcastTx, error)
func (*CosmosInvoker) CreateAsset ¶
func (invoker *CosmosInvoker) CreateAsset(denom, amt string, lockProxy []byte) (*coretypes.ResultBroadcastTx, error)
func (*CosmosInvoker) CreateLockProxy ¶
func (invoker *CosmosInvoker) CreateLockProxy() (*coretypes.ResultBroadcastTx, error)
func (*CosmosInvoker) CreateValidator ¶
func (invoker *CosmosInvoker) CreateValidator(keyFile, stateFile, coin string, amt int64) (*coretypes.ResultBroadcastTx, error)
TODO: not working for now. How can we get an PrivKeyEd25519 ?
func (*CosmosInvoker) DelegateValidator ¶
func (invoker *CosmosInvoker) DelegateValidator(coin string, amt int64) (*coretypes.ResultBroadcastTx, error)
func (*CosmosInvoker) GetAccInfo ¶
func (invoker *CosmosInvoker) GetAccInfo() (string, error)
func (*CosmosInvoker) SendAsset ¶
func (invoker *CosmosInvoker) SendAsset(asset string, toChainId uint64, value int64, toAddr, lockProxy []byte) (*coretypes.ResultBroadcastTx, error)
func (*CosmosInvoker) SetupAllAssets ¶
func (invoker *CosmosInvoker) SetupAllAssets(proxy []byte) error
eth, erc20, ont, ong, oep4
func (*CosmosInvoker) SetupBtcx ¶
func (invoker *CosmosInvoker) SetupBtcx(denom, redeem string) error
func (*CosmosInvoker) SyncPolyGenesisHdr ¶
func (invoker *CosmosInvoker) SyncPolyGenesisHdr(syner types.AccAddress, rawHdr []byte) (*coretypes.ResultBroadcastTx, error)
func (*CosmosInvoker) TransferCoins ¶
func (invoker *CosmosInvoker) TransferCoins(toAddr, denom string, amt int64) (*coretypes.ResultBroadcastTx, error)
func (*CosmosInvoker) WaitTx ¶
func (invoker *CosmosInvoker) WaitTx(txhash bytes.HexBytes)