Documentation ¶
Index ¶
- Constants
- 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
- 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
- type ApiCallRegisterContractReq
- type ApiRespNodeStatus
- type Block
- type BuildPayment2Req
- type CommonResp
- type Contract
- 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
- type DataEncoder
- 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
- type Func
- type GetContractDataResp
- type GetContractTokenBalanceResp
- type HistoryTransaction
- type HtContract
- type HtContractSend
- type NetType
- type NewVsysApiReq
- type NodeHeath
- type NodeListHeathCheckResp
- type NodePeerAll
- type NodePeerBlacklisted
- type NodePeerConnected
- type NodePeerSuspended
- type NodeSyncRelation
- type PaymentChannelAbortReq
- type PaymentChannelCollectReq
- type PaymentChannelCreateAndLoadReq
- type PaymentChannelExtendExpirationTimeReq
- type PaymentChannelLoadReq
- type PaymentChannelUnloadReq
- type Proof
- type RegisterContractPaymentChannelReq
- type RegisterContractTokenReq
- type Textual
- type TokenDepositReq
- type TokenInfoResp
- type TokenIssueReq
- type TokenWithdrawReq
- type Transaction
- 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
- type TransactionList2Req
- type TransactionResponse
- type VsysApi
- 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 (api *VsysApi) GetNodeHeath() NodeHeath
- 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 (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 (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 (api *VsysApi) MustContractLock(req ContractLockReq) (resp TransactionResponse)
- 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 (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 (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 (api *VsysApi) MustTokenDeposit(req TokenDepositReq) (resp TransactionResponse)
- func (api *VsysApi) MustTokenIssue(req TokenIssueReq) (resp TransactionResponse)
- func (api *VsysApi) MustTokenWithdraw(req TokenWithdrawReq) (resp TransactionResponse)
- func (sdk *VsysApi) MustWaitPaymentConfirmedByTranId(id string, deadline time.Time)
- func (api *VsysApi) MustWaitPaymentOkByTransactionResponse(resp TransactionResponse)
- 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 (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 (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 (api *VsysApi) SendPaymentTx(tx *Transaction) (resp TransactionResponse, err error)
- func (api *VsysApi) SendRegisterContractTx(tx *Transaction) (resp TransactionResponse, 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
Constants ¶
const ( // Fee VsysPrecision int64 = 1e8 ContractExecFee int64 = 3e7 DefaultTxFee int64 = 1e7 DefaultFeeScale int16 = 100 // Network Testnet NetType = 'T' Mainnet NetType = 'M' // TX_TYPE TxTypePayment = 2 TxTypeLease = 3 TxTypeCancelLease = 4 TxTypeMinting = 5 TxTypeContractRegister = 8 TxTypeContractExecute = 9 //contract funcIdx variable ActionInit = "init" ActionSupersede = "supersede" ActionIssue = "issue" ActionDestroy = "destroy" ActionSplit = "split" ActionSend = "send" ActionTransfer = "transfer" ActionDeposit = "deposit" ActionWithdraw = "withdraw" // function index FuncidxSupersede = 0 FuncidxIssue = 1 FuncidxDestroy = 2 FuncidxSplit = 3 FuncidxSend = 3 FuncidxSendSplit = 4 FuncidxWithdraw = 6 FuncidxWithdrawSplit = 7 FuncidxDeposit = 5 FuncidxDepositSplit = 6 )
const ( DeTypePublicKey = 0x01 DeTypeAddress = 0x02 DeTypeAmount = 0x03 DeTypeInt32 = 0x04 DeTypeShortText = 0x05 DeTypeContractAccount = 0x06 //DeTypeAccount = 0x07 // Account is not a data entry, please use DeTypeAddress or DeTypeContractAccount DeTypeTokenId = 0x08 DeTypeTimeStamp = 0x09 DeTypeBool = 10 DeTypeShortByte = 11 )
const ContractCodeLock = `` /* 824-byte string literal not displayed */
const ContractCodePaymentChannel = `` /* 2691-byte string literal not displayed */
const ContractCodeToken = "" /* 1186-byte string literal not displayed */
const ContractDescriptor = "" /* 570-byte string literal not displayed */
const ContractWithSplitDescriptor = "" /* 615-byte string literal not displayed */
const IpxAmountRate = 1e9
const IpxContractId = "CC8Jx8aLkKVQmzuHBWNnhCSkn1GBLcjZ32k"
const IpxTokenId = "TWZZfKFqcaNVe5TrphLRNEm5DQFnBRJMjDDByqv84"
const TokenContractWithSplit = "" /* 1272-byte string literal not displayed */
const TokenSendFeeVsys = 0.3
const VsysAmountRate = 1e8
Variables ¶
This section is empty.
Functions ¶
func Base58Decode ¶
func Base58Encode ¶
Encode encodes a byte slice to a modified base58 string.
func BuildSeedHash ¶
func ContractId2TokenId ¶
func DecodeContractTexture ¶
func FormatVsys ¶
func IsErrTransactionNotInBlockChain ¶
"Transaction is not in blockchain"
func IsValidateAddress ¶
IsValidateAddress checks if address valid
func IsValidatePhrase ¶
IsValidatePhrase checks if phrase valid
func MustBase58Decode ¶
Decode decodes a modified base58 string to a byte slice.
func PublicKeyToAddress ¶
PublicKeyToAddress return address with base58 encoded
func TokenId2ContractId ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func GenerateKeyPair ¶
GenerateKeyPair generate Account using seed byte array
func InitAccount ¶
InitAccount return account with network initiated
func (*Account) AccountSeed ¶
func (*Account) BuildCancelLeasing ¶
func (acc *Account) BuildCancelLeasing(txId string) *Transaction
BuildCancelLeasing build Cancel transaction
func (*Account) BuildExecuteContract ¶
func (acc *Account) BuildExecuteContract(contractId string, funcIdx int16, funcData []byte, attachment []byte) *Transaction
BuildExecuteContract build ExecuteContract transaction
func (*Account) BuildFromPrivateKey ¶
BuildFromPrivateKey build account using privateKey
func (*Account) BuildFromSeed ¶
BuildFromPrivateKey build account using seed and nonce
func (*Account) BuildLeasing ¶
func (acc *Account) BuildLeasing(recipient string, amount int64) *Transaction
BuildLeasing build leasing transaction recipient should be address amount is in minimum unit
func (*Account) BuildPayment ¶
func (acc *Account) BuildPayment(recipient string, amount int64, attachment []byte) *Transaction
BuildPayment build payment transaction recipient should be address amount is in minimum unit attachment can be empty
func (*Account) BuildPayment2 ¶
func (acc *Account) BuildPayment2(transaction *Transaction) *Transaction
func (*Account) BuildSendTokenTransaction ¶
func (acc *Account) BuildSendTokenTransaction(tokenId string, recipient string, amount int64, isSplitSupported bool, attachment []byte) *Transaction
BuildExecuteContract build SendToken transaction
func (*Account) SetNetwork ¶
func (*Account) VerifySignature ¶
VerifySignature check if signature is correct
type ApiRespNodeStatus ¶
type Block ¶
type Block struct { Version int `json:"version"` Timestamp int64 `json:"timestamp"` Reference string `json:"reference"` SPOSConsensus struct { MintTime int64 `json:"mintTime"` MintBalance int64 `json:"mintBalance"` } `json:"SPOSConsensus"` ResourcePricingData struct { Computation int64 `json:"computation"` Storage int64 `json:"storage"` Memory int64 `json:"memory"` RandomIO int64 `json:"randomIO"` SequentialIO int64 `json:"sequentialIO"` } `json:"resourcePricingData"` TransactionMerkleRoot string `json:"TransactionMerkleRoot"` Transactions []HistoryTransaction `json:"transactions"` Generator string `json:"generator"` Signature string `json:"signature"` Fee int64 `json:"fee"` Blocksize int64 `json:"blocksize"` Height int64 `json:"height"` TransactionCount int64 `json:"transaction count"` }
type BuildPayment2Req ¶
type CommonResp ¶
type Contract ¶
type Contract struct { ContractId string Contract string Max int64 Unity int64 TokenDescription string ContractDescription string Amount int64 TokenIdx int32 // const 0 Recipient string SenderPublicKey string NewUnity int64 // split newUnity NewIssuer string // supersede newIssuer Textual Textual // [init func, user defined func, stateVar] Functions []Func }
func (*Contract) BuildDestroyData ¶
func (*Contract) BuildIssueData ¶
func (*Contract) BuildRegisterData ¶
func (*Contract) BuildSendData ¶
func (*Contract) BuildSplitData ¶
func (*Contract) DecodeDestroy ¶
func (*Contract) DecodeIssue ¶
func (*Contract) DecodeRegister ¶
func (*Contract) DecodeSend ¶
func (*Contract) DecodeSplit ¶
func (*Contract) DecodeSupersede ¶
func (*Contract) DecodeTexture ¶
func (c *Contract) DecodeTexture()
type ContractLockReq ¶
type DataEncoder ¶
type DataEncoder struct {
// contains filtered or unexported fields
}
func (*DataEncoder) Decode ¶
func (de *DataEncoder) Decode(data []byte) (list []DataEntry)
func (*DataEncoder) Encode ¶
func (de *DataEncoder) Encode(data interface{}, dataEntryType byte)
func (*DataEncoder) EncodeArgAmount ¶
func (de *DataEncoder) EncodeArgAmount(amount int16)
func (*DataEncoder) Result ¶
func (de *DataEncoder) Result() []byte
func (*DataEncoder) WriteAddress ¶
func (de *DataEncoder) WriteAddress(address string)
func (*DataEncoder) WriteAmount ¶
func (de *DataEncoder) WriteAmount(amount int64)
func (*DataEncoder) WriteContractAccount ¶
func (de *DataEncoder) WriteContractAccount(contractId string)
func (*DataEncoder) WriteShortByte ¶
func (de *DataEncoder) WriteShortByte(bytes []byte)
type GetContractDataResp ¶
type HistoryTransaction ¶
type HistoryTransaction struct { Type int `json:"type,omitempty"` // TX_TYPE Id string `json:"id,omitempty"` Fee int64 `json:"fee,omitempty"` FeeScale int64 `json:"feeScale,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` Proofs []Proof `json:"proofs,omitempty"` Recipient string `json:"recipient,omitempty"` Amount int64 `json:"amount,omitempty"` Attachment string `json:"attachmen,omitempty"` ContractId string `json:"contractId,omitempty"` FunctionIndex int `json:"functionIndex,omitempty"` // FuncidxSplit,... FunctionData string `json:"functionData,omitempty"` Contract *HtContract `json:"contract,omitempty"` InitData string `json:"initData,omitempty"` Description string `json:"description,omitempty"` Status string `json:"status,omitempty"` FeeCharged int `json:"feeCharged,omitempty"` Height int `json:"height,omitempty"` CurrentBlockHeight int `json:"currentBlockHeight,omitempty"` }
func (*HistoryTransaction) GetFirstSenderAddress ¶
func (tran *HistoryTransaction) GetFirstSenderAddress() string
func (*HistoryTransaction) IsContractSend ¶
func (ht *HistoryTransaction) IsContractSend() bool
func (*HistoryTransaction) MustDecodeContractSend ¶
func (ht *HistoryTransaction) MustDecodeContractSend() HtContractSend
type HtContract ¶
type HtContract struct { LanguageCode string `json:"languageCode,omitempty"` LanguageVersion int `json:"languageVersion,omitempty"` Triggers []string `json:"triggers,omitempty"` Descriptors []string `json:"descriptors,omitempty"` StateVariables []string `json:"stateVariables,omitempty"` StateMaps []string `json:"stateMaps,omitempty"` Textual struct { Triggers string `json:"triggers,omitempty"` Descriptors string `json:"descriptors,omitempty"` StateVariables string `json:"stateVariables,omitempty"` StateMaps string `json:"stateMaps,omitempty"` } `json:"textual,omitempty"` }
type HtContractSend ¶
type NewVsysApiReq ¶
type NodeHeath ¶
type NodeHeath struct { SelfAddr string `json:",omitempty"` AllAddrList []string `json:",omitempty"` SuspendedAddrList []string `json:",omitempty"` ConnectedAddrList []string `json:",omitempty"` BlacklistedAddrList []string `json:",omitempty"` LastBlockHeight int64 `json:",omitempty"` LastBlockSignature string `json:",omitempty"` LastBlockTimestamp time.Time `json:",omitempty"` UnconfirmedSize int64 // 0 is valid value ErrMsg string `json:",omitempty"` }
type NodeListHeathCheckResp ¶
type NodeListHeathCheckResp struct { HealthList []NodeHeath SyncRelationList []NodeSyncRelation ProblemList []string }
func NodeListHeathCheck ¶
func NodeListHeathCheck(nodeAddrList []string, NetType NetType) (resp NodeListHeathCheckResp)
type NodePeerAll ¶
type NodePeerBlacklisted ¶
type NodePeerConnected ¶
type NodePeerSuspended ¶
type NodeSyncRelation ¶
type PaymentChannelAbortReq ¶
type PaymentChannelCreateAndLoadReq ¶
type PaymentChannelCreateAndLoadReq struct { Sender *Account ContractId string RecipientAddress string Amount int64 TimeStamp int64 }
recipient_address = Account(chain=chain, seed='<recipient-seed>', nonce=0) create_recipient_data_entry = DataEntry(recipient_address.address, Type.address) create_amount_data_entry = DataEntry(50, Type.amount) create_expiration_time_data_entry = DataEntry(response2["timestamp"] + 10000000000, Type.timestamp)
create_data_stack = [create_recipient_data_entry, create_amount_data_entry, create_expiration_time_data_entry]
type PaymentChannelLoadReq ¶
type PaymentChannelUnloadReq ¶
type TokenDepositReq ¶
type TokenInfoResp ¶
type TokenIssueReq ¶
type TokenWithdrawReq ¶
type Transaction ¶
type Transaction struct { TxId string `json:"txId,omitempty"` Timestamp int64 `json:"timestamp"` Fee int64 `json:"fee"` FeeScale int16 `json:"feeScale"` Amount int64 `json:"amount,omitempty"` SenderPublicKey string `json:"senderPublicKey"` Attachment []byte `json:"attachment,omitempty"` Recipient string `json:"recipient,omitempty"` Signature string `json:"signature,omitempty"` // contract Contract string `json:"contract,omitempty"` InitData string `json:"initData,omitempty"` ContractId string `json:"contractId,omitempty"` TokenIdx int32 `json:"tokenIdx,omitempty"` Description string `json:"description,omitempty"` FunctionIndex int16 `json:"functionIndex"` FunctionData string `json:"functionData,omitempty"` // contains filtered or unexported fields }
func NewCancelLeaseTransaction ¶
func NewCancelLeaseTransaction(txId string) *Transaction
func NewExecuteTransaction ¶
func NewExecuteTransaction(contractId string, funcIdx int16, funcData string, attachment []byte) *Transaction
func NewLeaseTransaction ¶
func NewLeaseTransaction(recipient string, amount int64) *Transaction
func NewPaymentTransaction ¶
func NewPaymentTransaction(recipient string, amount int64, attachment []byte) *Transaction
func NewRegisterTransaction ¶
func NewRegisterTransaction(contract string, data string, contractDescription string) *Transaction
func (*Transaction) BuildTxData ¶
func (tx *Transaction) BuildTxData() []byte
BuildTxData generate data which is used to be signed
func (*Transaction) GetTxType ¶
func (tx *Transaction) GetTxType() int
type TransactionList2Req ¶
type TransactionResponse ¶
type TransactionResponse struct { HistoryTransaction CommonResp }
type VsysApi ¶
type VsysApi struct {
// contains filtered or unexported fields
}
func NewPublicMainNetApi ¶
func NewPublicMainNetApi() *VsysApi
func NewPublicTestNetApi ¶
func NewPublicTestNetApi() *VsysApi
func NewVsysApi ¶
func NewVsysApi(req NewVsysApiReq) *VsysApi
func (*VsysApi) AddToWallet ¶
func (*VsysApi) DeleteAccountFromWallet ¶
func (*VsysApi) GetAccountAllHistoryTransactionCallback ¶
func (sdk *VsysApi) GetAccountAllHistoryTransactionCallback(address string, TxType int, visitor func(tran HistoryTransaction)) (err error)
TxType 0 to return all transaction
func (*VsysApi) GetAccountBalance ¶
func (*VsysApi) GetAccountFromWallet ¶
func (*VsysApi) GetAccountHistoryTransactionList ¶
func (sdk *VsysApi) GetAccountHistoryTransactionList(address string, limit int) (list []HistoryTransaction, err error)
func (*VsysApi) GetAccountHistoryTransactionList2 ¶
func (sdk *VsysApi) GetAccountHistoryTransactionList2(req TransactionList2Req) (list []HistoryTransaction, err error)
func (*VsysApi) GetBlockHeight ¶
func (*VsysApi) GetHistoryTransactionById ¶
func (sdk *VsysApi) GetHistoryTransactionById(txId string) (ht HistoryTransaction, err error)
func (*VsysApi) GetNodeHeath ¶
func (*VsysApi) GetSdkName ¶
func (*VsysApi) GetUnconfirmedHistoryTransactionList ¶
func (sdk *VsysApi) GetUnconfirmedHistoryTransactionList() (list []HistoryTransaction, err error)
func (*VsysApi) IsValidAddress ¶
func (*VsysApi) MustApiCallBlockSeq ¶
func (*VsysApi) MustApiCallExecuteContract ¶
func (api *VsysApi) MustApiCallExecuteContract(req ApiCallExecuteContractReq) (resp TransactionResponse)
func (*VsysApi) MustApiCallGetContractData ¶
func (api *VsysApi) MustApiCallGetContractData(contractId string, key string) (resp GetContractDataResp)
func (*VsysApi) MustApiCallRegisterContract ¶
func (api *VsysApi) MustApiCallRegisterContract(req ApiCallRegisterContractReq) (resp TransactionResponse)
func (*VsysApi) MustApiGetBlockHeightBySignature ¶
func (*VsysApi) MustApiGetBlockLast ¶
func (*VsysApi) MustApiGetNodeStatus ¶
func (sdk *VsysApi) MustApiGetNodeStatus() (resp ApiRespNodeStatus)
func (*VsysApi) MustApiGetPeersAll ¶
func (sdk *VsysApi) MustApiGetPeersAll() []NodePeerAll
func (*VsysApi) MustApiGetPeersBlacklisted ¶
func (sdk *VsysApi) MustApiGetPeersBlacklisted() []NodePeerBlacklisted
func (*VsysApi) MustApiGetPeersConnected ¶
func (sdk *VsysApi) MustApiGetPeersConnected() []NodePeerConnected
func (*VsysApi) MustApiGetPeersSuspended ¶
func (sdk *VsysApi) MustApiGetPeersSuspended() []NodePeerSuspended
func (*VsysApi) MustContractLock ¶
func (api *VsysApi) MustContractLock(req ContractLockReq) (resp TransactionResponse)
func (*VsysApi) MustGetAccountBalance ¶
func (*VsysApi) MustGetAccountBalanceString ¶
func (*VsysApi) MustGetAccountHistoryTransactionList ¶
func (sdk *VsysApi) MustGetAccountHistoryTransactionList(address string, limit int) (list []HistoryTransaction)
func (*VsysApi) MustGetBlockCallbackDesc ¶
func (*VsysApi) MustGetBlockHeight ¶
func (*VsysApi) MustGetContractTokenBalance ¶
func (*VsysApi) MustGetContractTokenBalanceObj ¶
func (sdk *VsysApi) MustGetContractTokenBalanceObj(address string, tokenId string) GetContractTokenBalanceResp
{ "address" : "AR695aEbZPsDQzVjHBLvDYxadrpe21zdfHf", "tokenId" : "TWZZfKFqcaNVe5TrphLRNEm5DQFnBRJMjDDByqv84", "balance" : 35141117913, "unity" : 1000000000 }
func (*VsysApi) MustGetHistoryTransactionById ¶
func (sdk *VsysApi) MustGetHistoryTransactionById(txId string) (ht HistoryTransaction)
func (*VsysApi) MustGetNodeVersion ¶
func (*VsysApi) MustGetTokenInfo ¶
func (sdk *VsysApi) MustGetTokenInfo(tokenId string) TokenInfoResp
{ "tokenId" : "TWZZfKFqcaNVe5TrphLRNEm5DQFnBRJMjDDByqv84", "contractId" : "CC8Jx8aLkKVQmzuHBWNnhCSkn1GBLcjZ32k", "max" : 1500000000000000000, "total" : 1000000000000000000, "unity" : 1000000000, "description" : "15sb7d" }
func (*VsysApi) MustGetTransactionUnconfirmedSize ¶
func (*VsysApi) MustPaymentChannelAbort ¶
func (api *VsysApi) MustPaymentChannelAbort(req PaymentChannelAbortReq) (resp TransactionResponse)
func (*VsysApi) MustPaymentChannelCollect ¶
func (api *VsysApi) MustPaymentChannelCollect(req PaymentChannelCollectReq) (resp TransactionResponse)
func (*VsysApi) MustPaymentChannelCreateAndLoad ¶
func (api *VsysApi) MustPaymentChannelCreateAndLoad(req PaymentChannelCreateAndLoadReq) (resp TransactionResponse)
func (*VsysApi) MustPaymentChannelExtendExpirationTime ¶
func (api *VsysApi) MustPaymentChannelExtendExpirationTime(req PaymentChannelExtendExpirationTimeReq) (resp TransactionResponse)
func (*VsysApi) MustPaymentChannelGetChannelCapacity ¶
func (*VsysApi) MustPaymentChannelGetChannelCollectedBalance ¶
func (*VsysApi) MustPaymentChannelGetChannelExpirationTime ¶
func (*VsysApi) MustPaymentChannelGetChannelIsOpen ¶
true mean channel is open, false mean sender abort it. false can not call ExtendExpirationTime on it.
func (*VsysApi) MustPaymentChannelGetCreatorAddressOfChannel ¶
func (*VsysApi) MustPaymentChannelGetCreatorPublicKeyOfChannel ¶
func (*VsysApi) MustPaymentChannelGetMasterContractBalance ¶
func (*VsysApi) MustPaymentChannelGetRecipientAddressOfChannel ¶
func (*VsysApi) MustPaymentChannelLoad ¶
func (api *VsysApi) MustPaymentChannelLoad(req PaymentChannelLoadReq) (resp TransactionResponse)
func (*VsysApi) MustPaymentChannelUnload ¶
func (api *VsysApi) MustPaymentChannelUnload(req PaymentChannelUnloadReq) (resp TransactionResponse)
func (*VsysApi) MustRegisterContractLock ¶
func (api *VsysApi) MustRegisterContractLock(Sender *Account, Vsys_token_id string) (resp TransactionResponse)
func (*VsysApi) MustRegisterContractPaymentChannel ¶
func (api *VsysApi) MustRegisterContractPaymentChannel(req RegisterContractPaymentChannelReq) (resp TransactionResponse)
func (*VsysApi) MustRegisterContractToken ¶
func (api *VsysApi) MustRegisterContractToken(req RegisterContractTokenReq) (resp TransactionResponse)
func (*VsysApi) MustSendPaymentSimpleAsync2 ¶
func (sdk *VsysApi) MustSendPaymentSimpleAsync2(senderAccount *Account, receiverAddress string, amount int64) (resp TransactionResponse)
func (*VsysApi) MustSendPaymentSimpleSync ¶
func (*VsysApi) MustSendTokenSimpleSync ¶
func (*VsysApi) MustTokenDeposit ¶
func (api *VsysApi) MustTokenDeposit(req TokenDepositReq) (resp TransactionResponse)
func (*VsysApi) MustTokenIssue ¶
func (api *VsysApi) MustTokenIssue(req TokenIssueReq) (resp TransactionResponse)
func (*VsysApi) MustTokenWithdraw ¶
func (api *VsysApi) MustTokenWithdraw(req TokenWithdrawReq) (resp TransactionResponse)
func (*VsysApi) MustWaitPaymentConfirmedByTranId ¶
func (*VsysApi) MustWaitPaymentOkByTransactionResponse ¶
func (api *VsysApi) MustWaitPaymentOkByTransactionResponse(resp TransactionResponse)
func (*VsysApi) NewAccountFromSeedAndNonce ¶
func (*VsysApi) NewAccountFromSeedAndNonceV2 ¶
func (*VsysApi) NewAccountFromSeedHash ¶
func (*VsysApi) SendCancelLeasingTx ¶
func (api *VsysApi) SendCancelLeasingTx(tx *Transaction) (resp TransactionResponse, err error)
func (*VsysApi) SendExecuteContractTx ¶
func (api *VsysApi) SendExecuteContractTx(tx *Transaction) (resp TransactionResponse, err error)
func (*VsysApi) SendLeasingTx ¶
func (api *VsysApi) SendLeasingTx(tx *Transaction) (resp TransactionResponse, err error)
func (*VsysApi) SendPaymentSimpleAsync ¶
func (sdk *VsysApi) SendPaymentSimpleAsync(senderAccount *Account, receiverAddress string, amount int64) (err error)
transfer vsys, do not wait the transaction go to chain
func (*VsysApi) SendPaymentSimpleAsync2 ¶
func (*VsysApi) SendPaymentSimpleSync ¶
func (sdk *VsysApi) SendPaymentSimpleSync(senderAccount *Account, receiverAddress string, amount int64) (err error)
transfer vsys, wait the transaction go to chain,(it may be refused by the chain)
func (*VsysApi) SendPaymentTx ¶
func (api *VsysApi) SendPaymentTx(tx *Transaction) (resp TransactionResponse, err error)
func (*VsysApi) SendRegisterContractTx ¶
func (api *VsysApi) SendRegisterContractTx(tx *Transaction) (resp TransactionResponse, err error)
func (*VsysApi) SendTokenSimpleAsync ¶
func (*VsysApi) SendTokenSimpleAsync2 ¶
type VsysApiList ¶
type VsysApiList struct {
// contains filtered or unexported fields
}
func (*VsysApiList) AddVsysApi ¶
func (list *VsysApiList) AddVsysApi(api *VsysApi)
func (*VsysApiList) GetByName ¶
func (list *VsysApiList) GetByName(name string) *VsysApi
func (*VsysApiList) GetList ¶
func (list *VsysApiList) GetList() []*VsysApi
Source Files ¶
- ContractDataEncoder.go
- ContractPaymentLock.go
- ContractType.go
- account.go
- api.go
- api2.go
- apiBlock.go
- apiHistoryTransaction.go
- apiNode.go
- apiSend.go
- axlsign.go
- base58.go
- common.go
- config.go
- configCoin.go
- contract.go
- contractApi.go
- contractPaymentChannel.go
- contractToken.go
- crypto.go
- http.go
- lib.go
- transaction.go
- wordList.go