@morambacrypto/connect
v0.0.26
Published
This library use for interact with moramba-crypto project
Readme
Moramba Crypto: Connect
A Node.js client library for interacting with the Moramba Crypto API to create and manage JWT tokens for authentication and moramba-crypto feature.
Installation
npm install @morambacrypto/connectRequirements
- Node.js 16+
- Valid API key and Partner ID
- Stable internet connection
Usage
Basic Setup
import { MorambaClient } from "@morambacrypto/connect";
const client = new MorambaClient({
baseURL: "https://crypto.moramba.io",
apiKey: "abcd123",
partnerId: "partner_001",
});Creating a JWT Token
const response = await client.auth.createJwtToken({ userid: "[email protected]" });
console.log(response.data.token);Creating a Company
import { MorambaClient } from "@morambacrypto/connect";
const client = new MorambaClient({
baseURL: "https://crypto.moramba.io",
apiKey: process.env.API_KEY!,
partnerId: process.env.PARTNER_ID!,
});
// STEP 1 — Get JWT token
const jwt = await client.auth.createJwtToken({ userid: "[email protected]" });
const token = jwt.data.token;
// STEP 2 — Create company
const company = await client.company.createCompany(
{
payment_method: {
network: "monad",
token: "moramba",
address: "0x62F6c82114809C00a1293be02A43C05a3F917202"
},
name: "Aeropres",
email: "[email protected]",
},
token
);
console.log(company);
signature process
await monadApprove({
privateKey: "0xYOUR_PRIVATE_KEY",
unlimited: false,
amount: "2500",
});API Reference
MorambaClient
The main client class for interacting with the Moramba Crypto API.
Constructor Options
baseURL(string): The base URL for the API (default: "https://crypto.moramba.io")apiKey(string): Your API keypartnerId(string): Your partner ID
Methods
client.auth.createJwtToken(options)
Creates a JWT token for authentication.
Parameters:
options.userid(string): User identifier (email)options.partner_id(string): Your partner IDoptions.api_key(string): Your API key
Configuration
Make sure to keep your API credentials secure. Consider using environment variables:
const client = new MorambaClient({
baseURL: "https://crypto.moramba.io",
apiKey: process.env.MORAMBA_API_KEY,
partnerId: process.env.MORAMBA_PARTNER_ID
});Package Information
- Version: 0.0.4
- License: MIT
- Package Size: 3.56 kB
- Total Files: 18
Support
For issues and questions, please visit the moramba.xyz .
Documentation
For complete API documentation, visit API Documentation
License
MIT
Made with ❤️ by Moramba Crypto
