hedera

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 33 Imported by: 3

README

Actions Status

Hedera™ Hashgraph Go SDK

The Go SDK for interacting with Hedera Hashgraph: the official distributed consensus platform built using the hashgraph consensus algorithm for fast, fair and secure transactions. Hedera enables and empowers developers to build an entirely new class of decentralized applications.

Hedera Hashgraph communicates using gRPC; the Protobufs definitions for the protocol are available in the hashgraph/hedera-protobuf repository.

Install

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

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 Aes128Ctr = "aes-128-ctr"
View Source
const HmacSha256 = "hmac-sha256"

Variables

View Source
var HbarUnits = struct {
	Tinybar  HbarUnit
	Microbar HbarUnit
	Millibar HbarUnit
	Hbar     HbarUnit
	Kilobar  HbarUnit
	Megabar  HbarUnit
	Gigabar  HbarUnit
}{
	Tinybar:  HbarUnit("tinybar"),
	Microbar: HbarUnit("microbar"),
	Millibar: HbarUnit("millibar"),
	Hbar:     HbarUnit("hbar"),
	Kilobar:  HbarUnit("kilobar"),
	Megabar:  HbarUnit("megabar"),
	Gigabar:  HbarUnit("gigabar"),
}
View Source
var MaxHbar = Hbar{math.MaxInt64}
View Source
var MinHbar = Hbar{math.MinInt64}
View Source
var ZeroHbar = Hbar{0}

Functions

This section is empty.

Types

type AccountBalanceQuery added in v0.5.0

type AccountBalanceQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

AccountBalanceQuery gets the balance of a CryptoCurrency account. This returns only the balance, so it is a smaller and faster reply than AccountInfoQuery, which returns the balance plus additional information.

func NewAccountBalanceQuery added in v0.5.0

func NewAccountBalanceQuery() *AccountBalanceQuery

NewAccountBalanceQuery creates an AccountBalanceQuery builder which can be used to construct and execute an AccountBalanceQuery. It is recommended that you use this for creating new instances of an AccountBalanceQuery instead of manually creating an instance of the struct.

func (*AccountBalanceQuery) Execute added in v0.5.0

func (builder *AccountBalanceQuery) Execute(client *Client) (Hbar, error)

Execute executes the AccountBalanceQuery using the provided client

func (*AccountBalanceQuery) SetAccountID added in v0.5.0

func (builder *AccountBalanceQuery) SetAccountID(id AccountID) *AccountBalanceQuery

SetAccountID sets the AccountID for which you wish to query the balance.

Note: you can only query an Account or Contract but not both -- if a Contract ID or Account ID has already been set, it will be overwritten by this method.

func (*AccountBalanceQuery) SetContractID added in v0.7.0

func (builder *AccountBalanceQuery) SetContractID(id ContractID) *AccountBalanceQuery

SetContractID sets the ContractID for which you wish to query the balance.

Note: you can only query an Account or Contract but not both -- if a Contract ID or Account ID has already been set, it will be overwritten by this method.

func (*AccountBalanceQuery) SetMaxQueryPayment added in v0.5.0

func (builder *AccountBalanceQuery) SetMaxQueryPayment(maxPayment Hbar) *AccountBalanceQuery

func (*AccountBalanceQuery) SetQueryPayment added in v0.5.0

func (builder *AccountBalanceQuery) SetQueryPayment(paymentAmount Hbar) *AccountBalanceQuery

func (*AccountBalanceQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *AccountBalanceQuery) SetQueryPaymentTransaction(tx Transaction) *AccountBalanceQuery

type AccountCreateTransaction added in v0.5.0

type AccountCreateTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

AccountCreateTransaction creates a new account. After the account is created, the AccountID for it is in the receipt, or by asking for a Record of the transaction to be created, and retrieving that. The account can then automatically generate records for large transfers into it or out of it, which each last for 25 hours. Records are generated for any transfer that exceeds the thresholds given here. This account is charged hbar for each record generated, so the thresholds are useful for limiting Record generation to happen only for large transactions.

The current API ignores shardID, realmID, and newRealmAdminKey, and creates everything in shard 0 and realm 0, with a null key. Future versions of the API will support multiple realms and multiple shards.

func NewAccountCreateTransaction added in v0.5.0

func NewAccountCreateTransaction() AccountCreateTransaction

NewAccountCreateTransaction creates an AccountCreateTransaction builder which can be used to construct and execute a Crypto Create Transaction.

func (AccountCreateTransaction) SetAutoRenewPeriod added in v0.5.0

func (builder AccountCreateTransaction) SetAutoRenewPeriod(autoRenewPeriod time.Duration) AccountCreateTransaction

SetAutoRenewPeriod sets the time duration for when account is charged to extend its expiration date. When the account is created, the payer account is charged enough hbars so that the new account will not expire for the next auto renew period. When it reaches the expiration time, the new account will then be automatically charged to renew for another auto renew period. If it does not have enough hbars to renew for that long, then the remaining hbars are used to extend its expiration as long as possible. If it is has a zero balance when it expires, then it is deleted.

func (AccountCreateTransaction) SetInitialBalance added in v0.5.0

func (builder AccountCreateTransaction) SetInitialBalance(initialBalance Hbar) AccountCreateTransaction

SetInitialBalance sets the initial number of Hbar to put into the account

func (AccountCreateTransaction) SetKey added in v0.5.0

SetKey sets the key that must sign each transfer out of the account. If RecieverSignatureRequired is true, then it must also sign any transfer into the account.

func (AccountCreateTransaction) SetMaxTransactionFee added in v0.5.0

func (builder AccountCreateTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) AccountCreateTransaction

func (AccountCreateTransaction) SetNodeAccountID added in v0.5.0

func (builder AccountCreateTransaction) SetNodeAccountID(nodeAccountID AccountID) AccountCreateTransaction

func (AccountCreateTransaction) SetProxyAccountID added in v0.5.0

func (builder AccountCreateTransaction) SetProxyAccountID(id AccountID) AccountCreateTransaction

SetProxyAccountID sets the ID of the account to which this account is proxy staked. If proxyAccountID is not set, is an invalid account, or is an account that isn't a node, then this account is automatically proxy staked to a node chosen by the network, but without earning payments. If the proxyAccountID account refuses to accept proxy staking , or if it is not currently running a node, then it will behave as if proxyAccountID was not set.

func (AccountCreateTransaction) SetReceiveRecordThreshold added in v0.5.0

func (builder AccountCreateTransaction) SetReceiveRecordThreshold(recordThreshold Hbar) AccountCreateTransaction

SetReceiveRecordThreshold sets the threshold amount for which an account record is created for any receive/deposit transaction

func (AccountCreateTransaction) SetReceiverSignatureRequired added in v0.5.0

func (builder AccountCreateTransaction) SetReceiverSignatureRequired(required bool) AccountCreateTransaction

SetReceiverSignatureRequired sets the receiverSigRequired flag. If the receiverSigRequired flag is set to true, then all cryptocurrency transfers must be signed by this account's key, both for transfers in and out. If it is false, then only transfers out have to be signed by it. This transaction must be signed by the payer account. If receiverSigRequired is false, then the transaction does not have to be signed by the keys in the keys field. If it is true, then it must be signed by them, in addition to the keys of the payer account.

func (AccountCreateTransaction) SetSendRecordThreshold added in v0.5.0

func (builder AccountCreateTransaction) SetSendRecordThreshold(recordThreshold Hbar) AccountCreateTransaction

SetSendRecordThreshold sets the threshold amount for which an account record is created for any send/withdraw transaction

func (AccountCreateTransaction) SetTransactionID added in v0.5.0

func (builder AccountCreateTransaction) SetTransactionID(transactionID TransactionID) AccountCreateTransaction

func (AccountCreateTransaction) SetTransactionMemo added in v0.5.0

func (builder AccountCreateTransaction) SetTransactionMemo(memo string) AccountCreateTransaction

func (AccountCreateTransaction) SetTransactionValidDuration added in v0.5.0

func (builder AccountCreateTransaction) SetTransactionValidDuration(validDuration time.Duration) AccountCreateTransaction

type AccountDeleteTransaction added in v0.5.0

type AccountDeleteTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

AccountDeleteTransaction marks an account as deleted, moving all its current hbars to another account. It will remain in the ledger, marked as deleted, until it expires. Transfers into it a deleted account fail. But a deleted account can still have its expiration extended in the normal way.

func NewAccountDeleteTransaction added in v0.5.0

func NewAccountDeleteTransaction() AccountDeleteTransaction

NewAccountDeleteTransaction creates an AccountDeleteTransaction builder which can be used to construct and execute a Crypto Delete Transaction.

func (AccountDeleteTransaction) SetDeleteAccountID added in v0.5.0

func (builder AccountDeleteTransaction) SetDeleteAccountID(id AccountID) AccountDeleteTransaction

SetDeleteAccountID sets the account ID which should be deleted.

func (AccountDeleteTransaction) SetMaxTransactionFee added in v0.5.0

func (builder AccountDeleteTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) AccountDeleteTransaction

func (AccountDeleteTransaction) SetNodeAccountID added in v0.5.0

func (builder AccountDeleteTransaction) SetNodeAccountID(nodeAccountID AccountID) AccountDeleteTransaction

func (AccountDeleteTransaction) SetTransactionID added in v0.5.0

func (builder AccountDeleteTransaction) SetTransactionID(transactionID TransactionID) AccountDeleteTransaction

func (AccountDeleteTransaction) SetTransactionMemo added in v0.5.0

func (builder AccountDeleteTransaction) SetTransactionMemo(memo string) AccountDeleteTransaction

func (AccountDeleteTransaction) SetTransactionValidDuration added in v0.5.0

func (builder AccountDeleteTransaction) SetTransactionValidDuration(validDuration time.Duration) AccountDeleteTransaction

func (AccountDeleteTransaction) SetTransferAccountID added in v0.5.0

func (builder AccountDeleteTransaction) SetTransferAccountID(id AccountID) AccountDeleteTransaction

SetTransferAccountID sets the account ID which will receive all remaining hbars.

type AccountID

type AccountID struct {
	Shard   uint64
	Realm   uint64
	Account uint64
}

AccountID is the ID for a Hedera account

func AccountIDFromSolidityAddress added in v0.5.0

func AccountIDFromSolidityAddress(s string) (AccountID, error)

AccountIDFromSolidityAddress constructs an AccountID from a string representation of a solidity address

func AccountIDFromString

func AccountIDFromString(s string) (AccountID, error)

AccountIDFromString constructs an AccountID from a string formatted as `Shard.Realm.Account` (for example "0.0.3")

func (AccountID) String added in v0.2.0

func (id AccountID) String() string

String returns the string representation of an AccountID in `Shard.Realm.Account` (for example "0.0.3")

func (AccountID) ToSolidityAddress added in v0.5.0

func (id AccountID) ToSolidityAddress() string

ToSolidityAddress returns the string representation of the AccountID as a solidity address.

func (*AccountID) UnmarshalJSON added in v0.5.0

func (id *AccountID) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the encoding.JSON interface.

type AccountInfo added in v0.5.0

type AccountInfo struct {
	AccountID                      AccountID
	ContractAccountID              string
	Deleted                        bool
	ProxyAccountID                 AccountID
	ProxyReceived                  Hbar
	Key                            PublicKey
	Balance                        Hbar
	GenerateSendRecordThreshold    Hbar
	GenerateReceiveRecordThreshold Hbar
	ReceiverSigRequired            bool
	ExpirationTime                 time.Time
	AutoRenewPeriod                time.Duration
}

AccountInfo is info about the account returned from an AccountInfoQuery

type AccountInfoQuery added in v0.5.0

type AccountInfoQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

AccountInfoQuery gets all the information about an account excluding account records. This includes the balance.

func NewAccountInfoQuery added in v0.5.0

func NewAccountInfoQuery() *AccountInfoQuery

NewAccountInfoQuery creates an AccountInfoQuery builder which can be used to construct and execute an AccountInfoQuery.

It is recommended that you use this for creating new instances of an AccountInfoQuery instead of manually creating an instance of the struct.

func (*AccountInfoQuery) Cost added in v0.5.0

func (builder *AccountInfoQuery) Cost(client *Client) (Hbar, error)

Cost is a wrapper around the standard Cost function for a query. It must exist because the cost returned by the standard Cost() and the Hedera Network doesn't work for any accounnts that have been deleted. In that case the minimum cost should be ~25 Tinybar which seems to succeed most of the time.

func (*AccountInfoQuery) Execute added in v0.5.0

func (builder *AccountInfoQuery) Execute(client *Client) (AccountInfo, error)

Execute executes the AccountInfoQuery using the provided client

func (*AccountInfoQuery) SetAccountID added in v0.5.0

func (builder *AccountInfoQuery) SetAccountID(id AccountID) *AccountInfoQuery

SetAccountID sets the account ID for which information is requested

func (*AccountInfoQuery) SetMaxQueryPayment added in v0.5.0

func (builder *AccountInfoQuery) SetMaxQueryPayment(maxPayment Hbar) *AccountInfoQuery

func (*AccountInfoQuery) SetQueryPayment added in v0.5.0

func (builder *AccountInfoQuery) SetQueryPayment(paymentAmount Hbar) *AccountInfoQuery

func (*AccountInfoQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *AccountInfoQuery) SetQueryPaymentTransaction(tx Transaction) *AccountInfoQuery

type AccountRecordsQuery added in v0.5.0

type AccountRecordsQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

AccountRecordsQuery gets all of the records for an account for any transfers into it and out of it, that were above the threshold, during the last 25 hours.

func NewAccountRecordsQuery added in v0.5.0

func NewAccountRecordsQuery() *AccountRecordsQuery

NewAccountRecordsQuery creates an AccountRecordsQuery builder which can be used to construct and execute an AccountRecordsQuery.

It is recommended that you use this for creating new instances of an AccountRecordQuery instead of manually creating an instance of the struct.

func (*AccountRecordsQuery) Execute added in v0.5.0

func (builder *AccountRecordsQuery) Execute(client *Client) ([]TransactionRecord, error)

Execute executes the AccountRecordsQuery using the provided client

func (*AccountRecordsQuery) SetAccountID added in v0.5.0

func (builder *AccountRecordsQuery) SetAccountID(id AccountID) *AccountRecordsQuery

SetAccountID sets the account ID for which the records should be retrieved.

func (*AccountRecordsQuery) SetMaxQueryPayment added in v0.5.0

func (builder *AccountRecordsQuery) SetMaxQueryPayment(maxPayment Hbar) *AccountRecordsQuery

func (*AccountRecordsQuery) SetQueryPayment added in v0.5.0

func (builder *AccountRecordsQuery) SetQueryPayment(paymentAmount Hbar) *AccountRecordsQuery

func (*AccountRecordsQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *AccountRecordsQuery) SetQueryPaymentTransaction(tx Transaction) *AccountRecordsQuery

type AccountStakersQuery added in v0.5.0

type AccountStakersQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

