hedera

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

README

https://github.com/QuestofIranon/hedera-sdk-go.git# Hedera SDK for Go

GoDoc

This repo contains the Go SDK for interacting with the Hedera platform. Hedera is the only public distributed ledger licensed to use the Hashgraph consensus algorithm for fast, fair and secure transactions. By using any of the Hedera SDKs, developers will be empowered to build an entirely new class of decentralized applications.

Following the instructions below should help you to reach the position where you can send transactions and queries to a Hedera testnet or the Hedera mainnet.

Table of Contents


Developer Rewards

Developers who create Hedera accounts and test their applications on our testnet will be offered the opportunity to earn real mainnet (hbars) based upon that testing activity. The SDKs are intended to facilitate application development and encourage such testing. See the Hedera Account section for further details.

Developers who create Hedera accounts and test their applications on our testnet are offered the opportunity to earn real mainnet (hbars) based upon that testing activity. The SDKs are intended to facilitate application development and encourage such testing. See the Hedera Account section for further details.

Hbars:

Hbars are the native cryptocurrency that is used to pay for transactions on the Hedera platform and to secure the network from certain types of cyberattacks. They are the native platform coin needed to interact with and exchange value on Hedera.

The symbol for hbars is "" so 5 ℏ means 5 hbars

Tinybars:

Tinybars are (not surprisingly) smaller than hbars. They are used to divide hbars into smaller amounts. One hbar is equivalent to one hundred million tinybars.

The symbol for tinybars is "tℏ" so it is correct to say 1 ℏ = 100,000,000 tℏ

Important Note: The values of all fees and transfers throughout the Hedera SDKs are represented in tinybars, though the term hbars may be used for the purposes of brevity.

Architectural Overview

All Hedera SDKs are intended to provide a developer-friendly means to leverage the Hedera API, which is based on Google Protobuf. Protobuf supports code generation for a growing number of languages and is highly optimised for efficient communications. For those interesting in viewing the underlying protobuf message definitions, see the Hedera Protobuf Message Definitions repo.

Developers who wish to work in other languages are at liberty to do so, but should be aware that implementation of cryptographic key generation and manipulation is not a trivial undertaking. The source code for the cryptography libraries used by this project can be found in the Hedera SDK for Rust repository although they are compiled to C for inclusion in this project. We would recommend use of these same libraries for developers interested in adding support for other languages.

Prerequisites

Software

  • Go – version 1.11 or higher (download here).

    • Installation instructions for Go can be found here.
    • An introduction to the Go programming language can be found here.
  • Git LFS is used to assist dependency and version management, speeding up repo cloning. In the case of this project, libraries built from the Hedera SDK for Rust project are included in ./libs. It is important that Git LFS be installed before the running go get... command below.

    • Installing Git LFS on Mac OS X (using homebrew). Run the following commands from a terminal window:

      brew install git-lfs
      git lfs install
      
    • Installing Git LFS on Ubuntu or Debian. Run the following commands from a terminal window:

      sudo apt install git-lfs
      git lfs install
      
    • Installing Git LFS on Windows

      Download and run git-lfs.exe. Open your git console – under Git Bash if you installed Git through git-scm.com.

      git lfs install
      

Hedera Account

The Hedera Portal allows people to create a Hedera Account facilitating access to the Hedera mainnet and Hedera testnets. A Hedera Account allows entry of a testnet access code, in order to add a number of testnet (hbars) to a testnet account created (as can be seen below) using Hedera SDKs. The public key associated with a testnet account must also be associated with your Hedera account. A detailed explanation of this whole process is contained within this document.

  • In order to gain early access (before Open Access) to a Hedera testnet or the Hedera mainnet users must create a Hedera account, including full identity verification. You can do this using the Hedera Portal.
  • We want to allow devs to earn (hbars) by helping us to test our SDKs. Hedera is based in the USA, so for us to be allowed to do this under US law we need to verify your identity as a part of the account creation process.

A full explanation of the Portal, Hedera accounts, identity verification and many other topics can be found at Hedera Help. New users should head for the Getting Started section.

Hedera testnet access

A Hedera testnet provides a test environment for testing your code without having to spend "real" mainnet (hbars). Testnet hbars are akin to "monopoly money" and have no intrinsic value, but testing against testnets will help you earn real mainnet ℏ (hbars). It is worth noting that the virtual infrastructure used to provide testnets is not intended for performance testing, as the specification of nodes is not in any way equivalent to that of mainnet nodes. Further information on this topic is included within the "Testnet Performance and Throttling" section further on in these instructions.

  • Once you have your Hedera account set up, you can request access to Hedera test networks by filling out the form here.
  • Check for answers to your testnet-related questions in the Testnet Activation section on this page.
  • Please note that there is a waiting list for testnet access; please be patient. If you haven't had a response withing 10 days, reach out to to the team on discord.
  • Once you have received a testnet access code, enter it into the testnet access box and push the proceed/arrow button. You should see a message "Access code confirmed. By activating this code you will switch to testnetXXX with a starting value of 1000 hbars." Please note that these are testnet hbars and should not to be confused with mainnet hbars.
  • Pushing the "Activate and switch network" button will credit your testnet account with those testnet hbars and switch the portal to the testnet. You can switch the portal between mainnet and testnet at any time by using the drop-down at the top of the page.

Installing the Hedera SDK for Go

To clone the repo and all required dependencies, run the following command from a terminal window. Note that this command will create a files and folders from within your current folder.

Remember that the software prerequisites described above must be installed before proceeding.

go get github.com/launchbadge/hedera-sdk-go

Creating a public/private keypair for testnet use

As a general principle, it is bad practice to use your mainnet keys on a testnet. The code below shows the content of the generate_key example file. This shows how you can create new public and private keys using the Hedera SDK for Go:

package main

import (
  "fmt"
  "github.com/launchbadge/hedera-sdk-go"
)

