Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ostium.com/llms.txt

Use this file to discover all available pages before exploring further.

createDelegatedAndGasless() is the most operationally advanced mode.
  • the trader EOA owns USDC and positions
  • a delegate EOA signs the delegated action
  • the delegate’s Safe submits it as a sponsored user operation

When to use it

  • backend-driven products that want custody separation and gasless submission
  • high-volume builder integrations
  • systems that already operate a Safe or Pimlico flow

One-time trader setup

The trader must approve USDC and register the delegate Safe, not the delegate EOA:
await traderClient.approveUsdc('max');
await traderClient.setDelegate('0xDelegateSafeAddress');
You can get that Safe address from client.getSmartAccountAddress().

Submit-capable client

const client = await OstiumClient.createDelegatedAndGasless({
  delegatePrivateKey: process.env.DELEGATE_PRIVATE_KEY as `0x${string}`,
  traderAddress: '0xTraderAddress',
  pimlicoUrl: 'https://builder.ostium.io/v1/pimlico/sponsor?chainId=42161',
});

Build-only client

const client = await OstiumClient.createDelegatedAndGasless({
  traderAddress: '0xTraderAddress',
  delegateAddress: '0xDelegateAddress',
  safeAddress: '0xDelegateSafeAddress',
});
In build-only mode, get*Tx() returns a Safe-style request whose call data is already wrapped for delegated execution.