cosmos

package
v0.0.0-...-035b7fa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2021 License: GPL-3.0 Imports: 30 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcCosmosFees

func CalcCosmosFees(gasPrice types.DecCoins, gas uint64) (types.Coins, error)

func NewCodec

func NewCodec() *codec.Codec

Types

type CosmosAcc

type CosmosAcc struct {
	Acc        types.AccAddress
	PrivateKey crypto.PrivKey
	Seq        *CosmosSeq
	AccNum     uint64
}

func NewCosmosAcc

func NewCosmosAcc(wallet, pwd string, cli *http.HTTP, cdc *codec.Codec) (*CosmosAcc, error)

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)

type CosmosSeq

type CosmosSeq struct {
	// contains filtered or unexported fields
}

func (*CosmosSeq) GetAndAdd

func (seq *CosmosSeq) GetAndAdd() uint64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL