public function createSignedJsonRequest(
        string $method,
        string $uri,
        array $arrayToJsonify,
        SigningSecretKey $key,
        array $headers = []
    ): RequestInterface {
        if (empty($headers['Content-Type'])) {
            $headers['Content-Type'] = 'application/json';
        }
        /** @var string $body */
        $body = \json_encode($arrayToJsonify, JSON_PRETTY_PRINT);
        if (!\is_string($body)) {
            throw new InvalidMessageException('Cannot JSON-encode this message.');
        }
        return $this->createSignedRequest(
            $method,
            $uri,
            $body,
            $key,
            $headers
        );
    }
public function createSignedJsonRequest(
        string $method,
        string $uri,
        array $arrayToJsonify,
        SigningSecretKey $key,
        array $headers = []
    ): RequestInterface {
        if (empty($headers['Content-Type'])) {
            $headers['Content-Type'] = 'application/json';
        }
        /** @var string $body */
        $body = \json_encode($arrayToJsonify, JSON_PRETTY_PRINT);
        if (!\is_string($body)) {
            throw new InvalidMessageException('Cannot JSON-encode this message.');
        }
        return $this->createSignedRequest(
            $method,
            $uri,
            $body,
            $key,
            $headers
        );
    }
Creates a JSON-signed API request to be sent to an API.
Enforces hard-coded Ed25519 keys.

@param string $method
@param string $uri
@param array $arrayToJsonify
@param SigningSecretKey $key
@param array $headers
@return RequestInterface
@throws InvalidMessageException