func main() {
  secret, mnemonic := hedera.GenerateSecretKey()
  fmt.Printf("secret   = %v\n", secret)
  fmt.Printf("mnemonic = %v\n", mnemonic)

  public := secret.Public()
  fmt.Printf("public   = %v\n", public)
}
  • It can be executed from a terminal window by changing to the examples/generate_key folder and typing:
go run main.go
  • Make careful note of the 24-word mnemonic and both of the keys that are generateed. For a testnet you can copy and paste this information into a text file. For security reasons you should never do this for mainnet.

Development Environment Note

All of the commands described in these instructions can also be executed using an IDE – such as VSCode or Goland, or editors such as Atom – according to each developer's preferences and budget. Hedera has no affiliation with the companies providing these or other equivalent tools.

Throughout these instructions you'll find the phrase "Run the following command from a terminal window." Feel free to use your IDE whenever you see this – if that's how you prefer to work. Terminal is used in this document to avoid ambiguity.

Associating your public key with your Hedera testnet account

Once you have generated a public/private keypair as described above, you need to link the public key to your Hedera testnet account. To do this, return to the Hedera portal and ensure that you have the testnet selected in the drop-down at the top of the page.

You should see the box asking you to Enter your Public Key. Copy the long hex value of the public key and paste it into that textbox in the portal. Do make sure you that you select all of the characters. Click Submit.

You should briefly see an "Account Pending" message, which will be replaced with an Account ID box. You should make a note of your account ID - perhaps in the same text file where you have stored your public and private testnet keys.

All Hedera IDs consist of three numbers (int64s) separated by the "." symbol. The three numbers represent Shard number, Realm number and Account number respectively. Shards and Realms are not yet in use so expect the first two numbers to be zeros.

You should also scroll down until you see a box labelled "Network" and make a note of the Address, which will be something like testnet.hedera.com:50222. You should also take note of the Node, which represents the account ID of a node on the testnet; it will be something like 0.0.3.

Your First Hedera Application

Checking your account balance

A more complete example, which includes code fragments in this section can be found in the get_account_balance example file located in the examples folder of this repo. This simplified example is broken into bite-sized pieces here so that accompanying explanations can be seen in context alongside each fragment.

Create a new main.go file importing fmt (for Printf) and the Hedera SDK. The time package is also imported but commented here. This package will be required later in this example and can be un-commented when required by removing the preceding //.

It's also useful to create a variable oneHbar to represent the number of tinybars in one hbar:

package main

import (
  "fmt"
  //"time"
  "github.com/launchbadge/hedera-sdk-go"
)

func main() {

  oneHbar := 100000000

Create and set a myAccount variable, replacing 1234 with your own Account ID from the portal. Note that the Shard ID and Realm ID are not required at this time so they are defaulted to zero unless explicitly included. If the accountID shown in the portal is 0.0.1234 only the last number 1234 need be used. This is the account for which we will retrieve the balance.

  myAccount := hedera.AccountID{Account: 1234}

Next, you will want to establish a connection to the Hedera testnet using the Address you noted earlier from the network section shown on the Hedera portal. Make sure that the testnet address contained within the quotation marks matches the one you copied from the portal.

You should also handle any errors and defer disconnection from the tesnet to keep things clean and orderly.

  client, err := hedera.Dial("testnet.hedera.com:50222")
  if err == nil {
    defer client.Close()
  } else {
    panic(err)
  }

Once a connection has been established, you need to decide which node to send your query to. Testnets provide each developer with a single node's account ID (labelled node in the portal) in order to simplify this and limit testnet infrastructure burden. On mainnet it will be the responsibility of the application to choose a node - usually at random.

Node Account Defaults: The client.SetNode() function sets the default node account for all future transactions until changed and unless overridden. In these examples this is not strictly necessary as all of the transaction examples in this document include Node(nodeAccount). When using testnets, it is also worth noting that the SDK uses node account 0.0.3 by default – even when neither of these mechanisms is used.

The node account ID should look something like 0.0.3. Since Shard ID and Realm ID are not yet in use, they are defaulted to zero. It is the last number (in this example 3) that you should use in the following code:

  nodeAccount := hedera.AccountID{Account: 3}
  client.SetNode(nodeAccount)

It is also important to specify which account is initiating this query – known as the operator account – so that the account can be charged a small fee for the execution of this query. In order to authorise the payment of such a fee, the operator must sign the request using their private key.

Security Tip: In the get_account_balance example file located in the examples folder, the os.Getenv("OPERATOR_SECRET") function is used. This retrieves the private key from an environment variable called OPERATOR_SECRET. It is good practice to use this technique, as it avoids accidental publication of private keys when storing code in public repos or sharing them accidentally via collaboration tools. Don't forget: If someone else knows your private key, they effectively own your account! Although the impact of this is low when using testnets, it could be a very expensive mistake on mainnet. For purposes of clarity, the example below has been simplified and does not use an environment variable

Replace <my-private-key> with the private key you generated near the beginning of these instructions.

  operatorSecret, err := hedera.SecretKeyFromString("<my-private-key>")
  if err != nil {
    panic(err)
  }
  client.SetOperator(myAccount, func() hedera.SecretKey {
    return operatorSecret
  })

Again, note that the client.SetOperator() function is used to set the default operator account for subsequent transactions. This is not necessary if both Operator() and Sign() are used when creating the transaction, but is included here in order to explain both approaches.

At this point, you're ready to query your account balance. The client.Account(myAccount).Balance() constructs the request; adding .Get() executes that request. Once again, don't forget to handle possible failures.

You can the output the balance using fmt.Printf and end the program by closing the braces for func main.

For illustrative purposes, we're showing the balance in tinybars and hbars. The Hedera SDKs represent all quantities for transfers and fees as integers using tinybars. There are one hundred million (100,000,000) tinybars in one hbar.

  myBalance, err := client.Account(myAccount).Balance().Get()
  if err != nil {
    panic(err)
  }

  fmt.Printf("Account %v balance = %v tinybars\n", myAccount.Account, myBalance)
  fmt.Printf("Account %v balance = %.5f hbars\n", myAccount.Account, float64(myBalance)/float64(oneHbar))
}

