Documentation ¶
Overview ¶
Package foundation server implementation of smartcontract functions
Index ¶
- func ExportPublicKey(publicKey crypto.PublicKey) (string, error)
- func ExtractPublicKey(privateKey crypto.PrivateKey) crypto.PublicKey
- func GeneratePrivateKey() (crypto.PrivateKey, error)
- func GetContext() *core.LogicCallContext
- func GetImplementationFor(object, ofType core.RecordRef) (core.RecordRef, error)
- func ImportPublicKey(publicKey string) (crypto.PublicKey, error)
- func Sign(data []byte, key crypto.PrivateKey) ([]byte, error)
- func Verify(data []byte, signatureRaw []byte, publicKey crypto.PublicKey) bool
- type BaseContract
- func (bc *BaseContract) GetCode() core.RecordRef
- func (bc *BaseContract) GetContext() *core.LogicCallContext
- func (bc *BaseContract) GetPrototype() core.RecordRef
- func (bc *BaseContract) GetReference() core.RecordRef
- func (bc *BaseContract) NewChildrenTypedIterator(childPrototype core.RecordRef) (*proxyctx.ChildrenTypedIterator, error)
- func (bc *BaseContract) SelfDestruct()
- type BaseContractInterface
- type Error
- type ProxyInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportPublicKey ¶ added in v0.6.3
func ExtractPublicKey ¶ added in v0.6.3
func ExtractPublicKey(privateKey crypto.PrivateKey) crypto.PublicKey
func GeneratePrivateKey ¶ added in v0.6.3
func GeneratePrivateKey() (crypto.PrivateKey, error)
func GetContext ¶ added in v0.4.0
func GetContext() *core.LogicCallContext
GetContext returns current calling context.
func GetImplementationFor ¶
GetImplementationFor finds delegate typed r in object and returns it
func ImportPublicKey ¶ added in v0.6.3
Types ¶
type BaseContract ¶
type BaseContract struct { }
BaseContract is a base class for all contracts.
func (*BaseContract) GetCode ¶ added in v0.6.3
func (bc *BaseContract) GetCode() core.RecordRef
GetCode - Returns prototype of contract
func (*BaseContract) GetContext ¶
func (bc *BaseContract) GetContext() *core.LogicCallContext
GetContext returns current calling context OBSOLETED.
func (*BaseContract) GetPrototype ¶ added in v0.6.2
func (bc *BaseContract) GetPrototype() core.RecordRef
GetPrototype - Returns prototype of contract
func (*BaseContract) GetReference ¶ added in v0.0.6
func (bc *BaseContract) GetReference() core.RecordRef
GetReference - Returns public reference of contract
func (*BaseContract) NewChildrenTypedIterator ¶ added in v0.7.5
func (bc *BaseContract) NewChildrenTypedIterator(childPrototype core.RecordRef) (*proxyctx.ChildrenTypedIterator, error)
NewChildrenTypedIterator returns children with corresponding type iterator
func (*BaseContract) SelfDestruct ¶ added in v0.6.0
func (bc *BaseContract) SelfDestruct()
SelfDestruct contract will be marked as deleted
type BaseContractInterface ¶
type BaseContractInterface interface { GetReference() core.RecordRef GetPrototype() core.RecordRef GetCode() core.RecordRef }
BaseContractInterface is an interface to deal with any contract same way
type Error ¶ added in v0.4.0
type Error struct {
S string
}
Error elementary string based error struct satisfying builtin error interface
foundation.Error{"some err"}
type ProxyInterface ¶ added in v0.0.6
type ProxyInterface interface { GetReference() core.RecordRef GetPrototype() (core.RecordRef, error) GetCode() (core.RecordRef, error) }
ProxyInterface interface any proxy of a contract implements
func GetObject ¶
func GetObject(ref core.RecordRef) ProxyInterface
GetObject create proxy by address unimplemented