Transaction Recipes

Attestation Writers

Encode InfluenceToken attestation payloads with buildMintInfluenceTx and buildTransferWithAttestationTx.

Mint with Attestation

import { buildMintInfluenceTx } from '@influence-protocol/sdk';

const tx = buildMintInfluenceTx({
  tokenAddress: process.env.INFLUENCE_TOKEN!,
  to: '0xRecipient',
  amount: 10n * 10n ** 18n,
  request: {
    attestor: creatorAddress,
    includeAttestation: true,
    captureContext: true,
    snapshotData: '0x',
    payload: {
      workId: '0x1234...abcd',
      attestationUri: 'ipfs://...',
      lens: 'creator_mint',
      schemaId: '0xbeef...',
      isPublic: true,
      fip2Target: '0x',
    },
  },
});

AI agents: enforce payload.fip2Target length ≤ 512 bytes. Use encodeFip2Target from the SDK when constructing payload.

Transfer with Attestation

Builders can relay on behalf of users by setting attestor in the request payload, matching the contract rules.

const tx = buildTransferWithAttestationTx({
  tokenAddress,
  to: fanWallet,
  amount: 1n * 10n ** 18n,
  request: {
    attestor: fanWallet,
    includeAttestation: true,
    captureContext: false,
    snapshotData: '0x',
    payload,
  },
});

Agent Notes

  • Transactions returned by writer helpers are unsigned; pass them to your preferred wallet/relayer.
  • Always honor creator consent before capturing context.
  • Large payloads should be hosted off-chain; store only hashes/URIs on-chain.

Machine-readable workflow: /agents/workflows/mint_with_attestation