Documentation ¶
Index ¶
- Constants
- Variables
- func BuildGetDDO(ontid string) (string, error)
- func BuildInvocationTransaction(contractHex string, operation string, argString string, gasPrice uint, ...) (string, error)
- func GetOffset(addressBase58 string, rpcEndpoint string)
- func GetTimeFormat(second int64, format string) string
- func MakeRegister(gasPrice uint, gasLimit uint, ontidWif string, payerWif string) (string, error)
- func NewSmartContractTransaction(gasPrice, gasLimit uint64, invokeCode []byte) (*types.MutableTransaction, error)
- func ONTAddressFromPublicKey(publicKeyBytes []byte) string
- func RoundFixed(val float64, decimals int) (newVal float64)
- func SendPreExecRawTransaction(endpoint string, rawTransactionHex string) (string, error)
- func SendRawTransaction(endpoint string, rawTransactionHex string) (string, error)
- func SendRpcRequest(method string, params []interface{}) ([]byte, error)
- type JsonRpcRequest
- type JsonRpcResponse
- type ONTAccount
- type ParameterJSONArrayForm
- type ParameterJSONForm
- type RawTransaction
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 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 GetTimeFormat ¶
func MakeRegister ¶
func NewSmartContractTransaction ¶
func NewSmartContractTransaction(gasPrice, gasLimit uint64, invokeCode []byte) (*types.MutableTransaction, error)
func ONTAddressFromPublicKey ¶
func RoundFixed ¶
func SendRawTransaction ¶
func SendRpcRequest ¶
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"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.