EscroFi Documentation
Getting Started
EscroFi is a smart-contract-based payment solution for freelancers and clients. This documentation will guide you through setup and usage of the platform.
Installation
Install the EscroFi SDK using npm or yarn:
npm install @escrofi/sdk
yarn add @escrofi/sdk
Configuration
Create a configuration file with your network settings:
{ "networks": { "ethereum": { "rpc_url": "https://mainnet.infura.io/v3/YOUR-PROJECT-ID", "chain_id": 1 }, "polygon": { "rpc_url": "https://polygon-rpc.com", "chain_id": 137 } } }
Protocol Agent
The ProtocolAwareAgent is the core component for managing cross-chain operations:
import { ProtocolAwareAgent } from '@escrofi/sdk'; const agent = new ProtocolAwareAgent({ agent_id: 'my-agent', config: config });
Developer Resources
- JavaScript SDK: Integrate EscroFi features into your web applications.
- Smart Contract Templates: Ready-to-use templates for freelance and escrow scenarios.
- GitHub Repository: github.com/escrofi
import { EscroFi } from '@escrofi/sdk';
const escrofi = new EscroFi({ apiKey: 'YOUR_API_KEY' });
// Create a new contract
const contract = await escrofi.createContract({
client: '0xClientAddress',
freelancer: '0xFreelancerAddress',
milestones: [
{ title: 'Design', amount: 500 },
{ title: 'Development', amount: 1000 },
],
});