blockchain

package
v0.5.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: Apache-2.0 Imports: 18 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// Producer indicates block producer's encoded address
	Producer = "io13rjq2c07mqhe8sdd7nf9a4vcmnyk9mn72hu94e"
	// ProducerPubKey indicates block producer's public key
	ProducerPubKey = "" /* 130-byte string literal not displayed */
	// ProducerPrivKey indicates block producer's private key
	ProducerPrivKey = "82a1556b2dbd0e3615e367edf5d3b90ce04346ec4d12ed71f67c70920ef9ac90"
	// GasLimitPerByte indicates the gas limit for each byte
	GasLimitPerByte uint64 = 100
	// GasPrice indicates the gas price
	GasPrice = 0
)
View Source
const (
	// FpRegistryID is the ID of FpRegistry
	FpRegistryID = "0000000000000009"
	// FpRegistryBinary is the binary code of FpRegistry
	FpRegistryBinary = "" /* 9082-byte string literal not displayed */
	// CdpManageID is the ID of CdpManage
	CdpManageID = "0000000000000010"
	// CdpManageBinary is the binary code of CdpManage
	CdpManageBinary = "" /* 23634-byte string literal not displayed */
	// ManageID is the ID of Manage
	ManageID = "0000000000000011"
	// ManageBinary is the binary code of Manage
	ManageBinary = "" /* 47372-byte string literal not displayed */
	// ManageProxyID is the ID of ManageProxy
	ManageProxyID = "0000000000000012"
	// ManageProxyBinary is the binary code of ManageProxy
	ManageProxyBinary = "" /* 17926-byte string literal not displayed */
	// EapStorageID is the ID of EapStorage
	EapStorageID = "0000000000000013"
	// EapStorageBinary is the binary code of EapStorage
	EapStorageBinary = "" /* 17870-byte string literal not displayed */
	// TokenRiskLockID is the ID of TokenRiskLock
	TokenRiskLockID = "0000000000000014"
	// TokenRiskLockBinary is the binary code of TokenRiskLock
	TokenRiskLockBinary = "" /* 7716-byte string literal not displayed */
	// StartFpTokenID is the ID of StartFpToken
	StartFpTokenID = "00000000000000015"
)
View Source
const (
	// StableTokenID is the ID of StableToken
	StableTokenID = "0000000000000000"
	// StableTokenBinary is the binary code of StableToken
	StableTokenBinary = "" /* 36056-byte string literal not displayed */
	// AllowanceSheetID is the ID of AllowanceSheet
	AllowanceSheetID = "0000000000000001"
	// AllowanceSheetBinary is the binary of AllowanceSheet
	AllowanceSheetBinary = "" /* 5066-byte string literal not displayed */
	// BalanceSheetID is the ID of BalanceSheet
	BalanceSheetID = "0000000000000002"
	// BalanceSheetBinary is the binary of BalanceSheet
	BalanceSheetBinary = "" /* 4168-byte string literal not displayed */
	// RegistryID is the ID of Registry
	RegistryID = "0000000000000003"
	// RegistryBinary is the binary of Registry
	RegistryBinary = "" /* 9082-byte string literal not displayed */
	// GlobalPauseID is the ID of GlobalPause
	GlobalPauseID = "0000000000000004"
	// GlobalPauseBinary is the binary of GlobalPause
	GlobalPauseBinary = "" /* 4462-byte string literal not displayed */
	// StartStableTokenID is the ID of StartStableToken
	StartStableTokenID = "0000000000000005"
)
View Source
const (
	// TradingID is the ID of Trading
	TradingID = "0000000000000032"
	// TradingBinary is the binary of Trading
	TradingBinary = "" /* 43092-byte string literal not displayed */
	// TradingProxyID is the ID of Trading proxy
	TradingProxyID = "0000000000000033"
	// TradingProxyBinary is the binary of Trading proxy
	TradingProxyBinary = "" /* 26206-byte string literal not displayed */
	// ReserveID is the ID of Reserve
	ReserveID = "0000000000000034"
	// ReserveBinary is the binary of Reserve
	ReserveBinary = "" /* 34310-byte string literal not displayed */
	// CreditRatingID is the ID of CreditRating
	CreditRatingID = "0000000000000035"
	// CreditRatingBinary is the binary of CreditRating
	CreditRatingBinary = "" /* 15786-byte string literal not displayed */
	// ExpectedRateID is the ID of ExpectedRate
	ExpectedRateID = "0000000000000036"
	// ExpectedRateBinary is the binary of ExpectedRate
	ExpectedRateBinary = "" /* 18920-byte string literal not displayed */
	// ConversionRateID is the ID of ConversionRate
	ConversionRateID = "0000000000000037"
	// ConversionRateBinary is the binary of ConversionRate
	ConversionRateBinary = "" /* 32342-byte string literal not displayed */
	// StartTradingID is the ID of StartTrading
	StartTradingID = "0000000000000038"
)

