Building Offline
To build a transaction offline (with no client
required), you need to fully define all of your
input values and gas configuration (see the following example). For pure values, you can provide a
Uint8Array
which is used directly in the transaction. For objects, you can use the Inputs
helper
to construct an object reference.
import { Inputs } from '@mysten/sui/transactions';
// for owned or immutable objects
tx.object(Inputs.ObjectRef({ digest, objectId, version }));
// for shared objects
tx.object(Inputs.SharedObjectRef({ objectId, initialSharedVersion, mutable }));
You can then omit the client
object when calling build
on the transaction. Any required data
that is missing throws an error.