Socket
Socket
Sign inDemoInstall

alfetopito-permit-utils

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alfetopito-permit-utils

Collection of utils for handling token permits.


Version published
Weekly downloads
2
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

@cowprotocol/permit-utils

Collection of utils for handling token permits.

Installation

yarn add @cowprotocol/permit-utils

Usage

getTokenPermitInfo

import { getTokenPermitInfo } from "@cowprotocol/permit-utils"

const permitInfo = await getTokenPermitInfo({
  spender, tokenAddress, tokenName, chainId, provider
})

getPermitUtilsInstance

import { getPermitUtilsInstance } from "@cowprotocol/permit-utils"

// Using the a static account defined in the library
const staticEip2612PermitUtils = getPermitUtilsInstance(chainId, provider)

// Using a provided account address
const accountEip2612PermitUtils = getPermitUtilsInstance(chainId, provider, account)

generatePermitHook

import { generatePermitHook } from "@cowprotocol/permit-utils"

const hookData = await generatePermitHook({
  chainId,
  inputToken,
  spender,
  provider,
  permitInfo,
  eip2162Utils,
  account,
  nonce
})

checkIsCallDataAValidPermit

import { checkIsCallDataAValidPermit } from "@cowprotocol/permit-utils"

const isCallDataAValidPermit = await checkIsCallDataAValidPermit(
  account,
  chainId,
  eip2612Utils, 
  tokenAddress,
  tokenName,
  callData,
  permitInfo
)

Building

Run nx build permit-utils to build the library.

Running unit tests

Run nx test permit-utils to execute the unit tests via Jest.

FAQs

Package last updated on 25 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc