Sign and Execute Transaction

Once an application is connected to Martian wallet via the connect method, the app can request the user to sign and execute the transaction on the Sui Network using window.martian.sui.signAndExecuteTransaction()and it will return a Promise that resolves when the user accepts the request and rejects (throw when awaited) when the user declines the request or the request is not valid/fails. It takes one parameter listed below

Here is an example code that demonstrates how to call the signAndExecuteTransactionBlock API on the Sui Network using Martian Wallet:

// Create a transaction
const response = await window.martian.sui.connect(['viewAccount', 'suggestTransactions']);
const tx = new TransactionBlock();
  target: '0x2::devnet_nft::mint',
  arguments: [
const input = {
  transactionBlockSerialized: tx.serialize(),
  options: {
    showEffects: true,
const transaction = await window.martian.sui.signAndExecuteTransactionBlock(input);

By using this function, developers can easily integrate their applications with the Sui Network and leverage the security and decentralization provided by the Sui blockchain.

Last updated