From 74c49f875a0829dd90e96f94e4e85229955a82a8 Mon Sep 17 00:00:00 2001 From: Maxwell Melcher Date: Mon, 11 Dec 2023 15:07:15 -0600 Subject: [PATCH] Added a section to specify buffer return type --- .../chainlink-functions/api-reference/javascript-source.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/content/chainlink-functions/api-reference/javascript-source.mdx b/src/content/chainlink-functions/api-reference/javascript-source.mdx index 67309246419..40adaea0be7 100644 --- a/src/content/chainlink-functions/api-reference/javascript-source.mdx +++ b/src/content/chainlink-functions/api-reference/javascript-source.mdx @@ -59,4 +59,8 @@ The Functions library includes several encoding functions, which are useful for | `Functions.encodeInt256` | Integer | 32-byte `Buffer` | Converts an integer to a 32-byte `Buffer` for an `int256` in Solidity. | | `Functions.encodeString` | String | `Buffer` | Converts a string to a `Buffer` for a `string` type in Solidity. | -**Note**: Using these encoding functions is optional. The source code must return a `Buffer` that represents the on-chain bytes array. +**Note**: Using these encoding functions is optional. The source code must return a [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) which represents the `bytes` that are returned on-chain. + +```javascript +const myArr = new Uint8Array(ARRAY_LENGTH) +```