AccountStakersQuery gets all of the accounts that are proxy staking to this account. For each of them, the amount currently staked will be given. This is not yet implemented, but will be in a future version of the API.

func NewAccountStakersQuery added in v0.5.0

func NewAccountStakersQuery() *AccountStakersQuery

NewAccountStakersQuery creates an AccountStakersQuery builder which can be used to construct and execute an AccountStakersQuery.

It is recommended that you use this for creating new instances of an AccountStakersQuery instead of manually creating an instance of the struct.

func (*AccountStakersQuery) Execute added in v0.5.0

func (builder *AccountStakersQuery) Execute(client *Client) ([]Transfer, error)

Execute executes the AccountStakersQuery using the provided client.

func (*AccountStakersQuery) SetAccountID added in v0.5.0

func (builder *AccountStakersQuery) SetAccountID(id AccountID) *AccountStakersQuery

SetAccountID sets the Account ID for which the stakers should be retrieved

func (*AccountStakersQuery) SetMaxQueryPayment added in v0.5.0

func (builder *AccountStakersQuery) SetMaxQueryPayment(maxPayment Hbar) *AccountStakersQuery

func (*AccountStakersQuery) SetQueryPayment added in v0.5.0

func (builder *AccountStakersQuery) SetQueryPayment(paymentAmount Hbar) *AccountStakersQuery

func (*AccountStakersQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *AccountStakersQuery) SetQueryPaymentTransaction(tx Transaction) *AccountStakersQuery

type AccountUpdateTransaction added in v0.5.0

type AccountUpdateTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

AccountUpdateTransaction changes properties for the given account. Any unset field is left unchanged. This transaction must be signed by the existing key for this account.

func NewAccountUpdateTransaction added in v0.5.0

func NewAccountUpdateTransaction() AccountUpdateTransaction

NewAccountUpdateTransaction creates an AccountUpdateTransaction builder which can be used to construct and execute a Crypto Update Transaction.

func (AccountUpdateTransaction) SetAccountID added in v0.5.0

SetAccountID sets the account ID which is being updated in this transaction

func (AccountUpdateTransaction) SetAutoRenewPeriod added in v0.5.0

func (builder AccountUpdateTransaction) SetAutoRenewPeriod(autoRenewPeriod time.Duration) AccountUpdateTransaction

SetAutoRenewPeriod sets the duration in which it will automatically extend the expiration period. If it doesn't have enough balance, it extends as long as possible. If the balance is empty when it expires, then it is deleted.

func (AccountUpdateTransaction) SetExpirationTime added in v0.5.0

func (builder AccountUpdateTransaction) SetExpirationTime(expiration time.Time) AccountUpdateTransaction

SetExpirationTime sets the new expiration time to extend to (ignored if equal to or before the current one) When extending the expiration date, the cost is affected by the size of the list of attached claims, and of the keys associated with the claims and the account.

func (AccountUpdateTransaction) SetKey added in v0.5.0

SetKey sets the new key for the account being updated. The transaction must be signed by both the old key (from before the change) and the new key.

The old key must sign for security. The new key must sign as a safeguard to avoid accidentally changing to an invalid key, and then having no way to recover.

func (AccountUpdateTransaction) SetMaxTransactionFee added in v0.5.0

func (builder AccountUpdateTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) AccountUpdateTransaction

func (AccountUpdateTransaction) SetNodeAccountID added in v0.5.0

func (builder AccountUpdateTransaction) SetNodeAccountID(nodeAccountID AccountID) AccountUpdateTransaction

func (AccountUpdateTransaction) SetProxyAccountID added in v0.5.0

func (builder AccountUpdateTransaction) SetProxyAccountID(id AccountID) AccountUpdateTransaction

SetProxyAccountID sets the ID of the account to which this account is proxy staked. If proxyAccountID is unset, is an invalid account, or is an account that isn't a node, then this account is automatically proxy staked to a node chosen by the network, but without earning payments. If the proxyAccountID account refuses to accept proxy staking, or if it is not currently running a node, then it will behave as if proxyAccountID was unset.

func (AccountUpdateTransaction) SetReceiveRecordThreshold added in v0.5.0

func (builder AccountUpdateTransaction) SetReceiveRecordThreshold(threshold Hbar) AccountUpdateTransaction

SetReceiveRecordThreshold sets the threshold amount for which an account record is created for any receive/deposit transaction

func (AccountUpdateTransaction) SetReceiverSignatureRequired added in v0.5.0

func (builder AccountUpdateTransaction) SetReceiverSignatureRequired(required bool) AccountUpdateTransaction

SetReceiverSignatureRequired sets the receiverSigRequired flag on the account.

func (AccountUpdateTransaction) SetSendRecordThreshold added in v0.5.0

func (builder AccountUpdateTransaction) SetSendRecordThreshold(threshold Hbar) AccountUpdateTransaction

SetSendRecordThreshold sets the threshold amount for which an account record is created for any send/withdraw transaction

func (AccountUpdateTransaction) SetTransactionID added in v0.5.0

func (builder AccountUpdateTransaction) SetTransactionID(transactionID TransactionID) AccountUpdateTransaction

func (AccountUpdateTransaction) SetTransactionMemo added in v0.5.0

func (builder AccountUpdateTransaction) SetTransactionMemo(memo string) AccountUpdateTransaction

func (AccountUpdateTransaction) SetTransactionValidDuration added in v0.5.0

func (builder AccountUpdateTransaction) SetTransactionValidDuration(validDuration time.Duration) AccountUpdateTransaction

type Argument added in v0.5.0

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

type Client

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

Client is the Hedera protocol wrapper for the SDK used by all transaction and query types.

func ClientForMainnet added in v0.5.0

func ClientForMainnet() *Client

ClientForMainnet returns a preconfigured client for use with the standard Hedera mainnet. Most users will want to set an operator account with .SetOperator so transactions can be automatically given TransactionIDs and signed.

func ClientForTestnet added in v0.5.0

func ClientForTestnet() *Client

ClientForTestnet returns a preconfigured client for use with the standard Hedera testnet. Most users will want to set an operator account with .SetOperator so transactions can be automatically given TransactionIDs and signed.

func ClientFromFile added in v0.5.0

func ClientFromFile(filename string) (*Client, error)

ClientFromFile takes a filename string representing the path to a JSON encoded Client file and returns a Client based on the configuration.

func ClientFromJSON added in v0.5.0

func ClientFromJSON(jsonBytes []byte) (*Client, error)

ClientFromJSON takes in the byte slice representation of a JSON string or document and returns Client based on the configuration.

func NewClient added in v0.5.0

func NewClient(network map[string]AccountID) *Client

NewClient takes in a map of node addresses to their respective IDS (network) and returns a Client instance which can be used to

func (*Client) Close

func (client *Client) Close() error

Close is used to disconnect the Client from the network

func (*Client) ReplaceNodes added in v0.5.0

func (client *Client) ReplaceNodes(network map[string]AccountID) *Client

ReplaceNodes replaces all nodes in the Client with a new set of nodes. (e.g. for an Address Book update).

func (*Client) SetMaxQueryPayment added in v0.5.0

func (client *Client) SetMaxQueryPayment(payment Hbar) *Client

SetMaxQueryPayment sets the default maximum payment allowable for queries.

func (*Client) SetMaxTransactionFee added in v0.5.0

func (client *Client) SetMaxTransactionFee(fee Hbar) *Client

SetMaxTransactionFee sets the maximum fee to be paid for the transactions executed by the Client. Because transaction fees are always maximums the actual fee assessed for a given transaction may be less than this value, but never greater.

func (*Client) SetOperator added in v0.3.0

func (client *Client) SetOperator(accountID AccountID, privateKey Ed25519PrivateKey) *Client

SetOperator sets that account that will, by default, be paying for transactions and queries built with the client and the associated key with which to automatically sign transactions.

func (*Client) SetOperatorWith added in v0.5.0

func (client *Client) SetOperatorWith(accountID AccountID, publicKey Ed25519PublicKey, signer TransactionSigner) *Client

SetOperatorWith sets that account that will, by default, be paying for transactions and queries built with the client, the account's Ed25519PublicKey and a callback that will be invoked when a transaction needs to be signed.

type ConsensusMessage added in v0.5.0

type ConsensusMessage struct {
	TopicID            ConsensusTopicID
	ConsensusTimestamp time.Time
	Message            []byte
	RunningHash        []byte
	SequenceNumber     uint64
}

func NewConsensusMessage added in v0.5.0

func NewConsensusMessage(id ConsensusTopicID, resp *mirror.ConsensusTopicResponse) ConsensusMessage

func (ConsensusMessage) String added in v0.5.0

func (message ConsensusMessage) String() string

type ConsensusMessageSubmitTransaction added in v0.5.0

type ConsensusMessageSubmitTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

func NewConsensusMessageSubmitTransaction added in v0.5.0

func NewConsensusMessageSubmitTransaction() ConsensusMessageSubmitTransaction

NewConsensusMessageSubmitTransaction creates a ConsensusMessageSubmitTransaction builder which can be used to construct and execute a Consensus Submit Message Transaction.

func (ConsensusMessageSubmitTransaction) SetMaxTransactionFee added in v0.5.0

func (builder ConsensusMessageSubmitTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) ConsensusMessageSubmitTransaction

func (ConsensusMessageSubmitTransaction) SetMemo added in v0.5.0

func (ConsensusMessageSubmitTransaction) SetMessage added in v0.5.0

SetMessage sets the message to be submitted. Max size of the Transaction (including signatures) is 4kB.

func (ConsensusMessageSubmitTransaction) SetNodeAccountID added in v0.5.0

func (builder ConsensusMessageSubmitTransaction) SetNodeAccountID(nodeAccountID AccountID) ConsensusMessageSubmitTransaction

func (ConsensusMessageSubmitTransaction) SetTopicID added in v0.5.0

SetTopic sets the topic to submit the message to.

func (ConsensusMessageSubmitTransaction) SetTransactionID added in v0.5.0

func (ConsensusMessageSubmitTransaction) SetTransactionValidDuration added in v0.5.0

func (builder ConsensusMessageSubmitTransaction) SetTransactionValidDuration(validDuration time.Duration) ConsensusMessageSubmitTransaction

type ConsensusTopicCreateTransaction added in v0.5.0

type ConsensusTopicCreateTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

func NewConsensusTopicCreateTransaction added in v0.5.0

func NewConsensusTopicCreateTransaction() ConsensusTopicCreateTransaction

NewConsensusTopicCreateTransaction creates a ConsensusTopicCreateTransaction builder which can be used to construct and execute a Consensus Create Topic Transaction.

func (ConsensusTopicCreateTransaction) SetAdminKey added in v0.5.0

SetAdminKey sets the key required to update or delete the topic. If unspecified, anyone can increase the topic's expirationTime.

func (ConsensusTopicCreateTransaction) SetAutoRenewAccountID added in v0.5.0

SetAutoRenewAccountID sets an optional account to be used at the topic's expirationTime to extend the life of the topic. The topic lifetime will be extended up to a maximum of the autoRenewPeriod or however long the topic can be extended using all funds on the account (whichever is the smaller duration/amount).

If specified, there must be an adminKey and the autoRenewAccount must sign this transaction.

func (ConsensusTopicCreateTransaction) SetAutoRenewPeriod added in v0.5.0

SetAutoRenewPeriod sets the initial lifetime of the topic and the amount of time to extend the topic's lifetime automatically at expirationTime if the autoRenewAccount is configured and has sufficient funds.

Required. Limited to a maximum of 90 days (server-side configuration which may change).

func (ConsensusTopicCreateTransaction) SetMaxTransactionFee added in v0.5.0

func (builder ConsensusTopicCreateTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) ConsensusTopicCreateTransaction

func (ConsensusTopicCreateTransaction) SetMemo added in v0.5.0

func (ConsensusTopicCreateTransaction) SetNodeAccountID added in v0.5.0

func (builder ConsensusTopicCreateTransaction) SetNodeAccountID(nodeAccountID AccountID) ConsensusTopicCreateTransaction

func (ConsensusTopicCreateTransaction) SetSubmitKey added in v0.5.0

SetSubmitKey sets the key required for submitting messages to the topic. If unspecified, all submissions are allowed.

func (ConsensusTopicCreateTransaction) SetTopicMemo added in v0.5.0

SetTopicMemo sets a short publicly visible memo about the topic. No guarantee of uniqueness.

func (ConsensusTopicCreateTransaction) SetTransactionID added in v0.5.0

func (builder ConsensusTopicCreateTransaction) SetTransactionID(transactionID TransactionID) ConsensusTopicCreateTransaction

func (ConsensusTopicCreateTransaction) SetTransactionValidDuration added in v0.5.0

func (builder ConsensusTopicCreateTransaction) SetTransactionValidDuration(validDuration time.Duration) ConsensusTopicCreateTransaction

type ConsensusTopicDeleteTransaction added in v0.5.0

type ConsensusTopicDeleteTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

func NewConsensusTopicDeleteTransaction added in v0.5.0

func NewConsensusTopicDeleteTransaction() ConsensusTopicDeleteTransaction

NewConsensusTopicDeleteTransaction creates a ConsensusTopicDeleteTransaction builder which can be used to construct and execute a Consensus Delete Topic Transaction.

func (ConsensusTopicDeleteTransaction) SetMaxTransactionFee added in v0.5.0

func (builder ConsensusTopicDeleteTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) ConsensusTopicDeleteTransaction

func (ConsensusTopicDeleteTransaction) SetMemo added in v0.5.0

func (ConsensusTopicDeleteTransaction) SetNodeAccountID added in v0.5.0

func (builder ConsensusTopicDeleteTransaction) SetNodeAccountID(nodeAccountID AccountID) ConsensusTopicDeleteTransaction

func (ConsensusTopicDeleteTransaction) SetTopicID added in v0.5.0

SetTopicID sets the topic identifier.

func (ConsensusTopicDeleteTransaction) SetTransactionID added in v0.5.0

func (builder ConsensusTopicDeleteTransaction) SetTransactionID(transactionID TransactionID) ConsensusTopicDeleteTransaction

func (ConsensusTopicDeleteTransaction) SetTransactionValidDuration added in v0.5.0

func (builder ConsensusTopicDeleteTransaction) SetTransactionValidDuration(validDuration time.Duration) ConsensusTopicDeleteTransaction

type ConsensusTopicID added in v0.5.0

type ConsensusTopicID struct {
	Shard uint64
	Realm uint64
	Topic uint64
}

ConsensusTopicID is a unique identifier for a topic (used by the consensus service)

func TopicIDFromString added in v0.5.0

func TopicIDFromString(s string) (ConsensusTopicID, error)

TopicIDFromString constructs a TopicID from a string formatted as `Shard.Realm.Topic` (for example "0.0.3")

func (ConsensusTopicID) String added in v0.5.0

func (id ConsensusTopicID) String() string

String returns the string representation of a TopicID in `Shard.Realm.Topic` (for example "0.0.3")

type ConsensusTopicInfo added in v0.5.0

