Documentation ¶
Overview ¶
Package naet represents a connection to a Node or Compiler. It saves the caller from having to deal with swagger generated types and returns native Go types whenever possible.
Index ¶
- type APIVersioner
- type CompileContracter
- type Compiler
- func (c *Compiler) APIVersion() (version string, err error)
- func (c *Compiler) CompileContract(source string, backend string) (bytecode string, err error)
- func (c *Compiler) DecodeCallResult(callResult string, callValue string, function string, source string, ...) (answer interface{}, err error)
- func (c *Compiler) DecodeCalldataBytecode(bytecode string, calldata string, backend string) (decodedCallData *models.DecodedCalldata, err error)
- func (c *Compiler) DecodeCalldataSource(source string, function string, callData string, backend string) (decodedCallData *models.DecodedCalldata, err error)
- func (c *Compiler) DecodeData(data string, sophiaType string) (decodedData *models.SophiaJSONData, err error)
- func (c *Compiler) EncodeCalldata(source string, function string, args []string, backend string) (callData string, err error)
- func (c *Compiler) GenerateACI(source string, backend string) (aci *models.ACI, err error)
- func (c *Compiler) SophiaVersion() (version string, err error)
- type DecodeCallResulter
- type DecodeCalldataBytecoder
- type DecodeCalldataSourcer
- type DecodeDataer
- type EncodeCalldataer
- type GenerateACIer
- type GetAccounter
- type GetGenerationByHeighter
- type GetHeighter
- type GetKeyBlockByHasher
- type GetMicroBlockHeaderByHasher
- type GetMicroBlockTransactionsByHasher
- type GetNameEntryByNamer
- type GetOracleByPubkeyer
- type GetStatuser
- type GetTopBlocker
- type GetTransactionByHasher
- type Node
- func (c *Node) GetAccount(accountID string) (account *models.Account, err error)
- func (c *Node) GetContractByID(ctID string) (contract *models.ContractObject, err error)
- func (c *Node) GetCurrentKeyBlock() (kb *models.KeyBlock, err error)
- func (c *Node) GetGenerationByHeight(height uint64) (g *models.Generation, err error)
- func (c *Node) GetHeight() (height uint64, err error)
- func (c *Node) GetKeyBlockByHash(keyBlockID string) (txs *models.KeyBlock, err error)
- func (c *Node) GetMicroBlockHeaderByHash(microBlockID string) (txs *models.MicroBlockHeader, err error)
- func (c *Node) GetMicroBlockTransactionsByHash(microBlockID string) (txs *models.GenericTxs, err error)
- func (c *Node) GetNameEntryByName(name string) (nameEntry *models.NameEntry, err error)
- func (c *Node) GetOracleByPubkey(pubkey string) (oracle *models.RegisteredOracle, err error)
- func (c *Node) GetOracleQueriesByPubkey(pubkey string) (oracleQueries *models.OracleQueries, err error)
- func (c *Node) GetStatus() (status *models.Status, err error)
- func (c *Node) GetTopBlock() (kb *models.KeyBlockOrMicroBlockHeader, err error)
- func (c *Node) GetTransactionByHash(txHash string) (tx *models.GenericSignedTx, err error)
- func (c *Node) PostTransaction(signedEncodedTx, signedEncodedTxHash string) (err error)
- type NodeInterface
- type PostTransactioner
- type SophiaVersioner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIVersioner ¶
APIVersioner guarantees that one can run a APIVersion() method on the mocked/real network connection to the aesophia compiler
type CompileContracter ¶
type CompileContracter interface {
CompileContract(source string, backend string) (bytecode string, err error)
}
CompileContracter guarantees that one can run a CompileContract() method on the mocked/real network connection to the aesophia compiler
type Compiler ¶
type Compiler struct {
*compiler_client.Compiler
}
Compiler wraps around the swagger-generated Compiler. Unlike the swagger-generated Compiler, this Compiler struct builds the swagger HTTP requests from the Golang native arguments that its methods receive, and uses the swagger-generated Compiler's endpoints to send these requests off. It then parses the swagger response and makes it as native-Go-code-friendly as possible.
func NewCompiler ¶
NewCompiler creates a new Compiler instance from a URL
func (*Compiler) APIVersion ¶
APIVersion connects to the compiler and returns its version string, e.g. 3.1.0
func (*Compiler) CompileContract ¶
CompileContract abstracts away the swagger specifics of posting to /compile
func (*Compiler) DecodeCallResult ¶
func (c *Compiler) DecodeCallResult(callResult string, callValue string, function string, source string, backend string) (answer interface{}, err error)
DecodeCallResult abstracts away the swagger specifics of posting to /decode-call-result
func (*Compiler) DecodeCalldataBytecode ¶
func (c *Compiler) DecodeCalldataBytecode(bytecode string, calldata string, backend string) (decodedCallData *models.DecodedCalldata, err error)
DecodeCalldataBytecode abstracts away the swagger specifics of posting to /decode-calldata/bytecode
func (*Compiler) DecodeCalldataSource ¶
func (c *Compiler) DecodeCalldataSource(source string, function string, callData string, backend string) (decodedCallData *models.DecodedCalldata, err error)
DecodeCalldataSource abstracts away the swagger specifics of posting to /decode-calldata/source
func (*Compiler) DecodeData ¶
func (c *Compiler) DecodeData(data string, sophiaType string) (decodedData *models.SophiaJSONData, err error)
DecodeData abstracts away the swagger specifics of posting to /decode-data
func (*Compiler) EncodeCalldata ¶
func (c *Compiler) EncodeCalldata(source string, function string, args []string, backend string) (callData string, err error)
EncodeCalldata abstracts away the swagger specifics of posting to /encode-calldata
func (*Compiler) GenerateACI ¶
GenerateACI abstracts away the swagger specifics of posting to /aci
func (*Compiler) SophiaVersion ¶
SophiaVersion abstracts away the swagger specifics of getting /version
type DecodeCallResulter ¶
type DecodeCallResulter interface {
DecodeCallResult(callResult string, callValue string, function string, source string, backend string) (answer interface{}, err error)
}
DecodeCallResulter guarantees that one can run a DecodeCallResult() method on the mocked/real network connection to the aesophia compiler
type DecodeCalldataBytecoder ¶
type DecodeCalldataBytecoder interface {
DecodeCalldataBytecode(bytecode string, calldata string, backend string) (decodedCallData *models.DecodedCalldata, err error)
}
DecodeCalldataBytecoder guarantees that one can run a DecodeCalldataBytecode() method on the mocked/real network connection to the aesophia compiler
type DecodeCalldataSourcer ¶
type DecodeCalldataSourcer interface {
DecodeCalldataSource(source string, function string, callData string, backend string) (decodedCallData *models.DecodedCalldata, err error)
}
DecodeCalldataSourcer guarantees that one can run a DecodeCalldataSource() method on the mocked/real network connection to the aesophia compiler
type DecodeDataer ¶
type DecodeDataer interface {
DecodeData(data string, sophiaType string) (decodedData *models.SophiaJSONData, err error)
}
DecodeDataer guarantees that one can run a DecodeData() method on the mocked/real network connection to the aesophia compiler
type EncodeCalldataer ¶
type EncodeCalldataer interface {
EncodeCalldata(source string, function string, args []string, backend string) (callData string, err error)
}
EncodeCalldataer guarantees that one can run a EncodeCalldata() method on the mocked/real network connection to the aesophia compiler
type GenerateACIer ¶
type GenerateACIer interface {
GenerateACI(source string, backend string) (aci *models.ACI, err error)
}
GenerateACIer guarantees that one can run a GenerateACI() method on the mocked/real network connection to the aesophia compiler
type GetAccounter ¶
GetAccounter guarantees that one can run a GetAccount() method on the mocked/real network connection
type GetGenerationByHeighter ¶
type GetGenerationByHeighter interface {
GetGenerationByHeight(height uint64) (*models.Generation, error)
}
GetGenerationByHeighter guarantees that one can run a GetGenerationByHeight() method on the mocked/real network connection
type GetHeighter ¶
GetHeighter guarantees that one can run a GetHeight() method on the mocked/real network connection
type GetKeyBlockByHasher ¶
GetKeyBlockByHasher guarantees that one can run a GetKeyBlockByHash() method on the mocked/real network connection
type GetMicroBlockHeaderByHasher ¶
type GetMicroBlockHeaderByHasher interface {
GetMicroBlockHeaderByHash(string) (*models.MicroBlockHeader, error)
}
GetMicroBlockHeaderByHasher guarantees that one can run a GetMicroBlockHeaderByHash() method on the mocked/real network connection
type GetMicroBlockTransactionsByHasher ¶
type GetMicroBlockTransactionsByHasher interface {
GetMicroBlockTransactionsByHash(string) (*models.GenericTxs, error)
}
GetMicroBlockTransactionsByHasher guarantees that one can run a GetMicroBlockTransactionsByHash() method on the mocked/real network connection
type GetNameEntryByNamer ¶
GetNameEntryByNamer guarantees that one can run a GetNameEntryByName() method on the mocked/real network connection
type GetOracleByPubkeyer ¶
type GetOracleByPubkeyer interface {
GetOracleByPubkey(string) (*models.RegisteredOracle, error)
}
GetOracleByPubkeyer guarantees that one can run a GetOracleByPubkey() method on the mocked/real network connection
type GetStatuser ¶
GetStatuser guarantees that one can run a GetStatus() method on the mocked/real network connection
type GetTopBlocker ¶
type GetTopBlocker interface {
GetTopBlock() (*models.KeyBlockOrMicroBlockHeader, error)
}
GetTopBlocker guarantees that one can run a GetTopBlock() method on the mocked/real network connection
type GetTransactionByHasher ¶
type GetTransactionByHasher interface {
GetTransactionByHash(string) (*models.GenericSignedTx, error)
}
GetTransactionByHasher guarantees that one can run a GetTransactionByHash() method on the mocked/real network connection
type Node ¶
Node represents a HTTP connection to an aeternity node
func NewNode ¶
NewNode instantiates a new swagger HTTP client to an aeternity node. No network connection is actually performed, this only sets up the HTTP client code.
func (*Node) GetAccount ¶
GetAccount retrieve an account by its address (public key) it is particularly useful to obtain the nonce for spending transactions
func (*Node) GetContractByID ¶
func (c *Node) GetContractByID(ctID string) (contract *models.ContractObject, err error)
GetContractByID gets a contract by ct_ ID
func (*Node) GetCurrentKeyBlock ¶
GetCurrentKeyBlock get current key block
func (*Node) GetGenerationByHeight ¶
func (c *Node) GetGenerationByHeight(height uint64) (g *models.Generation, err error)
GetGenerationByHeight gets the keyblock and all its microblocks
func (*Node) GetKeyBlockByHash ¶
GetKeyBlockByHash get a key block by its hash
func (*Node) GetMicroBlockHeaderByHash ¶
func (c *Node) GetMicroBlockHeaderByHash(microBlockID string) (txs *models.MicroBlockHeader, err error)
GetMicroBlockHeaderByHash get the header of a micro block
func (*Node) GetMicroBlockTransactionsByHash ¶
func (c *Node) GetMicroBlockTransactionsByHash(microBlockID string) (txs *models.GenericTxs, err error)
GetMicroBlockTransactionsByHash get the transactions of a microblock
func (*Node) GetNameEntryByName ¶
GetNameEntryByName return the name entry
func (*Node) GetOracleByPubkey ¶
func (c *Node) GetOracleByPubkey(pubkey string) (oracle *models.RegisteredOracle, err error)
GetOracleByPubkey get an oracle by it's public key
func (*Node) GetOracleQueriesByPubkey ¶
func (c *Node) GetOracleQueriesByPubkey(pubkey string) (oracleQueries *models.OracleQueries, err error)
GetOracleQueriesByPubkey get a list of queries made to a particular oracle
func (*Node) GetTopBlock ¶
func (c *Node) GetTopBlock() (kb *models.KeyBlockOrMicroBlockHeader, err error)
GetTopBlock get the top block of the chain
func (*Node) GetTransactionByHash ¶
func (c *Node) GetTransactionByHash(txHash string) (tx *models.GenericSignedTx, err error)
GetTransactionByHash get a transaction by it's hash
func (*Node) PostTransaction ¶
PostTransaction post transaction
type NodeInterface ¶
type NodeInterface interface { GetAccounter GetTopBlocker GetStatuser GetHeighter GetKeyBlockByHasher GetOracleByPubkeyer GetGenerationByHeighter GetTransactionByHasher GetNameEntryByNamer GetMicroBlockHeaderByHasher GetMicroBlockTransactionsByHasher PostTransactioner }
NodeInterface collects together all the interfaces defined in this file to describe the capabilities of a generic connection to an aeternity (or mock) node
type PostTransactioner ¶
PostTransactioner guarantees that one can run a PostTransaction() method on the mocked/real network connection
type SophiaVersioner ¶
SophiaVersioner guarantees that one can run a SophiaVersion() method on the mocked/real network connection to the aesophia compiler