👛USDFC SDK
Documentation for the USDFC SDK
The USDFC SDK is a comprehensive toolkit for developers to integrate and interact with the USDFC stablecoin protocol.
Overview
USDFC is a collateralized debt platform built on the Filecoin blockchain. Users can lock up FIL as collateral and issue USDFC stablecoin tokens. The USDFC SDK provides a programmatic interface to interact with the protocol, allowing developers to build applications that leverage USDFC functionality.
How It Works
The USDFC SDK is built on top of ethers.js and provides a type-safe interface to interact with the USDFC smart contracts. It abstracts away the complexity of direct contract interactions and provides a more developer-friendly API.
Installation
The USDFC SDK packages are hosted on GitHub Packages registry, not the public NPM registry. You'll need to configure your .npmrc file to access them:
# Add this to your .npmrc file
@secured-finance:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
# Then install the individual packages
npm install @secured-finance/stablecoin-lib-ethers
npm install @secured-finance/stablecoin-lib-react
npm install @secured-finance/stablecoin-lib-baseFor more details on setting up authentication for GitHub Packages, see the GitHub documentation.
Key Components
The USDFC SDK consists of several packages:
lib-ethers
The core package for interacting with the USDFC protocol using ethers.js.
lib-react
React hooks and components for building USDFC-integrated web applications.
Basic Usage
Connecting to the Protocol
Reading Protocol State
Creating and Managing Troves
Stability Pool Operations
Redemption Operations
Liquidation Operations
Advanced Usage
React Integration
Examples
Creating a Trove and Minting USDFC
Monitoring Liquidation Risk
FAQ
How do I handle transaction errors?
The SDK throws descriptive error objects that contain information about the failure. Wrap your transactions in try-catch blocks to handle errors gracefully.
How do I monitor protocol events?
Use the block-polled store to automatically update your application state when protocol events occur.
What networks does the SDK support?
The SDK supports the Filecoin network, which is the only network where the USDFC protocol is deployed. The USDFC protocol is not available on Ethereum or Arbitrum networks.
Related Resources
Last updated
Was this helpful?