Account
Represents an account in the Stellar network with its sequence number.
An Account object is required to build a transaction. It contains the account ID and the current sequence number, which is needed to prevent transaction replay attacks.
Usage
// Create account from account ID (public key)
val account = Account("GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H", 2908908335136768L)
// Create account from keypair
val keypair = KeyPair.fromSecretSeed("SCZANGBA5YHTNYVVV4C3U252E2B6P6F5T3U6MM63WBSBZATAQI3EBTQ4")
val account = Account(keypair, 2908908335136768L)Content copied to clipboard
Sequence Numbers
The sequence number is crucial for transaction ordering:
It starts at 0 when an account is created
Each transaction increments the sequence number by 1
Transactions must use sequenceNumber + 1
Multiple transactions can be built by incrementing the sequence number