Creates an object helper for a configured AftermathApi.
The API instance whose gRPC client performs object requests.
Adds a transaction command that transfers an object to the zero address.
This is a local transaction builder and performs no network I/O. It mutates
tx; the caller must still set gas details, sign, and execute the returned
transaction. The object is transferred to 0x0, which is the SDK's burn
destination.
The transaction being built and the object argument to burn.
The transaction argument returned by transferObjects.
Fetches one object and converts it with a caller-provided caster.
The fetch performs gRPC network I/O through fetchObject. The caster runs
locally after the request and receives the gRPC object view, not the old
JSON-RPC SuiObjectResponse envelope.
The object ID, caster, and optional Display flag.
The value produced by objectFromSuiObjectResponse.
Fetches an object batch and casts each successful object locally.
The fetch performs parallel gRPC network I/O through fetchObjectBatch.
Per-object errors dropped by that method never reach the caster.
The object IDs, caster, and optional gRPC include or Display flags.
The caster output for each object returned by gRPC.
Fetches an object's BCS bytes and converts them with a caller-provided BCS type and deserializer.
The method performs gRPC network I/O through fetchObjectBcs. It decodes
the base64 payload with bcsType.fromBase64 and then calls
fromDeserialized locally.
The value returned by fromDeserialized.
import { bcs } from "@mysten/sui/bcs";
import { AftermathApi } from "aftermath-ts-sdk";
declare const api: AftermathApi;
const objectId = "0x0000000000000000000000000000000000000000000000000000000000000002";
const value = await api.Objects().fetchCastObjectBcs({
objectId,
bcsType: bcs.u64(),
fromDeserialized: (amount) => amount,
});
Fetches one object with custom include flags and converts it with a caster.
The fetch performs gRPC network I/O through fetchObjectGeneral. The
caster runs locally and receives the gRPC object view returned by that
method.
The object ID, caster, and gRPC include flags.
The value produced by objectFromSuiObjectResponse.
Fetches all owned objects of a Move type and casts them locally.
The fetch performs paginated gRPC network I/O through
fetchObjectsOfTypeOwnedByAddress. The caster receives each successful
gRPC object view in page order.
The owner address, exact Move type, caster, and optional Display or compatibility include flags.
The caster output for every matching owned object.
Checks whether an object or package can be fetched from the gRPC fullnode.
This method performs network I/O through getObject. It returns false
for any fetch error, including a missing object and an unavailable node, so
it does not distinguish absence from transport failure.
The Sui object ID or published package ID to check.
true when getObject succeeds, otherwise false.
Checks whether an object is owned by an address owner or an object owner.
The method performs network I/O by fetching the object through gRPC. It
returns false when the object has no supported owner arm or when its
owner differs from walletAddress.
The object ID and wallet or parent-object address to compare with the object's owner.
true when either gRPC owner form equals walletAddress.
Fetches one object with the JSON view required by SDK casters.
This method performs gRPC network I/O through getObject. It always asks
for json: true and requests Display output only when withDisplay is
true. The helper wraps a fullnode error in a new Error whose message
starts with an error occured fetching object:.
The object ID and optional Display flag.
The gRPC object view. A caster that reads Display fields requires
withDisplay: true.
Fetches objects in gRPC batches of at most 50 IDs.
This method performs network I/O through getObjects. Requests run in
parallel by batch. Each per-object Error arm is dropped, while a request
failure for an entire batch rejects the method. When include is omitted,
the helper requests json: true and sets display from withDisplay.
The object IDs and optional gRPC include or Display flags.
objectIds are split into requests of 50 IDs or fewer.
Successful object views in batch and server order. Missing or otherwise failed individual objects are absent from the result.
gRPC's getObjects returns (Object | Error)[] — a per-object
error arm JSON-RPC's multiGetObjects did not have, delivered as real
Error instances. Those entries are dropped rather than handed to a caster:
spreading one into objectFromSuiObjectResponse would throw deep inside the
cast with a message that names neither the batch nor the missing id.
This is a deliberate behaviour change and the more forgiving one. Previously
a single missing object in a batch threw from inside the caster and lost the
whole batch; now the surviving objects are returned. nftsFromSuiObjects
already filtered its input, so the app-visible result is unchanged.
Fetches an object's Move contents as BCS and reshapes the response to the
SDK's JSON-RPC SuiObjectResponse type.
This method performs gRPC network I/O through getObject({ content: true }).
The returned BCS payload is base64 in data.bcs.bcsBytes; it is not a
decoded JavaScript value. gRPC errors are wrapped in an Error whose
message starts with an error occured fetching object:.
The object ID to read.
A JSON-RPC-shaped response containing the object's identity, owner, Move type, version, and base64 BCS bytes.
Fetches one object with caller-selected gRPC include flags.
This method performs gRPC network I/O through getObject. When include
is omitted, it requests the JSON view and no Display output. Include flags
that a caster reads must be present in the request; missing JSON or Display
data is returned as undefined by gRPC rather than synthesized locally.
Fullnode failures are wrapped in an Error with the same
an error occured fetching object: prefix as fetchObject.
The object ID and optional gRPC include flags.
The object view returned by gRPC.
Fetches all objects of one Move type owned by an address.
This method performs paginated gRPC network I/O through
listOwnedObjects. It is the typed wrapper around fetchOwnedObjects and
uses the fixed object-type filter supplied in objectType. The helper
always requests the JSON view and sets the display flag from
withDisplay; the include field is accepted for compatibility but is
not used to replace those caster flags.
The owner address, exact Move object type, optional display
request, and compatibility include value. withDisplay controls whether
gRPC returns Display output.
All matching object views across every page.
Fetches every object owned by an address, optionally filtered by Move type.
The method performs paginated gRPC network I/O. Each request uses a limit
of 50 objects and follows the returned cursor while hasNextPage is true.
An empty page, a false hasNextPage, or a missing cursor ends pagination.
The helper requests json: true and requests display only when
withDisplay is true; the optional include value is not used to
override these flags.
The owner address, optional exact Move type filter, display flag, and compatibility include value.
All object views returned by the fullnode in page order.
Adds a 0x2::transfer::public_share_object Move call to a transaction.
This is a local transaction builder and performs no network I/O. It mutates
tx; the caller must sign and execute the transaction. objectType is
passed as the call's single Move type argument.
The transaction, object argument, and fully qualified Move type of the object.
The transaction argument returned by moveCall.
Fetches, paginates, casts, and builds transactions around Sui objects.
Object reads use the configured
SuiGrpcClientand therefore perform network I/O unless a method is explicitly described as a local transaction builder. gRPC object views expose JSON underjson; requestwithDisplaywhen a caster reads the object's Display output. The helper keeps the SDK's JSON-RPC-shaped return types where the public API requires them and documents the conversions on those methods.