Documentation ¶
Index ¶
- Variables
- func CreatePrivateKey(user, role, password string) string
- func CreatePublicKey(prefix, privatekey string) string
- func Decrypt(key []byte, text string) (string, error)
- func EncodeWallet(password string, wallet_data *WalletData) (string, error)
- func Encrypt(key []byte, text string) (string, error)
- func HasElem(s interface{}, elem interface{}) bool
- func JSONOpString(v []types.Operation) (string, error)
- func JSONTrxString(v *transactions.SignedTransaction) (string, error)
- func Pad(src []byte) []byte
- func RandStringBytes(n int) (string, error)
- func SaveWalletFile(wallet_path string, wallet_filename string, password string, ...) error
- func SetAsset(amount float64, symbol string) *types.Asset
- func Unpad(src []byte) ([]byte, error)
- func ValidateAmount(amount string) bool
- func ValidateFee(fee string, minFee float64) bool
- func ValidateNameAccount(name string) error
- func ValidateNftSymbol(symbol string) error
- type BResp
- type Client
- func (client *Client) AccountCreate(creator, newAccountName, publicKey, fee string) (*OperResp, error)
- func (client *Client) AccountCreateWS(creator, newAccountName, password, fee string) (*OperResp, error)
- func (client *Client) AccountSupernodeUnvote(username, supernodeName, fee string) (*OperResp, error)
- func (client *Client) AccountSupernodeVote(username, supernodeName, fee string, votes int64) (*OperResp, error)
- func (client *Client) AccountUpdate(account, publicKey, fee string) (*OperResp, error)
- func (client *Client) AddAuthorizedIssuingAccounts(fromName, scid, symbol, fee string, issuingAccounts []string) (*OperResp, error)
- func (client *Client) AddProperty(fromName, scid, symbol, propertyName, propertyType, fee string, ...) (*OperResp, error)
- func (client *Client) BurnNFT(fromName, scid, fee string, nfts []api.NFTTransferRequest) (*OperResp, error)
- func (client *Client) Close() error
- func (client *Client) CommitScb(scid, committer, supernode, content, fee string) (*OperResp, error)
- func (client *Client) CreateMultiSigAccount(creator, newAccountName, fee string, accountOwners []string, ...) (*OperResp, error)
- func (client *Client) CreateNFT(fromName, scid, name, symbol, maxSupply, fee string, ...) (*OperResp, error)
- func (client *Client) CreateToken(creator, controlAcc, tokenName string, decimals uint8, maxSupply uint64) (*OperResp, error)
- func (client *Client) CreateTrx(trxOps []types.Operation, extension string) (*transactions.SignedTransaction, error)
- func (client *Client) CreateTrxTransfer(fromName, toName, memo, amount, fee string, extension string) (*transactions.SignedTransaction, error)
- func (client *Client) GenKeys(newAccountName string) (*WalletData, error)
- func (client *Client) GetAccount(account string) (*api.AccountInfo, error)
- func (client *Client) GetActiveSupernodes() (*[]string, error)
- func (client *Client) GetBalance(account, tokenName string, decimals uint8) (*string, error)
- func (client *Client) GetBlock(blockNum uint32) (*api.Block, error)
- func (client *Client) GetHeadBlockNum() (uint32, error)
- func (client *Client) GetKeyReferences(publicKey string) (*[][]string, error)
- func (client *Client) GetLatestNFTBlock() (*api.NFTBlock, error)
- func (client *Client) GetNFTBalance(account, symbol string, limit, offset uint32) (*api.NFTInstanceList, error)
- func (client *Client) GetNFTBalanceOfAccount(account string, limit, offset uint32) (map[string]api.NFTInstanceList, error)
- func (client *Client) GetNFTBlock(blockNum uint32) (*api.NFTBlock, error)
- func (client *Client) GetNFTInstances(symbol string, limit, offset uint32) (*api.NFTInstanceList, error)
- func (client *Client) GetNFTTransaction(trxid string) (*api.NFTTransaction, error)
- func (client *Client) GetNFTs(symbol string, limit, offset uint32) (*api.NFTList, error)
- func (client *Client) GetPrivateKey() string
- func (client *Client) GetPublicKey() string
- func (client *Client) GetSigningKeysOwner() ([][]byte, error)
- func (client *Client) GetSupernodeByAccount(account string) (*api.SupernodeInfo, error)
- func (client *Client) GetSupernodeVoted(account string) (*api.SupernodeVoteList, error)
- func (client *Client) GetToken(name string) (*api.TokenInfo, error)
- func (client *Client) GetTransaction(trx string) (*api.TransactionResponse, error)
- func (client *Client) GetTrx(strx []types.Operation, extension string) (*types.Transaction, error)
- func (client *Client) ImportKey(wif_key, name string) bool
- func (client *Client) IssueNFT(fromName, scid, symbol, to, fee string) (*OperResp, error)
- func (client *Client) IssueWithProperties(fromName, scid, symbol, to, fee string, properties interface{}) (*OperResp, error)
- func (client *Client) ListAccounts(lowerBound string, limit uint32) (*[]string, error)
- func (client *Client) ListSupernodes(lowerBound string, limit uint32) (*[]string, error)
- func (client *Client) ListTokens() (*api.TokenList, error)
- func (client *Client) LoadWallet(wallet_filename string) bool
- func (client *Client) MultiOp(trx []types.Operation, extension string) (*OperResp, error)
- func (client *Client) MultipleIssueNFT(fromName, scid, fee string, instances []api.Instance) (*OperResp, error)
- func (client *Client) RemoveAuthorizedIssuingAccounts(fromName, scid, symbol, fee string, issuingAccounts []string) (*OperResp, error)
- func (client *Client) SendTrx(strx []types.Operation, extension string) (*BResp, error)
- func (client *Client) SendTrxMultiSig(tx *transactions.SignedTransaction) (*BResp, error)
- func (client *Client) SetKeys(keys *Keys)
- func (client *Client) SetKeysFromEncodeWallet(wallet_json string, password string) error
- func (client *Client) SetKeysFromFileWallet(pathFileWallet string, password string) error
- func (client *Client) SetPassword(password string) error
- func (client *Client) SetProperties(fromName, scid, symbol, fee string, nfts []api.NFTProperty) (*OperResp, error)
- func (client *Client) SignTrx(tx *transactions.SignedTransaction) (*transactions.SignedTransaction, error)
- func (client *Client) SignTrxMulti(tx *transactions.SignedTransaction) ([]string, error)
- func (client *Client) SigningKeys(trx types.Operation) ([][]byte, error)
- func (client *Client) SupernodeUpdate(owner, blocksigningkey, fee string) (*OperResp, error)
- func (client *Client) Transfer(fromName, toName, memo, amount, fee string) (*OperResp, error)
- func (client *Client) TransferEx(fromName, toName, memo, amount, fee string, extension string) (*OperResp, error)
- func (client *Client) TransferNFT(fromName, scid, to, fee string, nfts []api.NFTTransferRequest) (*OperResp, error)
- func (client *Client) TransferToVesting(from, to, amount, fee string) (*OperResp, error)
- func (client *Client) Unlock(password string) error
- func (client *Client) UpdateMetadata(fromName, scid, symbol, url, image, fee string) (*OperResp, error)
- func (client *Client) UpdateMultiSigAccount(account, fee string, accountOwners []string, keyOwners []string, ...) (*OperResp, error)
- func (client *Client) UpdateName(fromName, scid, symbol, name, fee string) (*OperResp, error)
- func (client *Client) UpdateOrgName(fromName, scid, symbol, orgName, fee string) (*OperResp, error)
- func (client *Client) UpdatePropertyDefinition(...) (*OperResp, error)
- func (client *Client) WithdrawVesting(account, vshares, fee string) (*OperResp, error)
- type Keys
- type OperResp
- type PlainKeys
- type Wallet
- type WalletData
Constants ¶
This section is empty.
Variables ¶
var ( Keys_ = make(map[string]string) Checksum_ = make([]byte, sha512.Size) Wallet_ Wallet Locked = true WalletName_ = "wallet.json" )
var (
ErrInitializeTransport = errors.New("Failed to initialize transport.")
)
var ( //OpTypeKey include a description of the operation and the key needed to sign it OpTypeKey = make(map[types.OpType][]string) )
var RefBlockMap = make(map[time.Time]uint32)
Functions ¶
func CreatePrivateKey ¶
CreatePrivateKey generates a private key based on the specified parameters.
func CreatePublicKey ¶
CreatePublicKey generates a public key based on the prefix and the private key.
func EncodeWallet ¶ added in v0.0.3
func EncodeWallet(password string, wallet_data *WalletData) (string, error)
func JSONOpString ¶
JSONOpString generate Operations to String
func JSONTrxString ¶
func JSONTrxString(v *transactions.SignedTransaction) (string, error)
JSONTrxString generate Trx to String
func RandStringBytes ¶
func SaveWalletFile ¶
func SaveWalletFile(wallet_path string, wallet_filename string, password string, wallet_data *WalletData) error
func ValidateAmount ¶
func ValidateFee ¶
func ValidateNameAccount ¶
func ValidateNftSymbol ¶ added in v1.0.2
Types ¶
type Client ¶
type Client struct { AsyncProtocol bool // Database represents database_api. API *api.API // Current private keys for operations CurrentKeys *Keys // contains filtered or unexported fields }
Client can be used to access BEOWULF remote APIs. There is a public field for every BEOWULF API available,
func NewClient ¶
NewClient creates a new RPC client that use the given CallCloser internally. Initialize only server present API. Absent API initialized as nil value.
func (*Client) AccountCreate ¶
func (*Client) AccountCreateWS ¶
func (*Client) AccountSupernodeUnvote ¶
func (client *Client) AccountSupernodeUnvote(username, supernodeName, fee string) (*OperResp, error)
Unvote
func (*Client) AccountSupernodeVote ¶
func (client *Client) AccountSupernodeVote(username, supernodeName, fee string, votes int64) (*OperResp, error)
AccountSupernodeVote of voting for the delegate.
func (*Client) AccountUpdate ¶
AccountUpdate update public key for account
func (*Client) AddAuthorizedIssuingAccounts ¶ added in v1.0.2
func (*Client) AddProperty ¶ added in v1.0.2
func (*Client) Close ¶
Close should be used to close the client when no longer needed. It simply calls Close() on the underlying CallCloser.
func (*Client) CreateMultiSigAccount ¶
func (client *Client) CreateMultiSigAccount(creator, newAccountName, fee string, accountOwners []string, keyOwners []string, threshold uint32) (*OperResp, error)
CreateMultiSigAccount creating an account shared among many users in systems
func (*Client) CreateNFT ¶ added in v1.0.2
func (client *Client) CreateNFT(fromName, scid, name, symbol, maxSupply, fee string, authorizedIssuingAccounts []string) (*OperResp, error)
Create NFT
func (*Client) CreateToken ¶
func (*Client) CreateTrx ¶
func (client *Client) CreateTrx(trxOps []types.Operation, extension string) (*transactions.SignedTransaction, error)
func (*Client) CreateTrxTransfer ¶
func (client *Client) CreateTrxTransfer(fromName, toName, memo, amount, fee string, extension string) (*transactions.SignedTransaction, error)
func (*Client) GenKeys ¶
func (client *Client) GenKeys(newAccountName string) (*WalletData, error)
AccountCreate creating a user in systems
func (*Client) GetAccount ¶
func (client *Client) GetAccount(account string) (*api.AccountInfo, error)
func (*Client) GetActiveSupernodes ¶
func (*Client) GetBalance ¶
func (*Client) GetHeadBlockNum ¶
Get HeadBlockNumber from mem before getting from Blockchain
func (*Client) GetKeyReferences ¶
func (*Client) GetLatestNFTBlock ¶ added in v1.0.2
func (*Client) GetNFTBalance ¶ added in v1.0.2
func (*Client) GetNFTBalanceOfAccount ¶ added in v1.0.2
func (*Client) GetNFTBlock ¶ added in v1.0.2
func (*Client) GetNFTInstances ¶ added in v1.0.2
func (*Client) GetNFTTransaction ¶ added in v1.0.2
func (client *Client) GetNFTTransaction(trxid string) (*api.NFTTransaction, error)
func (*Client) GetPrivateKey ¶
func (*Client) GetPublicKey ¶
func (*Client) GetSigningKeysOwner ¶
func (*Client) GetSupernodeByAccount ¶
func (client *Client) GetSupernodeByAccount(account string) (*api.SupernodeInfo, error)
func (*Client) GetSupernodeVoted ¶
func (client *Client) GetSupernodeVoted(account string) (*api.SupernodeVoteList, error)
func (*Client) GetTransaction ¶
func (client *Client) GetTransaction(trx string) (*api.TransactionResponse, error)
func (*Client) IssueWithProperties ¶ added in v1.0.2
func (*Client) ListAccounts ¶
func (*Client) ListSupernodes ¶
func (*Client) LoadWallet ¶
func (*Client) MultipleIssueNFT ¶ added in v1.0.2
func (*Client) RemoveAuthorizedIssuingAccounts ¶ added in v1.0.2
func (*Client) SendTrxMultiSig ¶
func (client *Client) SendTrxMultiSig(tx *transactions.SignedTransaction) (*BResp, error)
func (*Client) SetKeysFromEncodeWallet ¶ added in v0.0.3
func (*Client) SetKeysFromFileWallet ¶
func (*Client) SetPassword ¶
func (*Client) SetProperties ¶ added in v1.0.2
func (*Client) SignTrx ¶
func (client *Client) SignTrx(tx *transactions.SignedTransaction) (*transactions.SignedTransaction, error)
func (*Client) SignTrxMulti ¶
func (client *Client) SignTrxMulti(tx *transactions.SignedTransaction) ([]string, error)
func (*Client) SigningKeys ¶
SigningKeys returns the key from the CurrentKeys
func (*Client) SupernodeUpdate ¶
SupernodeUpdate updating delegate data
func (*Client) TransferEx ¶
func (*Client) TransferNFT ¶ added in v1.0.2
func (*Client) TransferToVesting ¶
TransferToVesting transfer to POWER
func (*Client) UpdateMetadata ¶ added in v1.0.2
func (*Client) UpdateMultiSigAccount ¶
func (client *Client) UpdateMultiSigAccount(account, fee string, accountOwners []string, keyOwners []string, threshold uint32) (*OperResp, error)
AccountUpdate update owner keys for account TODO: every key has different weight on account
func (*Client) UpdateName ¶ added in v1.0.2
func (*Client) UpdateOrgName ¶ added in v1.0.2
func (*Client) UpdatePropertyDefinition ¶ added in v1.0.2
type Keys ¶
type Keys struct {
OKey []string
}
Keys is used as a keystroke for a specific user. Only a few keys can be set.