import "valibot"; import "near-api-js/lib/utils/serialize"; //#region src/intents/expirable-nonce.d.ts type Salt = Uint8Array; declare class ExpirableNonce { deadline: bigint; nonce: Uint8Array; constructor(deadline: bigint, nonce: Uint8Array); } declare class SaltedNonce { salt: Salt; inner: ExpirableNonce; constructor(salt: Salt, inner: ExpirableNonce); } /** * VersionedNonce class representing a versioned expirable nonce * * @property version The version of the nonce * @property value The current value of nonce, it is unknown to allow for future version types */ declare class VersionedNonce { version: number; value: unknown; constructor(version: number, value: unknown); static latest(saltedNonce: SaltedNonce): VersionedNonce; } declare namespace VersionedNonceBuilder { /** * Creates nonce bytes with embedded start timestamp. * Layout: [startTime: 8 bytes LE nanoseconds] [random: 7 bytes] * * @param startTime The start time to embed in the nonce * @returns 15-byte Uint8Array with timestamp and random data */ function createTimestampedNonceBytes(startTime: Date): Uint8Array; /** * Encodes a versioned expirable nonce with the given salt and deadline * * @param salt The salt to use for the nonce * @param deadline The expiration deadline for the nonce * @param randomBytes Optional random bytes to use. If not provided, random bytes will be generated. * @returns The encoded nonce as a base64 string */ function encodeNonce(salt: Salt, deadline: Date, randomBytes?: Uint8Array): string; /** * Decodes a versioned expirable nonce from a base64-encoded string * * @param encoded The encoded nonce string * @returns The decoded VersionedNonce object */ function decodeNonce(encoded: string): VersionedNonce; } //#endregion export { Salt, VersionedNonceBuilder };