Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account interface { // GetPubKey returns the public key of this account. GetPubKey() []byte // Sign signs a message with this account's secret key. Sign(message []byte, callback SignCallback) // Verify verifies the signature of this account. Verify(signBytes []byte, message []byte, callback VerifyCallback) // SetProperty sets a property for this algorithm account. Plugin can save some extra data of this account if needed. // Notices that the properties belong to the keyPair, if default keyPair changes, properties would be changed. SetProperty(key string, value string) // GetProperty retrieves a property for this algorithm account of a certain key. GetProperty(key string) string }
Account interface represents an account.
type Block ¶
type CallRequest ¶
type CallRequest struct { Path string // 调用资源的路径。例如:payment.chain0.hello Method string // 资源函数的方法名。例如:"transfer" Args []string // 函数的参数。例如:["Tom", "100"] Nonce int64 // 唯一性标识符 Sender string // 调用请求的发送者 Version string // luyu 协议的版本 LuyuSign []byte // 由 luyu 账户签名的签名 Properties map[string]interface{} // 扩展参数 }
CallRequest 结构表示一个调用请求
type CallResponse ¶
type CallResponse struct { Result []string // Resource function's return output Code int64 // Error code Message string // Error message Path string // Transaction path of the calling resource. eg: payment.chain0.hello Method string // Transaction method of resource function name. eg: "transfer" Args []string // Transaction arguments of function. eg: ["Tom", "100"] Version string // version of luyu protocol }
func (CallResponse) String ¶
func (c CallResponse) String() string
type CallResponseCallback ¶
type CallResponseCallback interface { // Define CallResponseCallback interface OnResponse(status int, message string, callResponse CallResponse) }
type Events ¶
type Events interface { // Define Events interface methods SendTransaction(tx Transaction, callback ReceiptCallback) Call(request CallRequest, callback CallResponseCallback) GetAccountByIdentity(identity string, callback KeyCallback) }
type KeyCallback ¶
type KeyCallback interface { // Define KeyCallback interface method OnResponse(account Account) }
type Receipt ¶
type Receipt struct { Result []string // Resource function's return output Code int // Error code of blockchain Message string // Error message of blockchain Path string // Transaction path of the calling resource. eg: payment.chain0.hello Method string // Transaction method of resource function name. eg: "transfer" Args []string // Transaction arguments of function. eg: ["Tom", "100"] TransactionHash string // Original transaction hash TransactionBytes []byte // The original transaction bytes of a certain blockchain BlockNumber int64 // Block number of this transaction belongs to Version string // version of luyu protocol }
Receipt represents a transaction receipt.
type ReceiptCallback ¶
type SignCallback ¶
SignCallback is a callback function for signing.
type Transaction ¶
type Transaction struct { Path string // 调用资源的路径。例如:payment.chain0.hello Method string // 资源函数的方法名。例如:"transfer" Args []string // 函数的参数。例如:["Tom", "100"] Nonce int64 // 唯一性标识符 Sender string // 交易发送者 Version string // luyu 协议的版本 LuyuSign []byte // 由 luyu 账户签名的签名 Properties map[string]interface{} // 扩展参数 }
Transaction 结构表示一个交易
type VerifyCallback ¶
VerifyCallback is a callback function for signature verification.
Click to show internal directories.
Click to hide internal directories.