1.0.0 • Published 5 months ago
intents-framework v1.0.0
@bootnode/intents-framework
A reference implementation of ERC-7683: Intent-Based Token Transfers with TypeScript support.
Installation
npm install @bootnode/intents-framework
# or
yarn add @bootnode/intents-framework
Usage
Basic Usage
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.
Development
To build the package locally:
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
1.0.0
5 months ago