Documentation ¶
Index ¶
- Constants
- Variables
- func GetTransactionResult(code int32) string
- func GetTransactionResults() map[int32]string
- type AccountId
- func NewAccountIdFromAlias(alias []byte, shard, realm int64) (zero AccountId, _ error)
- func NewAccountIdFromEntity(entity domain.Entity) (zero AccountId, _ error)
- func NewAccountIdFromEntityId(accountId domain.EntityId) AccountId
- func NewAccountIdFromPublicKeyBytes(keyBytes []byte, shard, realm int64) (zero AccountId, _ error)
- func NewAccountIdFromSdkAccountId(accountId hedera.AccountID) (zero AccountId, _ error)
- func NewAccountIdFromString(address string, shard, realm int64) (zero AccountId, _ error)
- func (a AccountId) GetAlias() []byte
- func (a AccountId) GetCurveType() types.CurveType
- func (a AccountId) GetId() int64
- func (a AccountId) HasAlias() bool
- func (a AccountId) IsZero() bool
- func (a AccountId) String() string
- func (a AccountId) ToRosetta() *types.AccountIdentifier
- func (a AccountId) ToSdkAccountId() hedera.AccountID
- type AddressBookEntries
- type AddressBookEntry
- type Amount
- type AmountSlice
- type Block
- type HbarAmount
- type Operation
- type OperationSlice
- type PublicKey
- type Transaction
Constants ¶
const ( MetadataKeyMetadatas = "metadatas" MetadataKeySerialNumbers = "serial_numbers" MetadataKeyType = "type" )
const ( MetadataKeyMemo = "memo" OperationTypeCryptoCreateAccount = "CRYPTOCREATEACCOUNT" OperationTypeCryptoTransfer = "CRYPTOTRANSFER" OperationTypeTokenAssociate = "TOKENASSOCIATE" OperationTypeTokenBurn = "TOKENBURN" OperationTypeTokenCreate = "TOKENCREATION" OperationTypeTokenDelete = "TOKENDELETION" OperationTypeTokenDissociate = "TOKENDISSOCIATE" // #nosec OperationTypeTokenFreeze = "TOKENFREEZE" OperationTypeTokenGrantKyc = "TOKENGRANTKYC" OperationTypeTokenMint = "TOKENMINT" OperationTypeTokenRevokeKyc = "TOKENREVOKEKYC" OperationTypeTokenUnfreeze = "TOKENUNFREEZE" OperationTypeTokenUpdate = "TOKENUPDATE" OperationTypeTokenWipe = "TOKENWIPE" OperationTypeFee = "FEE" )
const (
Blockchain = "Hedera"
)
Variables ¶
var ( CurrencyHbar = &types.Currency{ Symbol: currencySymbol, Decimals: currencyDecimals, Metadata: map[string]interface{}{ "issuer": Blockchain, }, } SupportedOperationTypes = []string{ OperationTypeCryptoCreateAccount, OperationTypeCryptoTransfer, OperationTypeTokenAssociate, OperationTypeTokenBurn, OperationTypeTokenCreate, OperationTypeTokenDelete, OperationTypeTokenDissociate, OperationTypeTokenFreeze, OperationTypeTokenGrantKyc, OperationTypeTokenMint, OperationTypeTokenRevokeKyc, OperationTypeTokenUnfreeze, OperationTypeTokenUpdate, OperationTypeTokenWipe, } )
var TransactionTypes = map[int32]string{ 0: "UNKNOWN", 7: "CONTRACTCALL", 8: "CONTRACTCREATEINSTANCE", 9: "CONTRACTUPDATEINSTANCE", 10: "CRYPTOADDLIVEHASH", 11: OperationTypeCryptoCreateAccount, 12: "CRYPTODELETE", 13: "CRYPTODELETELIVEHASH", 14: OperationTypeCryptoTransfer, 15: "CRYPTOUPDATEACCOUNT", 16: "FILEAPPEND", 17: "FILECREATE", 18: "FILEDELETE", 19: "FILEUPDATE", 20: "SYSTEMDELETE", 21: "SYSTEMUNDELETE", 22: "CONTRACTDELETEINSTANCE", 23: "FREEZE", 24: "CONSENSUSCREATETOPIC", 25: "CONSENSUSUPDATETOPIC", 26: "CONSENSUSDELETETOPIC", 27: "CONSENSUSSUBMITMESSAGE", 28: "UNCHECKEDSUBMIT", 29: OperationTypeTokenCreate, 31: OperationTypeTokenFreeze, 32: OperationTypeTokenUnfreeze, 33: OperationTypeTokenGrantKyc, 34: OperationTypeTokenRevokeKyc, 35: OperationTypeTokenDelete, 36: OperationTypeTokenUpdate, 37: OperationTypeTokenMint, 38: OperationTypeTokenBurn, 39: OperationTypeTokenWipe, 40: OperationTypeTokenAssociate, 41: OperationTypeTokenDissociate, 42: "SCHEDULECREATE", 43: "SCHEDULEDELETE", 44: "SCHEDULESIGN", 45: "TOKENFEESCHEDULEUPDATE", 46: "TOKENPAUSE", 47: "TOKENUNPAUSE", 48: "CRYPTOAPPROVEALLOWANCE", 49: "CRYPTODELETEALLOWANCE", 50: "ETHEREUMTRANSACTION", 51: "NODESTAKEUPDATE", 52: "UTILPRNG", }
Functions ¶
func GetTransactionResult ¶
func GetTransactionResults ¶
Types ¶
type AccountId ¶
type AccountId struct {
// contains filtered or unexported fields
}
func NewAccountIdFromAlias ¶
func NewAccountIdFromEntity ¶
NewAccountIdFromEntity creates AccountId from the entity. If the entity has a network alias, the function will parse it to the rosetta format
func NewAccountIdFromString ¶
NewAccountIdFromString creates AccountId from the address string. If the address is in the shard.realm.num form, shard and realm are ignored. The only valid form of the alias address is the hex string of the raw public key bytes.
func (AccountId) GetCurveType ¶
func (AccountId) ToRosetta ¶
func (a AccountId) ToRosetta() *types.AccountIdentifier
func (AccountId) ToSdkAccountId ¶
func (a AccountId) ToSdkAccountId() hedera.AccountID
type AddressBookEntries ¶
type AddressBookEntries struct {
Entries []AddressBookEntry
}
AddressBookEntries is domain level struct used to represent an array of AddressBookEntry
func (*AddressBookEntries) ToRosetta ¶
func (abe *AddressBookEntries) ToRosetta() []*types.Peer
ToRosetta returns an array of Rosetta type Peer
type AddressBookEntry ¶
AddressBookEntry is domain level struct used to represent Rosetta Peer
type Amount ¶
type AmountSlice ¶
type AmountSlice []Amount
func (AmountSlice) ToRosetta ¶
func (a AmountSlice) ToRosetta() []*types.Amount
type Block ¶
type Block struct { ConsensusEndNanos int64 ConsensusStartNanos int64 Hash string Index int64 ParentHash string ParentIndex int64 Transactions []*Transaction }
Block is domain level struct used to represent Block conceptual mapping in Hedera
func (*Block) GetRosettaBlockIdentifier ¶
func (b *Block) GetRosettaBlockIdentifier() *types.BlockIdentifier
func (*Block) GetTimestampMillis ¶
GetTimestampMillis returns the block timestamp in milliseconds
type HbarAmount ¶
type HbarAmount struct {
Value int64
}
func (*HbarAmount) GetDecimals ¶
func (h *HbarAmount) GetDecimals() int64
func (*HbarAmount) GetSymbol ¶
func (h *HbarAmount) GetSymbol() string
func (*HbarAmount) GetValue ¶
func (h *HbarAmount) GetValue() int64
func (*HbarAmount) ToRosetta ¶
func (h *HbarAmount) ToRosetta() *types.Amount
ToRosetta returns Rosetta type Amount with hbar currency
type Operation ¶
type Operation struct { AccountId AccountId Amount Amount Index int64 Metadata map[string]interface{} Status string Type string }
Operation is domain level struct used to represent Operation within Transaction
type OperationSlice ¶
type OperationSlice []Operation
func (OperationSlice) ToRosetta ¶
func (o OperationSlice) ToRosetta() []*types.Operation
ToRosetta returns a slice of Rosetta Operation
type PublicKey ¶
type PublicKey struct {
hedera.PublicKey
}
PublicKey embed hedera.PublicKey and implement the Unmarshaler interface
func NewPublicKeyFromAlias ¶
func (*PublicKey) UnmarshalJSON ¶
type Transaction ¶
type Transaction struct { EntityId *domain.EntityId Hash string Memo []byte Operations OperationSlice }
Transaction is domain level struct used to represent Transaction conceptual mapping in Hedera
func (*Transaction) ToRosetta ¶
func (t *Transaction) ToRosetta() *types.Transaction
ToRosetta returns Rosetta type Transaction from the current domain type Transaction