You should now be able to run your first Hedera program by executing go run main.go from terminal.

If everything went according to plan you should see something like this:

Account 1234 balance = 100500005000 tinybars
Account 1234 balance = 1005.00005 hbars
Testnet performance and throttling

For the present, our testnets have been throttled, allowing a limited number of Hedera transactions per account per second. We're using virtual infrastructure to support the huge demand we have had for testnet access, and prefer to foster innovative use of these resources and discourage folks from trying to generate metrics using underspecified hardware.

If you see error messages like transaction failed the pre-check: Busy, it is likely that you are exceeding these throttling thresholds. To avoid such errors, short delays can be added. To add a one second delay, for example, use the following code between transactions or queries:

 time.Sleep(1 * time.Second)

Don't forget to remove the // comment symbols before "time" (in the import section at the beginning of the program) to gain access to the functions in the go time package. Some IDEs will automatically add missing packages when detected, so don't be surprised if you find that a new "time" line has appeared alongside //"time".

Enhance your application to check a friend's account balance

If you know the account ID of another account on your testnet – perhaps a friend or colleague – you can also check their balance.

Creating an additional testnet account

If your friends won’t share their accounts, or if you don’t have any friends, see the Create Account Example included in this repo.

If you do choose to create an account using that example, don't forget to do the following:

  1. Create a local environment variable OPERATOR_SECRET that contains your private key.
  2. Adjust the nodeAccountID variable to the ID you see in the portal.
  3. Update the testnet.hedera.com:... testnet address to the correct one.
  4. Change the operatorAccountID variable value to your own testnet account ID.
  5. Change the InitialBalance to an acceptable quantity of testnet tinybars.
  • For the purposes of this example, an Account ID of 0:0:1235 will be used for that second account. Don't forget to amend 1235 to the account number of your friend's account. If you forget to do this will you will probably see a transaction failed the pre-check: InvalidAccount message.

  • To continue with this example, add the following code into your existing func main function, just before the closing braces:

  • As mentioned above, we will add a small delay to ensure that we do not exceed testnet throttling limits. For brevity, this statement will be included without further comment in all subsequent examples. If you get an error here, you need to remove the // before "time" in the import block near the beginning of the program.

  • Before executing any transfers, you can initialise a second variable friendAccount representing the second account, query its balance and output the result.

  time.Sleep(1 * time.Second)

  friendAccount := hedera.AccountID{Account: 1235}

  friendBalance, err := client.Account(friendAccount).Balance().Get()
  if err != nil {
    panic(err)
  }

  fmt.Printf("Account %v balance = %v tinybars\n", friendAccount.Account, friendBalance)
  fmt.Printf("Account %v balance = %.5f hbars\n", friendAccount.Account, float64(friendBalance)/float64(oneHbar))
  • Run the program again by executing go run main.go from terminal.

  • You should see your balance followed by your friend's balance.

Transaction and Query Fees

Note that your balance will decrease slightly each time you execute your code. This is due to the small fees associated with each query or transaction on the Hedera platform. On a testnet, this is not all that important, but it's worth keeping on mind when using mainnet.

Next step: Transferring hbars to a friend's account

  • A transferAmount variable can be used to make the next steps more readable. In this case, we'll transfer 10 ℏ and output details of the intended transaction.
  transferAmount := int64(10 * oneHbar)
  fmt.Printf("Starting transfer of %v tinybars from Account %v to Account %v\n", transferAmount, myAccount.Account, friendAccount.Account)
  • It is worth re-stating that a secret key (also known as private key) is required in order to transfer hbars from an account. Separate signatures are required for the operator account and each Transfer line with a negative amount – even if they're the same account.

  • The next statement is a little more complex so each line is explained individually below the code.

  transaction, err := client.CryptoTransfer().
    Transfer(myAccount, -transferAmount).
    Transfer(friendAccount, transferAmount).
    Operator(myAccount).
    Node(nodeAccount).
    Memo("My first transfer of hbars! w00t!").
    Sign(operatorSecret).
    Sign(operatorSecret).
    Execute()
    if err != nil {
      panic(err)
    }
Explanation of the above code block by line number

1. transaction, err := client.CryptoTransfer(). creates a transaction to transfer hbars between accounts.

2. Transfer(myAccount, -transferAmount). sets up part of the transfer. In this case from your account. Note that the "-" (minus sign) denotes that hbars will be deducted from this account.

3. Transfer(friendAccount, transferAmount). sets up the second part of this transfer. In this case to your friend's account. A positive number indicates that this account will be incremented by the specified amount.

4. Operator(myAccount). specifies the account initiating the transaction and to which transaction fees will be charged.

5. Node(nodeAccount). indicates the node to which this transaction and associated fee payments will be sent.

6. Memo("My first transfer of hbars! w00t!"). assigns a label to the transaction of up to 100 bytes. Use of this field is at the developer's discretion and does not affect the behaviour of the plaform.

7. Sign(operatorSecret). adds a signature for the operator account. This is required as fees will be deducted from this account.

8. Sign(operatorSecret). adds a signature for the account from which hbars will de debited. In this case the operator account is the same as the account sending hbars so the same signature can be re-used.

9. Execute() executes the transaction.

If the client.SetOperator() function is used to set the default operator as illustrated above, lines 4 and 7 can be omitted. If the client.SetNode() function is used to set the default node as illustrated above, line 5 can also be omitted.

Multi-party transfers

It is possible to create a transfer transaction containing multiple to and multiple _from_accounts within that same transaction. In a case where multiple accounts were to be debited, signatures would be required for each one, and addition Sign(...). lines would be required.