type ConsensusTopicInfo struct {
	Memo               string
	RunningHash        []byte
	SequenceNumber     uint64
	ExpirationTime     time.Time
	AdminKey           *Ed25519PublicKey
	SubmitKey          *Ed25519PublicKey
	AutoRenewPeriod    time.Duration
	AutoRenewAccountID *AccountID
}

type ConsensusTopicInfoQuery added in v0.5.0

type ConsensusTopicInfoQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

func NewConsensusTopicInfoQuery added in v0.5.0

func NewConsensusTopicInfoQuery() *ConsensusTopicInfoQuery

NewConsensusTopicInfoQuery creates a ConsensusTopicInfoQuery builder which can be used to construct and execute a Consensus Get Topic Info Query.

func (*ConsensusTopicInfoQuery) Execute added in v0.5.0

func (builder *ConsensusTopicInfoQuery) Execute(client *Client) (ConsensusTopicInfo, error)

Execute executes the ConsensusTopicInfoQuery using the provided client

func (*ConsensusTopicInfoQuery) SetMaxQueryPayment added in v0.5.0

func (builder *ConsensusTopicInfoQuery) SetMaxQueryPayment(maxPayment Hbar) *ConsensusTopicInfoQuery

func (*ConsensusTopicInfoQuery) SetQueryPayment added in v0.5.0

func (builder *ConsensusTopicInfoQuery) SetQueryPayment(paymentAmount Hbar) *ConsensusTopicInfoQuery

func (*ConsensusTopicInfoQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *ConsensusTopicInfoQuery) SetQueryPaymentTransaction(tx Transaction) *ConsensusTopicInfoQuery

func (*ConsensusTopicInfoQuery) SetTopicID added in v0.5.0

SetTopicId sets the topic to retrieve info about (the parameters and running state of).

type ConsensusTopicUpdateTransaction added in v0.5.0

type ConsensusTopicUpdateTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

ConsensusTopicUpdateTransaction updates all fields on a Topic that are set in the transaction.

func NewConsensusTopicUpdateTransaction added in v0.5.0

func NewConsensusTopicUpdateTransaction() ConsensusTopicUpdateTransaction

NewConsensusTopicUpdateTransaction creates a ConsensusTopicUpdateTransaction builder which can be used to construct and execute a Consensus Update Topic Transaction.

func (ConsensusTopicUpdateTransaction) ClearAdminKey added in v0.5.0

ClearAdminKey explicitly clears any admin key on the topic by sending an empty key list as the key

func (ConsensusTopicUpdateTransaction) ClearAutoRenewAccountID added in v0.5.0

func (builder ConsensusTopicUpdateTransaction) ClearAutoRenewAccountID() ConsensusTopicUpdateTransaction

ClearAutoRenewAccountID explicitly clears any auto renew account ID on the topic by sending an empty accountID

func (ConsensusTopicUpdateTransaction) ClearSubmitKey added in v0.5.0

ClearSubmitKey explicitly clears any submit key on the topic by sending an empty key list as the key

func (ConsensusTopicUpdateTransaction) ClearTopicMemo added in v0.5.0

ClearTopicMemo explicitly clears any memo on the topic by sending an empty string as the memo

func (ConsensusTopicUpdateTransaction) SetAdminKey added in v0.5.0

SetAdminKey sets the key required to update/delete the topic. If unset, the key will not be changed.

Setting the AdminKey to an empty KeyList will clear the adminKey.

func (ConsensusTopicUpdateTransaction) SetAutoRenewAccountID added in v0.5.0

SetAutoRenewAccountID sets the optional account to be used at the topic's expirationTime to extend the life of the topic. The topic lifetime will be extended up to a maximum of the autoRenewPeriod or however long the topic can be extended using all funds on the account (whichever is the smaller duration/amount). If specified as the default value (0.0.0), the autoRenewAccount will be removed.

func (ConsensusTopicUpdateTransaction) SetAutoRenewPeriod added in v0.5.0

SetAutoRenewPeriod sets the amount of time to extend the topic's lifetime automatically at expirationTime if the autoRenewAccount is configured and has funds. This is limited to a maximum of 90 days (server-side configuration which may change).

func (ConsensusTopicUpdateTransaction) SetExpirationTime added in v0.5.0

func (builder ConsensusTopicUpdateTransaction) SetExpirationTime(expiration time.Time) ConsensusTopicUpdateTransaction

SetExpirationTime sets the effective consensus timestamp at (and after) which all consensus transactions and queries will fail. The expirationTime may be no longer than 90 days from the consensus timestamp of this transaction.

func (ConsensusTopicUpdateTransaction) SetMaxTransactionFee added in v0.5.0

func (builder ConsensusTopicUpdateTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) ConsensusTopicUpdateTransaction

func (ConsensusTopicUpdateTransaction) SetMemo added in v0.5.0

func (ConsensusTopicUpdateTransaction) SetNodeAccountID added in v0.5.0

func (builder ConsensusTopicUpdateTransaction) SetNodeAccountID(nodeAccountID AccountID) ConsensusTopicUpdateTransaction

func (ConsensusTopicUpdateTransaction) SetSubmitKey added in v0.5.0

SetSubmitKey will set the key allowed to submit messages to the topic. If unset, the key will not be changed.

Setting the submitKey to an empty KeyList will clear the submitKey.

func (ConsensusTopicUpdateTransaction) SetTopicID added in v0.5.0

SetTopicID sets the topic to be updated.

func (ConsensusTopicUpdateTransaction) SetTopicMemo added in v0.5.0

SetTopicMemo sets a short publicly visible memo about the topic. No guarantee of uniqueness.

func (ConsensusTopicUpdateTransaction) SetTransactionID added in v0.5.0

func (builder ConsensusTopicUpdateTransaction) SetTransactionID(transactionID TransactionID) ConsensusTopicUpdateTransaction

func (ConsensusTopicUpdateTransaction) SetTransactionValidDuration added in v0.5.0

func (builder ConsensusTopicUpdateTransaction) SetTransactionValidDuration(validDuration time.Duration) ConsensusTopicUpdateTransaction

type ContractBytecodeQuery added in v0.5.0

type ContractBytecodeQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

ContractBytcodeQuery retrieves the bytecode for a smart contract instance

func NewContractBytecodeQuery added in v0.5.0

func NewContractBytecodeQuery() *ContractBytecodeQuery

NewContractBytecodeQuery creates a ContractBytecodeQuery builder which can be used to construct and execute a Contract Get Bytecode Query.

func (*ContractBytecodeQuery) Execute added in v0.5.0

func (builder *ContractBytecodeQuery) Execute(client *Client) ([]byte, error)

Execute executes the ContractByteCodeQuery using the provided client

func (*ContractBytecodeQuery) SetContractID added in v0.5.0

func (builder *ContractBytecodeQuery) SetContractID(id ContractID) *ContractBytecodeQuery

SetContractID sets the contract for which the bytecode is requested

func (*ContractBytecodeQuery) SetMaxQueryPayment added in v0.5.0

func (builder *ContractBytecodeQuery) SetMaxQueryPayment(maxPayment Hbar) *ContractBytecodeQuery

func (*ContractBytecodeQuery) SetQueryPayment added in v0.5.0

func (builder *ContractBytecodeQuery) SetQueryPayment(paymentAmount Hbar) *ContractBytecodeQuery

func (*ContractBytecodeQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *ContractBytecodeQuery) SetQueryPaymentTransaction(tx Transaction) *ContractBytecodeQuery

type ContractCallQuery added in v0.5.0

type ContractCallQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

ContractCallQuery calls a function of the given smart contract instance, giving it ContractFunctionParameters as its inputs. It will consume the entire given amount of gas.

