User Interactions

Methods for users to interact with vaults.

Register (Commit)

The register method handles allowance checks automatically.

// 1. Simulate to check status
const action = await sdk.register({ vaultAddress: '0x...' });

if (action.simulation.needsApproval) {
  console.log("Approval needed! SDK will handle this.");
}

// 2. Execute (Auto-Approve + Stake)
await action.execute({
  onApproving: () => console.log('Approving...'),
  onSubmitting: () => console.log('Registering...'),
  onSubmitted: (hash) => console.log('Tx Hash:', hash)
});

Claim Rewards

After settlement, users can claim their payout.

Last updated