Skip to content

Commit

Permalink
refactor: update parameter types in ManifestCoder methods for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
sarvalabs-harshrastogi committed Oct 24, 2024
1 parent 4f62349 commit d8c7cfb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions docs/source/manifest-call-encoder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,14 @@ Methods
.. code-block:: javascript
// Example
const args = ["MOI", 100_000_000];
const calldata = manifestCoder.encodeArguments("Seeder", args);
const calldata = manifestCoder.encodeArguments("Seeder", "MOI", 100_000_000);
console.log(calldata)
>> "0x0d6f0665...d4f49"
.. autofunction:: decodeArguments

.. autofunction:: decodeOutput

.. code-block:: javascript
Expand Down
4 changes: 2 additions & 2 deletions packages/js-moi-manifest/lib.cjs/manifest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/js-moi-manifest/lib.esm/manifest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/js-moi-manifest/src.ts/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export class ManifestCoder {
* is generated by parsing and encoding the arguments based on the dynamically
* created schema from fields.
*
* @param {(LogicManifest.TypeField[] | string)} fields - The fields associated with the routine parameters (arguments) or the name of the routine.
* @param {(LogicManifest.Routine | string)} routine - The routine object or name of it
* @param {any[]} args - The arguments to encode.
* @returns {string} The POLO-encoded calldata as a hexadecimal string prefixed with "0x".
*/
Expand Down Expand Up @@ -329,7 +329,7 @@ export class ManifestCoder {
* The output data is decoded using the provided fields and schema.
* Returns the decoded output data as an unknown type, or null if the output is empty.
*
* @param {string} routineOrCallsite - The name of the routine associated with the output data.
* @param {string} routineOrCallsite - The routine or callsite associated with the output data.
* @param {string} output - The output data to decode, represented as a hexadecimal string prefixed with "0x".
* @returns {T | null} The decoded output data, or null if the output is empty.
*/
Expand Down

0 comments on commit d8c7cfb

Please sign in to comment.