hedera

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2018 License: Apache-2.0 Imports: 5 Imported by: 3

README

Hedera Go SDK

Hedera SDK for Go

Requirements

  • Go 1.11+

  • Git LFS – Git LFS is used to version the built libraries in ./libs (built from hedera-sdk-rust). This must be installed on your system prior to go get.

    • MacOS (homebrew)

      $ brew install git-lfs
      $ git lfs install
      
    • Ubuntu / Debian

      $ sudo apt install git-lfs
      $ git lfs install
      
    • Windows

      Download and run git-lfs.exe. Open your git console ( under Git Bash if you installed Git through https://git-scm.com/ ).

      $ git lfs install
      

Install

$ go get github.com/hashgraph/hedera-sdk-go

Development

Requirements
  • rustup

  • musl

    • MacOS

      $ brew install FiloSottile/musl-cross/musl-cross
      
  • MinGW

    • MacOS

      $ brew install mingw-w64
      
Build
$ ./x.py

License

Licensed under Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountID

type AccountID struct {
	Realm   int64 `json:"realm"`
	Shard   int64 `json:"shard"`
	Account int64 `json:"account"`
}

func AccountIDFromString

func AccountIDFromString(s string) (AccountID, error)

func NewAccountID deprecated

func NewAccountID(realm, shard, account int64) AccountID

Deprecated: Use AccountID{realm, shard, account} instead.

func (AccountID) String added in v0.2.0

func (id AccountID) String() string

type Client

type Client struct {
	// contains filtered or unexported fields
}

func Dial

func Dial(address string) (Client, error)

func (Client) Account added in v0.2.0

func (client Client) Account(id AccountID) PartialAccountMessage

func (Client) Close

func (client Client) Close()

func (Client) CreateAccount

func (client Client) CreateAccount() TransactionCryptoCreate

func (Client) CryptoTransfer deprecated

func (client Client) CryptoTransfer() TransactionCryptoTransfer

Deprecated: Use Client.TransferCrypto() instead

func (Client) GetAccountBalance deprecated

func (client Client) GetAccountBalance(id AccountID) QueryCryptoGetAccountBalance

Deprecated: Use Client.Account(id).Balance() instead

func (Client) GetTransactionReceipt deprecated

func (client Client) GetTransactionReceipt(id *TransactionID) QueryGetTransactionReceipt

Deprecated: Use Client.Transaction(id).Receipt() instead

func (Client) Transaction added in v0.2.0

func (client Client) Transaction(id TransactionID) PartialTransactionMessage

func (Client) TransferCrypto added in v0.2.0

func (client Client) TransferCrypto() TransactionCryptoTransfer

type ContractID added in v0.2.0

type ContractID struct {
	Realm    int64 `json:"realm"`
	Shard    int64 `json:"shard"`
	Contract int64 `json:"contract"`
}

func ContractIDFromString added in v0.2.0

func ContractIDFromString(s string) (ContractID, error)

func (ContractID) String added in v0.2.0

func (id ContractID) String() string

type FileID added in v0.2.0

type FileID struct {
	Realm int64 `json:"realm"`
	Shard int64 `json:"shard"`
	File  int64 `json:"file"`
}

func FileIDFromString added in v0.2.0

func FileIDFromString(s string) (FileID, error)

func (FileID) String added in v0.2.0

func (id FileID) String() string

type PartialAccountMessage added in v0.2.0

type PartialAccountMessage struct {
	// contains filtered or unexported fields
}

func (PartialAccountMessage) Balance added in v0.2.0

type PartialTransactionMessage added in v0.2.0

type PartialTransactionMessage struct {
	// contains filtered or unexported fields
}

func (PartialTransactionMessage) Receipt added in v0.2.0

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

func PublicKeyFromString

func PublicKeyFromString(s string) (PublicKey, error)

func (PublicKey) String

func (public PublicKey) String() string

func (PublicKey) Verify

func (public PublicKey) Verify(message []byte, signature Signature) (bool, error)

type QueryCryptoGetAccountBalance added in v0.2.0

type QueryCryptoGetAccountBalance struct {
	// contains filtered or unexported fields
}

func (QueryCryptoGetAccountBalance) Answer deprecated added in v0.2.0

func (query QueryCryptoGetAccountBalance) Answer() (uint64, error)

Deprecated: Use Query.Get() instead

func (QueryCryptoGetAccountBalance) Cost added in v0.2.0

func (q QueryCryptoGetAccountBalance) Cost() (uint64, error)

func (QueryCryptoGetAccountBalance) Get added in v0.2.0

func (query QueryCryptoGetAccountBalance) Get() (uint64, error)

type QueryGetTransactionReceipt

type QueryGetTransactionReceipt struct {
	// contains filtered or unexported fields
}

func (QueryGetTransactionReceipt) Answer deprecated

Deprecated: Use Query.Get() instead

func (QueryGetTransactionReceipt) Cost added in v0.2.0

func (q QueryGetTransactionReceipt) Cost() (uint64, error)

func (QueryGetTransactionReceipt) Get added in v0.2.0

type RawTransaction added in v0.2.0

type RawTransaction struct {
	// contains filtered or unexported fields
}

func (RawTransaction) Execute added in v0.2.0

func (tx RawTransaction) Execute() (TransactionID, error)

func (RawTransaction) Sign added in v0.2.0

type SecretKey

type SecretKey struct {
	// contains filtered or unexported fields
}

func GenerateSecretKey

func GenerateSecretKey() SecretKey

func SecretKeyFromString

func SecretKeyFromString(s string) (SecretKey, error)

func (SecretKey) Public

func (secret SecretKey) Public() PublicKey

func (SecretKey) Sign

func (secret SecretKey) Sign(message []byte) (Signature, error)

func (SecretKey) String

func (secret SecretKey) String() string

type Signature

type Signature struct {
	// contains filtered or unexported fields
}

func SignatureFromString

func SignatureFromString(s string) (Signature, error)

func (Signature) String

func (signature Signature) String() string

type TransactionCryptoCreate added in v0.2.0

type TransactionCryptoCreate struct {
	// contains filtered or unexported fields
}

func (TransactionCryptoCreate) Execute added in v0.2.0

func (tx TransactionCryptoCreate) Execute() (TransactionID, error)

func (TransactionCryptoCreate) InitialBalance added in v0.2.0

func (tx TransactionCryptoCreate) InitialBalance(balance uint64) TransactionCryptoCreate

func (TransactionCryptoCreate) Key added in v0.2.0

func (TransactionCryptoCreate) Memo added in v0.2.0

func (TransactionCryptoCreate) Node added in v0.2.0

func (TransactionCryptoCreate) Operator added in v0.2.0

func (TransactionCryptoCreate) Sign added in v0.2.0

func (tx TransactionCryptoCreate) Sign(key SecretKey) RawTransaction

type TransactionCryptoTransfer

type TransactionCryptoTransfer struct {
	// contains filtered or unexported fields
}

func (TransactionCryptoTransfer) Execute added in v0.2.0

func (tx TransactionCryptoTransfer) Execute() (TransactionID, error)

func (TransactionCryptoTransfer) Memo

func (TransactionCryptoTransfer) Node

func (TransactionCryptoTransfer) Operator

func (TransactionCryptoTransfer) Sign

func (tx TransactionCryptoTransfer) Sign(key SecretKey) RawTransaction

func (TransactionCryptoTransfer) Transfer

type TransactionID

type TransactionID struct {
	// Deprecated: The response is already a TransactionID
	ID *TransactionID

	AccountID             AccountID
	TransactionValidStart time.Time
}

func TransactionIDFromString

func TransactionIDFromString(s string) (TransactionID, error)

func (TransactionID) String

func (id TransactionID) String() string

type TransactionReceipt

type TransactionReceipt struct {
	Status     TransactionStatus
	AccountID  *AccountID
	ContractID *ContractID
	FileID     *FileID
}

type TransactionStatus

type TransactionStatus uint8
const (
	TransactionStatusUnkown      TransactionStatus = 0
	TransactionStatusSuccess     TransactionStatus = 1
	TransactionStatusFailInvalid TransactionStatus = 2
	TransactionStatusFailFee     TransactionStatus = 3
	TransactionStatusFailBalance TransactionStatus = 4
)

func (TransactionStatus) String

func (status TransactionStatus) String() string

Directories

Path Synopsis
examples
create_account command
crypto_transfer command
generate_keys command
tck module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL