Documentation
¶
Index ¶
- Variables
- func DecodePublicKey(pubKey string) (*secp256k1.PublicKey, error)
- func GetPublicKeyString(pubKey *secp256k1.PublicKey) *string
- func GphBase58CheckDecode(input string) ([]byte, [1]byte, error)
- func SignDigest(digest []byte, wif *string) ([]byte, error)
- func WriteUvarint(w io.Writer, x uint64) error
- func WriteVarint(w io.Writer, x int64) error
- type AccountData
- type Authority
- type Auths
- type Block
- type CustomTime
- type HiveOperation
- type HiveRpcNode
- func (h *HiveRpcNode) Broadcast(ops []HiveOperation, wif *string) (string, error)
- func (h *HiveRpcNode) BroadcastJson(reqAuth []string, reqPostAuth []string, id string, cj string, wif *string) (string, error)
- func (h *HiveRpcNode) ClaimRewards(Account string, wif *string) (string, error)
- func (h *HiveRpcNode) GetAccount(accountNames []string) ([]AccountData, error)
- func (h *HiveRpcNode) GetBlock(blockNum int) (Block, error)
- func (h *HiveRpcNode) GetBlockRange(startBlock int, count int) (<-chan Block, error)
- func (h *HiveRpcNode) GetDynamicGlobalProps() ([]byte, error)
- func (h *HiveRpcNode) GetTransaction(txId string, includeReversible bool) ([]byte, error)
- func (h *HiveRpcNode) StreamBlocks() (<-chan Block, error)
- func (h *HiveRpcNode) Transfer(from string, to string, amount string, memo string, wif *string) (string, error)
- func (h *HiveRpcNode) UpdateAccount(account string, owner *Auths, active *Auths, posting *Auths, ...) (string, error)
- func (h *HiveRpcNode) VotePost(voter string, author string, permlink string, weight int, wif *string) (string, error)
- type KeyPair
- type Operation
- type RC
- type Transaction
- type TransactionQueryParams
Constants ¶
This section is empty.
Variables ¶
View Source
var OperationType = operationTypes{
Vote: "vote_operation",
Comment: "comment_operation",
Transfer: "transfer_operation",
TransferToVesting: "transfer_to_vesting_operation",
WithdrawVesting: "withdraw_vesting_operation",
LimitOrderCreate: "limit_order_create_operation",
LimitOrderCancel: "limit_order_cancel_operation",
FeedPublish: "feed_publish_operation",
Convert: "convert_operation",
AccountCreate: "account_create_operation",
AccountUpdate: "account_update_operation",
WitnessUpdate: "witness_update_operation",
AccountWitnessVote: "account_witness_vote_operation",
AccountWitnessProxy: "account_witness_proxy_operation",
Pow: "pow_operation",
Custom: "custom_operation",
ReportOverProduction: "report_over_production_operation",
DeleteComment: "delete_comment_operation",
CustomJson: "custom_json_operation",
CommentOptions: "comment_options_operation",
SetWithdrawVestingRoute: "set_withdraw_vesting_route_operation",
LimitOrderCreate2: "limit_order_create2_operation",
ClaimAccount: "claim_account_operation",
CreateClaimedAccount: "create_claimed_account_operation",
RequestAccountRecovery: "request_account_recovery_operation",
RecoverAccount: "recover_account_operation",
ChangeRecoveryAccount: "change_recovery_account_operation",
EscrowTransfer: "escrow_transfer_operation",
EscrowDispute: "escrow_dispute_operation",
EscrowRelease: "escrow_release_operation",
Pow2: "pow2_operation",
EscrowApprove: "escrow_approve_operation",
TransferToSavings: "transfer_to_savings_operation",
TransferFromSavings: "transfer_from_savings_operation",
CancelTransferFromSavings: "cancel_transfer_from_savings_operation",
CustomBinary: "custom_binary_operation",
DeclineVotingRights: "decline_voting_rights_operation",
ResetAccount: "reset_account_operation",
SetResetAccount: "set_reset_account_operation",
ClaimRewardBalance: "claim_reward_balance_operation",
DelegateVestingShares: "delegate_vesting_shares_operation",
AccountCreateWithDelegation: "account_create_with_delegation_operation",
WitnessSetProperties: "witness_set_properties_operation",
AccountUpdate2: "account_update2_operation",
CreateProposal: "create_proposal_operation",
UpdateProposalVotes: "update_proposal_votes_operation",
RemoveProposal: "remove_proposal_operation",
UpdateProposal: "update_proposal_operation",
CollateralizedConvert: "collateralized_convert_operation",
RecurrentTransfer: "recurrent_transfer_operation",
}
View Source
var PublicKeyPrefix = "STM"
Functions ¶
func DecodePublicKey ¶
Decodes a base58 Hive public key to secp256k1 public key
func GetPublicKeyString ¶
func WriteUvarint ¶
todo: UNTESTED encodes a uint64 into a variable-length byte slice and writes it to w
Types ¶
type AccountData ¶
type AccountData struct {
ID int64 `json:"id"`
Name string `json:"name"`
Owner Authority `json:"owner"`
Active Authority `json:"active"`
Posting Authority `json:"posting"`
MemoKey string `json:"memo_key"`
JSONMetadata string `json:"json_metadata"`
Proxy string `json:"proxy"`
LastOwnerUpdate CustomTime `json:"last_owner_update"`
LastAccountUpdate CustomTime `json:"last_account_update"`
Created CustomTime `json:"created"`
Mined bool `json:"mined"`
RecoveryAccount string `json:"recovery_account"`
LastAccountRecovery CustomTime `json:"last_account_recovery"`
CommentCount int32 `json:"comment_count"`
LifetimeVoteCount int32 `json:"lifetime_vote_count"`
PostCount int32 `json:"post_count"`
CanVote bool `json:"can_vote"`
VotingPower int16 `json:"voting_power"`
LastVoteTime CustomTime `json:"last_vote_time"`
Balance string `json:"balance"`
SavingsBalance string `json:"savings_balance"`
HbdBalance string `json:"hbd_balance"`
HbdSeconds string `json:"hbd_seconds"`
HbdSecondsLastUpdate CustomTime `json:"hbd_seconds_last_update"`
HbdLastInterestPayment CustomTime `json:"hbd_last_interest_payment"`
SavingsHbdBalance string `json:"savings_hbd_balance"`
SavingsHbdSeconds string `json:"savings_hbd_seconds"`
SavingsHbdLastUpdate CustomTime `json:"savings_hbd_last_update"`
SavingsHbdLastInterestPayment CustomTime `json:"savings_hbd_last_interest_payment"`
SavingsWithdrawRequests int32 `json:"savings_withdraw_requests"`
RewardHbdBalance string `json:"reward_hbd_balance"`
RewardHiveBalance string `json:"reward_hive_balance"`
RewardVestingBalance string `json:"reward_vesting_balance"`
RewardVestingHive string `json:"reward_vesting_hive"`
VestingWithdrawRate string `json:"vesting_withdraw_rate"`
NextVestingWithdrawal CustomTime `json:"next_vesting_withdrawal"`
Withdrawn int64 `json:"withdrawn"`
ToWithdraw int64 `json:"to_withdraw"`
WithdrawRoutes int32 `json:"withdraw_routes"`
CurationRewards int64 `json:"curation_rewards"`
PostingRewards int64 `json:"posting_rewards"`
ProxiedVsfVotes []int64 `json:"proxied_vsf_votes"`
WitnessesVotedFor int32 `json:"witnesses_voted_for"`
LastPost CustomTime `json:"last_post"`
LastRootPost CustomTime `json:"last_root_post"`
AverageBandwidth string `json:"average_bandwidth"`
LifetimeBandwidth string `json:"lifetime_bandwidth"`
LastBandwidthUpdate CustomTime `json:"last_bandwidth_update"`
PostVotingPower string `json:"post_voting_power"`
Reputation int64 `json:"reputation"`
PostBandwidth int64 `json:"post_bandwidth"`
PendingClaimedAccounts int32 `json:"pending_claimed_accounts"`
PendingTransfers int32 `json:"pending_transfers"`
PreviousOwnerUpdate CustomTime `json:"previous_owner_update"`
TransferHistory []interface{} `json:"transfer_history"`
MarketHistory []interface{} `json:"market_history"`
PostHistory []interface{} `json:"post_history"`
VoteHistory []interface{} `json:"vote_history"`
OtherHistory []interface{} `json:"other_history"`
WitnessVotes []string `json:"witness_votes"`
TagsUsage []interface{} `json:"tags_usage"`
GuestBloggers []interface{} `json:"guest_bloggers"`
DelayedVotes []interface{} `json:"delayed_votes"`
VotingManabar RC `json:"voting_manabar"`
DownvoteManabar RC `json:"downvote_manabar"`
GovernanceVoteExpirationTs CustomTime `json:"governance_vote_expiration_ts"`
PostingJSONMetadata string `json:"posting_json_metadata"`
}
type Authority ¶
type Authority struct {
AccountAuths [][]interface{} `json:"account_auths"`
KeyAuths [][]interface{} `json:"key_auths"`
WeightThreshold int `json:"weight_threshold"`
}
type Auths ¶
type Auths struct {
WeightThreshold int `json:"weight_threshold"`
AccountAuths [][2]interface{} `json:"account_auths"` // tuple (string, int)
KeyAuths [][2]interface{} `json:"key_auths"` // tuple (string, int)
}
type Block ¶
type Block struct {
BlockNumber int
BlockID string `json:"block_id"`
Previous string `json:"previous"`
Timestamp string `json:"timestamp"`
Witness string `json:"witness"`
TransactionMerkleRoot string `json:"transaction_merkle_root"`
Transactions []Transaction `json:"transactions"`
Extensions []interface{} `json:"extensions"`
SigningKey string `json:"signing_key"`
TransactionIds []string `json:"transaction_ids"`
WitnessSignature string `json:"witness_signature"`
}
type CustomTime ¶
func (CustomTime) ToTime ¶
func (ct CustomTime) ToTime() time.Time
func (*CustomTime) UnmarshalJSON ¶
func (ct *CustomTime) UnmarshalJSON(b []byte) error
type HiveOperation ¶
type HiveRpcNode ¶
type HiveRpcNode struct {
MaxConn int
MaxBatch int
NoBroadcast bool
// contains filtered or unexported fields
}
func NewHiveRpc ¶
func NewHiveRpc(addr string) *HiveRpcNode
func NewHiveRpcWithOpts ¶
func NewHiveRpcWithOpts(addr string, maxConn int, maxBatch int) *HiveRpcNode
func (*HiveRpcNode) Broadcast ¶
func (h *HiveRpcNode) Broadcast(ops []HiveOperation, wif *string) (string, error)
func (*HiveRpcNode) BroadcastJson ¶
func (*HiveRpcNode) ClaimRewards ¶
func (h *HiveRpcNode) ClaimRewards(Account string, wif *string) (string, error)
func (*HiveRpcNode) GetAccount ¶
func (h *HiveRpcNode) GetAccount(accountNames []string) ([]AccountData, error)
func (*HiveRpcNode) GetBlockRange ¶
func (h *HiveRpcNode) GetBlockRange(startBlock int, count int) (<-chan Block, error)
func (*HiveRpcNode) GetDynamicGlobalProps ¶
func (h *HiveRpcNode) GetDynamicGlobalProps() ([]byte, error)
func (*HiveRpcNode) GetTransaction ¶
func (h *HiveRpcNode) GetTransaction(txId string, includeReversible bool) ([]byte, error)
func (*HiveRpcNode) StreamBlocks ¶
func (h *HiveRpcNode) StreamBlocks() (<-chan Block, error)
func (*HiveRpcNode) UpdateAccount ¶
type KeyPair ¶
type KeyPair struct {
PrivateKey *secp256k1.PrivateKey
PublicKey *secp256k1.PublicKey
}
func KeyPairFromWif ¶
Gets a KeyPair from a given WIF String
func (*KeyPair) GetPublicKeyString ¶
type Transaction ¶
type Transaction struct {
Expiration string `json:"expiration"`
Extensions []interface{} `json:"extensions"`
Operations []Operation `json:"operations"`
RefBlockNum uint16 `json:"ref_block_num"`
RefBlockPrefix uint32 `json:"ref_block_prefix"`
Signatures []string `json:"signatures"`
RequiredAuths []string `json:"required_auths,omitempty"`
RequiredPostingAuths []string `json:"required_posting_auths,omitempty"`
}
type TransactionQueryParams ¶
Click to show internal directories.
Click to hide internal directories.