• Smart-contract operations exposed under demos.run.contracts.

    IMPORTANT — these do NOT go through the shared fee-cap runner. Unlike the other demos.run.* namespaces, contract deploy/call are RPC-native: they execute directly over demos.rpcCall and return the contract's own result types (ContractInstance, ContractCallResult, gas bigint), never a ProgrammaticTxResult. There is no separate confirm → broadcast stage here, so ProgrammaticTxOptions (maxFee, confirm, wait) do not apply.

    NOTE: like ipfs.* and d402.pay, the smart-contract path is not enabled on production nodes yet — these methods are wired and typed but cannot be exercised end-to-end until the network turns the feature on.

    The namespace is a thin, uniform surface over DemosContracts; instantiate-free access for callers who want everything under demos.run.*.

    Parameters

    Returns {
        at: (<T>(address: string, abi?: ContractABI) => Promise<ContractInstance<T>>);
        batch: (() => BatchBuilder);
        call: (<T>(contractAddress: string, method: string, args?: unknown[], options?: ContractCallOptions) => Promise<ContractCallResult<T>>);
        deploy: ((source: string, constructorArgs?: unknown[], options?: ContractDeployOptions) => Promise<ContractInstance<any>>);
        deployTemplate: ((templateName: string, params?: Record<string, unknown>) => Promise<ContractInstance<any>>);
        estimateGas: ((contractAddress: string, method: string, args?: unknown[]) => Promise<bigint>);
        getAvailableTemplates: (() => string[]);
    }

    • at: (<T>(address: string, abi?: ContractABI) => Promise<ContractInstance<T>>)

      Get a handle to an already-deployed contract. Read-only; no tx.

        • <T>(address, abi?): Promise<ContractInstance<T>>
        • Type Parameters

          • T = unknown

          Parameters

          • address: string

            The contract address.

          • Optionalabi: ContractABI

            Optional ABI to type the instance.

          Returns Promise<ContractInstance<T>>

    • batch: (() => BatchBuilder)

      Start a batch of deploy/call operations (see DemosContracts.batch).

        • (): BatchBuilder
        • Returns BatchBuilder

    • call: (<T>(contractAddress: string, method: string, args?: unknown[], options?: ContractCallOptions) => Promise<ContractCallResult<T>>)

      Call a method on an existing contract by address.

      RPC-native (not fee-capped). Returns the raw ContractCallResult, not a ProgrammaticTxResult.

        • <T>(contractAddress, method, args?, options?): Promise<ContractCallResult<T>>
        • Type Parameters

          • T = unknown

          Parameters

          • contractAddress: string

            Target contract address.

          • method: string

            Method name to invoke.

          • Optionalargs: unknown[]

            Method arguments (default []).

          • Optionaloptions: ContractCallOptions

            Call options (gas, etc.).

          Returns Promise<ContractCallResult<T>>

    • deploy: ((source: string, constructorArgs?: unknown[], options?: ContractDeployOptions) => Promise<ContractInstance<any>>)

      Deploy a smart contract from source. Requires a connected wallet.

      RPC-native (not fee-capped). Returns the deployed ContractInstance, not a ProgrammaticTxResult.

      const c = await demos.run.contracts.deploy(source, [arg1, arg2])
      await demos.run.contracts.call(c.address, "transfer", [to, 100])
        • (source, constructorArgs?, options?): Promise<ContractInstance<any>>
        • Parameters

          • source: string

            Contract source code.

          • OptionalconstructorArgs: unknown[]

            Constructor arguments (default []).

          • Optionaloptions: ContractDeployOptions

            Deploy options (gas, etc.).

          Returns Promise<ContractInstance<any>>

    • deployTemplate: ((templateName: string, params?: Record<string, unknown>) => Promise<ContractInstance<any>>)

      Deploy a contract from a named template.

        • (templateName, params?): Promise<ContractInstance<any>>
        • Parameters

          • templateName: string

            Registered template name.

          • Optionalparams: Record<string, unknown>

            Template parameters.

          Returns Promise<ContractInstance<any>>

    • estimateGas: ((contractAddress: string, method: string, args?: unknown[]) => Promise<bigint>)

      Estimate gas for a contract call. Read-only; no tx.

        • (contractAddress, method, args?): Promise<bigint>
        • Parameters

          • contractAddress: string

            Target contract address.

          • method: string

            Method name.

          • Optionalargs: unknown[]

            Method arguments (default []).

          Returns Promise<bigint>

    • getAvailableTemplates: (() => string[])

      List the available contract template names.

        • (): string[]
        • Returns string[]