pub struct MoveCall {
pub package: ObjectId,
pub module: String,
pub function: String,
pub type_arguments: Vec<String>,
pub arguments: Vec<Value>,
pub gas: Option<ObjectId>,
pub gas_budget: u64,
}Expand description
Description of a single Move call. The RPC server builds the
TransactionData from this plus the signer address.
Fields§
§package: ObjectIdAddress of the Move package (the tai package on the target network).
module: StringModule name within the package, e.g. "launchpad".
function: StringFunction name within the module, e.g. "record_service_payment_sui".
type_arguments: Vec<String>Type arguments (instantiates the function’s generic parameters).
Concrete Move type strings, e.g. "0xabc::larry::LARRY".
arguments: Vec<Value>Positional Move arguments. Each argument is serialized as either: an object id (string), a pure number, a string, an array of pure values, etc. The RPC server resolves shared object IDs to refs.
gas: Option<ObjectId>Optional gas object override. None lets the RPC pick a coin from
the signer’s owned coins.
gas_budget: u64Maximum gas in MIST.
Implementations§
Source§impl MoveCall
impl MoveCall
Sourcepub fn new(
package: ObjectId,
module: impl Into<String>,
function: impl Into<String>,
) -> Self
pub fn new( package: ObjectId, module: impl Into<String>, function: impl Into<String>, ) -> Self
Construct a Move call with the default gas budget and auto-selected gas coin.
Sourcepub fn arg_object(self, id: ObjectId) -> Self
pub fn arg_object(self, id: ObjectId) -> Self
Append an object-id argument.
Sourcepub fn arg_u64(self, n: u64) -> Self
pub fn arg_u64(self, n: u64) -> Self
Append a pure u64 argument. Sui’s unsafe_moveCall is strict about
numeric arg encoding — it rejects JSON numbers (0) for u64 with
"Unexpected arg Number(0) for expected type U64" and only accepts
strings ("0"). Stringify always so we don’t trip on edge cases
like the operator-daily-limit-of-zero in a sovereign launch.
Sourcepub fn arg_addr(self, a: SuiAddress) -> Self
pub fn arg_addr(self, a: SuiAddress) -> Self
Append a pure address argument.
Sourcepub fn arg_option_id(self, opt: Option<ObjectId>) -> Self
pub fn arg_option_id(self, opt: Option<ObjectId>) -> Self
Append a pure Option<ID> argument.
Sui’s RPC format for Move Option arguments is an array:
[] for None, [inner] for Some(inner).
Sourcepub fn arg_vec_addr(self, addrs: &[SuiAddress]) -> Self
pub fn arg_vec_addr(self, addrs: &[SuiAddress]) -> Self
Append a pure vector<address> argument.
Sourcepub fn arg_vec_id(self, ids: &[ObjectId]) -> Self
pub fn arg_vec_id(self, ids: &[ObjectId]) -> Self
Append a pure vector<ID> argument.
Sourcepub fn arg_vec_u8(self, bytes: &[u8]) -> Self
pub fn arg_vec_u8(self, bytes: &[u8]) -> Self
Append a pure vector<u8> argument (sent as JSON array of numbers
rather than base64, which the Sui RPC also accepts and is easier to
read in tx replays).
Sourcepub fn arg_string(self, s: &str) -> Self
pub fn arg_string(self, s: &str) -> Self
Append a pure String argument.
Sourcepub fn with_gas_budget(self, gas_budget: u64) -> Self
pub fn with_gas_budget(self, gas_budget: u64) -> Self
Override the gas budget.