Documentation ¶
Overview ¶
WARNING: not finish
Index ¶
- Constants
- func BuildOntologyInvocationTransaction(contract string, method string, args string, gasPrice int, gasLimit int, ...) (string, error)
- func BytesToHex(b []byte) string
- func ClaimONG(endpoint string, gasPrice int, gasLimit int, wif string) (string, error)
- func ConvertByteArrayToBigInt(hexString string) *big.Int
- func Decrypt(key []byte, encryptedText string) string
- func DeploySmartContractScript(contractInfo SmartContractInfo, wallet Wallet, asset smartcontract.NativeAsset, ...) ([]byte, error)
- func Encrypt(key []byte, text string) string
- func GenerateNEP6FromEncryptedKey(walletName, addressLabel, address, encryptedKey string) string
- func GetVarUInt(value int64) []byte
- func Hash160(data []byte) []byte
- func Hash256(b []byte) []byte
- func HexTobytes(hexstring string) (b []byte)
- func NEOAddressToScriptHashWithEndian(neoAddress string, endian binary.ByteOrder) string
- func NEOAddresstoScriptHashBigEndian(neoAddress string) string
- func NEP2Decrypt(key, passphrase string) (s string, err error)
- func NeonJSTXSerializer(tx NeonJSTransaction) []byte
- func OEP4Transfer(endpoint string, contract string, fromAddress string, toAddress string, ...) (string, error)
- func ONTAddressFromPublicKey(publicKey []byte) string
- func OntologyBuildGetDDO(ontid string) (string, error)
- func OntologyGetBlockCount(endpoint string) (int, error)
- func OntologyGetBlockWithHash(endpoint string, blockHash string) (string, error)
- func OntologyGetBlockWithHeight(endpoint string, blockHeight int) (string, error)
- func OntologyGetRawTransaction(endpoint string, txID string) (string, error)
- func OntologyGetStorage(endpoint string, scriptHash string, key string) (string, error)
- func OntologyGetUnboundONG(endpoint string, address string) (string, error)
- func OntologyInvoke(endpoint string, contract string, method string, args string, gasPrice int, ...) (string, error)
- func OntologyMakeRegister(gasPrice int, gasLimit int, ontidWif string, payerWif string) (string, error)
- func OntologySendPreExecRawTransaction(endpoint string, raw string) (string, error)
- func OntologySendRawTransaction(endpoint string, raw string) (string, error)
- func OntologyTransfer(endpoint string, gasPrice int, gasLimit int, wif string, asset string, ...) (string, error)
- func PublicKeyToNEOAddress(publicKeyBytes []byte) string
- func RecoverFromSharedSecret(first []byte, second []byte) (string, error)
- func ReverseBytes(b []byte) []byte
- func ScriptHashToNEOAddress(scriptHash string) string
- func SerializeTX(jsonString string) []byte
- func Sign(data []byte, key string) ([]byte, error)
- func VMCodeToNEOAddress(vmCode []byte) string
- func ValidateNEOAddress(address string) bool
- func Verify(publicKey []byte, signature []byte, hash []byte) bool
- func WriteVarUint(w io.Writer, val uint64) error
- type BlockCountResponse
- type FetchSeedRequest
- type MultiSig
- type MultiSigInterface
- type NEP2
- type NEP5
- type NEP5Interface
- type NativeAsset
- type NativeAssetInterface
- type NeonJSTransaction
- type NodeList
- type ONTAccount
- type OntologyBalances
- type RawTransaction
- type SeedNodeResponse
- type SharedSecret
- type SimplifiedNEP9
- type SmartCodeEvent
- type SmartContract
- type SmartContractInfo
- type SmartContractInterface
- type Wallet
Constants ¶
View Source
const (
VERSION = "1.3.0"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertByteArrayToBigInt ¶
Convert byte array to big int
func DeploySmartContractScript ¶
func DeploySmartContractScript(contractInfo SmartContractInfo, wallet Wallet, asset smartcontract.NativeAsset, amount float64, unspent smartcontract.Unspent, attributes map[smartcontract.TransactionAttribute][]byte) ([]byte, error)
func GetVarUInt ¶
func NEOAddressToScriptHashWithEndian ¶
Convert NEO address to script hash
func NEP2Decrypt ¶
func NeonJSTXSerializer ¶
func NeonJSTXSerializer(tx NeonJSTransaction) []byte
func OEP4Transfer ¶
func OEP4Transfer(endpoint string, contract string, fromAddress string, toAddress string, amount float64, tokenDecimals int, gasPrice int, gasLimit int, wif string) (string, error)
OEP4Transfer : Transfer OEP4 token
func ONTAddressFromPublicKey ¶
func OntologyBuildGetDDO ¶
func OntologyGetBlockCount ¶
func OntologyGetStorage ¶
func OntologyGetUnboundONG ¶
func OntologyInvoke ¶
func OntologyInvoke(endpoint string, contract string, method string, args string, gasPrice int, gasLimit int, wif string, payer string) (string, error)
OntologyInvoke : Invoke a neovm contract in Ontology
func OntologyMakeRegister ¶
func OntologyTransfer ¶
func PublicKeyToNEOAddress ¶
func RecoverFromSharedSecret ¶
Recover the secret from shared secrets.
func ReverseBytes ¶
func ScriptHashToNEOAddress ¶
Convert script hash to NEO address This method takes Big Endian Script hash
func SerializeTX ¶
func VMCodeToNEOAddress ¶
Types ¶
type BlockCountResponse ¶
type FetchSeedRequest ¶
type FetchSeedRequest struct { Response *BlockCountResponse URL string }
type MultiSig ¶
func (*MultiSig) CreateMultiSigRedeemScript ¶
type MultiSigInterface ¶
type NEP5 ¶
type NEP5 struct { ScriptHash smartcontract.ScriptHash NetworkFeeAmount smartcontract.NetworkFeeAmount //allow users to override the network fee here }
func UseNEP5WithNetworkFee ¶
func UseNEP5WithNetworkFee(scriptHashHex string, networkFeeAmount smartcontract.NetworkFeeAmount) *NEP5
func (*NEP5) MintTokensRawTransaction ¶
func (n *NEP5) MintTokensRawTransaction(wallet Wallet, assetToSend smartcontract.NativeAsset, amount float64, unspent smartcontract.Unspent, remark string) ([]byte, string, error)
func (*NEP5) TransferNEP5RawTransaction ¶
func (n *NEP5) TransferNEP5RawTransaction(wallet Wallet, toAddress smartcontract.NEOAddress, amount float64, unspent smartcontract.Unspent, attributes map[smartcontract.TransactionAttribute][]byte) ([]byte, string, error)
type NEP5Interface ¶
type NEP5Interface interface { MintTokensRawTransaction(wallet Wallet, assetToSend smartcontract.NativeAsset, amount float64, unspent smartcontract.Unspent, remark string) ([]byte, string, error) TransferNEP5RawTransaction(wallet Wallet, toAddress smartcontract.NEOAddress, amount float64, unspent smartcontract.Unspent, attributes map[smartcontract.TransactionAttribute][]byte) ([]byte, string, error) }
type NativeAsset ¶
type NativeAsset struct {
NetworkFeeAmount smartcontract.NetworkFeeAmount //allow users to override the network fee here
}
func UseNativeAsset ¶
func UseNativeAsset(networkFeeAmount smartcontract.NetworkFeeAmount) NativeAsset
func (*NativeAsset) GenerateRawTx ¶
func (n *NativeAsset) GenerateRawTx(fromAddress string, asset smartcontract.NativeAsset, amount float64, to smartcontract.NEOAddress, unspent smartcontract.Unspent, attributes map[smartcontract.TransactionAttribute][]byte) ([]byte, string, error)
func (*NativeAsset) SendNativeAssetRawTransaction ¶
func (n *NativeAsset) SendNativeAssetRawTransaction(wallet Wallet, asset smartcontract.NativeAsset, amount float64, to smartcontract.NEOAddress, unspent smartcontract.Unspent, attributes map[smartcontract.TransactionAttribute][]byte) ([]byte, string, error)
type NativeAssetInterface ¶
type NativeAssetInterface interface { SendNativeAssetRawTransaction(wallet Wallet, asset smartcontract.NativeAsset, amount float64, to smartcontract.NEOAddress, unspent smartcontract.Unspent, attributes map[smartcontract.TransactionAttribute][]byte) ([]byte, string, error) GenerateRawTx(fromAddress string, asset smartcontract.NativeAsset, amount float64, to smartcontract.NEOAddress, unspent smartcontract.Unspent, attributes map[smartcontract.TransactionAttribute][]byte) ([]byte, string, error) }
type NeonJSTransaction ¶
type NeonJSTransaction struct { Sha256 string `json:"sha256"` Hash string `json:"hash"` Inputs []struct { PrevIndex int `json:"prevIndex"` PrevHash string `json:"prevHash"` } `json:"inputs"` Outputs []struct { AssetID string `json:"assetId"` ScriptHash string `json:"scriptHash"` Value interface{} `json:"value"` } `json:"outputs"` Script string `json:"script"` Version int `json:"version"` Type int `json:"type"` Attributes []struct { Usage int `json:"usage"` Data string `json:"data"` } `json:"attributes"` Scripts []interface{} `json:"scripts"` Gas int `json:"gas"` }
type ONTAccount ¶
func ONTAccountFromPrivateKey ¶
func ONTAccountFromPrivateKey(privateKeyBytes []byte) *ONTAccount
func ONTAccountFromWIF ¶
func ONTAccountFromWIF(wif string) *ONTAccount
func ONTCreateAccount ¶
func ONTCreateAccount() *ONTAccount
type OntologyBalances ¶
func OntologyGetBalance ¶
func OntologyGetBalance(endpoint string, address string) (*OntologyBalances, error)
type RawTransaction ¶
type SeedNodeResponse ¶
func SelectBestSeedNode ¶
func SelectBestSeedNode(commaSeparatedURLs string) *SeedNodeResponse
type SharedSecret ¶
type SharedSecret struct {}
Shared Secret with 2 parts.
func GenerateShamirSharedSecret ¶
func GenerateShamirSharedSecret(secret string) (*SharedSecret, error)
Generate Shamir shared secret to SharedSecret struct.
type SimplifiedNEP9 ¶
type SimplifiedNEP9 struct { To string `json:"to"` Asset string `json:"assetID"` Amount float64 `json:"amount"` }
func ParseNEP9URI ¶
func ParseNEP9URI(uri string) (*SimplifiedNEP9, error)
type SmartCodeEvent ¶
func OntologyGetSmartCodeEvent ¶
func OntologyGetSmartCodeEvent(endpoint string, txHash string) (*SmartCodeEvent, error)
type SmartContract ¶
type SmartContract struct { ScriptHash smartcontract.ScriptHash NetworkFeeAmount smartcontract.NetworkFeeAmount //allow users to override the network fee here }
func (*SmartContract) GenerateInvokeFunctionRawTransaction ¶
func (s *SmartContract) GenerateInvokeFunctionRawTransaction(wallet Wallet, unspent smartcontract.Unspent, attributes map[smartcontract.TransactionAttribute][]byte, operation string, args []interface{}) ([]byte, error)
func (*SmartContract) GenerateInvokeFunctionRawTransactionWithAmountToSend ¶
func (s *SmartContract) GenerateInvokeFunctionRawTransactionWithAmountToSend(wallet Wallet, asset smartcontract.NativeAsset, amount float64, unspent smartcontract.Unspent, attributes map[smartcontract.TransactionAttribute][]byte, operation string, args []interface{}) ([]byte, error)
type SmartContractInfo ¶
type SmartContractInfo struct { AVMHEX string Name string Version string Author string Email string Description string Properties smartcontract.Properties InputTypes []smartcontract.ParameterType ReturnType smartcontract.ParameterType }
func (*SmartContractInfo) GetScriptHash ¶
func (s *SmartContractInfo) GetScriptHash() string
func (*SmartContractInfo) Serialize ¶
func (s *SmartContractInfo) Serialize() []byte
type SmartContractInterface ¶
type SmartContractInterface interface { //NOTE: these two methods are actually pretty similar in implementation. //the only difference is GenerateInvokeFunctionRawTransactionWithAmountToSend is used to send NEO/GAS to SmartContract //however, I want to keep them separated GenerateInvokeFunctionRawTransaction(wallet Wallet, unspent smartcontract.Unspent, attributes map[smartcontract.TransactionAttribute][]byte, operation string, args []interface{}) ([]byte, error) GenerateInvokeFunctionRawTransactionWithAmountToSend(wallet Wallet, asset smartcontract.NativeAsset, amount float64, unspent smartcontract.Unspent, attributes map[smartcontract.TransactionAttribute][]byte, operation string, args []interface{}) ([]byte, error) }
func UseSmartContract ¶
func UseSmartContract(scriptHashHex string) SmartContractInterface
func UseSmartContractWithNetworkFee ¶
func UseSmartContractWithNetworkFee(scriptHashHex string, feeAmount smartcontract.NetworkFeeAmount) SmartContractInterface
type Wallet ¶
type Wallet struct { PublicKey []byte PrivateKey []byte Address string WIF string HashedSignature []byte }
func GenerateFromPrivateKey ¶
Generate a wallet from a private key
func GenerateFromWIF ¶
Generate a wallet from a WIF
func NEP2DecryptToWallet ¶
func (*Wallet) ComputeSharedSecret ¶
Compute shared secret using ECDH
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
https://github.com/CityOfZion/neo-go/ https://github.com/CityOfZion/neo-go/
|
https://github.com/CityOfZion/neo-go/ https://github.com/CityOfZion/neo-go/ |
Package rfc6979 is an implementation of RFC 6979's deterministic DSA.
|
Package rfc6979 is an implementation of RFC 6979's deterministic DSA. |
Package sss implements Shamir's Secret Sharing algorithm over GF(2^8).
|
Package sss implements Shamir's Secret Sharing algorithm over GF(2^8). |
Click to show internal directories.
Click to hide internal directories.