Skip to main content
Save shared calculation logic as a Function and reuse it by its full Function ID. The caller passes arguments, waits for the result, and continues computing.

Call an existing Function

First follow Create a Function to save demo.usdc_amount. Create usdc_value in the same Space with this code:
No parameters are needed. Save and click Run to return:
usdc_value calls an existing Function and returns the amount and token symbol
The first argument to function.call() is the Function ID. The remaining arguments are passed by position, and the return value is the called Function’s result.

Pass multiple arguments

For an entry point def _(address, block_id), pass the address and block ID in that order. Do not wrap them in one list unless the called function itself accepts a single list argument. Use the full ID for calls across Spaces and ensure the current account has the required access. Calls use the Function’s saved code, so save edits first.