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

    Converts staking object and event responses into the SDK's normalized types.

    These static methods perform local parsing only. They accept the transport shapes used by the Sui object and event clients, convert decimal integer strings to bigint, normalize addresses, and convert 18-decimal validator fees to decimal ratios. They do not perform network I/O.

    Index
    • Casts an on-chain StakedEvent to the normalized StakedEvent type.

      Decimal amount and epoch strings become bigint, the validator fee's 18-decimal fixed-point value becomes a decimal ratio, and a nullable on-chain referrer becomes an omitted value when it is null.

      Parameters

      Returns StakedEvent

      The normalized staking event, including timestamp and transaction digest.

      When a required address or numeric event field cannot be parsed.

    • Casts a stakedSui vault state object response to its normalized shape.

      The caster accepts both bare gRPC JSON fields and JSON-RPC-style nested { type, fields } structs. It returns raw balances and epochs as bigint and preserves atomic-unstake fees as 18-decimal fixed-point bigints.

      Parameters

      • data: SuiObjectView

        Sui object response containing StakedSuiVaultStateV1 fields.

      Returns StakedSuiVaultStateObject

      The normalized StakedSuiVaultStateObject.

      When a required nested field is missing or a numeric field cannot be converted to bigint.

    • Casts a completed on-chain unstake event to UnstakedEvent.

      The afSUI and SUI amounts and epoch become bigint; address fields are normalized; timestampMs becomes the event timestamp number.

      Parameters

      Returns UnstakedEvent

      The normalized completed-unstake event.

      When a required address or numeric event field cannot be parsed.

    • Casts a validator operation-cap object response to its normalized shape.

      The caster reads authorizer_validator_address from the Move fields and expands it to the SDK's normalized Sui address format.

      Parameters

      • data: SuiObjectView

        Sui object response containing validator operation-cap fields.

      Returns ValidatorOperationCapObject

      The normalized ValidatorOperationCapObject.

      Errors from object-field or address parsing when the response shape is incomplete or malformed.