Documentation ¶
Index ¶
- type AccountApi
- type ActivateInviteArgs
- type ActivateInviteToRandAddrArgs
- type ActivateInviteToRandAddrResponse
- type Balance
- type BaseApi
- type BaseTxArgs
- type Block
- type BlockchainApi
- func (api *BlockchainApi) Block(hash common.Hash) *Block
- func (api *BlockchainApi) BlockAt(height uint64) *Block
- func (api *BlockchainApi) BurntCoins() []BurntCoins
- func (api *BlockchainApi) FeePerGas() *big.Int
- func (api *BlockchainApi) GetRawTx(args SendTxArgs) (hexutil.Bytes, error)
- func (api *BlockchainApi) LastBlock() *Block
- func (api *BlockchainApi) Mempool() []common.Hash
- func (api *BlockchainApi) PendingTransactions(args TransactionsArgs) Transactions
- func (api *BlockchainApi) SendRawTx(ctx context.Context, bytesTx hexutil.Bytes) (common.Hash, error)
- func (api *BlockchainApi) Syncing() Syncing
- func (api *BlockchainApi) Transaction(hash common.Hash) *Transaction
- func (api *BlockchainApi) Transactions(args TransactionsArgs) Transactions
- func (api *BlockchainApi) TxReceipt(hash common.Hash) *TxReceipt
- type BurnArgs
- type BurntCoins
- type CallArgs
- type CeremonyIntervals
- type ChangeProfileArgs
- type ChangeProfileResponse
- type ContractApi
- func (api *ContractApi) Call(ctx context.Context, args CallArgs) (common.Hash, error)
- func (api *ContractApi) Deploy(ctx context.Context, args DeployArgs) (common.Hash, error)
- func (api *ContractApi) EstimateCall(args CallArgs) (*TxReceipt, error)
- func (api *ContractApi) EstimateDeploy(args DeployArgs) (*TxReceipt, error)
- func (api *ContractApi) EstimateTerminate(args TerminateArgs) (*TxReceipt, error)
- func (api *ContractApi) Events(args EventsArgs) interface{}
- func (api *ContractApi) GetStake(contract common.Address) interface{}
- func (api *ContractApi) ReadData(contract common.Address, key string, format string) (interface{}, error)
- func (api *ContractApi) ReadonlyCall(args ReadonlyCallArgs) (interface{}, error)
- func (api *ContractApi) SubscribeToEvent(contract common.Address, event string) error
- func (api *ContractApi) Terminate(ctx context.Context, args TerminateArgs) (common.Hash, error)
- func (api *ContractApi) UnsubscribeFromEvent(contract common.Address, event string) error
- type DeployArgs
- type DnaApi
- func (api *DnaApi) ActivateInvite(ctx context.Context, args ActivateInviteArgs) (common.Hash, error)
- func (api *DnaApi) ActivateInviteToRandAddr(ctx context.Context, args ActivateInviteToRandAddrArgs) (ActivateInviteToRandAddrResponse, error)
- func (api *DnaApi) BecomeOffline(ctx context.Context, args BaseTxArgs) (common.Hash, error)
- func (api *DnaApi) BecomeOnline(ctx context.Context, args BaseTxArgs) (common.Hash, error)
- func (api *DnaApi) Burn(ctx context.Context, args BurnArgs) (common.Hash, error)
- func (api *DnaApi) CeremonyIntervals() CeremonyIntervals
- func (api *DnaApi) ChangeProfile(ctx context.Context, args ChangeProfileArgs) (ChangeProfileResponse, error)
- func (api *DnaApi) Epoch() Epoch
- func (api *DnaApi) ExportKey(password string) (string, error)
- func (api *DnaApi) GetBalance(address common.Address) Balance
- func (api *DnaApi) GetCoinbaseAddr() common.Address
- func (api *DnaApi) Identities() []Identity
- func (api *DnaApi) Identity(address *common.Address) Identity
- func (api *DnaApi) ImportKey(args ImportKeyArgs) error
- func (api *DnaApi) IsValidationReady() bool
- func (api *DnaApi) Profile(address *common.Address) (ProfileResponse, error)
- func (api *DnaApi) SendInvite(ctx context.Context, args SendInviteArgs) (Invite, error)
- func (api *DnaApi) SendTransaction(ctx context.Context, args SendTxArgs) (common.Hash, error)
- func (api *DnaApi) Sign(value string) hexutil.Bytes
- func (api *DnaApi) SignatureAddress(args SignatureAddressArgs) (common.Address, error)
- func (api *DnaApi) State() State
- func (api *DnaApi) Version() string
- func (api *DnaApi) WordsSeed() hexutil.Bytes
- type DynamicArg
- type DynamicArgs
- type EncryptionKeyArgs
- type Epoch
- type Event
- type EventsArgs
- type FlipAnswer
- type FlipApi
- func (api *FlipApi) Delete(ctx context.Context, hash string) (common.Hash, error)
- func (api *FlipApi) Get(hash string) (FlipResponse, error)
- func (api *FlipApi) GetKeys(addr common.Address, hash string) (FlipKeysResponse, error)
- func (api *FlipApi) GetRaw(hash string) (FlipResponse2, error)
- func (api *FlipApi) LongHashes(addr *common.Address) ([]FlipHashesResponse, error)
- func (api *FlipApi) PrivateEncryptionKeyCandidates(addr common.Address) ([]hexutil.Bytes, error)
- func (api *FlipApi) SendPrivateEncryptionKeysPackage(args EncryptionKeyArgs) error
- func (api *FlipApi) SendPublicEncryptionKey(args EncryptionKeyArgs) error
- func (api *FlipApi) ShortHashes(addr *common.Address) ([]FlipHashesResponse, error)
- func (api *FlipApi) Submit(args FlipSubmitArgs) (FlipSubmitResponse, error)
- func (api *FlipApi) SubmitLongAnswers(args SubmitAnswersArgs) (SubmitAnswersResponse, error)
- func (api *FlipApi) SubmitShortAnswers(args SubmitAnswersArgs) (SubmitAnswersResponse, error)
- func (api *FlipApi) Words(hash string) (FlipWordsResponse, error)
- type FlipHashesResponse
- type FlipKeysResponse
- type FlipResponse
- type FlipResponse2
- type FlipSubmitArgs
- type FlipSubmitResponse
- type FlipWords
- type FlipWordsResponse
- type Identity
- type ImportKeyArgs
- type Invite
- type IpfsApi
- type NetApi
- type Peer
- type ProfileResponse
- type ReadonlyCallArgs
- type SendInviteArgs
- type SendTxArgs
- type SignatureAddressArgs
- type State
- type SubmitAnswersArgs
- type SubmitAnswersResponse
- type Syncing
- type TerminateArgs
- type Transaction
- type Transactions
- type TransactionsArgs
- type TxReceipt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountApi ¶
type AccountApi struct {
// contains filtered or unexported fields
}
NetApi offers helper utils
func NewAccountApi ¶
func NewAccountApi(baseApi *BaseApi) *AccountApi
func (*AccountApi) Create ¶
func (api *AccountApi) Create(passPhrase string) (common.Address, error)
func (*AccountApi) List ¶
func (api *AccountApi) List() []common.Address
type ActivateInviteArgs ¶
type ActivateInviteArgs struct { Key string `json:"key"` To *common.Address `json:"to"` BaseTxArgs }
type ActivateInviteToRandAddrArgs ¶ added in v0.21.0
type ActivateInviteToRandAddrArgs struct { Key string `json:"key"` BaseTxArgs }
type ActivateInviteToRandAddrResponse ¶ added in v0.21.0
type BaseTxArgs ¶
type Block ¶
type Block struct { Coinbase common.Address `json:"coinbase"` Hash common.Hash `json:"hash"` ParentHash common.Hash `json:"parentHash"` Height uint64 `json:"height"` Time int64 `json:"timestamp"` Root common.Hash `json:"root"` // root of state tree IdentityRoot common.Hash `json:"identityRoot"` // root of approved identities tree IpfsHash *string `json:"ipfsCid"` // ipfs hash of block body Transactions []common.Hash `json:"transactions"` Flags []string `json:"flags"` IsEmpty bool `json:"isEmpty"` OfflineAddr *common.Address `json:"offlineAddress"` }
type BlockchainApi ¶
type BlockchainApi struct {
// contains filtered or unexported fields
}
func NewBlockchainApi ¶
func NewBlockchainApi(baseApi *BaseApi, bc *blockchain.Blockchain, ipfs ipfs.Proxy, pool *mempool.TxPool, d *protocol.Downloader, pm *protocol.IdenaGossipHandler) *BlockchainApi
func (*BlockchainApi) BlockAt ¶
func (api *BlockchainApi) BlockAt(height uint64) *Block
func (*BlockchainApi) BurntCoins ¶
func (api *BlockchainApi) BurntCoins() []BurntCoins
func (*BlockchainApi) FeePerGas ¶ added in v0.22.0
func (api *BlockchainApi) FeePerGas() *big.Int
func (*BlockchainApi) GetRawTx ¶
func (api *BlockchainApi) GetRawTx(args SendTxArgs) (hexutil.Bytes, error)
func (*BlockchainApi) LastBlock ¶
func (api *BlockchainApi) LastBlock() *Block
func (*BlockchainApi) Mempool ¶
func (api *BlockchainApi) Mempool() []common.Hash
func (*BlockchainApi) PendingTransactions ¶
func (api *BlockchainApi) PendingTransactions(args TransactionsArgs) Transactions
sorted by epoch \ nonce desc (the newest transactions are first)
func (*BlockchainApi) Syncing ¶
func (api *BlockchainApi) Syncing() Syncing
func (*BlockchainApi) Transaction ¶
func (api *BlockchainApi) Transaction(hash common.Hash) *Transaction
func (*BlockchainApi) Transactions ¶
func (api *BlockchainApi) Transactions(args TransactionsArgs) Transactions
type BurntCoins ¶
type CeremonyIntervals ¶
type ChangeProfileArgs ¶
type ChangeProfileResponse ¶
type ContractApi ¶ added in v0.22.0
type ContractApi struct {
// contains filtered or unexported fields
}
func NewContractApi ¶ added in v0.22.0
func NewContractApi(baseApi *BaseApi, bc *blockchain.Blockchain, deferredTxs *deferredtx.Job, subManager *subscriptions.Manager) *ContractApi
NewContractApi creates a new NetApi instance
func (*ContractApi) Deploy ¶ added in v0.22.0
func (api *ContractApi) Deploy(ctx context.Context, args DeployArgs) (common.Hash, error)
func (*ContractApi) EstimateCall ¶ added in v0.22.0
func (api *ContractApi) EstimateCall(args CallArgs) (*TxReceipt, error)
func (*ContractApi) EstimateDeploy ¶ added in v0.22.0
func (api *ContractApi) EstimateDeploy(args DeployArgs) (*TxReceipt, error)
func (*ContractApi) EstimateTerminate ¶ added in v0.22.0
func (api *ContractApi) EstimateTerminate(args TerminateArgs) (*TxReceipt, error)
func (*ContractApi) Events ¶ added in v0.22.0
func (api *ContractApi) Events(args EventsArgs) interface{}
func (*ContractApi) GetStake ¶ added in v0.22.0
func (api *ContractApi) GetStake(contract common.Address) interface{}
func (*ContractApi) ReadonlyCall ¶ added in v0.22.0
func (api *ContractApi) ReadonlyCall(args ReadonlyCallArgs) (interface{}, error)
func (*ContractApi) SubscribeToEvent ¶ added in v0.22.0
func (api *ContractApi) SubscribeToEvent(contract common.Address, event string) error
func (*ContractApi) Terminate ¶ added in v0.22.0
func (api *ContractApi) Terminate(ctx context.Context, args TerminateArgs) (common.Hash, error)
func (*ContractApi) UnsubscribeFromEvent ¶ added in v0.22.0
func (api *ContractApi) UnsubscribeFromEvent(contract common.Address, event string) error
type DeployArgs ¶ added in v0.22.0
type DnaApi ¶
type DnaApi struct {
// contains filtered or unexported fields
}
func NewDnaApi ¶
func NewDnaApi(baseApi *BaseApi, bc *blockchain.Blockchain, ceremony *ceremony.ValidationCeremony, appVersion string, profileManager *profile.Manager) *DnaApi
func (*DnaApi) ActivateInvite ¶
func (*DnaApi) ActivateInviteToRandAddr ¶ added in v0.21.0
func (api *DnaApi) ActivateInviteToRandAddr(ctx context.Context, args ActivateInviteToRandAddrArgs) (ActivateInviteToRandAddrResponse, error)
func (*DnaApi) BecomeOffline ¶
func (*DnaApi) BecomeOnline ¶
func (*DnaApi) CeremonyIntervals ¶
func (api *DnaApi) CeremonyIntervals() CeremonyIntervals
func (*DnaApi) ChangeProfile ¶
func (api *DnaApi) ChangeProfile(ctx context.Context, args ChangeProfileArgs) (ChangeProfileResponse, error)
func (*DnaApi) GetCoinbaseAddr ¶
func (*DnaApi) Identities ¶
func (*DnaApi) ImportKey ¶
func (api *DnaApi) ImportKey(args ImportKeyArgs) error
func (*DnaApi) IsValidationReady ¶ added in v0.23.1
func (*DnaApi) Profile ¶
func (api *DnaApi) Profile(address *common.Address) (ProfileResponse, error)
func (*DnaApi) SendInvite ¶
func (*DnaApi) SendTransaction ¶
func (*DnaApi) SignatureAddress ¶
func (api *DnaApi) SignatureAddress(args SignatureAddressArgs) (common.Address, error)
type DynamicArg ¶ added in v0.22.0
type DynamicArg struct { Index int `json:"index"` Format string `json:"format"` Value string `json:"value"` }
func (DynamicArg) ToBytes ¶ added in v0.22.0
func (a DynamicArg) ToBytes() []byte
type DynamicArgs ¶ added in v0.22.0
type DynamicArgs []*DynamicArg
func (DynamicArgs) ToSlice ¶ added in v0.22.0
func (d DynamicArgs) ToSlice() [][]byte
type EncryptionKeyArgs ¶ added in v0.23.1
type EventsArgs ¶ added in v0.22.0
type FlipAnswer ¶
type FlipApi ¶
type FlipApi struct {
// contains filtered or unexported fields
}
func NewFlipApi ¶
func NewFlipApi(baseApi *BaseApi, fp *flip.Flipper, ipfsProxy ipfs.Proxy, ceremony *ceremony.ValidationCeremony) *FlipApi
NewFlipApi creates a new FlipApi instance
func (*FlipApi) Get ¶
func (api *FlipApi) Get(hash string) (FlipResponse, error)
Works only for coinbase address
func (*FlipApi) GetRaw ¶ added in v0.21.4
func (api *FlipApi) GetRaw(hash string) (FlipResponse2, error)
func (*FlipApi) LongHashes ¶
func (api *FlipApi) LongHashes(addr *common.Address) ([]FlipHashesResponse, error)
func (*FlipApi) PrivateEncryptionKeyCandidates ¶ added in v0.23.1
func (*FlipApi) SendPrivateEncryptionKeysPackage ¶ added in v0.23.1
func (api *FlipApi) SendPrivateEncryptionKeysPackage(args EncryptionKeyArgs) error
func (*FlipApi) SendPublicEncryptionKey ¶ added in v0.23.1
func (api *FlipApi) SendPublicEncryptionKey(args EncryptionKeyArgs) error
func (*FlipApi) ShortHashes ¶
func (api *FlipApi) ShortHashes(addr *common.Address) ([]FlipHashesResponse, error)
func (*FlipApi) Submit ¶
func (api *FlipApi) Submit(args FlipSubmitArgs) (FlipSubmitResponse, error)
func (*FlipApi) SubmitLongAnswers ¶
func (api *FlipApi) SubmitLongAnswers(args SubmitAnswersArgs) (SubmitAnswersResponse, error)
func (*FlipApi) SubmitShortAnswers ¶
func (api *FlipApi) SubmitShortAnswers(args SubmitAnswersArgs) (SubmitAnswersResponse, error)
type FlipHashesResponse ¶
type FlipKeysResponse ¶ added in v0.21.4
type FlipResponse ¶
type FlipResponse2 ¶ added in v0.21.4
type FlipSubmitArgs ¶
type FlipSubmitResponse ¶
type FlipWordsResponse ¶
type FlipWordsResponse struct {
Words [2]int `json:"words"`
}
type Identity ¶
type Identity struct { Address common.Address `json:"address"` ProfileHash string `json:"profileHash"` Stake decimal.Decimal `json:"stake"` Invites uint8 `json:"invites"` Age uint16 `json:"age"` State string `json:"state"` PubKey string `json:"pubkey"` RequiredFlips uint8 `json:"requiredFlips"` AvailableFlips uint8 `json:"availableFlips"` FlipKeyWordPairs []FlipWords `json:"flipKeyWordPairs"` MadeFlips uint8 `json:"madeFlips"` QualifiedFlips uint32 `json:"totalQualifiedFlips"` ShortFlipPoints float32 `json:"totalShortFlipPoints"` Flips []string `json:"flips"` Online bool `json:"online"` Generation uint32 `json:"generation"` Code hexutil.Bytes `json:"code"` Invitees []state.TxAddr `json:"invitees"` Penalty decimal.Decimal `json:"penalty"` LastValidationFlags []string `json:"lastValidationFlags"` }
type ImportKeyArgs ¶
type IpfsApi ¶ added in v0.22.0
type IpfsApi struct {
// contains filtered or unexported fields
}
func NewIpfsApi ¶ added in v0.22.0
NewNetApi creates a new NetApi instance
type NetApi ¶
type NetApi struct {
// contains filtered or unexported fields
}
NetApi offers helper utils
func NewNetApi ¶
func NewNetApi(pm *protocol.IdenaGossipHandler, ipfsProxy ipfs.Proxy) *NetApi
NewNetApi creates a new NetApi instance
func (*NetApi) IpfsAddress ¶
func (*NetApi) PeersCount ¶
type ProfileResponse ¶
type ReadonlyCallArgs ¶ added in v0.22.0
type ReadonlyCallArgs struct { Contract common.Address `json:"contract"` Method string `json:"method"` Format string `json:"format"` Args DynamicArgs `json:"args"` }
type SendInviteArgs ¶
type SendInviteArgs struct { To common.Address `json:"to"` Amount decimal.Decimal `json:"amount"` BaseTxArgs }
SendInviteArgs represents the arguments to send invite
type SendTxArgs ¶
type SendTxArgs struct { Type types.TxType `json:"type"` From common.Address `json:"from"` To *common.Address `json:"to"` Amount decimal.Decimal `json:"amount"` MaxFee decimal.Decimal `json:"maxFee"` Payload *hexutil.Bytes `json:"payload"` Tips decimal.Decimal `json:"tips"` UseProto bool `json:"useProto"` BaseTxArgs }
SendTxArgs represents the arguments to submit a new transaction into the transaction pool.
type SignatureAddressArgs ¶
type SubmitAnswersArgs ¶
type SubmitAnswersArgs struct {
Answers []FlipAnswer `json:"answers"`
}
type SubmitAnswersResponse ¶
type TerminateArgs ¶ added in v0.22.0
type Transaction ¶
type Transaction struct { Hash common.Hash `json:"hash"` Type string `json:"type"` From common.Address `json:"from"` To *common.Address `json:"to"` Amount decimal.Decimal `json:"amount"` Tips decimal.Decimal `json:"tips"` MaxFee decimal.Decimal `json:"maxFee"` Nonce uint32 `json:"nonce"` Epoch uint16 `json:"epoch"` Payload hexutil.Bytes `json:"payload"` BlockHash common.Hash `json:"blockHash"` UsedFee decimal.Decimal `json:"usedFee"` Timestamp int64 `json:"timestamp"` }
type Transactions ¶
type Transactions struct { Transactions []*Transaction `json:"transactions"` Token *hexutil.Bytes `json:"token"` }
type TransactionsArgs ¶
Click to show internal directories.
Click to hide internal directories.