@0xmonaco/contracts
Smart contract ABIs and sweeper deposit-address helpers for the Monaco protocol. Resolve deployed addresses, such as the vault, through the Monaco SDK.
Installation
npm install @0xmonaco/contracts
Note: This package is typically installed as a dependency of @0xmonaco/core or @0xmonaco/types, but you can install it directly if you only need contract ABIs.
Usage
Contract ABIs
Use CONTRACT_ABIS with the vault address the Monaco SDK resolves for the network:
import { CONTRACT_ABIS } from "@0xmonaco/contracts";
import { createPublicClient, http } from "viem";
import { sei } from "viem/chains";
// Resolve the vault address from the Monaco SDK (Sei mainnet, chain ID 1329)
const vaultAddress = await sdk.vault.getVaultAddress();
const client = createPublicClient({
chain: sei,
transport: http("https://evm-rpc.sei-apis.com"),
});
const vaultContract = {
address: vaultAddress,
abi: CONTRACT_ABIS.vault,
client,
};
Contract Overview
Core Protocol Contracts
Vault
- Manages user balances and deposits
- Handles token transfers for trades
- Ensures secure fund management
Sweeper
- Per-(application, user) deposit addresses created through a CREATE2 factory
predictSweeperAddressand the related helpers derive an address before it is deployed
Network Support
- Sei mainnet (
pacific-1)- Chain ID: 1329
ABI Reference
The package exports a consolidated CONTRACT_ABIS object:
import { CONTRACT_ABIS } from "@0xmonaco/contracts";
const vaultAbi = CONTRACT_ABIS.vault;
Available ABIs in CONTRACT_ABIS:
vault: Vault contract interfacesweeper: Per-(application, user) sweeper deposit address interfacesweeperFactory: CREATE2 sweeper factory interface
Development
Adding New Contracts
- Create a new file in
src/abis/for the contract ABI - Export the ABI as a named constant
- Add the export to
src/abis/index.ts - Add the ABI to
CONTRACT_ABISinsrc/index.ts
Best Practices
- Keep ABIs up to date with deployed contracts
- Document any breaking changes
- Maintain backward compatibility when possible