TransactionBuilder

Class that allows to construct Stellar transactions, containing one or more operations

Functions

Link copied to clipboard
fun addAccountSigner(signerAddress: AccountKeyPair, signerWeight: Int): TransactionBuilder

Add new signer to the account. Use caution when adding new signers, make sure you set the correct signer weight. Otherwise, you might lock the account irreversibly.

Link copied to clipboard
fun addAssetSupport(asset: IssuedAssetId, trustLimit: String = Long.MAX_VALUE.toBigDecimal().movePointLeft(DECIMAL_POINT_PRECISION).toPlainString()): TransactionBuilder

Add an asset (trustline) to the account.

Link copied to clipboard
fun addOperation(operation: Operation): TransactionBuilder

Adds operation to this builder

Link copied to clipboard
fun build(): Transaction

Creates transaction

Link copied to clipboard
fun createAccount(newAccount: AccountKeyPair, startingBalance: ULong): TransactionBuilder

Create an account in the network.

Link copied to clipboard
fun lockAccountMasterKey(): TransactionBuilder

Lock the master key of the account (set its weight to 0). Use caution when locking account's master key. Make sure you have set the correct signers and weights. Otherwise, you might lock the account irreversibly.

Link copied to clipboard
fun removeAccountSigner(signerAddress: AccountKeyPair): TransactionBuilder

Remove signer from the account.

Link copied to clipboard
fun removeAssetSupport(asset: IssuedAssetId): TransactionBuilder

Remove an asset (trustline) from the account.

Link copied to clipboard
fun setMemo(memo: Pair<MemoType, String>): TransactionBuilder

Set memo to this builder

Link copied to clipboard
fun setThreshold(low: Int, medium: Int, high: Int): TransactionBuilder
Link copied to clipboard
fun sponsoring(sponsorAccount: AccountKeyPair, sponsoredAccount: AccountKeyPair? = null, body: SponsoringBuilder.() -> SponsoringBuilder): TransactionBuilder

Start a sponsoring block

Link copied to clipboard
fun transfer(destinationAddress: String, assetId: StellarAssetId, amount: String): TransactionBuilder

Creates transaction transferring asset, using Stellar's payment operation (https://developers.stellar.org/docs/fundamentals-and-concepts/list-of-operations#payment) to move asset between accounts.

Link copied to clipboard
fun transferWithdrawalTransaction(transaction: WithdrawalTransaction, assetId: StellarAssetId): TransactionBuilder

Add a transfer to this builder from the withdrawal transaction

Properties

Link copied to clipboard
open override val operations: MutableList<Operation>