@venturialstd/inbestgo
v0.0.4
Published
Inbestgo Integration Module for Venturial
Downloads
398
Keywords
Readme
@venturialstd/inbestgo
Inbestgo Integration Module for Venturial - A NestJS module for integrating with the Inbestgo investment platform API.
Overview
This module provides seamless integration with the Inbestgo API, allowing you to:
- Lookup and manage user information by phone number
- Create and track investment transactions
- Manage user KYC status
- Track transaction history and status
Installation
npm install @venturialstd/inbestgoUsage
Import the Module
import { Module } from '@nestjs/common';
import { InbestgoModule } from '@venturialstd/inbestgo';
@Module({
imports: [InbestgoModule],
})
export class AppModule {}Using Services
InbestgoUserService
import { InbestgoUserService, INBESTGO_ENVIRONMENTS } from '@venturialstd/inbestgo';
@Injectable()
export class YourService {
constructor(private readonly inbestgoUserService: InbestgoUserService) {}
async lookupUser(phoneNumber: string) {
const user = await this.inbestgoUserService.lookupUserByPhone(
phoneNumber,
'your-api-key',
INBESTGO_ENVIRONMENTS.SANDBOX
);
return user;
}
async getOrCreateUser(phoneNumber: string) {
const user = await this.inbestgoUserService.getOrCreate(
phoneNumber,
'your-api-key',
INBESTGO_ENVIRONMENTS.SANDBOX
);
return user;
}
}InbestgoTransactionService
import { InbestgoTransactionService, INBESTGO_ENVIRONMENTS } from '@venturialstd/inbestgo';
@Injectable()
export class YourService {
constructor(
private readonly inbestgoTransactionService: InbestgoTransactionService
) {}
async createTransaction() {
const transaction = await this.inbestgoTransactionService.createTransaction(
'+1234567890',
'transaction-id',
'0xabcdef...',
'ethereum',
'USDC',
'100.00',
'your-api-key',
INBESTGO_ENVIRONMENTS.SANDBOX
);
return transaction;
}
}Entities
InbestgoUser
id: Database UUIDinbestgoUserId: Inbestgo platform user IDfirstName: User's first namelastName: User's last nameemail: User's email addressphoneNumber: User's phone numberstatus: User status (NOT_REGISTERED, CREATED, KYC_INITIATED, KYC_COMPLETED)createdAt: Creation timestampupdatedAt: Last update timestamp
InbestgoTransaction
id: Database UUIDinbestgoUserId: Reference to InbestgoUsertransactionId: Unique transaction identifiertxHash: Blockchain transaction hashblockchain: Blockchain network nameamount: Transaction amounttoken: Token symbolstatus: Transaction status (INITIATED, SUCCEEDED, FAILED)description: Optional descriptioncreatedAt: Creation timestampupdatedAt: Last update timestamp
Constants
INBESTGO_ENVIRONMENTS
enum INBESTGO_ENVIRONMENTS {
SANDBOX = 'SANDBOX',
PRODUCTION = 'PRODUCTION',
}INBESTGO_USER_STATUS
enum INBESTGO_USER_STATUS {
NOT_REGISTERED = 'NOT_REGISTERED',
CREATED = 'CREATED',
KYC_INITIATED = 'KYC_INITIATED',
KYC_COMPLETED = 'KYC_COMPLETED',
}INBESTGO_TRANSACTION_STATUS
enum INBESTGO_TRANSACTION_STATUS {
INITIATED = 'INITIATED',
SUCCEEDED = 'SUCCEEDED',
FAILED = 'FAILED',
}Configuration
The module requires TypeORM configuration with the InbestgoUser and InbestgoTransaction entities included.
API Endpoints Used
GET /ommacash/user?phoneNumber={phone}- Lookup user by phone numberPOST /ommacash/transactions- Create transaction
Dependencies
@nestjs/common@nestjs/typeorm@nestjs/axios@venturialstd/core@dataui/crud-typeormtypeormclass-validatorclass-transformer
License
MIT
