Versions in this module Expand all Collapse all v0 v0.1.0 Aug 6, 2020 Changes in this version + const ActionDeposit + const ActionDestroy + const ActionInit + const ActionIssue + const ActionSend + const ActionSplit + const ActionSupersede + const ActionTransfer + const ActionWithdraw + const ContractCodeLock + const ContractCodePaymentChannel + const ContractCodeToken + const ContractDescriptor + const ContractExecFee + const ContractWithSplitDescriptor + const DeTypeAddress + const DeTypeAmount + const DeTypeBool + const DeTypeContractAccount + const DeTypeInt32 + const DeTypePublicKey + const DeTypeShortByte + const DeTypeShortText + const DeTypeTimeStamp + const DeTypeTokenId + const DefaultFeeScale + const DefaultTxFee + const FuncidxDeposit + const FuncidxDepositSplit + const FuncidxDestroy + const FuncidxIssue + const FuncidxSend + const FuncidxSendSplit + const FuncidxSplit + const FuncidxSupersede + const FuncidxWithdraw + const FuncidxWithdrawSplit + const IpxAmountRate + const IpxContractId + const IpxTokenId + const Mainnet + const Testnet + const TokenContractWithSplit + const TokenSendFeeVsys + const TxTypeCancelLease + const TxTypeContractExecute + const TxTypeContractRegister + const TxTypeLease + const TxTypeMinting + const TxTypePayment + const VsysAmountRate + const VsysPrecision + func Base58Decode(b string) (val []byte, ok bool) + func Base58Encode(b []byte) string + func BuildSeedHash(seed string, nonce int) []byte + func ContractId2TokenId(contractId string, tokenIndex int) string + func DecodeContractTexture(data string) string + func FormatIpx(ipx int64) string + func FormatVsys(v int64) string + func HashChain(nonceSecret []byte) []byte + func IsErrTransactionNotInBlockChain(err error) bool + func IsValidateAddress(address string, network NetType) bool + func IsValidatePhrase(phrase string) bool + func Keccak256(data ...[]byte) []byte + func MustBase58Decode(b string) []byte + func MustGenerateSeed() string + func PaymentChannelGenerateSenderPaymentSignature(Sender *Account, ChannelId string, Amount int64) string + func PublicKeyToAddress(publicKey string, network NetType) string + func SharedKey(secretKey []uint8, publicKey []uint8) []uint8 + func Sign(secretKey []uint8, msg []uint8, opt_random []uint8) []uint8 + func SignMessage(secretKey []uint8, msg []uint8, opt_random []uint8) []uint8 + func TokenId2ContractId(tokenId string) string + func Verify(publicKey []uint8, msg []uint8, signature []uint8) int + type Account struct + func GenerateKeyPair(seed []byte) *Account + func InitAccount(network NetType) *Account + func (acc *Account) AccountSeed() string + func (acc *Account) BuildCancelLeasing(txId string) *Transaction + func (acc *Account) BuildExecuteContract(contractId string, funcIdx int16, funcData []byte, attachment []byte) *Transaction + func (acc *Account) BuildFromPrivateKey(privateKey string) + func (acc *Account) BuildFromSeed(seed string, nonce int) + func (acc *Account) BuildLeasing(recipient string, amount int64) *Transaction + func (acc *Account) BuildPayment(recipient string, amount int64, attachment []byte) *Transaction + func (acc *Account) BuildPayment2(transaction *Transaction) *Transaction + func (acc *Account) BuildSendTokenTransaction(tokenId string, recipient string, amount int64, isSplitSupported bool, ...) *Transaction + func (acc *Account) GetAddress() string + func (acc *Account) PrivateKey() string + func (acc *Account) PublicKey() string + func (acc *Account) SetNetwork(network NetType) + func (acc *Account) SignData(data []byte) string + func (acc *Account) VerifySignature(data, signature []byte) bool + type ApiCallExecuteContractReq struct + Attachment []byte + ContractId string + FuncData []byte + FuncIdx int16 + Sender *Account + type ApiCallRegisterContractReq struct + ContractCode string + ContractDescription string + DataB []byte + Sender *Account + type ApiRespNodeStatus struct + BlockchainHeight int64 + StateHeight int64 + UpdatedDate string + UpdatedTimestamp int64 + type Block struct + Blocksize int64 + Fee int64 + Generator string + Height int64 + Reference string + ResourcePricingData struct{ ... } + SPOSConsensus struct{ ... } + Signature string + Timestamp int64 + TransactionCount int64 + TransactionMerkleRoot string + Transactions []HistoryTransaction + Version int + type BuildPayment2Req struct + Amount int64 + Recipient string + type CommonResp struct + Error int + Message string + type Contract struct + Amount int64 + Contract string + ContractDescription string + ContractId string + Functions []Func + Max int64 + NewIssuer string + NewUnity int64 + Recipient string + SenderPublicKey string + Textual Textual + TokenDescription string + TokenIdx int32 + Unity int64 + func (c *Contract) BuildDestroyData() []byte + func (c *Contract) BuildIssueData() []byte + func (c *Contract) BuildRegisterData() []byte + func (c *Contract) BuildSendData() []byte + func (c *Contract) BuildSplitData() []byte + func (c *Contract) DecodeDestroy(data []byte) + func (c *Contract) DecodeIssue(data []byte) + func (c *Contract) DecodeRegister(data []byte) + func (c *Contract) DecodeSend(data []byte) + func (c *Contract) DecodeSplit(data []byte) + func (c *Contract) DecodeSupersede(data []byte) + func (c *Contract) DecodeTexture() + type ContractLockReq struct + ContractId string + Sender *Account + Timestamp int64 + type DataEncoder struct + func (de *DataEncoder) Decode(data []byte) (list []DataEntry) + func (de *DataEncoder) Encode(data interface{}, dataEntryType byte) + func (de *DataEncoder) EncodeArgAmount(amount int16) + func (de *DataEncoder) Result() []byte + func (de *DataEncoder) WriteAddress(address string) + func (de *DataEncoder) WriteAmount(amount int64) + func (de *DataEncoder) WriteContractAccount(contractId string) + func (de *DataEncoder) WriteShortByte(bytes []byte) + type DataEntry struct + Type int8 + Value interface{} + type Func struct + Args []string + Name string + RetArgs []string + type GetContractDataResp struct + ContractId string + DataType string + DbName string + Height int64 + Key string + ValueI int64 + ValueS string + type GetContractTokenBalanceResp struct + Address string + Balance int64 + TokenId string + Unity int + type HistoryTransaction struct + Amount int64 + Attachment string + Contract *HtContract + ContractId string + CurrentBlockHeight int + Description string + Fee int64 + FeeCharged int + FeeScale int64 + FunctionData string + FunctionIndex int + Height int + Id string + InitData string + Proofs []Proof + Recipient string + Status string + Timestamp int64 + Type int + func (ht *HistoryTransaction) IsContractSend() bool + func (ht *HistoryTransaction) MustDecodeContractSend() HtContractSend + func (tran *HistoryTransaction) GetFirstSenderAddress() string + type HtContract struct + Descriptors []string + LanguageCode string + LanguageVersion int + StateMaps []string + StateVariables []string + Textual struct{ ... } + Triggers []string + type HtContractSend struct + AddressRecv string + AddressSend string + Amount int64 + type NetType byte + type NewVsysApiReq struct + ApiKey string + Name string + Network NetType + NodeAddress string + type NodeHeath struct + AllAddrList []string + BlacklistedAddrList []string + ConnectedAddrList []string + ErrMsg string + LastBlockHeight int64 + LastBlockSignature string + LastBlockTimestamp time.Time + SelfAddr string + SuspendedAddrList []string + UnconfirmedSize int64 + type NodeListHeathCheckResp struct + HealthList []NodeHeath + ProblemList []string + SyncRelationList []NodeSyncRelation + func NodeListHeathCheck(nodeAddrList []string, NetType NetType) (resp NodeListHeathCheckResp) + type NodePeerAll struct + Address string + LastSeen int64 + type NodePeerBlacklisted struct + Hostname string + Reason string + Timestamp int64 + type NodePeerConnected struct + Address string + ApplicationName string + ApplicationVersion string + DeclaredAddress string + PeerName string + PeerNonce int64 + type NodePeerSuspended struct + Hostname string + Timestamp int64 + type NodeSyncRelation struct + CheckNodeAddr string + ErrMsg string + FindHeight int64 + LastNodeAddr string + type PaymentChannelAbortReq struct + ChannelId string + ContractId string + Sender *Account + type PaymentChannelCollectReq struct + Amount int64 + ChannelId string + ContractId string + Payment_signature_str string + Receiver *Account + type PaymentChannelCreateAndLoadReq struct + Amount int64 + ContractId string + RecipientAddress string + Sender *Account + TimeStamp int64 + type PaymentChannelExtendExpirationTimeReq struct + ChannelId string + ContractId string + Sender *Account + TimeStamp int64 + type PaymentChannelLoadReq struct + Amount int64 + ChannelId string + ContractId string + Sender *Account + type PaymentChannelUnloadReq struct + ChannelId string + ContractId string + Sender *Account + type Proof struct + Address string + ProofType string + PublicKey string + Signature string + type RegisterContractPaymentChannelReq struct + Sender *Account + Vsys_token_id string + type RegisterContractTokenReq struct + ContractDescription string + Max int64 + Sender *Account + TokenDescription string + Unity int64 + type Textual struct + Descriptors string + StateVariables string + Triggers string + type TokenDepositReq struct + Amount int64 + ReceiveAddress string + ReceiveContractId string + Sender *Account + TokenContractId string + TokenId string + type TokenInfoResp struct + ContractID string + Description string + Max int64 + TokenID string + Total int64 + Unity int + type TokenIssueReq struct + Amount int64 + ContractId string + Sender *Account + TokenId string + type TokenWithdrawReq struct + Amount int64 + ReceiveAddress string + ReceiveContractId string + Sender *Account + TokenContractId string + TokenId string + type Transaction struct + Amount int64 + Attachment []byte + Contract string + ContractId string + Description string + Fee int64 + FeeScale int16 + FunctionData string + FunctionIndex int16 + InitData string + Recipient string + SenderPublicKey string + Signature string + Timestamp int64 + TokenIdx int32 + TxId string + func NewCancelLeaseTransaction(txId string) *Transaction + func NewExecuteTransaction(contractId string, funcIdx int16, funcData string, attachment []byte) *Transaction + func NewLeaseTransaction(recipient string, amount int64) *Transaction + func NewPaymentTransaction(recipient string, amount int64, attachment []byte) *Transaction + func NewRegisterTransaction(contract string, data string, contractDescription string) *Transaction + func (tx *Transaction) BuildTxData() []byte + func (tx *Transaction) GetTxType() int + type TransactionList2Req struct + Address string + Limit int + Offset int + TxType int + type TransactionResponse struct + type VsysApi struct + func NewPublicMainNetApi() *VsysApi + func NewPublicTestNetApi() *VsysApi + func NewVsysApi(req NewVsysApiReq) *VsysApi + func (api *VsysApi) GetNodeHeath() NodeHeath + func (api *VsysApi) MustApiCallExecuteContract(req ApiCallExecuteContractReq) (resp TransactionResponse) + func (api *VsysApi) MustApiCallGetContractData(contractId string, key string) (resp GetContractDataResp) + func (api *VsysApi) MustApiCallRegisterContract(req ApiCallRegisterContractReq) (resp TransactionResponse) + func (api *VsysApi) MustContractLock(req ContractLockReq) (resp TransactionResponse) + func (api *VsysApi) MustPaymentChannelAbort(req PaymentChannelAbortReq) (resp TransactionResponse) + func (api *VsysApi) MustPaymentChannelCollect(req PaymentChannelCollectReq) (resp TransactionResponse) + func (api *VsysApi) MustPaymentChannelCreateAndLoad(req PaymentChannelCreateAndLoadReq) (resp TransactionResponse) + func (api *VsysApi) MustPaymentChannelExtendExpirationTime(req PaymentChannelExtendExpirationTimeReq) (resp TransactionResponse) + func (api *VsysApi) MustPaymentChannelGetChannelCapacity(ContractId string, ChannelId string) int64 + func (api *VsysApi) MustPaymentChannelGetChannelCollectedBalance(ContractId string, ChannelId string) int64 + func (api *VsysApi) MustPaymentChannelGetChannelExpirationTime(ContractId string, ChannelId string) int64 + func (api *VsysApi) MustPaymentChannelGetChannelIsOpen(ContractId string, ChannelId string) bool + func (api *VsysApi) MustPaymentChannelGetCreatorAddressOfChannel(ContractId string, ChannelId string) string + func (api *VsysApi) MustPaymentChannelGetCreatorPublicKeyOfChannel(ContractId string, ChannelId string) string + func (api *VsysApi) MustPaymentChannelGetMasterContractBalance(ContractId string, address string) int64 + func (api *VsysApi) MustPaymentChannelGetRecipientAddressOfChannel(ContractId string, ChannelId string) string + func (api *VsysApi) MustPaymentChannelLoad(req PaymentChannelLoadReq) (resp TransactionResponse) + func (api *VsysApi) MustPaymentChannelUnload(req PaymentChannelUnloadReq) (resp TransactionResponse) + func (api *VsysApi) MustRegisterContractLock(Sender *Account, Vsys_token_id string) (resp TransactionResponse) + func (api *VsysApi) MustRegisterContractPaymentChannel(req RegisterContractPaymentChannelReq) (resp TransactionResponse) + func (api *VsysApi) MustRegisterContractToken(req RegisterContractTokenReq) (resp TransactionResponse) + func (api *VsysApi) MustTokenDeposit(req TokenDepositReq) (resp TransactionResponse) + func (api *VsysApi) MustTokenIssue(req TokenIssueReq) (resp TransactionResponse) + func (api *VsysApi) MustTokenWithdraw(req TokenWithdrawReq) (resp TransactionResponse) + func (api *VsysApi) MustWaitPaymentOkByTransactionResponse(resp TransactionResponse) + func (api *VsysApi) SendCancelLeasingTx(tx *Transaction) (resp TransactionResponse, err error) + func (api *VsysApi) SendExecuteContractTx(tx *Transaction) (resp TransactionResponse, err error) + func (api *VsysApi) SendLeasingTx(tx *Transaction) (resp TransactionResponse, err error) + func (api *VsysApi) SendPaymentTx(tx *Transaction) (resp TransactionResponse, err error) + func (api *VsysApi) SendRegisterContractTx(tx *Transaction) (resp TransactionResponse, err error) + func (sdk *VsysApi) AddToWallet(account *Account) + func (sdk *VsysApi) DeleteAccountFromWallet(addr string) + func (sdk *VsysApi) GetAccountAllHistoryTransactionCallback(address string, TxType int, visitor func(tran HistoryTransaction)) (err error) + func (sdk *VsysApi) GetAccountBalance(address string) (v int64, err error) + func (sdk *VsysApi) GetAccountFromWallet(addr string) *Account + func (sdk *VsysApi) GetAccountHistoryTransactionList(address string, limit int) (list []HistoryTransaction, err error) + func (sdk *VsysApi) GetAccountHistoryTransactionList2(req TransactionList2Req) (list []HistoryTransaction, err error) + func (sdk *VsysApi) GetBlockHeight() (h int, errMsg string) + func (sdk *VsysApi) GetHistoryTransactionById(txId string) (ht HistoryTransaction, err error) + func (sdk *VsysApi) GetSdkName() string + func (sdk *VsysApi) GetUnconfirmedHistoryTransactionList() (list []HistoryTransaction, err error) + func (sdk *VsysApi) IsValidAddress(address string) bool + func (sdk *VsysApi) MustApiCallBlockSeq(from int, to int) (output []Block) + func (sdk *VsysApi) MustApiGetBlockHeightBySignature(signature string) int64 + func (sdk *VsysApi) MustApiGetBlockLast() Block + func (sdk *VsysApi) MustApiGetNodeStatus() (resp ApiRespNodeStatus) + func (sdk *VsysApi) MustApiGetPeersAll() []NodePeerAll + func (sdk *VsysApi) MustApiGetPeersBlacklisted() []NodePeerBlacklisted + func (sdk *VsysApi) MustApiGetPeersConnected() []NodePeerConnected + func (sdk *VsysApi) MustApiGetPeersSuspended() []NodePeerSuspended + func (sdk *VsysApi) MustGetAccountBalance(address string) (v int64) + func (sdk *VsysApi) MustGetAccountBalanceString(address string) (s string) + func (sdk *VsysApi) MustGetAccountHistoryTransactionList(address string, limit int) (list []HistoryTransaction) + func (sdk *VsysApi) MustGetBlockCallbackDesc(cb func(block Block) bool) + func (sdk *VsysApi) MustGetBlockHeight() int + func (sdk *VsysApi) MustGetContractTokenBalance(address string, tokenId string) (v int64) + func (sdk *VsysApi) MustGetContractTokenBalanceObj(address string, tokenId string) GetContractTokenBalanceResp + func (sdk *VsysApi) MustGetHistoryTransactionById(txId string) (ht HistoryTransaction) + func (sdk *VsysApi) MustGetNodeVersion() (version string) + func (sdk *VsysApi) MustGetTokenInfo(tokenId string) TokenInfoResp + func (sdk *VsysApi) MustGetTransactionUnconfirmedSize() int64 + func (sdk *VsysApi) MustSendPaymentSimpleAsync2(senderAccount *Account, receiverAddress string, amount int64) (resp TransactionResponse) + func (sdk *VsysApi) MustSendPaymentSimpleSync(senderAccount *Account, receiverAddress string, amount int64) + func (sdk *VsysApi) MustSendTokenSimpleSync(tokenId string, senderAccount *Account, receiverAddress string, amount int64) (resp TransactionResponse) + func (sdk *VsysApi) MustWaitPaymentConfirmedByTranId(id string, deadline time.Time) + func (sdk *VsysApi) NewAccountFromSeedAndNonce(seed string, nonce int) (acc *Account) + func (sdk *VsysApi) NewAccountFromSeedAndNonceV2(seed string, nonce int) (acc *Account) + func (sdk *VsysApi) NewAccountFromSeedHash(seedHash []byte) (acc *Account) + func (sdk *VsysApi) SendPaymentSimpleAsync(senderAccount *Account, receiverAddress string, amount int64) (err error) + func (sdk *VsysApi) SendPaymentSimpleAsync2(senderAccount *Account, receiverAddress string, amount int64) (resp TransactionResponse, err error) + func (sdk *VsysApi) SendPaymentSimpleSync(senderAccount *Account, receiverAddress string, amount int64) (err error) + func (sdk *VsysApi) SendTokenSimpleAsync(tokenId string, senderAccount *Account, receiverAddress string, amount int64) (err error) + func (sdk *VsysApi) SendTokenSimpleAsync2(tokenId string, senderAccount *Account, receiverAddress string, amount int64) (resp TransactionResponse, err error) + func (sdk *VsysApi) WaitPaymentConfirmedByTranId(id string, deadline time.Time) (err error) + type VsysApiList struct + func (list *VsysApiList) AddVsysApi(api *VsysApi) + func (list *VsysApiList) GetByName(name string) *VsysApi + func (list *VsysApiList) GetList() []*VsysApi