sui_json_rpc_api

Trait TransactionBuilderServer

Source
pub trait TransactionBuilderServer:
    Sized
    + Send
    + Sync
    + 'static {
Show 14 methods // Required methods fn transfer_object<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, object_id: ObjectID, gas: Option<ObjectID>, gas_budget: BigInt<u64>, recipient: SuiAddress, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn transfer_sui<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, sui_object_id: ObjectID, gas_budget: BigInt<u64>, recipient: SuiAddress, amount: Option<BigInt<u64>>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pay<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, input_coins: Vec<ObjectID>, recipients: Vec<SuiAddress>, amounts: Vec<BigInt<u64>>, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pay_sui<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, input_coins: Vec<ObjectID>, recipients: Vec<SuiAddress>, amounts: Vec<BigInt<u64>>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pay_all_sui<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, input_coins: Vec<ObjectID>, recipient: SuiAddress, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn move_call<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, package_object_id: ObjectID, module: String, function: String, type_arguments: Vec<SuiTypeTag>, arguments: Vec<SuiJsonValue>, gas: Option<ObjectID>, gas_budget: BigInt<u64>, execution_mode: Option<SuiTransactionBlockBuilderMode>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn publish<'life0, 'async_trait>( &'life0 self, sender: SuiAddress, compiled_modules: Vec<Base64>, dependencies: Vec<ObjectID>, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn split_coin<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, coin_object_id: ObjectID, split_amounts: Vec<BigInt<u64>>, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn split_coin_equal<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, coin_object_id: ObjectID, split_count: BigInt<u64>, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn merge_coin<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, primary_coin: ObjectID, coin_to_merge: ObjectID, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn batch_transaction<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, single_transaction_params: Vec<RPCTransactionRequestParams>, gas: Option<ObjectID>, gas_budget: BigInt<u64>, txn_builder_mode: Option<SuiTransactionBlockBuilderMode>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn request_add_stake<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, coins: Vec<ObjectID>, amount: Option<BigInt<u64>>, validator: SuiAddress, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn request_withdraw_stake<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, staked_sui: ObjectID, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided method fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the TransactionBuilder RPC API.

Required Methods§

Source

fn transfer_object<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, object_id: ObjectID, gas: Option<ObjectID>, gas_budget: BigInt<u64>, recipient: SuiAddress, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an unsigned transaction to transfer an object from one address to another. The object’s type must allow public transfers

Source

fn transfer_sui<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, sui_object_id: ObjectID, gas_budget: BigInt<u64>, recipient: SuiAddress, amount: Option<BigInt<u64>>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an unsigned transaction to send SUI coin object to a Sui address. The SUI object is also used as the gas object.

Source

fn pay<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, input_coins: Vec<ObjectID>, recipients: Vec<SuiAddress>, amounts: Vec<BigInt<u64>>, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send Coin<T> to a list of addresses, where T can be any coin type, following a list of amounts, The object specified in the gas field will be used to pay the gas fee for the transaction. The gas object can not appear in input_coins. If the gas object is not specified, the RPC server will auto-select one.

Source

fn pay_sui<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, input_coins: Vec<ObjectID>, recipients: Vec<SuiAddress>, amounts: Vec<BigInt<u64>>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send SUI coins to a list of addresses, following a list of amounts. This is for SUI coin only and does not require a separate gas coin object. Specifically, what pay_sui does are:

  1. debit each input_coin to create new coin following the order of amounts and assign it to the corresponding recipient.
  2. accumulate all residual SUI from input coins left and deposit all SUI to the first input coin, then use the first input coin as the gas coin object.
  3. the balance of the first input coin after tx is sum(input_coins) - sum(amounts) - actual_gas_cost
  4. all other input coints other than the first one are deleted.
Source

fn pay_all_sui<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, input_coins: Vec<ObjectID>, recipient: SuiAddress, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send all SUI coins to one recipient. This is for SUI coin only and does not require a separate gas coin object. Specifically, what pay_all_sui does are:

  1. accumulate all SUI from input coins and deposit all SUI to the first input coin
  2. transfer the updated first coin to the recipient and also use this first coin as gas coin object.
  3. the balance of the first input coin after tx is sum(input_coins) - actual_gas_cost.
  4. all other input coins other than the first are deleted.
Source

fn move_call<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, package_object_id: ObjectID, module: String, function: String, type_arguments: Vec<SuiTypeTag>, arguments: Vec<SuiJsonValue>, gas: Option<ObjectID>, gas_budget: BigInt<u64>, execution_mode: Option<SuiTransactionBlockBuilderMode>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an unsigned transaction to execute a Move call on the network, by calling the specified function in the module of a given package.

Source

fn publish<'life0, 'async_trait>( &'life0 self, sender: SuiAddress, compiled_modules: Vec<Base64>, dependencies: Vec<ObjectID>, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an unsigned transaction to publish a Move package.

Source

fn split_coin<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, coin_object_id: ObjectID, split_amounts: Vec<BigInt<u64>>, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an unsigned transaction to split a coin object into multiple coins.

Source

fn split_coin_equal<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, coin_object_id: ObjectID, split_count: BigInt<u64>, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an unsigned transaction to split a coin object into multiple equal-size coins.

Source

fn merge_coin<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, primary_coin: ObjectID, coin_to_merge: ObjectID, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an unsigned transaction to merge multiple coins into one coin.

Source

fn batch_transaction<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, single_transaction_params: Vec<RPCTransactionRequestParams>, gas: Option<ObjectID>, gas_budget: BigInt<u64>, txn_builder_mode: Option<SuiTransactionBlockBuilderMode>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an unsigned batched transaction.

Source

fn request_add_stake<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, coins: Vec<ObjectID>, amount: Option<BigInt<u64>>, validator: SuiAddress, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add stake to a validator’s staking pool using multiple coins and amount.

Source

fn request_withdraw_stake<'life0, 'async_trait>( &'life0 self, signer: SuiAddress, staked_sui: ObjectID, gas: Option<ObjectID>, gas_budget: BigInt<u64>, ) -> Pin<Box<dyn Future<Output = RpcResult<TransactionBlockBytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Withdraw stake from a validator’s staking pool.

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§