ontmobile

package
v0.0.0-...-22ffadd Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ONGDECIMALS = 9
)
View Source
const (
	UNBOUND_TIME_OFFSET = "unboundTimeOffset"
)

Variables

View Source
var OIDContractAddress = []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}
View Source
var ONGContractAddress = []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}
View Source
var ONTContractAddress = []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}
View Source
var (
	OntContractAddress, _ = common.AddressParseFromBytes([]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01})
)

Functions

func BuildGetDDO

func BuildGetDDO(ontid string) (string, error)

func BuildInvocationTransaction

func BuildInvocationTransaction(contractHex string, operation string, argString string, gasPrice uint, gasLimit uint, wif string, payer string) (string, error)

BuildInvocationTransaction : creates a raw transaction

func GetOffset

func GetOffset(addressBase58 string, rpcEndpoint string)

ASi48wqdF9avm91pWwdphcAmaDJQkPNdNt

func GetTimeFormat

func GetTimeFormat(second int64, format string) string

func MakeRegister

func MakeRegister(gasPrice uint, gasLimit uint, ontidWif string, payerWif string) (string, error)

func NewSmartContractTransaction

func NewSmartContractTransaction(gasPrice, gasLimit uint64, invokeCode []byte) (*types.MutableTransaction, error)

func ONTAddressFromPublicKey

func ONTAddressFromPublicKey(publicKeyBytes []byte) string

func RoundFixed

func RoundFixed(val float64, decimals int) (newVal float64)

func SendPreExecRawTransaction

func SendPreExecRawTransaction(endpoint string, rawTransactionHex string) (string, error)

func SendRawTransaction

func SendRawTransaction(endpoint string, rawTransactionHex string) (string, error)

func SendRpcRequest

func SendRpcRequest(method string, params []interface{}) ([]byte, error)

Types

type JsonRpcRequest

type JsonRpcRequest struct {
	Version string        `json:"jsonrpc"`
	Id      string        `json:"id"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
}

JsonRpcRequest object in rpc

type JsonRpcResponse

type JsonRpcResponse struct {
	Error  int64  `json:"error"`
	Desc   string `json:"desc"`
	Result string `json:"result"`
}

JsonRpcResponse object response for JsonRpcRequest

type ONTAccount

type ONTAccount struct {
	Address    string //base58
	WIF        string
	PrivateKey []byte
	PublicKey  []byte
	// contains filtered or unexported fields
}

func NewONTAccount

func NewONTAccount() *ONTAccount

func ONTAccountWithPrivateKey

func ONTAccountWithPrivateKey(privateKeyBytes []byte) *ONTAccount

func ONTAccountWithWIF

func ONTAccountWithWIF(wif string) *ONTAccount

type ParameterJSONArrayForm

type ParameterJSONArrayForm struct {
	A []ParameterJSONForm `json:"array"`
}

type ParameterJSONForm

type ParameterJSONForm struct {
	T string      `json:"type"`
	V interface{} `json:"value"`
}

type RawTransaction

type RawTransaction struct {
	TXID string
	Data []byte
}

func Transfer

func Transfer(gasPrice uint, gasLimit uint, senderWIF string, asset string, toAddress string, amount float64) (*RawTransaction, error)

func WithdrawONG

func WithdrawONG(gasPrice uint, gasLimit uint, endpoint string, wif string) (*RawTransaction, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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