Important: the sum of all amounts in Transfer(...) lines contained within in a CryptoTransfer must add up to zero.

  • The transaction is made up of the account ID and the transaction timestamp – right down to nanoseconds, which uniquely identifies it.

  • It makes sense to wait a little longer (2 seconds) after sending the transaction, so that the Hedera network can reach consensus on the transaction.

  fmt.Printf("Transfer Sent. Transaction ID is %v\n", transaction.String())

  time.Sleep(2 * time.Second)
  • To confirm that the transaction succeeded a receipt can be requested. Although this is not a mandatory step, it does verify that this transaction successfully reached network consensus.
  receipt, err := client.Transaction(transaction).Receipt().Get()
  if err != nil {
    panic(err)
  }

  if receipt.Status == hedera.StatusSuccess {
    fmt.Printf("Transaction Successful. Consensus confirmed.\n")
  } else {
    panic(fmt.Errorf("Transaction unsuccessful. Status: %v", receipt.Status.String()))
  }

  time.Sleep(1 * time.Second)
  • Finally, the balances of both accounts can be required to verify that the 10 ℏ was indeed transferred from your account to that of your friend.
  myBalance, err = client.Account(myAccount).Balance().Get()
  if err != nil {
    panic(err)
  }

  friendBalance, err = client.Account(friendAccount).Balance().Get()
  if err != nil {
    panic(err)
  }

  fmt.Printf("Account %v balance = %v tinybars\n", myAccount.Account, myBalance)
  fmt.Printf("Account %v balance = %.5f hbars\n", myAccount.Account, float64(myBalance)/float64(oneHbar))
  fmt.Printf("Account %v balance = %v tinybars\n", friendAccount.Account, friendBalance)
  fmt.Printf("Account %v balance = %.5f hbars\n", friendAccount.Account, float64(friendBalance)/float64(oneHbar))
  • Run the program again by executing go run main.go from terminal.

  • You should now see both balances prior to the transfer followed by details of the transfer including success/failure. You should then be able to see the balances of both accounts after the transfer, demonstrating that 10 ℏ has been transferred from your account to you friend's account. Hopefully it looks something like this:

Account 1234 balance = 96495305000 tinybars
Account 1234 balance = 964.95305 hbars
Account 1235 balance = 4000000000 tinybars
Account 1235 balance = 40.00000 hbars
Transfering 1000000000 tinybars from Account 1234 to Account 1235
Transfer Sent. Transaction ID is 0:0:1234@1548679850.429332000
Transaction Successful. Consensus confirmed.
Account 1234 balance = 95494805000 tinybars
Account 1234 balance = 954.94805 hbars
Account 1235 balance = 5000000000 tinybars
Account 1235 balance = 50.00000 hbars

Other resources

  • For an explanation of the underlying hashgraph algorithm, please consult our whitepaper or Dr. Leemon Baird's 52-minute Simple Explanation video.
  • Links to all Hedera news and information can be found in at Hedera Help – including Coq validation of the hashgraph ABFT algorithm.
  • 300+ Hedera interviews and videos on YouTube. Thanks to Arvydas – a Hedera MVP – for curating this list.

Deeper Development

Requirements

  • rustup

  • musl

    • Mac OS X

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

    • Mac OS X

      brew install mingw-w64
      
Build
./x.py

Getting in touch

Please reach out to us on the Hedera discord channels. We're fortunate to have an active community of over 5000 like-minded devs, who are passionate about our tech. The Hedera Developer Advocacy team also participates actively.

Contributing to this Project

We welcome participation from all developers! For instructions on how to contribute to this repo, please review the Contributing Guide.

License Information

Licensed under Apache License, Version 2.0 – see LICENSE in this repo or apache.org/licenses/LICENSE-2.0

Documentation

Index

Constants

View Source
const (
	SELECTOR_LEN     = 4
	SELECTOR_LEN_HEX = 8
)
View Source
const (
	ADDRESS_LEN     = 20
	ADDRESS_LEN_HEX = ADDRESS_LEN * 2
)

Variables

This section is empty.

Functions

func AddressForAccount added in v0.4.0

func AddressForAccount(accountID AccountID) (string, error)

func AddressForContract added in v0.4.0

func AddressForContract(contractID ContractID) (string, error)

func AddressForFile added in v0.4.0

func AddressForFile(fileID FileID) (string, error)

func CheckAddressLen added in v0.4.0

func CheckAddressLen(address []byte) error

func DecodeAddress added in v0.4.0

func DecodeAddress(address string) ([]byte, error)

func Keccak256 added in v0.4.0

func Keccak256(data ...[]byte) []byte

Types

type AccountID

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

func AccountIDFromAddress added in v0.4.0

func AccountIDFromAddress(b []byte) (AccountID, error)

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

func (id AccountID) String() string

type Argument added in v0.4.0

type Argument struct {
	Value   []byte
	Dynamic bool
}

func NewArgument added in v0.4.0

func NewArgument(value []byte, dynamic bool) (*Argument, error)

type CallParams added in v0.4.0

type CallParams struct {
	Args []Argument
	// contains filtered or unexported fields
}

func NewCallParams added in v0.4.0

func NewCallParams(fs *FunctionSelector) *CallParams

func NewConstructorCallParams added in v0.4.0

func NewConstructorCallParams() *CallParams

func (*CallParams) AddAddress added in v0.4.0

func (cp *CallParams) AddAddress(address []byte) error

func (*CallParams) AddAddressArray added in v0.4.0

func (cp *CallParams) AddAddressArray(addresses [][]byte) error

func (*CallParams) AddAddressString added in v0.4.0

func (cp *CallParams) AddAddressString(address string) error

func (*CallParams) AddAddressStringArray added in v0.4.0

func (cp *CallParams) AddAddressStringArray(addresses []string) error

func (*CallParams) AddBigInt added in v0.4.0

