java.lang.Object
com.hedera.hashgraph.sdk.HbarAllowance
An approved allowance of hbar transfers for a spender.
See Hedera Documentation
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHbarAllowance(AccountId ownerAccountId, AccountId spenderAccountId, Hbar amount) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic HbarAllowancefromBytes(byte[] bytes) Create a hbar allowance from a byte array.(package private) static HbarAllowancefromProtobuf(CryptoAllowance allowanceProto) Create a hbar allowance from a crypto allowance protobuf.(package private) static HbarAllowancefromProtobuf(GrantedCryptoAllowance allowanceProto) Create a hbar allowance from a granted crypto allowance protobuf.byte[]toBytes()Create the byte array.(package private) GrantedCryptoAllowanceConvert a crypto allowance into a granted crypto allowance protobuf.(package private) CryptoAllowanceConvert a crypto allowance into a protobuf.toString()(package private) voidvalidateChecksums(Client client) Validate that the client is configured correctly.
-
Field Details
-
ownerAccountId
The account ID of the hbar owner (ie. the grantor of the allowance) -
spenderAccountId
The account ID of the spender of the hbar allowance -
amount
The amount of the spender's allowance in tinybars
-
-
Constructor Details
-
Method Details
-
fromProtobuf
Create a hbar allowance from a crypto allowance protobuf.- Parameters:
allowanceProto- the crypto allowance protobuf- Returns:
- the new hbar allowance
-
fromProtobuf
Create a hbar allowance from a granted crypto allowance protobuf.- Parameters:
allowanceProto- the granted crypto allowance protobuf- Returns:
- the new hbar allowance
-
fromBytes
public static HbarAllowance fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException Create a hbar allowance from a byte array.- Parameters:
bytes- the byte array- Returns:
- the new hbar allowance
- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
validateChecksums
Validate that the client is configured correctly.- Parameters:
client- the client to verify- Throws:
BadEntityIdException- if entity ID is formatted poorly
-
toProtobuf
CryptoAllowance toProtobuf()Convert a crypto allowance into a protobuf.- Returns:
- the protobuf
-
toGrantedProtobuf
GrantedCryptoAllowance toGrantedProtobuf()Convert a crypto allowance into a granted crypto allowance protobuf.- Returns:
- the granted crypto allowance
-
toBytes
public byte[] toBytes()Create the byte array.- Returns:
- a byte array representation
-
toString
-