Skip to main content

unsafe_moveCall

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

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

Parameters

  • signer : <SuiAddress> - the transaction signer's Sui address
  • package_object_id : <ObjectID> - the Move package ID, e.g. `0x2`
  • module : <string> - the Move module name, e.g. `devnet_nft`
  • function : <string> - the move function name, e.g. `mint`
  • type_arguments : <[TypeTag]> - the type arguments of the Move function
  • arguments : <[SuiJsonValue]> - the arguments to be passed into the Move function, in SuiJson format
  • gas : <ObjectID> - gas object to be used in this transaction, node will pick one from the signer's possession if not provided
  • gas_budget : <uint64> - the gas budget, the transaction will fail if the gas cost exceed the budget
  • execution_mode : <SuiTransactionBuilderMode> - Whether this is a Normal transaction or a Dev Inspect Transaction. Default to be `SuiTransactionBuilderMode::Commit` when it's None.

Returns

  • TransactionBytes : <TransactionBytes>
    • gas : <[ObjectRef]> - the gas object to be used
    • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
    • txBytes : <[Base64]> - BCS serialized transaction data bytes without its type tag, as base-64 encoded string.

Example Request and Result for unsafe_moveCall

Request

curl --location 'https://sui-testnet.blastapi.io/<project-id>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "unsafe_moveCall",
"params": [
"0x00c364252964511b32b084c17a492093d5b762cbe2766d46911912718e56950f",
"0x0000000000000000000000000000000000000000000000000000000000000002",
"bag",
"borrow",
[
"0x2::devnet_nft::MintNFTEvent"
],
["copy","drop"],
"0x30dab78d58471a78496eb71c2c6e77ba268f0390",
"1",
"Commit"
]
}'