Skip to main content

GraphQlTransactionBuilder

open class GraphQlTransactionBuilder : Disposable, AutoCloseable, GraphQlTransactionBuilderInterface

A builder for creating transactions which uses a GraphQL client to automatically resolve inputs. Use finish to finalize the transaction data.

Functions​

NameSummary
authorizeUpgradeopen override fun authorizeUpgrade(upgradeCapability: PtbArgument, upgradePolicy: UpgradePolicy, digest: Digest, upgradeTicketName: String): GraphQlTransactionBuilder
Authorize a package upgrade by calling 0x2::package::authorize_upgrade.
close@Synchronized
open override fun close()
commitUpgradeopen override fun commitUpgrade(upgradeCapability: PtbArgument, upgradeReceipt: PtbArgument): GraphQlTransactionBuilder
Commit a package upgrade by calling 0x2::package::commit_upgrade, consuming the UpgradeReceipt returned by upgrade().
destroyopen override fun destroy()
divideCoinopen override fun divideCoin(coin: PtbArgument, count: ULong, coinType: TypeTag?): GraphQlTransactionBuilder
Divide a coin into count coins of equal value, all kept by the sender.
dryRunopen suspend override fun dryRun(skipChecks: Boolean): GraphQlDryRunResult
Dry run the transaction.
executeopen suspend override fun execute(signer: TransactionSigner, waitFor: WaitForTransaction?): TransactionEffects
Execute the transaction and optionally wait for finalization.
executeWithGasStationopen suspend override fun executeWithGasStation(gasStation: GasStation, signer: TransactionSigner): TransactionEffects
Execute the transaction with its gas paid by gas_station, and wait for finalization.
executeWithSponsorSigneropen suspend override fun executeWithSponsorSigner(signer: TransactionSigner, sponsorSigner: TransactionSigner, waitFor: WaitForTransaction?): TransactionEffects
Execute the transaction with both the sender's and the sponsor's signature, and optionally wait for finalization.
expirationopen override fun expiration(epoch: ULong): GraphQlTransactionBuilder
Set the expiration of the transaction to be a specific epoch.
finishopen suspend override fun finish(): Transaction
Convert this builder into a transaction.
finishWithBudgetopen suspend override fun finishWithBudget(gasBudget: ULong): Transaction
Convert this builder into a transaction with the given gas budget, used as-is (no estimation or minimum clamp) and overriding any budget set via gas_budget.
gasopen override fun gas(objectIds: List<ObjectId>): GraphQlTransactionBuilder
Add gas coins that will be consumed. Optional.
gasBudgetopen override fun gasBudget(budget: ULong): GraphQlTransactionBuilder
Set the gas budget for the transaction.
gasPriceopen override fun gasPrice(price: ULong): GraphQlTransactionBuilder
Set the gas price for the transaction.
makeMoveVecopen override fun makeMoveVec(elements: List<MoveArg>, typeTag: TypeTag, name: String): GraphQlTransactionBuilder
Make a move vector from a list of elements. The elements must all be of the type indicated by type_tag.
mergeCoinsopen override fun mergeCoins(primaryCoin: PtbArgument, consumedCoins: List<PtbArgument>): GraphQlTransactionBuilder
Merge multiple coins into one.
moveCallopen override fun moveCall(package: Address, module: Identifier, function: Identifier, arguments: List<PtbArgument>, typeArgs: List<TypeTag>, names: List<String>): GraphQlTransactionBuilder
Call a Move function with the given arguments.
payopen override fun pay(coins: List<PtbArgument>, payments: List<Payment>): GraphQlTransactionBuilder
Send coins to multiple recipients, each paired with the amount to send.
payIotaopen override fun payIota(payments: List<Payment>): GraphQlTransactionBuilder
Send IOTA to multiple recipients, each paired with the amount to send.
publishPackageopen override fun publishPackage(packageData: MovePackageData, upgradeCapName: String): GraphQlTransactionBuilder
Publish a list of modules with the given dependencies. The result assigned to upgrade_cap_name is the 0x2::package::UpgradeCap Move type. Note that the upgrade capability needs to be handled after this call:
sendCoinsopen override fun sendCoins(coins: List<PtbArgument>, recipient: Address, amount: PtbArgument?): GraphQlTransactionBuilder
Transfer some coins to a recipient address. If multiple coins are provided then they will be merged.
senderopen override fun sender(sender: Address): GraphQlTransactionBuilder
Set the sender address.
sendIotaopen override fun sendIota(recipient: Address, amount: PtbArgument): GraphQlTransactionBuilder
Send IOTA to a recipient address.
splitCoinsopen override fun splitCoins(coin: PtbArgument, amounts: List<PtbArgument>, names: List<String>): GraphQlTransactionBuilder
Split a coin into many.
sponsoropen override fun sponsor(sponsor: Address): GraphQlTransactionBuilder
Set the sponsor of the transaction.
stakeopen override fun stake(stake: PtbArgument, validatorAddress: Address): GraphQlTransactionBuilder
Add stake to a validator's staking pool.
transferObjectsopen override fun transferObjects(recipient: Address, objects: List<PtbArgument>): GraphQlTransactionBuilder
Transfer a list of objects to the given address, without producing any result.
unstakeopen override fun unstake(stakedIota: PtbArgument): GraphQlTransactionBuilder
Withdraw stake from a validator's staking pool.
upgradeopen override fun upgrade(packageId: ObjectId, packageData: MovePackageData, upgradeTicket: PtbArgument, name: String?): GraphQlTransactionBuilder
Upgrade a Move package.
upgradePackageopen override fun upgradePackage(packageId: ObjectId, packageData: MovePackageData, upgradeCapability: PtbArgument, upgradePolicy: UpgradePolicy): GraphQlTransactionBuilder
Upgrade a Move package.