Skip to content

Commit a858c1a

Browse files
Added a section to specify buffer return type (#1691)
1 parent 641f514 commit a858c1a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/content/chainlink-functions/api-reference/javascript-source.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,8 @@ The Functions library includes several encoding functions, which are useful for
5959
| `Functions.encodeInt256` | Integer | 32-byte `Buffer` | Converts an integer to a 32-byte `Buffer` for an `int256` in Solidity. |
6060
| `Functions.encodeString` | String | `Buffer` | Converts a string to a `Buffer` for a `string` type in Solidity. |
6161

62-
**Note**: Using these encoding functions is optional. The source code must return a `Buffer` that represents the on-chain bytes array.
62+
**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.
63+
64+
```javascript
65+
const myArr = new Uint8Array(ARRAY_LENGTH)
66+
```

0 commit comments

Comments
 (0)