This is performed locally on the particular node that the client is communicating with. It cannot change the state of the contract instance (and so, cannot spend anything from the instance's Hedera account). It will not have a consensus timestamp. It cannot generate a record or a receipt. This is useful for calling getter functions, which purely read the state and don't change it. It is faster and cheaper than a ContractExecuteTransaction, because it is purely local to a single node.

func NewContractCallQuery added in v0.5.0

func NewContractCallQuery() *ContractCallQuery

NewContractCallQuery creates a ContractCallQuery builder which can be used to construct and execute a Contract Call Local Query.

func (*ContractCallQuery) Cost added in v0.5.0

func (builder *ContractCallQuery) Cost(client *Client) (Hbar, error)

Cost is a wrapper around the standard Cost function for a query. It must exist because the cost returned the standard QueryBuilder.Cost() function and therein the Hedera Network doesn't work for ContractCallQueries. However, if the value returned by the network is increased by 10% then most contractCallQueries will complete fine.

func (*ContractCallQuery) Execute added in v0.5.0

func (builder *ContractCallQuery) Execute(client *Client) (ContractFunctionResult, error)

Execute executes the ContractCallQuery using the provided client. The returned ContractFunctionResult will contain the output returned by the function call.

func (*ContractCallQuery) SetContractID added in v0.5.0

func (builder *ContractCallQuery) SetContractID(id ContractID) *ContractCallQuery

SetContractID sets the contract instance to call

func (*ContractCallQuery) SetFunction added in v0.5.0

func (builder *ContractCallQuery) SetFunction(name string, params *ContractFunctionParams) *ContractCallQuery

SetFunction sets which function to call, and the ContractFunctionParams to pass to the function

func (*ContractCallQuery) SetGas added in v0.5.0

func (builder *ContractCallQuery) SetGas(gas uint64) *ContractCallQuery

SetGas sets the amount of gas to use for the call. All of the gas offered will be charged for.

func (*ContractCallQuery) SetMaxQueryPayment added in v0.5.0

func (builder *ContractCallQuery) SetMaxQueryPayment(maxPayment Hbar) *ContractCallQuery

func (*ContractCallQuery) SetMaxResultSize added in v0.5.0

func (builder *ContractCallQuery) SetMaxResultSize(size uint64) *ContractCallQuery

SetMaxResultSize sets the max number of bytes that the result might include. The run will fail if it would have returned more than this number of bytes.

func (*ContractCallQuery) SetQueryPayment added in v0.5.0

func (builder *ContractCallQuery) SetQueryPayment(paymentAmount Hbar) *ContractCallQuery

func (*ContractCallQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *ContractCallQuery) SetQueryPaymentTransaction(tx Transaction) *ContractCallQuery

type ContractCreateTransaction added in v0.5.0

type ContractCreateTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

ContractCreateTransaction starts a new smart contract instance. After the instance is created, the ContractID for it is in the receipt, or can be retrieved with a GetByKey query, or by asking for a Record of the transaction to be created, and retrieving that. The instance will run the bytecode stored in the given file, referenced either by FileID or by the TransactionID of the transaction that created the file. The constructor will be executed using the given amount of gas, and any unspent gas will be refunded to the paying account. Constructor inputs come from the given constructorParameters.

A smart contract instance normally enforces rules, so "the code is law". For example, an ERC-20 contract prevents a transfer from being undone without a signature by the recipient of the transfer. This is always enforced if the contract instance was created with the adminKeys being null. But for some uses, it might be desirable to create something like an ERC-20 contract that has a specific group of trusted individuals who can act as a "supreme court" with the ability to override the normal operation, when a sufficient number of them agree to do so. If adminKeys is not null, then they can sign a transaction that can change the state of the smart contract in arbitrary ways, such as to reverse a transaction that violates some standard of behavior that is not covered by the code itself. The admin keys can also be used to change the autoRenewPeriod, and change the adminKeys field itself. The API currently does not implement this ability. But it does allow the adminKeys field to be set and queried, and will in the future implement such admin abilities for any instance that has a non-null adminKeys.

An entity (account, file, or smart contract instance) must be created in a particular realm. If the realmID is left null, then a new realm will be created with the given admin key. If a new realm has a null adminKey, then anyone can create/modify/delete entities in that realm. But if an admin key is given, then any transaction to create/modify/delete an entity in that realm must be signed by that key, though anyone can still call functions on smart contract instances that exist in that realm. A realm ceases to exist when everything within it has expired and no longer exists.

The current API ignores shardID, realmID, and newRealmAdminKey, and creates everything in shard 0 and realm 0, with a null key. Future versions of the API will support multiple realms and multiple shards.

func NewContractCreateTransaction added in v0.5.0

func NewContractCreateTransaction() ContractCreateTransaction

NewContractCreateTransaction creates a ContractCreateTransaction builder which can be used to construct and execute a Contract Create Transaction. This constructor defaults the autoRenewPeriod to ~1/4 year to fall within the required range, if desired the value can be changed through the SetAutoRenewPeriod method

func (ContractCreateTransaction) SetAdminKey added in v0.5.0

SetAdminKeyu sets the key required to arbitrarily modify the state of the instance and its fields. If this is left unset, then such modifications are not possible, and there is no administrator that can override the normal operation of the smart contract instance. Note that if it is created with no admin keys, then there is no administrator to authorize changing the admin keys, so there can never be any admin keys for that instance.

func (ContractCreateTransaction) SetAutoRenewPeriod added in v0.5.0

func (builder ContractCreateTransaction) SetAutoRenewPeriod(autoRenewPeriod time.Duration) ContractCreateTransaction

SetAutoRenewPeriod sets the duration the instance will exist for. When that is reached, it will renew itself for another autoRenewPeriod duration by charging its associated account. If it has an insufficient balance to extend that long, it will extend as long as it can. If its balance is zero, the instance will be deleted.

func (ContractCreateTransaction) SetBytecodeFileID added in v0.5.0

func (builder ContractCreateTransaction) SetBytecodeFileID(id FileID) ContractCreateTransaction

SetBytecodeFileID sets the ID of the file containing the smart contract byte code. A copy will be made and held by the contract instance, and have the same expiration time as the instance.

func (ContractCreateTransaction) SetConstructorParams added in v0.5.0

func (builder ContractCreateTransaction) SetConstructorParams(params *ContractFunctionParams) ContractCreateTransaction

SetConstructorParams sets the ContractFunctionParams to pass to the constructor. If this constructor stores information, it is charged gas to store it. There is a fee in hbars to maintain that storage until the expiration time, and that fee is added as part of the transaction fee.

func (ContractCreateTransaction) SetContractMemo added in v0.5.0

func (builder ContractCreateTransaction) SetContractMemo(memo string) ContractCreateTransaction

SetContractMemo sets the optional memo field which can contain a string whose length is up to 100 bytes. That is the size after Unicode NFD then UTF-8 conversion. This field can be used to describe the smart contract. It could also be used for other purposes.

One recommended purpose is to hold a hexadecimal string that is the SHA-384 hash of a PDF file containing a human-readable legal contract. Then, if the admin keys are the public keys of human arbitrators, they can use that legal document to guide their decisions during a binding arbitration tribunal, convened to consider any changes to the smart contract in the future. The memo field can only be changed using the admin keys. If there are no admin keys, then it cannot be changed after the smart contract is created.

func (ContractCreateTransaction) SetGas added in v0.5.0

SetGas sets the gas required to run the constructor

func (ContractCreateTransaction) SetInitialBalance added in v0.5.0

func (builder ContractCreateTransaction) SetInitialBalance(initialBalance Hbar) ContractCreateTransaction

SetInitialBalance sets the initial Hbar to put into the account associated with and owned by the smart contract

func (ContractCreateTransaction) SetMaxTransactionFee added in v0.5.0

func (builder ContractCreateTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) ContractCreateTransaction

func (ContractCreateTransaction) SetNodeAccountID added in v0.5.0

func (builder ContractCreateTransaction) SetNodeAccountID(nodeAccountID AccountID) ContractCreateTransaction

func (ContractCreateTransaction) SetProxyAccountID added in v0.5.0

func (builder ContractCreateTransaction) SetProxyAccountID(id AccountID) ContractCreateTransaction

SetProxyAccountID sets the AccountID of the account to which this contract is proxy staked. If proxyAccountID is left unset, is an invalid account, or is an account that isn't a node, then this contract is automatically proxy staked to a node chosen by the network, but without earning payments. If the proxyAccountID account refuses to accept proxy staking , or if it is not currently running a node, then it will behave as if proxyAccountID was never set.

func (ContractCreateTransaction) SetTransactionID added in v0.5.0

func (builder ContractCreateTransaction) SetTransactionID(transactionID TransactionID) ContractCreateTransaction

func (ContractCreateTransaction) SetTransactionMemo added in v0.5.0

func (builder ContractCreateTransaction) SetTransactionMemo(memo string) ContractCreateTransaction

func (ContractCreateTransaction) SetTransactionValidDuration added in v0.5.0

func (builder ContractCreateTransaction) SetTransactionValidDuration(validDuration time.Duration) ContractCreateTransaction

type ContractDeleteTransaction added in v0.5.0

type ContractDeleteTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

func NewContractDeleteTransaction added in v0.5.0

func NewContractDeleteTransaction() ContractDeleteTransaction

NewContractDeleteTransaction creates a Contract Delete Transaction builder which can be used to construct and execute a Contract Delete Transaction.

func (ContractDeleteTransaction) SetContractID added in v0.5.0

SetContractID sets the Contract ID of the Contract to be deleted by the Contract Delete Transaction

func (ContractDeleteTransaction) SetMaxTransactionFee added in v0.5.0

func (builder ContractDeleteTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) ContractDeleteTransaction

func (ContractDeleteTransaction) SetNodeAccountID added in v0.5.0

func (builder ContractDeleteTransaction) SetNodeAccountID(nodeAccountID AccountID) ContractDeleteTransaction

func (ContractDeleteTransaction) SetTransactionID added in v0.5.0

func (builder ContractDeleteTransaction) SetTransactionID(transactionID TransactionID) ContractDeleteTransaction

func (ContractDeleteTransaction) SetTransactionMemo added in v0.5.0

func (builder ContractDeleteTransaction) SetTransactionMemo(memo string) ContractDeleteTransaction

func (ContractDeleteTransaction) SetTransactionValidDuration added in v0.5.0

func (builder ContractDeleteTransaction) SetTransactionValidDuration(validDuration time.Duration) ContractDeleteTransaction

func (ContractDeleteTransaction) SetTransferAccountID added in v0.7.0

func (builder ContractDeleteTransaction) SetTransferAccountID(id AccountID) ContractDeleteTransaction

SetTransferAccountID sets the Account ID which will receive remaining hbar tied to the Contract

func (ContractDeleteTransaction) SetTransferContractID added in v0.7.0

func (builder ContractDeleteTransaction) SetTransferContractID(id ContractID) ContractDeleteTransaction

type ContractExecuteTransaction added in v0.5.0

type ContractExecuteTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

ContractExecuteTransaction calls a function of the given smart contract instance, giving it ContractFuncionParams as its inputs. it can use the given amount of gas, and any unspent gas will be refunded to the paying account.

If this function stores information, it is charged gas to store it. There is a fee in hbars to maintain that storage until the expiration time, and that fee is added as part of the transaction fee.

For a cheaper but more limited method to call functions, see ContractCallQuery.

func NewContractExecuteTransaction added in v0.5.0

func NewContractExecuteTransaction() ContractExecuteTransaction

NewContractExecuteTransaction creates a ContractExecuteTransaction builder which can be used to construct and execute a Contract Call Transaction.

func (ContractExecuteTransaction) SetContractID added in v0.5.0

SetContractID sets the contract instance to call.

func (ContractExecuteTransaction) SetFunction added in v0.5.0

SetFunction sets which function to call, and the ContractFunctionParams to pass to the function

func (ContractExecuteTransaction) SetGas added in v0.5.0

SetGas sets the maximum amount of gas to use for the call.

func (ContractExecuteTransaction) SetMaxTransactionFee added in v0.5.0

func (builder ContractExecuteTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) ContractExecuteTransaction

func (ContractExecuteTransaction) SetNodeAccountID added in v0.5.0

func (builder ContractExecuteTransaction) SetNodeAccountID(nodeAccountID AccountID) ContractExecuteTransaction

func (ContractExecuteTransaction) SetPayableAmount added in v0.5.0

func (builder ContractExecuteTransaction) SetPayableAmount(amount Hbar) ContractExecuteTransaction

SetPayableAmount sets the amount of Hbar sent (the function must be payable if this is nonzero)

func (ContractExecuteTransaction) SetTransactionID added in v0.5.0

func (builder ContractExecuteTransaction) SetTransactionID(transactionID TransactionID) ContractExecuteTransaction

func (ContractExecuteTransaction) SetTransactionMemo added in v0.5.0

func (builder ContractExecuteTransaction) SetTransactionMemo(memo string) ContractExecuteTransaction

func (ContractExecuteTransaction) SetTransactionValidDuration added in v0.5.0

func (builder ContractExecuteTransaction) SetTransactionValidDuration(validDuration time.Duration) ContractExecuteTransaction

type ContractFunctionParams added in v0.5.0

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

func NewContractFunctionParams added in v0.5.0

func NewContractFunctionParams() *ContractFunctionParams

func (*ContractFunctionParams) AddAddress added in v0.5.0

func (contract *ContractFunctionParams) AddAddress(value string) (*ContractFunctionParams, error)

func (*ContractFunctionParams) AddAddressArray added in v0.5.0

func (contract *ContractFunctionParams) AddAddressArray(value []string) (*ContractFunctionParams, error)

func (*ContractFunctionParams) AddBool added in v0.5.0

func (contract *ContractFunctionParams) AddBool(value bool) *ContractFunctionParams

func (*ContractFunctionParams) AddBytes added in v0.5.0

func (contract *ContractFunctionParams) AddBytes(value []byte) *ContractFunctionParams

func (*ContractFunctionParams) AddBytes32 added in v0.5.0

func (contract *ContractFunctionParams) AddBytes32(value [32]byte) *ContractFunctionParams

func (*ContractFunctionParams) AddBytes32Array added in v0.5.0

func (contract *ContractFunctionParams) AddBytes32Array(value [][]byte) *ContractFunctionParams

func (*ContractFunctionParams) AddBytesArray added in v0.5.0

func (contract *ContractFunctionParams) AddBytesArray(value [][]byte) *ContractFunctionParams

func (*ContractFunctionParams) AddFunction added in v0.5.0

func (contract *ContractFunctionParams) AddFunction(address string, selector ContractFunctionSelector) (*ContractFunctionParams, error)

func (*ContractFunctionParams) AddInt256 added in v0.5.0

func (contract *ContractFunctionParams) AddInt256(value []byte) *ContractFunctionParams

func (*ContractFunctionParams) AddInt256Array added in v0.5.0

func (contract *ContractFunctionParams) AddInt256Array(value [][32]byte) *ContractFunctionParams

func (*ContractFunctionParams) AddInt32 added in v0.5.0

func (contract *ContractFunctionParams) AddInt32(value int32) *ContractFunctionParams

func (*ContractFunctionParams) AddInt32Array added in v0.5.0

func (contract *ContractFunctionParams) AddInt32Array(value []int32) *ContractFunctionParams

func (*ContractFunctionParams) AddInt64 added in v0.5.0

func (contract *ContractFunctionParams) AddInt64(value int64) *ContractFunctionParams

func (*ContractFunctionParams) AddInt64Array added in v0.5.0

func (contract *ContractFunctionParams) AddInt64Array(value []int64) *ContractFunctionParams

func (*ContractFunctionParams) AddInt8 added in v0.5.0

func (contract *ContractFunctionParams) AddInt8(value int8) *ContractFunctionParams

func (*ContractFunctionParams) AddString added in v0.5.0

func (contract *ContractFunctionParams) AddString(value string) *ContractFunctionParams

func (*ContractFunctionParams) AddStringArray added in v0.5.0

func (contract *ContractFunctionParams) AddStringArray(value []string) *ContractFunctionParams

func (*ContractFunctionParams) AddUint256 added in v0.5.0

func (contract *ContractFunctionParams) AddUint256(value []byte) *ContractFunctionParams

func (*ContractFunctionParams) AddUint256Array added in v0.5.0

func (contract *ContractFunctionParams) AddUint256Array(value [][32]byte) *ContractFunctionParams

func (*ContractFunctionParams) AddUint32 added in v0.5.0

func (contract *ContractFunctionParams) AddUint32(value uint32) *ContractFunctionParams

func (*ContractFunctionParams) AddUint32Array added in v0.5.0

func (contract *ContractFunctionParams) AddUint32Array(value []uint32) *ContractFunctionParams

func (*ContractFunctionParams) AddUint64 added in v0.5.0

func (contract *ContractFunctionParams) AddUint64(value uint64) *ContractFunctionParams

func (*ContractFunctionParams) AddUint64Array added in v0.5.0

func (contract *ContractFunctionParams) AddUint64Array(value []uint64) *ContractFunctionParams

func (*ContractFunctionParams) AddUint8 added in v0.5.0

func (contract *ContractFunctionParams) AddUint8(value uint8) *ContractFunctionParams

type ContractFunctionResult added in v0.5.0

type ContractFunctionResult struct {
	// ContractID is the smart contract instance whose function was called
	ContractID *ContractID
	// ContractCallResult is the result returned by the function
	ContractCallResult []byte
	// ErrorMessage is the message returned in the case there was an error during smart contract execution
	ErrorMessage string
	// Bloom is the bloom filter for record
	Bloom []byte
	// GasUsed is the amount of gas used to execute the contract function
	GasUsed uint64
	// LogInfo is the log info for events returned by the function
	LogInfo []ContractLogInfo
}

ContractFunctionResult is the result returned by a call to a smart contract function. This is The response to a ContractCallQuery, and is in the record for a ContractCallQuery.

func (ContractFunctionResult) AsBytes added in v0.5.0

func (result ContractFunctionResult) AsBytes() []byte

AsBytes returns the raw bytes of the ContractCallResult

func (ContractFunctionResult) GetAddress added in v0.5.0

func (result ContractFunctionResult) GetAddress(index uint64) []byte

GetAddress gets a solidity address from the result at the given index

func (ContractFunctionResult) GetBool added in v0.5.0

func (result ContractFunctionResult) GetBool(index uint64) bool

GetBool gets a solidity bool from the result at the given index

func (ContractFunctionResult) GetBytes added in v0.5.0

func (result ContractFunctionResult) GetBytes(index uint64) []byte

GetBytes gets a byte array from the result at the given index

func (ContractFunctionResult) GetBytes32 added in v0.5.0

func (result ContractFunctionResult) GetBytes32(index uint64) []byte

GetBytes32 gets a solidity bytes32 from the result at the given index

func (ContractFunctionResult) GetInt256 added in v0.5.0

func (result ContractFunctionResult) GetInt256(index uint64) []byte

GetInt256 gets a solidity int256 from the result at the given index

func (ContractFunctionResult) GetInt32 added in v0.5.0

func (result ContractFunctionResult) GetInt32(index uint64) int32

GetInt32 gets a solidity int32 from the result at the given index

func (ContractFunctionResult) GetInt64 added in v0.5.0

func (result ContractFunctionResult) GetInt64(index uint64) int64

GetInt64 gets a solidity int64 from the result at the given index

func (ContractFunctionResult) GetInt8 added in v0.5.0

func (result ContractFunctionResult) GetInt8(index uint64) int8

GetInt8 gets a solidity int8 from the result at the given index

func (ContractFunctionResult) GetString added in v0.5.0

func (result ContractFunctionResult) GetString(index uint64) string

GetStrings gets a string from the result at the given index

func (ContractFunctionResult) GetUint256 added in v0.5.0

func (result ContractFunctionResult) GetUint256(index uint64) []byte

GetUint256 gets a solidity uint256 from the result at the given index

func (ContractFunctionResult) GetUint32 added in v0.5.0

func (result ContractFunctionResult) GetUint32(index uint64) uint32

GetUint32 gets a solidity uint32 from the result at the given index

func (ContractFunctionResult) GetUint64 added in v0.5.0

func (result ContractFunctionResult) GetUint64(index uint64) uint64

GetUint64 gets a solidity uint64 from the result at the given index

func (ContractFunctionResult) GetUint8 added in v0.5.0

func (result ContractFunctionResult) GetUint8(index uint64) uint8

GetUint8 gets a solidity uint8 from the result at the given index

type ContractFunctionSelector added in v0.5.0

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

func NewContractFunctionSelector added in v0.5.0

func NewContractFunctionSelector(name string) ContractFunctionSelector

func (*ContractFunctionSelector) AddAddress added in v0.5.0

func (selector *ContractFunctionSelector) AddAddress() *ContractFunctionSelector

func (*ContractFunctionSelector) AddAddressArray added in v0.5.0

func (selector *ContractFunctionSelector) AddAddressArray() *ContractFunctionSelector

func (*ContractFunctionSelector) AddBool added in v0.5.0

func (*ContractFunctionSelector) AddBoolArray added in v0.5.0

func (selector *ContractFunctionSelector) AddBoolArray() *ContractFunctionSelector

func (*ContractFunctionSelector) AddBytes added in v0.5.0

func (selector *ContractFunctionSelector) AddBytes() *ContractFunctionSelector

func (*ContractFunctionSelector) AddBytes32 added in v0.5.0

func (selector *ContractFunctionSelector) AddBytes32() *ContractFunctionSelector

func (*ContractFunctionSelector) AddBytes32Array added in v0.5.0

func (selector *ContractFunctionSelector) AddBytes32Array() *ContractFunctionSelector

func (*ContractFunctionSelector) AddBytesArray added in v0.5.0

func (selector *ContractFunctionSelector) AddBytesArray() *ContractFunctionSelector

func (*ContractFunctionSelector) AddFunction added in v0.5.0

func (selector *ContractFunctionSelector) AddFunction() *ContractFunctionSelector

func (*ContractFunctionSelector) AddInt256 added in v0.5.0

func (selector *ContractFunctionSelector) AddInt256() *ContractFunctionSelector

func (*ContractFunctionSelector) AddInt256Array added in v0.5.0

func (selector *ContractFunctionSelector) AddInt256Array() *ContractFunctionSelector

func (*ContractFunctionSelector) AddInt32 added in v0.5.0

func (selector *ContractFunctionSelector) AddInt32() *ContractFunctionSelector

func (*ContractFunctionSelector) AddInt32Array added in v0.5.0

func (selector *ContractFunctionSelector) AddInt32Array() *ContractFunctionSelector

func (*ContractFunctionSelector) AddInt64 added in v0.5.0

func (selector *ContractFunctionSelector) AddInt64() *ContractFunctionSelector

func (*ContractFunctionSelector) AddInt64Array added in v0.5.0

func (selector *ContractFunctionSelector) AddInt64Array() *ContractFunctionSelector

func (*ContractFunctionSelector) AddInt8 added in v0.5.0

func (*ContractFunctionSelector) AddInt8Array added in v0.5.0

func (selector *ContractFunctionSelector) AddInt8Array() *ContractFunctionSelector

func (*ContractFunctionSelector) AddString added in v0.5.0

func (selector *ContractFunctionSelector) AddString() *ContractFunctionSelector

func (*ContractFunctionSelector) AddStringArray added in v0.5.0

func (selector *ContractFunctionSelector) AddStringArray() *ContractFunctionSelector

func (*ContractFunctionSelector) AddUint256 added in v0.5.0

func (selector *ContractFunctionSelector) AddUint256() *ContractFunctionSelector

func (*ContractFunctionSelector) AddUint256Array added in v0.5.0

func (selector *ContractFunctionSelector) AddUint256Array() *ContractFunctionSelector

func (*ContractFunctionSelector) AddUint32 added in v0.5.0

func (selector *ContractFunctionSelector) AddUint32() *ContractFunctionSelector

func (*ContractFunctionSelector) AddUint32Array added in v0.5.0

func (selector *ContractFunctionSelector) AddUint32Array() *ContractFunctionSelector

func (*ContractFunctionSelector) AddUint64 added in v0.5.0

func (selector *ContractFunctionSelector) AddUint64() *ContractFunctionSelector

func (*ContractFunctionSelector) AddUint64Array added in v0.5.0

func (selector *ContractFunctionSelector) AddUint64Array() *ContractFunctionSelector

func (*ContractFunctionSelector) AddUint8 added in v0.5.0

func (selector *ContractFunctionSelector) AddUint8() *ContractFunctionSelector

func (*ContractFunctionSelector) AddUint8Array added in v0.5.0

func (selector *ContractFunctionSelector) AddUint8Array() *ContractFunctionSelector

func (*ContractFunctionSelector) String added in v0.5.0

func (selector *ContractFunctionSelector) String() string

type ContractID added in v0.2.0

type ContractID struct {
	Shard    uint64
	Realm    uint64
	Contract uint64
}

ContractID is the ID for a Hedera smart contract

func ContractIDFromSolidityAddress added in v0.5.0

func ContractIDFromSolidityAddress(s string) (ContractID, error)

ContractIDFromSolidityAddress constructs a ContractID from a string representation of a solidity address

func ContractIDFromString added in v0.2.0

func ContractIDFromString(s string) (ContractID, error)

ContractIDFromString constructs a ContractID from a string formatted as `Shard.Realm.Contract` (for example "0.0.3")

func (ContractID) String added in v0.2.0

func (id ContractID) String() string

String returns the string representation of a ContractID formatted as `Shard.Realm.Contract` (for example "0.0.3")

func (ContractID) ToSolidityAddress added in v0.5.0

func (id ContractID) ToSolidityAddress() string

ToSolidityAddress returns the string representation of the ContractID as a solidity address.

type ContractInfo added in v0.5.0

type ContractInfo struct {
	AccountID         AccountID
	ContractID        ContractID
	ContractAccountID string
	AdminKey          PublicKey
	ExpirationTime    time.Time
	AutoRenewPeriod   time.Duration
	Storage           uint64
	ContractMemo      string
}

ContractInfo is the information about the contract instance returned by a ContractInfoQuery

type ContractInfoQuery added in v0.5.0

type ContractInfoQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

ContractInfoQuery retrieves information about a smart contract instance. This includes the account that it uses, the file containing its bytecode, and the time when it will expire.

func NewContractInfoQuery added in v0.5.0

func NewContractInfoQuery() *ContractInfoQuery

NewContractInfoQuery creates a ContractInfoQuery builder which can be used to construct and execute a Contract Get Info Query.

func (*ContractInfoQuery) Cost added in v0.5.0

func (builder *ContractInfoQuery) Cost(client *Client) (Hbar, error)

Cost is a wrapper around the standard Cost function for a query. It must exist because deleted files return a COST_ANSWER of zero which triggers an INSUFFICIENT_TX_FEE response Status if set as the query payment. However, 25 tinybar seems to be enough to get FILE_DELETED back instead, so that is used instead.

func (*ContractInfoQuery) Execute added in v0.5.0

func (builder *ContractInfoQuery) Execute(client *Client) (ContractInfo, error)

Execute executes the ContractInfoQuery using the provided client

func (*ContractInfoQuery) SetContractID added in v0.5.0

func (builder *ContractInfoQuery) SetContractID(id ContractID) *ContractInfoQuery

SetContractID sets the contract for which information is requested

func (*ContractInfoQuery) SetMaxQueryPayment added in v0.5.0

func (builder *ContractInfoQuery) SetMaxQueryPayment(maxPayment Hbar) *ContractInfoQuery

func (*ContractInfoQuery) SetQueryPayment added in v0.5.0

func (builder *ContractInfoQuery) SetQueryPayment(paymentAmount Hbar) *ContractInfoQuery

func (*ContractInfoQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *ContractInfoQuery) SetQueryPaymentTransaction(tx Transaction) *ContractInfoQuery

type ContractLogInfo added in v0.5.0

type ContractLogInfo struct {
	ContractID ContractID
	Bloom      []byte
	Topics     [][]byte
	Data       []byte
}

ContractLogInfo is the log info for events returned by a function

type ContractRecordsQuery added in v0.5.0

type ContractRecordsQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

ContractRecordsQuery retrieves all of the records for a smart contract instance, for any function call (or the constructor call) during the last 25 hours, for which a Record was requested.

func NewContractRecordsQuery added in v0.5.0

func NewContractRecordsQuery() *ContractRecordsQuery

NewContractRecordsQuery creates a ContractRecordsQuery builder which can be used to construct and execute a Contract Get Records Query

func (*ContractRecordsQuery) Execute added in v0.5.0

func (builder *ContractRecordsQuery) Execute(client *Client) ([]TransactionRecord, error)

Execute executes the ContractRecordsQuery using the provided client.

func (*ContractRecordsQuery) SetContractID added in v0.5.0

func (builder *ContractRecordsQuery) SetContractID(id ContractID) *ContractRecordsQuery

SetContractID sets the smart contract instance for which the records should be retrieved

func (*ContractRecordsQuery) SetMaxQueryPayment added in v0.5.0

func (builder *ContractRecordsQuery) SetMaxQueryPayment(maxPayment Hbar) *ContractRecordsQuery

func (*ContractRecordsQuery) SetQueryPayment added in v0.5.0

func (builder *ContractRecordsQuery) SetQueryPayment(paymentAmount Hbar) *ContractRecordsQuery

func (*ContractRecordsQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *ContractRecordsQuery) SetQueryPaymentTransaction(tx Transaction) *ContractRecordsQuery

type ContractUpdateTransaction added in v0.5.0

type ContractUpdateTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

ContractUpdateTransaction is used to modify a smart contract instance to have the given parameter values. Any nil field is ignored (left unchanged). If only the contractInstanceExpirationTime is being modified, then no signature is needed on this transaction other than for the account paying for the transaction itself. But if any of the other fields are being modified, then it must be signed by the adminKey. The use of adminKey is not currently supported in this API, but in the future will be implemented to allow these fields to be modified, and also to make modifications to the state of the instance. If the contract is created with no admin key, then none of the fields can be changed that need an admin signature, and therefore no admin key can ever be added. So if there is no admin key, then things like the bytecode are immutable. But if there is an admin key, then they can be changed.

For example, the admin key might be a threshold key, which requires 3 of 5 binding arbitration judges to agree before the bytecode can be changed. This can be used to add flexibility to the management of smart contract behavior. But this is optional. If the smart contract is created without an admin key, then such a key can never be added, and its bytecode will be immutable.

func NewContractUpdateTransaction added in v0.5.0

func NewContractUpdateTransaction() ContractUpdateTransaction

NewContractUpdateTransaction creates a ContractUpdateTransaction builder which can be used to construct and execute a Contract Update Transaction.

func (ContractUpdateTransaction) SetAdminKey added in v0.5.0

func (builder ContractUpdateTransaction) SetAdminKey(publicKey PublicKey) ContractUpdateTransaction

SetAdminKey sets the key which can be used to arbitrarily modify the state of the instance by signing a ContractUpdateTransaction to modify it. If the admin key was never set then such modifications are not possible, and there is no administrator that can override the normal operation of the smart contract instance.

func (ContractUpdateTransaction) SetAutoRenewPeriod added in v0.5.0

func (builder ContractUpdateTransaction) SetAutoRenewPeriod(autoRenewPeriod time.Duration) ContractUpdateTransaction

SetAutoRenewPeriod sets the duration for which the contract instance will automatically charge its account to renew for.

func (ContractUpdateTransaction) SetBytecodeFileID added in v0.5.0

func (builder ContractUpdateTransaction) SetBytecodeFileID(id FileID) ContractUpdateTransaction

SetBytecodeFileID sets the file ID of file containing the smart contract byte code. A copy will be made and held by the contract instance, and have the same expiration time as the instance.

func (ContractUpdateTransaction) SetContractID added in v0.5.0

SetContractID sets The Contract ID instance to update (this can't be changed on the contract)

func (ContractUpdateTransaction) SetContractMemo added in v0.5.0

func (builder ContractUpdateTransaction) SetContractMemo(memo string) ContractUpdateTransaction

SetContractMemo sets the memo associated with the contract (max 100 bytes)

func (ContractUpdateTransaction) SetExpirationTime added in v0.5.0

func (builder ContractUpdateTransaction) SetExpirationTime(expiration time.Time) ContractUpdateTransaction

SetExpirationTime extends the expiration of the instance and its account to the provided time. If the time provided is the current or past time, then there will be no effect.

func (ContractUpdateTransaction) SetMaxTransactionFee added in v0.5.0

func (builder ContractUpdateTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) ContractUpdateTransaction

func (ContractUpdateTransaction) SetNodeAccountID added in v0.5.0

func (builder ContractUpdateTransaction) SetNodeAccountID(nodeAccountID AccountID) ContractUpdateTransaction

func (ContractUpdateTransaction) SetProxyAccountID added in v0.5.0

func (builder ContractUpdateTransaction) SetProxyAccountID(id AccountID) ContractUpdateTransaction

SetProxyAccountID sets the ID of the account to which this contract is proxy staked. If proxyAccountID is left unset, is an invalid account, or is an account that isn't a node, then this contract is automatically proxy staked to a node chosen by the network, but without earning payments. If the proxyAccountID account refuses to accept proxy staking, or if it is not currently running a node, then it will behave as if proxyAccountID was never set.

func (ContractUpdateTransaction) SetTransactionID added in v0.5.0

func (builder ContractUpdateTransaction) SetTransactionID(transactionID TransactionID) ContractUpdateTransaction

func (ContractUpdateTransaction) SetTransactionMemo added in v0.5.0

func (builder ContractUpdateTransaction) SetTransactionMemo(memo string) ContractUpdateTransaction

func (ContractUpdateTransaction) SetTransactionValidDuration added in v0.5.0

func (builder ContractUpdateTransaction) SetTransactionValidDuration(validDuration time.Duration) ContractUpdateTransaction

type CryptoTransferTransaction added in v0.5.0

type CryptoTransferTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

Transfer hbar from some account balances to other account balances. The accounts list can contain up to 10 accounts. The amounts list must be the same length as the accounts list.

This transaction must be signed by the keys for all the sending accounts, and for any receiving accounts that have receiverSigRequired == true. The signatures are in the same order as the accounts, skipping those accounts that don't need a signature.

func NewCryptoTransferTransaction added in v0.5.0

func NewCryptoTransferTransaction() CryptoTransferTransaction

NewCryptoTransferTransaction creates a CryptoTransferTransaction builder which can be used to construct and execute a Crypto Transfer Transaction.

func (CryptoTransferTransaction) AddRecipient added in v0.5.0

func (builder CryptoTransferTransaction) AddRecipient(id AccountID, amount Hbar) CryptoTransferTransaction

AddRecipient adds a recipient account and the amount of hbar to be received from the sender(s).

func (CryptoTransferTransaction) AddSender added in v0.5.0

func (builder CryptoTransferTransaction) AddSender(id AccountID, amount Hbar) CryptoTransferTransaction

AddSender adds an account and the amount of hbar (as a positive value) to be sent from the sender. If any sender account fails to have a sufficient balance to do the withdrawal, then the entire transaction fails, and none of those transfers occur, though the transaction fee is still charged.

func (CryptoTransferTransaction) AddTransfer added in v0.5.0

func (builder CryptoTransferTransaction) AddTransfer(id AccountID, amount Hbar) CryptoTransferTransaction

AddTransfer adds the accountID to the internal accounts list and the amounts to the internal amounts list. Each negative amount is withdrawn from the corresponding account (a sender), and each positive one is added to the corresponding account (a receiver). The amounts list must sum to zero and there can be a maximum of 10 transfers.

AddSender and AddRecipient are provided as convenience wrappers around AddTransfer.

func (CryptoTransferTransaction) SetMaxTransactionFee added in v0.5.0

func (builder CryptoTransferTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) CryptoTransferTransaction

func (CryptoTransferTransaction) SetNodeAccountID added in v0.5.0

func (builder CryptoTransferTransaction) SetNodeAccountID(nodeAccountID AccountID) CryptoTransferTransaction

func (CryptoTransferTransaction) SetTransactionID added in v0.5.0

func (builder CryptoTransferTransaction) SetTransactionID(transactionID TransactionID) CryptoTransferTransaction

func (CryptoTransferTransaction) SetTransactionMemo added in v0.5.0

func (builder CryptoTransferTransaction) SetTransactionMemo(memo string) CryptoTransferTransaction

func (CryptoTransferTransaction) SetTransactionValidDuration added in v0.5.0

func (builder CryptoTransferTransaction) SetTransactionValidDuration(validDuration time.Duration) CryptoTransferTransaction

type Ed25519PrivateKey added in v0.5.0

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

Ed25519PrivateKey is an ed25519 private key.

func Ed25519PrivateKeyFromBytes added in v0.5.0

func Ed25519PrivateKeyFromBytes(bytes []byte) (Ed25519PrivateKey, error)

Ed25519PrivateKeyFromBytes constructs an Ed25519PrivateKey from a raw slice of either 32 or 64 bytes.

func Ed25519PrivateKeyFromKeystore added in v0.5.0

func Ed25519PrivateKeyFromKeystore(ks []byte, passphrase string) (Ed25519PrivateKey, error)

Ed25519PrivateKeyFromKeystore recovers an Ed25519PrivateKey from an encrypted keystore encoded as a byte slice.

func Ed25519PrivateKeyFromMnemonic added in v0.5.0

func Ed25519PrivateKeyFromMnemonic(mnemonic Mnemonic, passPhrase string) (Ed25519PrivateKey, error)

Ed25519PrivateKeyFromMnemonic recovers an Ed25519PrivateKey from a valid 24 word length mnemonic phrase and a passphrase.

An empty string can be passed for passPhrase If the mnemonic phrase wasn't generated with a passphrase. This is required to recover a private key from a mnemonic generated by the Android and iOS wallets.

func Ed25519PrivateKeyFromPem added in v0.7.0

func Ed25519PrivateKeyFromPem(pemBytes []byte, passphrase string) (Ed25519PrivateKey, error)

func Ed25519PrivateKeyFromString added in v0.5.0

func Ed25519PrivateKeyFromString(s string) (Ed25519PrivateKey, error)

Ed25519PrivateKeyFromString recovers an Ed25519PrivateKey from its text-encoded representation.

func Ed25519PrivateKeyReadKeystore added in v0.5.0

func Ed25519PrivateKeyReadKeystore(source io.Reader, passphrase string) (Ed25519PrivateKey, error)

Ed25519PrivateKeyReadKeystore recovers an Ed25519PrivateKey from an encrypted keystore file.

func Ed25519PrivateKeyReadPem added in v0.7.0

func Ed25519PrivateKeyReadPem(source io.Reader, passphrase string) (Ed25519PrivateKey, error)

func GenerateEd25519PrivateKey added in v0.5.0

func GenerateEd25519PrivateKey() (Ed25519PrivateKey, error)

GenerateEd25519PrivateKey generates a random new Ed25519PrivateKey.

func (Ed25519PrivateKey) Bytes added in v0.5.0

func (sk Ed25519PrivateKey) Bytes() []byte

Bytes returns the byte slice representation of the Ed25519PrivateKey.

func (Ed25519PrivateKey) Derive added in v0.5.0

func (sk Ed25519PrivateKey) Derive(index uint32) (Ed25519PrivateKey, error)

Derive a child key compatible with the iOS and Android wallets using a provided wallet/account index. Use index 0 for the default account.

This will fail if the key does not support derivation which can be checked by calling SupportsDerivation()

func (Ed25519PrivateKey) Keystore added in v0.5.0

func (sk Ed25519PrivateKey) Keystore(passphrase string) ([]byte, error)

Keystore returns an encrypted keystore containing the Ed25519PrivateKey.

func (Ed25519PrivateKey) PublicKey added in v0.5.0

func (sk Ed25519PrivateKey) PublicKey() Ed25519PublicKey

PublicKey returns the Ed25519PublicKey associated with this Ed25519PrivateKey.

func (Ed25519PrivateKey) Sign added in v0.5.0

func (sk Ed25519PrivateKey) Sign(message []byte) []byte

Sign signs the provided message with the Ed25519PrivateKey.

func (Ed25519PrivateKey) String added in v0.5.0

func (sk Ed25519PrivateKey) String() string

String returns the text-encoded representation of the Ed25519PrivateKey.

func (Ed25519PrivateKey) SupportsDerivation added in v0.5.0

func (sk Ed25519PrivateKey) SupportsDerivation() bool

SupportsDerivation returns true if the Ed25519PrivateKey supports derivation.

func (Ed25519PrivateKey) WriteKeystore added in v0.5.0

func (sk Ed25519PrivateKey) WriteKeystore(destination io.Writer, passphrase string) error

WriteKeystore writes an encrypted keystore containing the Ed25519PrivateKey to the provided destination.

type Ed25519PublicKey added in v0.5.0

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

Ed25519PublicKey is an ed25519 public key.

func Ed25519PublicKeyFromBytes added in v0.5.0

func Ed25519PublicKeyFromBytes(bytes []byte) (Ed25519PublicKey, error)

Ed25519PublicKeyFromBytes constructs a known Ed25519PublicKey from its text-encoded representation.

func Ed25519PublicKeyFromString added in v0.5.0

func Ed25519PublicKeyFromString(s string) (Ed25519PublicKey, error)

Ed25519PublicKeyFromString recovers an Ed25519PublicKey from its text-encoded representation.

func (Ed25519PublicKey) Bytes added in v0.5.0

func (pk Ed25519PublicKey) Bytes() []byte

Bytes returns the byte slice representation of the Ed25519PublicKey.

func (Ed25519PublicKey) String added in v0.5.0

func (pk Ed25519PublicKey) String() string

String returns the text-encoded representation of the Ed25519PublicKey.

type EntityID added in v0.5.0

type EntityID interface {
	// contains filtered or unexported methods
}

EntityID is an interface for various IDs of entities (Account, Contract, File, etc)

type ErrBadKey added in v0.5.0

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

ErrBadKey is returned if a key is provided in an invalid format or structure

func (ErrBadKey) Error added in v0.5.0

func (e ErrBadKey) Error() string

Error() implements the Error interface

type ErrHederaNetwork added in v0.5.0

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

ErrHederaNetwork is returned in cases where the Hedera network cannot be reached or a network-side error occurs.

func (ErrHederaNetwork) Error added in v0.5.0

func (e ErrHederaNetwork) Error() string

Error() implements the Error interface

type ErrHederaPreCheckStatus added in v0.6.0

type ErrHederaPreCheckStatus struct {
	TxID   TransactionID
	Status Status
}

ErrHederaPreCheckStatus is returned by Transaction.Execute and QueryBuilder.Execute if an exceptional status is returned during network side validation of the sent transaction.

func (ErrHederaPreCheckStatus) Error added in v0.6.0

func (e ErrHederaPreCheckStatus) Error() string

Error() implements the Error interface

type ErrHederaReceiptStatus added in v0.6.0

type ErrHederaReceiptStatus struct {
	TxID   TransactionID
	Status Status
}

ErrHederaReceiptStatus is returned by TransactionID.GetReceipt if the status of the receipt is exceptional.

func (ErrHederaReceiptStatus) Error added in v0.6.0

func (e ErrHederaReceiptStatus) Error() string

Error() implements the Error interface

type ErrHederaRecordStatus added in v0.6.0

type ErrHederaRecordStatus struct {
	TxID   TransactionID
	Status Status
}

ErrHederaRecordStatus is returned by TransactionID.GetRecord if the status of the record is exceptional.

func (ErrHederaRecordStatus) Error added in v0.6.0

func (e ErrHederaRecordStatus) Error() string

Error() implements the Error interface

type ErrLocalValidation added in v0.5.0

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

ErrLocalValidation is returned by TransactionBuilder.Build(*Client) and QueryBuilder.Execute(*Client) if the constructed transaction or query fails local sanity checks.

func (ErrLocalValidation) Error added in v0.5.0

func (e ErrLocalValidation) Error() string

Error() implements the Error interface

type ErrMaxQueryPaymentExceeded added in v0.5.0

type ErrMaxQueryPaymentExceeded struct {
	// The cost of the query that was attempted as returned by QueryBuilder.GetCost
	QueryCost Hbar
	// The limit for a single automatic query payment, set by
	// Client.SetMaxQueryPayment(int64) or QueryBuilder.SetMaxQueryPayment(uint64).
	MaxQueryPayment Hbar
	// contains filtered or unexported fields
}

ErrMaxQueryPaymentExceeded is returned during query execution if the total cost of the query + estimated fees exceeds the max query payment threshold set on the client or QueryBuilder.

func (ErrMaxQueryPaymentExceeded) Error added in v0.5.0

Error() implements the Error interface

type FileAppendTransaction added in v0.5.0

type FileAppendTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

FileAppendTransaction appends the given contents to the end of the file. If a file is too big to create with a single FileCreateTransaction, then it can be created with the first part of its contents, and then appended multiple times to create the entire file.

func NewFileAppendTransaction added in v0.5.0

func NewFileAppendTransaction() FileAppendTransaction

NewFileAppendTransaction creates a FileAppendTransaction builder which can be used to construct and execute a File Append Transaction.

func (FileAppendTransaction) SetContents added in v0.5.0

func (builder FileAppendTransaction) SetContents(contents []byte) FileAppendTransaction

SetContents sets the bytes to append to the contents of the file.

func (FileAppendTransaction) SetFileID added in v0.5.0

func (builder FileAppendTransaction) SetFileID(id FileID) FileAppendTransaction

SetFileID sets the FileID of the file to which the bytes are appended to.

func (FileAppendTransaction) SetMaxTransactionFee added in v0.5.0

func (builder FileAppendTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) FileAppendTransaction

func (FileAppendTransaction) SetNodeAccountID added in v0.5.0

func (builder FileAppendTransaction) SetNodeAccountID(nodeAccountID AccountID) FileAppendTransaction

func (FileAppendTransaction) SetTransactionID added in v0.5.0

func (builder FileAppendTransaction) SetTransactionID(transactionID TransactionID) FileAppendTransaction

func (FileAppendTransaction) SetTransactionMemo added in v0.5.0

func (builder FileAppendTransaction) SetTransactionMemo(memo string) FileAppendTransaction

func (FileAppendTransaction) SetTransactionValidDuration added in v0.5.0

func (builder FileAppendTransaction) SetTransactionValidDuration(validDuration time.Duration) FileAppendTransaction

type FileContentsQuery added in v0.5.0

type FileContentsQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

FileContentsQuery retrieves the contents of a file.

func NewFileContentsQuery added in v0.5.0

func NewFileContentsQuery() *FileContentsQuery

NewFileContentsQuery creates a FileContentsQuery builder which can be used to construct and execute a File Get Contents Query.

func (*FileContentsQuery) Execute added in v0.5.0

func (builder *FileContentsQuery) Execute(client *Client) ([]byte, error)

Execute executes the FileContentsQuery using the provided client. The returned byte slice will be empty if the file is empty.

func (*FileContentsQuery) SetFileID added in v0.5.0

func (builder *FileContentsQuery) SetFileID(id FileID) *FileContentsQuery

SetFileID sets the FileID of the file whose contents are requested.

func (*FileContentsQuery) SetMaxQueryPayment added in v0.5.0

func (builder *FileContentsQuery) SetMaxQueryPayment(maxPayment Hbar) *FileContentsQuery

func (*FileContentsQuery) SetQueryPayment added in v0.5.0

func (builder *FileContentsQuery) SetQueryPayment(paymentAmount Hbar) *FileContentsQuery

func (*FileContentsQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *FileContentsQuery) SetQueryPaymentTransaction(tx Transaction) *FileContentsQuery

type FileCreateTransaction added in v0.5.0

type FileCreateTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

FileCreateTransaction creates a new file, containing the given contents. It is referenced by its FileID, and does not have a filename, so it is important to get and hold onto the FileID. After the file is created, the FileID for it can be found in the receipt, or retrieved with a GetByKey query, or by asking for a Record of the transaction to be created, and retrieving that.

See FileInfoQuery for more information about files.

The current API ignores shardID, realmID, and newRealmAdminKey, and creates everything in shard 0 and realm 0, with a null key. Future versions of the API will support multiple realms and multiple shards.

func NewFileCreateTransaction added in v0.5.0

func NewFileCreateTransaction() FileCreateTransaction

NewFileCreateTransaction creates a FileCreateTransaction builder which can be used to construct and execute a File Create Transaction.

func (FileCreateTransaction) AddKey added in v0.5.0

func (builder FileCreateTransaction) AddKey(publicKey PublicKey) FileCreateTransaction

AddKeys adds a key to the internal list of keys associated with the file. All of the keys on the list must sign to create or modify a file, but only one of them needs to sign in order to delete the file. Each of those "keys" may itself be threshold key containing other keys (including other threshold keys). In other words, the behavior is an AND for create/modify, OR for delete. This is useful for acting as a revocation server. If it is desired to have the behavior be AND for all 3 operations (or OR for all 3), then the list should have only a single Key, which is a threshold key, with N=1 for OR, N=M for AND.

If a file is created without adding ANY keys, the file is immutable and ONLY the expirationTime of the file can be changed using FileUpdateTransaction. The file contents or its keys will not be mutable.

func (FileCreateTransaction) SetContents added in v0.5.0

func (builder FileCreateTransaction) SetContents(contents []byte) FileCreateTransaction

SetContents sets the bytes that are the contents of the file (which can be empty). If the size of the file and other fields in the transaction exceed the max transaction size then FileAppendTransaction can be used to continue uploading the file.

func (FileCreateTransaction) SetExpirationTime added in v0.5.0

func (builder FileCreateTransaction) SetExpirationTime(expiration time.Time) FileCreateTransaction

SetExpirationTime sets the time at which this file should expire (unless FileUpdateTransaction is used before then to extend its life). The file will automatically disappear at the fileExpirationTime, unless its expiration is extended by another transaction before that time. If the file is deleted, then its contents will become empty and it will be marked as deleted until it expires, and then it will cease to exist.

func (FileCreateTransaction) SetMaxTransactionFee added in v0.5.0

func (builder FileCreateTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) FileCreateTransaction

func (FileCreateTransaction) SetNodeAccountID added in v0.5.0

func (builder FileCreateTransaction) SetNodeAccountID(nodeAccountID AccountID) FileCreateTransaction

func (FileCreateTransaction) SetTransactionID added in v0.5.0

func (builder FileCreateTransaction) SetTransactionID(transactionID TransactionID) FileCreateTransaction

func (FileCreateTransaction) SetTransactionMemo added in v0.5.0

func (builder FileCreateTransaction) SetTransactionMemo(memo string) FileCreateTransaction

func (FileCreateTransaction) SetTransactionValidDuration added in v0.5.0

func (builder FileCreateTransaction) SetTransactionValidDuration(validDuration time.Duration) FileCreateTransaction

type FileDeleteTransaction added in v0.5.0

type FileDeleteTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

func NewFileDeleteTransaction added in v0.5.0

func NewFileDeleteTransaction() FileDeleteTransaction

func (FileDeleteTransaction) Build added in v0.5.0

func (builder FileDeleteTransaction) Build(client *Client) (Transaction, error)

func (FileDeleteTransaction) SetFileID added in v0.5.0

func (builder FileDeleteTransaction) SetFileID(id FileID) FileDeleteTransaction

func (FileDeleteTransaction) SetMaxTransactionFee added in v0.5.0

func (builder FileDeleteTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) FileDeleteTransaction

func (FileDeleteTransaction) SetNodeAccountID added in v0.5.0

func (builder FileDeleteTransaction) SetNodeAccountID(nodeAccountID AccountID) FileDeleteTransaction

func (FileDeleteTransaction) SetTransactionID added in v0.5.0

func (builder FileDeleteTransaction) SetTransactionID(transactionID TransactionID) FileDeleteTransaction

func (FileDeleteTransaction) SetTransactionMemo added in v0.5.0

func (builder FileDeleteTransaction) SetTransactionMemo(memo string) FileDeleteTransaction

func (FileDeleteTransaction) SetTransactionValidDuration added in v0.5.0

func (builder FileDeleteTransaction) SetTransactionValidDuration(validDuration time.Duration) FileDeleteTransaction

type FileID added in v0.2.0

type FileID struct {
	Shard uint64
	Realm uint64
	File  uint64
}

func FileIDForAddressBook added in v0.5.0

func FileIDForAddressBook() FileID

The public node address book for the current network

func FileIDForExchangeRate added in v0.5.0

func FileIDForExchangeRate() FileID

The current exchange rates of HBAR to USD

func FileIDForFeeSchedule added in v0.5.0

func FileIDForFeeSchedule() FileID

The current fee schedule for the network

func FileIDFromSolidityAddress added in v0.5.0

func FileIDFromSolidityAddress(s string) (FileID, error)

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

func (FileID) ToSolidityAddress added in v0.5.0

func (id FileID) ToSolidityAddress() string

type FileInfo added in v0.5.0

type FileInfo struct {
	FileID         FileID
	Size           int64
	ExpirationTime time.Time
	IsDeleted      bool
	Keys           []PublicKey
}

type FileInfoQuery added in v0.5.0

type FileInfoQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

func NewFileInfoQuery added in v0.5.0

func NewFileInfoQuery() *FileInfoQuery

func (*FileInfoQuery) Cost added in v0.5.0

func (builder *FileInfoQuery) Cost(client *Client) (Hbar, error)

func (*FileInfoQuery) Execute added in v0.5.0

func (builder *FileInfoQuery) Execute(client *Client) (FileInfo, error)

func (*FileInfoQuery) SetFileID added in v0.5.0

func (builder *FileInfoQuery) SetFileID(id FileID) *FileInfoQuery

func (*FileInfoQuery) SetMaxQueryPayment added in v0.5.0

func (builder *FileInfoQuery) SetMaxQueryPayment(maxPayment Hbar) *FileInfoQuery

func (*FileInfoQuery) SetQueryPayment added in v0.5.0

func (builder *FileInfoQuery) SetQueryPayment(paymentAmount Hbar) *FileInfoQuery

func (*FileInfoQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *FileInfoQuery) SetQueryPaymentTransaction(tx Transaction) *FileInfoQuery

type FileUpdateTransaction added in v0.5.0

type FileUpdateTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

func NewFileUpdateTransaction added in v0.5.0

func NewFileUpdateTransaction() FileUpdateTransaction

func (FileUpdateTransaction) AddKey added in v0.5.0

func (builder FileUpdateTransaction) AddKey(publicKey PublicKey) FileUpdateTransaction

func (FileUpdateTransaction) SetContents added in v0.5.0

func (builder FileUpdateTransaction) SetContents(contents []byte) FileUpdateTransaction

func (FileUpdateTransaction) SetExpirationTime added in v0.5.0

func (builder FileUpdateTransaction) SetExpirationTime(expiration time.Time) FileUpdateTransaction

func (FileUpdateTransaction) SetFileID added in v0.5.0

func (builder FileUpdateTransaction) SetFileID(id FileID) FileUpdateTransaction

func (FileUpdateTransaction) SetMaxTransactionFee added in v0.5.0

func (builder FileUpdateTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) FileUpdateTransaction

func (FileUpdateTransaction) SetNodeAccountID added in v0.5.0

func (builder FileUpdateTransaction) SetNodeAccountID(nodeAccountID AccountID) FileUpdateTransaction

func (FileUpdateTransaction) SetTransactionID added in v0.5.0

func (builder FileUpdateTransaction) SetTransactionID(transactionID TransactionID) FileUpdateTransaction

func (FileUpdateTransaction) SetTransactionMemo added in v0.5.0

func (builder FileUpdateTransaction) SetTransactionMemo(memo string) FileUpdateTransaction

func (FileUpdateTransaction) SetTransactionValidDuration added in v0.5.0

func (builder FileUpdateTransaction) SetTransactionValidDuration(validDuration time.Duration) FileUpdateTransaction

type FreezeTransaction added in v0.5.0

type FreezeTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

func NewFreezeTransaction added in v0.5.0

func NewFreezeTransaction() FreezeTransaction

func (FreezeTransaction) SetEndTime added in v0.5.0

func (builder FreezeTransaction) SetEndTime(hour uint8, minute uint8) FreezeTransaction

func (FreezeTransaction) SetMaxTransactionFee added in v0.5.0

func (builder FreezeTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) FreezeTransaction

func (FreezeTransaction) SetNodeAccountID added in v0.5.0

func (builder FreezeTransaction) SetNodeAccountID(nodeAccountID AccountID) FreezeTransaction

func (FreezeTransaction) SetStartTime added in v0.5.0

func (builder FreezeTransaction) SetStartTime(hour uint8, minute uint8) FreezeTransaction

func (FreezeTransaction) SetTransactionID added in v0.5.0

func (builder FreezeTransaction) SetTransactionID(transactionID TransactionID) FreezeTransaction

func (FreezeTransaction) SetTransactionMemo added in v0.5.0

func (builder FreezeTransaction) SetTransactionMemo(memo string) FreezeTransaction

func (FreezeTransaction) SetTransactionValidDuration added in v0.5.0

func (builder FreezeTransaction) SetTransactionValidDuration(validDuration time.Duration) FreezeTransaction

type GetBySolidityIDQuery added in v0.5.0

type GetBySolidityIDQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

func NewGetBySolidityIDQuery added in v0.5.0

func NewGetBySolidityIDQuery() *GetBySolidityIDQuery

func (*GetBySolidityIDQuery) Execute added in v0.5.0

func (builder *GetBySolidityIDQuery) Execute(client *Client) (EntityID, error)

func (*GetBySolidityIDQuery) SetMaxQueryPayment added in v0.5.0

func (builder *GetBySolidityIDQuery) SetMaxQueryPayment(maxPayment Hbar) *GetBySolidityIDQuery

func (*GetBySolidityIDQuery) SetQueryPayment added in v0.5.0

func (builder *GetBySolidityIDQuery) SetQueryPayment(paymentAmount Hbar) *GetBySolidityIDQuery

func (*GetBySolidityIDQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *GetBySolidityIDQuery) SetQueryPaymentTransaction(tx Transaction) *GetBySolidityIDQuery

func (*GetBySolidityIDQuery) SetSolidityID added in v0.5.0

func (builder *GetBySolidityIDQuery) SetSolidityID(id string) *GetBySolidityIDQuery

type Hbar added in v0.5.0

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

func HbarFrom added in v0.5.0

func HbarFrom(bars float64, unit HbarUnit) Hbar

HbarFrom creates a representation of Hbar in tinybar on the unit provided

func HbarFromTinybar added in v0.5.0

func HbarFromTinybar(tinybar int64) Hbar

HbarFromTinybar creates a representation of Hbar in tinybars

func NewHbar added in v0.5.0

func NewHbar(hbar float64) Hbar

func (Hbar) As added in v0.5.0

func (hbar Hbar) As(unit HbarUnit) int64

func (Hbar) AsTinybar added in v0.5.0

func (hbar Hbar) AsTinybar() int64

func (Hbar) String added in v0.5.0

func (hbar Hbar) String() string

type HbarUnit added in v0.5.0

type HbarUnit string

func (HbarUnit) String added in v0.5.0

func (unit HbarUnit) String() string

func (HbarUnit) Symbol added in v0.5.0

func (unit HbarUnit) Symbol() string

type KeyList added in v0.5.0

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

func NewKeyList added in v0.5.0

func NewKeyList() *KeyList

func (*KeyList) Add added in v0.5.0

func (kl *KeyList) Add(key PublicKey) *KeyList

func (*KeyList) AddAll added in v0.5.0

func (kl *KeyList) AddAll(keys []PublicKey) *KeyList

type MirrorClient added in v0.5.0

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

func NewMirrorClient added in v0.5.0

func NewMirrorClient(endpoint string) (MirrorClient, error)

func (MirrorClient) Close added in v0.5.0

func (mc MirrorClient) Close() error

type MirrorConsensusTopicQuery added in v0.5.0

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

func NewMirrorConsensusTopicQuery added in v0.5.0

func NewMirrorConsensusTopicQuery() *MirrorConsensusTopicQuery

func (*MirrorConsensusTopicQuery) SetEndTime added in v0.5.0

func (*MirrorConsensusTopicQuery) SetLimit added in v0.5.0

func (*MirrorConsensusTopicQuery) SetStartTime added in v0.5.0

func (*MirrorConsensusTopicQuery) SetTopicID added in v0.5.0

func (*MirrorConsensusTopicQuery) Subscribe added in v0.5.0

func (b *MirrorConsensusTopicQuery) Subscribe(
	client MirrorClient,
	onNext func(MirrorConsensusTopicResponse),
	onError func(error),
) (MirrorSubscriptionHandle, error)

type MirrorConsensusTopicResponse added in v0.5.0

type MirrorConsensusTopicResponse struct {
	ConsensusTimeStamp time.Time
	Message            []byte
	RunningHash        []byte
	SequenceNumber     uint64
}

type MirrorSubscriptionHandle added in v0.5.0

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

func (MirrorSubscriptionHandle) Unsubscribe added in v0.5.0

func (handle MirrorSubscriptionHandle) Unsubscribe()

type Mnemonic added in v0.5.0

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

func GenerateMnemonic added in v0.5.0

func GenerateMnemonic() (Mnemonic, error)

GenerateMnemonic generates a random 24-word mnemonic

func MnemonicFromString added in v0.5.0

func MnemonicFromString(s string) (Mnemonic, error)

MnemonicFromString creates a mnemonic from a string of 24 words separated by spaces

Keys are lazily generated

func NewMnemonic added in v0.5.0

func NewMnemonic(words []string) (Mnemonic, error)

NewMnemonic Creates a mnemonic from a slice of 24 strings

Keys are lazily generated

func (Mnemonic) String added in v0.5.0

func (m Mnemonic) String() string

func (Mnemonic) ToPrivateKey added in v0.5.0

func (m Mnemonic) ToPrivateKey(passPhrase string) (Ed25519PrivateKey, error)

func (Mnemonic) Words added in v0.5.0

func (m Mnemonic) Words() []string

type PublicKey

type PublicKey interface {
	// contains filtered or unexported methods
}

type QueryBuilder added in v0.5.0

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

func (*QueryBuilder) GetCost added in v0.7.0

func (builder *QueryBuilder) GetCost(client *Client) (Hbar, error)

func (*QueryBuilder) SetMaxQueryPayment added in v0.5.0

func (builder *QueryBuilder) SetMaxQueryPayment(maxPayment Hbar) *QueryBuilder

func (*QueryBuilder) SetQueryPayment added in v0.5.0

func (builder *QueryBuilder) SetQueryPayment(paymentAmount Hbar) *QueryBuilder

func (*QueryBuilder) SetQueryPaymentTransaction added in v0.5.0

func (builder *QueryBuilder) SetQueryPaymentTransaction(tx Transaction) *QueryBuilder

type Status added in v0.3.0

type Status uint32
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
	StatusInvalidSignatureTypeMismatchingKey  Status = 51
	StatusInvalidSignatureCountMismatchingKey Status = 52
	StatusEmptyClaimBody                      Status = 53
	StatusEmptyClaimHash                      Status = 54
	StatusEmptyClaimKeys                      Status = 55
	StatusInvalidClaimHashSize                Status = 56
	StatusEmptyQueryBody                      Status = 57
	StatusEmptyClaimQuery                     Status = 58
	StatusClaimNotFound                       Status = 59
	StatusAccountIDDoesNotExist               Status = 60
	StatusClaimAlreadyExists                  Status = 61
	StatusInvalidFileWacl                     Status = 62
	StatusSerializationFailed                 Status = 63
	StatusTransactionOversize                 Status = 64
	StatusTransactionTooManyLayers            Status = 65
	StatusContractDeleted                     Status = 66
	StatusPlatformNotActive                   Status = 67
	StatusKeyPrefixMismatch                   Status = 68
	StatusPlatformTransactionNotCreated       Status = 69
	StatusInvalidRenewalPeriod                Status = 70
	StatusInvalidPayerAccountID               Status = 71
	StatusAccountDeleted                      Status = 72
	StatusFileDeleted                         Status = 73
	StatusAccountRepeatedInAccountAmounts     Status = 74
	StatusSettingNegativeAccountBalance       Status = 75
	StatusObtainerRequired                    Status = 76
	StatusObtainerSameContractID              Status = 77
	StatusObtainerDoesNotExist                Status = 78
	StatusModifyingImmutableContract          Status = 79
	StatusFileSystemException                 Status = 80
	StatusAutorenewDurationNotInRange         Status = 81
	StatusErrorDecodingBytestring             Status = 82
	StatusContractFileEmpty                   Status = 83
	StatusContractBytecodeEmpty               Status = 84
	StatusInvalidInitialBalance               Status = 85
	StatusInvalidReceiveRecordThreshold       Status = 86
	StatusInvalidSendRecordThreshold          Status = 87
	StatusAccountIsNotGenesisAccount          Status = 88
	StatusPayerAccountUnauthorized            Status = 89
	StatusInvalidFreezeTransactionBody        Status = 90
	StatusFreezeTransactionBodyNotFound       Status = 91
	StatusTransferListSizeLimitExceeded       Status = 92
	StatusResultSizeLimitExceeded             Status = 93
	StatusNotSpecialAccount                   Status = 94
	StatusContractNegativeGas                 Status = 95
	StatusContractNegativeValue               Status = 96
	StatusInvalidFeeFile                      Status = 97
	StatusInvalidExchangeRateFile             Status = 98
	StatusInsufficientLocalCallGas            Status = 99
	StatusEntityNotAllowedToDelete            Status = 100
	StatusAuthorizationFailed                 Status = 101
	StatusFileUploadedProtoInvalid            Status = 102
	StatusFileUploadedProtoNotSavedToDisk     Status = 103
	StatusFeeScheduleFilePartUploaded         Status = 104
	StatusExchangeRateChangeLimitExceeded     Status = 105
	StatusMaxContractStorageExceeded          Status = 106
	StatusTransferAccountSameAsDeleteAccount  Status = 107
	StatusTotalLedgerBalanceInvalid           Status = 108
	StatusExpirationReductionNotAllowed       Status = 110
	StatusMaxGasLimitExceeded                 Status = 111
	StatusMaxFileSizeExceeded                 Status = 112
	StatusInvalidTopicID                      Status = 150
	StatusInvalidAdminKey                     Status = 155
	StatusInvalidSubmitKey                    Status = 156
	StatusUnauthorized                        Status = 157
	StatusInvalidTopicMessage                 Status = 158
	StatusInvalidAutoRenewAccount             Status = 159
	StatusAutoRenewAccountNotAllowed          Status = 160
	StatusTopicExpired                        Status = 162
)

func (Status) String added in v0.3.0

func (status Status) String() string

String() returns a string representation of the status

type SystemDeleteTransaction added in v0.5.0

type SystemDeleteTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

func NewSystemDeleteTransaction added in v0.5.0

func NewSystemDeleteTransaction() SystemDeleteTransaction

func (SystemDeleteTransaction) SetContractID added in v0.5.0

func (SystemDeleteTransaction) SetExpirationTime added in v0.5.0

func (builder SystemDeleteTransaction) SetExpirationTime(expiration time.Time) SystemDeleteTransaction

func (SystemDeleteTransaction) SetFileID added in v0.5.0

func (SystemDeleteTransaction) SetMaxTransactionFee added in v0.5.0

func (builder SystemDeleteTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) SystemDeleteTransaction

func (SystemDeleteTransaction) SetNodeAccountID added in v0.5.0

func (builder SystemDeleteTransaction) SetNodeAccountID(nodeAccountID AccountID) SystemDeleteTransaction

func (SystemDeleteTransaction) SetTransactionID added in v0.5.0

func (builder SystemDeleteTransaction) SetTransactionID(transactionID TransactionID) SystemDeleteTransaction

func (SystemDeleteTransaction) SetTransactionMemo added in v0.5.0

func (builder SystemDeleteTransaction) SetTransactionMemo(memo string) SystemDeleteTransaction

func (SystemDeleteTransaction) SetTransactionValidDuration added in v0.5.0

func (builder SystemDeleteTransaction) SetTransactionValidDuration(validDuration time.Duration) SystemDeleteTransaction

type SystemUndeleteTransaction added in v0.5.0

type SystemUndeleteTransaction struct {
	TransactionBuilder
	// contains filtered or unexported fields
}

func NewSystemUndeleteTransaction added in v0.5.0

func NewSystemUndeleteTransaction() SystemUndeleteTransaction

func (SystemUndeleteTransaction) SetContractID added in v0.5.0

func (SystemUndeleteTransaction) SetFileID added in v0.5.0

func (SystemUndeleteTransaction) SetMaxTransactionFee added in v0.5.0

func (builder SystemUndeleteTransaction) SetMaxTransactionFee(maxTransactionFee Hbar) SystemUndeleteTransaction

func (SystemUndeleteTransaction) SetNodeAccountID added in v0.5.0

func (builder SystemUndeleteTransaction) SetNodeAccountID(nodeAccountID AccountID) SystemUndeleteTransaction

func (SystemUndeleteTransaction) SetTransactionID added in v0.5.0

func (builder SystemUndeleteTransaction) SetTransactionID(transactionID TransactionID) SystemUndeleteTransaction

func (SystemUndeleteTransaction) SetTransactionMemo added in v0.5.0

func (builder SystemUndeleteTransaction) SetTransactionMemo(memo string) SystemUndeleteTransaction

func (SystemUndeleteTransaction) SetTransactionValidDuration added in v0.5.0

func (builder SystemUndeleteTransaction) SetTransactionValidDuration(validDuration time.Duration) SystemUndeleteTransaction

type ThresholdKey added in v0.5.0

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

func NewThresholdKey added in v0.5.0

func NewThresholdKey(threshold uint32) *ThresholdKey

func (*ThresholdKey) Add added in v0.5.0

func (tk *ThresholdKey) Add(key PublicKey) *ThresholdKey

func (*ThresholdKey) AddAll added in v0.5.0

func (tk *ThresholdKey) AddAll(keys []PublicKey) *ThresholdKey

type Transaction

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

Transaction contains the protobuf of a prepared transaction which can be signed and executed.

func (Transaction) Execute

func (transaction Transaction) Execute(client *Client) (TransactionID, error)

Execute executes the Transaction with the provided client

func (Transaction) ID added in v0.5.0

func (transaction Transaction) ID() TransactionID

ID returns the transaction ID of the transaction

func (Transaction) MarshalBinary added in v0.6.0

func (transaction Transaction) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Transaction) Sign

