Vana SDK - v4.1.0
    Preparing search index...

    Function openJobResult

    • Decrypts a job result and verifies its builder-visible protocol bindings.

      The builder private key is a Hex wallet key. For expect.version, undefined skips the check while null requires a null result version.

      Parameters

      • sealedBytes: Uint8Array

        Raw hybrid sealed-result bytes.

      • builderPrivateKey: `0x${string}`

        Builder's wallet private key as hex.

      • ecies: ECIESProvider

        Injected ECIES implementation.

      • expect: JobResultExpectation

        Required job ID and optional scope and version bindings.

      Returns Promise<JobResult>

      The validated result when every supplied binding matches.

      If plaintext is malformed, invalid, or a binding differs.

      If ciphertext decoding or ECIES decryption fails.

      const sealedBytes = new Uint8Array(await response.arrayBuffer());
      const result = await openJobResult(sealedBytes, key, ecies, {
      jobId,
      scope,
      });
      const text = new TextDecoder().decode(result.body);