Versions in this module Expand all Collapse all v0 v0.1.1 Feb 18, 2018 Changes in this version + const AddressTrinaryOffset + const AddressTrinarySize + const AttachmentTimestampLowerBoundTrinaryOffset + const AttachmentTimestampLowerBoundTrinarySize + const AttachmentTimestampTrinaryOffset + const AttachmentTimestampTrinarySize + const AttachmentTimestampUpperBoundTrinaryOffset + const AttachmentTimestampUpperBoundTrinarySize + const BranchTransactionTrinaryOffset + const BranchTransactionTrinarySize + const BundleTrinaryOffset + const BundleTrinarySize + const ByteLength + const CurrentIndexTrinaryOffset + const CurrentIndexTrinarySize + const DefaultMinWeightMagnitude + const DefaultNumberOfWalks + const Depth + const Gi + const HashSize + const IntLength + const Ki + const LastIndexTrinaryOffset + const LastIndexTrinarySize + const MaxTryteValue + const Mi + const MinTryteValue + const NonceTrinaryOffset + const NonceTrinarySize + const ObsoleteTagTrinaryOffset + const ObsoleteTagTrinarySize + const Pi + const Radix + const SignatureMessageFragmentTrinaryOffset + const SignatureMessageFragmentTrinarySize + const SignatureSize + const TagTrinaryOffset + const TagTrinarySize + const Ti + const TimestampTrinaryOffset + const TimestampTrinarySize + const TritHashLength + const TrunkTransactionTrinaryOffset + const TrunkTransactionTrinarySize + const TryteAlphabet + const ValueTrinaryOffset + const ValueTrinarySize + var EmptyAddress Address = "999999999999999999999999999999999999999999999999999999999999999999999999999999999" + var EmptyHash Trytes = "999999999999999999999999999999999999999999999999999999999999999999999999999999999" + var ErrInvalidAddressTrits = errors.New("addresses without checksum are 243 trits in length") + var ErrInvalidAddressTrytes = errors.New("addresses without checksum are 81 trytes in length") + var ErrInvalidTransaction = errors.New("malformed transaction") + var ErrInvalidTransactionHash = errors.New("invalid transaction hash") + var ErrInvalidTransactionType = errors.New("invalid transaction type") + var ErrKeyTritsLength = errors.New("key trit slice should be a multiple of HashSize*27 entries long") + var ErrSeedTritsLength = errors.New("seed trit slice should be HashSize entries long") + var ErrSeedTrytesLength = errors.New("seed string needs to be HashSize / 3 characters long") + var PowProcs int + var PublicNodes = []string + func GetUsedAddress(api *API, seed Trytes, security int) (Address, []Address, error) + func IsValidSig(expectedAddress Address, signatureFragments []Trytes, bundleHash Trytes) bool + func IsValidTrit(t int8) error + func IsValidTryte(t rune) error + func Promote(api *API, tail Trytes, depth int64, trytes []Transaction, mwm int64, ...) error + func RandomNode() string + func SendTrytes(api *API, depth int64, trytes []Transaction, mwm int64, pow PowFunc) error + func ToString(t Trytes) string + type API struct + func NewAPI(endpoint string, c *http.Client) *API + func (api *API) AddNeighbors(uris []string) (*AddNeighborsResponse, error) + func (api *API) AttachToTangle(att *AttachToTangleRequest) (*AttachToTangleResponse, error) + func (api *API) Balances(adr []Address) (Balances, error) + func (api *API) BroadcastTransactions(trytes []Transaction) error + func (api *API) CheckConsistency(tails []Trytes) (*CheckConsistencyResponse, error) + func (api *API) FindTransactions(ft *FindTransactionsRequest) (*FindTransactionsResponse, error) + func (api *API) GetBalances(adr []Address, threshold int64) (*GetBalancesResponse, error) + func (api *API) GetInclusionStates(tx []Trytes, tips []Trytes) (*GetInclusionStatesResponse, error) + func (api *API) GetLatestInclusion(hash []Trytes) ([]bool, error) + func (api *API) GetNeighbors() (*GetNeighborsResponse, error) + func (api *API) GetNodeInfo() (*GetNodeInfoResponse, error) + func (api *API) GetTips() (*GetTipsResponse, error) + func (api *API) GetTransactionsToApprove(depth, numWalks int64, reference Trytes) (*GetTransactionsToApproveResponse, error) + func (api *API) GetTrytes(hashes []Trytes) (*GetTrytesResponse, error) + func (api *API) InterruptAttachingToTangle() error + func (api *API) RemoveNeighbors(uris []string) (*RemoveNeighborsResponse, error) + func (api *API) StoreTransactions(trytes []Transaction) error + type AddNeighborsRequest struct + Command string + URIS []string + type AddNeighborsResponse struct + AddedNeighbors int64 + Duration int64 + type Address Trytes + func NewAddress(seed Trytes, index, security int) (Address, error) + func NewAddresses(seed Trytes, start, count, security int) ([]Address, error) + func ToAddress(t string) (Address, error) + func (a Address) Checksum() Trytes + func (a Address) Hash() Trytes + func (a Address) IsValid() error + func (a Address) WithChecksum() Trytes + type AddressInfo struct + Index int + Security int + Seed Trytes + func (a *AddressInfo) Address() (Address, error) + func (a *AddressInfo) Key() (Trytes, error) + type AttachToTangleRequest struct + BranchTransaction Trytes + Command string + MinWeightMagnitude int64 + TrunkTransaction Trytes + Trytes []Transaction + type AttachToTangleResponse struct + Duration int64 + Trytes []Transaction + type Balance struct + Address Address + Index int + Value int64 + type Balances []Balance + func GetInputs(api *API, seed Trytes, start, end int, threshold int64, security int) (Balances, error) + func (bs Balances) Total() int64 + type BroadcastTransactionsRequest struct + Command string + Trytes []Transaction + type Bundle []Transaction + func PrepareTransfers(api *API, seed Trytes, trs []Transfer, inputs []AddressInfo, remainder Address, ...) (Bundle, error) + func Send(api *API, seed Trytes, security int, trs []Transfer, mwm int64, pow PowFunc) (Bundle, error) + func (bs *Bundle) Add(num int, address Address, value int64, timestamp time.Time, tag Trytes) + func (bs Bundle) Categorize(adr Address) (send Bundle, received Bundle) + func (bs Bundle) Finalize(sig []Trytes) + func (bs Bundle) Hash() Trytes + func (bs Bundle) IsValid() error + type CheckConsistencyResponse struct + Duration int64 + Info string + State bool + type Curl struct + func NewCurl() *Curl + func (c *Curl) Absorb(inn Trytes) + func (c *Curl) Reset() + func (c *Curl) Squeeze() Trytes + func (c *Curl) Transform() + type ErrorResponse struct + Error string + Exception string + type FindTransactionsRequest struct + Addresses []Address + Approvees []Trytes + Bundles []Trytes + Command string + Tags []Trytes + type FindTransactionsResponse struct + Duration int64 + Hashes []Trytes + type GetBalancesRequest struct + Addresses []Address + Command string + Threshold int64 + type GetBalancesResponse struct + Balances []int64 + Duration int64 + Milestone Trytes + MilestoneIndex int64 + type GetInclusionStatesRequest struct + Command string + Tips []Trytes + Transactions []Trytes + type GetInclusionStatesResponse struct + Duration int64 + States []bool + type GetNeighborsRequest struct + Command string + type GetNeighborsResponse struct + Duration int64 + Neighbors []Neighbor + type GetNodeInfoRequest struct + Command string + type GetNodeInfoResponse struct + AppName string + AppVersion string + Duration int64 + JREAvailableProcessors int64 + JREFreeMemory int64 + JREMaxMemory int64 + JRETotalMemory int64 + LatestMilestone Trytes + LatestMilestoneIndex int64 + LatestSolidSubtangleMilestone Trytes + LatestSolidSubtangleMilestoneIndex int64 + Neighbors int64 + PacketQueueSize int64 + Time int64 + Tips int64 + TransactionsToRequest int64 + type GetTipsRequest struct + Command string + type GetTipsResponse struct + Duration int64 + Hashes []Trytes + type GetTransactionsToApproveRequest struct + Command string + Depth int64 + type GetTransactionsToApproveResponse struct + BranchTransaction Trytes + Duration int64 + TrunkTransaction Trytes + type GetTrytesRequest struct + Command string + Hashes []Trytes + type GetTrytesResponse struct + Duration int64 + Trytes []Transaction + type InterruptAttachingToTangleRequest struct + Command string + type Kerl struct + func NewKerl() *Kerl + func (k *Kerl) Absorb(in Trits) error + func (k *Kerl) Reset() + func (k *Kerl) Squeeze(length int) (Trits, error) + type Neighbor struct + Address Address + ConnectionType string + NumberOfAllTransactions int64 + NumberOfInvalidTransactions int64 + NumberOfNewTransactions int64 + NumberOfRandomTransactionRequests int64 + NumberOfSentTransactions int64 + type PowFunc func(Trytes, int) (Trytes, error) + func GetBestPoW() (string, PowFunc) + type RemoveNeighborsRequest struct + Command string + URIS []string + type RemoveNeighborsResponse struct + Duration int64 + RemovedNeighbors int64 + type StoreTransactionsRequest struct + Command string + Trytes []Transaction + type Transaction struct + Address Address + AttachmentTimestamp Trytes + AttachmentTimestampLowerBound Trytes + AttachmentTimestampUpperBound Trytes + BranchTransaction Trytes + Bundle Trytes + CurrentIndex int64 + LastIndex int64 + Nonce Trytes + ObsoleteTag Trytes + SignatureMessageFragment Trytes + Tag Trytes + Timestamp time.Time + TrunkTransaction Trytes + Value int64 + func NewTransaction(trytes Trytes) (*Transaction, error) + func (t *Transaction) HasValidNonce(mwm int64) bool + func (t *Transaction) Hash() Trytes + func (t *Transaction) MarshalJSON() ([]byte, error) + func (t *Transaction) Trytes() Trytes + func (t *Transaction) UnmarshalJSON(b []byte) error + type Transfer struct + Address Address + Message Trytes + Tag Trytes + Value int64 + type Trits []int8 + func BytesToTrits(b []byte) (Trits, error) + func Digests(key Trits) (Trits, error) + func Int2Trits(v int64, size int) Trits + func ToTrits(t []int8) (Trits, error) + func (t Trits) Bytes() ([]byte, error) + func (t Trits) CanTrytes() bool + func (t Trits) Equal(b Trits) bool + func (t Trits) Int() int64 + func (t Trits) IsValid() error + func (t Trits) IsValidLength() bool + func (t Trits) TrailingZeros() int64 + func (t Trits) Trytes() Trytes + type Trytes string + func FromString(s string) (Trytes, error) + func NewKey(seed Trytes, index, securityLevel int) (Trytes, error) + func NewSeed() Trytes + func PowC(trytes Trytes, mwm int) (Trytes, error) + func PowGo(trytes Trytes, mwm int) (Trytes, error) + func PowSSE(trytes Trytes, mwm int) (Trytes, error) + func Sign(normalizedBundleFragment []int8, keyFragment Trytes) Trytes + func ToTrytes(t string) (Trytes, error) + func (t Trytes) Hash() Trytes + func (t Trytes) IsValid() error + func (t Trytes) Normalize() []int8 + func (t Trytes) ToAddress() (Address, error) + func (t Trytes) Trits() Trits