npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ahumblebuilder/vincent-ability-options

v0.0.1

Published

A Vincent ability for options contract operations (writeOption and redeem)

Readme

Vincent Options Ability

A Vincent/Lit Protocol ability for options contract operations including writeOption and redeem functions.

Overview

This package provides a Vincent ability that allows users to interact with options contracts by writing options and redeeming them after expiry. The ability supports both operations with comprehensive validation and error handling.

Features

  • Write Options: Create new options with deposit tokens and receive premium
  • Redeem Options: Redeem options after expiry to receive pro-rata share of vault balances
  • Validation: Comprehensive parameter validation for all operations
  • Policy Support: Integrates with Vincent policies for access control
  • Type Safety: Full TypeScript support with Zod schema validation

Installation

npm install @ahumblebuilder/vincent-ability-options

Usage

Basic Usage

import { vincentAbility } from '@ahumblebuilder/vincent-ability-options';

// The ability is ready to be used with Vincent

Ability Parameters

The ability accepts two types of operations:

WriteOption Parameters

interface WriteOptionParams {
  action: 'writeOption';
  contractAddress: string;     // Options contract address
  depositToken: string;         // Token to deposit (e.g., WETH)
  amount: string;              // Amount to deposit
  strike: string;              // Strike price
  expiry: number;              // Expiry timestamp
  premiumPerUnit: string;      // Premium per unit
  minDeposit: string;         // Minimum deposit amount
  maxDeposit: string;         // Maximum deposit amount
  validUntil: number;         // Signature validity timestamp
  signature: string;          // Signature for the terms
  rpcUrl?: string;           // Optional RPC URL
}

Redeem Parameters

interface RedeemParams {
  action: 'redeem';
  contractAddress: string;     // Options contract address
  rpcUrl?: string;           // Optional RPC URL
}

Example Usage

Writing an Option

const writeOptionParams = {
  action: 'writeOption' as const,
  contractAddress: '0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6',
  depositToken: '0xA0b86a33E6441b8C4C8C0C8C0C8C0C8C0C8C0C8C', // WETH
  amount: '1.0', // 1 WETH
  strike: '2000', // $2000 strike
  expiry: 1735689600, // Jan 1, 2025
  premiumPerUnit: '0.05', // 5% premium
  minDeposit: '0.1',
  maxDeposit: '10.0',
  validUntil: 1733097600, // Dec 1, 2024
  signature: '0x1234...', // Valid signature
};

Redeeming Options

const redeemParams = {
  action: 'redeem' as const,
  contractAddress: '0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6',
};

Contract Integration

This ability calls the following contract methods:

writeOption

function writeOption(
    address _depositToken,
    uint256 amount,
    uint256 _strike,
    uint256 _expiry,
    uint256 premiumPerUnit,
    uint256 minDeposit,
    uint256 maxDeposit,
    uint256 validUntil,
    bytes calldata signature
) external;

redeem

function redeem() external;

Vincent Integration

This ability integrates with the Vincent ecosystem:

  • Policies: Supports Vincent policies for access control
  • Delegation: Works with PKP (Programmable Key Pairs) delegation
  • Validation: Comprehensive pre-execution validation
  • Events: Emits contract events for writeOption and redeem operations

Error Handling

The ability includes comprehensive error handling for:

  • Invalid contract addresses
  • Invalid deposit tokens
  • Invalid amounts and limits
  • Invalid strike prices and expiry times
  • Invalid signatures
  • Expired options
  • Insufficient balances

Development

Building

npm run build

Publishing

npm publish

License

MIT

Support

For issues and questions, please open an issue on the GitHub repository.