near-api-js - v7.5.3
    Preparing search index...

    Class DeterministicStateInit

    A canonical, versioned NEP-616 deterministic account state initialization.

    Implements

    Index
    V1: {
        code: GlobalContractIdentifier;
        data: Map<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
    }
    • Derives the NEP-616 account ID from the current canonical initialization.

      Returns string

      0s followed by the last 20 bytes of Keccak-256 as lowercase hexadecimal. Does not create or query an account; changing the encoded state changes the derived ID.

    • Serializes the current state init, including the V1 enum tag and bytewise-sorted storage.

      Returns Uint8Array

      Canonical Borsh bytes, with storage re-sorted on every call even if V1.data was mutated.

      If the current storage contains duplicate byte keys or cannot be serialized.

    • Decodes Borsh bytes into a real class instance, canonicalizing storage order.

      Parameters

      • bytes: Uint8Array

        Versioned deterministic state-init encoding.

      Returns DeterministicStateInit

      A state-init instance whose encoding uses bytewise-sorted storage.

      If decoding or construction fails. Does not verify on-chain code availability.