docs(js-sdk): complete encryptInput reference — positional signature + supported types (NOXFB-13) - #78
Open
edenbd1 wants to merge 3 commits into
Open
docs(js-sdk): complete encryptInput reference — positional signature + supported types (NOXFB-13)#78edenbd1 wants to merge 3 commits into
edenbd1 wants to merge 3 commits into
Conversation
…ed types) Document the full encryptInput signature and remove the ambiguity that blocked hackathon builders: - Add a Signature section and a prominent callout that the three arguments (value, solidityType, applicationContract) are positional, not an options object. - List the five supported solidityType values (bool, uint16, uint256, int16, int256) in a table, and add a danger callout enumerating unsupported types (address, bytes32, uint8/32/64/128, string, ...) that throw before any network call, with the reason (Nox Runner allow-list). - Document the SolidityType export and how to type variables with it. - Document the handleProof return type as a 137-byte (0x + 274 hex) string. - Replace examples that used unsupported types (address, uint64, string) with supported ones so no official snippet uses an invalid type. - Add a complete encrypt -> decrypt example to the JS SDK getting-started.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Doc-only update to the Nox JS SDK documentation to make handleClient.encryptInput usage unambiguous (positional args) and to document the runtime allow-list of supported solidityType values so developers can pick valid types without reading the SDK source.
Changes:
- Added an explicit
encryptInputsignature section and a callout clarifying the 3 positional arguments (and showing ✅/❌ examples). - Documented the 5 supported
solidityTypevalues and clarified that other types fail fast with aTypeErrorbefore any network call. - Added a complete “encrypt → decrypt” snippet to Getting Started that uses positional args and destructured return values.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/references/js-sdk/methods/encryptInput.md | Adds signature + positional-args warning; documents supported/unsupported solidityType values and handleProof shape. |
| src/references/js-sdk/getting-started.md | Adds an end-to-end encrypt→decrypt example using the correct positional call and destructuring. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+16
to
+20
| encryptInput( | ||
| value: boolean | bigint, | ||
| solidityType: SolidityType, | ||
| applicationContract: string // 0x-prefixed Ethereum address | ||
| ): Promise<{ handle: Handle<T>; handleProof: `0x${string}` }>; |
Comment on lines
+169
to
+170
| Passing one throws synchronously: | ||
|
|
| and helpers instead of hard-coding string literals: | ||
|
|
||
| ```ts twoslash | ||
| import { type SolidityType } from '@iexec-nox/handle'; |
Comment on lines
+16
to
+20
| encryptInput( | ||
| value: boolean | bigint, | ||
| solidityType: SolidityType, | ||
| applicationContract: string // 0x-prefixed Ethereum address | ||
| ): Promise<{ handle: Handle<T>; handleProof: `0x${string}` }>; |
Comment on lines
+169
to
+170
| Passing one throws synchronously: | ||
|
|
| and helpers instead of hard-coding string literals: | ||
|
|
||
| ```ts twoslash | ||
| import { type SolidityType } from '@iexec-nox/handle'; |
Resolves conflict in encryptInput.md: keeps both the fromExternal cross-link (this branch) and the concurrent encryption section added by #88 on main, back to back.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOXFB-13 —
encryptInput: référence complète manquante (signature + typessolidityType)Strongest signal of the Vibe Coding Challenge 2026 hackathon batch (7+ teams hit the signature, ~50% hit the types). Doc-only.
All facts verified against the SDK source (
@iexec-nox/handle@0.1.0-beta.11,src/methods/encryptInput.ts).Changes
references/js-sdk/methods/encryptInput.md(value, solidityType, applicationContract)are positional, not an options object (✅/❌ examples).solidityType(bool, uint16, uint256, int16, int256) in a table.address, bytes32, uint8/32/64/128, string, …) that throw aTypeErrorbefore any network call, with the real error message and the reason (the Nox Runner allow-list — not the SDK).SolidityTypetype and how to type variables with it.handleProofreturn type as a 137-byte (0x+ 274 hex) string.address,uint64,string) — no official snippet uses an invalid type anymore.references/js-sdk/getting-started.mdAcceptance criteria
{ handle, handleProof }documented (handleProof = 137-byte0xHexString)import { SolidityType } from '@iexec-nox/handle'documentedValidation
prettier --check✅ · fullvitepress build(type-checks everytwoslashblock) ✅Refs: NOXFB-13 · absorbs NOXFB-24 · related NOXFB-22 / NOXFB-23