func (cp *CallParams) AddBigInt(value big.Int, width int) error

func (*CallParams) AddBitIntArray added in v0.4.0

func (cp *CallParams) AddBitIntArray(value []big.Int, width int) error

func (*CallParams) AddBool added in v0.4.0

func (cp *CallParams) AddBool(b bool) error

func (*CallParams) AddByteArray added in v0.4.0

func (cp *CallParams) AddByteArray(param [][]byte) error

func (*CallParams) AddByteFixedArray added in v0.4.0

func (cp *CallParams) AddByteFixedArray(param [][]byte, fixedLen int) error

func (*CallParams) AddBytes added in v0.4.0

func (cp *CallParams) AddBytes(param []byte) error

func (*CallParams) AddFixedAddressArray added in v0.4.0

func (cp *CallParams) AddFixedAddressArray(addresses [][]byte, fixedLen int) error

func (*CallParams) AddFixedAddressStringArray added in v0.4.0

func (cp *CallParams) AddFixedAddressStringArray(addresses []string, fixedLen int) error

func (*CallParams) AddFixedBigIntArray added in v0.4.0

func (cp *CallParams) AddFixedBigIntArray(value []big.Int, width int, fixedLen int) error

func (*CallParams) AddFixedByteArray added in v0.4.0

func (cp *CallParams) AddFixedByteArray(param [][]byte, byteLen int) error

func (*CallParams) AddFixedByteFixedArray added in v0.4.0

func (cp *CallParams) AddFixedByteFixedArray(param [][]byte, fixedByteLen int, fixedLen int) error

func (*CallParams) AddFixedBytes added in v0.4.0

func (cp *CallParams) AddFixedBytes(param []byte, fixedLen int) error

func (*CallParams) AddFixedIntArray added in v0.4.0

func (cp *CallParams) AddFixedIntArray(value []int, width int, fixedLen int) error

func (*CallParams) AddFixedStringArray added in v0.4.0

func (cp *CallParams) AddFixedStringArray(param []string, fixedLen int) error

func (*CallParams) AddFixedUintArray added in v0.4.0

func (cp *CallParams) AddFixedUintArray(value []uint, width int, fixedLen int) error

func (*CallParams) AddFunction added in v0.4.0

func (cp *CallParams) AddFunction(address []byte, selector []byte) error

func (*CallParams) AddFunctionFS added in v0.4.0

func (cp *CallParams) AddFunctionFS(address string, selector FunctionSelector) error

func (*CallParams) AddFunctionString added in v0.4.0

func (cp *CallParams) AddFunctionString(address string, selector string) error

func (*CallParams) AddInt added in v0.4.0

func (cp *CallParams) AddInt(value int64, width int) error

func (*CallParams) AddIntArray added in v0.4.0

func (cp *CallParams) AddIntArray(value []int, width int) error

func (*CallParams) AddString added in v0.4.0

func (cp *CallParams) AddString(param string) error

func (*CallParams) AddStringArray added in v0.4.0

func (cp *CallParams) AddStringArray(param []string) error

func (*CallParams) AddUint added in v0.4.0

func (cp *CallParams) AddUint(value uint64, width int) error

func (*CallParams) AddUintArray added in v0.4.0

func (cp *CallParams) AddUintArray(value []uint, width int) error

func (*CallParams) ToProto added in v0.4.0

func (cp *CallParams) ToProto() ([]byte, error)

type Client

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

func Dial

func Dial(address string) (Client, error)

func (Client) Account

func (client Client) Account(id AccountID) PartialAccountMessage

func (Client) AppendFile added in v0.4.0

func (client Client) AppendFile(fileID FileID, content []byte) TransactionFileAppend

func (Client) CallContract added in v0.4.0

func (client Client) CallContract(contract ContractID) TransactionContractCall

func (Client) CallContractQuery added in v0.4.0

func (client Client) CallContractQuery(contract ContractID, gas int64, params []byte,
	maxResultSize int64) QueryContractCall

func (Client) Close

func (client Client) Close()

func (Client) CreateAccount

func (client Client) CreateAccount() TransactionCryptoCreate

func (Client) CreateContract added in v0.4.0

func (client Client) CreateContract() TransactionContractCreate

func (Client) CreateFile added in v0.4.0

func (client Client) CreateFile() TransactionFileCreate

func (Client) CryptoTransfer deprecated

func (client Client) CryptoTransfer() TransactionCryptoTransfer

Deprecated: Use Client.TransferCrypto() instead

func (Client) DeleteFile added in v0.4.0

func (client Client) DeleteFile(fileID FileID) TransactionFileDelete

func (Client) FileContents added in v0.4.0

func (client Client) FileContents(fileID FileID) QueryFileGetContents

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) QueryTransactionGetReceipt

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

func (Client) SetNode

func (client Client) SetNode(node AccountID)

func (Client) SetOperator

func (client Client) SetOperator(operator AccountID, secretCallback func() SecretKey)

func (Client) Transaction

func (client Client) Transaction(id TransactionID) PartialTransactionMessage

func (Client) TransferCrypto

func (client Client) TransferCrypto() TransactionCryptoTransfer

func (Client) UpdateContract added in v0.4.0

func (client Client) UpdateContract() TransactionContractUpdate

func (Client) UpdateFile added in v0.4.0

func (client Client) UpdateFile(fileID FileID) TransactionFileUpdate

type ContractFunctionResult added in v0.4.0

type ContractFunctionResult struct {
	Contract ContractID
	Result   []byte
	Error    string
	Bloom    []byte
	GasUsed  uint64
	LogInfo  []ContractLogInfo
}

func (*ContractFunctionResult) GetAddress added in v0.4.0

func (fr *ContractFunctionResult) GetAddress(valIndex int) []byte

func (*ContractFunctionResult) GetAddressArray added in v0.4.0

func (fr *ContractFunctionResult) GetAddressArray(valIndex int) []string