func (transaction Transaction) Sign(privateKey Ed25519PrivateKey) Transaction

Sign uses the provided privateKey to sign the transaction.

func (Transaction) SignWith added in v0.5.0

func (transaction Transaction) SignWith(publicKey Ed25519PublicKey, signer TransactionSigner) Transaction

SignWith executes the TransactionSigner and adds the resulting signature data to the Transaction's signature map with the publicKey as the map key.

func (Transaction) String added in v0.5.0

func (transaction Transaction) String() string

func (*Transaction) UnmarshalBinary added in v0.6.0

func (transaction *Transaction) UnmarshalBinary(txBytes []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

type TransactionBuilder added in v0.5.0

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

TransactionBuilder is used to construct Transactions. The state is mutable through the various setter functions.

func (TransactionBuilder) Build added in v0.5.0

func (builder TransactionBuilder) Build(client *Client) (Transaction, error)

Build validates and finalizes the transaction's state and prepares it for execution, returning a Transaction. The inner state becomes immutable, however it can still be signed after building.

func (TransactionBuilder) Execute added in v0.5.0

func (builder TransactionBuilder) Execute(client *Client) (TransactionID, error)

Execute is a short hand function to build and execute a transaction. It first calls build on the TransactionBuilder and as long as validation passes it will then execute the resulting Transaction.

func (TransactionBuilder) GetCost added in v0.7.0

func (builder TransactionBuilder) GetCost(client *Client) (Hbar, error)

GetCost returns the estimated cost of the transaction.

NOTE: The actual cost returned by Hedera is within 99.8% to 99.9% of the actual fee that will be assessed. We're unsure if this is because the fee fluctuates that much or if the calculations are simply incorrect on the server. To compensate for this we just bump by a 1% the value returned. As this would only ever be a maximum this will not cause you to be charged more.

func (TransactionBuilder) SetMaxTransactionFee added in v0.5.0

func (builder TransactionBuilder) SetMaxTransactionFee(maxTransactionFee Hbar) TransactionBuilder

func (TransactionBuilder) SetNodeAccountID added in v0.5.0

func (builder TransactionBuilder) SetNodeAccountID(nodeAccountID AccountID) TransactionBuilder

func (TransactionBuilder) SetTransactionID added in v0.5.0

func (builder TransactionBuilder) SetTransactionID(transactionID TransactionID) TransactionBuilder

func (TransactionBuilder) SetTransactionMemo added in v0.5.0

func (builder TransactionBuilder) SetTransactionMemo(memo string) TransactionBuilder

func (TransactionBuilder) SetTransactionValidDuration added in v0.5.0

func (builder TransactionBuilder) SetTransactionValidDuration(validDuration time.Duration) TransactionBuilder

type TransactionID

type TransactionID struct {
	AccountID  AccountID
	ValidStart time.Time
}

TransactionID is the id used to identify a Transaction on the Hedera network. It consists of an AccountID and a a valid start time.

func NewTransactionID added in v0.5.0

func NewTransactionID(accountID AccountID) TransactionID

NewTransactionID constructs a new Transaction id struct with the provided AccountID and the valid start time set to the current time - 10 seconds.

func NewTransactionIDWithValidStart added in v0.6.0

func NewTransactionIDWithValidStart(accountID AccountID, validStart time.Time) TransactionID

NewTransactionIDWithValidStart constructs a new Transaction id struct with the provided AccountID and the valid start time set to a provided time.

func (TransactionID) GetReceipt added in v0.5.0

func (id TransactionID) GetReceipt(client *Client) (TransactionReceipt, error)

GetReceipt queries the network for a receipt corresponding to the TransactionID's transaction. If the status of the receipt is exceptional an ErrHederaReceiptStatus will be returned alongside the receipt, otherwise only the receipt will be returned.

func (TransactionID) GetRecord added in v0.5.0

func (id TransactionID) GetRecord(client *Client) (TransactionRecord, error)

GetRecord queries the network for a record corresponding to the TransactionID's transaction. If the status of the record's receipt is exceptional an ErrHederaRecordStatus will be returned alongside the record, otherwise, only the record will be returned. If consensus has not been reached, this function will return a HederaReceiptError with a status of StatusBusy.

func (TransactionID) String

func (id TransactionID) String() string

String returns a string representation of the TransactionID in `AccountID@ValidStartSeconds.ValidStartNanos` format

type TransactionReceipt

type TransactionReceipt struct {
	// Status is the consensus status of the receipt's transaction. It might be unknown or have Failed.
	Status Status
	// contains filtered or unexported fields
}

TransactionReceipt is the consensus result for a transaction which is returned from a TransactionReceiptQuery.

func (TransactionReceipt) GetAccountID added in v0.5.0

func (receipt TransactionReceipt) GetAccountID() AccountID

GetAccountID returns the AccountID associated with the receipt's transaction or else panics if no AccountID exists

func (TransactionReceipt) GetConsensusTopicID added in v0.5.0

func (receipt TransactionReceipt) GetConsensusTopicID() ConsensusTopicID

GetConsensusTopicID returns the ConsensusTopicID associated with the receipt's transaction or else panics if no ConsensusTopicID exists

func (TransactionReceipt) GetConsensusTopicRunningHash added in v0.5.0

func (receipt TransactionReceipt) GetConsensusTopicRunningHash() []byte

GetConsensusTopicRunningHash returns the running hash associated with the Consensus Topic. However, if a ConsensusTopicID does not exist on the receipt it will return potentially invalid values (likely an empty slice).

func (TransactionReceipt) GetConsensusTopicSequenceNumber added in v0.5.0

func (receipt TransactionReceipt) GetConsensusTopicSequenceNumber() uint64

GetConsensusTopicSequenceNumber returns the topic sequence number associated with the Consensus Topic. However, if a ConsensusTopicID does not exist on the receipt it will return potentially invalid values.

func (TransactionReceipt) GetContractID added in v0.5.0

func (receipt TransactionReceipt) GetContractID() ContractID

GetContractID returns the ContractID associated with the receipt's transaction or else panics if no ContractID exists

func (TransactionReceipt) GetFileID added in v0.5.0

func (receipt TransactionReceipt) GetFileID() FileID

GetFileID returns the FileID associated with the receipt's transaction or else panics no FileID exists

func (TransactionReceipt) TryGetAccountID added in v0.5.0

func (receipt TransactionReceipt) TryGetAccountID() (AccountID, error)

TryGetAccountID returns the AccountID associated with the receipt's transaction or else returns an error if no AccountID exists

func (TransactionReceipt) TryGetConsensusTopicID added in v0.5.0

func (receipt TransactionReceipt) TryGetConsensusTopicID() (ConsensusTopicID, error)

TryGetConsensusTopicID returns the ConsensusTopicID associated with the receipt's transaction or else returns an error if no ConsensusTopicID exists

func (TransactionReceipt) TryGetConsensusTopicRunningHash added in v0.5.0

func (receipt TransactionReceipt) TryGetConsensusTopicRunningHash() ([]byte, error)

TryGetConsensusTopicRunningHash checks if the receipt contains a ConsensusTopicID. If the ConsensusTopicID exists it will return the running hash associated with the consensus Topic. Otherwise, an error will be returned.

func (TransactionReceipt) TryGetConsensusTopicSequenceNumber added in v0.5.0

func (receipt TransactionReceipt) TryGetConsensusTopicSequenceNumber() (uint64, error)

TryGetConsensusTopicSequenceNumber checks if the receipt contains a ConsensusTopicID. If the ConsensusTopicID exists it will return the ConsensusTopicSequenceNumber. Otherwise an error will be returned.

func (TransactionReceipt) TryGetContractID added in v0.5.0

func (receipt TransactionReceipt) TryGetContractID() (ContractID, error)

TryGetContractID returns the ContractID associated with the receipt's transaction or else returns an error if no ContractID exists

func (TransactionReceipt) TryGetFileID added in v0.5.0

func (receipt TransactionReceipt) TryGetFileID() (FileID, error)

TryGetFileID returns the FileID associated with the receipt's transaction or else returns an err if no FileID exists.

type TransactionReceiptQuery added in v0.5.0

type TransactionReceiptQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

func NewTransactionReceiptQuery added in v0.5.0

func NewTransactionReceiptQuery() *TransactionReceiptQuery

func (*TransactionReceiptQuery) Execute added in v0.5.0

func (builder *TransactionReceiptQuery) Execute(client *Client) (TransactionReceipt, error)

func (*TransactionReceiptQuery) SetMaxQueryPayment added in v0.5.0

func (builder *TransactionReceiptQuery) SetMaxQueryPayment(maxPayment Hbar) *TransactionReceiptQuery

func (*TransactionReceiptQuery) SetQueryPayment added in v0.5.0

func (builder *TransactionReceiptQuery) SetQueryPayment(paymentAmount Hbar) *TransactionReceiptQuery

func (*TransactionReceiptQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *TransactionReceiptQuery) SetQueryPaymentTransaction(tx Transaction) *TransactionReceiptQuery

func (*TransactionReceiptQuery) SetTransactionID added in v0.5.0

func (builder *TransactionReceiptQuery) SetTransactionID(id TransactionID) *TransactionReceiptQuery

type TransactionRecord added in v0.5.0

type TransactionRecord struct {
	Receipt            TransactionReceipt
	TransactionHash    []byte
	ConsensusTimestamp time.Time
	TransactionID      TransactionID
	TransactionMemo    string
	TransactionFee     Hbar
	Transfers          []Transfer
	// contains filtered or unexported fields
}

func (TransactionRecord) GetContractCreateResult added in v0.5.0

func (record TransactionRecord) GetContractCreateResult() (ContractFunctionResult, error)

func (TransactionRecord) GetContractExecuteResult added in v0.5.0

func (record TransactionRecord) GetContractExecuteResult() (ContractFunctionResult, error)

type TransactionRecordQuery added in v0.5.0

type TransactionRecordQuery struct {
	QueryBuilder
	// contains filtered or unexported fields
}

func NewTransactionRecordQuery added in v0.5.0

func NewTransactionRecordQuery() *TransactionRecordQuery

func (*TransactionRecordQuery) Execute added in v0.5.0

func (builder *TransactionRecordQuery) Execute(client *Client) (TransactionRecord, error)

func (*TransactionRecordQuery) SetMaxQueryPayment added in v0.5.0

func (builder *TransactionRecordQuery) SetMaxQueryPayment(maxPayment Hbar) *TransactionRecordQuery

func (*TransactionRecordQuery) SetQueryPayment added in v0.5.0

func (builder *TransactionRecordQuery) SetQueryPayment(paymentAmount Hbar) *TransactionRecordQuery

func (*TransactionRecordQuery) SetQueryPaymentTransaction added in v0.5.0

func (builder *TransactionRecordQuery) SetQueryPaymentTransaction(tx Transaction) *TransactionRecordQuery

func (*TransactionRecordQuery) SetTransactionID added in v0.5.0

func (builder *TransactionRecordQuery) SetTransactionID(id TransactionID) *TransactionRecordQuery

type TransactionSigner added in v0.5.0

type TransactionSigner func(message []byte) []byte

Transaction signer is a closure or function that defines how transactions will be signed

type Transfer added in v0.5.0

type Transfer struct {
	AccountID AccountID
	Amount    Hbar
}

Source Files

Jump to

Keyboard shortcuts

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