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

    A typed builder for the canonical raw state-init bytes used by protocol-88 universal accounts.

    Implements

    • UniversalStateInitSchema
    Index
    V1: {
        accessKeys: PublicKeyHandle[];
        code: GlobalContractIdentifier | null;
        data: Map<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
    }
    • Derives a universal account ID from the current canonical initialization.

      Returns string

      0u followed by the lowercase Crockford Base32 encoding of the SHA3-256 digest. Does not create an account or check whether it exists.

    • Encodes the current initialization for use in a universal state-init action.

      Returns Uint8Array

      Canonical Borsh bytes. Storage and access-key handles are re-sorted on every call.

      If storage keys contain duplicate byte sequences or serialization fails.

    • Decodes canonical V1 bytes into a real class instance.

      Parameters

      • bytes: Uint8Array

        Canonical versioned universal state-init bytes.

      Returns UniversalStateInit

      A state-init instance with the decoded storage and access-key handles.

      If decoding fails or re-encoding differs, including noncanonical ordering or trailing bytes.