Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalAssets = map[string]string{
	"c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b": "NEO",
	"602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7": "GAS",
}

    GlobalAssets stores a map of asset IDs to user-friendly strings ("NEO"/"GAS").

    Functions

    This section is empty.

    Types

    type AccountState

    type AccountState struct {
    	Version    uint8             `json:"version"`
    	ScriptHash util.Uint160      `json:"script_hash"`
    	IsFrozen   bool              `json:"frozen"`
    	Votes      []*keys.PublicKey `json:"votes"`
    	Balances   []Balance         `json:"balances"`
    }

      AccountState wrapper used for the representation of state.Account on the RPC Server.

      func NewAccountState

      func NewAccountState(a *state.Account) AccountState

        NewAccountState creates a new Account wrapper.

        type AssetState

        type AssetState struct {
        	ID         util.Uint256          `json:"assetID"`
        	AssetType  transaction.AssetType `json:"assetType"`
        	Name       string                `json:"name"`
        	Amount     util.Fixed8           `json:"amount"`
        	Available  util.Fixed8           `json:"available"`
        	Precision  uint8                 `json:"precision"`
        	FeeMode    uint8                 `json:"fee"`
        	FeeAddress util.Uint160          `json:"address"`
        	Owner      string                `json:"owner"`
        	Admin      string                `json:"admin"`
        	Issuer     string                `json:"issuer"`
        	Expiration uint32                `json:"expiration"`
        	IsFrozen   bool                  `json:"is_frozen"`
        }

          AssetState wrapper used for the representation of state.Asset on the RPC Server.

          func NewAssetState

          func NewAssetState(a *state.Asset) AssetState

            NewAssetState creates a new Asset wrapper.

            type Balance

            type Balance struct {
            	Asset util.Uint256 `json:"asset"`
            	Value util.Fixed8  `json:"value"`
            }

              Balance response wrapper.

              type Balances

              type Balances []Balance

                Balances type for sorting balances in rpc response.

                func (Balances) Len

                func (b Balances) Len() int

                func (Balances) Less

                func (b Balances) Less(i, j int) bool

                func (Balances) Swap

                func (b Balances) Swap(i, j int)

                type Block

                type Block struct {
                	Hash              util.Uint256  `json:"hash"`
                	Size              int           `json:"size"`
                	Version           uint32        `json:"version"`
                	NextBlockHash     *util.Uint256 `json:"nextblockhash,omitempty"`
                	PreviousBlockHash util.Uint256  `json:"previousblockhash"`
                	MerkleRoot        util.Uint256  `json:"merkleroot"`
                	Time              uint32        `json:"time"`
                	Index             uint32        `json:"index"`
                	Nonce             string        `json:"nonce"`
                	NextConsensus     util.Uint160  `json:"nextconsensus"`
                
                	Confirmations uint32 `json:"confirmations"`
                
                	Script transaction.Witness `json:"script"`
                
                	Tx []Tx `json:"tx"`
                }

                  Block wrapper used for the representation of block.Block / block.Base on the RPC Server.

                  func NewBlock

                  func NewBlock(b *block.Block, chain core.Blockchainer) Block

                    NewBlock creates a new Block wrapper.

                    type ContractState

                    type ContractState struct {
                    	Version     byte                      `json:"version"`
                    	ScriptHash  util.Uint160              `json:"hash"`
                    	Script      []byte                    `json:"script"`
                    	ParamList   []smartcontract.ParamType `json:"parameters"`
                    	ReturnType  smartcontract.ParamType   `json:"returntype"`
                    	Name        string                    `json:"name"`
                    	CodeVersion string                    `json:"code_version"`
                    	Author      string                    `json:"author"`
                    	Email       string                    `json:"email"`
                    	Description string                    `json:"description"`
                    	Properties  Properties                `json:"properties"`
                    }

                      ContractState wrapper used for the representation of state.Contract on the RPC Server.

                      func NewContractState

                      func NewContractState(c *state.Contract) ContractState

                        NewContractState creates a new Contract wrapper.

                        type GetPeers

                        type GetPeers struct {
                        	Unconnected Peers `json:"unconnected"`
                        	Connected   Peers `json:"connected"`
                        	Bad         Peers `json:"bad"`
                        }

                          GetPeers payload for outputting peers in `getpeers` RPC call.

                          func NewGetPeers

                          func NewGetPeers() GetPeers

                            NewGetPeers creates a new GetPeers structure.

                            func (*GetPeers) AddBad

                            func (g *GetPeers) AddBad(addrs []string)

                              AddBad adds a set of peers to the bad peers slice.

                              func (*GetPeers) AddConnected

                              func (g *GetPeers) AddConnected(addrs []string)

                                AddConnected adds a set of peers to the connected peers slice.

                                func (*GetPeers) AddUnconnected

                                func (g *GetPeers) AddUnconnected(addrs []string)

                                  AddUnconnected adds a set of peers to the unconnected peers slice.

                                  type Invoke

                                  type Invoke struct {
                                  	State       string `json:"state"`
                                  	GasConsumed string `json:"gas_consumed"`
                                  	Script      string `json:"script"`
                                  	Stack       *vm.Stack
                                  }

                                    Invoke represents code invocation result and is used by several RPC calls that invoke functions, scripts and generic bytecode.

                                    type Peer

                                    type Peer struct {
                                    	Address string `json:"address"`
                                    	Port    string `json:"port"`
                                    }

                                      Peer represents the peer.

                                      type Peers

                                      type Peers []Peer

                                        Peers represent a slice of peers.

                                        type Properties

                                        type Properties struct {
                                        	HasStorage       bool `json:"storage"`
                                        	HasDynamicInvoke bool `json:"dynamic_invoke"`
                                        	IsPayable        bool `json:"is_payable"`
                                        }

                                          Properties response wrapper.

                                          type TransactionOutput

                                          type TransactionOutput struct {
                                          	N       int         `json:"n"`
                                          	Asset   string      `json:"asset"`
                                          	Value   util.Fixed8 `json:"value"`
                                          	Address string      `json:"address"`
                                          }

                                            TransactionOutput is a wrapper to represent transaction's output.

                                            func NewTxOutput

                                            func NewTxOutput(out *transaction.Output) *TransactionOutput

                                              NewTxOutput converts out to a TransactionOutput.

                                              type TransactionOutputRaw

                                              type TransactionOutputRaw struct {
                                              	*transaction.Transaction
                                              	TxHash        util.Uint256 `json:"txid"`
                                              	Size          int          `json:"size"`
                                              	SysFee        util.Fixed8  `json:"sys_fee"`
                                              	NetFee        util.Fixed8  `json:"net_fee"`
                                              	Blockhash     util.Uint256 `json:"blockhash,omitempty"`
                                              	Confirmations int          `json:"confirmations,omitempty"`
                                              	Timestamp     uint32       `json:"blocktime,omitempty"`
                                              }

                                                TransactionOutputRaw is used as a wrapper to represents a Transaction.

                                                func NewTransactionOutputRaw

                                                func NewTransactionOutputRaw(tx *transaction.Transaction, header *block.Header, chain core.Blockchainer) TransactionOutputRaw

                                                  NewTransactionOutputRaw returns a new ransactionOutputRaw object.

                                                  type Tx

                                                  type Tx struct {
                                                  	TxID       util.Uint256            `json:"txid"`
                                                  	Size       int                     `json:"size"`
                                                  	Type       transaction.TXType      `json:"type"`
                                                  	Version    uint8                   `json:"version"`
                                                  	Attributes []transaction.Attribute `json:"attributes"`
                                                  	VIn        []transaction.Input     `json:"vin"`
                                                  	VOut       []transaction.Output    `json:"vout"`
                                                  	Scripts    []transaction.Witness   `json:"scripts"`
                                                  
                                                  	SysFee util.Fixed8 `json:"sys_fee"`
                                                  	NetFee util.Fixed8 `json:"net_fee"`
                                                  
                                                  	Nonce uint32 `json:"nonce,omitempty"`
                                                  }

                                                    Tx wrapper used for the representation of transaction on the RPC Server.

                                                    type UnspentBalanceInfo

                                                    type UnspentBalanceInfo struct {
                                                    	Unspents    []state.UnspentBalance `json:"unspent"`
                                                    	AssetHash   util.Uint256           `json:"asset_hash"`
                                                    	Asset       string                 `json:"asset"`
                                                    	AssetSymbol string                 `json:"asset_symbol"`
                                                    	Amount      util.Fixed8            `json:"amount"`
                                                    }

                                                      UnspentBalanceInfo wrapper is used to represent single unspent asset entry in `getunspents` output.

                                                      type Unspents

                                                      type Unspents struct {
                                                      	Balance []UnspentBalanceInfo `json:"balance"`
                                                      	Address string               `json:"address"`
                                                      }

                                                        Unspents wrapper is used to represent getunspents return result.

                                                        func NewUnspents

                                                        func NewUnspents(a *state.Account, chain core.Blockchainer, addr string) Unspents

                                                          NewUnspents creates a new Account wrapper using given Blockchainer.

                                                          type ValidateAddress

                                                          type ValidateAddress struct {
                                                          	Address interface{} `json:"address"`
                                                          	IsValid bool        `json:"isvalid"`
                                                          }

                                                            ValidateAddress represents result of the `validateaddress` call. Notice that Address is an interface{} here because server echoes back whatever address value user has sent to it, even if it's not a string.

                                                            type Version

                                                            type Version struct {
                                                            	Port      uint16 `json:"port"`
                                                            	Nonce     uint32 `json:"nonce"`
                                                            	UserAgent string `json:"useragent"`
                                                            }

                                                              Version model used for reporting server version info.