func (*ContractFunctionResult) GetBigInt added in v0.4.0

func (fr *ContractFunctionResult) GetBigInt(valIndex int) big.Int

func (*ContractFunctionResult) GetBool added in v0.4.0

func (fr *ContractFunctionResult) GetBool(valIndex int) bool

func (*ContractFunctionResult) GetByteArray added in v0.4.0

func (fr *ContractFunctionResult) GetByteArray(valIndex int) [][]byte

func (*ContractFunctionResult) GetBytes added in v0.4.0

func (fr *ContractFunctionResult) GetBytes(valIndex int) ([]byte, error)

func (*ContractFunctionResult) GetInt added in v0.4.0

func (fr *ContractFunctionResult) GetInt(valIndex int) int

func (*ContractFunctionResult) GetLong added in v0.4.0

func (fr *ContractFunctionResult) GetLong(valIndex int) int64

func (*ContractFunctionResult) GetString added in v0.4.0

func (fr *ContractFunctionResult) GetString(valIndex int) (string, error)

type ContractID

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

func ContractIDFromAddress added in v0.4.0

func ContractIDFromAddress(b []byte) (ContractID, error)

func ContractIDFromString

func ContractIDFromString(s string) (ContractID, error)

func (ContractID) String

func (id ContractID) String() string

type ContractLogInfo added in v0.4.0

type ContractLogInfo struct {
	Contract ContractID
	Bloom    []byte
	Topic    [][]byte
	Data     []byte
}

type Duration added in v0.4.0

type Duration struct {
	Seconds uint64
	Nanos   uint32
}

func NewDuration added in v0.4.0

func NewDuration(seconds uint64, nanos uint32) *Duration

type FileID

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

func FileIDFromAddress added in v0.4.0

func FileIDFromAddress(b []byte) (FileID, error)

func FileIDFromString

func FileIDFromString(s string) (FileID, error)

func (FileID) String

func (id FileID) String() string

type FunctionSelector added in v0.4.0

type FunctionSelector struct {
	NeedsComma bool
	Finished   []byte
	Complete   bool
}

func NewFunctionSelector added in v0.4.0

func NewFunctionSelector(function string) *FunctionSelector

func (*FunctionSelector) AddParamType added in v0.4.0

func (fs *FunctionSelector) AddParamType(paramType string)

func (*FunctionSelector) Finish added in v0.4.0

func (fs *FunctionSelector) Finish() []byte

func (*FunctionSelector) FinishIntermediate added in v0.4.0

func (fs *FunctionSelector) FinishIntermediate() []byte

type PartialAccountMessage

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

func (PartialAccountMessage) Balance

type PartialTransactionMessage

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

func (PartialTransactionMessage) Receipt

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 QueryContractCall added in v0.4.0

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

func (QueryContractCall) Execute added in v0.4.0

func (query QueryContractCall) Execute() (ContractFunctionResult, error)

type QueryCryptoGetAccountBalance

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

func (QueryCryptoGetAccountBalance) Answer deprecated

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

Deprecated: Use Query.Get() instead

func (QueryCryptoGetAccountBalance) Get

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

type QueryFileGetContents added in v0.4.0

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

func (QueryFileGetContents) GetContents added in v0.4.0

func (query QueryFileGetContents) GetContents() ([]byte, error)

type QueryTransactionGetReceipt

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

func (QueryTransactionGetReceipt) Answer deprecated

Deprecated: Use Query.Get() instead

func (QueryTransactionGetReceipt) Get

type RawTransaction

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

func (RawTransaction) Execute

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

func (RawTransaction) Sign

type SecretKey

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

func GenerateSecretKey

func GenerateSecretKey() (SecretKey, string)

func GenerateSecretKeyWithPassword

func GenerateSecretKeyWithPassword(password string) (SecretKey, string)

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 Status

