gateway

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TokenABI is the input ABI used to generate the binding from.
	USDTContractAddress      = "0xdac17f958d2ee523a2206206994597c13d831ec7"
	MultiSendContractAddress = "0xF62e93Eb9e92A0Cd9B9311ea01f1c74cbA5650F2"
	USDTDecimal              = 6
	GWEIDecimal              = 9
	ETHDecimal               = 18
	ETHDerivationPath        = "m/44'/60'/0'/0/0"
)
View Source
const (
	BIPDecimal = 18.0
)

Variables

This section is empty.

Functions

func NewMnemonic added in v0.0.3

func NewMnemonic(length int) (string, error)

func PrivateKeyBySeed added in v0.0.3

func PrivateKeyBySeed(seed []byte) (string, error)

Get private key from seed.

Types

type Adapter

type Adapter interface {
	NewWallet(ctx context.Context) (Wallet, error)
	GetBalance(ctx context.Context, address string) (map[string]float64, error)
	EstimateSendFee(ctx context.Context, w Wallet, coin string, amount float64, address string) (float64, error)
	Send(ctx context.Context, w Wallet, coin string, amount float64, address string) (string, error)
	EstimateMultiSendFee(ctx context.Context, w Wallet, coin string, addresses []string, amounts []float64) (float64, error)
	MultiSend(ctx context.Context, w Wallet, coin string, addresses []string, amounts []float64) (string, error)
}

type CryptoHub

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

func NewCryptoHub

func NewCryptoHub(blockChains map[string]Adapter) *CryptoHub

func (*CryptoHub) EstimateMultiSendFee added in v0.0.3

func (ch *CryptoHub) EstimateMultiSendFee(ctx context.Context, baseCoin string, w Wallet, coin string, addresses []string, amounts []float64) (float64, error)

func (*CryptoHub) EstimateSendFee added in v0.0.3

func (ch *CryptoHub) EstimateSendFee(ctx context.Context, baseCoin string, w Wallet, coin string, amount float64, address string) (float64, error)

func (*CryptoHub) GetBalance

func (ch *CryptoHub) GetBalance(ctx context.Context, baseCoin string, address string) (map[string]float64, error)

func (*CryptoHub) MultiSend

func (ch *CryptoHub) MultiSend(ctx context.Context, baseCoin string, w Wallet, coin string, addresses []string, amounts []float64) (string, error)

func (*CryptoHub) MustEstimateMultiSendFee added in v0.0.4

func (ch *CryptoHub) MustEstimateMultiSendFee(ctx context.Context, baseCoin string, w Wallet, coin string, addresses []string, amounts []float64) float64

func (*CryptoHub) MustEstimateSendFee added in v0.0.4

func (ch *CryptoHub) MustEstimateSendFee(ctx context.Context, baseCoin string, w Wallet, coin string, amount float64, address string) float64

func (*CryptoHub) MustGetBalance added in v0.0.4

func (ch *CryptoHub) MustGetBalance(ctx context.Context, baseCoin string, address string) map[string]float64

func (*CryptoHub) MustMultiSend added in v0.0.4

func (ch *CryptoHub) MustMultiSend(ctx context.Context, baseCoin string, w Wallet, coin string, addresses []string, amounts []float64) string

func (*CryptoHub) MustNewWallet added in v0.0.4

func (ch *CryptoHub) MustNewWallet(ctx context.Context, baseCoin string) Wallet

func (*CryptoHub) MustSend added in v0.0.4

func (ch *CryptoHub) MustSend(ctx context.Context, baseCoin string, w Wallet, coin string, amount float64, address string) string

func (*CryptoHub) NewWallet

func (ch *CryptoHub) NewWallet(ctx context.Context, baseCoin string) (Wallet, error)

func (*CryptoHub) Send

func (ch *CryptoHub) Send(ctx context.Context, baseCoin string, w Wallet, coin string, amount float64, address string) (string, error)

type EthereumAdapter added in v0.0.3

type EthereumAdapter struct {
	Client *ethclient.Client
}

func NewEthereumAdapter added in v0.0.3

func NewEthereumAdapter(ethereumClient *ethclient.Client) *EthereumAdapter

func (*EthereumAdapter) ConfigureTransactionContract added in v0.0.4

func (ea *EthereumAdapter) ConfigureTransactionContract(
	ctx context.Context,
	w Wallet,
	feePerc uint8,
	internalFeePerc uint8,
	rewardPerc uint8,
	affiliatesPerc []uint8,
	partnersPerc []uint8,
	partnersWallets []string,
) ([]string, error)

func (*EthereumAdapter) DeployMultiSendContract added in v0.0.4

func (ea *EthereumAdapter) DeployMultiSendContract(ctx context.Context, w Wallet) (string, string, error)

func (*EthereumAdapter) EstimateMultiSendFee added in v0.0.3

func (ea *EthereumAdapter) EstimateMultiSendFee(ctx context.Context, w Wallet, coin string, addresses []string, amounts []float64) (float64, error)

func (*EthereumAdapter) EstimateSendFee added in v0.0.3

func (ea *EthereumAdapter) EstimateSendFee(ctx context.Context, w Wallet, coin string, amount float64, address string) (float64, error)

func (*EthereumAdapter) GetBalance added in v0.0.3

func (ea *EthereumAdapter) GetBalance(ctx context.Context, address string) (map[string]float64, error)

func (*EthereumAdapter) MultiSend added in v0.0.3

func (ea *EthereumAdapter) MultiSend(ctx context.Context, w Wallet, coin string, addresses []string, amounts []float64) (string, error)

func (*EthereumAdapter) NewWallet added in v0.0.3

func (ea *EthereumAdapter) NewWallet(ctx context.Context) (Wallet, error)

func (*EthereumAdapter) Send added in v0.0.3

func (ea *EthereumAdapter) Send(ctx context.Context, w Wallet, coin string, amount float64, address string) (string, error)

type MinterAdapter

type MinterAdapter struct {
	Client *api.Api
}

func NewMinterAdapter

func NewMinterAdapter(minterClient *api.Api) *MinterAdapter

func (*MinterAdapter) EstimateMultiSendFee added in v0.0.3

func (ma *MinterAdapter) EstimateMultiSendFee(ctx context.Context, w Wallet, coin string, addresses []string, amounts []float64) (float64, error)

func (*MinterAdapter) EstimateSendFee added in v0.0.3

func (ma *MinterAdapter) EstimateSendFee(ctx context.Context, w Wallet, coin string, amount float64, address string) (float64, error)

func (*MinterAdapter) GetBalance

func (ma *MinterAdapter) GetBalance(ctx context.Context, address string) (map[string]float64, error)

func (*MinterAdapter) MultiSend

func (ma *MinterAdapter) MultiSend(ctx context.Context, w Wallet, coin string, addresses []string, amounts []float64) (string, error)

func (*MinterAdapter) NewWallet

func (ma *MinterAdapter) NewWallet(ctx context.Context) (Wallet, error)

func (*MinterAdapter) SellAll

func (ma *MinterAdapter) SellAll(ctx context.Context, w Wallet, coin string) (string, error)

func (*MinterAdapter) Send

func (ma *MinterAdapter) Send(ctx context.Context, w Wallet, coin string, amount float64, address string) (string, error)

type Wallet

type Wallet struct {
	Address    string
	PrivateKey string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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