Installation

Learn how to install and set up the Moromoro SDK in your project.

Prerequisites

Before installing the Moromoro SDK, ensure you have:

  • Node.js: Version 14.0 or higher

  • Package Manager: npm or yarn

  • ethers.js: Version 5.4.0 or higher (will be installed automatically)

Installation Methods

npm install @moromoro/moro-sdk ethers

Verify Installation

After installation, verify that the package is installed correctly:

const { MoroBestRate } = require('@moromoro/moro-sdk')
console.log('Moromoro SDK loaded successfully!')

Or in TypeScript/ES6:

import { MoroBestRate } from '@moromoro/moro-sdk'
console.log('Moromoro SDK loaded successfully!')

Package Contents

The installed package includes:

  • Main Library: Pre-built JavaScript bundles

  • TypeScript Definitions: Full type definitions for TypeScript support

  • ES Modules: ES module builds for modern bundlers

Dependencies

The SDK has the following dependencies:

Required Dependencies

  • ethers: ^5.7.2 - Ethereum library for interacting with the blockchain

Peer Dependencies

The SDK works with:

  • Node.js 14+

  • Modern browsers (Chrome, Firefox, Safari, Edge)

TypeScript Support

The SDK is written in TypeScript and includes full type definitions. No additional @types packages are needed.

TypeScript Configuration

Ensure your tsconfig.json includes:

Browser Support

The SDK can be used in browser environments with bundlers like:

  • Webpack

  • Vite

  • Rollup

  • Parcel

Webpack Configuration

If using Webpack 5, add polyfills for Node.js core modules:

Vite Configuration

For Vite projects:

Framework Integration

React

Next.js

Vue.js

Environment Setup

Environment Variables

Create a .env file for your configuration:

Using dotenv

Updating the SDK

Check Current Version

Update to Latest Version

Install Specific Version

Troubleshooting

Issue: Module not found

Solution: Clear cache and reinstall

Issue: TypeScript errors

Solution: Ensure TypeScript version compatibility

Issue: ethers.js version mismatch

Solution: Install compatible ethers.js version

Next Steps

Now that you have installed the SDK, proceed to:

Getting Help

If you encounter issues during installation:

Last updated