type Status uint8
const (
	StatusOk                             Status = 0
	StatusInvalidTransaction             Status = 1
	StatusPayerAccountNotFound           Status = 2
	StatusInvalidNodeAccount             Status = 3
	StatusTransactionExpired             Status = 4
	StatusInvalidTransactionStart        Status = 5
	StatusInvalidTransactionDuration     Status = 6
	StatusInvalidSignature               Status = 7
	StatusMemoTooLong                    Status = 8
	StatusInsufficientTxFee              Status = 9
	StatusInsufficientPayerBalance       Status = 10
	StatusDuplicateTransaction           Status = 11
	StatusBusy                           Status = 12
	StatusNotSupported                   Status = 13
	StatusInvalidFileId                  Status = 14
	StatusInvalidAccountId               Status = 15
	StatusInvalidContractId              Status = 16
	StatusInvalidTransactionId           Status = 17
	StatusReceiptNotFound                Status = 18
	StatusRecordNotFound                 Status = 19
	StatusInvalidSolidityId              Status = 20
	StatusUnknown                        Status = 21
	StatusSuccess                        Status = 22
	StatusFailInvalid                    Status = 23
	StatusFailFee                        Status = 24
	StatusFailBalance                    Status = 25
	StatusKeyRequired                    Status = 26
	StatusBadEncoding                    Status = 27
	StatusInsufficientAccountBalance     Status = 28
	StatusInvalidSolidityAddress         Status = 29
	StatusInsufficientGas                Status = 30
	StatusContractSizeLimitExceeded      Status = 31
	StatusLocalCallModificationException Status = 32
	StatusContractRevertExecuted         Status = 33
	StatusContractExecutionException     Status = 34
	StatusInvalidReceivingNodeAccount    Status = 35
	StatusMissingQueryHeader             Status = 36
	StatusAccountUpdateFailed            Status = 37
	StatusInvalidKeyEncoding             Status = 38
	StatusNullSolidityAddress            Status = 39
	StatusContractUpdateFailed           Status = 40
	StatusInvalidQueryHeader             Status = 41
	StatusInvalidFeeSubmitted            Status = 42
	StatusInvalidPayerSignature          Status = 43
	StatusKeyNotProvided                 Status = 44
	StatusInvalidExpirationTime          Status = 45
	StatusNoWaclKey                      Status = 46
	StatusFileContentEmpty               Status = 47
	StatusInvalidAccountAmounts          Status = 48
	StatusEmptyTransactionBody           Status = 49
	StatusInvalidTransactionBody         Status = 50
	InvalidSignatureTypeMismatch         Status = 51
	InvalidSignatureCountMismatch        Status = 52
	EmptyClaimBody                       Status = 53
	EmptyClaimHash                       Status = 54
	EmptyClaimKeys                       Status = 55
	InvalidClaimHashSize                 Status = 56
	EmptyQueryBody                       Status = 57
	EmptyClaimQuery                      Status = 58
	ClaimNotFound                        Status = 59
	AccountIdDoesNotExist                Status = 60
	ClaimAlreadyExists                   Status = 61
	InvalidFileWACL                      Status = 62
	SerializationFailed                  Status = 63
	TransactionOversize                  Status = 64
	TransactionTooManyLayers             Status = 65
	ContractDeleted                      Status = 66
	PlatformNotActive                    Status = 67
	KeyPrefixMismatch                    Status = 68
	TransactionNotCreated                Status = 69
	InvalidRenewalPeriod                 Status = 70
	InvalidPayerAccount                  Status = 71
	AccountDeleted                       Status = 72
	FileDeleted                          Status = 73
	AccountRepeatedInAccountAmounts      Status = 74
	SettingNegativeAccountBalance        Status = 75
	ObtainerRequired                     Status = 76
	ObtainerSameContractId               Status = 77
	ObtainerDoesNotExist                 Status = 78
	ModifyingImmutableContract           Status = 79
	FileSystemException                  Status = 80
	AutorenewDurationNotInRange          Status = 81
	ErrorDecodingBytestring              Status = 82
	ContractFileEmpty                    Status = 83
	ContractBytecodeEmpty                Status = 84
	InvalidInitialBalance                Status = 85
	InvalidReceiveRecordThreshold        Status = 86
	InvalidSendRecordThreshold           Status = 87
	AccountIsNotGenesisAccount           Status = 88
	PayerAccountUnauthorized             Status = 89
	InvalidFreezeTransactionBody         Status = 90
	FreezeTransactionBodyNotFound        Status = 91
	TransferListSizeLimitExceeded        Status = 92
	ResultSizeLimitExceeded              Status = 93
	NotSpecialAccount                    Status = 94
	ContractNegativeGas                  Status = 95
	ContractNegativeValue                Status = 96
	InvalidFeeFile                       Status = 97
	InvalidExchangeRateFile              Status = 98
	InsufficientLocalCallGas             Status = 99
	EntityNotAllowedToDelete             Status = 100
	AuthorizationFailed                  Status = 101
	FileUploadedProtoInvalid             Status = 102
	FileUploadedProtoNotSavedToDisk      Status = 103
	FeeScheduleFilePartUploaded          Status = 104
	ExchangeRateChangeLimitExceeded      Status = 105
)

func (Status) String

func (status Status) String() string

type Timestamp added in v0.4.0

type Timestamp struct {
	Seconds int64
	Nanos   uint32
}

func TimeNow added in v0.4.0

func TimeNow() *Timestamp

func (*Timestamp) AddNanos added in v0.4.0

func (ts *Timestamp) AddNanos(nans uint32)

func (*Timestamp) AddSeconds added in v0.4.0

func (ts *Timestamp) AddSeconds(secs int64)

type TransactionContractCall added in v0.4.0

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

func (TransactionContractCall) Amount added in v0.4.0

func (TransactionContractCall) Execute added in v0.4.0

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

func (TransactionContractCall) Fee added in v0.4.0

func (tx TransactionContractCall) Fee(fee uint64) transaction

func (TransactionContractCall) Gas added in v0.4.0

func (TransactionContractCall) Memo added in v0.4.0

func (tx TransactionContractCall) Memo(memo string) transaction

func (TransactionContractCall) Node added in v0.4.0

func (tx TransactionContractCall) Node(id AccountID) transaction

func (TransactionContractCall) Operator added in v0.4.0

func (tx TransactionContractCall) Operator(id AccountID) transaction

func (TransactionContractCall) Parameters added in v0.4.0

func (tx TransactionContractCall) Parameters(params []byte) TransactionContractCall

func (TransactionContractCall) Sign added in v0.4.0

func (tx TransactionContractCall) Sign(key SecretKey) RawTransaction

type TransactionContractCreate added in v0.4.0

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

func (TransactionContractCreate) AdminKey added in v0.4.0

func (TransactionContractCreate) AutoRenew added in v0.4.0

func (TransactionContractCreate) ConstructorParams added in v0.4.0

func (tx TransactionContractCreate) ConstructorParams(params []byte) TransactionContractCreate

func (TransactionContractCreate) Execute added in v0.4.0

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

func (TransactionContractCreate) Fee added in v0.4.0

func (tx TransactionContractCreate) Fee(fee uint64) transaction

func (TransactionContractCreate) File added in v0.4.0

func (TransactionContractCreate) Gas added in v0.4.0

func (TransactionContractCreate) InitialBalance added in v0.4.0

func (tx TransactionContractCreate) InitialBalance(balance int64) TransactionContractCreate

func (TransactionContractCreate) Memo added in v0.4.0

func (tx TransactionContractCreate) Memo(memo string) transaction

func (TransactionContractCreate) Node added in v0.4.0

func (tx TransactionContractCreate) Node(id AccountID) transaction

func (TransactionContractCreate) Operator added in v0.4.0

func (tx TransactionContractCreate) Operator(id AccountID) transaction

func (TransactionContractCreate) ProxyAccount added in v0.4.0

func (TransactionContractCreate) Sign added in v0.4.0