Variables

This section is empty.

Functions

func U256

func U256(n *big.Int) []byte

U256 converts a big Int into a 256bit EVM number.

Types

type Contract

type Contract interface {
	Start() error
	Exist(string) bool
	Explorer() string
	Deploy(string, ...[]byte) (string, error)
	Read(string, ...[]byte) (string, error)
	ReadValue(string, string, string) (int64, error)
	ReadAndParseToDecimal(string, string, string) (string, error)
	Call(string, ...[]byte) (string, error)
	Transact([]byte, bool) (string, error)
	CheckCallResult(string) (*iotextypes.Receipt, error)

	Address() string
	SetAddress(string) Contract
	SetOwner(string, string) Contract
	SetExecutor(string) Contract
	SetPrvKey(string) Contract
	RunAsOwner() Contract
}

Contract is a basic contract

func NewContract

func NewContract(exp string) Contract

NewContract creates a new contract

type FpToken

type FpToken interface {
	Contract
	CreateToken(string, string, string, int64, int64, int64, int64) (string, error)
	CreateDeferredToken(string, string, string, string, int64, int64, int64) (string, error)
	TokenAddress(string) (string, error)
	Transfer(string, string, string, string, int64) (string, error)
	RiskLock(string, string, string, int64) (string, error)
	SetRate(string, int64) (string, error)
	GetRate(string) (string, error)
	SetPayDate(string, int64) (string, error)
	GetPayDate(string) (string, error)

	SetManagement(string) FpToken
	SetManagementProxy(string) FpToken
	SetEapStorage(string) FpToken
	SetRiskLock(string) FpToken
	SetRegistry(string) FpToken
	SetCdpManager(string) FpToken
	SetStableToken(string) FpToken
}

FpToken is an interface for an fp token

func NewFpToken

func NewFpToken(exp string) FpToken

NewFpToken creates a new FpToken

type ICanBytes

type ICanBytes interface {
	Bytes() []byte
}

ICanBytes is []byte

type SliceAssembler

type SliceAssembler interface {
	PackArguments(args ...interface{}) ([]byte, error)
	IsDynamicType(param interface{}) bool
}

SliceAssembler is an interface to pack arguments for ABI

func NewSliceAssembler

func NewSliceAssembler() SliceAssembler

NewSliceAssembler creates a slice assembler

type StableToken

type StableToken interface {
	Contract
	Mint(string, int64) (string, error)
	Burn(string, string, string, int64) (string, error)
	Transfer(string, int64) (string, error)

	MintWhitelist() []byte
	BurnWhiteList() []byte

	SetAllowance(string) StableToken
	SetBalance(string) StableToken
	SetRegistry(string) StableToken
	SetPause(string) StableToken
	SetStable(string) StableToken
}

StableToken is an interface for a stable token

func NewStableToken

func NewStableToken(exp string) StableToken

NewStableToken creates a new Stable Token

type Trading

type Trading interface {
	Contract
	CreateReserve(string, string) (string, string, error)
	SetInterest(string, []string, []int64, []int64) (string, error)
	SetFactor(string, string, []int64, []int64, []int64) (string, error)
	SetAccountCreditRating(string, int64) (string, error)
	GetAccountCreditRating(string) (string, error)
	QuoteRate(string, string, int64, int64) (string, error)
	Trade(string, string, string, string, int64, int64) (string, error)

	SetTrading(string) Trading
	SetTradingProxy(string) Trading
	SetCreditRating(string) Trading
	SetExpectedRate(string) Trading
	SetEapStorage(string) Trading
	SetFpManage(string) Trading
	SetStableToken(string) Trading
}

Trading is an interface for trading platform

func NewTrading

func NewTrading(exp string) Trading

NewTrading creates a new trading

Jump to

Keyboard shortcuts

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