@origintrail-official/dkg-chain
v0.0.1-dev.1773614346.8bc4e9c
Published
Blockchain abstraction layer for DKG V9. Provides a `ChainAdapter` interface with implementations for EVM chains and testing.
Downloads
503
Readme
@origintrail-official/dkg-chain
Blockchain abstraction layer for DKG V9. Provides a ChainAdapter interface with implementations for EVM chains and testing.
Features
- ChainAdapter interface — unified API for on-chain operations (KC creation, paranet management, staking, token transfers)
- EVMChainAdapter — production adapter using ethers.js to interact with deployed DKG smart contracts on EVM chains (Base Sepolia, etc.)
- MockChainAdapter — in-memory mock for unit and integration testing without a blockchain
- NoChainAdapter — no-op adapter for workspace/feeless publishing mode where chain interaction is not needed
Usage
import { EVMChainAdapter } from '@origintrail-official/dkg-chain';
const chain = new EVMChainAdapter({
rpcUrl: 'https://sepolia.base.org',
privateKey: process.env.PRIVATE_KEY,
hubAddress: '0x...',
});
const tx = await chain.createKnowledgeCollection(merkleRoot, size, epochs);Internal Dependencies
@origintrail-official/dkg-core— configuration types, logging@origintrail-official/dkg-evm-module— contract ABIs for DKG smart contracts