func (tx TransactionContractCreate) Sign(key SecretKey) RawTransaction

type TransactionContractUpdate added in v0.4.0

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

func (TransactionContractUpdate) AdminKey added in v0.4.0

func (TransactionContractUpdate) Execute added in v0.4.0

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

func (TransactionContractUpdate) Fee added in v0.4.0

func (tx TransactionContractUpdate) Fee(fee uint64) transaction

func (TransactionContractUpdate) File added in v0.4.0

func (TransactionContractUpdate) Memo added in v0.4.0

func (tx TransactionContractUpdate) Memo(memo string) transaction

func (TransactionContractUpdate) Node added in v0.4.0

func (tx TransactionContractUpdate) Node(id AccountID) transaction

func (TransactionContractUpdate) Operator added in v0.4.0

func (tx TransactionContractUpdate) Operator(id AccountID) transaction

func (TransactionContractUpdate) ProxyAccount added in v0.4.0

func (TransactionContractUpdate) Sign added in v0.4.0

func (tx TransactionContractUpdate) Sign(key SecretKey) RawTransaction

type TransactionCryptoCreate

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

func (TransactionCryptoCreate) Execute

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

func (TransactionCryptoCreate) Fee added in v0.3.4

func (tx TransactionCryptoCreate) Fee(fee uint64) transaction

func (TransactionCryptoCreate) InitialBalance

func (tx TransactionCryptoCreate) InitialBalance(balance uint64) TransactionCryptoCreate

func (TransactionCryptoCreate) Key

func (TransactionCryptoCreate) Memo

func (TransactionCryptoCreate) Node

func (TransactionCryptoCreate) Operator

func (TransactionCryptoCreate) Sign

func (tx TransactionCryptoCreate) Sign(key SecretKey) RawTransaction

type TransactionCryptoTransfer

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

func (TransactionCryptoTransfer) Execute

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

func (TransactionCryptoTransfer) Fee added in v0.3.4

func (tx TransactionCryptoTransfer) Fee(fee uint64) transaction

func (TransactionCryptoTransfer) Memo

func (TransactionCryptoTransfer) Node

func (TransactionCryptoTransfer) Operator

func (TransactionCryptoTransfer) Sign

func (tx TransactionCryptoTransfer) Sign(key SecretKey) RawTransaction

func (TransactionCryptoTransfer) Transfer

type TransactionFileAppend added in v0.4.0

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

func (TransactionFileAppend) Execute added in v0.4.0

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

func (TransactionFileAppend) Fee added in v0.4.0

func (tx TransactionFileAppend) Fee(fee uint64) transaction

func (TransactionFileAppend) Memo added in v0.4.0

func (tx TransactionFileAppend) Memo(memo string) transaction

func (TransactionFileAppend) Node added in v0.4.0

func (tx TransactionFileAppend) Node(id AccountID) transaction

func (TransactionFileAppend) Operator added in v0.4.0

func (tx TransactionFileAppend) Operator(id AccountID) transaction

func (TransactionFileAppend) Sign added in v0.4.0

func (tx TransactionFileAppend) Sign(key SecretKey) RawTransaction

type TransactionFileCreate added in v0.4.0

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

func (TransactionFileCreate) Content added in v0.4.0

func (tx TransactionFileCreate) Content(content []byte) TransactionFileCreate

func (TransactionFileCreate) Execute added in v0.4.0

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

func (TransactionFileCreate) Expiration added in v0.4.0

func (TransactionFileCreate) Fee added in v0.4.0

func (tx TransactionFileCreate) Fee(fee uint64) transaction

func (TransactionFileCreate) Key added in v0.4.0

func (TransactionFileCreate) Memo added in v0.4.0

func (tx TransactionFileCreate) Memo(memo string) transaction

func (TransactionFileCreate) Node added in v0.4.0

func (tx TransactionFileCreate) Node(id AccountID) transaction

func (TransactionFileCreate) Operator added in v0.4.0

func (tx TransactionFileCreate) Operator(id AccountID) transaction

func (TransactionFileCreate) Sign added in v0.4.0

func (tx TransactionFileCreate) Sign(key SecretKey) RawTransaction

type TransactionFileDelete added in v0.4.0

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

func (TransactionFileDelete) Execute added in v0.4.0

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

func (TransactionFileDelete) Fee added in v0.4.0

func (tx TransactionFileDelete) Fee(fee uint64) transaction

func (TransactionFileDelete) Memo added in v0.4.0

func (tx TransactionFileDelete) Memo(memo string) transaction

func (TransactionFileDelete) Node added in v0.4.0

func (tx TransactionFileDelete) Node(id AccountID) transaction

func (TransactionFileDelete) Operator added in v0.4.0

func (tx TransactionFileDelete) Operator(id AccountID) transaction

func (TransactionFileDelete) Sign added in v0.4.0

func (tx TransactionFileDelete) Sign(key SecretKey) RawTransaction

type TransactionFileUpdate added in v0.4.0

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

func (TransactionFileUpdate) Execute added in v0.4.0

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

func (TransactionFileUpdate) Fee added in v0.4.0

func (tx TransactionFileUpdate) Fee(fee uint64) transaction

func (TransactionFileUpdate) Key added in v0.4.0

func (TransactionFileUpdate) Memo added in v0.4.0

func (tx TransactionFileUpdate) Memo(memo string) transaction

func (TransactionFileUpdate) Node added in v0.4.0

func (tx TransactionFileUpdate) Node(id AccountID) transaction

func (TransactionFileUpdate) Operator added in v0.4.0

func (tx TransactionFileUpdate) Operator(id AccountID) transaction

func (TransactionFileUpdate) Sign added in v0.4.0

func (tx TransactionFileUpdate) Sign(key SecretKey) RawTransaction

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     Status
	AccountID  *AccountID
	ContractID *ContractID
	FileID     *FileID
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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