UNPKG

intents-framework

Version:

A reference ERC7683 implementation with TypeScript support

78 lines (57 loc) 1.79 kB
# @bootnode/intents-framework A reference implementation of [ERC-7683: Intent-Based Token Transfers](https://eips.ethereum.org/EIPS/eip-7683) with TypeScript support. ## Installation ```bash npm install @bootnode/intents-framework # or yarn add @bootnode/intents-framework ``` ## Usage ### Basic Usage ```typescript import { ethers } from 'ethers'; import { Hyperlane7683__factory, Base7683__factory, BasicSwap7683__factory, Hyperlane7683ABI, Base7683ABI, BasicSwap7683ABI } from '@bootnode/intents-framework'; // Connect to your provider const provider = new ethers.providers.JsonRpcProvider('YOUR_RPC_URL'); const signer = new ethers.Wallet('YOUR_PRIVATE_KEY', provider); // Deploy a new Hyperlane7683 contract const hyperlane7683Factory = new Hyperlane7683__factory(signer); const hyperlane7683 = await hyperlane7683Factory.deploy( 'MAILBOX_ADDRESS', 'IGP_ADDRESS', 'ISM_ADDRESS' ); // Deploy a new Base7683 contract const base7683Factory = new Base7683__factory(signer); const base7683 = await base7683Factory.deploy(); // Deploy a new BasicSwap7683 contract const basicSwap7683Factory = new BasicSwap7683__factory(signer); const basicSwap7683 = await basicSwap7683Factory.deploy(); // Or connect to existing contracts const existingHyperlane7683 = new ethers.Contract( 'CONTRACT_ADDRESS', Hyperlane7683ABI, signer ); ``` ### Advanced Usage For more advanced usage and examples, please refer to the [GitHub repository](https://github.com/bootnode/intents-framework). ## Development To build the package locally: ```bash git clone https://github.com/bootnode/intents-framework.git cd intents-framework/solidity npm install npm run build ``` ## Contributing Contributions are welcome! Please feel free to submit a Pull Request. ## License MIT