tea-berry
v1.1.4
Published
connecting the EVM-based blockchain to the Cosmos chain
Downloads
3
Readme
Tea-Berry: Bridging EVM and Cosmos
Tea-Berry is an innovative NPM package that harmoniously connects the EVM-based blockchain (think Ethereum) with the Cosmos chain. Imagine it as a delightful blend of your favorite tea and the sweet tanginess of berries—bringing together the best of both worlds.
Features 🌟
- Interoperability: Seamlessly transfer assets and data between EVM and Cosmos.
- Smart Contract Harmony: Execute EVM smart contracts on the Cosmos chain and vice versa.
- State Synchronization: Keep your chai (state) consistent across the two realms.
- Easy Brewing: Simple APIs for developers to stir into their projects.
Installation 🚀
Install the package using NPM:
npm install tea-berry
Usage 🍵
Connecting EVM to Cosmos
const { TeaBerry } = require('tea-berry');
// Initialize the connector
const connector = new TeaBerry({
evmNodeUrl: 'https://ethereum-node-url',
cosmosNodeUrl: 'https://cosmos-node-url',
privateKey: 'your-private-key',
});
// Listen for EVM transactions
connector.onEvmTransaction((txData) => {
// Translate EVM transaction data to Cosmos format
const cosmosTx = translateToCosmosFormat(txData);
// Sign and broadcast the Cosmos transaction
connector.sendCosmosTransaction(cosmosTx);
});
Connecting Cosmos to EVM
// Listen for Cosmos transactions
connector.onCosmosTransaction((cosmosTx) => {
// Translate Cosmos transaction data to EVM format
const evmTx = translateToEvmFormat(cosmosTx);
// Execute the EVM transaction
connector.sendEvmTransaction(evmTx);
});
Examples 🌿
Check out the examples directory for aromatic usage samples.
Contributing 🌱
Contributions are steeped to perfection! Please follow our contribution guidelines.
License 🍓
This project is licensed under the MIT License—sip responsibly!