sfi-liquidity-sdk
v0.1.0
Published
ABIs and chain deployments for the SFI modular DynaLiquidity framework
Downloads
156
Maintainers
Readme
sfi-liquidity-sdk
ABIs and verified chain deployments for the SFI modular DynaLiquidity framework. The package has no runtime dependencies and supports TypeScript, ESM, and CommonJS.
Install
npm install sfi-liquidity-sdkImport an ABI
import { DynaLiquidityABI, DynaLiquidityRegistryABI } from "sfi-liquidity-sdk";Every production DynaLiquidity ABI is available as <ContractName>ABI. ABIs can also be selected dynamically:
import { contractAbis, getContractABI } from "sfi-liquidity-sdk/abis";
const registryABI = getContractABI("DynaLiquidityRegistry");
const liquidityABI = contractAbis.DynaLiquidity;Resolve a registry deployment
import {
ChainId,
getDynaLiquidityRegistryAddress,
requireDynaLiquidityRegistryAddress,
dynaLiquidityRegistryAddresses,
} from "sfi-liquidity-sdk/chains";
const baseRegistry = dynaLiquidityRegistryAddresses[ChainId.BASE];
// Returns undefined when the framework is not deployed on the chain.
const optionalRegistry = getDynaLiquidityRegistryAddress(chainId);
// Throws when the chain is unsupported.
const registry = requireDynaLiquidityRegistryAddress(chainId);Use the ABI and preconfigured address with ethers:
import { Contract } from "ethers";
import {
DynaLiquidityRegistryABI,
requireDynaLiquidityRegistryAddress,
} from "sfi-liquidity-sdk";
const registry = new Contract(
requireDynaLiquidityRegistryAddress(chainId),
DynaLiquidityRegistryABI,
provider,
);Or with viem:
import { getContract } from "viem";
import {
DynaLiquidityRegistryABI,
requireDynaLiquidityRegistryAddress,
} from "sfi-liquidity-sdk";
const registry = getContract({
address: requireDynaLiquidityRegistryAddress(client.chain.id),
abi: DynaLiquidityRegistryABI,
client,
});Supported deployments
| Chain | Chain ID | DynaLiquidityRegistry |
| ----- | -------: | -------------------------------------------- |
| Base | 8453 | 0x82f22418DE1b9B30E04aFc0cE303cf7EbE8d1674 |
Only deployments recorded by the DynaVaults production deployment and verified to contain registry contract bytecode are included. Unsupported chains return undefined from non-throwing lookup functions.
Exported ABIs
DynaLiquidityABIDynaLiquidityAssetManagerLibABIDynaLiquidityFactoryABIDynaLiquidityLibABIDynaLiquidityProxyAssetManagerABIDynaLiquidityRegistryABILiquidityArbitrageABI
