@sfpro/sdk

Host

Superfluid Host contract API reference

The Superfluid Host contract is the central registry and entry point for the Superfluid protocol. It manages protocol governance, app registration, and provides batch transaction capabilities.

Overview

The Host contract serves as:

  • Protocol registry for Super Tokens and agreements
  • Governance and configuration manager
  • Batch call executor for complex operations
  • App registration and callback system

Read Functions

getGovernance

Returns the current governance address.

import { useReadHost } from '@sfpro/sdk/hook/core';

const { data: governance } = useReadHost({
  address: '0x...',
  functionName: 'getGovernance',
});
import { hostAbi } from '@sfpro/sdk/abi/core';

const governance = await client.readContract({
  address: '0x...',
  abi: hostAbi,
  functionName: 'getGovernance',
});
import { readHost } from '@sfpro/sdk/action/core';

const governance = await readHost(client, {
  address: '0x...',
  functionName: 'getGovernance',
});

getSuperTokenFactory

Returns the Super Token factory address.

getAgreementClass

Returns the address of a registered agreement by type.

Write Functions

callAgreement

Executes an agreement operation through the host.

import { useWriteHost } from '@sfpro/sdk/hook/core';

const { writeContract } = useWriteHost();

await writeContract({
  address: '0x...',
  functionName: 'callAgreement',
  args: [agreementAddress, callData, userData],
});
import { hostAbi } from '@sfpro/sdk/abi/core';

const hash = await client.writeContract({
  address: '0x...',
  abi: hostAbi,
  functionName: 'callAgreement',
  args: [agreementAddress, callData, userData],
});
import { writeHost } from '@sfpro/sdk/action/core';

const hash = await writeHost(client, {
  address: '0x...',
  functionName: 'callAgreement',
  args: [agreementAddress, callData, userData],
});

batchCall

Executes multiple operations in a single transaction. See Batch Calls for detailed usage.

registerApp

Registers a Super App with the protocol.