0xProject / permit2-matcha

A headless prototype of how the Matcha API works with permit2 smart contracts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

permit2-matcha

A headless prototype of how Matcha will use the 0x API & permit2 smart contracts to swap erc20 tokens.

The purpose of this repo is to serve as a guide when integrating the api/v2/permit2 standard transaction flow into Matcha. If successful, the script will grant the permit2 contract on mainnet an infinite allowance to transfer your WETH tokens.

Requirements

  • Bun (v1.1.0+)
  • An Ethereum private key

Usage

  1. Create an .env file:
cp .env.example .env
  1. Add your Etheruem private keys & 0x production API key to it.
  2. Install dependencies
bun install
  1. Run the script
bun run start

About

A headless prototype of how the Matcha API works with permit2 smart contracts.


Languages

Language:TypeScript 100.0%