aftermath-ts-sdk - v3.3.3
    Preparing search index...

    Reads and paginates Sui dynamic fields through the configured gRPC client.

    Methods that list fields perform network I/O through AftermathApi.client.listDynamicFields. Casting methods also call the caller-provided object loader for the field object IDs. Cursors are Sui object IDs and null means that the server returned the last page.

    Index
    • Fetches every page of dynamic fields for a parent object and returns the fields that match the optional type filter.

      This method performs gRPC network I/O until it receives an empty page or a null cursor. It uses limitStepSize for every request and defaults to 256 fields per request. The result does not include a cursor because this method consumes the complete listing. When a type filter removes every field from a page, the implementation treats that filtered page as empty and stops even if the service returned another cursor.

      Parameters

      • inputs: {
            dynamicFieldType?: string | ((objectType: string) => boolean);
            limitStepSize?: number;
            parentObjectId: string;
        }

        The parent object, optional type filter, and page size.

      Returns Promise<DynamicFieldInfo[]>

      All matching DynamicFieldInfo values in page order.

      Errors from AftermathApi.client.listDynamicFields.

    • Fetches every matching dynamic field and loads all field objects in one call to objectsFromObjectIds.

      The field listing performs gRPC network I/O. The loader receives the full list of IDs after pagination, so it can issue one batch request or apply a custom local mapping. limitStepSize controls each list request and defaults to 256 fields. It inherits the filtered-page stop behavior of fetchAllDynamicFieldsOfType.

      Type Parameters

      • ObjectType

      Parameters

      • inputs: {
            dynamicFieldType?: string | ((objectType: string) => boolean);
            limitStepSize?: number;
            objectsFromObjectIds: (
                objectIds: string[],
            ) => ObjectType[] | Promise<ObjectType[]>;
            parentObjectId: string;
        }

        The parent object, object loader, optional type filter, and page size. The loader may return its result synchronously or as a promise.

      Returns Promise<ObjectType[]>

      The loaded objects in the order returned by the object loader.

      Errors from the gRPC client or objectsFromObjectIds.

    • Lists one page of dynamic fields, filters the page, and loads the matching field objects with the caller-provided caster or loader.

      The method performs gRPC network I/O for the field list and whatever I/O objectsFromObjectIds performs. Filtering happens after the gRPC page is fetched, so nextCursor advances past fields that do not match dynamicFieldType. The returned dynamicFieldObjects contains only the objects loaded from the matching field IDs in that page.

      Type Parameters

      • ObjectType

      Parameters

      • inputs: {
            cursor?: string;
            dynamicFieldType?: string | ((objectType: string) => boolean);
            limit?: number;
            objectsFromObjectIds: (objectIds: string[]) => Promise<ObjectType[]>;
            parentObjectId: string;
        }

        The parent object, page options, optional type filter, and object loader. limit is a number of fields, not a byte size.

      Returns Promise<DynamicFieldObjectsWithCursor<ObjectType>>

      The loaded objects and the cursor for the next page. nextCursor is null when the gRPC service has no next page.

      Errors from the gRPC client or objectsFromObjectIds.

    • Fetches the object stored in one dynamic object field.

      This method performs gRPC network I/O through client.core.getDynamicObjectField and requests both the JSON and display views required by object casters. The name.bcs value must contain the field name's BCS bytes. JSON-RPC callers cannot pass the parsed { type, value } form here.

      Parameters

      • inputs: { name: DynamicFieldName; parentId: string }

        The parent object ID and the Move-typed dynamic-field name.

        • name: DynamicFieldName

          ⚠️ gRPC's DynamicFieldName requires the name's BCS bytes ({ type, bcs }) where JSON-RPC's took its parsed JSON value ({ type, value }). The SDK does not carry Move type layouts, so it cannot convert one to the other — callers must supply the bytes. Both listDynamicFields and GrpcCasting.dynamicFieldInfoFromGrpcEntry expose them (as bcsName, base64).

        • parentId: string

      Returns Promise<SuiObjectView>

      The gRPC object view for the dynamic field value.

      Errors from the gRPC client, including a missing field object.

      Ported to client.core.getDynamicObjectField.

      ⚠️ Not gRPC's getDynamicField, which is the obvious-looking target and the wrong one: it returns the field's value as { type, bcs } only — no json view and no objectId — so it cannot feed an object caster. getDynamicObjectField returns { object } in the same shape as getObject, which can. (It lives on client.core, not on the client root, which is why an earlier pass recorded it as unavailable.)

      The return type changes from SuiObjectResponse to SuiObjectView, in step with every other object fetcher here. This helper has zero internal callers, so nothing inside the SDK is affected.

    • Lists one page of dynamic fields from the configured gRPC client.

      The method performs network I/O through listDynamicFields and reshapes each gRPC entry into the SDK's DynamicFieldInfo shape. The returned field name contains the original BCS bytes as base64 in name.value and bcsName; the SDK does not decode the Move field name. A type string is an exact comparison, while a predicate receives each field's objectType.

      Parameters

      • inputs: {
            dynamicFieldType?: string | ((objectType: string) => boolean);
            parentObjectId: string;
        } & DynamicFieldsInputs

        The parent object, optional cursor, page limit, and type filter. limit is a number of fields. cursor is the last field object ID from the previous page.

      Returns Promise<DynamicFieldsWithCursor>

      A page of DynamicFieldInfo values and a nullable next cursor.

      Errors from AftermathApi.client.listDynamicFields.

    • Repeatedly fetches dynamic-field objects until a caller-defined condition is met or the source is exhausted.

      This helper does not call a network client directly. fetchFunc decides whether each page comes from gRPC, JSON-RPC, or another source. Pages use limitStepSize, which defaults to 256. The method stops on an empty page, a null cursor, or the first page for which isComplete returns true. When the predicate stops the loop, the returned cursor still points to the first unprocessed page.

      Type Parameters

      • ObjectType

      Parameters

      • inputs: {
            cursor?: string;
            fetchFunc: (
                dynamicFieldsInputs: DynamicFieldsInputs,
            ) => Promise<DynamicFieldObjectsWithCursor<ObjectType>>;
            isComplete: (dynamicFieldObjects: ObjectType[]) => boolean;
            limitStepSize?: number;
        }

        The page fetcher, completion predicate, optional starting cursor, and page size.

      Returns Promise<DynamicFieldObjectsWithCursor<ObjectType>>

      All objects fetched so far and the cursor returned with the page that ended the loop.

      Errors from fetchFunc or isComplete.